Skip to contentSkip to conversation

staging: r8188eu: remove unused defines in wifi.h

PATCH In review Zameer Manji 3 participants 8 messages Nov 16, 2021 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: r8188eu: remove unused defines in wifi.h

None of these defines in wifi.h are used so they
can be safely removed.

---
 drivers/staging/r8188eu/include/wifi.h | 57 --------------------------
 1 file changed, 57 deletions(-)
drivers/staging/r8188eu/include/wifi.h +0 -57
index 193a557f0f47..7cbc7015e90f 100644
@@ -13,32 +13,9 @@
 #define BIT(x)	(1 << (x))
 
 #define WLAN_ETHHDR_LEN		14
-#define WLAN_ETHADDR_LEN	6
-#define WLAN_IEEE_OUI_LEN	3
-#define WLAN_ADDR_LEN		6
-#define WLAN_CRC_LEN		4
-#define WLAN_BSSID_LEN		6
-#define WLAN_BSS_TS_LEN		8
 #define WLAN_HDR_A3_LEN		24
-#define WLAN_HDR_A4_LEN		30
 #define WLAN_HDR_A3_QOS_LEN	26
-#define WLAN_HDR_A4_QOS_LEN	32
 #define WLAN_SSID_MAXLEN	32
-#define WLAN_DATA_MAXLEN	2312
-
-#define WLAN_A3_PN_OFFSET	24
-#define WLAN_A4_PN_OFFSET	30
-
-#define WLAN_MIN_ETHFRM_LEN	60
-#define WLAN_MAX_ETHFRM_LEN	1514
-#define WLAN_ETHHDR_LEN		14
-
-#define P80211CAPTURE_VERSION	0x80211001
-
-/*  This value is tested by WiFi 11n Test Plan 5.2.3. */
-/*  This test verifies the WLAN NIC can update the NAV through sending
- *  the CTS with large duration. */
-#define	WiFiNavUpperUs				30000	/*  30 ms */
 
 enum WIFI_FRAME_TYPE {
 	WIFI_MGT_TYPE  =	(0),
@@ -487,13 +464,6 @@ static inline int IsFrameTypeCtrl(unsigned char *pframe)
 #define _STATUS_CODE_		2
 #define _TIMESTAMP_		8
 
-#define AUTH_ODD_TO		0
-#define AUTH_EVEN_TO		1
-
-#define WLAN_ETHCONV_ENCAP	1
-#define WLAN_ETHCONV_RFC1042	2
-#define WLAN_ETHCONV_8021h	3
-
 #define cap_ESS		BIT(0)
 #define cap_IBSS	BIT(1)
 #define cap_CFPollable	BIT(2)
@@ -632,13 +602,6 @@ enum ht_cap_ampdu_factor {
 #define HT_INFO_OPERATION_MODE_TRANSMIT_BURST_LIMIT	((u8) BIT(3))
 #define HT_INFO_OPERATION_MODE_NON_HT_STA_PRESENT	((u8) BIT(4))
 
-#define HT_INFO_STBC_PARAM_DUAL_BEACON		((u16) BIT(6))
-#define HT_INFO_STBC_PARAM_DUAL_STBC_PROTECT	((u16) BIT(7))
-#define HT_INFO_STBC_PARAM_SECONDARY_BC		((u16) BIT(8))
-#define HT_INFO_STBC_PARAM_LSIG_TXOP_PROTECT_ALLOWED	((u16) BIT(9))
-#define HT_INFO_STBC_PARAM_PCO_ACTIVE		((u16) BIT(10))
-#define HT_INFO_STBC_PARAM_PCO_PHASE		((u16) BIT(11))
-
 /*	===============WPS Section=============== */
 /*	For WPSv1.0 */
 #define WPSOUI					0x0050f204
@@ -949,26 +912,6 @@ enum P2P_PS_MODE {
 	P2P_PS_MIX = 3, /*  CTWindow and NoA */
 };
 
-/*	=====================WFD Section===================== */
-/*	For Wi-Fi Display */
-#define	WFD_ATTR_DEVICE_INFO		0x00
-#define	WFD_ATTR_ASSOC_BSSID		0x01
-#define	WFD_ATTR_COUPLED_SINK_INFO	0x06
-#define	WFD_ATTR_LOCAL_IP_ADDR		0x08
-#define	WFD_ATTR_SESSION_INFO		0x09
-#define	WFD_ATTR_ALTER_MAC		0x0a
-
-/*	For WFD Device Information Attribute */
-#define	WFD_DEVINFO_SOURCE			0x0000
-#define	WFD_DEVINFO_PSINK			0x0001
-#define	WFD_DEVINFO_SSINK			0x0002
-#define	WFD_DEVINFO_DUAL			0x0003
-
-#define	WFD_DEVINFO_SESSION_AVAIL		0x0010
-#define	WFD_DEVINFO_WSD				0x0040
-#define	WFD_DEVINFO_PC_TDLS			0x0080
-#define	WFD_DEVINFO_HDCP_SUPPORT		0x0100
-
 #define IP_MCAST_MAC(mac)				\
 	((mac[0] == 0x01) && (mac[1] == 0x00) && (mac[2] == 0x5e))
 #define ICMPV6_MCAST_MAC(mac)				\
Signature · 1 line
2.25.1
#1 lore raw
Quoted 13 lines · Zameer Manji

None of these defines in wifi.h are used so they
can be safely removed.

---
  drivers/staging/r8188eu/include/wifi.h | 57 --------------------------
  1 file changed, 57 deletions(-)
drivers/staging/r8188eu/include/wifi.h +0 -0
index 193a557f0f47..7cbc7015e90f 100644

drivers/staging/r8188eu/include/wifi.h line 13

Quoted 1 line
drivers/staging/r8188eu/include/wifi.h +0 -0
@@ -13,32 +13,9 @@
  #define BIT(x)	(1 << (x))

What about BIT() macro? It's already defined in include/vdso/bits.h and can be included via include/bits.h.

Most likely linux/ieee80211.h contains bits.h. Haven't checked yet, but anyway redefining kernel macros is not good approach and BIT() can be also removed.

With regards,
Pavel Skripkin

#2 lore raw
Quoted 20 lines · Pavel Skripkin
Quoted 13 lines · Zameer Manji

None of these defines in wifi.h are used so they
can be safely removed.

---
  drivers/staging/r8188eu/include/wifi.h | 57 --------------------------
  1 file changed, 57 deletions(-)
drivers/staging/r8188eu/include/wifi.h +0 -0
index 193a557f0f47..7cbc7015e90f 100644

drivers/staging/r8188eu/include/wifi.h line 13

Quoted 1 line
drivers/staging/r8188eu/include/wifi.h +0 -0
@@ -13,32 +13,9 @@
  #define BIT(x)      (1 << (x))

What about BIT() macro? It's already defined in include/vdso/bits.h and can be included via include/bits.h.

Quoted 3 lines

Most likely linux/ieee80211.h contains bits.h. Haven't checked yet, but anyway redefining kernel macros is not good approach and BIT() can be also removed.

This is a good observation, but the objective of my patch is to remove unused defines so it will be easier to do the work that you mention. wifi.h and ieee80211.h redefine a few kernel provided values, and I intend to follow up by addressing all of them in one go.

Would you be willing to ack this patch as is?

Signature · 1 line
Zameer Manji
#3 lore raw
Quoted 25 lines · Zameer Manji
Quoted 20 lines · Pavel Skripkin
Quoted 13 lines · Zameer Manji

None of these defines in wifi.h are used so they
can be safely removed.

---
  drivers/staging/r8188eu/include/wifi.h | 57 --------------------------
  1 file changed, 57 deletions(-)
drivers/staging/r8188eu/include/wifi.h +0 -0
index 193a557f0f47..7cbc7015e90f 100644

drivers/staging/r8188eu/include/wifi.h line 13

Quoted 1 line
drivers/staging/r8188eu/include/wifi.h +0 -0
@@ -13,32 +13,9 @@
  #define BIT(x)      (1 << (x))

What about BIT() macro? It's already defined in include/vdso/bits.h and can be included via include/bits.h.

Quoted 3 lines

Most likely linux/ieee80211.h contains bits.h. Haven't checked yet, but anyway redefining kernel macros is not good approach and BIT() can be also removed.

Quoted 7 lines

This is a good observation, but the objective of my patch is to remove unused defines so it will be easier to do the work that you mention. wifi.h and ieee80211.h redefine a few kernel provided values, and I intend to follow up by addressing all of them in one go.

Would you be willing to ack this patch as is?

I cannot ack, since I am not the maintainer (or even reviewer) of this driver :) I just saw this BIT() definition and decided to say, that it can be also removed

Just to be clear: I am not against this patch as is, since _any_ clean up for this driver is important

Thanks

With regards,
Pavel Skripkin

#4 lore raw
Quoted 31 lines · Pavel Skripkin
Quoted 30 lines · Zameer Manji
Quoted 20 lines · Pavel Skripkin
Quoted 13 lines · Zameer Manji

None of these defines in wifi.h are used so they
can be safely removed.

---
  drivers/staging/r8188eu/include/wifi.h | 57 --------------------------
  1 file changed, 57 deletions(-)
drivers/staging/r8188eu/include/wifi.h +0 -0
index 193a557f0f47..7cbc7015e90f 100644

drivers/staging/r8188eu/include/wifi.h line 13

Quoted 1 line
drivers/staging/r8188eu/include/wifi.h +0 -0
@@ -13,32 +13,9 @@
  #define BIT(x)      (1 << (x))

What about BIT() macro? It's already defined in include/vdso/bits.h and can be included via include/bits.h.

Quoted 3 lines

Most likely linux/ieee80211.h contains bits.h. Haven't checked yet, but anyway redefining kernel macros is not good approach and BIT() can be also removed.

This is a good observation, but the objective of my patch is to remove unused defines so it will be easier to do the work that you mention. wifi.h and ieee80211.h redefine a few kernel provided values, and I intend to follow up by addressing all of them in one go.

Quoted 6 lines
Quoted 2 lines

Would you be willing to ack this patch as is?

I cannot ack, since I am not the maintainer (or even reviewer) of this driver :) I just saw this BIT() definition and decided to say, that it can be also removed

Just give a Reviewed-by tag... No one is appointed as a maintainer, you just have to start handing our reviewed-by tags until people start to respect your judgement and then you're a maintainer.

regards,
dan carpenter

#5 lore raw
Quoted 8 lines · Dan Carpenter
Quoted 3 lines

I cannot ack, since I am not the maintainer (or even reviewer) of this driver :) I just saw this BIT() definition and decided to say, that it can be also removed

Just give a Reviewed-by tag... No one is appointed as a maintainer, you just have to start handing our reviewed-by tags until people start to respect your judgement and then you're a maintainer.

Ok, I will send the R-b tag, since patch looks correct to me as is :)

I think, I misunderstood what "ack" means. I thought Zameer means Acked-by tag, which can sent only by maintainers (Larry and Phillip in case of r8188eu), but I was wrong, I guess...

With regards,
Pavel Skripkin

#6 lore raw
Quoted 10 lines · Pavel Skripkin
Quoted 8 lines · Dan Carpenter
Quoted 3 lines

I cannot ack, since I am not the maintainer (or even reviewer) of this driver :) I just saw this BIT() definition and decided to say, that it can be also removed

Just give a Reviewed-by tag... No one is appointed as a maintainer, you just have to start handing our reviewed-by tags until people start to respect your judgement and then you're a maintainer.

Quoted 5 lines

Ok, I will send the R-b tag, since patch looks correct to me as is :)

I think, I misunderstood what "ack" means. I thought Zameer means Acked-by tag, which can sent only by maintainers (Larry and Phillip in case of r8188eu), but I was wrong, I guess...

To me Acked by means you approve the patch so it's like, yeah, normally maintainers use it. But sometimes like people ask for your opinion and then you can Ack it. Or maybe you just want to express joy about a feature. (Please feel joy very sparingly. :P).

regards,
dan carpenter