Skip to contentSkip to conversation

staging: winbond: Cleanups

PATCH In review Sankar P 4 participants 15 messages Mar 19, 2010 – Apr 28, 2010 Staging

lore
Share & tools
lore

Sankar P

author
#0 lore raw

cover staging: winbond: Cleanups

The following series of patches are cleanups on the winbond driver under staging. Some typedefs are converted to structs and an un-used enumeration and a typedef are removed.

Sankar P (6):
staging: winbond: Convert typedef struct _PMKID to struct pmkid
staging: winbond: Remove unused enum enum_PowerManagementMode
staging: winbond: Convert typedef struct _STRUCT_SELECTOR
staging: winbond: Remove typedef for standard types
staging: winbond: Convert typedef struct _MLME_FRAME to struct
staging: winbond: Convert typedef struct _SCAN_REQ_PARA to struct

 drivers/staging/winbond/core.h            |    2 +-
 drivers/staging/winbond/mac_structures.h  |   31 +++++++++++-----------------
 drivers/staging/winbond/mlme_s.h          |    4 +-
 drivers/staging/winbond/phy_calibration.c |    9 ++-----
 drivers/staging/winbond/scan_s.h          |    8 ++++--
 5 files changed, 23 insertions(+), 31 deletions(-)
author
#1 lore raw

PATCH 1/6 staging: winbond: Convert typedef struct _PMKID to struct pmkid

This patch converts the definition typedef struct _PMKID to struct pmkid and also the part where the typedef was used.

---
 drivers/staging/winbond/mac_structures.h |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/staging/winbond/mac_structures.h +3 -3
index 0d16196..ad19c88 100644
@@ -505,10 +505,10 @@ struct RSN_Capability_Element
 }__attribute__ ((packed)) ;
 
 #ifdef _WPA2_
-typedef struct _PMKID
+struct pmkid
 {
   u8 pValue[16];
-}PMKID;
+};
 
 struct	WPA2_RSN_Information_Element
 {
@@ -531,7 +531,7 @@ struct WPA2_RSN_Auth_Sub_Information_Element
 struct PMKID_Information_Element
 {
 	u16				PMKID_Count;
-	PMKID pmkid [16] ;
+	struct pmkid pmkid[16];
 }__attribute__ ((packed));
 
 #endif //enddef _WPA2_
Signature · 1 line
1.6.4.2
author
#2 lore raw

PATCH 2/6 staging: winbond: Remove unused enum enum_PowerManagementMode

---
 drivers/staging/winbond/mac_structures.h |    7 -------
 1 files changed, 0 insertions(+), 7 deletions(-)
drivers/staging/winbond/mac_structures.h +0 -7
index ad19c88..7eb0e57 100644
@@ -116,13 +116,6 @@
 #define WLAN_MAX_PAIRWISE_CIPHER_SUITE_COUNT    ((u16) 6)
 #define WLAN_MAX_AUTH_KEY_MGT_SUITE_LIST_COUNT  ((u16) 2)
 
-//========================================================
-typedef enum enum_PowerManagementMode
-{
-    ACTIVE = 0,
-    POWER_SAVE
-} WB_PM_Mode, *PWB_PM_MODE;
-
 //===================================================================
 //  Reason Code (Table 18): indicate the reason of DisAssoc, DeAuthen
 //  length of ReasonCode is 2 Octs.
Signature · 1 line
1.6.4.2
author
#3 lore raw

PATCH 3/6 staging: winbond: Convert typedef struct _STRUCT_SELECTOR

This patch converts the declaration typedef struct _STRUCT_SELECTOR to struct struct_selector and also the places where it was used.

---
 drivers/staging/winbond/mac_structures.h |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)
drivers/staging/winbond/mac_structures.h +9 -9
index 7eb0e57..4130cf6 100644
@@ -436,7 +436,7 @@ struct Extended_Supported_Rates_Element
 #define OUI_CIPHER_CCMP				0x04
 #define OUI_CIPHER_WEP_104			0x05
 
-typedef struct _SUITE_SELECTOR_
+struct suite_selector
 {
 	union
 	{
@@ -447,23 +447,23 @@ typedef struct _SUITE_SELECTOR_
 			u8	Type;
 		}SuitSelector;
 	};
