drivers/net/wireless/rsi/rsi_91x_main.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/rsi/rsi_91x_main.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/rsi/rsi_91x_main.c- Extension
.c- Size
- 10841 bytes
- Lines
- 432
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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/module.hlinux/firmware.hnet/rsi_91x.hrsi_mgmt.hrsi_common.hrsi_coex.hrsi_hal.hrsi_usb.h
Detected Declarations
function rsi_dbgfunction rsi_print_versionfunction rsi_prepare_skbfunction rsi_read_pktfunction rsi_tx_scheduler_threadfunction rsi_get_host_intffunction rsi_set_bt_contextfunction rsi_attach_btfunction rsi_91x_initfunction rsi_91x_deinitexport rsi_zone_enabledexport rsi_dbgexport rsi_read_pktexport rsi_91x_initexport rsi_91x_deinit
Annotated Snippet
switch (queueno) {
case RSI_COEX_Q:
#ifdef CONFIG_RSI_COEX
if (common->coex_mode > 1)
rsi_coex_recv_pkt(common, frame_desc + offset);
else
#endif
rsi_mgmt_pkt_recv(common,
(frame_desc + offset));
break;
case RSI_WIFI_DATA_Q:
skb = rsi_prepare_skb(common,
(frame_desc + offset),
length,
extended_desc);
if (skb == NULL)
goto fail;
rsi_indicate_pkt_to_os(common, skb);
break;
case RSI_WIFI_MGMT_Q:
rsi_mgmt_pkt_recv(common, (frame_desc + offset));
break;
#ifdef CONFIG_RSI_COEX
case RSI_BT_MGMT_Q:
case RSI_BT_DATA_Q:
#define BT_RX_PKT_TYPE_OFST 14
#define BT_CARD_READY_IND 0x89
bt_pkt_type = frame_desc[offset + BT_RX_PKT_TYPE_OFST];
if (bt_pkt_type == BT_CARD_READY_IND) {
rsi_dbg(INFO_ZONE, "BT Card ready recvd\n");
if (common->fsm_state == FSM_MAC_INIT_DONE)
rsi_attach_bt(common);
else
common->bt_defer_attach = true;
} else {
if (common->bt_adapter)
rsi_bt_ops.recv_pkt(common->bt_adapter,
frame_desc + offset);
}
break;
#endif
default:
rsi_dbg(ERR_ZONE, "%s: pkt from invalid queue: %d\n",
__func__, queueno);
goto fail;
}
index += actual_length;
rcv_pkt_len -= actual_length;
} while (rcv_pkt_len > 0);
return 0;
fail:
return -EINVAL;
}
EXPORT_SYMBOL_GPL(rsi_read_pkt);
/**
* rsi_tx_scheduler_thread() - This function is a kernel thread to send the
* packets to the device.
* @common: Pointer to the driver private structure.
*
* Return: None.
*/
static void rsi_tx_scheduler_thread(struct rsi_common *common)
{
struct rsi_hw *adapter = common->priv;
u32 timeout = EVENT_WAIT_FOREVER;
do {
if (adapter->determine_event_timeout)
timeout = adapter->determine_event_timeout(adapter);
rsi_wait_event(&common->tx_thread.event, timeout);
rsi_reset_event(&common->tx_thread.event);
if (common->init_done)
rsi_core_qos_processor(common);
} while (atomic_read(&common->tx_thread.thread_done) == 0);
kthread_complete_and_exit(&common->tx_thread.completion, 0);
}
#ifdef CONFIG_RSI_COEX
enum rsi_host_intf rsi_get_host_intf(void *priv)
{
struct rsi_common *common = priv;
Annotation
- Immediate include surface: `linux/module.h`, `linux/firmware.h`, `net/rsi_91x.h`, `rsi_mgmt.h`, `rsi_common.h`, `rsi_coex.h`, `rsi_hal.h`, `rsi_usb.h`.
- Detected declarations: `function rsi_dbg`, `function rsi_print_version`, `function rsi_prepare_skb`, `function rsi_read_pkt`, `function rsi_tx_scheduler_thread`, `function rsi_get_host_intf`, `function rsi_set_bt_context`, `function rsi_attach_bt`, `function rsi_91x_init`, `function rsi_91x_deinit`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration 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.