阅读:1137回复:0
网卡adapter结构定义的问题
各位大虾,小弟现在做8139芯片网卡驱动.前些时候下载\"源代码及分析\"之\"nic driver(rtl8139&sis900 for win2k)\"程序,读到rtl8139中有如下一个定义:
typedef struct tagADAPTER{ NDIS_HANDLE MiniportAdapterHandle; NDIS_HANDLE WrapperConfigurationContext; UCHAR NetworkAddress[6]; UCHAR mc_filter[8]; ULONG PacketFilter; PUCHAR ioaddr; //i/o ULONG BaseIO; NDIS_MINIPORT_INTERRUPT IntObj; //irq ULONG IRQLevel; ULONG IRQVector; ULONG IRQAffinity; USHORT IRQMode; PUCHAR tx_bufs; // TX_BUF_SIZE * NUM_OF_DESC NDIS_PHYSICAL_ADDRESS tx_bufs_dma; //2.接收: PUCHAR rx_ring; NDIS_PHYSICAL_ADDRESS rx_ring_dma; USHORT read_ptr; PUCHAR rx_bufs; NDIS_PHYSICAL_ADDRESS rx_bufs_dma; //packet,buffer & pool NDIS_HANDLE pkt_pool; NDIS_HANDLE buf_pool; PNDIS_PACKET pkt_desc[NUM_OF_PACKETS]; PNDIS_BUFFER buf_desc[NUM_OF_PACKETS]; UINT FreeRxPkt, FreeTxDesc; UINT cur_rx, cur_tx, dirty_tx, dirty_rx; //isr status USHORT curISR; // ULONG ERR_COUNT; ULONG XMIT_OK, XMIT_ERR; ULONG RCV_OK, RCV_ERR; ULONG RCV_NO_BUFFER; ULONG rev_byte, xmit_byte; char twistie, twist_row, twist_col; /* Twister tune state. */ }ADAPTER, *PADAPTER; 这是一个适配器结构的定义,可是我却不知道它是依据什么来定义的,我查阅了它的芯片资料和编程手册,但发现根本找不到.望高手指点迷津,让迷途人早日回归正路!!!谢谢 |
|