-}SUITE_SELECTOR;
+};
 
 //--  WPA  --
 struct	RSN_Information_Element
 {
 	u8					Element_ID;
 	u8					Length;
-	SUITE_SELECTOR	OuiWPAAdditional;//WPA version 2.0 additional field, and should be 00:50:F2:01
+	struct suite_selector	OuiWPAAdditional; /* WPA version 2.0 additional field, and should be 00:50:F2:01 */
 	u16					Version;
-	SUITE_SELECTOR		GroupKeySuite;
+	struct suite_selector		GroupKeySuite;
 	u16					PairwiseKeySuiteCount;
-	SUITE_SELECTOR		PairwiseKeySuite[1];
+	struct suite_selector		PairwiseKeySuite[1];
 }__attribute__ ((packed));
 struct RSN_Auth_Sub_Information_Element
 {
 	u16				AuthKeyMngtSuiteCount;
-	SUITE_SELECTOR	AuthKeyMngtSuite[1];
+	struct suite_selector	AuthKeyMngtSuite[1];
 }__attribute__ ((packed));
 
 //--  WPA2  --
@@ -508,16 +508,16 @@ struct	WPA2_RSN_Information_Element
 	u8					Element_ID;
 	u8					Length;
 	u16					Version;
-	SUITE_SELECTOR		GroupKeySuite;
+	struct suite_selector		GroupKeySuite;
 	u16					PairwiseKeySuiteCount;
-	SUITE_SELECTOR		PairwiseKeySuite[1];
+	struct suite_selector		PairwiseKeySuite[1];
 
 }__attribute__ ((packed));
 
 struct WPA2_RSN_Auth_Sub_Information_Element
 {
 	u16				AuthKeyMngtSuiteCount;
-	SUITE_SELECTOR	AuthKeyMngtSuite[1];
+	struct suite_selector	AuthKeyMngtSuite[1];
 }__attribute__ ((packed));
 
 
Signature · 1 line
1.6.4.2
author
#4 lore raw

PATCH 4/6 staging: winbond: Remove typedef for standard types

Remove the typedef named "fixed" used for the standard type s32

---
 drivers/staging/winbond/phy_calibration.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)
drivers/staging/winbond/phy_calibration.c +3 -6
index 8c56962..a8334f9 100644
@@ -25,10 +25,7 @@
 #define FIXED(X)        ((s32)((X) * 32768.0))
 #define DEG2RAD(X)      0.017453 * (X)
 
