All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: r8188eu: remove HW_VAR_SLOT_TIME from SetHwReg8188EU()
@ 2022-06-06  6:40 Michael Straube
  2022-06-08  6:50 ` [BUG] staging: r8188eu: driver stopped working with commit ("staging: r8188eu: add check for kzalloc") Michael Straube
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Straube @ 2022-06-06  6:40 UTC (permalink / raw)
  To: gregkh; +Cc: Larry.Finger, phil, linux-staging, linux-kernel, Michael Straube

In order to get rid of the function SetHwReg8188EU() remove the
HW_VAR_SLOT_TIME case from that function and move the functionality
into a static function in rtw_wlan_util.c.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/r8188eu/core/rtw_wlan_util.c | 26 +++++++++++++++++++-
 drivers/staging/r8188eu/hal/usb_halinit.c    | 24 ------------------
 drivers/staging/r8188eu/include/hal_intf.h   |  1 -
 3 files changed, 25 insertions(+), 26 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_wlan_util.c b/drivers/staging/r8188eu/core/rtw_wlan_util.c
index 392a65783f32..9f0a823b6e52 100644
--- a/drivers/staging/r8188eu/core/rtw_wlan_util.c
+++ b/drivers/staging/r8188eu/core/rtw_wlan_util.c
@@ -1348,6 +1348,30 @@ static void set_ack_preamble(struct adapter *adapter, bool short_preamble)
 	rtw_write8(adapter, REG_RRSR + 2, val8);
 };
 
+static void set_slot_time(struct adapter *adapter, u8 slot_time)
+{
+	u8 u1bAIFS, aSifsTime;
+	struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv;
+	struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
+
+	rtw_write8(adapter, REG_SLOT, slot_time);
+
+	if (pmlmeinfo->WMM_enable == 0) {
+		if (pmlmeext->cur_wireless_mode == WIRELESS_11B)
+			aSifsTime = 10;
+		else
+			aSifsTime = 16;
+
+		u1bAIFS = aSifsTime + (2 * pmlmeinfo->slotTime);
+
+		/*  <Roger_EXP> Temporary removed, 2008.06.20. */
+		rtw_write8(adapter, REG_EDCA_VO_PARAM, u1bAIFS);
+		rtw_write8(adapter, REG_EDCA_VI_PARAM, u1bAIFS);
+		rtw_write8(adapter, REG_EDCA_BE_PARAM, u1bAIFS);
+		rtw_write8(adapter, REG_EDCA_BK_PARAM, u1bAIFS);
+	}
+}
+
 void update_capinfo(struct adapter *Adapter, u16 updateCap)
 {
 	struct mlme_ext_priv	*pmlmeext = &Adapter->mlmeextpriv;
@@ -1386,7 +1410,7 @@ void update_capinfo(struct adapter *Adapter, u16 updateCap)
 		}
 	}
 
-	SetHwReg8188EU(Adapter, HW_VAR_SLOT_TIME, &pmlmeinfo->slotTime);
+	set_slot_time(Adapter, pmlmeinfo->slotTime);
 }
 
 void update_wireless_mode(struct adapter *padapter)
diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8188eu/hal/usb_halinit.c
index a217272a07f8..895619fea501 100644
--- a/drivers/staging/r8188eu/hal/usb_halinit.c
+++ b/drivers/staging/r8188eu/hal/usb_halinit.c
@@ -1036,30 +1036,6 @@ void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8 *val)
 			rtw_write32(Adapter, REG_RCR, rtw_read32(Adapter, REG_RCR) | RCR_CBSSID_BCN);
 		}
 		break;
-	case HW_VAR_SLOT_TIME:
-		{
-			u8 u1bAIFS, aSifsTime;
-			struct mlme_ext_priv	*pmlmeext = &Adapter->mlmeextpriv;
-			struct mlme_ext_info	*pmlmeinfo = &pmlmeext->mlmext_info;
-
-			rtw_write8(Adapter, REG_SLOT, val[0]);
-
-			if (pmlmeinfo->WMM_enable == 0) {
-				if (pmlmeext->cur_wireless_mode == WIRELESS_11B)
-					aSifsTime = 10;
-				else
-					aSifsTime = 16;
-
-				u1bAIFS = aSifsTime + (2 * pmlmeinfo->slotTime);
-
-				/*  <Roger_EXP> Temporary removed, 2008.06.20. */
-				rtw_write8(Adapter, REG_EDCA_VO_PARAM, u1bAIFS);
-				rtw_write8(Adapter, REG_EDCA_VI_PARAM, u1bAIFS);
-				rtw_write8(Adapter, REG_EDCA_BE_PARAM, u1bAIFS);
-				rtw_write8(Adapter, REG_EDCA_BK_PARAM, u1bAIFS);
-			}
-		}
-		break;
 	case HW_VAR_DM_FLAG:
 		podmpriv->SupportAbility = *((u8 *)val);
 		break;
diff --git a/drivers/staging/r8188eu/include/hal_intf.h b/drivers/staging/r8188eu/include/hal_intf.h
index a56f3d6ca399..0104ee463a10 100644
--- a/drivers/staging/r8188eu/include/hal_intf.h
+++ b/drivers/staging/r8188eu/include/hal_intf.h
@@ -13,7 +13,6 @@ enum hw_variables {
 	HW_VAR_BASIC_RATE,
 	HW_VAR_CORRECT_TSF,
 	HW_VAR_MLME_SITESURVEY,
-	HW_VAR_SLOT_TIME,
 	HW_VAR_DM_FLAG,
 	HW_VAR_DM_FUNC_OP,
 	HW_VAR_DM_FUNC_RESET,
-- 
2.36.1


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

* [BUG] staging: r8188eu: driver stopped working with commit ("staging: r8188eu: add check for kzalloc")
  2022-06-06  6:40 [PATCH] staging: r8188eu: remove HW_VAR_SLOT_TIME from SetHwReg8188EU() Michael Straube
@ 2022-06-08  6:50 ` Michael Straube
  2022-06-08  9:27   ` Martin Kaiser
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Straube @ 2022-06-08  6:50 UTC (permalink / raw)
  To: gregkh; +Cc: Larry.Finger, phil, linux-staging, linux-kernel, Michael Straube

Hi all,

The driver does not work anymore on my system. In dmesg there is:

"r8188eu 1-4:1.0: _rtw_init_xmit_priv failed"

I bisected it to commit f94b47c6bde ("staging: r8188eu: add check for 
kzalloc").

~/kernels/staging> git bisect bad
f94b47c6bde624d6c07f43054087607c52054a95 is the first bad commit

At the moment I have no time to look further into it.

regards,
Michael


dmesg after plugging in the device:

[15075.514705] usb 1-4: new high-speed USB device number 4 using xhci_hcd
[15075.750717] usb 1-4: New USB device found, idVendor=0bda, 
idProduct=8179, bcdDevice= 0.00
[15075.750729] usb 1-4: New USB device strings: Mfr=1, Product=2, 
SerialNumber=3
[15075.750734] usb 1-4: Product: 802.11n NIC
[15075.750738] usb 1-4: Manufacturer: Realtek
[15075.750742] usb 1-4: SerialNumber: 200DB02CEF8F
[15075.767685] Chip Version Info: 
CHIP_8188E_Normal_Chip_TSMC_D_CUT_1T1R_RomVer(0)
[15076.121994] EEPROM ID = 0x8129
[15076.123218] r8188eu 1-4:1.0: _rtw_init_xmit_priv failed
[15076.321389] usb 1-4: reset high-speed USB device number 4 using xhci_hcd

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

* Re: [BUG] staging: r8188eu: driver stopped working with commit ("staging: r8188eu: add check for kzalloc")
  2022-06-08  6:50 ` [BUG] staging: r8188eu: driver stopped working with commit ("staging: r8188eu: add check for kzalloc") Michael Straube
