drivers/net/wwan/t7xx/t7xx_port.h

Source file repositories/reference/linux-study-clean/drivers/net/wwan/t7xx/t7xx_port.h

File Facts

System
Linux kernel
Corpus path
drivers/net/wwan/t7xx/t7xx_port.h
Extension
.h
Size
4378 bytes
Lines
154
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 port_ops {
	int (*init)(struct t7xx_port *port);
	int (*recv_skb)(struct t7xx_port *port, struct sk_buff *skb);
	void (*md_state_notify)(struct t7xx_port *port, unsigned int md_state);
	void (*uninit)(struct t7xx_port *port);
	int (*enable_chl)(struct t7xx_port *port);
	int (*disable_chl)(struct t7xx_port *port);
};

struct t7xx_port_conf {
	enum port_ch		tx_ch;
	enum port_ch		rx_ch;
	unsigned char		txq_index;
	unsigned char		rxq_index;
	unsigned char		txq_exp_index;
	unsigned char		rxq_exp_index;
	enum cldma_id		path_id;
	struct port_ops		*ops;
	char			*name;
	enum wwan_port_type	port_type;
	bool			debug;
};

struct t7xx_port {
	/* Members not initialized in definition */
	const struct t7xx_port_conf	*port_conf;
	struct t7xx_pci_dev		*t7xx_dev;
	struct device			*dev;
	u16				seq_nums[2];	/* TX/RX sequence numbers */
	atomic_t			usage_cnt;
	struct				list_head entry;
	struct				list_head queue_entry;
	/* TX and RX flows are asymmetric since ports are multiplexed on
	 * queues.
	 *
	 * TX: data blocks are sent directly to a queue. Each port
	 * does not maintain a TX list; instead, they only provide
	 * a wait_queue_head for blocking writes.
	 *
	 * RX: Each port uses a RX list to hold packets,
	 * allowing the modem to dispatch RX packet as quickly as possible.
	 */
	struct sk_buff_head		rx_skb_list;
	spinlock_t			port_update_lock; /* Protects port configuration */
	wait_queue_head_t		rx_wq;
	int				rx_length_th;
	bool				chan_enable;
	struct task_struct		*thread;
	union {
		struct {
			struct wwan_port		*wwan_port;
		} wwan;
		struct {
			struct rchan			*relaych;
		} log;
	};
};

int t7xx_get_port_mtu(struct t7xx_port *port);
struct sk_buff *t7xx_port_alloc_skb(int payload);
struct sk_buff *t7xx_ctrl_alloc_skb(int payload);
int t7xx_port_enqueue_skb(struct t7xx_port *port, struct sk_buff *skb);
int t7xx_port_send_skb(struct t7xx_port *port, struct sk_buff *skb, unsigned int pkt_header,
		       unsigned int ex_msg);
int t7xx_port_send_raw_skb(struct t7xx_port *port, struct sk_buff *skb);
int t7xx_port_send_ctl_skb(struct t7xx_port *port, struct sk_buff *skb, unsigned int msg,
			   unsigned int ex_msg);

#endif /* __T7XX_PORT_H__ */

Annotation

Implementation Notes