drivers/net/ethernet/toshiba/ps3_gelic_net.h

Source file repositories/reference/linux-study-clean/drivers/net/ethernet/toshiba/ps3_gelic_net.h

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/toshiba/ps3_gelic_net.h
Extension
.h
Size
11613 bytes
Lines
373
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 gelic_hw_regs {
	struct  {
		__be32 dev_addr;
		__be32 size;
	} __packed payload;
	__be32 next_descr_addr;
	__be32 dmac_cmd_status;
	__be32 result_size;
	__be32 valid_size;	/* all zeroes for tx */
	__be32 data_status;
	__be32 data_error;	/* all zeroes for tx */
} __packed;

struct gelic_chain_link {
	dma_addr_t cpu_addr;
	unsigned int size;
};

struct gelic_descr {
	struct gelic_hw_regs hw_regs;
	struct gelic_chain_link link;
	struct sk_buff *skb;
	struct gelic_descr *next;
	struct gelic_descr *prev;
} __attribute__((aligned(32)));

struct gelic_descr_chain {
	/* we walk from tail to head */
	struct gelic_descr *head;
	struct gelic_descr *tail;
};

struct gelic_vlan_id {
	u16 tx;
	u16 rx;
};

struct gelic_card {
	struct napi_struct napi;
	struct net_device *netdev[GELIC_PORT_MAX];
	struct timer_list rx_oom_timer;
	/*
	 * hypervisor requires irq_status should be
	 * 8 bytes aligned, but u64 member is
	 * always disposed in that manner
	 */
	u64 irq_status;
	u64 irq_mask;

	struct ps3_system_bus_device *dev;
	struct gelic_vlan_id vlan[GELIC_PORT_MAX];
	int vlan_required;

	struct gelic_descr_chain tx_chain;
	struct gelic_descr_chain rx_chain;
	/*
	 * tx_lock guards tx descriptor list and
	 * tx_dma_progress.
	 */
	spinlock_t tx_lock;
	int tx_dma_progress;

	struct work_struct tx_timeout_task;
	atomic_t tx_timeout_task_counter;
	wait_queue_head_t waitq;

	/* only first user should up the card */
	struct mutex updown_lock;
	atomic_t users;

	u64 ether_port_status;
	int link_mode;

	/* original address returned by kzalloc */
	void *unalign;

	/*
	 * each netdevice has copy of irq
	 */
	unsigned int irq;
	struct gelic_descr *tx_top, *rx_top;
	struct gelic_descr descr[]; /* must be the last */
};

struct gelic_port {
	struct gelic_card *card;
	struct net_device *netdev;
	enum gelic_port_type type;
	long priv[]; /* long for alignment */
};

Annotation

Implementation Notes