drivers/net/ipa/ipa_modem.c
Source file repositories/reference/linux-study-clean/drivers/net/ipa/ipa_modem.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ipa/ipa_modem.c- Extension
.c- Size
- 12318 bytes
- Lines
- 499
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern 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.
- 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.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/errno.hlinux/etherdevice.hlinux/if_arp.hlinux/if_rmnet.hlinux/netdevice.hlinux/pm_runtime.hlinux/skbuff.hnet/pkt_sched.hlinux/remoteproc/qcom_rproc.hipa.hipa_endpoint.hipa_mem.hipa_modem.hipa_smp2p.hipa_table.hipa_uc.h
Detected Declarations
struct ipa_privenum ipa_modem_statefunction ipa_openfunction ipa_stopfunction ipa_start_xmitfunction ipa_modem_skb_rxfunction ipa_modem_netdev_setupfunction ipa_modem_suspendfunction ipa_modem_wake_queue_workfunction ipa_modem_resumefunction ipa_modem_startfunction ipa_modem_stopfunction ipa_modem_crashedfunction ipa_modem_notifyfunction ipa_modem_configfunction ipa_modem_deconfig
Annotated Snippet
static const struct net_device_ops ipa_modem_ops = {
.ndo_open = ipa_open,
.ndo_stop = ipa_stop,
.ndo_start_xmit = ipa_start_xmit,
};
/** ipa_modem_netdev_setup() - netdev setup function for the modem */
static void ipa_modem_netdev_setup(struct net_device *netdev)
{
netdev->netdev_ops = &ipa_modem_ops;
netdev->header_ops = NULL;
netdev->type = ARPHRD_RAWIP;
netdev->hard_header_len = 0;
netdev->min_header_len = ETH_HLEN;
netdev->min_mtu = ETH_MIN_MTU;
netdev->max_mtu = IPA_MTU;
netdev->mtu = netdev->max_mtu;
netdev->addr_len = 0;
netdev->tx_queue_len = DEFAULT_TX_QUEUE_LEN;
netdev->flags &= ~(IFF_BROADCAST | IFF_MULTICAST);
netdev->priv_flags |= IFF_TX_SKB_SHARING;
eth_broadcast_addr(netdev->broadcast);
/* The endpoint is configured for QMAP */
netdev->needed_headroom = sizeof(struct rmnet_map_header);
netdev->needed_tailroom = IPA_NETDEV_TAILROOM;
netdev->watchdog_timeo = IPA_NETDEV_TIMEOUT * HZ;
netdev->hw_features = NETIF_F_SG;
}
/** ipa_modem_suspend() - suspend callback
* @netdev: Network device
*
* Suspend the modem's endpoints.
*/
void ipa_modem_suspend(struct net_device *netdev)
{
struct ipa_priv *priv;
if (!(netdev->flags & IFF_UP))
return;
priv = netdev_priv(netdev);
ipa_endpoint_suspend_one(priv->rx);
ipa_endpoint_suspend_one(priv->tx);
}
/**
* ipa_modem_wake_queue_work() - enable modem netdev queue
* @work: Work structure
*
* Re-enable transmit on the modem network device. This is called
* in (power management) work queue context, scheduled when resuming
* the modem. We can't enable the queue directly in ipa_modem_resume()
* because transmits restart the instant the queue is awakened; but the
* device power state won't be ACTIVE until *after* ipa_modem_resume()
* returns.
*/
static void ipa_modem_wake_queue_work(struct work_struct *work)
{
struct ipa_priv *priv = container_of(work, struct ipa_priv, work);
netif_wake_queue(priv->tx->netdev);
}
/** ipa_modem_resume() - resume callback for runtime_pm
* @dev: pointer to device
*
* Resume the modem's endpoints.
*/
void ipa_modem_resume(struct net_device *netdev)
{
struct ipa_priv *priv;
if (!(netdev->flags & IFF_UP))
return;
priv = netdev_priv(netdev);
ipa_endpoint_resume_one(priv->tx);
ipa_endpoint_resume_one(priv->rx);
/* Arrange for the TX queue to be restarted */
(void)queue_pm_work(&priv->work);
}
int ipa_modem_start(struct ipa *ipa)
{
enum ipa_modem_state state;
struct net_device *netdev;
Annotation
- Immediate include surface: `linux/errno.h`, `linux/etherdevice.h`, `linux/if_arp.h`, `linux/if_rmnet.h`, `linux/netdevice.h`, `linux/pm_runtime.h`, `linux/skbuff.h`, `net/pkt_sched.h`.
- Detected declarations: `struct ipa_priv`, `enum ipa_modem_state`, `function ipa_open`, `function ipa_stop`, `function ipa_start_xmit`, `function ipa_modem_skb_rx`, `function ipa_modem_netdev_setup`, `function ipa_modem_suspend`, `function ipa_modem_wake_queue_work`, `function ipa_modem_resume`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: pattern implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.