Commit f46edd59 authored by Forest Bond's avatar Forest Bond Committed by Ben Hutchings

rtlwifi: rtl8192de: Fix phy-based version calculation

commit f1b00f4d upstream.

Commit d83579e2 incorporated some
changes from the vendor driver that made it newly important that the
calculated hardware version correctly include the CHIP_92D bit, as all
of the IS_92D_* macros were changed to depend on it.  However, this bit
was being unset for dual-mac, dual-phy devices.  The vendor driver
behavior was modified to not do this, but unfortunately this change was
not picked up along with the others.  This caused scanning in the 2.4GHz
band to be broken, and possibly other bugs as well.

This patch brings the version calculation logic in parity with the
vendor driver in this regard, and in doing so fixes the regression.
However, the version calculation code in general continues to be largely
incoherent and messy, and needs to be cleaned up.
Signed-off-by: default avatarForest Bond <forest.bond@rapidrollout.com>
Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent 88981d86
...@@ -3462,21 +3462,21 @@ void rtl92d_phy_config_macphymode_info(struct ieee80211_hw *hw) ...@@ -3462,21 +3462,21 @@ void rtl92d_phy_config_macphymode_info(struct ieee80211_hw *hw)
switch (rtlhal->macphymode) { switch (rtlhal->macphymode) {
case DUALMAC_SINGLEPHY: case DUALMAC_SINGLEPHY:
rtlphy->rf_type = RF_2T2R; rtlphy->rf_type = RF_2T2R;
rtlhal->version |= CHIP_92D_SINGLEPHY; rtlhal->version |= RF_TYPE_2T2R;
rtlhal->bandset = BAND_ON_BOTH; rtlhal->bandset = BAND_ON_BOTH;
rtlhal->current_bandtype = BAND_ON_2_4G; rtlhal->current_bandtype = BAND_ON_2_4G;
break; break;
case SINGLEMAC_SINGLEPHY: case SINGLEMAC_SINGLEPHY:
rtlphy->rf_type = RF_2T2R; rtlphy->rf_type = RF_2T2R;
rtlhal->version |= CHIP_92D_SINGLEPHY; rtlhal->version |= RF_TYPE_2T2R;
rtlhal->bandset = BAND_ON_BOTH; rtlhal->bandset = BAND_ON_BOTH;
rtlhal->current_bandtype = BAND_ON_2_4G; rtlhal->current_bandtype = BAND_ON_2_4G;
break; break;
case DUALMAC_DUALPHY: case DUALMAC_DUALPHY:
rtlphy->rf_type = RF_1T1R; rtlphy->rf_type = RF_1T1R;
rtlhal->version &= (~CHIP_92D_SINGLEPHY); rtlhal->version &= RF_TYPE_1T1R;
/* Now we let MAC0 run on 5G band. */ /* Now we let MAC0 run on 5G band. */
if (rtlhal->interfaceindex == 0) { if (rtlhal->interfaceindex == 0) {
rtlhal->bandset = BAND_ON_5G; rtlhal->bandset = BAND_ON_5G;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment