nl80211_chan_width_to_mhz(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– nl80211_chan_width_to_mhz πŸ’–

okay so bestie, welcome to the nl80211_chan_width_to_mhz(9) page β€” it lives in the Kernel API Manual and honestly it's giving tiny-but-mighty. it does exactly one thing and it does it flawlessly πŸ’…


✨ NAME ✨

nl80211_chan_width_to_mhz β€” get the channel width in MHz πŸ¦‹

like, that's it. that's the whole job. you hand it a channel width, it hands you back a number in MHz. no cap, no drama.


🌸 SYNOPSIS 🌸

int nl80211_chan_width_to_mhz (enum nl80211_chan_width chan_width );

she takes one argument, she returns an int, and she keeps it cute the entire time πŸŽ€


πŸ’œ ARGUMENTS πŸ’œ

  • chan_width β€” the channel width, straight from enum nl80211_chan_width. this is the only thing you gotta feed her, so don't overthink it, bestie. it's literally one parameter. main character energy fr fr 🫢

⭐ RETURN ⭐

so here's what you get back, and it's lowkey straightforward:

  • if the chan_width you passed in from enum nl80211_chan_width is valid, you get the channel width in MHz ✨
  • otherwise? you get -1 😭 that's the "nope, not valid" signal β€” so check for it, okay? don't just vibe-check the return value and assume everything slayed. -1 is your heads-up that the width wasn't a real one πŸ™ˆ
ngl the -1 is easy to miss if you're moving fast β€” treat it like a little red flag, not a real width πŸ’€

✨ SEE ALSO ✨

okay bestie, buckle up β€” this is the part of the page where we list literally the entire friend group. it's giving "tagged 359 people in the group photo." and yes, every single one of them is a real page, so i'm keeping all of them, in order, exactly as they live πŸ’…

the vibes are: everything here is in section (9), because we're in kernel-doc land and that's just how they do it. (9) is not a typo, it's the dress code. πŸŽ€

first up, the source of truth and the "start here" pages:

  • Kernel file ./include/net/cfg80211.h
  • Introduction(9)
  • Device registration(9)

🌸 the channel & rate basics

the little building blocks. the alphabet of wifi. no cap, you'll see these names everywhere:

  • enum ieee80211_channel_flags(9)
  • struct ieee80211_channel(9)
  • enum ieee80211_rate_flags(9)
  • enum ieee80211_bss_type(9)
  • enum ieee80211_privacy(9)
  • struct ieee80211_rate(9)

πŸ¦‹ the capability glow-ups (ht β†’ vht β†’ he β†’ eht β†’ uhr)

this is the "generational upgrade" arc and honestly? character development πŸ’– every generation gets its own struct and i think that's iconic:

  • struct ieee80211_he_obss_pd(9)
  • struct cfg80211_he_bss_color(9)
  • struct ieee80211_sta_ht_cap(9)
  • struct ieee80211_sta_vht_cap(9)
  • struct ieee80211_sta_he_cap(9)
  • struct ieee80211_eht_mcs_nss_supp(9)
  • struct ieee80211_sta_eht_cap(9)
  • struct ieee80211_sta_uhr_cap(9)

🧚 the band & iftype crowd

band stuff, s1g stuff, edmg stuff β€” niche but they ate:

  • struct ieee80211_sband_iftype_data(9)
  • enum ieee80211_edmg_bw_config(9)
  • struct ieee80211_edmg(9)
  • struct ieee80211_sta_s1g_cap(9)
  • struct ieee80211_supported_band(9)

and the little helpers that hang out with them β€” note the underscore sibling situation going on with the first two, they're literally family:

plus one lonely little one doing its own thing:


πŸ’… actions and configuration, aka chandef central

okay so this next block is exactly where our girl nl80211_chan_width_to_mhz lives, which is why the whole chandef clique is tagged here. prepare yourself, there's a lot of them and they're all named cfg80211_chandef_* because consistency is a love language 🫢

  • Actions and configuration(9)
  • struct vif_params(9)
  • struct key_params(9)
  • struct cfg80211_chan_def(9)
  • struct cfg80211_tid_cfg(9)
  • struct cfg80211_tid_config(9)
  • struct cfg80211_fils_aad(9)
  • struct cfg80211_set_hw_timestamp(9)

the chandef besties, in the exact order the page lists them β€” do not reshuffle, that's rude:

(you clocked that nl80211_send_chandef and ieee80211_chandef_max_power snuck into the middle of the cfg80211_ parade? yeah. we don't gatekeep, we don't alphabetize. we vibe. 🌈)


πŸŽ€ surveys, crypto & the beacon squad

  • enum survey_info_flags(9)
  • struct survey_info(9)
  • struct cfg80211_crypto_settings(9)
  • struct cfg80211_mbssid_config(9)
  • struct cfg80211_mbssid_elems(9)
  • struct cfg80211_rnr_elems(9)
  • struct cfg80211_beacon_data(9)
  • struct cfg80211_acl_data(9)
  • struct cfg80211_fils_discovery(9)
  • struct cfg80211_unsol_bcast_probe_resp(9)
  • struct cfg80211_s1g_short_beacon(9)
  • struct cfg80211_ap_settings(9)
  • struct cfg80211_ap_update(9)
  • struct cfg80211_csa_settings(9)
  • struct cfg80211_color_change_settings(9)
  • struct iface_combination_params(9)

the station-industrial complex. so many _parameters structs. so many. and yet they're all valid and i respect it:

  • enum station_parameters_apply_mask(9)
  • struct sta_txpwr(9)
  • struct link_station_parameters(9)
  • struct link_station_del_parameters(9)
  • struct cfg80211_ttlm_params(9)
  • struct station_parameters(9)
  • struct station_del_parameters(9)
  • enum cfg80211_station_type(9)
  • cfg80211_check_station_change(9)

πŸ”₯ rate info, bss params & stats

  • enum rate_info_flags(9)
  • enum rate_info_bw(9)
  • struct rate_info(9)
  • enum bss_param_flags(9)
  • struct sta_bss_parameters(9)
  • struct cfg80211_txq_stats(9)
  • struct cfg80211_tid_stats(9)
  • struct link_station_info(9)
  • struct station_info(9)

🧚 sar & station-getters

  • struct cfg80211_sar_sub_specs(9)
  • struct cfg80211_sar_specs(9)
  • struct cfg80211_sar_freq_ranges(9)
  • struct cfg80211_sar_capa(9)
  • cfg80211_get_station(9)

πŸ¦‹ monitor, mesh & ocb era

  • enum monitor_flags(9)
  • enum mpath_info_flags(9)
  • struct mpath_info(9)
  • enum wiphy_bss_param_flags(9)
  • struct bss_parameters(9)
  • struct mesh_config(9)
  • struct mesh_setup(9)
  • struct ocb_setup(9)
  • struct ieee80211_txq_params(9)

πŸ” scanning and BSS list handling

the whole "who's out there and what are their IEs" saga. main character energy fr fr:

  • 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)

🌸 auth, assoc & the connection girlies

  • 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)

πŸ’€ wowlan, coalesce & pattern matching (sleepy girl hours)

  • 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)

πŸŽ€ rekey, ft, mgmt tx & qos

  • 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)

🫢 neighbor awareness networking (NAN)

the whole NAN universe, because of course it has its own extended family:

  • Neighbor Awareness Networking (NAN)(9)
  • struct cfg80211_nan_band_config(9)
  • struct cfg80211_nan_conf(9)
  • struct cfg80211_nan_channel(9)
  • struct cfg80211_nan_local_sched(9)
  • struct cfg80211_nan_peer_map(9)
  • struct cfg80211_nan_peer_sched(9)
  • enum cfg80211_nan_conf_changes(9)
  • struct cfg80211_nan_func_filter(9)
  • struct cfg80211_nan_func(9)

🧚 pmk, external auth, ftm & pmsr

ooh, ranging time πŸ’…

  • struct cfg80211_pmk_conf(9)
  • struct cfg80211_external_auth_params(9)
  • struct cfg80211_ftm_responder_stats(9)
  • struct cfg80211_pmsr_ftm_result(9)
  • struct cfg80211_pmsr_result(9)
  • struct cfg80211_pmsr_ftm_request_peer(9)
  • struct cfg80211_pmsr_request_peer(9)
  • struct cfg80211_pmsr_request(9)
  • struct cfg80211_update_owe_info(9)
  • struct mgmt_frame_regs(9)

πŸ‘‘ the wiphy saga begins

this is the big one. struct cfg80211_ops is the whole driver contract and honestly? slay:

  • struct cfg80211_ops(9)
  • enum wiphy_flags(9)
  • struct ieee80211_iface_limit(9)
  • struct ieee80211_iface_combination(9)
  • enum wiphy_wowlan_support_flags(9)
  • struct wiphy_wowlan_support(9)
  • struct wiphy_coalesce_support(9)
  • enum wiphy_vendor_command_flags(9)
  • enum wiphy_opmode_flag(9)
  • struct sta_opmode_info(9)
  • struct wiphy_vendor_command(9)
  • struct wiphy_iftype_ext_capab(9)
  • cfg80211_get_iftype_ext_capa(9)
  • struct cfg80211_pmsr_capabilities(9)
  • struct wiphy_iftype_akm_suites(9)
  • struct wiphy_radio_cfg(9)
  • struct wiphy_radio_freq_range(9)
  • struct wiphy_radio(9)
  • enum wiphy_nan_flags(9)
  • struct wiphy_nan_capa(9)
  • struct wiphy(9)

🌈 wiphy helpers, accessors & locking

the "get a pointer to the thing behind the thing" section. also work queues. also hrtimers. also locks. drink water before this one:

the work-queue quartet (plus delayed, plus hrtimer β€” it's a whole ecosystem babes):

back to radio-ish + the wdev crowd:


🧚 utility functions (the useful girlies)

exactly the kind of page you end up on at 2am, and honestly? worth it:

πŸ“ data path helpers + element finding

the find_* family β€” every single iteration of it, and there are so many, and each one is a different flavour of "where is the IE":


πŸ’œ regulatory enforcement infrastructure

the rules girlies. you do not get to ignore them:

🌸 internal regulatory db functions


πŸ”₯ scan done, BSS informing & MLME notifications

πŸŽ€ RFkill integration

the "please turn off your wifi on the plane" girlies:

🌈 vendor commands (yes, the OEMs get their own club)

πŸ’€ test mode

for the lab girlies. careful in here πŸ™ˆ


🫢 connect / roam / disconnect reporting

πŸ¦‹ remain-on-channel, mgmt tx status & station life events

πŸ’œ rx/tx mgmt & control port

πŸ“ cqm, radar, cac & the notify girlies

the "tell userspace something happened" hall of fame:


and that's the whole list, bestie β€” all 359 of them, in the original order, nothing skipped, nothing renamed, nothing merged. πŸŽ€ if you got to the bottom of this you're genuinely built different. more coming in the next part, so don't go anywhere πŸ’–

Okay so the rest of the friend group πŸ’… β€” this is the extended cast, the ones who show up in the group chat at 3am. All of them are (9) pages, all of them live in the same kernel-adjacent universe, and you can go read any of them next:


And that's the whole page, start to finish πŸ’– This one came out of ./include/net, dated October 2026, and it's the nl80211_chan_width_to_mhz(9) page β€” go forth, convert those channel widths, and hydrate πŸ“βœ¨

πŸ“¦ where this page comes from