drivers/net/wwan/iosm/iosm_ipc_pcie.h

Source file repositories/reference/linux-study-clean/drivers/net/wwan/iosm/iosm_ipc_pcie.h

File Facts

System
Linux kernel
Corpus path
drivers/net/wwan/iosm/iosm_ipc_pcie.h
Extension
.h
Size
6407 bytes
Lines
211
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 iosm_pcie {
	struct pci_dev *pci;
	struct device *dev;
	void __iomem *ipc_regs;
	void __iomem *scratchpad;
	struct iosm_imem *imem;
	int ipc_regs_bar_nr;
	int scratchpad_bar_nr;
	int nvec;
	u32 doorbell_reg_offset;
	u32 doorbell_write;
	u32 doorbell_capture;
	unsigned long suspend;
	enum ipc_pcie_sleep_state d3l2_support;
};

/**
 * struct ipc_skb_cb - Struct definition of the socket buffer which is mapped to
 *		       the cb field of sbk
 * @mapping:	Store physical or IOVA mapped address of skb virtual add.
 * @direction:	DMA direction
 * @len:	Length of the DMA mapped region
 * @op_type:    Expected values are defined about enum ipc_ul_usr_op.
 */
struct ipc_skb_cb {
	dma_addr_t mapping;
	int direction;
	int len;
	u8 op_type;
};

/**
 * enum ipc_ul_usr_op - Control operation to execute the right action on
 *			the user interface.
 * @UL_USR_OP_BLOCKED:	The uplink app was blocked until CP confirms that the
 *			uplink buffer was consumed triggered by the IRQ.
 * @UL_MUX_OP_ADB:	In MUX mode the UL ADB shall be addedd to the free list.
 * @UL_DEFAULT:		SKB in non muxing mode
 */
enum ipc_ul_usr_op {
	UL_USR_OP_BLOCKED,
	UL_MUX_OP_ADB,
	UL_DEFAULT,
};

/**
 * ipc_pcie_addr_map - Maps the kernel's virtual address to either IOVA
 *		       address space or Physical address space, the mapping is
 *		       stored in the skb's cb.
 * @ipc_pcie:	Pointer to struct iosm_pcie
 * @data:	Skb mem containing data
 * @size:	Data size
 * @mapping:	Dma mapping address
 * @direction:	Data direction
 *
 * Returns: 0 on success and failure value on error
 */
int ipc_pcie_addr_map(struct iosm_pcie *ipc_pcie, unsigned char *data,
		      size_t size, dma_addr_t *mapping, int direction);

/**
 * ipc_pcie_addr_unmap - Unmaps the skb memory region from IOVA address space
 * @ipc_pcie:	Pointer to struct iosm_pcie
 * @size:	Data size
 * @mapping:	Dma mapping address
 * @direction:	Data direction
 */
void ipc_pcie_addr_unmap(struct iosm_pcie *ipc_pcie, size_t size,
			 dma_addr_t mapping, int direction);

/**
 * ipc_pcie_alloc_skb - Allocate an uplink SKB for the given size.
 * @ipc_pcie:	Pointer to struct iosm_pcie
 * @size:	Size of the SKB required.
 * @flags:	Allocation flags
 * @mapping:	Copies either mapped IOVA add. or converted Phy address
 * @direction:	DMA data direction
 * @headroom:	Header data offset
 *
 * Returns: Pointer to ipc_skb on Success, NULL on failure.
 */
struct sk_buff *ipc_pcie_alloc_skb(struct iosm_pcie *ipc_pcie, size_t size,
				   gfp_t flags, dma_addr_t *mapping,
				   int direction, size_t headroom);

/**
 * ipc_pcie_alloc_local_skb - Allocate a local SKB for the given size.
 * @ipc_pcie:	Pointer to struct iosm_pcie
 * @flags:	Allocation flags
 * @size:	Size of the SKB required.

Annotation

Implementation Notes