linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* staging: rtl8723bs: removal of 5G code
@ 2021-05-20  9:29 Fabio Aiuto
  2021-05-25 10:07 ` Hans de Goede
  0 siblings, 1 reply; 3+ messages in thread
From: Fabio Aiuto @ 2021-05-20  9:29 UTC (permalink / raw)
  To: hdegoede, Larry.Finger
  Cc: gregkh, johannes, linux-staging, linux-kernel, linux-wireless

Hi all,

I'm stick with removal of 5Ghz code from rtl8723bs wireless card driver
(in staging subsystem).

I think that this task comprehend deletion of all code managing
80Mhz bandwidth and upper bandwidth (160 and 80+80). For the latter
it's simple, there's quite no code (unused enums and obsolete comments).

The former seems to be trickier, there are handlers like this:

        /* 3 Set Reg483 */
        SubChnlNum = phy_GetSecondaryChnl_8723B(Adapter);
        rtw_write8(Adapter, REG_DATA_SC_8723B, SubChnlNum);

phy_GetSecondaryChnl_8723B() contains code like:

        } else if (pHalData->CurrentChannelBW == CHANNEL_WIDTH_40) {
                if (pHalData->nCur40MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_UPPER)
                        SCSettingOf20 = VHT_DATA_SC_20_UPPER_OF_80MHZ;
                else if (pHalData->nCur40MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_LOWER)
                        SCSettingOf20 = VHT_DATA_SC_20_LOWER_OF_80MHZ;
        }

so if we are on a 40M channel some settings involving 80M are made and
the whole is then written on card registers.

May I get rid of the whole? Are there some implications I should be aware of?
Is secondary channel needed if we are on 40M bandwidth?

Thank you in advance,

fabio

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: staging: rtl8723bs: removal of 5G code
  2021-05-20  9:29 staging: rtl8723bs: removal of 5G code Fabio Aiuto
@ 2021-05-25 10:07 ` Hans de Goede
  2021-05-25 13:40   ` Fabio Aiuto
  0 siblings, 1 reply; 3+ messages in thread
From: Hans de Goede @ 2021-05-25 10:07 UTC (permalink / raw)
  To: Fabio Aiuto, Larry.Finger
  Cc: gregkh, johannes, linux-staging, linux-kernel, linux-wireless

Hi,

On 5/20/21 11:29 AM, Fabio Aiuto wrote:
> Hi all,
> 
> I'm stick with removal of 5Ghz code from rtl8723bs wireless card driver
> (in staging subsystem).
> 
> I think that this task comprehend deletion of all code managing
> 80Mhz bandwidth and upper bandwidth (160 and 80+80). For the latter
> it's simple, there's quite no code (unused enums and obsolete comments).
> 
> The former seems to be trickier, there are handlers like this:
> 
>         /* 3 Set Reg483 */
>         SubChnlNum = phy_GetSecondaryChnl_8723B(Adapter);
>         rtw_write8(Adapter, REG_DATA_SC_8723B, SubChnlNum);
> 
> phy_GetSecondaryChnl_8723B() contains code like:
> 
>         } else if (pHalData->CurrentChannelBW == CHANNEL_WIDTH_40) {
>                 if (pHalData->nCur40MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_UPPER)
>                         SCSettingOf20 = VHT_DATA_SC_20_UPPER_OF_80MHZ;
>                 else if (pHalData->nCur40MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_LOWER)
>                         SCSettingOf20 = VHT_DATA_SC_20_LOWER_OF_80MHZ;
>         }
> 
> so if we are on a 40M channel some settings involving 80M are made and
> the whole is then written on card registers.

I'm no wifi expert, so I was hoping someone else would respond...

With that said I believe you should keep this else block, this part of the
function seems to select the order of the bonded channels when bonding
multiple 20MHz channels together.

The "if (pHalData->CurrentChannelBW == CHANNEL_WIDTH_80) {}" part can be
removed because on 2.4G only devices 80 MHz width is not supported, but
the 40MHz bit should stay, the constants for the register bits may be named
after the 80MHz option, but I believe these same register bits will impact
the 40Mhz case too.

It might be a good idea to rename the constants to VHT_DATA_SC_20_*_OF_40MHZ
in a separate patch.

Regards,

Hans


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: staging: rtl8723bs: removal of 5G code
  2021-05-25 10:07 ` Hans de Goede
@ 2021-05-25 13:40   ` Fabio Aiuto
  0 siblings, 0 replies; 3+ messages in thread
From: Fabio Aiuto @ 2021-05-25 13:40 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Larry.Finger, gregkh, johannes, linux-staging, linux-kernel,
	linux-wireless

Hi Hans and everyone,

On Tue, May 25, 2021 at 12:07:55PM +0200, Hans de Goede wrote:
> Hi,
> 
> On 5/20/21 11:29 AM, Fabio Aiuto wrote:
> > Hi all,
> > 
> > I'm stick with removal of 5Ghz code from rtl8723bs wireless card driver
> > (in staging subsystem).
> > 
> > I think that this task comprehend deletion of all code managing
> > 80Mhz bandwidth and upper bandwidth (160 and 80+80). For the latter
> > it's simple, there's quite no code (unused enums and obsolete comments).
> > 
> > The former seems to be trickier, there are handlers like this:
> > 
> >         /* 3 Set Reg483 */
> >         SubChnlNum = phy_GetSecondaryChnl_8723B(Adapter);
> >         rtw_write8(Adapter, REG_DATA_SC_8723B, SubChnlNum);
> > 
> > phy_GetSecondaryChnl_8723B() contains code like:
> > 
> >         } else if (pHalData->CurrentChannelBW == CHANNEL_WIDTH_40) {
> >                 if (pHalData->nCur40MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_UPPER)
> >                         SCSettingOf20 = VHT_DATA_SC_20_UPPER_OF_80MHZ;
> >                 else if (pHalData->nCur40MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_LOWER)
> >                         SCSettingOf20 = VHT_DATA_SC_20_LOWER_OF_80MHZ;
> >         }
> > 
> > so if we are on a 40M channel some settings involving 80M are made and
> > the whole is then written on card registers.
> 
> I'm no wifi expert, so I was hoping someone else would respond...
> 
> With that said I believe you should keep this else block, this part of the
> function seems to select the order of the bonded channels when bonding
> multiple 20MHz channels together.
> 
> The "if (pHalData->CurrentChannelBW == CHANNEL_WIDTH_80) {}" part can be
> removed because on 2.4G only devices 80 MHz width is not supported, but
> the 40MHz bit should stay, the constants for the register bits may be named
> after the 80MHz option, but I believe these same register bits will impact
> the 40Mhz case too.

agreed, just remove the CHANNEL_WIDTH_80 branch is good

> 
> It might be a good idea to rename the constants to VHT_DATA_SC_20_*_OF_40MHZ
> in a separate patch.

good idea, I was misguided by the trailing *_80MHZ in constant name

> 
> Regards,
> 
> Hans
> 

thank you Hans,

fabio

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-05-25 13:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-20  9:29 staging: rtl8723bs: removal of 5G code Fabio Aiuto
2021-05-25 10:07 ` Hans de Goede
2021-05-25 13:40   ` Fabio Aiuto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).