/* * This is the first field of the "visible" part of this structure * (i.e. as seen by users in the "Space.c" file). It is the name * the interface. */ char *name;
/* I/O specific fields - FIXME: Merge these and struct ifmap into one */
unsigned long rmem_end; /* shmem "recv" end */
unsigned long rmem_start; /* shmem "recv" start */
unsigned long mem_end; /* shared mem end */
unsigned long mem_start; /* shared mem start */
unsigned long base_addr; /* device I/O address */
unsigned char irq; /* device IRQ number */
/* Low-level status flags. */ volatile unsigned char start, /* start an operation */
interrupt; /* interrupt arrived */
/* 在處理中斷時interrupt設為1,處理完清0。 */ unsigned long tbusy; /* transmitter busy must be long for bitops */
struct device *next;
/* The device initialization function. Called only once. */ /* 指向驅動程式的初始化方法。 */ int (*init)(struct device *dev);
/* Some hardware also needs these fields, but they are not part of the usual set specified in Space.c. */ /* 一些硬體可以在一塊板上支援多個介面,可能用到if_port。 */ unsigned char if_port; /* Selectable AUI, TP,..*/
/* * This marks the end of the "visible" part of the structure. All * fields hereafter are internal to the system, and may change at * will (read: may be cleaned up at will). */
/* These may be needed for future network-power-down code. */ /* trans_start記錄最後一次成功發送的時間。可以用來確定硬體是否工作正常。 */ unsigned long trans_start; /* Time (in jiffies) of last Tx */
unsigned long last_rx; /* Time of last Rx */
/* flags裏面有很多內容,定義在include/linux/if.h裏。*/ unsigned short flags; /* interface flags (a la BSD) */
unsigned short family; /* address family ID (AF_INET) */
unsigned short metric; /* routing metric (not used) */
unsigned short mtu; /* interface MTU value */
/* type標明物理硬體的類型。主要說明硬體是否需要arp。定義在 include/linux/if_arp.h裏。 */ unsigned short type; /* interface hardware type */
/* 上層協定層根據hard_header_len在發送資料緩衝區前面預留硬體幀頭空間。*/
unsigned short hard_header_len; /* hardware hdr length */
/* priv指向驅動程式自己定義的一些參數。*/ void *priv; /* pointer to private data */