drivers/net/wwan/t7xx/t7xx_netdev.c
Source file repositories/reference/linux-study-clean/drivers/net/wwan/t7xx/t7xx_netdev.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wwan/t7xx/t7xx_netdev.c- Extension
.c- Size
- 12683 bytes
- Lines
- 530
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/atomic.hlinux/device.hlinux/gfp.hlinux/if_arp.hlinux/if_ether.hlinux/ip.hlinux/kernel.hlinux/list.hlinux/netdev_features.hlinux/netdevice.hlinux/pm_runtime.hlinux/skbuff.hlinux/types.hlinux/wwan.hnet/ipv6.hnet/pkt_sched.ht7xx_hif_dpmaif_rx.ht7xx_hif_dpmaif_tx.ht7xx_netdev.ht7xx_pci.ht7xx_port_proxy.ht7xx_state_monitor.h
Detected Declarations
function Copyrightfunction t7xx_ccmni_disable_napifunction t7xx_ccmni_openfunction t7xx_ccmni_closefunction t7xx_ccmni_send_packetfunction t7xx_ccmni_start_xmitfunction t7xx_ccmni_tx_timeoutfunction t7xx_ccmni_startfunction t7xx_ccmni_pre_stopfunction t7xx_ccmni_post_stopfunction t7xx_ccmni_wwan_setupfunction t7xx_init_netdev_napifunction t7xx_uninit_netdev_napifunction t7xx_ccmni_wwan_newlinkfunction t7xx_ccmni_wwan_dellinkfunction t7xx_ccmni_register_wwanfunction t7xx_ccmni_md_state_callbackfunction init_md_status_notifierfunction t7xx_ccmni_recv_skbfunction t7xx_ccmni_queue_tx_irq_notifyfunction t7xx_ccmni_queue_tx_full_notifyfunction t7xx_ccmni_queue_state_notifyfunction t7xx_ccmni_initfunction t7xx_ccmni_exit
Annotated Snippet
static const struct net_device_ops ccmni_netdev_ops = {
.ndo_open = t7xx_ccmni_open,
.ndo_stop = t7xx_ccmni_close,
.ndo_start_xmit = t7xx_ccmni_start_xmit,
.ndo_tx_timeout = t7xx_ccmni_tx_timeout,
};
static void t7xx_ccmni_start(struct t7xx_ccmni_ctrl *ctlb)
{
struct t7xx_ccmni *ccmni;
int i;
for (i = 0; i < ctlb->nic_dev_num; i++) {
ccmni = ctlb->ccmni_inst[i];
if (!ccmni)
continue;
if (atomic_read(&ccmni->usage) > 0) {
netif_tx_start_all_queues(ccmni->dev);
netif_carrier_on(ccmni->dev);
}
}
if (atomic_read(&ctlb->napi_usr_refcnt))
t7xx_ccmni_enable_napi(ctlb);
}
static void t7xx_ccmni_pre_stop(struct t7xx_ccmni_ctrl *ctlb)
{
struct t7xx_ccmni *ccmni;
int i;
for (i = 0; i < ctlb->nic_dev_num; i++) {
ccmni = ctlb->ccmni_inst[i];
if (!ccmni)
continue;
if (atomic_read(&ccmni->usage) > 0)
netif_tx_disable(ccmni->dev);
}
}
static void t7xx_ccmni_post_stop(struct t7xx_ccmni_ctrl *ctlb)
{
struct t7xx_ccmni *ccmni;
int i;
if (atomic_read(&ctlb->napi_usr_refcnt))
t7xx_ccmni_disable_napi(ctlb);
for (i = 0; i < ctlb->nic_dev_num; i++) {
ccmni = ctlb->ccmni_inst[i];
if (!ccmni)
continue;
if (atomic_read(&ccmni->usage) > 0)
netif_carrier_off(ccmni->dev);
}
}
static void t7xx_ccmni_wwan_setup(struct net_device *dev)
{
dev->needed_headroom += sizeof(struct ccci_header);
dev->mtu = ETH_DATA_LEN;
dev->max_mtu = CCMNI_MTU_MAX;
BUILD_BUG_ON(CCMNI_MTU_MAX > DPMAIF_HW_MTU_SIZE);
dev->tx_queue_len = DEFAULT_TX_QUEUE_LEN;
dev->watchdog_timeo = CCMNI_NETDEV_WDT_TO;
dev->flags = IFF_POINTOPOINT | IFF_NOARP;
dev->features = NETIF_F_VLAN_CHALLENGED;
dev->features |= NETIF_F_SG;
dev->hw_features |= NETIF_F_SG;
dev->features |= NETIF_F_HW_CSUM;
dev->hw_features |= NETIF_F_HW_CSUM;
dev->features |= NETIF_F_RXCSUM;
dev->hw_features |= NETIF_F_RXCSUM;
dev->features |= NETIF_F_GRO;
dev->hw_features |= NETIF_F_GRO;
dev->needs_free_netdev = true;
dev->type = ARPHRD_NONE;
Annotation
- Immediate include surface: `linux/atomic.h`, `linux/device.h`, `linux/gfp.h`, `linux/if_arp.h`, `linux/if_ether.h`, `linux/ip.h`, `linux/kernel.h`, `linux/list.h`.
- Detected declarations: `function Copyright`, `function t7xx_ccmni_disable_napi`, `function t7xx_ccmni_open`, `function t7xx_ccmni_close`, `function t7xx_ccmni_send_packet`, `function t7xx_ccmni_start_xmit`, `function t7xx_ccmni_tx_timeout`, `function t7xx_ccmni_start`, `function t7xx_ccmni_pre_stop`, `function t7xx_ccmni_post_stop`.
- 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.