-/****************** LOCAL TYPE DEFINITION SECTION ***************************/
-typedef s32         fixed; /* 16.16 fixed-point */
-
-static const fixed Angles[]=
+static const s32 Angles[] =
 {
     FIXED(DEG2RAD(45.0)),    FIXED(DEG2RAD(26.565)),  FIXED(DEG2RAD(14.0362)),
     FIXED(DEG2RAD(7.12502)), FIXED(DEG2RAD(3.57633)), FIXED(DEG2RAD(1.78991)),
@@ -300,7 +297,7 @@ u32 _sqrt(u32 sqsum)
 /****************************************************************************/
 void _sin_cos(s32 angle, s32 *sin, s32 *cos)
 {
-    fixed       X, Y, TargetAngle, CurrAngle;
+    s32 X, Y, TargetAngle, CurrAngle;
     unsigned    Step;
 
     X=FIXED(AG_CONST);      // AG_CONST * cos(0)
@@ -310,7 +307,7 @@ void _sin_cos(s32 angle, s32 *sin, s32 *cos)
 
     for (Step=0; Step < 12; Step++)
     {
-        fixed NewX;
+	s32 NewX;
 
         if(TargetAngle > CurrAngle)
         {
Signature · 1 line
1.6.4.2
author
#5 lore raw

PATCH 5/6 staging: winbond: Convert typedef struct _MLME_FRAME to struct

This patch converts the typedef struct _MLME_FRAME to struct mlme_frame and updates the places where it is used.

---
 drivers/staging/winbond/core.h   |    2 +-
 drivers/staging/winbond/mlme_s.h |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/staging/winbond/core.h +1 -1
index 0a2060b..372053a 100644
@@ -16,7 +16,7 @@ struct wbsoft_priv {
 
 	struct wb_local_para sLocalPara;	// Myself connected parameters
 
-	MLME_FRAME sMlmeFrame;	// connect to peerSTA parameters
+	struct mlme_frame sMlmeFrame;	/* connect to peerSTA parameters */
 
 	struct wb35_mto_params sMtoPara;	// MTO_struct ...
 	struct hw_data sHwData;	//For HAL
drivers/staging/winbond/mlme_s.h +2 -2
index 1217a1c..c95debf 100644
@@ -131,7 +131,7 @@
 #define boMLME_IdleScanState(_BB_)	(_BB_->wState==IDLE_SCAN)
 #define boMLME_FoundSTAinfo(_CC_)	(_CC_->wState>=IDLE_SCAN)
 
-typedef struct _MLME_FRAME
+struct mlme_frame
 {
 	//NDIS_PACKET		MLME_Packet;
 	s8 *			pMMPDU;
@@ -156,7 +156,7 @@ typedef struct _MLME_FRAME
 	u16		wNumRxMMPDUInMLME; 	// Number of the Rx MMPDU
 	u16		reserved_1;			//  in MLME.
                     	            //  excluding the discarded
-} MLME_FRAME, *psMLME_FRAME;
+};
 
 typedef struct _AUTHREQ {
 
Signature · 1 line
1.6.4.2
author
#6 lore raw

PATCH 6/6 staging: winbond: Convert typedef struct _SCAN_REQ_PARA to struct

This patch converts typedef struct _SCAN_REQ_PARA to struct scan_req_para and the places where it is used.

---
 drivers/staging/winbond/scan_s.h |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
drivers/staging/winbond/scan_s.h +5 -3
index 209717f..e677fc4 100644
@@ -31,7 +31,9 @@
 
 ///////////////////////////////////////////////////////////////////////////
 //Global data structures, Initial Scan & Background Scan
-typedef struct _SCAN_REQ_PARA	//mandatory parameters for SCAN request
+
+/* Mandatory parameters for SCAN request */
+struct scan_req_para
 {
 	u32				ScanType;			//passive/active scan
 
@@ -40,14 +42,14 @@ typedef struct _SCAN_REQ_PARA	//mandatory parameters for SCAN request
 	struct SSID_Element	sSSID; // 34B. scan only for this SSID
 	u8			reserved_2[2];
 
-} SCAN_REQ_PARA, *psSCAN_REQ_PARA;
+};
 
 typedef struct _SCAN_PARAMETERS
 {
 	u16				wState;
 	u16				iCurrentChannelIndex;
 
-	SCAN_REQ_PARA	sScanReq;
+	struct scan_req_para	sScanReq;
 
 	u8				BSSID[MAC_ADDR_LENGTH + 2];		//scan only for this BSSID
 
Signature · 1 line
1.6.4.2
#7 lore raw

Re: [PATCH 6/6] staging: winbond: Convert typedef struct _SCAN_REQ_PARA to struct

Quoted 4 lines · Sankar P

This patch converts typedef struct _SCAN_REQ_PARA to struct scan_req_para and the places where it is used.

ack.

Quoted 36 lines
---
 drivers/staging/winbond/scan_s.h |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
drivers/staging/winbond/scan_s.h +5 -3
index 209717f..e677fc4 100644
@@ -31,7 +31,9 @@
 
 ///////////////////////////////////////////////////////////////////////////
 //Global data structures, Initial Scan & Background Scan
-typedef struct _SCAN_REQ_PARA	//mandatory parameters for SCAN request
+
+/* Mandatory parameters for SCAN request */
+struct scan_req_para
 {
 	u32				ScanType;			//passive/active scan
 
@@ -40,14 +42,14 @@ typedef struct _SCAN_REQ_PARA	//mandatory parameters for SCAN request
 	struct SSID_Element	sSSID; // 34B. scan only for this SSID
 	u8			reserved_2[2];
 
-} SCAN_REQ_PARA, *psSCAN_REQ_PARA;
+};
 
 typedef struct _SCAN_PARAMETERS
 {
 	u16				wState;
 	u16				iCurrentChannelIndex;
 
-	SCAN_REQ_PARA	sScanReq;
+	struct scan_req_para	sScanReq;
 
 	u8				BSSID[MAC_ADDR_LENGTH + 2];		//scan only for this BSSID
 
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#8 lore raw

Re: [PATCH 5/6] staging: winbond: Convert typedef struct _MLME_FRAME to struct

In reply to Sankar P
Quoted 4 lines · Sankar P

This patch converts the typedef struct _MLME_FRAME to struct mlme_frame and updates the places where it is used.

Ack.

Quoted 40 lines
---
 drivers/staging/winbond/core.h   |    2 +-
 drivers/staging/winbond/mlme_s.h |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/staging/winbond/core.h +1 -1
index 0a2060b..372053a 100644
@@ -16,7 +16,7 @@ struct wbsoft_priv {
 
 	struct wb_local_para sLocalPara;	// Myself connected parameters
 
-	MLME_FRAME sMlmeFrame;	// connect to peerSTA parameters
+	struct mlme_frame sMlmeFrame;	/* connect to peerSTA parameters */
 
 	struct wb35_mto_params sMtoPara;	// MTO_struct ...
 	struct hw_data sHwData;	//For HAL
drivers/staging/winbond/mlme_s.h +2 -2
index 1217a1c..c95debf 100644
@@ -131,7 +131,7 @@
 #define boMLME_IdleScanState(_BB_)	(_BB_->wState==IDLE_SCAN)
 #define boMLME_FoundSTAinfo(_CC_)	(_CC_->wState>=IDLE_SCAN)
 
-typedef struct _MLME_FRAME
+struct mlme_frame
 {
 	//NDIS_PACKET		MLME_Packet;
 	s8 *			pMMPDU;
@@ -156,7 +156,7 @@ typedef struct _MLME_FRAME
 	u16		wNumRxMMPDUInMLME; 	// Number of the Rx MMPDU
 	u16		reserved_1;			//  in MLME.
                     	            //  excluding the discarded
-} MLME_FRAME, *psMLME_FRAME;
+};
 
 typedef struct _AUTHREQ {
 
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#9 lore raw

Re: [PATCH 4/6] staging: winbond: Remove typedef for standard types

In reply to Sankar P
Quoted 3 lines · Sankar P

Remove the typedef named "fixed" used for the standard type s32

NAK. That actually makes sense.

drivers/staging/winbond/phy_calibration.c line 28

Quoted 5 lines
drivers/staging/winbond/phy_calibration.c +1 -4
-/****************** LOCAL TYPE DEFINITION SECTION ***************************/
-typedef s32         fixed; /* 16.16 fixed-point */
-
-static const fixed Angles[]=
+static const s32 Angles[] =

fixed points are very different from integers...

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#10 lore raw

Re: [PATCH 3/6] staging: winbond: Convert typedef struct _STRUCT_SELECTOR

In reply to Sankar P
Quoted 4 lines · Sankar P

This patch converts the declaration typedef struct _STRUCT_SELECTOR to struct struct_selector and also the places where it was used.

ack.

Quoted 66 lines
---
 drivers/staging/winbond/mac_structures.h |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)
drivers/staging/winbond/mac_structures.h +9 -9
index 7eb0e57..4130cf6 100644
@@ -436,7 +436,7 @@ struct Extended_Supported_Rates_Element
 #define OUI_CIPHER_CCMP				0x04
 #define OUI_CIPHER_WEP_104			0x05
 
-typedef struct _SUITE_SELECTOR_
+struct suite_selector
 {
 	union
 	{
@@ -447,23 +447,23 @@ typedef struct _SUITE_SELECTOR_
 			u8	Type;
 		}SuitSelector;
 	};
-}SUITE_SELECTOR;
+};
 
 //--  WPA  --
 struct	RSN_Information_Element
 {
 	u8					Element_ID;
 	u8					Length;
-	SUITE_SELECTOR	OuiWPAAdditional;//WPA version 2.0 additional field, and should be 00:50:F2:01
+	struct suite_selector	OuiWPAAdditional; /* WPA version 2.0 additional field, and should be 00:50:F2:01 */
 	u16					Version;
-	SUITE_SELECTOR		GroupKeySuite;
+	struct suite_selector		GroupKeySuite;
 	u16					PairwiseKeySuiteCount;
-	SUITE_SELECTOR		PairwiseKeySuite[1];
+	struct suite_selector		PairwiseKeySuite[1];
 }__attribute__ ((packed));
 struct RSN_Auth_Sub_Information_Element
 {
 	u16				AuthKeyMngtSuiteCount;
-	SUITE_SELECTOR	AuthKeyMngtSuite[1];
+	struct suite_selector	AuthKeyMngtSuite[1];
 }__attribute__ ((packed));
 
 //--  WPA2  --
@@ -508,16 +508,16 @@ struct	WPA2_RSN_Information_Element
 	u8					Element_ID;
 	u8					Length;
 	u16					Version;
-	SUITE_SELECTOR		GroupKeySuite;
+	struct suite_selector		GroupKeySuite;
 	u16					PairwiseKeySuiteCount;
-	SUITE_SELECTOR		PairwiseKeySuite[1];
+	struct suite_selector		PairwiseKeySuite[1];
 
 }__attribute__ ((packed));
 
 struct WPA2_RSN_Auth_Sub_Information_Element
 {
 	u16				AuthKeyMngtSuiteCount;
-	SUITE_SELECTOR	AuthKeyMngtSuite[1];
+	struct suite_selector	AuthKeyMngtSuite[1];
 }__attribute__ ((packed));
 
 
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#11 lore raw

Re: [PATCH 2/6] staging: winbond: Remove unused enum enum_PowerManagementMode

In reply to Sankar P
Quoted 1 line · Sankar P

ACK.

Quoted 22 lines
---
 drivers/staging/winbond/mac_structures.h |    7 -------
 1 files changed, 0 insertions(+), 7 deletions(-)
drivers/staging/winbond/mac_structures.h +0 -7
index ad19c88..7eb0e57 100644
@@ -116,13 +116,6 @@
 #define WLAN_MAX_PAIRWISE_CIPHER_SUITE_COUNT    ((u16) 6)
 #define WLAN_MAX_AUTH_KEY_MGT_SUITE_LIST_COUNT  ((u16) 2)
 
-//========================================================
-typedef enum enum_PowerManagementMode
-{
-    ACTIVE = 0,
-    POWER_SAVE
-} WB_PM_Mode, *PWB_PM_MODE;
-
 //===================================================================
 //  Reason Code (Table 18): indicate the reason of DisAssoc, DeAuthen
 //  length of ReasonCode is 2 Octs.
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#12 lore raw

Re: [PATCH 1/6] staging: winbond: Convert typedef struct _PMKID to struct pmkid

In reply to Sankar P
Quoted 4 lines · Sankar P

This patch converts the definition typedef struct _PMKID to struct pmkid and also the part where the typedef was used.

ACK.

Quoted 30 lines
---
 drivers/staging/winbond/mac_structures.h |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/staging/winbond/mac_structures.h +3 -3
index 0d16196..ad19c88 100644
@@ -505,10 +505,10 @@ struct RSN_Capability_Element
 }__attribute__ ((packed)) ;
 
 #ifdef _WPA2_
-typedef struct _PMKID
+struct pmkid
 {
   u8 pValue[16];
-}PMKID;
+};
 
 struct	WPA2_RSN_Information_Element
 {
@@ -531,7 +531,7 @@ struct WPA2_RSN_Auth_Sub_Information_Element
 struct PMKID_Information_Element
 {
 	u16				PMKID_Count;
-	PMKID pmkid [16] ;
+	struct pmkid pmkid[16];
 }__attribute__ ((packed));
 
 #endif //enddef _WPA2_
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#13 lore raw
In reply to Sankar P
Quoted 3 lines · Sankar P

The following series of patches are cleanups on the winbond driver under staging. Some typedefs are converted to structs and an un-used enumeration and a typedef are removed.

Well, there's an identical patch series by me floating around waiting for Greg to apply them. But should Greg go with these, they look good to me except for the fixed point one for which we have a better patch also waiting to be applied.

Pekka

#14 lore raw
Quoted 9 lines · Pekka Enberg
Quoted 3 lines · Sankar P

The following series of patches are cleanups on the winbond driver under staging. Some typedefs are converted to structs and an un-used enumeration and a typedef are removed.

Well, there's an identical patch series by me floating around waiting for Greg to apply them. But should Greg go with these, they look good to me except for the fixed point one for which we have a better patch also waiting to be applied.

I've applied the first 4 of these then.

thanks,

greg k-h