Skip to content

Commit

Permalink
iwm: Fix a bug of sending data frames through invalid antenna, for ex…
Browse files Browse the repository at this point in the history
…ample, ac9462/ac9461 only have single antenna name ANT A and should not send the data to ANT B. This issue was introduced from the firmware update commit.
  • Loading branch information
zxystd committed Apr 25, 2022
1 parent 9317202 commit 596ee10
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions itlwm/hal_iwm/mac80211.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1604,7 +1604,8 @@ iwm_tx_fill_cmd(struct iwm_softc *sc, struct iwm_node *in,
rinfo = &iwm_rates[ridx];
if (iwm_is_mimo_ht_plcp(rinfo->ht_plcp) || iwm_is_mimo_vht_plcp(rinfo->vht_plcp))
rate_flags = IWM_RATE_MCS_ANT_AB_MSK;
else if (sc->sc_device_family == IWM_DEVICE_FAMILY_9000)
else if (sc->sc_device_family == IWM_DEVICE_FAMILY_9000 &&
(iwm_fw_valid_tx_ant(sc) & IWM_ANT_B))
rate_flags = IWM_RATE_MCS_ANT_B_MSK;
else
rate_flags = IWM_RATE_MCS_ANT_A_MSK;
Expand Down Expand Up @@ -2869,13 +2870,15 @@ iwm_setrates(struct iwm_node *in, int async)
if (ni->ni_flags & IEEE80211_NODE_VHT) {
if (iwm_is_mimo_vht_plcp(vht_plcp))
tab |= IWM_RATE_MCS_ANT_AB_MSK;
else if (sc->sc_device_family == IWM_DEVICE_FAMILY_9000)
else if (sc->sc_device_family == IWM_DEVICE_FAMILY_9000 &&
(iwm_fw_valid_tx_ant(sc) & IWM_ANT_B))
tab |= IWM_RATE_MCS_ANT_B_MSK;
else
tab |= IWM_RATE_MCS_ANT_A_MSK;
} else if (iwm_is_mimo_ht_plcp(ht_plcp))
tab |= IWM_RATE_MCS_ANT_AB_MSK;
else if (sc->sc_device_family == IWM_DEVICE_FAMILY_9000)
else if (sc->sc_device_family == IWM_DEVICE_FAMILY_9000 &&
(iwm_fw_valid_tx_ant(sc) & IWM_ANT_B))
tab |= IWM_RATE_MCS_ANT_B_MSK;
else
tab |= IWM_RATE_MCS_ANT_A_MSK;
Expand All @@ -2892,17 +2895,19 @@ iwm_setrates(struct iwm_node *in, int async)
tab = iwm_rates[ridx_min].plcp;
if (IWM_RIDX_IS_CCK(ridx_min))
tab |= IWM_RATE_MCS_CCK_MSK;
if (sc->sc_device_family == IWM_DEVICE_FAMILY_9000)
tab |= IWM_RATE_MCS_ANT_B_MSK;
else
tab |= IWM_RATE_MCS_ANT_A_MSK;
if (sc->sc_device_family == IWM_DEVICE_FAMILY_9000 &&
(iwm_fw_valid_tx_ant(sc) & IWM_ANT_B))
tab |= IWM_RATE_MCS_ANT_B_MSK;
else
tab |= IWM_RATE_MCS_ANT_A_MSK;
lqcmd.rs_table[j++] = htole32(tab);
}

if (sc->sc_device_family == IWM_DEVICE_FAMILY_9000)
lqcmd.single_stream_ant_msk = IWM_ANT_B;
else
lqcmd.single_stream_ant_msk = IWM_ANT_A;
if (sc->sc_device_family == IWM_DEVICE_FAMILY_9000 &&
(iwm_fw_valid_tx_ant(sc) & IWM_ANT_B))
lqcmd.single_stream_ant_msk = IWM_ANT_B;
else
lqcmd.single_stream_ant_msk = IWM_ANT_A;
lqcmd.dual_stream_ant_msk = IWM_ANT_AB;

lqcmd.agg_time_limit = htole16(iwm_coex_agg_time_limit(sc));
Expand Down

0 comments on commit 596ee10

Please sign in to comment.