drivers/net/ethernet/ibm/ibmveth.h

Source file repositories/reference/linux-study-clean/drivers/net/ethernet/ibm/ibmveth.h

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/ibm/ibmveth.h
Extension
.h
Size
7192 bytes
Lines
240
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 ibmveth_buff_pool {
    u32 size;
    u32 index;
    u32 buff_size;
    u32 threshold;
    atomic_t available;
    u32 consumer_index;
    u32 producer_index;
    u16 *free_map;
    dma_addr_t *dma_addr;
    struct sk_buff **skbuff;
    int active;
    struct kobject kobj;
};

struct ibmveth_rx_q {
    u64        index;
    u64        num_slots;
    u64        toggle;
    dma_addr_t queue_dma;
    u32        queue_len;
    struct ibmveth_rx_q_entry *queue_addr;
};

struct ibmveth_adapter {
	struct vio_dev *vdev;
	struct net_device *netdev;
	struct napi_struct napi;
	struct work_struct work;
	unsigned int mcastFilterSize;
	void *buffer_list_addr;
	void *filter_list_addr;
	void *tx_ltb_ptr[IBMVETH_MAX_QUEUES];
	unsigned int tx_ltb_size;
	dma_addr_t tx_ltb_dma[IBMVETH_MAX_QUEUES];
	dma_addr_t buffer_list_dma;
	dma_addr_t filter_list_dma;
	struct ibmveth_buff_pool rx_buff_pool[IBMVETH_NUM_BUFF_POOLS];
	struct ibmveth_rx_q rx_queue;
	int rx_csum;
	int large_send;
	bool is_active_trunk;
	unsigned int rx_buffers_per_hcall;

	u64 fw_ipv6_csum_support;
	u64 fw_ipv4_csum_support;
	u64 fw_large_send_support;
	/* adapter specific stats */
	u64 replenish_task_cycles;
	u64 replenish_no_mem;
	u64 replenish_add_buff_failure;
	u64 replenish_add_buff_success;
	u64 rx_invalid_buffer;
	u64 rx_no_buffer;
	u64 tx_map_failed;
	u64 tx_send_failed;
	u64 tx_large_packets;
	u64 rx_large_packets;
	/* Ethtool settings */
	u8 duplex;
	u32 speed;
};

/*
 * We pass struct ibmveth_buf_desc_fields to the hypervisor in registers,
 * so we don't need to byteswap the two elements. However since we use
 * a union (ibmveth_buf_desc) to convert from the struct to a u64 we
 * do end up with endian specific ordering of the elements and that
 * needs correcting.
 */
struct ibmveth_buf_desc_fields {
#ifdef __BIG_ENDIAN
	u32 flags_len;
	u32 address;
#else
	u32 address;
	u32 flags_len;
#endif
#define IBMVETH_BUF_VALID	0x80000000
#define IBMVETH_BUF_TOGGLE	0x40000000
#define IBMVETH_BUF_LRG_SND     0x04000000
#define IBMVETH_BUF_NO_CSUM	0x02000000
#define IBMVETH_BUF_CSUM_GOOD	0x01000000
#define IBMVETH_BUF_LEN_MASK	0x00FFFFFF
};

union ibmveth_buf_desc {
    u64 desc;
    struct ibmveth_buf_desc_fields fields;
};

Annotation

Implementation Notes