include/linux/wwan.h
Source file repositories/reference/linux-study-clean/include/linux/wwan.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/wwan.h- Extension
.h- Size
- 6219 bytes
- Lines
- 208
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/poll.hlinux/netdevice.hlinux/types.h
Detected Declarations
struct devicestruct filestruct netlink_ext_ackstruct sk_buffstruct wwan_portstruct wwan_port_opsstruct wwan_port_capsstruct wwan_netdev_privstruct wwan_opsenum wwan_port_typefunction wwan_put_debugfs_dir
Annotated Snippet
struct wwan_port_ops {
int (*start)(struct wwan_port *port);
void (*stop)(struct wwan_port *port);
int (*tx)(struct wwan_port *port, struct sk_buff *skb);
/* Optional operations */
int (*tx_blocking)(struct wwan_port *port, struct sk_buff *skb);
__poll_t (*tx_poll)(struct wwan_port *port, struct file *filp,
poll_table *wait);
};
/** struct wwan_port_caps - The WWAN port capbilities
* @frag_len: WWAN port TX fragments length
* @headroom_len: WWAN port TX fragments reserved headroom length
*/
struct wwan_port_caps {
size_t frag_len;
unsigned int headroom_len;
};
/**
* wwan_create_port - Add a new WWAN port
* @parent: Device to use as parent and shared by all WWAN ports
* @type: WWAN port type
* @ops: WWAN port operations
* @caps: WWAN port capabilities
* @drvdata: Pointer to caller driver data
*
* Allocate and register a new WWAN port. The port will be automatically exposed
* to user as a character device and attached to the right virtual WWAN device,
* based on the parent pointer. The parent pointer is the device shared by all
* components of a same WWAN modem (e.g. USB dev, PCI dev, MHI controller...).
*
* drvdata will be placed in the WWAN port device driver data and can be
* retrieved with wwan_port_get_drvdata().
*
* This function must be balanced with a call to wwan_remove_port().
*
* Returns: a valid pointer to wwan_port on success or PTR_ERR on failure
*/
struct wwan_port *wwan_create_port(struct device *parent,
enum wwan_port_type type,
const struct wwan_port_ops *ops,
struct wwan_port_caps *caps,
void *drvdata);
/**
* wwan_remove_port - Remove a WWAN port
* @port: WWAN port to remove
*
* Remove a previously created port.
*/
void wwan_remove_port(struct wwan_port *port);
/**
* wwan_port_rx - Receive data from the WWAN port
* @port: WWAN port for which data is received
* @skb: Pointer to the rx buffer
*
* A port driver calls this function upon data reception (MBIM, AT...).
*/
void wwan_port_rx(struct wwan_port *port, struct sk_buff *skb);
/**
* wwan_port_txoff - Stop TX on WWAN port
* @port: WWAN port for which TX must be stopped
*
* Used for TX flow control, a port driver calls this function to indicate TX
* is temporary unavailable (e.g. due to ring buffer fullness).
*/
void wwan_port_txoff(struct wwan_port *port);
/**
* wwan_port_txon - Restart TX on WWAN port
* @port: WWAN port for which TX must be restarted
*
* Used for TX flow control, a port driver calls this function to indicate TX
* is available again.
*/
void wwan_port_txon(struct wwan_port *port);
/**
* wwan_port_get_drvdata - Retrieve driver data from a WWAN port
* @port: Related WWAN port
*/
void *wwan_port_get_drvdata(struct wwan_port *port);
/**
* struct wwan_netdev_priv - WWAN core network device private data
Annotation
- Immediate include surface: `linux/poll.h`, `linux/netdevice.h`, `linux/types.h`.
- Detected declarations: `struct device`, `struct file`, `struct netlink_ext_ack`, `struct sk_buff`, `struct wwan_port`, `struct wwan_port_ops`, `struct wwan_port_caps`, `struct wwan_netdev_priv`, `struct wwan_ops`, `enum wwan_port_type`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.