cfg80211_get_p2p_attr(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ cfg80211_get_p2p_attr(9) ✨

okay bestie, welcome to the Kernel API Manual πŸ’… this one's called cfg80211_get_p2p_attr and it's lowkey iconic β€” it's your little helper for digging a P2P attribute out of a buffer of information elements and copying it somewhere you can actually use it. no cap, it's giving "search and rescue but make it wifi" πŸ¦‹


🌸 NAME 🌸

cfg80211_get_p2p_attr β€” find and copy a P2P attribute from IE buffer πŸ’–

like, literally, that's the whole job. find the thing, copy the thing. slay.


πŸŽ€ SYNOPSIS πŸŽ€

int cfg80211_get_p2p_attr (const u8 *ies , unsigned int len , enum
       ieee80211_p2p_attr_id attr , u8 *buf , unsigned int bufsize );

that's the whole signature, bestie β€” don't @ me if your editor wraps it weird, that's just how the manual page rolls πŸ™ˆ


πŸ’œ ARGUMENTS πŸ’œ

  • ies β€” the input IE buffer. this is where the function goes looking for your goodies, so like… give it something to work with 🫢
  • len β€” the input length. yes, you have to tell it how long the buffer is. the kernel is not a mind reader, unfortunately 😭
  • attr β€” the attribute ID to find πŸ‘‘ this is the specific thing you're hunting for, typed as an enum ieee80211_p2p_attr_id
  • buf β€” the output buffer, and here's the tea: it can be NULL if the data isn't needed, e.g. if the function is only called to get the needed buffer size ✨ classic two-step move: ask for the size first, then come back with a real buffer. main character energy.
  • bufsize β€” size of the output buffer. keep it honest, bestie πŸ’€

πŸ¦‹ DESCRIPTION πŸ¦‹

so the function finds a given P2P attribute in the (vendor) IEs and copies its contents to the given buffer. that's it, that's the vibe. it's a lookup plus a copy, and honestly? we love a function that does exactly what it says 🌈


⭐ RETURN ⭐

here's the iykyk part β€” what comes back at you:

  • a negative error code β€” either -EILSEQ or -ENOENT β€” if the data is malformed, or if the attribute can't be found (respectively) πŸ’€ so yes, those are two different flavours of "nope", and the "respectively" is doing real work there: -EILSEQ = malformed data, -ENOENT = attribute not found
  • or the length of the found attribute β€” which, and this is important, can be zero πŸŽ€ so a 0 return is a legit success case, not an error. do not come for zero, zero has rights.

and that's part one, bestie β€” more coming, don't go anywhere 🌸

✨ SEE ALSO ✨

okay bestie this is the part where the manpage just dumps the entire friend group on you 😭 β€” like every single related page it knows. it's giving "tag yourself, i'm cfg80211_chandef_valid(9)". no cap, this is a long one, so hydrate and let's go πŸ’–

the whole family lives in ./include/net/cfg80211.h, and the vibes start here:


then we get into the config / actions girlies, and honestly? they ate πŸ’…


scanning era πŸ¦‹ β€” the "where is everything and who's out there" section, lowkey iconic:

  • Scanning and BSS list handling(9)
  • struct cfg80211_ssid(9)
  • struct cfg80211_scan_info(9)
  • struct cfg80211_scan_6ghz_params(9)
  • struct cfg80211_scan_request(9)
  • struct cfg80211_match_set(9)
  • struct cfg80211_sched_scan_plan(9)
  • struct cfg80211_bss_select_adjust(9)
  • struct cfg80211_sched_scan_request(9)
  • enum cfg80211_signal_type(9)
  • struct cfg80211_inform_bss(9)
  • struct cfg80211_bss_ies(9)
  • struct cfg80211_bss(9)
  • ieee80211_bss_get_elem(9)
  • ieee80211_bss_get_ie(9)
  • struct cfg80211_auth_request(9)
  • struct cfg80211_assoc_link(9)
  • struct cfg80211_ml_reconf_req(9)
  • enum cfg80211_assoc_req_flags(9)
  • struct cfg80211_assoc_request(9)
  • struct cfg80211_deauth_request(9)
  • struct cfg80211_disassoc_request(9)
  • struct cfg80211_ibss_params(9)
  • struct cfg80211_bss_selection(9)
  • struct cfg80211_connect_params(9)
  • enum cfg80211_connect_params_changed(9)
  • enum wiphy_params_flags(9)
  • struct cfg80211_pmksa(9)
  • struct cfg80211_pkt_pattern(9)
  • struct cfg80211_wowlan_tcp(9)
  • struct cfg80211_wowlan(9)
  • struct cfg80211_coalesce_rules(9)
  • struct cfg80211_coalesce(9)
  • struct cfg80211_wowlan_nd_match(9)
  • struct cfg80211_wowlan_nd_info(9)
  • struct cfg80211_wowlan_wakeup(9)
  • struct cfg80211_gtk_rekey_data(9)
  • struct cfg80211_update_ft_ies_params(9)
  • struct cfg80211_mgmt_tx_params(9)
  • struct cfg80211_dscp_exception(9)
  • struct cfg80211_dscp_range(9)
  • struct cfg80211_qos_map(9)

NAN squad, PMSR besties, and honestly the wiphy girlies deserve their own moment πŸ‘‘


utility functions + data path helpers, aka the "glue that makes it all work" crew 🫢


regulatory enforcement (yes she's the strict one and we love her for it) ✨


the rest of the extended fam β€” rfkill, vendor commands, test mode, and all the notify besties πŸ’œ

and that's the whole guest list πŸŽ€ like yes it's a lot, but every single one of them is somebody's hyperfixation and honestly? respect.

bestie that's the entire extended fam right there β€” like sixty-plus pages of wifi lore, all cross-linked, all yours πŸ’…βœ¨ no cap, that's a reading list.

okay and that's a wrap on the whole page πŸŽ€ it lives at ./include/net in the tree, it's the October 2026 edition, and it's filed under cfg80211_get_p2p_attr(9) β€” go read the P2P attributes, drink some water, and slay your kernel module πŸ’–πŸ¦‹ periodt 🌈✨

πŸ“¦ where this page comes from