drivers/net/wwan/t7xx/t7xx_modem_ops.c
Source file repositories/reference/linux-study-clean/drivers/net/wwan/t7xx/t7xx_modem_ops.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wwan/t7xx/t7xx_modem_ops.c- Extension
.c- Size
- 22887 bytes
- Lines
- 832
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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/acpi.hlinux/bits.hlinux/bitfield.hlinux/device.hlinux/delay.hlinux/gfp.hlinux/io.hlinux/irqreturn.hlinux/kthread.hlinux/skbuff.hlinux/spinlock.hlinux/string.hlinux/types.hlinux/wait.hlinux/workqueue.ht7xx_cldma.ht7xx_hif_cldma.ht7xx_mhccif.ht7xx_modem_ops.ht7xx_netdev.ht7xx_pci.ht7xx_pcie_mac.ht7xx_port.ht7xx_port_proxy.ht7xx_reg.ht7xx_state_monitor.h
Detected Declarations
struct feature_queryenum mtk_feature_support_typefunction t7xx_get_interrupt_statusfunction t7xx_pci_mhccif_isrfunction t7xx_clr_device_irq_via_pciefunction t7xx_clear_rgu_irqfunction t7xx_acpi_resetfunction t7xx_host_event_notifyfunction t7xx_reset_devicefunction t7xx_reset_device_via_pmicfunction t7xx_rgu_isr_threadfunction t7xx_rgu_isr_handlerfunction t7xx_pcie_register_rgu_isrfunction t7xx_cldma_exceptionfunction t7xx_md_exceptionfunction t7xx_wait_hif_ex_hk_eventfunction t7xx_md_sys_sw_initfunction t7xx_prepare_host_rt_data_queryfunction t7xx_prepare_device_rt_datafunction le32_to_cpufunction t7xx_parse_host_rt_datafunction t7xx_core_resetfunction t7xx_core_hk_handlerfunction list_for_each_entry_safefunction t7xx_md_hk_wqfunction t7xx_ap_hk_wqfunction t7xx_md_event_notifyfunction t7xx_md_exception_handshakefunction t7xx_md_resetfunction t7xx_md_initfunction t7xx_md_exit
Annotated Snippet
struct feature_query {
__le32 head_pattern;
u8 feature_set[FEATURE_COUNT];
__le32 tail_pattern;
};
static void t7xx_prepare_host_rt_data_query(struct t7xx_sys_info *core)
{
struct feature_query *ft_query;
struct sk_buff *skb;
skb = t7xx_ctrl_alloc_skb(sizeof(*ft_query));
if (!skb)
return;
ft_query = skb_put(skb, sizeof(*ft_query));
ft_query->head_pattern = cpu_to_le32(MD_FEATURE_QUERY_ID);
memcpy(ft_query->feature_set, core->feature_set, FEATURE_COUNT);
ft_query->tail_pattern = cpu_to_le32(MD_FEATURE_QUERY_ID);
/* Send HS1 message to device */
t7xx_port_send_ctl_skb(core->ctl_port, skb, CTL_ID_HS1_MSG, 0);
}
static int t7xx_prepare_device_rt_data(struct t7xx_sys_info *core, struct device *dev,
void *data)
{
struct feature_query *md_feature = data;
struct mtk_runtime_feature *rt_feature;
unsigned int i, rt_data_len = 0;
struct sk_buff *skb;
/* Parse MD runtime data query */
if (le32_to_cpu(md_feature->head_pattern) != MD_FEATURE_QUERY_ID ||
le32_to_cpu(md_feature->tail_pattern) != MD_FEATURE_QUERY_ID) {
dev_err(dev, "Invalid feature pattern: head 0x%x, tail 0x%x\n",
le32_to_cpu(md_feature->head_pattern),
le32_to_cpu(md_feature->tail_pattern));
return -EINVAL;
}
for (i = 0; i < FEATURE_COUNT; i++) {
if (FIELD_GET(FEATURE_MSK, md_feature->feature_set[i]) !=
MTK_FEATURE_MUST_BE_SUPPORTED)
rt_data_len += sizeof(*rt_feature);
}
skb = t7xx_ctrl_alloc_skb(rt_data_len);
if (!skb)
return -ENOMEM;
rt_feature = skb_put(skb, rt_data_len);
memset(rt_feature, 0, rt_data_len);
/* Fill runtime feature */
for (i = 0; i < FEATURE_COUNT; i++) {
u8 md_feature_mask = FIELD_GET(FEATURE_MSK, md_feature->feature_set[i]);
if (md_feature_mask == MTK_FEATURE_MUST_BE_SUPPORTED)
continue;
rt_feature->feature_id = i;
if (md_feature_mask == MTK_FEATURE_DOES_NOT_EXIST)
rt_feature->support_info = md_feature->feature_set[i];
rt_feature++;
}
/* Send HS3 message to device */
t7xx_port_send_ctl_skb(core->ctl_port, skb, CTL_ID_HS3_MSG, 0);
return 0;
}
static int t7xx_parse_host_rt_data(struct t7xx_fsm_ctl *ctl, struct t7xx_sys_info *core,
struct device *dev, void *data, int data_length)
{
enum mtk_feature_support_type ft_spt_st, ft_spt_cfg;
struct mtk_runtime_feature *rt_feature;
int i, offset;
offset = sizeof(struct feature_query);
for (i = 0; i < FEATURE_COUNT && offset < data_length; i++) {
size_t remaining = data_length - offset;
size_t feat_data_len, feat_total;
if (remaining < sizeof(*rt_feature))
break;
rt_feature = data + offset;
feat_data_len = le32_to_cpu(rt_feature->data_len);
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/bits.h`, `linux/bitfield.h`, `linux/device.h`, `linux/delay.h`, `linux/gfp.h`, `linux/io.h`, `linux/irqreturn.h`.
- Detected declarations: `struct feature_query`, `enum mtk_feature_support_type`, `function t7xx_get_interrupt_status`, `function t7xx_pci_mhccif_isr`, `function t7xx_clr_device_irq_via_pcie`, `function t7xx_clear_rgu_irq`, `function t7xx_acpi_reset`, `function t7xx_host_event_notify`, `function t7xx_reset_device`, `function t7xx_reset_device_via_pmic`.
- 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.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.