#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都是做什么的就更好了。 多谢~