Commit c07f9721 authored by Przemo Firszt's avatar Przemo Firszt Committed by Greg Kroah-Hartman

rtl8712: code clean up

Clean some trivial formating problems in rtl8712 from staging tree. This patch
also changes the way preprocessor macros are defined to keep checkpatch.pl
quiet.
Signed-off-by: default avatarPrzemo Firszt <przemo@firszt.eu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 666b3bf2
...@@ -777,7 +777,7 @@ extern inline int ieee80211_get_hdrlen(u16 fc) ...@@ -777,7 +777,7 @@ extern inline int ieee80211_get_hdrlen(u16 fc)
struct registry_priv; struct registry_priv;
u8 *r8712_set_ie(u8 *pbuf, sint index, uint len, u8 *source, uint *frlen); u8 *r8712_set_ie(u8 *pbuf, sint index, uint len, u8 *source, uint *frlen);
u8 *r8712_get_ie(u8*pbuf, sint index, sint *len, sint limit); u8 *r8712_get_ie(u8 *pbuf, sint index, sint *len, sint limit);
unsigned char *r8712_get_wpa_ie(unsigned char *pie, int *rsn_ie_len, int limit); unsigned char *r8712_get_wpa_ie(unsigned char *pie, int *rsn_ie_len, int limit);
unsigned char *r8712_get_wpa2_ie(unsigned char *pie, int *rsn_ie_len, unsigned char *r8712_get_wpa2_ie(unsigned char *pie, int *rsn_ie_len,
int limit); int limit);
......
...@@ -749,7 +749,7 @@ u8 r8712_setopmode_cmd(struct _adapter *padapter, ...@@ -749,7 +749,7 @@ u8 r8712_setopmode_cmd(struct _adapter *padapter,
u8 r8712_setdatarate_cmd(struct _adapter *padapter, u8 *rateset); u8 r8712_setdatarate_cmd(struct _adapter *padapter, u8 *rateset);
u8 r8712_set_chplan_cmd(struct _adapter *padapter, int chplan); u8 r8712_set_chplan_cmd(struct _adapter *padapter, int chplan);
u8 r8712_setbasicrate_cmd(struct _adapter *padapter, u8 *rateset); u8 r8712_setbasicrate_cmd(struct _adapter *padapter, u8 *rateset);
u8 r8712_getrfreg_cmd(struct _adapter *padapter, u8 offset, u8 * pval); u8 r8712_getrfreg_cmd(struct _adapter *padapter, u8 offset, u8 *pval);
u8 r8712_setrfintfs_cmd(struct _adapter *padapter, u8 mode); u8 r8712_setrfintfs_cmd(struct _adapter *padapter, u8 mode);
u8 r8712_setrfreg_cmd(struct _adapter *padapter, u8 offset, u32 val); u8 r8712_setrfreg_cmd(struct _adapter *padapter, u8 offset, u32 val);
u8 r8712_setrttbl_cmd(struct _adapter *padapter, u8 r8712_setrttbl_cmd(struct _adapter *padapter,
......
...@@ -207,9 +207,9 @@ void seccalctkipmic( ...@@ -207,9 +207,9 @@ void seccalctkipmic(
u8 *Miccode, u8 *Miccode,
u8 priority); u8 priority);
void r8712_secmicsetkey(struct mic_data *pmicdata, u8 * key); void r8712_secmicsetkey(struct mic_data *pmicdata, u8 *key);
void r8712_secmicappend(struct mic_data *pmicdata, u8 * src, u32 nBytes); void r8712_secmicappend(struct mic_data *pmicdata, u8 *src, u32 nBytes);
void r8712_secgetmic(struct mic_data *pmicdata, u8 * dst); void r8712_secgetmic(struct mic_data *pmicdata, u8 *dst);
u32 r8712_aes_encrypt(struct _adapter *padapter, u8 *pxmitframe); u32 r8712_aes_encrypt(struct _adapter *padapter, u8 *pxmitframe);
u32 r8712_tkip_encrypt(struct _adapter *padapter, u8 *pxmitframe); u32 r8712_tkip_encrypt(struct _adapter *padapter, u8 *pxmitframe);
void r8712_wep_encrypt(struct _adapter *padapter, u8 *pxmitframe); void r8712_wep_encrypt(struct _adapter *padapter, u8 *pxmitframe);
......
...@@ -140,7 +140,7 @@ void r8712_free_all_stainfo(struct _adapter *padapter); ...@@ -140,7 +140,7 @@ void r8712_free_all_stainfo(struct _adapter *padapter);
struct sta_info *r8712_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr); struct sta_info *r8712_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr);
void r8712_init_bcmc_stainfo(struct _adapter *padapter); void r8712_init_bcmc_stainfo(struct _adapter *padapter);
struct sta_info *r8712_get_bcmc_stainfo(struct _adapter *padapter); struct sta_info *r8712_get_bcmc_stainfo(struct _adapter *padapter);
u8 r8712_access_ctrl(struct wlan_acl_pool *pacl_list, u8 * mac_addr); u8 r8712_access_ctrl(struct wlan_acl_pool *pacl_list, u8 *mac_addr);
#endif /* _STA_INFO_H_ */ #endif /* _STA_INFO_H_ */
...@@ -159,99 +159,85 @@ enum WIFI_REG_DOMAIN { ...@@ -159,99 +159,85 @@ enum WIFI_REG_DOMAIN {
#define _PRIVACY_ BIT(14) #define _PRIVACY_ BIT(14)
#define _ORDER_ BIT(15) #define _ORDER_ BIT(15)
#define SetToDs(pbuf) \ #define SetToDs(pbuf) ({ \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_TO_DS_); \ *(unsigned short *)(pbuf) |= cpu_to_le16(_TO_DS_); \
} while (0) })
#define GetToDs(pbuf) (((*(unsigned short *)(pbuf)) & \ #define GetToDs(pbuf) (((*(unsigned short *)(pbuf)) & \
le16_to_cpu(_TO_DS_)) != 0) le16_to_cpu(_TO_DS_)) != 0)
#define ClearToDs(pbuf) \ #define ClearToDs(pbuf) ({ \
do { \
*(unsigned short *)(pbuf) &= (~cpu_to_le16(_TO_DS_)); \ *(unsigned short *)(pbuf) &= (~cpu_to_le16(_TO_DS_)); \
} while (0) })
#define SetFrDs(pbuf) \ #define SetFrDs(pbuf) ({ \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_FROM_DS_); \ *(unsigned short *)(pbuf) |= cpu_to_le16(_FROM_DS_); \
} while (0) })
#define GetFrDs(pbuf) (((*(unsigned short *)(pbuf)) & \ #define GetFrDs(pbuf) (((*(unsigned short *)(pbuf)) & \
le16_to_cpu(_FROM_DS_)) != 0) le16_to_cpu(_FROM_DS_)) != 0)
#define ClearFrDs(pbuf) \ #define ClearFrDs(pbuf) ({ \
do { \
*(unsigned short *)(pbuf) &= (~cpu_to_le16(_FROM_DS_)); \ *(unsigned short *)(pbuf) &= (~cpu_to_le16(_FROM_DS_)); \
} while (0) })
#define get_tofr_ds(pframe) ((GetToDs(pframe) << 1) | GetFrDs(pframe)) #define get_tofr_ds(pframe) ((GetToDs(pframe) << 1) | GetFrDs(pframe))
#define SetMFrag(pbuf) \ #define SetMFrag(pbuf) ({ \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_MORE_FRAG_); \ *(unsigned short *)(pbuf) |= cpu_to_le16(_MORE_FRAG_); \
} while (0) })
#define GetMFrag(pbuf) (((*(unsigned short *)(pbuf)) & \ #define GetMFrag(pbuf) (((*(unsigned short *)(pbuf)) & \
le16_to_cpu(_MORE_FRAG_)) != 0) le16_to_cpu(_MORE_FRAG_)) != 0)
#define ClearMFrag(pbuf) \ #define ClearMFrag(pbuf) ({ \
do { \
*(unsigned short *)(pbuf) &= (~cpu_to_le16(_MORE_FRAG_)); \ *(unsigned short *)(pbuf) &= (~cpu_to_le16(_MORE_FRAG_)); \
} while (0) })
#define SetRetry(pbuf) \ #define SetRetry(pbuf) ({ \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_RETRY_); \ *(unsigned short *)(pbuf) |= cpu_to_le16(_RETRY_); \
} while (0) })
#define GetRetry(pbuf) (((*(unsigned short *)(pbuf)) & \ #define GetRetry(pbuf) (((*(unsigned short *)(pbuf)) & \
le16_to_cpu(_RETRY_)) != 0) le16_to_cpu(_RETRY_)) != 0)
#define ClearRetry(pbuf) \ #define ClearRetry(pbuf) ({ \
do { \
*(unsigned short *)(pbuf) &= (~cpu_to_le16(_RETRY_)); \ *(unsigned short *)(pbuf) &= (~cpu_to_le16(_RETRY_)); \
} while (0) })
#define SetPwrMgt(pbuf) \ #define SetPwrMgt(pbuf) ({ \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_PWRMGT_); \ *(unsigned short *)(pbuf) |= cpu_to_le16(_PWRMGT_); \
} while (0) })
#define GetPwrMgt(pbuf) (((*(unsigned short *)(pbuf)) & \ #define GetPwrMgt(pbuf) (((*(unsigned short *)(pbuf)) & \
le16_to_cpu(_PWRMGT_)) != 0) le16_to_cpu(_PWRMGT_)) != 0)
#define ClearPwrMgt(pbuf) \ #define ClearPwrMgt(pbuf) ({ \
do { \
*(unsigned short *)(pbuf) &= (~cpu_to_le16(_PWRMGT_)); \ *(unsigned short *)(pbuf) &= (~cpu_to_le16(_PWRMGT_)); \
} while (0) })
#define SetMData(pbuf) \ #define SetMData(pbuf) ({ \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_MORE_DATA_); \ *(unsigned short *)(pbuf) |= cpu_to_le16(_MORE_DATA_); \
} while (0) })
#define GetMData(pbuf) (((*(unsigned short *)(pbuf)) & \ #define GetMData(pbuf) (((*(unsigned short *)(pbuf)) & \
le16_to_cpu(_MORE_DATA_)) != 0) le16_to_cpu(_MORE_DATA_)) != 0)
#define ClearMData(pbuf) \ #define ClearMData(pbuf) ({ \
do { \
*(unsigned short *)(pbuf) &= (~cpu_to_le16(_MORE_DATA_)); \ *(unsigned short *)(pbuf) &= (~cpu_to_le16(_MORE_DATA_)); \
} while (0) })
#define SetPrivacy(pbuf) \ #define SetPrivacy(pbuf) ({ \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_PRIVACY_); \ *(unsigned short *)(pbuf) |= cpu_to_le16(_PRIVACY_); \
} while (0) })
#define GetPrivacy(pbuf) (((*(unsigned short *)(pbuf)) & \ #define GetPrivacy(pbuf) (((*(unsigned short *)(pbuf)) & \
le16_to_cpu(_PRIVACY_)) != 0) le16_to_cpu(_PRIVACY_)) != 0)
#define ClearPrivacy(pbuf) \ #define ClearPrivacy(pbuf) ({ \
do { \
*(unsigned short *)(pbuf) &= (~cpu_to_le16(_PRIVACY_)); \ *(unsigned short *)(pbuf) &= (~cpu_to_le16(_PRIVACY_)); \
} while (0) })
#define GetOrder(pbuf) (((*(unsigned short *)(pbuf)) & \ #define GetOrder(pbuf) (((*(unsigned short *)(pbuf)) & \
...@@ -287,48 +273,42 @@ enum WIFI_REG_DOMAIN { ...@@ -287,48 +273,42 @@ enum WIFI_REG_DOMAIN {
#define GetTupleCache(pbuf) (cpu_to_le16(*(unsigned short *)\ #define GetTupleCache(pbuf) (cpu_to_le16(*(unsigned short *)\
((addr_t)(pbuf) + 22))) ((addr_t)(pbuf) + 22)))
#define SetFragNum(pbuf, num) \ #define SetFragNum(pbuf, num) ({ \
do { \
*(unsigned short *)((addr_t)(pbuf) + 22) = \ *(unsigned short *)((addr_t)(pbuf) + 22) = \
((*(unsigned short *)((addr_t)(pbuf) + 22)) & \ ((*(unsigned short *)((addr_t)(pbuf) + 22)) & \
le16_to_cpu(~(0x000f))) | \ le16_to_cpu(~(0x000f))) | \
cpu_to_le16(0x0f & (num)); \ cpu_to_le16(0x0f & (num)); \
} while (0) })
#define SetSeqNum(pbuf, num) \ #define SetSeqNum(pbuf, num) ({ \
do { \
*(unsigned short *)((addr_t)(pbuf) + 22) = \ *(unsigned short *)((addr_t)(pbuf) + 22) = \
((*(unsigned short *)((addr_t)(pbuf) + 22)) & \ ((*(unsigned short *)((addr_t)(pbuf) + 22)) & \
le16_to_cpu((unsigned short)0x000f)) | \ le16_to_cpu((unsigned short)0x000f)) | \
le16_to_cpu((unsigned short)(0xfff0 & (num << 4))); \ le16_to_cpu((unsigned short)(0xfff0 & (num << 4))); \
} while (0) })
#define SetDuration(pbuf, dur) \ #define SetDuration(pbuf, dur) ({ \
do { \
*(unsigned short *)((addr_t)(pbuf) + 2) |= \ *(unsigned short *)((addr_t)(pbuf) + 2) |= \
cpu_to_le16(0xffff & (dur)); \ cpu_to_le16(0xffff & (dur)); \
} while (0) })
#define SetPriority(pbuf, tid) \ #define SetPriority(pbuf, tid) ({ \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(tid & 0xf); \ *(unsigned short *)(pbuf) |= cpu_to_le16(tid & 0xf); \
} while (0) })
#define GetPriority(pbuf) ((le16_to_cpu(*(unsigned short *)(pbuf))) & 0xf) #define GetPriority(pbuf) ((le16_to_cpu(*(unsigned short *)(pbuf))) & 0xf)
#define SetAckpolicy(pbuf, ack) \ #define SetAckpolicy(pbuf, ack) ({ \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16((ack & 3) << 5); \ *(unsigned short *)(pbuf) |= cpu_to_le16((ack & 3) << 5); \
} while (0) })
#define GetAckpolicy(pbuf) (((le16_to_cpu(*(unsigned short *)pbuf)) >> 5) & 0x3) #define GetAckpolicy(pbuf) (((le16_to_cpu(*(unsigned short *)pbuf)) >> 5) & 0x3)
#define GetAMsdu(pbuf) (((le16_to_cpu(*(unsigned short *)pbuf)) >> 7) & 0x1) #define GetAMsdu(pbuf) (((le16_to_cpu(*(unsigned short *)pbuf)) >> 7) & 0x1)
#define SetAMsdu(pbuf, amsdu) \ #define SetAMsdu(pbuf, amsdu) ({ \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16((amsdu & 1) << 7); \ *(unsigned short *)(pbuf) |= cpu_to_le16((amsdu & 1) << 7); \
} while (0) })
#define GetAid(pbuf) (cpu_to_le16(*(unsigned short *)((addr_t)(pbuf) + 2)) \ #define GetAid(pbuf) (cpu_to_le16(*(unsigned short *)((addr_t)(pbuf) + 2)) \
& 0x3fff) & 0x3fff)
...@@ -526,10 +506,9 @@ static inline unsigned char *get_hdr_bssid(unsigned char *pframe) ...@@ -526,10 +506,9 @@ static inline unsigned char *get_hdr_bssid(unsigned char *pframe)
#define IEEE80211_DELBA_PARAM_TID_MASK 0xF000 #define IEEE80211_DELBA_PARAM_TID_MASK 0xF000
#define IEEE80211_DELBA_PARAM_INITIATOR_MASK 0x0800 #define IEEE80211_DELBA_PARAM_INITIATOR_MASK 0x0800
#define SetOrderBit(pbuf) \ #define SetOrderBit(pbuf) ({ \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_ORDER_); \ *(unsigned short *)(pbuf) |= cpu_to_le16(_ORDER_); \
} while (0) })
#define GetOrderBit(pbuf) (((*(unsigned short *)(pbuf)) & \ #define GetOrderBit(pbuf) (((*(unsigned short *)(pbuf)) & \
le16_to_cpu(_ORDER_)) != 0) le16_to_cpu(_ORDER_)) != 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment