2023-12-10 19:37:23

by Tree Davies

[permalink] [raw]
Subject: [PATCH 0/4] Staging: rtl8192e: Remove unused variables in struct cb_desc

This series removes a few unused variables from struct cb_desc in
rtllib.h

Thank you in advance to reviewers.
~Tree

Tree Davies (4):
Staging: rtl8192e: Remove variable bFirstSeg
Staging: rtl8192e: Remove variable bLastSeg
Staging: rtl8192e: Remove variable bEncrypt
Staging: rtl8192e: Remove variable macId

drivers/staging/rtl8192e/rtllib.h | 4 ----
1 file changed, 4 deletions(-)

--
2.39.2


2023-12-10 19:37:25

by Tree Davies

[permalink] [raw]
Subject: [PATCH 1/4] Staging: rtl8192e: Remove variable bFirstSeg

Remove variable bFirstSeg as it is defined but never used.

Signed-off-by: Tree Davies <[email protected]>
---
drivers/staging/rtl8192e/rtllib.h | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
index 0a8c44e497f5..c0a24826cd3b 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -103,7 +103,6 @@ struct cb_desc {
/* Tx Desc Related flags (8-9) */
u8 bLastIniPkt:1;
u8 bCmdOrInit:1;
- u8 bFirstSeg:1;
u8 bLastSeg:1;
u8 bEncrypt:1;
u8 tx_dis_rate_fallback:1;
--
2.39.2

2023-12-10 19:37:26

by Tree Davies

[permalink] [raw]
Subject: [PATCH 3/4] Staging: rtl8192e: Remove variable bEncrypt

Remove variable bEncrypt as it is defined but never used.

Signed-off-by: Tree Davies <[email protected]>
---
drivers/staging/rtl8192e/rtllib.h | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
index fb399acb7157..224774b1ba31 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -103,7 +103,6 @@ struct cb_desc {
/* Tx Desc Related flags (8-9) */
u8 bLastIniPkt:1;
u8 bCmdOrInit:1;
- u8 bEncrypt:1;
u8 tx_dis_rate_fallback:1;
u8 tx_use_drv_assinged_rate:1;
u8 bHwSec:1;
--
2.39.2

2023-12-10 19:37:38

by Tree Davies

[permalink] [raw]
Subject: [PATCH 4/4] Staging: rtl8192e: Remove variable macId

Remove variable macId as it is defined but never used.

Signed-off-by: Tree Davies <[email protected]>
---
drivers/staging/rtl8192e/rtllib.h | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
index 224774b1ba31..0b4a6ded257a 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -136,7 +136,6 @@ struct cb_desc {
u8 bAMSDU:1;
u8 bFromAggrQ:1;
u8 reserved6:6;
- u8 macId;
u8 priority;

/* Tx firmware related element(20-27) */
--
2.39.2

2023-12-10 20:41:19

by Philipp Hortmann

[permalink] [raw]
Subject: Re: [PATCH 0/4] Staging: rtl8192e: Remove unused variables in struct cb_desc

On 12/10/23 20:37, Tree Davies wrote:
> This series removes a few unused variables from struct cb_desc in
> rtllib.h
>
> Thank you in advance to reviewers.
> ~Tree
>
> Tree Davies (4):
> Staging: rtl8192e: Remove variable bFirstSeg
> Staging: rtl8192e: Remove variable bLastSeg
> Staging: rtl8192e: Remove variable bEncrypt
> Staging: rtl8192e: Remove variable macId
>
> drivers/staging/rtl8192e/rtllib.h | 4 ----
> 1 file changed, 4 deletions(-)
>

Hi,

works.

Thanks for your support.

Bye Philipp

2023-12-11 08:37:35

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH 1/4] Staging: rtl8192e: Remove variable bFirstSeg

On Sun, Dec 10, 2023 at 11:37:02AM -0800, Tree Davies wrote:
> Remove variable bFirstSeg as it is defined but never used.
>
> Signed-off-by: Tree Davies <[email protected]>
> ---
> drivers/staging/rtl8192e/rtllib.h | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
> index 0a8c44e497f5..c0a24826cd3b 100644
> --- a/drivers/staging/rtl8192e/rtllib.h
> +++ b/drivers/staging/rtl8192e/rtllib.h
> @@ -103,7 +103,6 @@ struct cb_desc {
> /* Tx Desc Related flags (8-9) */
> u8 bLastIniPkt:1;
> u8 bCmdOrInit:1;
> - u8 bFirstSeg:1;
> u8 bLastSeg:1;
> u8 bEncrypt:1;
> u8 tx_dis_rate_fallback:1;

I don't think you can remove these. They're part of the protocol for
talking to the firmware.

regards,
dan carpenter

2023-12-11 19:22:35

by Philipp Hortmann

[permalink] [raw]
Subject: Re: [PATCH 1/4] Staging: rtl8192e: Remove variable bFirstSeg

On 12/11/23 09:37, Dan Carpenter wrote:
> On Sun, Dec 10, 2023 at 11:37:02AM -0800, Tree Davies wrote:
>> Remove variable bFirstSeg as it is defined but never used.
>>
>> Signed-off-by: Tree Davies <[email protected]>
>> ---
>> drivers/staging/rtl8192e/rtllib.h | 1 -
>> 1 file changed, 1 deletion(-)
>>
>> diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
>> index 0a8c44e497f5..c0a24826cd3b 100644
>> --- a/drivers/staging/rtl8192e/rtllib.h
>> +++ b/drivers/staging/rtl8192e/rtllib.h
>> @@ -103,7 +103,6 @@ struct cb_desc {
>> /* Tx Desc Related flags (8-9) */
>> u8 bLastIniPkt:1;
>> u8 bCmdOrInit:1;
>> - u8 bFirstSeg:1;
>> u8 bLastSeg:1;
>> u8 bEncrypt:1;
>> u8 tx_dis_rate_fallback:1;
>
> I don't think you can remove these. They're part of the protocol for
> talking to the firmware.
>
> regards,
> dan carpenter
>

Hi Dan,

thanks for your response.

struct cb_desc is used in conjunction with this line:
struct cb_desc *tcb_desc = (struct cb_desc *)(skb->cb + 8);
from skbuff.h:
/*
* This is the control buffer. It is free to use for every
* layer. Please put your private variables there. If you
* want to keep them across layers you have to do a skb_clone()
* first. This is owned by whoever has the skb queued ATM.
*/
char cb[48] __aligned(8);

I think it has to do with the sku buffer and can be changed.

Here a test:
kernel@matrix-ESPRIMO-P710:~/Documents/git/kernels/staging$ git diff
diff --git a/drivers/staging/rtl8192e/rtllib.h
b/drivers/staging/rtl8192e/rtllib.h
index cc9070f39004..f29efc605ba9 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -100,6 +100,7 @@ static inline void *netdev_priv_rsl(struct
net_device *dev)
/* defined for skb cb field */
/* At most 28 byte */
struct cb_desc {
+ u8 ph_temp[7];
/* Tx Desc Related flags (8-9) */
u8 bLastIniPkt:1;
u8 bCmdOrInit:1;
diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c
b/drivers/staging/rtl8192e/rtllib_softmac.c
index ee527ba5d1a8..93292fc3faaf 100644
--- a/drivers/staging/rtl8192e/rtllib_softmac.c
+++ b/drivers/staging/rtl8192e/rtllib_softmac.c
@@ -189,6 +189,9 @@ inline void softmac_mgmt_xmit(struct sk_buff *skb,
struct rtllib_device *ieee)
struct cb_desc *tcb_desc = (struct cb_desc *)(skb->cb + 8);

spin_lock_irqsave(&ieee->lock, flags);
+ printk("Setting tcb_desc !!!\n");
+ tcb_desc->ph_temp[0] = 0xAA;
+ tcb_desc->ph_temp[6] = 0xAA;

/* called with 2nd param 0, no mgmt lock required */
rtllib_sta_wakeup(ieee, 0);

Here the log:
[ 9024.740612] rtl819xE 0000:03:00.0: Adapter(8192 PCI-E) is found -
DeviceID=8192
[ 9025.773658] Setting tcb_desc !!!
[ 9025.773783] Setting tcb_desc !!!
[ 9025.797635] Setting tcb_desc !!!
[ 9025.797701] Setting tcb_desc !!!
[ 9025.849687] Setting tcb_desc !!!
[ 9025.849743] Setting tcb_desc !!!
[ 9025.977703] Setting tcb_desc !!!
[ 9025.977740] Setting tcb_desc !!!
[ 9026.105693] Setting tcb_desc !!!

Performance as expected OK.

Please reconsider your decision?

Thanks

Bye Philipp



2023-12-12 09:45:44

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH 1/4] Staging: rtl8192e: Remove variable bFirstSeg

The struct talks about firmware and it has reserved bits so that's what
confused me.

You know this code better than I do so since you're fine with it, then
I'm fine with it.

regards,
dan carpenter