With this commit, all "typedef union" statements are removed. Signed-off-by: Larry Finger <Larry.Finger@xxxxxxxxxxxx> --- drivers/staging/rtl8192e/r8192E_dev.c | 3 +- drivers/staging/rtl8192e/rtl819x_Qos.h | 53 ++++++++++++----------------- drivers/staging/rtl8192e/rtl819x_TS.h | 4 +- drivers/staging/rtl8192e/rtl819x_TSProc.c | 18 +++++---- drivers/staging/rtl8192e/rtllib.h | 7 ++-- drivers/staging/rtl8192e/rtllib_rx.c | 6 ++-- 6 files changed, 43 insertions(+), 48 deletions(-) diff --git a/drivers/staging/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/r8192E_dev.c index b2e46c3..bc8ca2a 100644 --- a/drivers/staging/rtl8192e/r8192E_dev.c +++ b/drivers/staging/rtl8192e/r8192E_dev.c @@ -235,7 +235,8 @@ rtl8192e_SetHwReg(struct net_device *dev,u8 variable,u8* val) struct rtllib_qos_parameters *qos_parameters = &priv->rtllib->current_network.qos_data.parameters; u8 pAcParam = *((u8*)val); u32 eACI = pAcParam; - PACI_AIFSN pAciAifsn = (PACI_AIFSN)&(qos_parameters->aifs[0]); + union ACI_AIFSN *pAciAifsn = + (union ACI_AIFSN *)&(qos_parameters->aifs[0]); u8 ACM = pAciAifsn->f.ACM; u8 AcmCtrl = read_nic_byte( dev, AcmHwCtrl); diff --git a/drivers/staging/rtl8192e/rtl819x_Qos.h b/drivers/staging/rtl8192e/rtl819x_Qos.h index ed1b338..606dcf0 100644 --- a/drivers/staging/rtl8192e/rtl819x_Qos.h +++ b/drivers/staging/rtl8192e/rtl819x_Qos.h @@ -54,7 +54,7 @@ #define BIT30 0x40000000 #define BIT31 0x80000000 -typedef union _QOS_TSINFO{ +union QOS_TSINFO { u8 charData[3]; struct { u8 ucTrafficType:1; @@ -68,13 +68,14 @@ typedef union _QOS_TSINFO{ u8 ucSchedule:1; u8 ucReserved:7; }field; -}QOS_TSINFO, *PQOS_TSINFO; -typedef union _TSPEC_BODY{ +}; + +union TSPEC_BODY { u8 charData[55]; struct { - QOS_TSINFO TSInfo; + union QOS_TSINFO TSInfo; u16 NominalMSDUsize; u16 MaxMSDUsize; u32 MinServiceItv; @@ -91,7 +92,7 @@ typedef union _TSPEC_BODY{ u16 SurplusBandwidthAllowance; u16 MediumTime; } f; -}TSPEC_BODY, *PTSPEC_BODY; +}; typedef struct _WMM_TSPEC{ u8 ID; @@ -100,7 +101,7 @@ typedef struct _WMM_TSPEC{ u8 OUI_Type; u8 OUI_SubType; u8 Version; - TSPEC_BODY Body; + union TSPEC_BODY Body; } WMM_TSPEC, *PWMM_TSPEC; typedef struct _OCTET_STRING{ @@ -109,7 +110,6 @@ typedef struct _OCTET_STRING{ }OCTET_STRING, *POCTET_STRING; #define MAX_WMMELE_LENGTH 64 -typedef u32 QOS_MODE, *PQOS_MODE; #define QOS_DISABLE 0 #define QOS_WMM 1 #define QOS_WMMSA 2 @@ -234,10 +234,6 @@ typedef struct _ACM{ u8 HwAcmCtl; }ACM, *PACM; - - -typedef u8 AC_UAPSD, *PAC_UAPSD; - #define GET_VO_UAPSD(_apsd) ((_apsd) & BIT0) #define SET_VO_UAPSD(_apsd) ((_apsd) |= BIT0) @@ -250,8 +246,7 @@ typedef u8 AC_UAPSD, *PAC_UAPSD; #define GET_BE_UAPSD(_apsd) ((_apsd) & BIT3) #define SET_BE_UAPSD(_apsd) ((_apsd) |= BIT3) -typedef union _QOS_TCLAS{ - +union QOS_TCLAS { struct _TYPE_GENERAL{ u8 Priority; u8 ClassifierType; @@ -299,7 +294,7 @@ typedef union _QOS_TCLAS{ u8 Mask; u16 TagType; } TYPE2_8021Q; -} QOS_TCLAS, *PQOS_TCLAS; +}; typedef struct _QOS_TSTREAM{ @@ -317,11 +312,11 @@ typedef struct _STA_QOS{ u8 WMMIEBuf[MAX_WMMELE_LENGTH]; u8* WMMIE; - QOS_MODE QosCapability; - QOS_MODE CurrentQosMode; + u32 QosCapability; + u32 CurrentQosMode; - AC_UAPSD b4ac_Uapsd; - AC_UAPSD Curr4acUapsd; + u8 b4ac_Uapsd; + u8 Curr4acUapsd; u8 bInServicePeriod; u8 MaxSPLength; int NumBcnBeforeTrigger; @@ -354,7 +349,7 @@ typedef struct _STA_QOS{ typedef struct _BSS_QOS{ - QOS_MODE bdQoSMode; + u32 bdQoSMode; u8 bdWMMIEBuf[MAX_WMMELE_LENGTH]; OCTET_STRING bdWMMIE; @@ -374,7 +369,7 @@ typedef struct _BSS_QOS{ #define IsACValid(ac) ( ( ac>=0 && ac<=7 )? true : false ) -typedef union _ACI_AIFSN{ +union ACI_AIFSN { u8 charData; struct @@ -384,31 +379,27 @@ typedef union _ACI_AIFSN{ u8 ACI:2; u8 Reserved:1; }f; -}ACI_AIFSN, *PACI_AIFSN; +}; -typedef union _ECW{ +union ECW { u8 charData; struct { u8 ECWmin:4; u8 ECWmax:4; }f; -}ECW, *PECW; +}; -typedef union _AC_PARAM{ +union AC_PARAM { u32 longData; u8 charData[4]; struct { - ACI_AIFSN AciAifsn; - ECW Ecw; + union ACI_AIFSN AciAifsn; + union ECW Ecw; u16 TXOPLimit; }f; -}AC_PARAM, *PAC_PARAM; - - - - +}; #endif diff --git a/drivers/staging/rtl8192e/rtl819x_TS.h b/drivers/staging/rtl8192e/rtl819x_TS.h index ff39132..f92f628 100644 --- a/drivers/staging/rtl8192e/rtl819x_TS.h +++ b/drivers/staging/rtl8192e/rtl819x_TS.h @@ -36,8 +36,8 @@ typedef struct _TS_COMMON_INFO{ struct timer_list SetupTimer; struct timer_list InactTimer; u8 Addr[6]; - TSPEC_BODY TSpec; - QOS_TCLAS TClass[TCLAS_NUM]; + union TSPEC_BODY TSpec; + union QOS_TCLAS TClass[TCLAS_NUM]; u8 TClasProc; u8 TClasNum; } TS_COMMON_INFO, *PTS_COMMON_INFO; diff --git a/drivers/staging/rtl8192e/rtl819x_TSProc.c b/drivers/staging/rtl8192e/rtl819x_TSProc.c index 4f2643d..e7db0be 100644 --- a/drivers/staging/rtl8192e/rtl819x_TSProc.c +++ b/drivers/staging/rtl8192e/rtl819x_TSProc.c @@ -105,8 +105,8 @@ void TsAddBaProcess(unsigned long data) void ResetTsCommonInfo(PTS_COMMON_INFO pTsCommonInfo) { memset(pTsCommonInfo->Addr, 0, 6); - memset(&pTsCommonInfo->TSpec, 0, sizeof(TSPEC_BODY)); - memset(&pTsCommonInfo->TClass, 0, sizeof(QOS_TCLAS)*TCLAS_NUM); + memset(&pTsCommonInfo->TSpec, 0, sizeof(union TSPEC_BODY)); + memset(&pTsCommonInfo->TClass, 0, sizeof(union QOS_TCLAS)*TCLAS_NUM); pTsCommonInfo->TClasProc = 0; pTsCommonInfo->TClasNum = 0; } @@ -294,8 +294,8 @@ PTS_COMMON_INFO SearchAdmitTRStream(struct rtllib_device *ieee, u8 *Addr, void MakeTSEntry( PTS_COMMON_INFO pTsCommonInfo, u8* Addr, - PTSPEC_BODY pTSPEC, - PQOS_TCLAS pTCLAS, + union TSPEC_BODY *pTSPEC, + union QOS_TCLAS *pTCLAS, u8 TCLAS_Num, u8 TCLAS_Proc ) @@ -308,10 +308,12 @@ void MakeTSEntry( memcpy(pTsCommonInfo->Addr, Addr, 6); if (pTSPEC != NULL) - memcpy((u8*)(&(pTsCommonInfo->TSpec)), (u8*)pTSPEC, sizeof(TSPEC_BODY)); + memcpy(&(pTsCommonInfo->TSpec), (u8 *)pTSPEC, + sizeof(union TSPEC_BODY)); for (count = 0; count < TCLAS_Num; count++) - memcpy((u8*)(&(pTsCommonInfo->TClass[count])), (u8*)pTCLAS, sizeof(QOS_TCLAS)); + memcpy((u8*)(&(pTsCommonInfo->TClass[count])), (u8*)pTCLAS, + sizeof(union QOS_TCLAS)); pTsCommonInfo->TClasProc = TCLAS_Proc; pTsCommonInfo->TClasNum = TCLAS_Num; @@ -372,8 +374,8 @@ bool GetTs(struct rtllib_device *ieee, PTS_COMMON_INFO *ppTS, } else { - TSPEC_BODY TSpec; - PQOS_TSINFO pTSInfo = &TSpec.f.TSInfo; + union TSPEC_BODY TSpec; + union QOS_TSINFO *pTSInfo = &TSpec.f.TSInfo; struct list_head* pUnusedList = (TxRxSelect == TX_DIR)? (&ieee->Tx_TS_Unused_List): diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index 0c15f48..ee03bd8 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -1351,7 +1351,7 @@ struct rtllib_rxb { u8 src[ETH_ALEN]; }__attribute__((packed)); -typedef union _frameqos { +union frameqos { u16 shortdata; u8 chardata[2]; struct { @@ -1361,7 +1361,7 @@ typedef union _frameqos { u16 reserved:1; u16 txop:8; }field; -}frameqos,*pframeqos; +}; /* SWEEP TABLE ENTRIES NUMBER*/ #define MAX_SWEEP_TAB_ENTRIES 42 @@ -1511,7 +1511,8 @@ static inline u8 Frame_QoSTID(u8* buf) u16 fc; hdr = (struct rtllib_hdr_3addr *)buf; fc = le16_to_cpu(hdr->frame_ctl); - return (u8)((frameqos*)(buf + (((fc & RTLLIB_FCTL_TODS)&&(fc & RTLLIB_FCTL_FROMDS))? 30 : 24)))->field.tid; + return (u8)((union frameqos *)(buf + (((fc & RTLLIB_FCTL_TODS) && + (fc & RTLLIB_FCTL_FROMDS)) ? 30 : 24)))->field.tid; } diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c index 841ec8b..a14b604 100644 --- a/drivers/staging/rtl8192e/rtllib_rx.c +++ b/drivers/staging/rtl8192e/rtllib_rx.c @@ -747,10 +747,10 @@ u8 parse_subframe(struct rtllib_device* ieee,struct sk_buff *skb, u8 *data_ptr; /* just for debug purpose */ SeqNum = WLAN_GET_SEQ_SEQ(le16_to_cpu(hdr->seq_ctl)); - if ((RTLLIB_QOS_HAS_SEQ(fc))&&\ - (((frameqos *)(skb->data + RTLLIB_3ADDR_LEN))->field.reserved)) { + if ((RTLLIB_QOS_HAS_SEQ(fc)) && + (((union frameqos *)(skb->data + + RTLLIB_3ADDR_LEN))->field.reserved)) bIsAggregateFrame = true; - } if (RTLLIB_QOS_HAS_SEQ(fc)) { LLCOffset += 2; -- 1.7.3.4 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/devel