rtl8188eu: Fix most sparse warnings other than endedness problems

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2013-06-03 14:52:18 -05:00
parent 925510ff1a
commit 327817d32a
47 changed files with 667 additions and 1771 deletions

View file

@ -89,12 +89,12 @@ typedef struct tag_HAL_VERSION
//HAL_VERSION VersionID;
// Get element
#define GET_CVID_IC_TYPE(version) ((HAL_IC_TYPE_E)(((HAL_VERSION)version).ICType) )
#define GET_CVID_CHIP_TYPE(version) ((HAL_CHIP_TYPE_E)(((HAL_VERSION)version).ChipType) )
#define GET_CVID_RF_TYPE(version) ((HAL_RF_TYPE_E)(((HAL_VERSION)version).RFType))
#define GET_CVID_MANUFACTUER(version) ((HAL_VENDOR_E)(((HAL_VERSION)version).VendorType))
#define GET_CVID_CUT_VERSION(version) ((HAL_CUT_VERSION_E)(((HAL_VERSION)version).CUTVersion))
#define GET_CVID_ROM_VERSION(version) ((((HAL_VERSION)version).ROMVer) & ROM_VERSION_MASK)
#define GET_CVID_IC_TYPE(version) (((version).ICType))
#define GET_CVID_CHIP_TYPE(version) (((version).ChipType))
#define GET_CVID_RF_TYPE(version) (((version).RFType))
#define GET_CVID_MANUFACTUER(version) (((version).VendorType))
#define GET_CVID_CUT_VERSION(version) (((version).CUTVersion))
#define GET_CVID_ROM_VERSION(version) (((version).ROMVer) & ROM_VERSION_MASK)
//----------------------------------------------------------------------------
//Common Macro. --
@ -124,9 +124,9 @@ typedef struct tag_HAL_VERSION
#define IS_CHIP_VENDOR_UMC(version) ((GET_CVID_MANUFACTUER(version) == CHIP_VENDOR_UMC)? true: false)
//HAL_RF_TYPE_E
#define IS_1T1R(version) ((GET_CVID_RF_TYPE(version) == RF_TYPE_1T1R)? true : false )
#define IS_1T2R(version) ((GET_CVID_RF_TYPE(version) == RF_TYPE_1T2R)? true : false)
#define IS_2T2R(version) ((GET_CVID_RF_TYPE(version) == RF_TYPE_2T2R)? true : false)
#define IS_1T1R(version) ((GET_CVID_RF_TYPE(version) == RF_TYPE_1T1R) ? true : false )
#define IS_1T2R(version) ((GET_CVID_RF_TYPE(version) == RF_TYPE_1T2R) ? true : false)
#define IS_2T2R(version) ((GET_CVID_RF_TYPE(version) == RF_TYPE_2T2R) ? true : false)
//----------------------------------------------------------------------------

View file

@ -146,4 +146,9 @@ void rtw_drv_if2_free(_adapter *if2);
void rtw_drv_if2_stop(_adapter *if2);
#endif
#ifdef SUPPORT_HW_RFOFF_DETECTED
int rtw_hw_suspend(_adapter *padapter );
int rtw_hw_resume(_adapter *padapter);
#endif
#endif //_OSDEP_INTF_H_

View file

@ -453,10 +453,6 @@ extern void _rtw_mutex_init(_mutex *pmutex);
extern void _rtw_mutex_free(_mutex *pmutex);
extern void _rtw_spinlock_init(_lock *plock);
extern void _rtw_spinlock_free(_lock *plock);
extern void _rtw_spinlock(_lock *plock);
extern void _rtw_spinunlock(_lock *plock);
extern void _rtw_spinlock_ex(_lock *plock);
extern void _rtw_spinunlock_ex(_lock *plock);
extern void _rtw_init_queue(_queue *pqueue);
extern u32 _rtw_queue_empty(_queue *pqueue);

View file

@ -52,6 +52,7 @@ int rtw_os_recvbuf_resource_free(_adapter *padapter, struct recv_buf *precvbuf);
void rtw_os_read_port(_adapter *padapter, struct recv_buf *precvbuf);
void rtw_init_recv_timer(struct recv_reorder_ctrl *preorder_ctrl);
int nat25_handle_frame(_adapter *priv, struct sk_buff *skb);
#endif //

View file

@ -1086,7 +1086,7 @@ enum rtw_h2c_cmd
#define _SetRFReg_CMD_ _Write_RFREG_CMD_
#ifdef _RTW_CMD_C_
struct _cmd_callback rtw_cmd_callback[] =
static struct _cmd_callback rtw_cmd_callback[] =
{
{GEN_CMD_CODE(_Read_MACREG), NULL}, /*0*/
{GEN_CMD_CODE(_Write_MACREG), NULL},

View file

@ -264,5 +264,8 @@ extern NDIS_STATUS drv_set_info(
u32* BytesRead,
u32* BytesNeeded
);
#ifdef CONFIG_GLOBAL_UI_PID
extern int ui_pid[3];
#endif
#endif // #ifndef __INC_CEINFO_

View file

@ -31,29 +31,6 @@ typedef struct _BSSIDInfo {
NDIS_802_11_PMKID_VALUE PMKID;
} BSSIDInfo, *PBSSIDInfo;
#ifdef PLATFORM_OS_XP
typedef struct _NDIS_802_11_PMKID {
u32 Length;
u32 BSSIDInfoCount;
BSSIDInfo BSSIDInfo[1];
} NDIS_802_11_PMKID, *PNDIS_802_11_PMKID;
#endif
#ifdef PLATFORM_WINDOWS
u8 rtw_set_802_11_reload_defaults(_adapter * padapter, NDIS_802_11_RELOAD_DEFAULTS reloadDefaults);
u8 rtw_set_802_11_test(_adapter * padapter, NDIS_802_11_TEST * test);
u8 rtw_set_802_11_pmkid(_adapter *pdapter, NDIS_802_11_PMKID *pmkid);
u8 rtw_pnp_set_power_sleep(_adapter* padapter);
u8 rtw_pnp_set_power_wakeup(_adapter* padapter);
void rtw_pnp_resume_wk(void *context);
void rtw_pnp_sleep_wk(void * context);
#endif
u8 rtw_set_802_11_add_key(_adapter * padapter, NDIS_802_11_KEY * key);
u8 rtw_set_802_11_authentication_mode(_adapter *pdapter, NDIS_802_11_AUTHENTICATION_MODE authmode);
u8 rtw_set_802_11_bssid(_adapter* padapter, u8 *bssid);
@ -72,5 +49,6 @@ u16 rtw_get_cur_max_rate(_adapter *adapter);
int rtw_set_scan_mode(_adapter *adapter, RT_SCAN_TYPE scan_mode);
int rtw_set_channel_plan(_adapter *adapter, u8 channel_plan);
int rtw_set_country(_adapter *adapter, const char *country_code);
int rtw_change_ifname(_adapter *padapter, const char *ifname);
#endif

View file

@ -821,7 +821,7 @@ u8 tdls_hdl(_adapter *padapter, unsigned char *pbuf);
#ifdef _RTW_CMD_C_
struct cmd_hdl wlancmds[] =
static struct cmd_hdl wlancmds[] =
{
GEN_DRV_CMD_HANDLER(0, NULL) /*0*/
GEN_DRV_CMD_HANDLER(0, NULL)

View file

@ -508,14 +508,12 @@ enum RTL871X_MP_IOCTL_SUBCODE {
u32 mp_ioctl_xmit_packet_hdl(struct oid_par_priv* poid_par_priv);
#ifdef _RTW_MP_IOCTL_C_
#define GEN_MP_IOCTL_HANDLER(sz, hdl, oid) {sz, hdl, oid},
#define EXT_MP_IOCTL_HANDLER(sz, subcode, oid) {sz, mp_ioctl_ ## subcode ## _hdl, oid},
struct mp_ioctl_handler mp_ioctl_hdl[] = {
static struct mp_ioctl_handler mp_ioctl_hdl[] = {
/*0*/ GEN_MP_IOCTL_HANDLER(sizeof(u32), oid_rt_pro_start_test_hdl, OID_RT_PRO_START_TEST)
GEN_MP_IOCTL_HANDLER(sizeof(u32), oid_rt_pro_stop_test_hdl, OID_RT_PRO_STOP_TEST)
@ -557,13 +555,6 @@ struct mp_ioctl_handler mp_ioctl_hdl[] = {
/*30*/ GEN_MP_IOCTL_HANDLER(sizeof(u8), oid_rt_set_power_down_hdl, OID_RT_SET_POWER_DOWN)
/*31*/ GEN_MP_IOCTL_HANDLER(0, oid_rt_pro_trigger_gpio_hdl, 0)
};
#else /* _RTW_MP_IOCTL_C_ */
extern struct mp_ioctl_handler mp_ioctl_hdl[];
#endif /* _RTW_MP_IOCTL_C_ */
#endif

View file

@ -25,13 +25,17 @@
#include <drv_types.h>
#include <usb_vendor_req.h>
extern char* rtw_initmac;
extern int rtw_mc2u_disable;
#define USBD_HALTED(Status) ((ULONG)(Status) >> 30 == 3)
//uint usb_dvobj_init(_adapter * adapter);
//void usb_dvobj_deinit(_adapter * adapter);
u8 usbvendorrequest(struct dvobj_priv *pdvobjpriv, RT_USB_BREQUEST brequest, RT_USB_WVALUE wvalue, u8 windex, void* data, u8 datalen, u8 isdirectionin);
int pm_netdev_open(struct net_device *pnetdev,u8 bnormal);
void netdev_br_init(struct net_device *netdev);
void dhcp_flag_bcast(_adapter *priv, struct sk_buff *skb);
void *scdb_findEntry(_adapter *priv, unsigned char *macAddr, unsigned char *ipAddr);
void nat25_db_expire(_adapter *priv);
int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method);
#endif

View file

@ -250,26 +250,26 @@ enum WIFI_REG_DOMAIN {
#define SetToDs(pbuf) \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_TO_DS_); \
*(__le16 *)(pbuf) |= cpu_to_le16(_TO_DS_); \
} while (0)
#define GetToDs(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_TO_DS_)) != 0)
#define ClearToDs(pbuf) \
do { \
*(unsigned short *)(pbuf) &= (~cpu_to_le16(_TO_DS_)); \
*(__le16 *)(pbuf) &= (~cpu_to_le16(_TO_DS_)); \
} while (0)
#define SetFrDs(pbuf) \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_FROM_DS_); \
*(__le16 *)(pbuf) |= cpu_to_le16(_FROM_DS_); \
} while (0)
#define GetFrDs(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_FROM_DS_)) != 0)
#define ClearFrDs(pbuf) \
do { \
*(unsigned short *)(pbuf) &= (~cpu_to_le16(_FROM_DS_)); \
*(__le16 *)(pbuf) &= (~cpu_to_le16(_FROM_DS_)); \
} while (0)
#define get_tofr_ds(pframe) ((GetToDs(pframe) << 1) | GetFrDs(pframe))
@ -277,62 +277,62 @@ enum WIFI_REG_DOMAIN {
#define SetMFrag(pbuf) \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_MORE_FRAG_); \
*(__le16 *)(pbuf) |= cpu_to_le16(_MORE_FRAG_); \
} while (0)
#define GetMFrag(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_MORE_FRAG_)) != 0)
#define ClearMFrag(pbuf) \
do { \
*(unsigned short *)(pbuf) &= (~cpu_to_le16(_MORE_FRAG_)); \
*(__le16 *)(pbuf) &= (~cpu_to_le16(_MORE_FRAG_)); \
} while (0)
#define SetRetry(pbuf) \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_RETRY_); \
*(__le16 *)(pbuf) |= cpu_to_le16(_RETRY_); \
} while (0)
#define GetRetry(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_RETRY_)) != 0)
#define ClearRetry(pbuf) \
do { \
*(unsigned short *)(pbuf) &= (~cpu_to_le16(_RETRY_)); \
*(__le16 *)(pbuf) &= (~cpu_to_le16(_RETRY_)); \
} while (0)
#define SetPwrMgt(pbuf) \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_PWRMGT_); \
*(__le16 *)(pbuf) |= cpu_to_le16(_PWRMGT_); \
} while (0)
#define GetPwrMgt(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_PWRMGT_)) != 0)
#define ClearPwrMgt(pbuf) \
do { \
*(unsigned short *)(pbuf) &= (~cpu_to_le16(_PWRMGT_)); \
*(__le16 *)(pbuf) &= (~cpu_to_le16(_PWRMGT_)); \
} while (0)
#define SetMData(pbuf) \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_MORE_DATA_); \
*(__le16 *)(pbuf) |= cpu_to_le16(_MORE_DATA_); \
} while (0)
#define GetMData(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_MORE_DATA_)) != 0)
#define ClearMData(pbuf) \
do { \
*(unsigned short *)(pbuf) &= (~cpu_to_le16(_MORE_DATA_)); \
*(__le16 *)(pbuf) &= (~cpu_to_le16(_MORE_DATA_)); \
} while (0)
#define SetPrivacy(pbuf) \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_PRIVACY_); \
*(__le16 *)(pbuf) |= cpu_to_le16(_PRIVACY_); \
} while (0)
#define GetPrivacy(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_PRIVACY_)) != 0)
#define ClearPrivacy(pbuf) \
do { \
*(unsigned short *)(pbuf) &= (~cpu_to_le16(_PRIVACY_)); \
*(__le16 *)(pbuf) &= (~cpu_to_le16(_PRIVACY_)); \
} while (0)
@ -350,8 +350,8 @@ enum WIFI_REG_DOMAIN {
#define SetFrameSubType(pbuf,type) \
do { \
*(unsigned short *)(pbuf) &= cpu_to_le16(~(BIT(7) | BIT(6) | BIT(5) | BIT(4) | BIT(3) | BIT(2))); \
*(unsigned short *)(pbuf) |= cpu_to_le16(type); \
*(__le16 *)(pbuf) &= cpu_to_le16(~(BIT(7) | BIT(6) | BIT(5) | BIT(4) | BIT(3) | BIT(2))); \
*(__le16 *)(pbuf) |= cpu_to_le16(type); \
} while (0)
#define GetSequence(pbuf) (cpu_to_le16(*(unsigned short *)((SIZE_PTR)(pbuf) + 22)) >> 4)
@ -369,32 +369,32 @@ enum WIFI_REG_DOMAIN {
#define SetSeqNum(pbuf, num) \
do { \
*(unsigned short *)((SIZE_PTR)(pbuf) + 22) = \
((*(unsigned short *)((SIZE_PTR)(pbuf) + 22)) & le16_to_cpu((unsigned short)~0xfff0)) | \
*(u16 *)((SIZE_PTR)(pbuf) + 22) = \
((*(u16 *)((SIZE_PTR)(pbuf) + 22)) & le16_to_cpu((unsigned short)0x000f)) | \
le16_to_cpu((unsigned short)(0xfff0 & (num << 4))); \
} while (0)
#define SetDuration(pbuf, dur) \
do { \
*(unsigned short *)((SIZE_PTR)(pbuf) + 2) = cpu_to_le16(0xffff & (dur)); \
*(__le16 *)((SIZE_PTR)(pbuf) + 2) = cpu_to_le16(0xffff & (dur)); \
} while (0)
#define SetPriority(pbuf, tid) \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(tid & 0xf); \
*(__le16 *)(pbuf) |= cpu_to_le16(tid & 0xf); \
} while (0)
#define GetPriority(pbuf) ((le16_to_cpu(*(unsigned short *)(pbuf))) & 0xf)
#define SetEOSP(pbuf, eosp) \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16( (eosp & 1) << 4); \
*(__le16 *)(pbuf) |= cpu_to_le16( (eosp & 1) << 4); \
} while (0)
#define SetAckpolicy(pbuf, ack) \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16( (ack & 3) << 5); \
*(__le16 *)(pbuf) |= cpu_to_le16( (ack & 3) << 5); \
} while (0)
#define GetAckpolicy(pbuf) (((le16_to_cpu(*(unsigned short *)pbuf)) >> 5) & 0x3)
@ -403,7 +403,7 @@ enum WIFI_REG_DOMAIN {
#define SetAMsdu(pbuf, amsdu) \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16( (amsdu & 1) << 7); \
*(__le16 *)(pbuf) |= cpu_to_le16( (amsdu & 1) << 7); \
} while (0)
#define GetAid(pbuf) (cpu_to_le16(*(unsigned short *)((SIZE_PTR)(pbuf) + 2)) & 0x3fff)

