Commit 8567829a authored by Larry Finger's avatar Larry Finger Committed by Greg Kroah-Hartman

staging: rtl8192e: Cleanup checkpatch -f warnings and errors - Part XII

This patch removes all the errors and most of the warnings generated by
checkpatch -f.
Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent a44325f9
......@@ -70,8 +70,8 @@
*
*/
#define container_of(ptr, type, member) ({ \
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
(type *)( (char *)__mptr - offsetof(type,member) );})
const typeof(((type *)0)->member)*__mptr = (ptr); \
(type *)((char *)__mptr - offsetof(type, member)); })
#endif
#define skb_tail_pointer_rsl(skb) skb_tail_pointer(skb)
......@@ -79,21 +79,24 @@
#define EXPORT_SYMBOL_RSL(x) EXPORT_SYMBOL(x)
#define queue_delayed_work_rsl(x,y,z) queue_delayed_work(x,y,z)
#define INIT_DELAYED_WORK_RSL(x,y,z) INIT_DELAYED_WORK(x,y)
#define queue_delayed_work_rsl(x, y, z) queue_delayed_work(x, y, z)
#define INIT_DELAYED_WORK_RSL(x, y, z) INIT_DELAYED_WORK(x, y)
#define queue_work_rsl(x,y) queue_work(x,y)
#define INIT_WORK_RSL(x,y,z) INIT_WORK(x,y)
#define queue_work_rsl(x, y) queue_work(x, y)
#define INIT_WORK_RSL(x, y, z) INIT_WORK(x, y)
#define container_of_work_rsl(x,y,z) container_of(x,y,z)
#define container_of_dwork_rsl(x,y,z) container_of(container_of(x, struct delayed_work, work), y, z)
#define container_of_work_rsl(x, y, z) container_of(x, y, z)
#define container_of_dwork_rsl(x, y, z) \
container_of(container_of(x, struct delayed_work, work), y, z)
#define iwe_stream_add_event_rsl(info,start,stop,iwe,len) iwe_stream_add_event(info,start,stop,iwe,len)
#define iwe_stream_add_event_rsl(info, start, stop, iwe, len) \
iwe_stream_add_event(info, start, stop, iwe, len)
#define iwe_stream_add_point_rsl(info,start,stop,iwe,p) iwe_stream_add_point(info,start,stop,iwe,p)
#define iwe_stream_add_point_rsl(info, start, stop, iwe, p) \
iwe_stream_add_point(info, start, stop, iwe, p)
#define usb_alloc_urb_rsl(x,y) usb_alloc_urb(x,y)
#define usb_submit_urb_rsl(x,y) usb_submit_urb(x,y)
#define usb_alloc_urb_rsl(x, y) usb_alloc_urb(x, y)
#define usb_submit_urb_rsl(x, y) usb_submit_urb(x, y)
static inline void *netdev_priv_rsl(struct net_device *dev)
{
......@@ -139,8 +142,10 @@ static inline void *netdev_priv_rsl(struct net_device *dev)
#define RT_RF_PS_LEVEL_ALWAYS_ASPM BIT6
#define RT_RF_LPS_DISALBE_2R BIT30
#define RT_RF_LPS_LEVEL_ASPM BIT31
#define RT_IN_PS_LEVEL(pPSC, _PS_FLAG) ((pPSC->CurPsLevel & _PS_FLAG) ? true : false)
#define RT_CLEAR_PS_LEVEL(pPSC, _PS_FLAG) (pPSC->CurPsLevel &= (~(_PS_FLAG)))
#define RT_IN_PS_LEVEL(pPSC, _PS_FLAG) \
((pPSC->CurPsLevel & _PS_FLAG) ? true : false)
#define RT_CLEAR_PS_LEVEL(pPSC, _PS_FLAG) \
(pPSC->CurPsLevel &= (~(_PS_FLAG)))
#define RT_SET_PS_LEVEL(pPSC, _PS_FLAG) (pPSC->CurPsLevel |= _PS_FLAG)
/* defined for skb cb field */
......@@ -251,7 +256,7 @@ struct cb_desc {
#define MGN_MCS15_SG 0x9f
enum _ReasonCode{
enum _ReasonCode {
unspec_reason = 0x1,
auth_not_valid = 0x2,
deauth_lv_ss = 0x3,
......@@ -273,7 +278,7 @@ enum _ReasonCode{
invalid_AKMP = 0x14,
unsup_RSNIEver = 0x15,
invalid_RSNIE = 0x16,
auth_802_1x_fail= 0x17,
auth_802_1x_fail = 0x17,
ciper_reject = 0x18,
QoS_unspec = 0x20,
......@@ -282,7 +287,7 @@ enum _ReasonCode{
no_facility = 0x23,
req_declined = 0x25,
invalid_param = 0x26,
req_not_honored= 0x27,
req_not_honored = 0x27,
TS_not_created = 0x2F,
DL_not_allowed = 0x30,
dest_not_exist = 0x31,
......@@ -311,7 +316,6 @@ enum hal_def_variable {
HAL_DEF_USB_IN_TOKEN_REV,
};
enum hw_variables {
HW_VAR_ETHER_ADDR,
HW_VAR_MULTICAST_REG,
......@@ -411,7 +415,10 @@ enum rt_op_mode {
};
#define aSifsTime (((priv->rtllib->current_network.mode == IEEE_A)||(priv->rtllib->current_network.mode == IEEE_N_24G)||(priv->rtllib->current_network.mode == IEEE_N_5G))? 16 : 10)
#define aSifsTime \
(((priv->rtllib->current_network.mode == IEEE_A) \
|| (priv->rtllib->current_network.mode == IEEE_N_24G) \
|| (priv->rtllib->current_network.mode == IEEE_N_5G)) ? 16 : 10)
#define MGMT_QUEUE_NUM 5
......@@ -452,8 +459,9 @@ enum rt_op_mode {
#define IEEE_CRYPT_ALG_NAME_LEN 16
#define MAX_IE_LEN 0xff
#define RT_ASSERT_RET(_Exp) do {} while(0)
#define RT_ASSERT_RET_VALUE(_Exp,Ret) do {} while(0)
#define RT_ASSERT_RET(_Exp) do {} while (0)
#define RT_ASSERT_RET_VALUE(_Exp, Ret) \
do {} while (0)
struct ieee_param {
u32 cmd;
......@@ -468,7 +476,7 @@ struct ieee_param {
u8 reserved[32];
u8 data[0];
} wpa_ie;
struct{
struct {
int command;
int reason_code;
} mlme;
......@@ -586,11 +594,13 @@ struct ieee_param {
#define RTLLIB_QCTL_TID 0x000F
#define FC_QOS_BIT BIT7
#define IsDataFrame(pdu) ( ((pdu[0] & 0x0C)==0x08) ? true : false )
#define IsLegacyDataFrame(pdu) (IsDataFrame(pdu) && (!(pdu[0]&FC_QOS_BIT)) )
#define IsQoSDataFrame(pframe) ((*(u16*)pframe&(RTLLIB_STYPE_QOS_DATA|RTLLIB_FTYPE_DATA)) == (RTLLIB_STYPE_QOS_DATA|RTLLIB_FTYPE_DATA))
#define Frame_Order(pframe) (*(u16*)pframe&RTLLIB_FCTL_ORDER)
#define SN_LESS(a, b) (((a-b)&0x800)!=0)
#define IsDataFrame(pdu) (((pdu[0] & 0x0C) == 0x08) ? true : false)
#define IsLegacyDataFrame(pdu) (IsDataFrame(pdu) && (!(pdu[0]&FC_QOS_BIT)))
#define IsQoSDataFrame(pframe) \
((*(u16 *)pframe&(RTLLIB_STYPE_QOS_DATA|RTLLIB_FTYPE_DATA)) == \
(RTLLIB_STYPE_QOS_DATA|RTLLIB_FTYPE_DATA))
#define Frame_Order(pframe) (*(u16 *)pframe&RTLLIB_FCTL_ORDER)
#define SN_LESS(a, b) (((a-b)&0x800) != 0)
#define SN_EQUAL(a, b) (a == b)
#define MAX_DEV_ADDR_SIZE 8
......@@ -616,7 +626,7 @@ enum ba_action {
};
enum init_gain_op_type {
IG_Backup=0,
IG_Backup = 0,
IG_Restore,
IG_Max
};
......@@ -670,25 +680,29 @@ enum wireless_network_type {
/* debug macros */
extern u32 rtllib_debug_level;
#define RTLLIB_DEBUG(level, fmt, args...) \
do { if (rtllib_debug_level & (level)) \
printk(KERN_DEBUG "rtllib: " fmt, ## args); } while (0)
do { \
if (rtllib_debug_level & (level)) \
printk(KERN_DEBUG "rtllib: " fmt, ## args); \
} while (0)
#define RTLLIB_DEBUG_DATA(level, data, datalen) \
do{ if ((rtllib_debug_level & (level)) == (level)) \
{ \
do { \
if ((rtllib_debug_level & (level)) == (level)) { \
int i; \
u8* pdata = (u8*) data; \
u8 *pdata = (u8 *)data; \
printk(KERN_DEBUG "rtllib: %s()\n", __func__); \
for (i=0; i<(int)(datalen); i++) \
{ \
for (i = 0; i < (int)(datalen); i++) { \
printk("%2.2x ", pdata[i]); \
if ((i+1)%16 == 0) printk("\n"); \
if ((i+1)%16 == 0) \
printk("\n"); \
} \
printk("\n"); \
} \
} while (0)
#define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x"
#define MAC_ARG(x) ((u8*)(x))[0],((u8*)(x))[1],((u8*)(x))[2],((u8*)(x))[3],((u8*)(x))[4],((u8*)(x))[5]
#define MAC_ARG(x) ((u8 *)(x))[0], ((u8 *)(x))[1], ((u8 *)(x))[2], \
((u8 *)(x))[3], ((u8 *)(x))[4], ((u8 *)(x))[5]
/*
* To use the debug system;
......@@ -753,22 +767,21 @@ do { if (rtllib_debug_level & (level)) \
/* Added by Annie, 2005-11-22. */
#define MAX_STR_LEN 64
/* I want to see ASCII 33 to 126 only. Otherwise, I print '?'. Annie, 2005-11-22.*/
#define PRINTABLE(_ch) (_ch>'!' && _ch<'~')
/* I want to see ASCII 33 to 126 only. Otherwise, I print '?'. */
#define PRINTABLE(_ch) (_ch > '!' && _ch < '~')
#define RTLLIB_PRINT_STR(_Comp, _TitleString, _Ptr, _Len) \
if ((_Comp) & level) \
{ \
if ((_Comp) & level) { \
int __i; \
u8 struct buffer[MAX_STR_LEN]; \
int length = (_Len<MAX_STR_LEN)? _Len : (MAX_STR_LEN-1) ; \
int length = (_Len < MAX_STR_LEN) ? _Len : (MAX_STR_LEN-1) ;\
memset(struct buffer, 0, MAX_STR_LEN); \
memcpy(struct buffer, (u8 *)_Ptr, length ); \
for ( __i=0; __i<MAX_STR_LEN; __i++ ) \
{ \
if ( !PRINTABLE(struct buffer[__i]) ) struct buffer[__i] = '?'; \
memcpy(struct buffer, (u8 *)_Ptr, length); \
for (__i = 0; __i < MAX_STR_LEN; __i++) { \
if (!PRINTABLE(struct buffer[__i])) \
struct buffer[__i] = '?'; \
} \
struct buffer[length] = '\0'; \
printk("Rtl819x: "); \
printk(KERN_INFO "Rtl819x: "); \
printk(_TitleString); \
printk(": %d, <%s>\n", _Len, struct buffer); \
}
......@@ -795,12 +808,12 @@ struct rtllib_snap_hdr {
u8 ctrl; /* always 0x03 */
u8 oui[P80211_OUI_LEN]; /* organizational universal id */
} __attribute__ ((packed));
} __packed;
enum _REG_PREAMBLE_MODE{
enum _REG_PREAMBLE_MODE {
PREAMBLE_LONG = 1,
PREAMBLE_AUTO = 2,
PREAMBLE_SHORT= 3,
PREAMBLE_SHORT = 3,
};
#define SNAP_SIZE sizeof(struct rtllib_snap_hdr)
......@@ -992,7 +1005,6 @@ struct ieee_ibss_seq {
* information for frames received. Not setting these will not cause
* any adverse affects. */
struct rtllib_rx_stats {
#if 1
u64 mac_time;
s8 rssi;
u8 signal;
......@@ -1038,7 +1050,7 @@ struct rtllib_rx_stats {
bool bPacketMatchBSSID;
bool bIsCCK;
bool bPacketToSelf;
u8* virtual_address;
u8 *virtual_address;
u16 packetlength;
u16 fraglength;
u16 fragoffset;
......@@ -1049,8 +1061,6 @@ struct rtllib_rx_stats {
char cck_adc_pwdb[4];
u16 Seq_Num;
u8 nTotalAggPkt;
#endif
};
/* IEEE 802.11 requires that STA supports concurrent reception of at least
......@@ -1134,7 +1144,7 @@ struct rtllib_security {
u8 keys[WEP_KEYS][SCM_KEY_LEN];
u8 level;
u16 flags;
} __attribute__ ((packed));
} __packed;
/*
......@@ -1173,11 +1183,11 @@ enum rtllib_mfie {
MFIE_TYPE_QUIET = 40,
MFIE_TYPE_IBSS_DFS = 41,
MFIE_TYPE_ERP = 42,
MFIE_TYPE_HT_CAP= 45,
MFIE_TYPE_HT_CAP = 45,
MFIE_TYPE_RSN = 48,
MFIE_TYPE_RATES_EX = 50,
MFIE_TYPE_HT_INFO= 61,
MFIE_TYPE_AIRONET=133,
MFIE_TYPE_HT_INFO = 61,
MFIE_TYPE_AIRONET = 133,
MFIE_TYPE_GENERIC = 221,
MFIE_TYPE_QOS_PARAMETER = 222,
};
......@@ -1190,20 +1200,20 @@ struct rtllib_pspoll_hdr {
__le16 aid;
u8 bssid[ETH_ALEN];
u8 ta[ETH_ALEN];
} __attribute__ ((packed));
} __packed;
struct rtllib_hdr {
__le16 frame_ctl;
__le16 duration_id;
u8 payload[0];
} __attribute__ ((packed));
} __packed;
struct rtllib_hdr_1addr {
__le16 frame_ctl;
__le16 duration_id;
u8 addr1[ETH_ALEN];
u8 payload[0];
} __attribute__ ((packed));
} __packed;
struct rtllib_hdr_2addr {
__le16 frame_ctl;
......@@ -1211,7 +1221,7 @@ struct rtllib_hdr_2addr {
u8 addr1[ETH_ALEN];
u8 addr2[ETH_ALEN];
u8 payload[0];
} __attribute__ ((packed));
} __packed;
struct rtllib_hdr_3addr {
__le16 frame_ctl;
......@@ -1221,7 +1231,7 @@ struct rtllib_hdr_3addr {
u8 addr3[ETH_ALEN];
__le16 seq_ctl;
u8 payload[0];
} __attribute__ ((packed));
} __packed;
struct rtllib_hdr_4addr {
__le16 frame_ctl;
......@@ -1232,7 +1242,7 @@ struct rtllib_hdr_4addr {
__le16 seq_ctl;
u8 addr4[ETH_ALEN];
u8 payload[0];
} __attribute__ ((packed));
} __packed;
struct rtllib_hdr_3addrqos {
__le16 frame_ctl;
......@@ -1243,7 +1253,7 @@ struct rtllib_hdr_3addrqos {
__le16 seq_ctl;
__le16 qos_ctl;
u8 payload[0];
} __attribute__ ((packed));
} __packed;
struct rtllib_hdr_4addrqos {
__le16 frame_ctl;
......@@ -1255,13 +1265,13 @@ struct rtllib_hdr_4addrqos {
u8 addr4[ETH_ALEN];
__le16 qos_ctl;
u8 payload[0];
} __attribute__ ((packed));
} __packed;
struct rtllib_info_element {
u8 id;
u8 len;
u8 data[0];
} __attribute__ ((packed));
} __packed;
struct rtllib_authentication {
struct rtllib_hdr_3addr header;
......@@ -1270,23 +1280,23 @@ struct rtllib_authentication {
__le16 status;
/*challenge*/
struct rtllib_info_element info_element[0];
} __attribute__ ((packed));
} __packed;
struct rtllib_disauth {
struct rtllib_hdr_3addr header;
__le16 reason;
} __attribute__ ((packed));
} __packed;
struct rtllib_disassoc {
struct rtllib_hdr_3addr header;
__le16 reason;
} __attribute__ ((packed));
} __packed;
struct rtllib_probe_request {
struct rtllib_hdr_3addr header;
/* SSID, supported rates */
struct rtllib_info_element info_element[0];
} __attribute__ ((packed));
} __packed;
struct rtllib_probe_response {
struct rtllib_hdr_3addr header;
......@@ -1296,7 +1306,7 @@ struct rtllib_probe_response {
/* SSID, supported rates, FH params, DS params,
* CF params, IBSS params, TIM (if beacon), RSN */
struct rtllib_info_element info_element[0];
} __attribute__ ((packed));
} __packed;
/* Alias beacon for probe_response */
#define rtllib_beacon rtllib_probe_response
......@@ -1307,7 +1317,7 @@ struct rtllib_assoc_request_frame {
__le16 listen_interval;
/* SSID, supported rates, RSN */
struct rtllib_info_element info_element[0];
} __attribute__ ((packed));
} __packed;
struct rtllib_reassoc_request_frame {
struct rtllib_hdr_3addr header;
......@@ -1316,7 +1326,7 @@ struct rtllib_reassoc_request_frame {
u8 current_ap[ETH_ALEN];
/* SSID, supported rates, RSN */
struct rtllib_info_element info_element[0];
} __attribute__ ((packed));
} __packed;
struct rtllib_assoc_response_frame {
struct rtllib_hdr_3addr header;
......@@ -1324,7 +1334,7 @@ struct rtllib_assoc_response_frame {
__le16 status;
__le16 aid;
struct rtllib_info_element info_element[0]; /* supported rates */
} __attribute__ ((packed));
} __packed;
struct rtllib_txb {
u8 nr_frags;
......@@ -1341,7 +1351,7 @@ struct rtllib_txb {
struct rtllib_drv_agg_txb {
u8 nr_drv_agg_frames;
struct sk_buff *tx_agg_frames[MAX_TX_AGG_COUNT];
}__attribute__((packed));
} __packed;
#define MAX_SUBFRAME_COUNT 64
struct rtllib_rxb {
......@@ -1349,7 +1359,7 @@ struct rtllib_rxb {
struct sk_buff *subframes[MAX_SUBFRAME_COUNT];
u8 dst[ETH_ALEN];
u8 src[ETH_ALEN];
}__attribute__((packed));
} __packed;
union frameqos {
u16 shortdata;
......@@ -1360,7 +1370,7 @@ union frameqos {
u16 ack_policy:2;
u16 reserved:1;
u16 txop:8;
}field;
} field;
};
/* SWEEP TABLE ENTRIES NUMBER*/
......@@ -1409,7 +1419,7 @@ union frameqos {
#define QOS_OUI_PARAM_SUB_TYPE 1
#define QOS_VERSION_1 1
#define QOS_AIFSN_MIN_VALUE 2
#if 1
struct rtllib_qos_information_element {
u8 elementID;
u8 length;
......@@ -1418,19 +1428,19 @@ struct rtllib_qos_information_element {
u8 qui_subtype;
u8 version;
u8 ac_info;
} __attribute__ ((packed));
} __packed;
struct rtllib_qos_ac_parameter {
u8 aci_aifsn;
u8 ecw_min_max;
__le16 tx_op_limit;
} __attribute__ ((packed));
} __packed;
struct rtllib_qos_parameter_info {
struct rtllib_qos_information_element info_element;
u8 reserved;
struct rtllib_qos_ac_parameter ac_params_record[QOS_QUEUE_NUM];
} __attribute__ ((packed));
} __packed;
struct rtllib_qos_parameters {
__le16 cw_min[QOS_QUEUE_NUM];
......@@ -1438,7 +1448,7 @@ struct rtllib_qos_parameters {
u8 aifs[QOS_QUEUE_NUM];
u8 flag[QOS_QUEUE_NUM];
__le16 tx_op_limit[QOS_QUEUE_NUM];
} __attribute__ ((packed));
} __packed;
struct rtllib_qos_data {
struct rtllib_qos_parameters parameters;
......@@ -1452,7 +1462,7 @@ struct rtllib_qos_data {
struct rtllib_tim_parameters {
u8 tim_count;
u8 tim_period;
} __attribute__ ((packed));
} __packed;
struct rtllib_wmm_ac_param {
u8 ac_aci_acm_aifsn;
......@@ -1464,7 +1474,7 @@ struct rtllib_wmm_ts_info {
u8 ac_dir_tid;
u8 ac_up_psb;
u8 reserved;
} __attribute__ ((packed));
} __packed;
struct rtllib_wmm_tspec_elem {
struct rtllib_wmm_ts_info ts_info;
......@@ -1483,8 +1493,8 @@ struct rtllib_wmm_tspec_elem {
u32 min_phy_rate;
u16 surp_band_allow;
u16 medium_time;
}__attribute__((packed));
#endif
} __packed;
enum eap_type {
EAP_PACKET = 0,
EAPOL_START,
......@@ -1503,15 +1513,17 @@ static const char *eap_types[] = {
static inline const char *eap_get_type(int type)
{
return ((u32)type >= ARRAY_SIZE(eap_types)) ? "Unknown" : eap_types[type];
return ((u32)type >= ARRAY_SIZE(eap_types)) ? "Unknown" :
eap_types[type];
}
static inline u8 Frame_QoSTID(u8* buf)
static inline u8 Frame_QoSTID(u8 *buf)
{
struct rtllib_hdr_3addr *hdr;
u16 fc;
hdr = (struct rtllib_hdr_3addr *)buf;
fc = le16_to_cpu(hdr->frame_ctl);
return (u8)((union 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;
}
......@@ -1521,9 +1533,9 @@ struct eapol {
u8 version;
u8 type;
u16 length;
} __attribute__ ((packed));
} __packed;
struct rtllib_softmac_stats{
struct rtllib_softmac_stats {
unsigned int rx_ass_ok;
unsigned int rx_ass_err;
unsigned int rx_probe_rq;
......@@ -1551,7 +1563,7 @@ struct rtllib_softmac_stats{
struct rtllib_info_element_hdr {
u8 id;
u8 len;
} __attribute__ ((packed));
} __packed;
/*
* These are the data types that can make up management packets
......@@ -1564,7 +1576,7 @@ struct rtllib_info_element_hdr {
u16 listen_interval;
struct {
u16 association_id:14, reserved:2;
} __attribute__ ((packed));
} __packed;
u32 time_stamp[2];
u16 reason;
u16 status;
......@@ -1611,13 +1623,14 @@ enum {WMM_all_frame, WMM_two_frame, WMM_four_frame, WMM_six_frame};
0)
#define ETHER_ADDR_LEN 6 /* length of an Ethernet address */
#define ETHERNET_HEADER_SIZE 14 /* length of two Ethernet address plus ether type*/
#define ETHERNET_HEADER_SIZE 14 /* length of two Ethernet address
* plus ether type*/
struct ether_header {
u8 ether_dhost[ETHER_ADDR_LEN];
u8 ether_shost[ETHER_ADDR_LEN];
u16 ether_type;
} __attribute__((packed));
} __packed;
#ifndef ETHERTYPE_PAE
#define ETHERTYPE_PAE 0x888e /* EAPOL PAE/802.1x */
......@@ -1770,7 +1783,9 @@ enum rtllib_state {
#define RTLLIB_52GHZ_CHANNELS (RTLLIB_52GHZ_MAX_CHANNEL - \
RTLLIB_52GHZ_MIN_CHANNEL + 1)
#ifndef eqMacAddr
#define eqMacAddr(a,b) ( ((a)[0]==(b)[0] && (a)[1]==(b)[1] && (a)[2]==(b)[2] && (a)[3]==(b)[3] && (a)[4]==(b)[4] && (a)[5]==(b)[5]) ? 1:0 )
#define eqMacAddr(a, b) \
(((a)[0] == (b)[0] && (a)[1] == (b)[1] && (a)[2] == (b)[2] && \
(a)[3] == (b)[3] && (a)[4] == (b)[4] && (a)[5] == (b)[5]) ? 1 : 0)
#endif
struct tx_pending {
int frag;
......@@ -1791,7 +1806,7 @@ struct bandwidth_autoswitch {
struct rx_reorder_entry {
struct list_head List;
u16 SeqNum;
struct rtllib_rxb* prxb;
struct rtllib_rxb *prxb;
};
enum fsync_state {
Default_Fsync,
......@@ -1936,7 +1951,7 @@ enum country_code_type {
};
enum scan_op_backup_opt {
SCAN_OPT_BACKUP=0,
SCAN_OPT_BACKUP = 0,
SCAN_OPT_RESTORE,
SCAN_OPT_MAX
};
......@@ -1949,10 +1964,10 @@ enum fw_cmd_io_type {
FW_CMD_HIGH_PWR_ENABLE = 4,
FW_CMD_HIGH_PWR_DISABLE = 5,
FW_CMD_RA_RESET = 6,
FW_CMD_RA_ACTIVE= 7,
FW_CMD_RA_REFRESH_N= 8,
FW_CMD_RA_REFRESH_BG= 9,
FW_CMD_RA_INIT= 10,
FW_CMD_RA_ACTIVE = 7,
FW_CMD_RA_REFRESH_N = 8,
FW_CMD_RA_REFRESH_BG = 9,
FW_CMD_RA_INIT = 10,
FW_CMD_IQK_ENABLE = 11,
FW_CMD_TXPWR_TRACK_ENABLE = 12,
FW_CMD_TXPWR_TRACK_DISABLE = 13,
......@@ -2050,7 +2065,7 @@ struct rt_pmkid_list {
u8 Bssid[6];
u8 PMKID[16];
u8 SsidBuf[33];
u8* ssid_octet;
u8 *ssid_octet;
u16 ssid_length;
};
......@@ -2077,7 +2092,7 @@ enum {
enum {
LPS_IS_WAKE = 0,
LPS_IS_SLEEP = 1,
LPS_WAIT_NULL_DATA_SEND =2,
LPS_WAIT_NULL_DATA_SEND = 2,
};
struct rtllib_device {
......@@ -2273,7 +2288,7 @@ struct rtllib_device {
u16 prev_seq_ctl; /* used to drop duplicate frames */
/* map of allowed channels. 0 is dummy */
void* pDot11dInfo;
void *pDot11dInfo;
bool bGlobalDomain;
u8 active_channel_map[MAX_CHANNEL_NUMBER+1];
......@@ -2417,11 +2432,11 @@ struct rtllib_device {
struct net_device *dev);
int (*reset_port)(struct net_device *dev);
int (*is_queue_full) (struct net_device * dev, int pri);
int (*is_queue_full)(struct net_device *dev, int pri);
int (*handle_management) (struct net_device * dev,
struct rtllib_network * network, u16 type);
int (*is_qos_active) (struct net_device *dev, struct sk_buff *skb);
int (*handle_management)(struct net_device *dev,
struct rtllib_network *network, u16 type);
int (*is_qos_active)(struct net_device *dev, struct sk_buff *skb);
/* Softmac-generated frames (mamagement) are TXed via this
* callback if the flag IEEE_SOFTMAC_SINGLE_QUEUE is
......@@ -2440,7 +2455,7 @@ struct rtllib_device {
* This function can't sleep.
*/
void (*softmac_data_hard_start_xmit)(struct sk_buff *skb,
struct net_device *dev,int rate);
struct net_device *dev, int rate);
/* stops the HW queue for DATA frames. Useful to avoid
* waste time to TX data frame when we are reassociating
......@@ -2455,7 +2470,7 @@ struct rtllib_device {
* This function can sleep. the driver should ensure
* the radio has been swithced before return.
*/
void (*set_chan)(struct net_device *dev,short ch);
void (*set_chan)(struct net_device *dev, short ch);
/* These are not used if the ieee stack takes care of
* scanning (IEEE_SOFTMAC_SCAN feature set).
......@@ -2492,38 +2507,52 @@ struct rtllib_device {
* stop_send_bacons is NOT guaranteed to be called only
* after start_send_beacons.
*/
void (*start_send_beacons) (struct net_device *dev);
void (*stop_send_beacons) (struct net_device *dev);
void (*start_send_beacons)(struct net_device *dev);
void (*stop_send_beacons)(struct net_device *dev);
/* power save mode related */
void (*sta_wake_up) (struct net_device *dev);
void (*enter_sleep_state) (struct net_device *dev, u64 time);
short (*ps_is_queue_empty) (struct net_device *dev);
int (*handle_beacon) (struct net_device * dev, struct rtllib_beacon * beacon, struct rtllib_network * network);
int (*handle_assoc_response) (struct net_device * dev, struct rtllib_assoc_response_frame * resp, struct rtllib_network * network);
void (*sta_wake_up)(struct net_device *dev);
void (*enter_sleep_state)(struct net_device *dev, u64 time);
short (*ps_is_queue_empty)(struct net_device *dev);
int (*handle_beacon)(struct net_device *dev,
struct rtllib_beacon *beacon,
struct rtllib_network *network);
int (*handle_assoc_response)(struct net_device *dev,
struct rtllib_assoc_response_frame *resp,
struct rtllib_network *network);
/* check whether Tx hw resouce available */
short (*check_nic_enough_desc)(struct net_device *dev, int queue_index);
short (*get_nic_desc_num)(struct net_device *dev, int queue_index);
void (*SetBWModeHandler)(struct net_device *dev, enum ht_channel_width Bandwidth, enum ht_extchnl_offset Offset);
bool (*GetNmodeSupportBySecCfg)(struct net_device* dev);
void (*SetWirelessMode)(struct net_device* dev, u8 wireless_mode);
bool (*GetHalfNmodeSupportByAPsHandler)(struct net_device* dev);
void (*SetBWModeHandler)(struct net_device *dev,
enum ht_channel_width Bandwidth,
enum ht_extchnl_offset Offset);
bool (*GetNmodeSupportBySecCfg)(struct net_device *dev);
void (*SetWirelessMode)(struct net_device *dev, u8 wireless_mode);
bool (*GetHalfNmodeSupportByAPsHandler)(struct net_device *dev);
u8 (*rtllib_ap_sec_type)(struct rtllib_device *ieee);
void (*HalUsbRxAggrHandler)(struct net_device *dev, bool Value);
void (*InitialGainHandler)(struct net_device *dev, u8 Operation);
bool (*SetFwCmdHandler)(struct net_device *dev, enum fw_cmd_io_type FwCmdIO);
void (*UpdateHalRAMaskHandler)(struct net_device* dev, bool bMulticast, u8 macId, u8 MimoPs, u8 WirelessMode, u8 bCurTxBW40MHz, u8 rssi_level);
void (*UpdateBeaconInterruptHandler)(struct net_device* dev, bool start);
void (*UpdateInterruptMaskHandler)(struct net_device* dev, u32 AddMSR, u32 RemoveMSR);
bool (*SetFwCmdHandler)(struct net_device *dev,
enum fw_cmd_io_type FwCmdIO);
void (*UpdateHalRAMaskHandler)(struct net_device *dev, bool bMulticast,
u8 macId, u8 MimoPs, u8 WirelessMode,
u8 bCurTxBW40MHz, u8 rssi_level);
void (*UpdateBeaconInterruptHandler)(struct net_device *dev,
bool start);
void (*UpdateInterruptMaskHandler)(struct net_device *dev, u32 AddMSR,
u32 RemoveMSR);
u16 (*rtl_11n_user_show_rates)(struct net_device *dev);
void (*ScanOperationBackupHandler)(struct net_device *dev, u8 Operation);
void (*LedControlHandler)(struct net_device * dev, enum led_ctl_mode LedAction);
void (*SetHwRegHandler)(struct net_device *dev,u8 variable,u8* val);
void (*GetHwRegHandler)(struct net_device *dev,u8 variable,u8* val);
void (*ScanOperationBackupHandler)(struct net_device *dev,
u8 Operation);
void (*LedControlHandler)(struct net_device *dev,
enum led_ctl_mode LedAction);
void (*SetHwRegHandler)(struct net_device *dev, u8 variable, u8 *val);
void (*GetHwRegHandler)(struct net_device *dev, u8 variable, u8 *val);
void (*AllowAllDestAddrHandler)(struct net_device *dev, bool bAllowAllDA, bool WriteIntoReg);
void (*AllowAllDestAddrHandler)(struct net_device *dev,
bool bAllowAllDA, bool WriteIntoReg);
void (*rtllib_ips_leave_wq) (struct net_device *dev);
void (*rtllib_ips_leave)(struct net_device *dev);
......@@ -2717,7 +2746,7 @@ extern void rtllib_rx_mgt(struct rtllib_device *ieee,
struct rtllib_rx_stats *stats);
extern void rtllib_rx_probe_rq(struct rtllib_device *ieee,
struct sk_buff *skb);
extern int IsLegalChannel( struct rtllib_device *rtllib, u8 channel);
extern int IsLegalChannel(struct rtllib_device *rtllib, u8 channel);
/* rtllib_wx.c */
extern int rtllib_wx_get_scan(struct rtllib_device *ieee,
......@@ -2732,10 +2761,10 @@ extern int rtllib_wx_get_encode(struct rtllib_device *ieee,
#if WIRELESS_EXT >= 18
extern int rtllib_wx_get_encode_ext(struct rtllib_device *ieee,
struct iw_request_info *info,
union iwreq_data* wrqu, char *extra);
union iwreq_data *wrqu, char *extra);
extern int rtllib_wx_set_encode_ext(struct rtllib_device *ieee,
struct iw_request_info *info,
union iwreq_data* wrqu, char *extra);
union iwreq_data *wrqu, char *extra);
#endif
extern int rtllib_wx_set_auth(struct rtllib_device *ieee,
struct iw_request_info *info,
......@@ -2748,13 +2777,16 @@ extern int rtllib_wx_set_gen_ie(struct rtllib_device *ieee, u8 *ie, size_t len);
/* rtllib_softmac.c */
extern short rtllib_is_54g(struct rtllib_network *net);
extern short rtllib_is_shortslot(struct rtllib_network net);
extern int rtllib_rx_frame_softmac(struct rtllib_device *ieee, struct sk_buff *skb,
extern int rtllib_rx_frame_softmac(struct rtllib_device *ieee,
struct sk_buff *skb,
struct rtllib_rx_stats *rx_stats, u16 type,
u16 stype);
extern void rtllib_softmac_new_net(struct rtllib_device *ieee, struct rtllib_network *net);
extern void rtllib_softmac_new_net(struct rtllib_device *ieee,
struct rtllib_network *net);
void SendDisassociation(struct rtllib_device *ieee, bool deauth, u16 asRsn);
extern void rtllib_softmac_xmit(struct rtllib_txb *txb, struct rtllib_device *ieee);
extern void rtllib_softmac_xmit(struct rtllib_txb *txb,
struct rtllib_device *ieee);
extern void rtllib_stop_send_beacons(struct rtllib_device *ieee);
extern void notify_wx_assoc_event(struct rtllib_device *ieee);
......@@ -2772,21 +2804,28 @@ extern void rtllib_stop_scan_syncro(struct rtllib_device *ieee);
extern void rtllib_start_scan_syncro(struct rtllib_device *ieee, u8 is_mesh);
extern inline struct sk_buff *rtllib_probe_req(struct rtllib_device *ieee);
extern u8 MgntQuery_MgntFrameTxRate(struct rtllib_device *ieee);
extern void rtllib_sta_ps_send_null_frame(struct rtllib_device *ieee, short pwr);
extern void rtllib_sta_ps_send_null_frame(struct rtllib_device *ieee,
short pwr);
extern void rtllib_sta_wakeup(struct rtllib_device *ieee, short nl);
extern void rtllib_sta_ps_send_pspoll_frame(struct rtllib_device *ieee);
extern void rtllib_check_all_nets(struct rtllib_device *ieee);
extern void rtllib_start_protocol(struct rtllib_device *ieee);
extern void rtllib_stop_protocol(struct rtllib_device *ieee, u8 shutdown);
extern void rtllib_EnableNetMonitorMode(struct net_device* dev, bool bInitState);
extern void rtllib_DisableNetMonitorMode(struct net_device* dev, bool bInitState);
extern void rtllib_EnableIntelPromiscuousMode(struct net_device* dev, bool bInitState);
extern void rtllib_DisableIntelPromiscuousMode(struct net_device* dev, bool bInitState);
extern void rtllib_EnableNetMonitorMode(struct net_device *dev,
bool bInitState);
extern void rtllib_DisableNetMonitorMode(struct net_device *dev,
bool bInitState);
extern void rtllib_EnableIntelPromiscuousMode(struct net_device *dev,
bool bInitState);
extern void rtllib_DisableIntelPromiscuousMode(struct net_device *dev,
bool bInitState);
extern void rtllib_send_probe_requests(struct rtllib_device *ieee, u8 is_mesh);
extern void rtllib_softmac_stop_protocol(struct rtllib_device *ieee, u8 mesh_flag, u8 shutdown);
extern void rtllib_softmac_start_protocol(struct rtllib_device *ieee,u8 mesh_flag);
extern void rtllib_softmac_stop_protocol(struct rtllib_device *ieee,
u8 mesh_flag, u8 shutdown);
extern void rtllib_softmac_start_protocol(struct rtllib_device *ieee,
u8 mesh_flag);
extern void rtllib_reset_queue(struct rtllib_device *ieee);
extern void rtllib_wake_queue(struct rtllib_device *ieee);
......@@ -2796,13 +2835,16 @@ extern void rtllib_stop_all_queues(struct rtllib_device *ieee);
extern struct sk_buff *rtllib_get_beacon(struct rtllib_device *ieee);
extern void rtllib_start_send_beacons(struct rtllib_device *ieee);
extern void rtllib_stop_send_beacons(struct rtllib_device *ieee);
extern int rtllib_wpa_supplicant_ioctl(struct rtllib_device *ieee, struct iw_point *p, u8 is_mesh);
extern int rtllib_wpa_supplicant_ioctl(struct rtllib_device *ieee,
struct iw_point *p, u8 is_mesh);
extern void notify_wx_assoc_event(struct rtllib_device *ieee);
extern void rtllib_ps_tx_ack(struct rtllib_device *ieee, short success);
extern void softmac_mgmt_xmit(struct sk_buff *skb, struct rtllib_device *ieee);
extern u16 rtllib_query_seqnum(struct rtllib_device*ieee, struct sk_buff* skb, u8* dst);
extern void softmac_mgmt_xmit(struct sk_buff *skb,
struct rtllib_device *ieee);
extern u16 rtllib_query_seqnum(struct rtllib_device *ieee,
struct sk_buff *skb, u8 *dst);
extern u8 rtllib_ap_sec_type(struct rtllib_device *ieee);
/* rtllib_crypt_ccmp&tkip&wep.c */
......@@ -2821,7 +2863,9 @@ extern int rtllib_wx_set_wap(struct rtllib_device *ieee,
union iwreq_data *awrq,
char *extra);
extern int rtllib_wx_get_essid(struct rtllib_device *ieee, struct iw_request_info *a,union iwreq_data *wrqu,char *b);
extern int rtllib_wx_get_essid(struct rtllib_device *ieee,
struct iw_request_info *a,
union iwreq_data *wrqu, char *b);
extern int rtllib_wx_set_rate(struct rtllib_device *ieee,
struct iw_request_info *info,
......@@ -2831,23 +2875,28 @@ extern int rtllib_wx_get_rate(struct rtllib_device *ieee,
struct iw_request_info *info,
union iwreq_data *wrqu, char *extra);
extern int rtllib_wx_set_mode(struct rtllib_device *ieee, struct iw_request_info *a,
extern int rtllib_wx_set_mode(struct rtllib_device *ieee,
struct iw_request_info *a,
union iwreq_data *wrqu, char *b);
extern int rtllib_wx_set_scan(struct rtllib_device *ieee, struct iw_request_info *a,
extern int rtllib_wx_set_scan(struct rtllib_device *ieee,
struct iw_request_info *a,
union iwreq_data *wrqu, char *b);
extern int rtllib_wx_set_essid(struct rtllib_device *ieee,
struct iw_request_info *a,
union iwreq_data *wrqu, char *extra);
extern int rtllib_wx_get_mode(struct rtllib_device *ieee, struct iw_request_info *a,
extern int rtllib_wx_get_mode(struct rtllib_device *ieee,
struct iw_request_info *a,
union iwreq_data *wrqu, char *b);
extern int rtllib_wx_set_freq(struct rtllib_device *ieee, struct iw_request_info *a,
extern int rtllib_wx_set_freq(struct rtllib_device *ieee,
struct iw_request_info *a,
union iwreq_data *wrqu, char *b);
extern int rtllib_wx_get_freq(struct rtllib_device *ieee, struct iw_request_info *a,
extern int rtllib_wx_get_freq(struct rtllib_device *ieee,
struct iw_request_info *a,
union iwreq_data *wrqu, char *b);
extern void rtllib_wx_sync_scan_wq(void *data);
......@@ -2875,49 +2924,62 @@ extern int rtllib_wx_get_rts(struct rtllib_device *ieee,
struct iw_request_info *info,
union iwreq_data *wrqu, char *extra);
#define MAX_RECEIVE_BUFFER_SIZE 9100
extern void HTDebugHTCapability(u8* CapIE, u8* TitleString );
extern void HTDebugHTInfo(u8* InfoIE, u8* TitleString);
void HTSetConnectBwMode(struct rtllib_device* ieee, enum ht_channel_width Bandwidth, enum ht_extchnl_offset Offset);
extern void HTUpdateDefaultSetting(struct rtllib_device* ieee);
extern void HTConstructCapabilityElement(struct rtllib_device* ieee, u8* posHTCap, u8* len, u8 isEncrypt,bool bAssoc);
extern void HTConstructInfoElement(struct rtllib_device* ieee, u8* posHTInfo, u8* len, u8 isEncrypt);
extern void HTConstructRT2RTAggElement(struct rtllib_device* ieee, u8* posRT2RTAgg, u8* len);
extern void HTDebugHTCapability(u8 *CapIE, u8 *TitleString);
extern void HTDebugHTInfo(u8 *InfoIE, u8 *TitleString);
void HTSetConnectBwMode(struct rtllib_device *ieee,
enum ht_channel_width Bandwidth,
enum ht_extchnl_offset Offset);
extern void HTUpdateDefaultSetting(struct rtllib_device *ieee);
extern void HTConstructCapabilityElement(struct rtllib_device *ieee,
u8 *posHTCap, u8 *len,
u8 isEncrypt, bool bAssoc);
extern void HTConstructInfoElement(struct rtllib_device *ieee,
u8 *posHTInfo, u8 *len, u8 isEncrypt);
extern void HTConstructRT2RTAggElement(struct rtllib_device *ieee,
u8 *posRT2RTAgg, u8* len);
extern void HTOnAssocRsp(struct rtllib_device *ieee);
extern void HTInitializeHTInfo(struct rtllib_device* ieee);
extern void HTInitializeHTInfo(struct rtllib_device *ieee);
extern void HTInitializeBssDesc(struct bss_ht *pBssHT);
extern void HTResetSelfAndSavePeerSetting(struct rtllib_device* ieee, struct rtllib_network * pNetwork);
extern void HTUpdateSelfAndPeerSetting(struct rtllib_device* ieee, struct rtllib_network * pNetwork);
extern u8 HTGetHighestMCSRate(struct rtllib_device* ieee, u8* pMCSRateSet, u8* pMCSFilter);
extern void HTResetSelfAndSavePeerSetting(struct rtllib_device *ieee,
struct rtllib_network *pNetwork);
extern void HTUpdateSelfAndPeerSetting(struct rtllib_device *ieee,
struct rtllib_network *pNetwork);
extern u8 HTGetHighestMCSRate(struct rtllib_device *ieee, u8 *pMCSRateSet,
u8 *pMCSFilter);
extern u8 MCS_FILTER_ALL[];
extern u16 MCS_DATA_RATE[2][2][77] ;
extern u8 HTCCheck(struct rtllib_device* ieee, u8* pFrame);
extern u8 HTCCheck(struct rtllib_device *ieee, u8 *pFrame);
extern void HTResetIOTSetting(struct rt_hi_throughput *pHTInfo);
extern bool IsHTHalfNmodeAPs(struct rtllib_device* ieee);
extern u16 HTHalfMcsToDataRate(struct rtllib_device* ieee, u8 nMcsRate);
extern u16 HTMcsToDataRate( struct rtllib_device* ieee, u8 nMcsRate);
extern u16 TxCountToDataRate( struct rtllib_device* ieee, u8 nDataRate);
extern int rtllib_rx_ADDBAReq( struct rtllib_device* ieee, struct sk_buff *skb);
extern int rtllib_rx_ADDBARsp( struct rtllib_device* ieee, struct sk_buff *skb);
extern int rtllib_rx_DELBA(struct rtllib_device* ieee,struct sk_buff *skb);
extern void TsInitAddBA( struct rtllib_device* ieee, struct tx_ts_record *pTS, u8 Policy, u8 bOverwritePending);
extern void TsInitDelBA( struct rtllib_device* ieee, struct ts_common_info *pTsCommonInfo, enum tr_select TxRxSelect);
extern bool IsHTHalfNmodeAPs(struct rtllib_device *ieee);
extern u16 HTHalfMcsToDataRate(struct rtllib_device *ieee, u8 nMcsRate);
extern u16 HTMcsToDataRate(struct rtllib_device *ieee, u8 nMcsRate);
extern u16 TxCountToDataRate(struct rtllib_device *ieee, u8 nDataRate);
extern int rtllib_rx_ADDBAReq(struct rtllib_device *ieee, struct sk_buff *skb);
extern int rtllib_rx_ADDBARsp(struct rtllib_device *ieee, struct sk_buff *skb);
extern int rtllib_rx_DELBA(struct rtllib_device *ieee, struct sk_buff *skb);
extern void TsInitAddBA(struct rtllib_device *ieee, struct tx_ts_record *pTS,
u8 Policy, u8 bOverwritePending);
extern void TsInitDelBA(struct rtllib_device *ieee,
struct ts_common_info *pTsCommonInfo,
enum tr_select TxRxSelect);
extern void BaSetupTimeOut(unsigned long data);
extern void TxBaInactTimeout(unsigned long data);
extern void RxBaInactTimeout(unsigned long data);
extern void ResetBaEntry( struct ba_record *pBA);
extern void ResetBaEntry(struct ba_record *pBA);
extern bool GetTs(
struct rtllib_device* ieee,
struct rtllib_device *ieee,
struct ts_common_info **ppTS,
u8* Addr,
u8 *Addr,
u8 TID,
enum tr_select TxRxSelect,
bool bAddNewTs
);
);
extern void TSInitialize(struct rtllib_device *ieee);
extern void TsStartAddBaProcess(struct rtllib_device* ieee, struct tx_ts_record *pTxTS);
extern void RemovePeerTS(struct rtllib_device* ieee, u8* Addr);
extern void RemoveAllTS(struct rtllib_device* ieee);
extern void TsStartAddBaProcess(struct rtllib_device *ieee,
struct tx_ts_record *pTxTS);
extern void RemovePeerTS(struct rtllib_device *ieee, u8 *Addr);
extern void RemoveAllTS(struct rtllib_device *ieee);
void rtllib_softmac_scan_syncro(struct rtllib_device *ieee, u8 is_mesh);
extern const long rtllib_wlan_frequencies[];
......@@ -2932,7 +2994,8 @@ extern inline int rtllib_get_scans(struct rtllib_device *ieee)
return ieee->scans;
}
static inline const char *escape_essid(const char *essid, u8 essid_len) {
static inline const char *escape_essid(const char *essid, u8 essid_len)
{
static char escaped[IW_ESSID_MAX_SIZE * 2 + 1];
const char *s = essid;
char *d = escaped;
......@@ -2956,7 +3019,9 @@ static inline const char *escape_essid(const char *essid, u8 essid_len) {
return escaped;
}
#define CONVERT_RATE(_ieee, _MGN_RATE) (_MGN_RATE<MGN_MCS0)?(_MGN_RATE):(HTMcsToDataRate(_ieee, (u8)_MGN_RATE))
#define CONVERT_RATE(_ieee, _MGN_RATE) \
((_MGN_RATE < MGN_MCS0) ? (_MGN_RATE) : \
(HTMcsToDataRate(_ieee, (u8)_MGN_RATE)))
/* fun with the built-in rtllib stack... */
int rtllib_init(void);
......@@ -2970,17 +3035,19 @@ void rtllib_crypto_ccmp_exit(void);
int rtllib_crypto_wep_init(void);
void rtllib_crypto_wep_exit(void);
void rtllib_MgntDisconnectIBSS(struct rtllib_device* rtllib);
void rtllib_MlmeDisassociateRequest(struct rtllib_device* rtllib, u8* asSta,u8 asRsn);
void rtllib_MgntDisconnectAP(struct rtllib_device* rtllib, u8 asRsn);
bool rtllib_MgntDisconnect(struct rtllib_device* rtllib,u8 asRsn);
void rtllib_MgntDisconnectIBSS(struct rtllib_device *rtllib);
void rtllib_MlmeDisassociateRequest(struct rtllib_device *rtllib, u8 *asSta,
u8 asRsn);
void rtllib_MgntDisconnectAP(struct rtllib_device *rtllib, u8 asRsn);
bool rtllib_MgntDisconnect(struct rtllib_device *rtllib, u8 asRsn);
/* For the function is more related to hardware setting, it's better to use the
* ieee handler to refer to it.
*/
extern void rtllib_update_active_chan_map(struct rtllib_device *ieee);
extern void rtllib_FlushRxTsPendingPkts(struct rtllib_device *ieee, struct rx_ts_record *pTS);
extern void rtllib_FlushRxTsPendingPkts(struct rtllib_device *ieee,
struct rx_ts_record *pTS);
extern int rtllib_data_xmit(struct sk_buff *skb, struct net_device *dev);
extern int rtllib_parse_info_param(struct rtllib_device *ieee,
struct rtllib_info_element *info_element,
......@@ -2988,9 +3055,11 @@ extern int rtllib_parse_info_param(struct rtllib_device *ieee,
struct rtllib_network *network,
struct rtllib_rx_stats *stats);
void rtllib_indicate_packets(struct rtllib_device *ieee, struct rtllib_rxb** prxbIndicateArray,u8 index);
extern u8 HTFilterMCSRate( struct rtllib_device* ieee, u8* pSupportMCS, u8* pOperateMCS);
extern void HTUseDefaultSetting(struct rtllib_device* ieee);
void rtllib_indicate_packets(struct rtllib_device *ieee,
struct rtllib_rxb **prxbIndicateArray, u8 index);
extern u8 HTFilterMCSRate(struct rtllib_device *ieee, u8 *pSupportMCS,
u8 *pOperateMCS);
extern void HTUseDefaultSetting(struct rtllib_device *ieee);
#define RT_ASOC_RETRY_LIMIT 5
u8 MgntQuery_TxRateExcludeCCKRates(struct rtllib_device *ieee);
extern void rtllib_TURBO_Info(struct rtllib_device *ieee, u8 **tag_p);
......@@ -3039,8 +3108,8 @@ extern void rtllib_TURBO_Info(struct rtllib_device *ieee, u8 **tag_p);
static inline void dump_buf(u8 *buf, u32 len)
{
u32 i;
printk("-----------------Len %d----------------\n", len);
for (i=0; i<len; i++)
printk(KERN_INFO "-----------------Len %d----------------\n", len);
for (i = 0; i < len; i++)
printk("%2.2x-", *(buf+i));
printk("\n");
}
......
......@@ -48,7 +48,7 @@
#include <linux/version.h>
#include <linux/wireless.h>
#include <linux/etherdevice.h>
#include <asm/uaccess.h>
#include <linux/uaccess.h>
#include <net/arp.h>
#include "rtllib.h"
......@@ -56,11 +56,11 @@
#define DRV_NAME "rtllib_92e"
void _setup_timer( struct timer_list* ptimer, void* fun, unsigned long data )
void _setup_timer(struct timer_list* ptimer, void *fun, unsigned long data)
{
ptimer->function = fun;
ptimer->data = data;
init_timer( ptimer );
init_timer(ptimer);
}
static inline int rtllib_networks_allocate(struct rtllib_device *ieee)
......@@ -98,14 +98,15 @@ static inline void rtllib_networks_initialize(struct rtllib_device *ieee)
INIT_LIST_HEAD(&ieee->network_free_list);
INIT_LIST_HEAD(&ieee->network_list);
for (i = 0; i < MAX_NETWORK_COUNT; i++)
list_add_tail(&ieee->networks[i].list, &ieee->network_free_list);
list_add_tail(&ieee->networks[i].list,
&ieee->network_free_list);
}
struct net_device *alloc_rtllib(int sizeof_priv)
{
struct rtllib_device *ieee = NULL;
struct net_device *dev;
int i,err;
int i, err;
RTLLIB_DEBUG_INFO("Initializing...\n");
......@@ -159,12 +160,11 @@ struct net_device *alloc_rtllib(int sizeof_priv)
ieee->raw_tx = 0;
ieee->hwsec_active = 0;
memset(ieee->swcamtable,0,sizeof(struct sw_cam_table)*32);
memset(ieee->swcamtable, 0, sizeof(struct sw_cam_table) * 32);
rtllib_softmac_init(ieee);
ieee->pHTInfo = (struct rt_hi_throughput*)kzalloc(sizeof(struct rt_hi_throughput), GFP_KERNEL);
if (ieee->pHTInfo == NULL)
{
ieee->pHTInfo = kzalloc(sizeof(struct rt_hi_throughput), GFP_KERNEL);
if (ieee->pHTInfo == NULL) {
RTLLIB_DEBUG(RTLLIB_DL_ERR, "can't alloc memory for HTInfo\n");
return NULL;
}
......@@ -192,10 +192,10 @@ struct net_device *alloc_rtllib(int sizeof_priv)
return NULL;
}
void free_rtllib(struct net_device *dev)
{
struct rtllib_device *ieee = (struct rtllib_device *)netdev_priv_rsl(dev);
struct rtllib_device *ieee = (struct rtllib_device *)
netdev_priv_rsl(dev);
int i;
if (ieee->pHTInfo != NULL) {
kfree(ieee->pHTInfo);
......@@ -219,11 +219,11 @@ void free_rtllib(struct net_device *dev)
free_netdev(dev);
}
u32 rtllib_debug_level = 0;
u32 rtllib_debug_level;
static int debug = \
RTLLIB_DL_ERR
;
struct proc_dir_entry *rtllib_proc = NULL;
struct proc_dir_entry *rtllib_proc;
static int show_debug_level(char *page, char **start, off_t offset,
int count, int *eof, void *data)
......
......@@ -286,7 +286,6 @@ rtllib_classify(struct sk_buff *skb, u8 bIsAmsdu)
}
}
#define SN_LESS(a, b) (((a-b)&0x800)!=0)
void rtllib_tx_query_agg_cap(struct rtllib_device* ieee, struct sk_buff* skb, struct cb_desc * tcb_desc)
{
struct rt_hi_throughput *pHTInfo = ieee->pHTInfo;
......
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