drivers/net/ethernet/3com/typhoon.h

Source file repositories/reference/linux-study-clean/drivers/net/ethernet/3com/typhoon.h

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/3com/typhoon.h
Extension
.h
Size
21430 bytes
Lines
625
Domain
Driver Families
Bucket
drivers/net
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct basic_ring {
	u8 *ringBase;
	u32 lastWrite;
};

/* The Typhoon transmit ring -- same as a basic ring, plus:
 * lastRead:      where we're at in regard to cleaning up the ring
 * writeRegister: register to use for writing (different for Hi & Lo rings)
 */
struct transmit_ring {
	u8 *ringBase;
	u32 lastWrite;
	u32 lastRead;
	int writeRegister;
};

/* The host<->Typhoon ring index structure
 * This indicates the current positions in the rings
 *
 * All values must be in little endian format for the 3XP
 *
 * rxHiCleared:   entry we've cleared to in the Hi receive ring
 * rxLoCleared:   entry we've cleared to in the Lo receive ring
 * rxBuffReady:   next entry we'll put a free buffer in
 * respCleared:   entry we've cleared to in the response ring
 *
 * txLoCleared:   entry the NIC has cleared to in the Lo transmit ring
 * txHiCleared:   entry the NIC has cleared to in the Hi transmit ring
 * rxLoReady:     entry the NIC has filled to in the Lo receive ring
 * rxBuffCleared: entry the NIC has cleared in the free buffer ring
 * cmdCleared:    entry the NIC has cleared in the command ring
 * respReady:     entry the NIC has filled to in the response ring
 * rxHiReady:     entry the NIC has filled to in the Hi receive ring
 */
struct typhoon_indexes {
	/* The first four are written by the host, and read by the NIC */
	volatile __le32 rxHiCleared;
	volatile __le32 rxLoCleared;
	volatile __le32 rxBuffReady;
	volatile __le32 respCleared;

	/* The remaining are written by the NIC, and read by the host */
	volatile __le32 txLoCleared;
	volatile __le32 txHiCleared;
	volatile __le32 rxLoReady;
	volatile __le32 rxBuffCleared;
	volatile __le32 cmdCleared;
	volatile __le32 respReady;
	volatile __le32 rxHiReady;
} __packed;

/* The host<->Typhoon interface
 * Our means of communicating where things are
 *
 * All values must be in little endian format for the 3XP
 *
 * ringIndex:   64 bit bus address of the index structure
 * txLoAddr:    64 bit bus address of the Lo transmit ring
 * txLoSize:    size (in bytes) of the Lo transmit ring
 * txHi*:       as above for the Hi priority transmit ring
 * rxLo*:       as above for the Lo priority receive ring
 * rxBuff*:     as above for the free buffer ring
 * cmd*:        as above for the command ring
 * resp*:       as above for the response ring
 * zeroAddr:    64 bit bus address of a zero word (for DMA)
 * rxHi*:       as above for the Hi Priority receive ring
 *
 * While there is room for 64 bit addresses, current versions of the 3XP
 * only do 32 bit addresses, so the *Hi for each of the above will always
 * be zero.
 */
struct typhoon_interface {
	__le32 ringIndex;
	__le32 ringIndexHi;
	__le32 txLoAddr;
	__le32 txLoAddrHi;
	__le32 txLoSize;
	__le32 txHiAddr;
	__le32 txHiAddrHi;
	__le32 txHiSize;
	__le32 rxLoAddr;
	__le32 rxLoAddrHi;
	__le32 rxLoSize;
	__le32 rxBuffAddr;
	__le32 rxBuffAddrHi;
	__le32 rxBuffSize;
	__le32 cmdAddr;
	__le32 cmdAddrHi;
	__le32 cmdSize;
	__le32 respAddr;

Annotation

Implementation Notes