drivers/staging/rtl8723bs/core/rtw_ieee80211.c
Source file repositories/reference/linux-study-clean/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/rtl8723bs/core/rtw_ieee80211.c- Extension
.c- Size
- 28486 bytes
- Lines
- 1172
- Domain
- Driver Families
- Bucket
- drivers/staging
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
drv_types.hlinux/hex.hlinux/of.hlinux/unaligned.h
Detected Declarations
function rtw_get_bit_value_from_ieee_valuefunction rtw_is_cckrates_includedfunction rtw_is_cckratesonly_includedfunction rtw_check_network_typefunction rtw_ies_remove_iefunction rtw_set_supported_ratefunction rtw_get_rateset_lenfunction rtw_generate_iefunction rtw_get_wpa_cipher_suitefunction rtw_get_wpa2_cipher_suitefunction rtw_parse_wpa_iefunction rtw_parse_wpa2_iefunction rtw_get_wapi_iefunction rtw_get_sec_iefunction rtw_ieee802_11_parse_vendor_specificfunction rtw_ieee802_11_parse_elemsfunction rtw_macaddr_cfgfunction rtw_get_cipher_infofunction rtw_get_bcn_infofunction rtw_mcs_ratefunction rtw_action_frame_parse
Annotated Snippet
if (*p == index) {
*len = tmp;
return p;
}
p += (tmp + 2);
i += (tmp + 2);
}
return NULL;
}
/**
* rtw_get_ie_ex - Search specific IE from a series of IEs
* @in_ie: Address of IEs to search
* @in_len: Length limit from in_ie
* @eid: Element ID to match
* @oui: OUI to match
* @oui_len: OUI length
* @ie: If not NULL and the specific IE is found, the IE will be copied to the buf starting from the specific IE
* @ielen: If not NULL and the specific IE is found, will set to the length of the entire IE
*
* Returns: The address of the specific IE found, or NULL
*/
u8 *rtw_get_ie_ex(u8 *in_ie, uint in_len, u8 eid, u8 *oui, u8 oui_len, u8 *ie, uint *ielen)
{
uint cnt;
u8 *target_ie = NULL;
if (ielen)
*ielen = 0;
if (!in_ie || in_len <= 0)
return target_ie;
cnt = 0;
while (cnt + 2 <= in_len) {
u8 ie_len = in_ie[cnt + 1];
if (cnt + 2 + ie_len > in_len)
break;
if (eid == in_ie[cnt] &&
(!oui || (ie_len >= oui_len && !memcmp(&in_ie[cnt + 2], oui, oui_len)))) {
target_ie = &in_ie[cnt];
if (ie)
memcpy(ie, &in_ie[cnt], ie_len + 2);
if (ielen)
*ielen = ie_len + 2;
break;
}
cnt += ie_len + 2; /* goto next */
}
return target_ie;
}
/**
* rtw_ies_remove_ie - Find matching IEs and remove
* @ies: Address of IEs to search
* @ies_len: Pointer of length of ies, will update to new length
* @offset: The offset to start search
* @eid: Element ID to match
* @oui: OUI to match
* @oui_len: OUI length
*
* Returns: _SUCCESS: ies is updated, _FAIL: not updated
*/
int rtw_ies_remove_ie(u8 *ies, uint *ies_len, uint offset, u8 eid, u8 *oui, u8 oui_len)
{
int ret = _FAIL;
u8 *target_ie;
u32 target_ielen;
u8 *start;
uint search_len;
if (!ies || !ies_len || *ies_len <= offset)
goto exit;
start = ies + offset;
search_len = *ies_len - offset;
while (1) {
target_ie = rtw_get_ie_ex(start, search_len, eid, oui, oui_len, NULL, &target_ielen);
if (target_ie && target_ielen) {
u8 *remain_ies = target_ie + target_ielen;
uint remain_len = search_len - (remain_ies - start);
Annotation
- Immediate include surface: `drv_types.h`, `linux/hex.h`, `linux/of.h`, `linux/unaligned.h`.
- Detected declarations: `function rtw_get_bit_value_from_ieee_value`, `function rtw_is_cckrates_included`, `function rtw_is_cckratesonly_included`, `function rtw_check_network_type`, `function rtw_ies_remove_ie`, `function rtw_set_supported_rate`, `function rtw_get_rateset_len`, `function rtw_generate_ie`, `function rtw_get_wpa_cipher_suite`, `function rtw_get_wpa2_cipher_suite`.
- Atlas domain: Driver Families / drivers/staging.
- Implementation status: source implementation candidate.
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.