drivers/net/wireless/microchip/wilc1000/wlan.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/microchip/wilc1000/wlan.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/microchip/wilc1000/wlan.c- Extension
.c- Size
- 42071 bytes
- Lines
- 1811
- 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/if_ether.hlinux/ip.hnet/dsfield.hcfg80211.hwlan_cfg.h
Detected Declarations
function Copyrightfunction wilc_wlan_txq_remove_from_headfunction wilc_wlan_txq_add_to_tailfunction wilc_wlan_txq_add_to_headfunction add_tcp_sessionfunction update_tcp_sessionfunction add_tcp_pending_ackfunction tcp_processfunction wilc_wlan_txq_filter_dup_tcp_ackfunction wilc_enable_tcp_ack_filterfunction wilc_wlan_txq_add_cfg_pktfunction is_ac_q_limitfunction ac_classifyfunction ac_balancefunction ac_update_fw_ac_pkt_infofunction ac_changefunction wilc_wlan_txq_add_net_pktfunction wilc_wlan_txq_add_mgmt_pktfunction wilc_wlan_rxq_addfunction chip_allow_sleep_wilc1000function chip_allow_sleep_wilc3000function chip_allow_sleepfunction chip_wakeup_wilc1000function chip_wakeup_wilc3000function chip_wakeupfunction acquire_busfunction release_busfunction host_wakeup_notifyfunction host_sleep_notifyfunction wilc_wlan_handle_txqfunction wilc_wlan_handle_rx_bufffunction wilc_wlan_handle_rxqfunction wilc_unknown_isr_extfunction wilc_wlan_handle_isr_extfunction wilc_handle_isrfunction wilc_wlan_firmware_downloadfunction wilc_wlan_startfunction wilc_wlan_stopfunction wilc_wlan_cleanupfunction wilc_wlan_cfg_commitfunction wilc_wlan_cfg_setfunction wilc_wlan_cfg_getfunction wilc_send_config_pktfunction wilc_get_chipidfunction init_chipfunction wilc_load_mac_from_nvfunction wilc_wlan_initexport host_wakeup_notify
Annotated Snippet
if (f->pending_acks[i].ack_num < bigger_ack_num) {
struct txq_entry_t *tqe;
tqe = f->pending_acks[i].txqe;
if (tqe) {
wilc_wlan_txq_remove(wilc, tqe->q_num, tqe);
tqe->status = 1;
if (tqe->tx_complete_func)
tqe->tx_complete_func(tqe->priv,
tqe->status);
kfree(tqe);
dropped++;
}
}
}
f->pending_acks_idx = 0;
f->tcp_session = 0;
if (f->pending_base == 0)
f->pending_base = MAX_TCP_SESSION;
else
f->pending_base = 0;
spin_unlock_irqrestore(&wilc->txq_spinlock, flags);
while (dropped > 0) {
wait_for_completion_timeout(&wilc->txq_event,
msecs_to_jiffies(1));
dropped--;
}
}
void wilc_enable_tcp_ack_filter(struct wilc_vif *vif, bool value)
{
vif->ack_filter.enabled = value;
}
static int wilc_wlan_txq_add_cfg_pkt(struct wilc_vif *vif, u8 *buffer,
u32 buffer_size)
{
struct txq_entry_t *tqe;
struct wilc *wilc = vif->wilc;
netdev_dbg(vif->ndev, "Adding config packet ...\n");
if (wilc->quit) {
netdev_dbg(vif->ndev, "Return due to clear function\n");
complete(&wilc->cfg_event);
return 0;
}
tqe = kmalloc_obj(*tqe, GFP_ATOMIC);
if (!tqe) {
complete(&wilc->cfg_event);
return 0;
}
tqe->type = WILC_CFG_PKT;
tqe->buffer = buffer;
tqe->buffer_size = buffer_size;
tqe->tx_complete_func = NULL;
tqe->priv = NULL;
tqe->q_num = AC_VO_Q;
tqe->ack_idx = NOT_TCP_ACK;
tqe->vif = vif;
wilc_wlan_txq_add_to_head(vif, AC_VO_Q, tqe);
return 1;
}
static bool is_ac_q_limit(struct wilc *wl, u8 q_num)
{
u8 factors[NQUEUES] = {1, 1, 1, 1};
u16 i;
unsigned long flags;
struct wilc_tx_queue_status *q = &wl->tx_q_limit;
u8 end_index;
u8 q_limit;
bool ret = false;
spin_lock_irqsave(&wl->txq_spinlock, flags);
if (!q->initialized) {
for (i = 0; i < AC_BUFFER_SIZE; i++)
q->buffer[i] = i % NQUEUES;
for (i = 0; i < NQUEUES; i++) {
q->cnt[i] = AC_BUFFER_SIZE * factors[i] / NQUEUES;
q->sum += q->cnt[i];
}
q->end_index = AC_BUFFER_SIZE - 1;
Annotation
- Immediate include surface: `linux/if_ether.h`, `linux/ip.h`, `net/dsfield.h`, `cfg80211.h`, `wlan_cfg.h`.
- Detected declarations: `function Copyright`, `function wilc_wlan_txq_remove_from_head`, `function wilc_wlan_txq_add_to_tail`, `function wilc_wlan_txq_add_to_head`, `function add_tcp_session`, `function update_tcp_session`, `function add_tcp_pending_ack`, `function tcp_process`, `function wilc_wlan_txq_filter_dup_tcp_ack`, `function wilc_enable_tcp_ack_filter`.
- 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.