死冰封 2016-10-17 18:15 采纳率: 0%
浏览 1534

有关GMAC驱动源码define的一个小问题。

 #ifndef SYNOP_GMAC_DEV_H
#define SYNOP_GMAC_DEV_H 1

#include "synopGMAC_plat.h"

/*SynopGMAC can support up to 32 phys*/

enum GMACPhyBase
{
    PHY0  = 0,          //The device can support 32 phys, but we use first phy only
    PHY1  = 1,
    PHY31 = 31,
};

#define DEFAULT_PHY_BASE PHY0       //We use First Phy 
#define MACBASE 0x0000          // The Mac Base address offset is 0x0000
#define DMABASE 0x1000          // Dma base address starts with an offset 0x1000

#ifdef AVB_SUPPORT
#define DMABASE_CH0 DMABASE     // DMA base address for Channel 0
#define DMABASE_CH1 0x1100      // DMA base address for Channel 1
#define DMABASE_CH2 0x1200      // DMA base address for Channel 2

#define ETHERNET_HEADER_AVB     18  //6 byte Dest addr, 6 byte Src addr, 2 byte length/type

#endif


//#define TRANSMIT_DESC_SIZE  256   //Tx Descriptors needed in the Descriptor pool/queue
//#define RECEIVE_DESC_SIZE   256   //Rx Descriptors needed in the Descriptor pool/queue
#define TRANSMIT_DESC_SIZE  12//256 //Tx Descriptors needed in the Descriptor pool/queue
#define RECEIVE_DESC_SIZE   12//256 //Rx Descriptors needed in the Descriptor pool/queue

#define ETHERNET_HEADER             14  //6 byte Dest addr, 6 byte Src addr, 2 byte length/type
#define ETHERNET_CRC                 4  //Ethernet CRC
#define ETHERNET_EXTRA           2  //Only God knows about this?????
#define ETHERNET_PACKET_COPY       250  // Maximum length when received data is copied on to a new skb  
#define ETHERNET_PACKET_EXTRA       18  // Preallocated length for the rx packets is MTU + ETHERNET_PACKET_EXTRA  
#define VLAN_TAG             4  //optional 802.1q VLAN Tag
#define MIN_ETHERNET_PAYLOAD        46  //Minimum Ethernet payload size
#define MAX_ETHERNET_PAYLOAD      1500  //Maximum Ethernet payload size
#define JUMBO_FRAME_PAYLOAD       9000  //Jumbo frame payload size

#define TX_BUF_SIZE        ETHERNET_HEADER + ETHERNET_CRC + MAX_ETHERNET_PAYLOAD + VLAN_TAG

先上一小段代码,最前面 ifdef AVB_SUPPORT那段, ETHERNET_HEADER_AVB定义的试18, 下面普通的ETHERNET_HEADER定义的试14

这4个byte的差别是什么? 源码的注释没有写差别在哪儿。

还有如果能详细的解释下AVB的三个channel都是做什么的就更好了。 多谢~

  • 写回答

1条回答 默认 最新

  • dabocaiqq 2017-02-04 15:54
    关注
    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog