nl80211_chan_width_to_mhz(9)
π 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 fromenum 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_widthyou passed in fromenum nl80211_chan_widthis 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.-1is 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.hIntroduction(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:
_ieee80211_set_sband_iftype_data(9)ieee80211_set_sband_iftype_data(9)for_each_sband_iftype_data(9)ieee80211_get_sband_iftype_data(9)ieee80211_get_he_iftype_cap(9)ieee80211_get_he_6ghz_capa(9)ieee80211_get_eht_iftype_cap(9)ieee80211_get_uhr_iftype_cap(9)
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:
cfg80211_get_chandef_type(9)cfg80211_chandef_create(9)cfg80211_chandef_identical(9)cfg80211_chandef_is_edmg(9)cfg80211_chandef_is_s1g(9)cfg80211_chandef_compatible(9)cfg80211_chandef_get_width(9)cfg80211_chandef_valid(9)cfg80211_chandef_usable(9)cfg80211_chandef_dfs_required(9)cfg80211_chandef_dfs_usable(9)cfg80211_chandef_dfs_cac_time(9)cfg80211_chandef_primary(9)cfg80211_chandef_npca_valid(9)cfg80211_chandef_add_npca(9)cfg80211_chandef_add_dbe(9)nl80211_send_chandef(9)ieee80211_chandef_max_power(9)cfg80211_chandef_s1g_pri_width(9)cfg80211_any_usable_channels(9)
(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)
π stations, links & all their params
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:
wiphy_priv(9)priv_to_wiphy(9)set_wiphy_dev(9)wiphy_dev(9)wiphy_name(9)wiphy_new_nm(9)wiphy_new(9)wiphy_register(9)rcu_dereference_wiphy(9)wiphy_dereference(9)get_wiphy_regdom(9)wiphy_unregister(9)wiphy_free(9)wiphy_lock(9)wiphy_unlock(9)
the work-queue quartet (plus delayed, plus hrtimer β it's a whole ecosystem babes):
wiphy_work_queue(9)wiphy_work_cancel(9)wiphy_work_flush(9)wiphy_delayed_work_queue(9)wiphy_delayed_work_cancel(9)wiphy_delayed_work_flush(9)wiphy_delayed_work_pending(9)wiphy_hrtimer_work_queue(9)wiphy_hrtimer_work_cancel(9)wiphy_hrtimer_work_flush(9)wiphy_hrtimer_work_pending(9)
back to radio-ish + the wdev crowd:
enum ieee80211_ap_reg_power(9)struct wireless_dev(9)wdev_priv(9)wdev_chandef(9)
π§ utility functions (the useful girlies)
exactly the kind of page you end up on at 2am, and honestly? worth it:
Utility functions(9)ieee80211_channel_equal(9)ieee80211_channel_to_khz(9)ieee80211_channel_to_freq_khz(9)ieee80211_channel_to_frequency(9)ieee80211_freq_khz_to_channel(9)ieee80211_frequency_to_channel(9)ieee80211_get_channel_khz(9)ieee80211_get_channel(9)cfg80211_channel_is_psc(9)ieee80211_radio_freq_range_valid(9)cfg80211_radio_chandef_valid(9)cfg80211_wdev_channel_allowed(9)ieee80211_get_response_rate(9)ieee80211_mandatory_rates(9)struct ieee80211_radiotap_iterator(9)ieee80211_get_hdrlen_from_skb(9)ieee80211_hdrlen(9)ieee80211_get_mesh_hdrlen(9)
π data path helpers + element finding
Data path helpers(9)ieee80211_data_to_8023_exthdr(9)ieee80211_data_to_8023(9)ieee80211_is_valid_amsdu(9)ieee80211_amsdu_to_8023s(9)ieee80211_get_8023_tunnel_proto(9)ieee80211_strip_8023_mesh_hdr(9)cfg80211_classify8021d(9)
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":
cfg80211_find_elem_match(9)cfg80211_find_ie_match(9)cfg80211_find_elem(9)cfg80211_find_ie(9)cfg80211_find_ext_elem(9)cfg80211_find_ext_ie(9)cfg80211_find_vendor_elem(9)cfg80211_find_vendor_ie(9)enum cfg80211_rnr_iter_ret(9)cfg80211_iter_rnr(9)cfg80211_defragment_element(9)cfg80211_send_layer2_update(9)
π regulatory enforcement infrastructure
the rules girlies. you do not get to ignore them:
Regulatory enforcement infrastructure(9)regulatory_hint(9)regulatory_set_wiphy_regd(9)regulatory_set_wiphy_regd_sync(9)wiphy_apply_custom_regulatory(9)freq_reg_info(9)reg_initiator_name(9)regulatory_pre_cac_allowed(9)
πΈ internal regulatory db functions
Internal regulatory db functions(9)reg_query_regdb_wmm(9)
π₯ scan done, BSS informing & MLME notifications
cfg80211_scan_done(9)cfg80211_sched_scan_results(9)cfg80211_sched_scan_stopped(9)cfg80211_sched_scan_stopped_locked(9)cfg80211_inform_bss_frame_data(9)cfg80211_gen_new_bssid(9)cfg80211_is_element_inherited(9)cfg80211_merge_profile(9)enum cfg80211_bss_frame_type(9)cfg80211_get_ies_channel_number(9)cfg80211_ssid_eq(9)cfg80211_inform_bss_data(9)__cfg80211_get_bss(9)cfg80211_get_bss(9)cfg80211_ref_bss(9)cfg80211_put_bss(9)cfg80211_unlink_bss(9)cfg80211_bss_iter(9)cfg80211_rx_mlme_mgmt(9)cfg80211_auth_timeout(9)struct cfg80211_rx_assoc_resp_data(9)cfg80211_rx_assoc_resp(9)struct cfg80211_assoc_failure(9)cfg80211_assoc_failure(9)cfg80211_tx_mlme_mgmt(9)cfg80211_rx_unprot_mlme_mgmt(9)cfg80211_michael_mic_failure(9)cfg80211_ibss_joined(9)cfg80211_notify_new_peer_candidate(9)
π RFkill integration
the "please turn off your wifi on the plane" girlies:
RFkill integration(9)wiphy_rfkill_set_hw_state_reason(9)wiphy_rfkill_start_polling(9)wiphy_rfkill_stop_polling(9)
π vendor commands (yes, the OEMs get their own club)
Vendor commands(9)cfg80211_vendor_cmd_alloc_reply_skb(9)cfg80211_vendor_cmd_reply(9)cfg80211_vendor_cmd_get_sender(9)cfg80211_vendor_event_alloc(9)cfg80211_vendor_event_alloc_ucast(9)cfg80211_vendor_event(9)
π test mode
for the lab girlies. careful in here π
Test mode(9)cfg80211_testmode_alloc_reply_skb(9)cfg80211_testmode_reply(9)cfg80211_testmode_alloc_event_skb(9)cfg80211_testmode_event(9)
π«Ά connect / roam / disconnect reporting
struct cfg80211_fils_resp_params(9)struct cfg80211_connect_resp_params(9)cfg80211_connect_done(9)cfg80211_connect_bss(9)cfg80211_connect_result(9)cfg80211_connect_timeout(9)struct cfg80211_roam_info(9)cfg80211_roamed(9)cfg80211_port_authorized(9)cfg80211_disconnected(9)
π¦ remain-on-channel, mgmt tx status & station life events
cfg80211_ready_on_channel(9)cfg80211_remain_on_channel_expired(9)cfg80211_tx_mgmt_expired(9)cfg80211_sinfo_alloc_tid_stats(9)cfg80211_link_sinfo_alloc_tid_stats(9)cfg80211_sinfo_release_content(9)cfg80211_new_sta(9)cfg80211_del_sta_sinfo(9)cfg80211_del_sta(9)cfg80211_conn_failed(9)
π rx/tx mgmt & control port
struct cfg80211_rx_info(9)cfg80211_rx_mgmt_ext(9)cfg80211_rx_mgmt_khz(9)cfg80211_rx_mgmt(9)struct cfg80211_tx_status(9)cfg80211_mgmt_tx_status_ext(9)cfg80211_mgmt_tx_status(9)cfg80211_control_port_tx_status(9)cfg80211_rx_control_port(9)
π cqm, radar, cac & the notify girlies
the "tell userspace something happened" hall of fame:
cfg80211_cqm_rssi_notify(9)cfg80211_cqm_pktloss_notify(9)cfg80211_cqm_txe_notify(9)cfg80211_cqm_beacon_loss_notify(9)__cfg80211_radar_event(9)cfg80211_sta_opmode_change_notify(9)cfg80211_cac_event(9)cfg80211_background_cac_abort(9)cfg80211_gtk_rekey_notify(9)cfg80211_pmksa_candidate_notify(9)cfg80211_rx_spurious_frame(9)cfg80211_rx_unexpected_4addr_frame(9)cfg80211_probe_status(9)cfg80211_report_obss_beacon_khz(9)cfg80211_report_obss_beacon(9)struct cfg80211_beaconing_check_config(9)
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:
cfg80211_reg_check_beaconing(9)β the "can we even beacon here tho" check β¨cfg80211_reg_can_beacon(9)β same vibe, the classiccfg80211_reg_can_beacon_relax(9)β the chill version of the above π¦cfg80211_ch_switch_notify(9)β telling everyone the channel changedcfg80211_ch_switch_started_notify(9)β and telling them it started changingieee80211_operating_class_to_band(9)β op class β band, iconic conversion behavior πieee80211_operating_class_to_chandef(9)β op class β channel definitionieee80211_chandef_to_operating_class(9)β the reverse, slay π₯ieee80211_chandef_to_khz(9)β chandef in kHz, extremely useful fr frcfg80211_tdls_oper_request(9)β TDLS business, don't askcfg80211_calculate_bitrate(9)β math but make it wifi πcfg80211_unregister_wdev(9)β bye bestie πcfg80211_register_netdevice(9)β hi bestie π«Άcfg80211_unregister_netdevice(9)β bye again πstruct cfg80211_ft_event_params(9)β a whole struct, main character energycfg80211_ft_event(9)β fast transition eventcfg80211_get_p2p_attr(9)β grabbing P2P attributesieee80211_ie_split_ric(9)β splitting IEs, RIC editionieee80211_ie_split(9)β splitting IEs, plain edition β¨ieee80211_fragment_element(9)β chopping elements into fragmentscfg80211_report_wowlan_wakeup(9)β wowlan woke up, tell someone πΈcfg80211_crit_proto_stopped(9)β critical protocol said peace outieee80211_get_num_supported_channels(9)β how many channels we got, a number, love thatcfg80211_check_combinations(9)β checking combos, the responsible thingcfg80211_iter_combinations(9)β iterating combos, the thorough thingcfg80211_get_radio_idx_by_chan(9)β which radio owns this channel, iykykcfg80211_stop_link(9)β stop that linkcfg80211_stop_iface(9)β stop that ifacecfg80211_shutdown_all_interfaces(9)β stop all the ifaces, dramatic and correct πwiphy_ext_feature_set(9)β setting an extended feature bitwiphy_ext_feature_isset(9)β is that bit set thocfg80211_free_nan_func(9)β free the NAN function, be nice to memorystruct cfg80211_nan_match_params(9)β another struct, another slaycfg80211_nan_match(9)β NAN match, we love a discoverycfg80211_nan_func_terminated(9)β the NAN function is donecfg80211_nan_sched_update_done(9)β schedule update finished βcfg80211_external_auth_request(9)β external auth, asking nicelycfg80211_pmsr_report(9)β PMSR report incomingcfg80211_pmsr_complete(9)β PMSR complete, periodtcfg80211_iftype_allowed(9)β is this interface type allowed herecfg80211_assoc_comeback(9)β assoc comeback, literally the namecfg80211_update_owe_info_event(9)β OWE info update eventcfg80211_bss_flush(9)β flush the BSS list π§Ήcfg80211_bss_color_notify(9)β BSS color notifcfg80211_obss_color_collision_notify(9)β color collision, sound the alarm π¨cfg80211_color_change_started_notify(9)β color change startedcfg80211_color_change_aborted_notify(9)β color change aborted, sad but validcfg80211_color_change_notify(9)β color change, the main onecfg80211_6ghz_power_type(9)β 6 GHz power type, the new era βcfg80211_links_removed(9)β links got removed, ripstruct cfg80211_mlo_reconf_done_data(9)β MLO reconf data structcfg80211_mlo_reconf_add_done(9)β reconf add done πcfg80211_schedule_channels_check(9)β schedule that channel checkcfg80211_epcs_changed(9)β EPCS changed, notedcfg80211_next_nan_dw_notif(9)β next NAN DW notifcfg80211_nan_cluster_joined(9)β joined the NAN cluster πcfg80211_nan_ulw_update(9)β NAN ULW updatecfg80211_nan_channel_evac(9)β NAN channel evacuation πββοΈwiphy_locked_debugfs_read(9)β debugfs read, but locked πwiphy_locked_debugfs_write(9)β debugfs write, also lockedcfg80211_s1g_get_start_freq_khz(9)β S1G start freq in kHzcfg80211_s1g_get_end_freq_khz(9)β S1G end freq in kHzcfg80211_s1g_get_primary_sibling(9)β S1G primary sibling, sure bestiecfg80211_incumbent_signal_notify(9)β incumbent signal notif, the last one on the list π
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms