drivers/net/wireless/silabs/wfx/sta.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/silabs/wfx/sta.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/silabs/wfx/sta.c- Extension
.c- Size
- 23585 bytes
- Lines
- 842
- 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/etherdevice.hnet/mac80211.hsta.hwfx.hbus.hfwio.hbh.hkey.hscan.hdebug.hhif_tx.hhif_tx_mib.h
Detected Declarations
function Copyrightfunction wfx_suspend_hot_devfunction wfx_filter_beaconfunction wfx_configure_filterfunction wfx_get_ps_timeoutfunction wfx_update_pmfunction wfx_conf_txfunction wfx_set_rts_thresholdfunction wfx_event_report_rssifunction wfx_beacon_loss_workfunction wfx_set_default_unicast_keyfunction wfx_resetfunction wfx_sta_addfunction wfx_sta_removefunction wfx_upload_ap_templatesfunction wfx_set_mfp_apfunction wfx_start_apfunction wfx_stop_apfunction wfx_joinfunction wfx_join_finalizefunction wfx_join_ibssfunction wfx_leave_ibssfunction wfx_enable_beaconfunction wfx_bss_info_changedfunction wfx_update_timfunction wfx_update_tim_workfunction wfx_set_timfunction wfx_suspend_resume_mcfunction wfx_ampdu_actionfunction wfx_add_chanctxfunction wfx_remove_chanctxfunction wfx_unassign_vif_chanctxfunction wfx_configfunction wfx_add_interfacefunction wfx_remove_interfacefunction wfx_suspendfunction wfx_resumefunction wfx_set_wakeupfunction wfx_startfunction wfx_stop
Annotated Snippet
if (*total_flags & FIF_PROBE_REQ && vif->type == NL80211_IFTYPE_AP) {
dev_dbg(wdev->dev, "do not forward probe request in AP mode\n");
*total_flags &= ~FIF_PROBE_REQ;
}
if (*total_flags & FIF_PROBE_REQ)
filter_prbreq = false;
else
filter_prbreq = true;
wfx_hif_set_rx_filter(wvif, filter_bssid, filter_prbreq);
}
mutex_unlock(&wdev->conf_mutex);
}
static int wfx_get_ps_timeout(struct wfx_vif *wvif, bool *enable_ps)
{
struct ieee80211_channel *chan0 = NULL, *chan1 = NULL;
struct ieee80211_conf *conf = &wvif->wdev->hw->conf;
struct ieee80211_vif *vif = wvif_to_vif(wvif);
WARN(!vif->cfg.assoc && enable_ps,
"enable_ps is reliable only if associated");
if (wdev_to_wvif(wvif->wdev, 0)) {
struct wfx_vif *wvif_ch0 = wdev_to_wvif(wvif->wdev, 0);
struct ieee80211_vif *vif_ch0 = wvif_to_vif(wvif_ch0);
chan0 = vif_ch0->bss_conf.chanreq.oper.chan;
}
if (wdev_to_wvif(wvif->wdev, 1)) {
struct wfx_vif *wvif_ch1 = wdev_to_wvif(wvif->wdev, 1);
struct ieee80211_vif *vif_ch1 = wvif_to_vif(wvif_ch1);
chan1 = vif_ch1->bss_conf.chanreq.oper.chan;
}
if (chan0 && chan1 && vif->type != NL80211_IFTYPE_AP) {
if (chan0->hw_value == chan1->hw_value) {
/* It is useless to enable PS if channels are the same. */
if (enable_ps)
*enable_ps = false;
if (vif->cfg.assoc && vif->cfg.ps)
dev_info(wvif->wdev->dev, "ignoring requested PS mode");
return -1;
}
/* It is necessary to enable PS if channels are different. */
if (enable_ps)
*enable_ps = true;
if (wfx_api_older_than(wvif->wdev, 3, 2))
return 0;
else
return 30;
}
if (enable_ps)
*enable_ps = vif->cfg.ps;
if (vif->cfg.assoc && vif->cfg.ps)
return conf->dynamic_ps_timeout;
else
return -1;
}
int wfx_update_pm(struct wfx_vif *wvif)
{
struct ieee80211_vif *vif = wvif_to_vif(wvif);
int ps_timeout;
bool ps;
if (!vif->cfg.assoc)
return 0;
ps_timeout = wfx_get_ps_timeout(wvif, &ps);
if (!ps)
ps_timeout = 0;
WARN_ON(ps_timeout < 0);
if (wvif->uapsd_mask)
ps_timeout = 0;
if (!wait_for_completion_timeout(&wvif->set_pm_mode_complete, TU_TO_JIFFIES(512)))
dev_warn(wvif->wdev->dev, "timeout while waiting of set_pm_mode_complete\n");
return wfx_hif_set_pm(wvif, ps, ps_timeout);
}
int wfx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
unsigned int link_id, u16 queue,
const struct ieee80211_tx_queue_params *params)
{
struct wfx_dev *wdev = hw->priv;
struct wfx_vif *wvif = (struct wfx_vif *)vif->drv_priv;
int old_uapsd = wvif->uapsd_mask;
WARN_ON(queue >= hw->queues);
mutex_lock(&wdev->conf_mutex);
Annotation
- Immediate include surface: `linux/etherdevice.h`, `net/mac80211.h`, `sta.h`, `wfx.h`, `bus.h`, `fwio.h`, `bh.h`, `key.h`.
- Detected declarations: `function Copyright`, `function wfx_suspend_hot_dev`, `function wfx_filter_beacon`, `function wfx_configure_filter`, `function wfx_get_ps_timeout`, `function wfx_update_pm`, `function wfx_conf_tx`, `function wfx_set_rts_threshold`, `function wfx_event_report_rssi`, `function wfx_beacon_loss_work`.
- 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.