2014-11-25 16:32:17

by Larry Finger

[permalink] [raw]
Subject: [PATCH 0/2 3.18] Fixes for Bug #88811

These two patches are needed to fix a regression introduced when
driver rtl8821ae was moved from staging to the regular wireless tree.

I am sorry that these fixes are so late in the 3.18 cycle.

Larry


Larry Finger (2):
rtlwifi: rtl8821ae: Fix 5G detection problem
rtlwifi: Change order in device startup

drivers/net/wireless/rtlwifi/pci.c | 20 ++++++++++----------
drivers/net/wireless/rtlwifi/rtl8821ae/hw.c | 5 +++--
2 files changed, 13 insertions(+), 12 deletions(-)

--
2.1.2



2014-11-25 16:32:19

by Larry Finger

[permalink] [raw]
Subject: [PATCH 2/2 3.18] rtlwifi: Change order in device startup

The existing order of steps when starting the PCI devices works for
2.4G devices, but fails to initialize the 5G section of the RTL8821AE
hardware.

This patch is needed to fix the regression reported in Bug #88811
(https://bugzilla.kernel.org/show_bug.cgi?id=88811).

Reported-by: Valerio Passini <[email protected]>
Tested-by: Valerio Passini <[email protected]>
Signed-off-by: Larry Finger <[email protected]>
Cc: Valerio Passini <[email protected]>
---
drivers/net/wireless/rtlwifi/pci.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c
index 61f5d36..846a2e6 100644
--- a/drivers/net/wireless/rtlwifi/pci.c
+++ b/drivers/net/wireless/rtlwifi/pci.c
@@ -2249,6 +2249,16 @@ int rtl_pci_probe(struct pci_dev *pdev,
/*like read eeprom and so on */
rtlpriv->cfg->ops->read_eeprom_info(hw);

+ if (rtlpriv->cfg->ops->init_sw_vars(hw)) {
+ RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Can't init_sw_vars\n");
+ err = -ENODEV;
+ goto fail3;
+ }
+ rtlpriv->cfg->ops->init_sw_leds(hw);
+
+ /*aspm */
+ rtl_pci_init_aspm(hw);
+
/* Init mac80211 sw */
err = rtl_init_core(hw);
if (err) {
@@ -2264,16 +2274,6 @@ int rtl_pci_probe(struct pci_dev *pdev,
goto fail3;
}

- if (rtlpriv->cfg->ops->init_sw_vars(hw)) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Can't init_sw_vars\n");
- err = -ENODEV;
- goto fail3;
- }
- rtlpriv->cfg->ops->init_sw_leds(hw);
-
- /*aspm */
- rtl_pci_init_aspm(hw);
-
err = ieee80211_register_hw(hw);
if (err) {
RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
--
2.1.2


2014-11-25 19:00:14

by John W. Linville

[permalink] [raw]
Subject: Re: [PATCH 1/2 3.18] rtlwifi: rtl8821ae: Fix 5G detection problem

On Tue, Nov 25, 2014 at 10:32:06AM -0600, Larry Finger wrote:
> The changes associated with moving this driver from staging to the regular
> tree missed one section setting the allowable rates for the 5GHz band.
>
> This patch is needed to fix the regression reported in Bug #88811
> (https://bugzilla.kernel.org/show_bug.cgi?id=88811).
>
> Reported-by: Valerio Passini <[email protected]>
> Tested-by: Valerio Passini <[email protected]>
> Signed-off-by: Larry Finger <[email protected]>
> Cc: Valerio Passini <[email protected]>
> ---
> drivers/net/wireless/rtlwifi/rtl8821ae/hw.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/rtlwifi/rtl8821ae/hw.c b/drivers/net/wireless/rtlwifi/rtl8821ae/hw.c
> index 310d316..18f34f7 100644
> --- a/drivers/net/wireless/rtlwifi/rtl8821ae/hw.c
> +++ b/drivers/net/wireless/rtlwifi/rtl8821ae/hw.c
> @@ -3672,8 +3672,9 @@ static void rtl8821ae_update_hal_rate_mask(struct ieee80211_hw *hw,
> mac->opmode == NL80211_IFTYPE_ADHOC)
> macid = sta->aid + 1;
> if (wirelessmode == WIRELESS_MODE_N_5G ||
> - wirelessmode == WIRELESS_MODE_AC_5G)
> - ratr_bitmap = sta->supp_rates[NL80211_BAND_5GHZ];
> + wirelessmode == WIRELESS_MODE_AC_5G ||
> + wirelessmode == WIRELESS_MODE_A)
> + ratr_bitmap = (sta->supp_rates[NL80211_BAND_5GHZ])<<4;

The parenthesis seem superfluous. How about this line instead?

+ ratr_bitmap = sta->supp_rates[NL80211_BAND_5GHZ] << 4;

> else
> ratr_bitmap = sta->supp_rates[NL80211_BAND_2GHZ];
>
> --
> 2.1.2
>
>

--
John W. Linville Someday the world will need a hero, and you
[email protected] might be all we have. Be ready.

2014-11-25 16:32:18

by Larry Finger

[permalink] [raw]
Subject: [PATCH 1/2 3.18] rtlwifi: rtl8821ae: Fix 5G detection problem

The changes associated with moving this driver from staging to the regular
tree missed one section setting the allowable rates for the 5GHz band.

This patch is needed to fix the regression reported in Bug #88811
(https://bugzilla.kernel.org/show_bug.cgi?id=88811).

Reported-by: Valerio Passini <[email protected]>
Tested-by: Valerio Passini <[email protected]>
Signed-off-by: Larry Finger <[email protected]>
Cc: Valerio Passini <[email protected]>
---
drivers/net/wireless/rtlwifi/rtl8821ae/hw.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/rtlwifi/rtl8821ae/hw.c b/drivers/net/wireless/rtlwifi/rtl8821ae/hw.c
index 310d316..18f34f7 100644
--- a/drivers/net/wireless/rtlwifi/rtl8821ae/hw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8821ae/hw.c
@@ -3672,8 +3672,9 @@ static void rtl8821ae_update_hal_rate_mask(struct ieee80211_hw *hw,
mac->opmode == NL80211_IFTYPE_ADHOC)
macid = sta->aid + 1;
if (wirelessmode == WIRELESS_MODE_N_5G ||
- wirelessmode == WIRELESS_MODE_AC_5G)
- ratr_bitmap = sta->supp_rates[NL80211_BAND_5GHZ];
+ wirelessmode == WIRELESS_MODE_AC_5G ||
+ wirelessmode == WIRELESS_MODE_A)
+ ratr_bitmap = (sta->supp_rates[NL80211_BAND_5GHZ])<<4;
else
ratr_bitmap = sta->supp_rates[NL80211_BAND_2GHZ];

--
2.1.2


2014-11-25 19:51:03

by Larry Finger

[permalink] [raw]
Subject: Re: [PATCH 1/2 3.18] rtlwifi: rtl8821ae: Fix 5G detection problem

On 11/25/2014 12:46 PM, John W. Linville wrote:
> On Tue, Nov 25, 2014 at 10:32:06AM -0600, Larry Finger wrote:
>> The changes associated with moving this driver from staging to the regular
>> tree missed one section setting the allowable rates for the 5GHz band.
>>
>> This patch is needed to fix the regression reported in Bug #88811
>> (https://bugzilla.kernel.org/show_bug.cgi?id=88811).
>>
>> Reported-by: Valerio Passini <[email protected]>
>> Tested-by: Valerio Passini <[email protected]>
>> Signed-off-by: Larry Finger <[email protected]>
>> Cc: Valerio Passini <[email protected]>
>> ---
>> drivers/net/wireless/rtlwifi/rtl8821ae/hw.c | 5 +++--
>> 1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/wireless/rtlwifi/rtl8821ae/hw.c b/drivers/net/wireless/rtlwifi/rtl8821ae/hw.c
>> index 310d316..18f34f7 100644
>> --- a/drivers/net/wireless/rtlwifi/rtl8821ae/hw.c
>> +++ b/drivers/net/wireless/rtlwifi/rtl8821ae/hw.c
>> @@ -3672,8 +3672,9 @@ static void rtl8821ae_update_hal_rate_mask(struct ieee80211_hw *hw,
>> mac->opmode == NL80211_IFTYPE_ADHOC)
>> macid = sta->aid + 1;
>> if (wirelessmode == WIRELESS_MODE_N_5G ||
>> - wirelessmode == WIRELESS_MODE_AC_5G)
>> - ratr_bitmap = sta->supp_rates[NL80211_BAND_5GHZ];
>> + wirelessmode == WIRELESS_MODE_AC_5G ||
>> + wirelessmode == WIRELESS_MODE_A)
>> + ratr_bitmap = (sta->supp_rates[NL80211_BAND_5GHZ])<<4;
>
> The parenthesis seem superfluous. How about this line instead?
>
> + ratr_bitmap = sta->supp_rates[NL80211_BAND_5GHZ] << 4;
>
>> else
>> ratr_bitmap = sta->supp_rates[NL80211_BAND_2GHZ];

Good idea. V2 is on its way.

Larry



2014-11-25 20:46:09

by John W. Linville

[permalink] [raw]
Subject: Re: [PATCH 1/2 3.18] rtlwifi: rtl8821ae: Fix 5G detection problem

On Tue, Nov 25, 2014 at 01:50:32PM -0600, Larry Finger wrote:
> On 11/25/2014 12:46 PM, John W. Linville wrote:
> >On Tue, Nov 25, 2014 at 10:32:06AM -0600, Larry Finger wrote:
> >>The changes associated with moving this driver from staging to the regular
> >>tree missed one section setting the allowable rates for the 5GHz band.
> >>
> >>This patch is needed to fix the regression reported in Bug #88811
> >>(https://bugzilla.kernel.org/show_bug.cgi?id=88811).
> >>
> >>Reported-by: Valerio Passini <[email protected]>
> >>Tested-by: Valerio Passini <[email protected]>
> >>Signed-off-by: Larry Finger <[email protected]>
> >>Cc: Valerio Passini <[email protected]>
> >>---
> >> drivers/net/wireless/rtlwifi/rtl8821ae/hw.c | 5 +++--
> >> 1 file changed, 3 insertions(+), 2 deletions(-)
> >>
> >>diff --git a/drivers/net/wireless/rtlwifi/rtl8821ae/hw.c b/drivers/net/wireless/rtlwifi/rtl8821ae/hw.c
> >>index 310d316..18f34f7 100644
> >>--- a/drivers/net/wireless/rtlwifi/rtl8821ae/hw.c
> >>+++ b/drivers/net/wireless/rtlwifi/rtl8821ae/hw.c
> >>@@ -3672,8 +3672,9 @@ static void rtl8821ae_update_hal_rate_mask(struct ieee80211_hw *hw,
> >> mac->opmode == NL80211_IFTYPE_ADHOC)
> >> macid = sta->aid + 1;
> >> if (wirelessmode == WIRELESS_MODE_N_5G ||
> >>- wirelessmode == WIRELESS_MODE_AC_5G)
> >>- ratr_bitmap = sta->supp_rates[NL80211_BAND_5GHZ];
> >>+ wirelessmode == WIRELESS_MODE_AC_5G ||
> >>+ wirelessmode == WIRELESS_MODE_A)
> >>+ ratr_bitmap = (sta->supp_rates[NL80211_BAND_5GHZ])<<4;
> >
> >The parenthesis seem superfluous. How about this line instead?
> >
> >+ ratr_bitmap = sta->supp_rates[NL80211_BAND_5GHZ] << 4;
> >
> >> else
> >> ratr_bitmap = sta->supp_rates[NL80211_BAND_2GHZ];
>
> Good idea. V2 is on its way.

No need -- I merged it with my version of the line. :-)

John
--
John W. Linville Someday the world will need a hero, and you
[email protected] might be all we have. Be ready.