drivers/net/wireless/rsi/rsi_91x_coex.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/rsi/rsi_91x_coex.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/rsi/rsi_91x_coex.c- Extension
.c- Size
- 4786 bytes
- Lines
- 179
- 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
rsi_main.hrsi_coex.hrsi_mgmt.hrsi_hal.h
Detected Declarations
function Copyrightfunction rsi_coex_sched_tx_pktsfunction rsi_coex_scheduler_threadfunction rsi_coex_recv_pktfunction rsi_map_coex_qfunction rsi_coex_send_pktfunction rsi_coex_attachfunction rsi_coex_detach
Annotated Snippet
if (coex_q == RSI_COEX_Q_BT) {
skb = skb_dequeue(&coex_cb->coex_tx_qs[RSI_COEX_Q_BT]);
rsi_send_bt_pkt(coex_cb->priv, skb);
}
} while (coex_q != RSI_COEX_Q_INVALID);
}
static void rsi_coex_scheduler_thread(struct rsi_common *common)
{
struct rsi_coex_ctrl_block *coex_cb = common->coex_cb;
u32 timeout = EVENT_WAIT_FOREVER;
do {
rsi_wait_event(&coex_cb->coex_tx_thread.event, timeout);
rsi_reset_event(&coex_cb->coex_tx_thread.event);
rsi_coex_sched_tx_pkts(coex_cb);
} while (atomic_read(&coex_cb->coex_tx_thread.thread_done) == 0);
kthread_complete_and_exit(&coex_cb->coex_tx_thread.completion, 0);
}
int rsi_coex_recv_pkt(struct rsi_common *common, u8 *msg)
{
u8 msg_type = msg[RSI_RX_DESC_MSG_TYPE_OFFSET];
switch (msg_type) {
case COMMON_CARD_READY_IND:
rsi_dbg(INFO_ZONE, "common card ready received\n");
common->hibernate_resume = false;
rsi_handle_card_ready(common, msg);
break;
case SLEEP_NOTIFY_IND:
rsi_dbg(INFO_ZONE, "sleep notify received\n");
rsi_mgmt_pkt_recv(common, msg);
break;
}
return 0;
}
static inline int rsi_map_coex_q(u8 hal_queue)
{
switch (hal_queue) {
case RSI_COEX_Q:
return RSI_COEX_Q_COMMON;
case RSI_WLAN_Q:
return RSI_COEX_Q_WLAN;
case RSI_BT_Q:
return RSI_COEX_Q_BT;
}
return RSI_COEX_Q_INVALID;
}
int rsi_coex_send_pkt(void *priv, struct sk_buff *skb, u8 hal_queue)
{
struct rsi_common *common = priv;
struct rsi_coex_ctrl_block *coex_cb = common->coex_cb;
struct skb_info *tx_params = NULL;
enum rsi_coex_queues coex_q;
int status;
coex_q = rsi_map_coex_q(hal_queue);
if (coex_q == RSI_COEX_Q_INVALID) {
rsi_dbg(ERR_ZONE, "Invalid coex queue\n");
return -EINVAL;
}
if (coex_q != RSI_COEX_Q_COMMON &&
coex_q != RSI_COEX_Q_WLAN) {
skb_queue_tail(&coex_cb->coex_tx_qs[coex_q], skb);
rsi_set_event(&coex_cb->coex_tx_thread.event);
return 0;
}
if (common->iface_down) {
tx_params =
(struct skb_info *)&IEEE80211_SKB_CB(skb)->driver_data;
if (!(tx_params->flags & INTERNAL_MGMT_PKT)) {
rsi_indicate_tx_status(common->priv, skb, -EINVAL);
return 0;
}
}
/* Send packet to hal */
if (skb->priority == MGMT_SOFT_Q)
status = rsi_send_mgmt_pkt(common, skb);
else
status = rsi_send_data_pkt(common, skb);
return status;
Annotation
- Immediate include surface: `rsi_main.h`, `rsi_coex.h`, `rsi_mgmt.h`, `rsi_hal.h`.
- Detected declarations: `function Copyright`, `function rsi_coex_sched_tx_pkts`, `function rsi_coex_scheduler_thread`, `function rsi_coex_recv_pkt`, `function rsi_map_coex_q`, `function rsi_coex_send_pkt`, `function rsi_coex_attach`, `function rsi_coex_detach`.
- 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.