View file

@ -23,7 +23,6 @@
#define MAX_IE_SZ 768
#ifdef PLATFORM_LINUX
#define NDIS_802_11_LENGTH_SSID 32
@ -666,5 +665,8 @@ typedef struct _NDIS_802_11_CAPABILITY
} NDIS_802_11_CAPABILITY, *PNDIS_802_11_CAPABILITY;
#endif
u8 key_2char2num(u8 hch, u8 lch);
u8 key_char2num(u8 ch);
u8 str_2char2num(u8 hch, u8 lch);
#endif //#ifndef WLAN_BSSDEF_H_

View file

@ -33,39 +33,11 @@ struct pkt_file {
SIZE_T buf_len;
};
#ifdef PLATFORM_WINDOWS
#ifdef PLATFORM_OS_XP
#ifdef CONFIG_USB_HCI
#include <usb.h>
#include <usbdlib.h>
#include <usbioctl.h>
#ifdef CONFIG_80211N_HT
extern int rtw_ht_enable;
extern int rtw_cbw40_enable;
extern int rtw_ampdu_enable;//for enable tx_ampdu
#endif
#endif
#ifdef CONFIG_GSPI_HCI
#define NR_XMITFRAME 64
#else
#define NR_XMITFRAME 128
#endif
#define ETH_ALEN 6
extern NDIS_STATUS rtw_xmit_entry(
_nic_hdl cnxt,
NDIS_PACKET *pkt,
UINT flags
);
#endif
#ifdef PLATFORM_FREEBSD
#define NR_XMITFRAME 256
extern int rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev);
extern void rtw_xmit_entry_wrap (struct ifnet * pifp);
#endif //PLATFORM_FREEBSD
#ifdef PLATFORM_LINUX
#define NR_XMITFRAME 256
@ -77,8 +49,6 @@ struct xmit_buf;
extern int rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev);
#endif
void rtw_os_xmit_schedule(_adapter *padapter);
int rtw_os_xmit_resource_alloc(_adapter *padapter, struct xmit_buf *pxmitbuf,u32 alloc_sz);