drivers/net/wireless/realtek/rtw89/ps.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/realtek/rtw89/ps.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/realtek/rtw89/ps.c- Extension
.c- Size
- 15573 bytes
- Lines
- 602
- 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
chan.hcoex.hcore.hdebug.hfw.hmac.hphy.hps.hreg.hser.hutil.h
Detected Declarations
function rtw89_fw_receive_lps_h2c_checkfunction rtw89_fw_leave_lps_checkfunction rtw89_ps_power_mode_change_with_hcifunction rtw89_ps_power_mode_changefunction __rtw89_enter_ps_modefunction __rtw89_leave_ps_modefunction __rtw89_enter_lps_linkfunction __rtw89_leave_lpsfunction rtw89_leave_ps_modefunction rtw89_enter_lpsfunction rtw89_vif_for_each_linkfunction rtw89_leave_lps_viffunction rtw89_leave_lpsfunction rtw89_enter_ipsfunction rtw89_leave_ipsfunction rtw89_set_coex_ctrl_lpsfunction rtw89_tsf32_togglefunction rtw89_p2p_disable_all_noafunction rtw89_p2p_update_noafunction rtw89_process_p2p_psfunction rtw89_recalc_lpsfunction rtw89_for_each_rtwviffunction rtw89_p2p_noa_renewfunction rtw89_p2p_noa_appendfunction rtw89_p2p_noa_fetchfunction rtw89_ps_noa_once_set_workfunction rtw89_ps_noa_once_clr_workfunction rtw89_p2p_noa_once_initfunction rtw89_p2p_noa_once_cancelfunction rtw89_p2p_noa_once_deinitfunction rtw89_p2p_noa_once_recalc
Annotated Snippet
if (vif->type != NL80211_IFTYPE_STATION) {
count = 0;
break;
}
count++;
found_vif = vif;
}
if (count == 1 && found_vif->cfg.ps) {
rtwdev->lps_enabled = true;
return;
}
disable_lps:
rtw89_leave_lps(rtwdev);
rtwdev->lps_enabled = false;
}
void rtw89_p2p_noa_renew(struct rtw89_vif_link *rtwvif_link)
{
struct rtw89_p2p_noa_setter *setter = &rtwvif_link->p2p_noa;
struct rtw89_p2p_noa_ie *ie = &setter->ie;
struct rtw89_p2p_ie_head *p2p_head = &ie->p2p_head;
struct rtw89_noa_attr_head *noa_head = &ie->noa_head;
if (setter->noa_count) {
setter->noa_index++;
setter->noa_count = 0;
}
memset(ie, 0, sizeof(*ie));
p2p_head->eid = WLAN_EID_VENDOR_SPECIFIC;
p2p_head->ie_len = 4 + sizeof(*noa_head);
p2p_head->oui[0] = (WLAN_OUI_WFA >> 16) & 0xff;
p2p_head->oui[1] = (WLAN_OUI_WFA >> 8) & 0xff;
p2p_head->oui[2] = (WLAN_OUI_WFA >> 0) & 0xff;
p2p_head->oui_type = WLAN_OUI_TYPE_WFA_P2P;
noa_head->attr_type = IEEE80211_P2P_ATTR_ABSENCE_NOTICE;
noa_head->attr_len = cpu_to_le16(2);
noa_head->index = setter->noa_index;
noa_head->oppps_ctwindow = 0;
}
void rtw89_p2p_noa_append(struct rtw89_vif_link *rtwvif_link,
const struct ieee80211_p2p_noa_desc *desc)
{
struct rtw89_p2p_noa_setter *setter = &rtwvif_link->p2p_noa;
struct rtw89_p2p_noa_ie *ie = &setter->ie;
struct rtw89_p2p_ie_head *p2p_head = &ie->p2p_head;
struct rtw89_noa_attr_head *noa_head = &ie->noa_head;
if (!desc->count || !desc->duration)
return;
if (setter->noa_count >= RTW89_P2P_MAX_NOA_NUM)
return;
p2p_head->ie_len += sizeof(*desc);
le16_add_cpu(&noa_head->attr_len, sizeof(*desc));
ie->noa_desc[setter->noa_count++] = *desc;
}
u8 rtw89_p2p_noa_fetch(struct rtw89_vif_link *rtwvif_link, void **data)
{
struct rtw89_p2p_noa_setter *setter = &rtwvif_link->p2p_noa;
struct rtw89_p2p_noa_ie *ie = &setter->ie;
void *tail;
if (!setter->noa_count)
return 0;
*data = ie;
tail = ie->noa_desc + setter->noa_count;
return tail - *data;
}
static void rtw89_ps_noa_once_set_work(struct wiphy *wiphy, struct wiphy_work *work)
{
struct rtw89_ps_noa_once_handler *noa_once =
container_of(work, struct rtw89_ps_noa_once_handler, set_work.work);
lockdep_assert_wiphy(wiphy);
noa_once->in_duration = true;
}
Annotation
- Immediate include surface: `chan.h`, `coex.h`, `core.h`, `debug.h`, `fw.h`, `mac.h`, `phy.h`, `ps.h`.
- Detected declarations: `function rtw89_fw_receive_lps_h2c_check`, `function rtw89_fw_leave_lps_check`, `function rtw89_ps_power_mode_change_with_hci`, `function rtw89_ps_power_mode_change`, `function __rtw89_enter_ps_mode`, `function __rtw89_leave_ps_mode`, `function __rtw89_enter_lps_link`, `function __rtw89_leave_lps`, `function rtw89_leave_ps_mode`, `function rtw89_enter_lps`.
- 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.