On Wed, Mar 09, 2022 at 01:07:47PM +0100, Stefan Sperling wrote:
> This patch adds initial 11ac support to the iwx(4) driver.
> This means that 80MHz channels can be used. No other 11ac features
> are enabled yet.
>
> This is not yet a patch which could be committed. Apart from debug
> prints which need to go, there is a known issue found by dv@ where
> this patch causes a firmware error, sysassert 0x20101A25. The reason
> for this is not known.
> It would help to get more testing to see if more clues can be found
> based on where this error pops up. I cannot reproduce the error myself.
>
> When sending feedback, please be clear about which iwx(4) device and
> which access point has been tested. Thanks!
>
> The patch works for me on AX200 and AX201 with a pepwave AC one mini AP,
> although throughput is not much different to 11n 40MHz with this AP.
I can't test the functionality of the patch, because I don't own Intel
hardware and proper AP, but during 'git apply' process it warned about
improper whitespacing, the patch for this is inlined at the end of the
mail (need to be applied above your patch).
>
> /*
> + * Install received VHT caps information in the node's state block.
> + */
> +void
> +ieee80211_setup_vhtcaps(struct ieee80211_node *ni, const uint8_t *data,
> + uint8_t len)
> +{
> + if (len != 12)
> + return;
> +
> + ni->ni_vhtcaps = (data[0] | (data[1] << 8) | data[2] << 16 |
> + data[3] << 24);
> + ni->ni_vht_rxmcs = (data[4] | (data[5] << 8));
> + ni->ni_vht_rx_max_lgi_mbit_s = ((data[6] | (data[7] << 8)) &
> + IEEE80211_VHT_MAX_LGI_MBIT_S_MASK);
> + ni->ni_vht_txmcs = (data[8] | (data[9] << 8));
> + ni->ni_vht_tx_max_lgi_mbit_s = ((data[10] | (data[11] << 8)) &
> + IEEE80211_VHT_MAX_LGI_MBIT_S_MASK);
> +
> + ni->ni_flags |= IEEE80211_NODE_VHTCAP;
> +}
I understand that this function do things like ieee80211_setup_htcaps()
(HT, 802.11n), which is mature, working and stable, but is there a
reason not to return 0 on error, 1 on success, and check it in the
caller (like in ieee80211_setup_vhtop())?
> +/* Check if the peer supports VHT short guard interval (SGI) on 160 MHz. */
> +static inline int
> +ieee80211_node_supports_vht_sgi160(struct ieee80211_node *ni)
> +{
> + return ieee80211_node_supports_vht(ni) &&
> + (ni->ni_vhtcaps & IEEE80211_VHTCAP_SGI160);
> +}
This function is unused.
The patch for whitespacing:
diff --git sys/dev/pci/if_iwx.c sys/dev/pci/if_iwx.c
index a56c59f82c8..9efa429df07 100644
--- sys/dev/pci/if_iwx.c
+++ sys/dev/pci/if_iwx.c
@@ -5384,7 +5384,7 @@ iwx_tx_fill_cmd(struct iwx_softc *sc, struct iwx_node *in,
rate_flags |= IWX_RATE_MCS_CHAN_WIDTH_80;
if (ieee80211_node_supports_vht_sgi80(ni))
rate_flags |= IWX_RATE_MCS_SGI_MSK;
- } else if ((sco == IEEE80211_HTOP0_SCO_SCA ||
+ } else if ((sco == IEEE80211_HTOP0_SCO_SCA ||
sco == IEEE80211_HTOP0_SCO_SCB) &&
in->in_phyctxt != NULL && in->in_phyctxt->sco == sco) {
rate_flags |= IWX_RATE_MCS_CHAN_WIDTH_40;
@@ -7020,7 +7020,7 @@ iwx_rs_vht_rates(struct iwx_softc *sc, struct
ieee80211_node *ni, int num_ss)
/* Should not happen; Values above cover the possible range. */
panic("invalid VHT Rx MCS value %u", rx_mcs);
}
-
+
return ((1 << (max_mcs + 1)) - 1);
}
diff --git sys/net80211/ieee80211_node.c sys/net80211/ieee80211_node.c
index c874c874657..a6833e255ff 100644
--- sys/net80211/ieee80211_node.c
+++ sys/net80211/ieee80211_node.c
@@ -2458,7 +2458,7 @@ ieee80211_setup_vhtop(struct ieee80211_node *ni, const
uint8_t *data,
}
#ifndef IEEE80211_STA_ONLY
-/*
+/*
* Handle nodes switching from 11ac into legacy modes.
*/
void
diff --git sys/net80211/ieee80211_node.h sys/net80211/ieee80211_node.h
index e64e3ec26b2..a0c82378eb4 100644
--- sys/net80211/ieee80211_node.h
+++ sys/net80211/ieee80211_node.h
@@ -420,8 +420,8 @@ struct ieee80211_node {
#define IEEE80211_NODE_VHT 0x10000 /* VHT negotiated */
#define IEEE80211_NODE_HTCAP 0x20000 /* claims to support HT */
#define IEEE80211_NODE_VHTCAP 0x40000 /* claims to support VHT */
-#define IEEE80211_NODE_VHT_SGI80 0x80000 /* SGI on 80 MHz negotiated */
-#define IEEE80211_NODE_VHT_SGI160 0x100000 /* SGI on 160 MHz negotiated
*/
+#define IEEE80211_NODE_VHT_SGI80 0x80000 /* SGI on 80 MHz negotiated */
+#define IEEE80211_NODE_VHT_SGI160 0x100000 /* SGI on 160 MHz negotiated */
/* If not NULL, this function gets called when ni_refcnt hits zero. */
void (*ni_unref_cb)(struct ieee80211com *,
@@ -516,7 +516,7 @@ ieee80211_node_supports_ht_chan40(struct ieee80211_node *ni)
(ni->ni_htop0 & IEEE80211_HTOP0_CHW));
}
-/*
+/*
* Check if the peer supports VHT.
* Require a VHT capabilities IE and support for VHT MCS with a single
* spatial stream.
@@ -560,8 +560,8 @@ ieee80211_node_supports_vht_chan80(struct ieee80211_node
*ni)
cap_chan_width = (ni->ni_vhtcaps & IEEE80211_VHTCAP_CHAN_WIDTH_MASK) >>
IEEE80211_VHTCAP_CHAN_WIDTH_SHIFT;
- if (cap_chan_width != IEEE80211_VHTCAP_CHAN_WIDTH_80 &&
- cap_chan_width != IEEE80211_VHTCAP_CHAN_WIDTH_160 &&
+ if (cap_chan_width != IEEE80211_VHTCAP_CHAN_WIDTH_80 &&
+ cap_chan_width != IEEE80211_VHTCAP_CHAN_WIDTH_160 &&
cap_chan_width != IEEE80211_VHTCAP_CHAN_WIDTH_160_8080)
return 0;