Setting the HT_PROT flag in the MAC context command forces all data frames
to be preceded by an RTS frame. There's not much wrong with RTS expect that
it slows our transmit speed down, so we should not enable it unnecessarily.

Because we do not support 40 MHz channels yet we do not need to enable
HT protection if the AP asks for "20MHz" protection. It is the 40 MHz
users who need to use RTS when a 20MHz-only user shows up.

So disable HT protection on such networks (which are mostly on 5 GHz)
until we start advertising 40MHz support in our own HT capabilities.

Index: if_iwm.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/if_iwm.c,v
retrieving revision 1.151
diff -u -p -r1.151 if_iwm.c
--- if_iwm.c    8 Dec 2016 17:24:25 -0000       1.151
+++ if_iwm.c    9 Dec 2016 13:40:58 -0000
@@ -5053,10 +5053,14 @@ iwm_mac_ctxt_cmd_common(struct iwm_softc
                case IEEE80211_HTPROT_NONHT_MIXED:
                        cmd->protection_flags |=
                            htole32(IWM_MAC_PROT_FLG_HT_PROT);
+                       break;
                case IEEE80211_HTPROT_20MHZ:
-                       cmd->protection_flags |=
-                           htole32(IWM_MAC_PROT_FLG_HT_PROT |
-                           IWM_MAC_PROT_FLG_FAT_PROT);
+                       if (ic->ic_htcaps & IEEE80211_HTCAP_CBW20_40) {
+                               /* XXX ... and if our channel is 40 MHz ... */
+                               cmd->protection_flags |=
+                                   htole32(IWM_MAC_PROT_FLG_HT_PROT |
+                                   IWM_MAC_PROT_FLG_FAT_PROT);
+                       }
                        break;
                default:
                        break;

Reply via email to