Documentation
¶
Overview ¶
Package htmodes decodes raw nl80211 HT/VHT/HE/EHT capability fields into OpenSOHO's htmode vocabulary ("HT20", "VHT80", "HE160", "EHT320", ...).
Go port of iwinfo's nl80211_eval_modelist, so this can be run per radio instead of per (possibly shared) wiphy - see OpenSOHO issue #59 https://github.com/openwrt/iwinfo/blob/66bdd1a071895d91babc9b9228bb84626bbce226/iwinfo_nl80211.c#L3341-L3418
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CapPHY ¶
type CapPHY []byte
CapPHY is a raw PHY capability element (NL80211_BAND_IFTYPE_ATTR_HE_CAP_PHY / EHT_CAP_PHY). ucode's nl80211 module renders these DT_U8|DF_ARRAY attributes as a JSON array of numbers, not the base64 string encoding/json uses for a plain []byte.
func (*CapPHY) UnmarshalJSON ¶
type Capabilities ¶
type Capabilities struct {
HTCapa uint16 `json:"ht_capa"` // NL80211_BAND_ATTR_HT_CAPA verbatim; 0 = absent.
VHTCapa uint32 `json:"vht_capa"` // NL80211_BAND_ATTR_VHT_CAPA verbatim; 0 = absent.
HECapPHY CapPHY `json:"he_cap_phy"` // only byte 0 is used.
EHTCapPHY CapPHY `json:"eht_cap_phy"` // only byte 0 is used.
}
Capabilities holds the raw per-band nl80211 capability fields for a single radio, as reported by scripts/dump-radios.uc's radio_caps().
func (Capabilities) Modes ¶
func (c Capabilities) Modes(band string) []string
Modes returns the htmode values this radio supports on the given band ("2.4", "5", "6", or "60", matching frequencyplan's vocabulary), sorted and de-duplicated. Only VHT (5 GHz) and EHT320 (6 GHz) are band-gated, matching upstream; HT/HE/EHT<320 are not. 80+80 MHz isn't in this project's htmode vocabulary (see htModesForBand in opensoho.go), so its bits are only consulted as a *160 trigger, never their own string.