net/mac80211/tests/s1g_tim.c
Source file repositories/reference/linux-study-clean/net/mac80211/tests/s1g_tim.c
File Facts
- System
- Linux kernel
- Corpus path
net/mac80211/tests/s1g_tim.c- Extension
.c- Size
- 8841 bytes
- Lines
- 357
- Domain
- Networking Core
- Bucket
- Sockets, Protocols, Packet Path, And Network Policy
- Inferred role
- Networking Core: implementation source
- Status
- source implementation candidate
Why This File Exists
Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/ieee80211.hkunit/test.hkunit/test-bug.h
Detected Declarations
function Copyrightfunction dump_tim_bitsfunction tim_pushfunction tim_beginfunction tim_endfunction pvb_add_block_bitmapfunction pvb_add_single_aidfunction pvb_add_olbfunction check_all_aidsfunction fill_bitmapfunction fill_bitmap_inversefunction s1g_tim_block_testfunction s1g_tim_single_testfunction s1g_tim_olb_testfunction s1g_tim_inverse_block_testfunction s1g_tim_inverse_single_testfunction s1g_tim_inverse_olb_test
Annotated Snippet
switch (mode) {
case IEEE80211_S1G_TIM_ENC_MODE_BLOCK: {
u8 blkmap = *ptr++;
byte_to_bitstr(blkmap, bits);
kunit_info(test, " octet %2u (blk-map) : %s (0x%02x)",
oct, bits, blkmap);
++oct;
for (u8 sb = 0; sb < 8; sb++) {
if (!(blkmap & BIT(sb)))
continue;
u8 sub = *ptr++;
byte_to_bitstr(sub, bits);
kunit_info(
test,
" octet %2u (SB %2u) : %s (0x%02x)",
oct, sb, bits, sub);
++oct;
}
break;
}
case IEEE80211_S1G_TIM_ENC_MODE_SINGLE: {
u8 single = *ptr++;
byte_to_bitstr(single, bits);
kunit_info(test, " octet %2u (single) : %s (0x%02x)",
oct, bits, single);
++oct;
break;
}
case IEEE80211_S1G_TIM_ENC_MODE_OLB: {
u8 len = *ptr++;
byte_to_bitstr(len, bits);
kunit_info(test, " octet %2u (len=%2u) : %s (0x%02x)",
oct, len, bits, len);
++oct;
for (u8 i = 0; i < len && ptr < end; i++) {
u8 sub = *ptr++;
byte_to_bitstr(sub, bits);
kunit_info(
test,
" octet %2u (SB %2u) : %s (0x%02x)",
oct, i, bits, sub);
++oct;
}
break;
}
default:
kunit_info(test, " ** unknown encoding 0x%x **", mode);
return;
}
blk++;
}
}
static void tim_push(u8 **p, u8 v)
{
*(*p)++ = v;
}
static void tim_begin(struct ieee80211_tim_ie *tim, u8 **p)
{
tim->dtim_count = 0;
tim->dtim_period = 1;
tim->bitmap_ctrl = 0;
*p = tim->virtual_map;
}
static u8 tim_end(struct ieee80211_tim_ie *tim, u8 *tail)
{
return tail - (u8 *)tim;
}
static void pvb_add_block_bitmap(u8 **p, u8 blk_off, bool inverse, u8 blk_bmap,
const u8 *subblocks)
{
u8 enc = IEEE80211_S1G_TIM_ENC_MODE_BLOCK;
u8 n = hweight8(blk_bmap);
tim_push(p, BC(enc, inverse, blk_off));
tim_push(p, blk_bmap);
for (u8 i = 0; i < n; i++)
tim_push(p, subblocks[i]);
}
Annotation
- Immediate include surface: `linux/ieee80211.h`, `kunit/test.h`, `kunit/test-bug.h`.
- Detected declarations: `function Copyright`, `function dump_tim_bits`, `function tim_push`, `function tim_begin`, `function tim_end`, `function pvb_add_block_bitmap`, `function pvb_add_single_aid`, `function pvb_add_olb`, `function check_all_aids`, `function fill_bitmap`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- 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.