@ 2022-06-08  9:27   ` Martin Kaiser
  2022-06-08  9:34     ` Pavel Skripkin
  0 siblings, 1 reply; 6+ messages in thread
From: Martin Kaiser @ 2022-06-08  9:27 UTC (permalink / raw)
  To: Michael Straube, phil; +Cc: gregkh, Larry.Finger, linux-staging, linux-kernel

Hi Michael & Phil,

Thus wrote Michael Straube (straube.linux@gmail.com):

> The driver does not work anymore on my system. In dmesg there is:

> "r8188eu 1-4:1.0: _rtw_init_xmit_priv failed"

> I bisected it to commit f94b47c6bde ("staging: r8188eu: add check for
> kzalloc").

> ~/kernels/staging> git bisect bad
> f94b47c6bde624d6c07f43054087607c52054a95 is the first bad commit

> At the moment I have no time to look further into it.

See also

https://lore.kernel.org/linux-staging/YoyU4zXf45UpF1Tq@kroah.com/T/#mb5e56a285b8eb1ebb0e798462fc388cb02b4a7cc

Phil said in

https://lore.kernel.org/linux-staging/YoyU4zXf45UpF1Tq@kroah.com/T/#m7a21d460b2569f6b59965ecc3298a6337fa3458a

that he has submitted a patch to fix this issue for now until we
get around to changing the _SUCCESS and _FAIL values.

Phil, did you really send this out? I don't see it.
If you don't have anything ready, I can try a simple fix.

Thanks & best regards,

   Martin

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

* Re: [BUG] staging: r8188eu: driver stopped working with commit ("staging: r8188eu: add check for kzalloc")
  2022-06-08  9:27   ` Martin Kaiser
@ 2022-06-08  9:34     ` Pavel Skripkin
  2022-06-08 10:45       ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Pavel Skripkin @ 2022-06-08  9:34 UTC (permalink / raw)
  To: Martin Kaiser, Michael Straube, phil
  Cc: gregkh, Larry.Finger, linux-staging, linux-kernel

Hi Martin,

On 6/8/22 12:27, Martin Kaiser wrote:
> Hi Michael & Phil,
> 
> Thus wrote Michael Straube (straube.linux@gmail.com):
> 
>> The driver does not work anymore on my system. In dmesg there is:
> 
>> "r8188eu 1-4:1.0: _rtw_init_xmit_priv failed"
> 
>> I bisected it to commit f94b47c6bde ("staging: r8188eu: add check for
>> kzalloc").
> 
>> ~/kernels/staging> git bisect bad
>> f94b47c6bde624d6c07f43054087607c52054a95 is the first bad commit
> 
>> At the moment I have no time to look further into it.
> 
> See also
> 
> https://lore.kernel.org/linux-staging/YoyU4zXf45UpF1Tq@kroah.com/T/#mb5e56a285b8eb1ebb0e798462fc388cb02b4a7cc
> 
> Phil said in
> 
> https://lore.kernel.org/linux-staging/YoyU4zXf45UpF1Tq@kroah.com/T/#m7a21d460b2569f6b59965ecc3298a6337fa3458a
> 

There is the posted patch [1]. I also have to apply it every time I want 
to test smth.

[1] https://lore.kernel.org/all/20220521204741.921-1-phil@philpotter.co.uk/




With regards,
Pavel Skripkin

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

* Re: [BUG] staging: r8188eu: driver stopped working with commit ("staging: r8188eu: add check for kzalloc")
  2022-06-08  9:34     ` Pavel Skripkin
@ 2022-06-08 10:45       ` Greg KH
  2022-06-08 12:21         ` Michael Straube
  0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2022-06-08 10:45 UTC (permalink / raw)
  To: Pavel Skripkin
  Cc: Martin Kaiser, Michael Straube, phil, Larry.Finger,
	linux-staging, linux-kernel

On Wed, Jun 08, 2022 at 12:34:45PM +0300, Pavel Skripkin wrote:
> Hi Martin,
> 
> On 6/8/22 12:27, Martin Kaiser wrote:
> > Hi Michael & Phil,
> > 
> > Thus wrote Michael Straube (straube.linux@gmail.com):
> > 
> > > The driver does not work anymore on my system. In dmesg there is:
> > 
> > > "r8188eu 1-4:1.0: _rtw_init_xmit_priv failed"
> > 
> > > I bisected it to commit f94b47c6bde ("staging: r8188eu: add check for
> > > kzalloc").
> > 
> > > ~/kernels/staging> git bisect bad
> > > f94b47c6bde624d6c07f43054087607c52054a95 is the first bad commit
> > 
> > > At the moment I have no time to look further into it.
> > 
> > See also
> > 
> > https://lore.kernel.org/linux-staging/YoyU4zXf45UpF1Tq@kroah.com/T/#mb5e56a285b8eb1ebb0e798462fc388cb02b4a7cc
> > 
> > Phil said in
> > 
> > https://lore.kernel.org/linux-staging/YoyU4zXf45UpF1Tq@kroah.com/T/#m7a21d460b2569f6b59965ecc3298a6337fa3458a
> > 
> 
> There is the posted patch [1]. I also have to apply it every time I want to
> test smth.
> 
> [1] https://lore.kernel.org/all/20220521204741.921-1-phil@philpotter.co.uk/

That patch is in linux-next and will be sent to Linus later this week.

thanks,

greg k-h

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

* Re: [BUG] staging: r8188eu: driver stopped working with commit ("staging: r8188eu: add check for kzalloc")
  2022-06-08 10:45       ` Greg KH
@ 2022-06-08 12:21         ` Michael Straube
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Straube @ 2022-06-08 12:21 UTC (permalink / raw)
  To: Greg KH, Pavel Skripkin
  Cc: Martin Kaiser, phil, Larry.Finger, linux-staging, linux-kernel

On 6/8/22 12:45, Greg KH wrote:
> On Wed, Jun 08, 2022 at 12:34:45PM +0300, Pavel Skripkin wrote:
>> Hi Martin,
>>
>> On 6/8/22 12:27, Martin Kaiser wrote:
>>> Hi Michael & Phil,
>>>
>>> Thus wrote Michael Straube (straube.linux@gmail.com):
>>>
>>>> The driver does not work anymore on my system. In dmesg there is:
>>>
>>>> "r8188eu 1-4:1.0: _rtw_init_xmit_priv failed"
>>>
>>>> I bisected it to commit f94b47c6bde ("staging: r8188eu: add check for
>>>> kzalloc").
>>>
>>>> ~/kernels/staging> git bisect bad
>>>> f94b47c6bde624d6c07f43054087607c52054a95 is the first bad commit
>>>
>>>> At the moment I have no time to look further into it.
>>>
>>> See also
>>>
>>> https://lore.kernel.org/linux-staging/YoyU4zXf45UpF1Tq@kroah.com/T/#mb5e56a285b8eb1ebb0e798462fc388cb02b4a7cc
>>>
>>> Phil said in
>>>
>>> https://lore.kernel.org/linux-staging/YoyU4zXf45UpF1Tq@kroah.com/T/#m7a21d460b2569f6b59965ecc3298a6337fa3458a
>>>
>>
>> There is the posted patch [1]. I also have to apply it every time I want to
>> test smth.
>>
>> [1] https://lore.kernel.org/all/20220521204741.921-1-phil@philpotter.co.uk/
> 
> That patch is in linux-next and will be sent to Linus later this week.
> 

I obviously missed that patch. Thank you all.

Michael

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

end of thread, other threads:[~2022-06-08 12:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-06  6:40 [PATCH] staging: r8188eu: remove HW_VAR_SLOT_TIME from SetHwReg8188EU() Michael Straube
2022-06-08  6:50 ` [BUG] staging: r8188eu: driver stopped working with commit ("staging: r8188eu: add check for kzalloc") Michael Straube
2022-06-08  9:27   ` Martin Kaiser
2022-06-08  9:34     ` Pavel Skripkin
2022-06-08 10:45       ` Greg KH
2022-06-08 12:21         ` Michael Straube

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.