drivers/net/wwan/iosm/iosm_ipc_mux_codec.c
Source file repositories/reference/linux-study-clean/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wwan/iosm/iosm_ipc_mux_codec.c- Extension
.c- Size
- 43276 bytes
- Lines
- 1554
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/nospec.hiosm_ipc_imem_ops.hiosm_ipc_mux_codec.hiosm_ipc_task_queue.h
Detected Declarations
function Copyrightfunction ipc_mux_acb_sendfunction ipc_mux_acb_initfunction ipc_mux_acb_allocfunction ipc_mux_dl_acb_send_cmdsfunction ipc_mux_netif_tx_flowctrlfunction ipc_mux_dl_cmdresps_decode_processfunction ipc_mux_dl_cmds_decode_processfunction ipc_mux_dl_cmd_decodefunction cpu_to_le32function ipc_mux_net_receivefunction ipc_mux_dl_fcth_decodefunction ipc_mux_dl_adgh_decodefunction ipc_mux_dl_acbcmd_decodefunction ipc_mux_dl_acb_decodefunction mux_dl_process_dgfunction mux_dl_adb_decodefunction ipc_mux_dl_decodefunction ipc_mux_ul_skb_allocfunction ipc_mux_ul_adgh_finishfunction ipc_mux_ul_encode_adthfunction ipc_mux_ul_adb_finishfunction ipc_mux_ul_adb_allocatefunction ipc_mux_stop_tx_for_all_sessionsfunction ipc_mux_lite_send_qltfunction ipc_mux_ul_bytes_credits_checkfunction ipc_mux_ul_adgh_encodefunction ipc_mux_ul_adb_update_qlfunction mux_ul_dg_update_tbl_indexfunction mux_ul_dg_encodefunction mux_ul_adb_encodefunction ipc_mux_ul_data_encodefunction ipc_mux_get_payload_from_adbfunction ipc_mux_ul_encoded_processfunction ipc_mux_tq_ul_trigger_encodefunction ipc_mux_ul_trigger_encode
Annotated Snippet
if (if_id >= IPC_MEM_MUX_IP_SESSION_ENTRIES) {
dev_err(ipc_mux->dev, "if_id [%d] not valid",
if_id);
return -EINVAL; /* No session interface id. */
}
session = &ipc_mux->session[if_id];
adb_timer = &ipc_mux->imem->adb_timer;
if (param->flow_ctl.mask == cpu_to_le32(0xFFFFFFFF)) {
/* Backward Compatibility */
if (cmd_len == cpu_to_le16(size))
session->flow_ctl_mask =
le32_to_cpu(param->flow_ctl.mask);
else
session->flow_ctl_mask = ~0;
/* if CP asks for FLOW CTRL Enable
* then set our internal flow control Tx flag
* to limit uplink session queueing
*/
session->net_tx_stop = true;
/* We have to call Finish ADB here.
* Otherwise any already queued data
* will be sent to CP when ADB is full
* for some other sessions.
*/
if (ipc_mux->protocol == MUX_AGGREGATION) {
ipc_mux_ul_adb_finish(ipc_mux);
ipc_imem_hrtimer_stop(adb_timer);
}
/* Update the stats */
session->flow_ctl_en_cnt++;
} else if (param->flow_ctl.mask == 0) {
/* Just reset the Flow control mask and let
* mux_flow_ctrl_low_thre_b take control on
* our internal Tx flag and enabling kernel
* flow control
*/
dev_dbg(ipc_mux->dev, "if_id[%u] flow_ctl mask 0x%08X",
if_id, le32_to_cpu(param->flow_ctl.mask));
/* Backward Compatibility */
if (cmd_len == cpu_to_le16(size))
session->flow_ctl_mask =
le32_to_cpu(param->flow_ctl.mask);
else
session->flow_ctl_mask = 0;
/* Update the stats */
session->flow_ctl_dis_cnt++;
} else {
break;
}
ipc_mux->acc_adb_size = 0;
ipc_mux->acc_payload_size = 0;
dev_dbg(ipc_mux->dev, "if_id[%u] FLOW CTRL 0x%08X", if_id,
le32_to_cpu(param->flow_ctl.mask));
break;
case MUX_LITE_CMD_LINK_STATUS_REPORT:
break;
default:
return -EINVAL;
}
return 0;
}
/* Decode and Send appropriate response to a command block. */
static void ipc_mux_dl_cmd_decode(struct iosm_mux *ipc_mux, struct sk_buff *skb)
{
struct mux_lite_cmdh *cmdh = (struct mux_lite_cmdh *)skb->data;
__le32 trans_id = cmdh->transaction_id;
int size;
if (ipc_mux_dl_cmdresps_decode_process(ipc_mux, cmdh->param,
cmdh->command_type, cmdh->if_id,
cmdh->transaction_id)) {
/* Unable to decode command response indicates the cmd_type
* may be a command instead of response. So try to decoding it.
*/
size = offsetof(struct mux_lite_cmdh, param) +
sizeof(cmdh->param.flow_ctl);
if (!ipc_mux_dl_cmds_decode_process(ipc_mux, &cmdh->param,
cmdh->command_type,
cmdh->if_id,
cmdh->cmd_len, size)) {
/* Decoded command may need a response. Give the
* response according to the command type.
Annotation
- Immediate include surface: `linux/nospec.h`, `iosm_ipc_imem_ops.h`, `iosm_ipc_mux_codec.h`, `iosm_ipc_task_queue.h`.
- Detected declarations: `function Copyright`, `function ipc_mux_acb_send`, `function ipc_mux_acb_init`, `function ipc_mux_acb_alloc`, `function ipc_mux_dl_acb_send_cmds`, `function ipc_mux_netif_tx_flowctrl`, `function ipc_mux_dl_cmdresps_decode_process`, `function ipc_mux_dl_cmds_decode_process`, `function ipc_mux_dl_cmd_decode`, `function cpu_to_le32`.
- 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.