drivers/net/wwan/t7xx/t7xx_port_proxy.c
Source file repositories/reference/linux-study-clean/drivers/net/wwan/t7xx/t7xx_port_proxy.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wwan/t7xx/t7xx_port_proxy.c- Extension
.c- Size
- 16699 bytes
- Lines
- 656
- 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.
- 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.
- 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/bits.hlinux/bitfield.hlinux/device.hlinux/gfp.hlinux/kernel.hlinux/kthread.hlinux/list.hlinux/mutex.hlinux/netdevice.hlinux/skbuff.hlinux/spinlock.hlinux/wait.hlinux/wwan.ht7xx_hif_cldma.ht7xx_modem_ops.ht7xx_port.ht7xx_port_proxy.ht7xx_state_monitor.h
Detected Declarations
function for_each_proxy_portfunction t7xx_port_next_rx_seq_numfunction t7xx_port_proxy_resetfunction for_each_proxy_portfunction t7xx_port_get_queue_nofunction t7xx_port_struct_initfunction t7xx_port_enqueue_skbfunction t7xx_get_port_mtufunction t7xx_port_send_raw_skbfunction t7xx_port_send_ccci_skbfunction t7xx_port_send_ctl_skbfunction t7xx_port_send_skbfunction t7xx_proxy_setup_ch_mappingfunction for_each_proxy_portfunction t7xx_port_proxy_recv_skb_from_dedicated_queuefunction t7xx_port_proxy_recv_skbfunction t7xx_port_proxy_md_status_notifyfunction for_each_proxy_portfunction t7xx_proxy_init_all_portsfunction for_each_proxy_portfunction t7xx_proxy_debug_ports_showfunction for_each_proxy_portfunction t7xx_port_proxy_set_cfgfunction t7xx_proxy_allocfunction t7xx_port_proxy_initfunction t7xx_port_proxy_uninitfunction for_each_proxy_portfunction t7xx_port_proxy_chl_enable_disable
Annotated Snippet
switch (md_state) {
case MD_STATE_EXCEPTION:
if (port_conf->tx_ch != PORT_CH_MD_LOG_TX)
return -EBUSY;
break;
case MD_STATE_WAITING_FOR_HS1:
case MD_STATE_WAITING_FOR_HS2:
case MD_STATE_STOPPED:
case MD_STATE_WAITING_TO_STOP:
case MD_STATE_INVALID:
return -ENODEV;
default:
break;
}
}
return t7xx_port_send_ccci_skb(port, skb, pkt_header, ex_msg);
}
static void t7xx_proxy_setup_ch_mapping(struct port_proxy *port_prox)
{
struct t7xx_port *port;
int i, j;
for (i = 0; i < ARRAY_SIZE(port_prox->rx_ch_ports); i++)
INIT_LIST_HEAD(&port_prox->rx_ch_ports[i]);
for (j = 0; j < ARRAY_SIZE(port_prox->queue_ports); j++) {
for (i = 0; i < ARRAY_SIZE(port_prox->queue_ports[j]); i++)
INIT_LIST_HEAD(&port_prox->queue_ports[j][i]);
}
for_each_proxy_port(i, port, port_prox) {
const struct t7xx_port_conf *port_conf = port->port_conf;
enum cldma_id path_id = port_conf->path_id;
u8 ch_id;
ch_id = FIELD_GET(PORT_CH_ID_MASK, port_conf->rx_ch);
list_add_tail(&port->entry, &port_prox->rx_ch_ports[ch_id]);
list_add_tail(&port->queue_entry,
&port_prox->queue_ports[path_id][port_conf->rxq_index]);
}
}
/**
* t7xx_port_proxy_recv_skb_from_dedicated_queue() - Dispatch early port received skb.
* @queue: CLDMA queue.
* @skb: Socket buffer.
*
* Return:
** 0 - Packet consumed.
** -ERROR - Failed to process skb.
*/
int t7xx_port_proxy_recv_skb_from_dedicated_queue(struct cldma_queue *queue, struct sk_buff *skb)
{
struct t7xx_pci_dev *t7xx_dev = queue->md_ctrl->t7xx_dev;
struct port_proxy *port_prox = t7xx_dev->md->port_prox;
const struct t7xx_port_conf *port_conf;
struct t7xx_port *port;
int ret;
port = &port_prox->ports[0];
if (WARN_ON_ONCE(port->port_conf->rxq_index != queue->index)) {
dev_kfree_skb_any(skb);
return -EINVAL;
}
port_conf = port->port_conf;
ret = port_conf->ops->recv_skb(port, skb);
if (ret < 0 && ret != -ENOBUFS) {
dev_err(port->dev, "drop on RX ch %d, %d\n", port_conf->rx_ch, ret);
dev_kfree_skb_any(skb);
}
return ret;
}
static struct t7xx_port *t7xx_port_proxy_find_port(struct t7xx_pci_dev *t7xx_dev,
struct cldma_queue *queue, u16 channel)
{
struct port_proxy *port_prox = t7xx_dev->md->port_prox;
struct list_head *port_list;
struct t7xx_port *port;
u8 ch_id;
ch_id = FIELD_GET(PORT_CH_ID_MASK, channel);
port_list = &port_prox->rx_ch_ports[ch_id];
Annotation
- Immediate include surface: `linux/bits.h`, `linux/bitfield.h`, `linux/device.h`, `linux/gfp.h`, `linux/kernel.h`, `linux/kthread.h`, `linux/list.h`, `linux/mutex.h`.
- Detected declarations: `function for_each_proxy_port`, `function t7xx_port_next_rx_seq_num`, `function t7xx_port_proxy_reset`, `function for_each_proxy_port`, `function t7xx_port_get_queue_no`, `function t7xx_port_struct_init`, `function t7xx_port_enqueue_skb`, `function t7xx_get_port_mtu`, `function t7xx_port_send_raw_skb`, `function t7xx_port_send_ccci_skb`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source 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.