]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - net/mac80211/tx.c
mac80211: fix CTS protection handling
[mirror_ubuntu-bionic-kernel.git] / net / mac80211 / tx.c
index 15c1b286e280693399905c83f71b55581dd43f48..6ca857f8f4248d2e7767c0dd464a29eb579df2a3 100644 (file)
@@ -656,6 +656,9 @@ ieee80211_tx_h_rate_ctrl(struct ieee80211_tx_data *tx)
                txrc.rts = rts = true;
        }
 
+       info->control.use_rts = rts;
+       info->control.use_cts_prot = tx->sdata->vif.bss_conf.use_cts_prot;
+
        /*
         * Use short preamble if the BSS can handle it, but not for
         * management frames unless we know the receiver can handle
@@ -766,6 +769,11 @@ ieee80211_tx_h_rate_ctrl(struct ieee80211_tx_data *tx)
                 */
                if (rc_rate->flags & IEEE80211_TX_RC_MCS) {
                        WARN_ON(rc_rate->idx > 76);
+
+                       if (!(rc_rate->flags & IEEE80211_TX_RC_USE_RTS_CTS) &&
+                           tx->sdata->vif.bss_conf.use_cts_prot)
+                               rc_rate->flags |=
+                                       IEEE80211_TX_RC_USE_CTS_PROTECT;
                        continue;
                }