rtl8188eu: Fix checkpatch errors in include/*.h - part 3

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2013-08-15 16:11:51 -05:00
parent 7120e63109
commit 8a46c9e7a5
13 changed files with 1082 additions and 1051 deletions

View file

@ -58,19 +58,16 @@ enum _EFUSE_DEF_TYPE {
#define EFUSE_MAX_HW_SIZE 512 #define EFUSE_MAX_HW_SIZE 512
#define EFUSE_MAX_SECTION_BASE 16 #define EFUSE_MAX_SECTION_BASE 16
#define EXT_HEADER(header) ((header & 0x1F ) == 0x0F) #define EXT_HEADER(header) ((header & 0x1F) == 0x0F)
#define ALL_WORDS_DISABLED(wde) ((wde & 0x0F) == 0x0F) #define ALL_WORDS_DISABLED(wde) ((wde & 0x0F) == 0x0F)
#define GET_HDR_OFFSET_2_0(header) ( (header & 0xE0) >> 5) #define GET_HDR_OFFSET_2_0(header) ((header & 0xE0) >> 5)
#define EFUSE_REPEAT_THRESHOLD_ 3 #define EFUSE_REPEAT_THRESHOLD_ 3
/* */
/* The following is for BT Efuse definition */ /* The following is for BT Efuse definition */
/* */
#define EFUSE_BT_MAX_MAP_LEN 1024 #define EFUSE_BT_MAX_MAP_LEN 1024
#define EFUSE_MAX_BANK 4 #define EFUSE_MAX_BANK 4
#define EFUSE_MAX_BT_BANK (EFUSE_MAX_BANK-1) #define EFUSE_MAX_BT_BANK (EFUSE_MAX_BANK-1)
/* */
/*--------------------------Define Parameters-------------------------------*/ /*--------------------------Define Parameters-------------------------------*/
#define EFUSE_MAX_WORD_UNIT 4 #define EFUSE_MAX_WORD_UNIT 4
@ -120,29 +117,34 @@ extern u8 fakeBTEfuseInitMap[];
extern u8 fakeBTEfuseModifiedMap[]; extern u8 fakeBTEfuseModifiedMap[];
/*------------------------Export global variable----------------------------*/ /*------------------------Export global variable----------------------------*/
u8 efuse_GetCurrentSize(struct adapter * padapter, u16 *size); u8 efuse_GetCurrentSize(struct adapter *adapter, u16 *size);
u16 efuse_GetMaxSize(struct adapter * padapter); u16 efuse_GetMaxSize(struct adapter *adapter);
u8 rtw_efuse_access(struct adapter * padapter, u8 bRead, u16 start_addr, u16 cnts, u8 *data); u8 rtw_efuse_access(struct adapter *adapter, u8 read, u16 start_addr,
u8 rtw_efuse_map_read(struct adapter * padapter, u16 addr, u16 cnts, u8 *data); u16 cnts, u8 *data);
u8 rtw_efuse_map_write(struct adapter * padapter, u16 addr, u16 cnts, u8 *data); u8 rtw_efuse_map_read(struct adapter *adapter, u16 addr, u16 cnts, u8 *data);
u8 rtw_BT_efuse_map_read(struct adapter * padapter, u16 addr, u16 cnts, u8 *data); u8 rtw_efuse_map_write(struct adapter *adapter, u16 addr, u16 cnts, u8 *data);
u8 rtw_BT_efuse_map_write(struct adapter * padapter, u16 addr, u16 cnts, u8 *data); u8 rtw_BT_efuse_map_read(struct adapter *adapter, u16 addr,
u16 cnts, u8 *data);
u16 Efuse_GetCurrentSize(struct adapter * pAdapter, u8 efuseType, bool bPseudoTest); u8 rtw_BT_efuse_map_write(struct adapter *adapter, u16 addr,
u16 cnts, u8 *data);
u16 Efuse_GetCurrentSize(struct adapter *adapter, u8 efusetype, bool test);
u8 Efuse_CalculateWordCnts(u8 word_en); u8 Efuse_CalculateWordCnts(u8 word_en);
void ReadEFuseByte(struct adapter * Adapter, u16 _offset, u8 *pbuf, bool bPseudoTest) ; void ReadEFuseByte(struct adapter *adapter, u16 _offset, u8 *pbuf, bool test);
void EFUSE_GetEfuseDefinition(struct adapter * pAdapter, u8 efuseType, u8 type, void *pOut, bool bPseudoTest); void EFUSE_GetEfuseDefinition(struct adapter *adapt, u8 type, u8 type1,
u8 efuse_OneByteRead(struct adapter * pAdapter, u16 addr, u8 *data, bool bPseudoTest); void *out, bool bPseudoTest);
u8 efuse_OneByteWrite(struct adapter * pAdapter, u16 addr, u8 data, bool bPseudoTest); u8 efuse_OneByteRead(struct adapter *adapter, u16 addr, u8 *data, bool test);
u8 efuse_OneByteWrite(struct adapter *adapter, u16 addr, u8 data, bool test);
void Efuse_PowerSwitch(struct adapter * pAdapter,u8 bWrite,u8 PwrState); void Efuse_PowerSwitch(struct adapter *adapt,u8 bWrite,u8 PwrState);
int Efuse_PgPacketRead(struct adapter * pAdapter, u8 offset, u8 *data, bool bPseudoTest); int Efuse_PgPacketRead(struct adapter *adapt, u8 offset, u8 *data, bool test);
int Efuse_PgPacketWrite(struct adapter * pAdapter, u8 offset, u8 word_en, u8 *data, bool bPseudoTest); int Efuse_PgPacketWrite(struct adapter *adapter, u8 offset, u8 word, u8 *data,
bool test);
void efuse_WordEnableDataRead(u8 word_en, u8 *sourdata, u8 *targetdata); void efuse_WordEnableDataRead(u8 word_en, u8 *sourdata, u8 *targetdata);
u8 Efuse_WordEnableDataWrite(struct adapter * pAdapter, u16 efuse_addr, u8 word_en, u8 *data, bool bPseudoTest); u8 Efuse_WordEnableDataWrite(struct adapter *adapter, u16 efuse_addr,
u8 word_en, u8 *data, bool test);
u8 EFUSE_Read1Byte(struct adapter * pAdapter, u16 Address); u8 EFUSE_Read1Byte(struct adapter *adapter, u16 address);
void EFUSE_ShadowMapUpdate(struct adapter * pAdapter, u8 efuseType, bool bPseudoTest); void EFUSE_ShadowMapUpdate(struct adapter *adapter, u8 efusetype, bool test);
void EFUSE_ShadowRead(struct adapter * pAdapter, u8 Type, u16 Offset, u32 *Value); void EFUSE_ShadowRead(struct adapter *adapt, u8 type, u16 offset, u32 *val);
#endif #endif

View file

@ -23,11 +23,7 @@
#include <osdep_service.h> #include <osdep_service.h>
#include <wlan_bssdef.h> #include <wlan_bssdef.h>
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26))
#include <asm/semaphore.h>
#else
#include <linux/semaphore.h> #include <linux/semaphore.h>
#endif
#include <linux/sem.h> #include <linux/sem.h>
/* /*
@ -66,14 +62,12 @@ struct joinbss_event {
/* /*
Used to report a given STA has joinned the created BSS. Used to report a given STA has joinned the created BSS.
It is used in AP/Ad-HoC(M) mode. It is used in AP/Ad-HoC(M) mode.
*/ */
struct stassoc_event { struct stassoc_event {
unsigned char macaddr[6]; unsigned char macaddr[6];
unsigned char rsvd[2]; unsigned char rsvd[2];
int cam_id; int cam_id;
}; };
struct stadel_event { struct stadel_event {
@ -82,8 +76,7 @@ struct stadel_event {
int mac_id; int mac_id;
}; };
struct addba_event struct addba_event {
{
unsigned int tid; unsigned int tid;
}; };
@ -96,17 +89,17 @@ struct fwevent {
#define C2HEVENT_SZ 32 #define C2HEVENT_SZ 32
struct event_node{ struct event_node {
unsigned char *node; unsigned char *node;
unsigned char evt_code; unsigned char evt_code;
unsigned short evt_sz; unsigned short evt_sz;
volatile int *caller_ff_tail; int *caller_ff_tail;
int caller_ff_sz; int caller_ff_sz;
}; };
struct c2hevent_queue { struct c2hevent_queue {
volatile int head; int head;
volatile int tail; int tail;
struct event_node nodes[C2HEVENT_SZ]; struct event_node nodes[C2HEVENT_SZ];
unsigned char seq; unsigned char seq;
}; };
@ -114,10 +107,9 @@ struct c2hevent_queue {
#define NETWORK_QUEUE_SZ 4 #define NETWORK_QUEUE_SZ 4
struct network_queue { struct network_queue {
volatile int head; int head;
volatile int tail; int tail;
struct wlan_bssid_ex networks[NETWORK_QUEUE_SZ]; struct wlan_bssid_ex networks[NETWORK_QUEUE_SZ];
}; };
#endif /* _WLANEVENT_H_ */ #endif /* _WLANEVENT_H_ */

View file

@ -23,26 +23,22 @@
#include <osdep_service.h> #include <osdep_service.h>
#include "wifi.h" #include "wifi.h"
struct ht_priv struct ht_priv {
{
u32 ht_option; u32 ht_option;
u32 ampdu_enable;/* for enable Tx A-MPDU */ u32 ampdu_enable;/* for enable Tx A-MPDU */
/* u8 baddbareq_issued[16]; */
u32 tx_amsdu_enable;/* for enable Tx A-MSDU */ u32 tx_amsdu_enable;/* for enable Tx A-MSDU */
u32 tx_amdsu_maxlen; /* 1: 8k, 0:4k ; default:8k, for tx */ u32 tx_amdsu_maxlen; /* 1: 8k, 0:4k ; default:8k, for tx */
u32 rx_ampdu_maxlen; /* for rx reordering ctrl win_sz, updated when join_callback. */ u32 rx_ampdu_maxlen; /* for rx reordering ctrl win_sz,
* updated when join_callback. */
u8 bwmode;/* */ u8 bwmode;/* */
u8 ch_offset;/* PRIME_CHNL_OFFSET */ u8 ch_offset;/* PRIME_CHNL_OFFSET */
u8 sgi;/* short GI */ u8 sgi;/* short GI */
/* for processing Tx A-MPDU */ /* for processing Tx A-MPDU */
u8 agg_enable_bitmap; u8 agg_enable_bitmap;
/* u8 ADDBA_retry_count; */
u8 candidate_tid_bitmap; u8 candidate_tid_bitmap;
struct rtw_ieee80211_ht_cap ht_cap; struct rtw_ieee80211_ht_cap ht_cap;
}; };
#endif /* _RTL871X_HT_H_ */ #endif /* _RTL871X_HT_H_ */

View file

@ -25,28 +25,30 @@
#include <osdep_intf.h> #include <osdep_intf.h>
#include <asm/byteorder.h> #include <asm/byteorder.h>
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26))
#include <asm/semaphore.h>
#else
#include <linux/semaphore.h> #include <linux/semaphore.h>
#endif
#include <linux/list.h> #include <linux/list.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <asm/atomic.h> #include <linux/atomic.h>
#include <linux/usb.h> #include <linux/usb.h>
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)) #if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 21))
#include <linux/usb_ch9.h> #include <linux/usb_ch9.h>
#else #else
#include <linux/usb/ch9.h> #include <linux/usb/ch9.h>
#endif #endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35))
#define rtw_usb_buffer_alloc(dev, size, dma) usb_alloc_coherent((dev), (size), (in_interrupt() ? GFP_ATOMIC : GFP_KERNEL), (dma)) #define rtw_usb_buffer_alloc(dev, size, dma) \
#define rtw_usb_buffer_free(dev, size, addr, dma) usb_free_coherent((dev), (size), (addr), (dma)) usb_alloc_coherent((dev), (size), (in_interrupt() ? \
GFP_ATOMIC : GFP_KERNEL), (dma))
#define rtw_usb_buffer_free(dev, size, addr, dma) \
usb_free_coherent((dev), (size), (addr), (dma))
#else #else
#define rtw_usb_buffer_alloc(dev, size, dma) usb_buffer_alloc((dev), (size), (in_interrupt() ? GFP_ATOMIC : GFP_KERNEL), (dma)) #define rtw_usb_buffer_alloc(dev, size, dma) \
#define rtw_usb_buffer_free(dev, size, addr, dma) usb_buffer_free((dev), (size), (addr), (dma)) usb_buffer_alloc((dev), (size), (in_interrupt() ? \
GFP_ATOMIC : GFP_KERNEL), (dma))
#define rtw_usb_buffer_free(dev, size, addr, dma) \
usb_buffer_free((dev), (size), (addr), (dma))
#endif #endif
#define NUM_IOREQ 8 #define NUM_IOREQ 8
@ -68,20 +70,16 @@
#define _IO_SYNC_ BIT(13) #define _IO_SYNC_ BIT(13)
#define _IO_CMDMASK_ (0x1F80) #define _IO_CMDMASK_ (0x1F80)
/* /*
For prompt mode accessing, caller shall free io_req For prompt mode accessing, caller shall free io_req
Otherwise, io_handler will free io_req Otherwise, io_handler will free io_req
*/ */
/* IO STATUS TYPE */ /* IO STATUS TYPE */
#define _IO_ERR_ BIT(2) #define _IO_ERR_ BIT(2)
#define _IO_SUCCESS_ BIT(1) #define _IO_SUCCESS_ BIT(1)
#define _IO_DONE_ BIT(0) #define _IO_DONE_ BIT(0)
#define IO_RD32 (_IO_SYNC_ | _IO_WORD_) #define IO_RD32 (_IO_SYNC_ | _IO_WORD_)
#define IO_RD16 (_IO_SYNC_ | _IO_HW_) #define IO_RD16 (_IO_SYNC_ | _IO_HW_)
#define IO_RD8 (_IO_SYNC_ | _IO_BYTE_) #define IO_RD8 (_IO_SYNC_ | _IO_BYTE_)
@ -99,15 +97,13 @@
#define IO_WR8_ASYNC (_IO_WRITE_ | _IO_BYTE_) #define IO_WR8_ASYNC (_IO_WRITE_ | _IO_BYTE_)
/* /*
Only Sync. burst accessing is provided. Only Sync. burst accessing is provided.
*/ */
#define IO_WR_BURST(x) (_IO_WRITE_ | _IO_SYNC_ | _IO_BURST_ | ( (x) & _IOSZ_MASK_)) #define IO_WR_BURST(x) \
#define IO_RD_BURST(x) (_IO_SYNC_ | _IO_BURST_ | ( (x) & _IOSZ_MASK_)) (_IO_WRITE_ | _IO_SYNC_ | _IO_BURST_ | ((x) & _IOSZ_MASK_))
#define IO_RD_BURST(x) \
(_IO_SYNC_ | _IO_BURST_ | ((x) & _IOSZ_MASK_))
/* below is for the intf_option bit defition... */ /* below is for the intf_option bit defition... */
@ -121,28 +117,25 @@ struct _io_ops {
u8 (*_read8)(struct intf_hdl *pintfhdl, u32 addr); u8 (*_read8)(struct intf_hdl *pintfhdl, u32 addr);
u16 (*_read16)(struct intf_hdl *pintfhdl, u32 addr); u16 (*_read16)(struct intf_hdl *pintfhdl, u32 addr);
u32 (*_read32)(struct intf_hdl *pintfhdl, u32 addr); u32 (*_read32)(struct intf_hdl *pintfhdl, u32 addr);
int (*_write8)(struct intf_hdl *pintfhdl, u32 addr, u8 val); int (*_write8)(struct intf_hdl *pintfhdl, u32 addr, u8 val);
int (*_write16)(struct intf_hdl *pintfhdl, u32 addr, u16 val); int (*_write16)(struct intf_hdl *pintfhdl, u32 addr, u16 val);
int (*_write32)(struct intf_hdl *pintfhdl, u32 addr, u32 val); int (*_write32)(struct intf_hdl *pintfhdl, u32 addr, u32 val);
int (*_writeN)(struct intf_hdl *pintfhdl, u32 addr, u32 length, u8 *pdata); int (*_writeN)(struct intf_hdl *pintfhdl, u32 addr, u32 length,
u8 *pdata);
int (*_write8_async)(struct intf_hdl *pintfhdl, u32 addr, u8 val); int (*_write8_async)(struct intf_hdl *pintfhdl, u32 addr, u8 val);
int (*_write16_async)(struct intf_hdl *pintfhdl, u32 addr, u16 val); int (*_write16_async)(struct intf_hdl *pintfhdl, u32 addr, u16 val);
int (*_write32_async)(struct intf_hdl *pintfhdl, u32 addr, u32 val); int (*_write32_async)(struct intf_hdl *pintfhdl, u32 addr, u32 val);
void (*_read_mem)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt,
void (*_read_mem)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem); u8 *pmem);
void (*_write_mem)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem); void (*_write_mem)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt,
u8 *pmem);
void (*_sync_irp_protocol_rw)(struct io_queue *pio_q); void (*_sync_irp_protocol_rw)(struct io_queue *pio_q);
u32 (*_read_interrupt)(struct intf_hdl *pintfhdl, u32 addr); u32 (*_read_interrupt)(struct intf_hdl *pintfhdl, u32 addr);
u32 (*_read_port)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt,
u32 (*_read_port)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem); u8 *pmem);
u32 (*_write_port)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem); u32 (*_write_port)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt,
u8 *pmem);
u32 (*_write_scsi)(struct intf_hdl *pintfhdl,u32 cnt, u8 *pmem); u32 (*_write_scsi)(struct intf_hdl *pintfhdl,u32 cnt, u8 *pmem);
void (*_read_port_cancel)(struct intf_hdl *pintfhdl); void (*_read_port_cancel)(struct intf_hdl *pintfhdl);
void (*_write_port_cancel)(struct intf_hdl *pintfhdl); void (*_write_port_cancel)(struct intf_hdl *pintfhdl);
}; };
@ -150,29 +143,25 @@ struct _io_ops {
struct io_req { struct io_req {
struct list_head list; struct list_head list;
u32 addr; u32 addr;
volatile u32 val; u32 val;
u32 command; u32 command;
u32 status; u32 status;
u8 *pbuf; u8 *pbuf;
struct semaphore sema; struct semaphore sema;
void (*_async_io_callback)(struct adapter *padater, struct io_req *pio_req, u8 *cnxt); void (*_async_io_callback)(struct adapter *padater,
struct io_req *pio_req, u8 *cnxt);
u8 *cnxt; u8 *cnxt;
}; };
struct intf_hdl { struct intf_hdl {
struct adapter *padapter; struct adapter *padapter;
struct dvobj_priv *pintf_dev;/* pointer to &(padapter->dvobjpriv); */ struct dvobj_priv *pintf_dev;
struct _io_ops io_ops; struct _io_ops io_ops;
}; };
struct reg_protocol_rd { struct reg_protocol_rd {
#ifdef __LITTLE_ENDIAN #ifdef __LITTLE_ENDIAN
/* DW1 */ /* DW1 */
u32 NumOfTrans:4; u32 NumOfTrans:4;
u32 Reserved1:4; u32 Reserved1:4;
@ -192,45 +181,30 @@ struct reg_protocol_rd {
/* DW4 */ /* DW4 */
/* u32 Value; */ /* u32 Value; */
#else #else
/* DW1 */ /* DW1 */
u32 Reserved1 :4; u32 Reserved1:4;
u32 NumOfTrans :4; u32 NumOfTrans:4;
u32 Reserved2:24;
u32 Reserved2 :24;
/* DW2 */ /* DW2 */
u32 WriteEnable : 1; u32 WriteEnable:1;
u32 ByteCount :7; u32 ByteCount:7;
u32 Reserved3:3;
u32 Byte4Access:1;
u32 Reserved3 : 3;
u32 Byte4Access : 1;
u32 Byte2Access : 1;
u32 Byte1Access : 1;
u32 BurstMode :1 ;
u32 FixOrContinuous : 1;
u32 Reserved4 : 16;
u32 Byte2Access:1;
u32 Byte1Access:1;
u32 BurstMode:1;
u32 FixOrContinuous:1;
u32 Reserved4:16;
/* DW3 */ /* DW3 */
u32 BusAddress; u32 BusAddress;
/* DW4 */ /* DW4 */
/* u32 Value; */
#endif #endif
}; };
struct reg_protocol_wt { struct reg_protocol_wt {
#ifdef __LITTLE_ENDIAN #ifdef __LITTLE_ENDIAN
/* DW1 */ /* DW1 */
u32 NumOfTrans:4; u32 NumOfTrans:4;
u32 Reserved1:4; u32 Reserved1:4;
@ -249,179 +223,164 @@ struct reg_protocol_wt {
u32 BusAddress; u32 BusAddress;
/* DW4 */ /* DW4 */
u32 Value; u32 Value;
#else #else
/* DW1 */ /* DW1 */
u32 Reserved1 :4; u32 Reserved1 :4;
u32 NumOfTrans :4; u32 NumOfTrans:4;
u32 Reserved2:24;
u32 Reserved2 :24;
/* DW2 */ /* DW2 */
u32 WriteEnable : 1; u32 WriteEnable:1;
u32 ByteCount :7; u32 ByteCount:7;
u32 Reserved3:3;
u32 Reserved3 : 3; u32 Byte4Access:1;
u32 Byte4Access : 1; u32 Byte2Access:1;
u32 Byte1Access:1;
u32 Byte2Access : 1; u32 BurstMode:1;
u32 Byte1Access : 1; u32 FixOrContinuous:1;
u32 BurstMode :1 ; u32 Reserved4:16;
u32 FixOrContinuous : 1;
u32 Reserved4 : 16;
/* DW3 */ /* DW3 */
u32 BusAddress; u32 BusAddress;
/* DW4 */ /* DW4 */
u32 Value; u32 Value;
#endif #endif
}; };
/* /*
Below is the data structure used by _io_handler Below is the data structure used by _io_handler
*/ */
struct io_queue { struct io_queue {
spinlock_t lock; spinlock_t lock;
struct list_head free_ioreqs; struct list_head free_ioreqs;
struct list_head pending; /* The io_req list that will be served in the single protocol read/write. */ struct list_head pending; /* The io_req list that will be served
* in the single protocol read/write.*/
struct list_head processing; struct list_head processing;
u8 *free_ioreqs_buf; /* 4-byte aligned */ u8 *free_ioreqs_buf; /* 4-byte aligned */
u8 *pallocated_free_ioreqs_buf; u8 *pallocated_free_ioreqs_buf;
struct intf_hdl intf; struct intf_hdl intf;
}; };
struct io_priv{ struct io_priv {
struct adapter *padapter; struct adapter *padapter;
struct intf_hdl intf; struct intf_hdl intf;
}; };
extern uint ioreq_flush(struct adapter *adapter, struct io_queue *ioqueue); uint ioreq_flush(struct adapter *adapter, struct io_queue *ioqueue);
extern void sync_ioreq_enqueue(struct io_req *preq,struct io_queue *ioqueue); void sync_ioreq_enqueue(struct io_req *preq,struct io_queue *ioqueue);
extern uint sync_ioreq_flush(struct adapter *adapter, struct io_queue *ioqueue); uint sync_ioreq_flush(struct adapter *adapter, struct io_queue *ioqueue);
uint free_ioreq(struct io_req *preq, struct io_queue *pio_queue);
struct io_req *alloc_ioreq(struct io_queue *pio_q);
uint register_intf_hdl(u8 *dev, struct intf_hdl *pintfhdl);
void unregister_intf_hdl(struct intf_hdl *pintfhdl);
extern uint free_ioreq(struct io_req *preq, struct io_queue *pio_queue); void _rtw_attrib_read(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
extern struct io_req *alloc_ioreq(struct io_queue *pio_q); void _rtw_attrib_write(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
extern uint register_intf_hdl(u8 *dev, struct intf_hdl *pintfhdl); u8 _rtw_read8(struct adapter *adapter, u32 addr);
extern void unregister_intf_hdl(struct intf_hdl *pintfhdl); u16 _rtw_read16(struct adapter *adapter, u32 addr);
u32 _rtw_read32(struct adapter *adapter, u32 addr);
void _rtw_read_mem(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
void _rtw_read_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
void _rtw_read_port_cancel(struct adapter *adapter);
extern void _rtw_attrib_read(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem); int _rtw_write8(struct adapter *adapter, u32 addr, u8 val);
extern void _rtw_attrib_write(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem); int _rtw_write16(struct adapter *adapter, u32 addr, u16 val);
int _rtw_write32(struct adapter *adapter, u32 addr, u32 val);
int _rtw_writeN(struct adapter *adapter, u32 addr, u32 length, u8 *pdata);
extern u8 _rtw_read8(struct adapter *adapter, u32 addr); int _rtw_write8_async(struct adapter *adapter, u32 addr, u8 val);
extern u16 _rtw_read16(struct adapter *adapter, u32 addr); int _rtw_write16_async(struct adapter *adapter, u32 addr, u16 val);
extern u32 _rtw_read32(struct adapter *adapter, u32 addr); int _rtw_write32_async(struct adapter *adapter, u32 addr, u32 val);
extern void _rtw_read_mem(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
extern void _rtw_read_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
extern void _rtw_read_port_cancel(struct adapter *adapter);
void _rtw_write_mem(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
extern int _rtw_write8(struct adapter *adapter, u32 addr, u8 val); u32 _rtw_write_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
extern int _rtw_write16(struct adapter *adapter, u32 addr, u16 val); u32 _rtw_write_port_and_wait(struct adapter *adapter, u32 addr, u32 cnt,
extern int _rtw_write32(struct adapter *adapter, u32 addr, u32 val); u8 *pmem, int timeout_ms);
extern int _rtw_writeN(struct adapter *adapter, u32 addr, u32 length, u8 *pdata); void _rtw_write_port_cancel(struct adapter *adapter);
extern int _rtw_write8_async(struct adapter *adapter, u32 addr, u8 val);
extern int _rtw_write16_async(struct adapter *adapter, u32 addr, u16 val);
extern int _rtw_write32_async(struct adapter *adapter, u32 addr, u32 val);
extern void _rtw_write_mem(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
extern u32 _rtw_write_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
u32 _rtw_write_port_and_wait(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem, int timeout_ms);
extern void _rtw_write_port_cancel(struct adapter *adapter);
#define rtw_read8(adapter, addr) _rtw_read8((adapter), (addr)) #define rtw_read8(adapter, addr) _rtw_read8((adapter), (addr))
#define rtw_read16(adapter, addr) _rtw_read16((adapter), (addr)) #define rtw_read16(adapter, addr) _rtw_read16((adapter), (addr))
#define rtw_read32(adapter, addr) _rtw_read32((adapter), (addr)) #define rtw_read32(adapter, addr) _rtw_read32((adapter), (addr))
#define rtw_read_mem(adapter, addr, cnt, mem) _rtw_read_mem((adapter), (addr), (cnt), (mem)) #define rtw_read_mem(adapter, addr, cnt, mem) \
#define rtw_read_port(adapter, addr, cnt, mem) _rtw_read_port((adapter), (addr), (cnt), (mem)) _rtw_read_mem((adapter), (addr), (cnt), (mem))
#define rtw_read_port(adapter, addr, cnt, mem) \
_rtw_read_port((adapter), (addr), (cnt), (mem))
#define rtw_read_port_cancel(adapter) _rtw_read_port_cancel((adapter)) #define rtw_read_port_cancel(adapter) _rtw_read_port_cancel((adapter))
#define rtw_write8(adapter, addr, val) _rtw_write8((adapter), (addr), (val)) #define rtw_write8(adapter, addr, val) \
#define rtw_write16(adapter, addr, val) _rtw_write16((adapter), (addr), (val)) _rtw_write8((adapter), (addr), (val))
#define rtw_write32(adapter, addr, val) _rtw_write32((adapter), (addr), (val)) #define rtw_write16(adapter, addr, val) \
#define rtw_writeN(adapter, addr, length, data) _rtw_writeN((adapter), (addr), (length), (data)) _rtw_write16((adapter), (addr), (val))
#define rtw_write32(adapter, addr, val) \
#define rtw_write8_async(adapter, addr, val) _rtw_write8_async((adapter), (addr), (val)) _rtw_write32((adapter), (addr), (val))
#define rtw_write16_async(adapter, addr, val) _rtw_write16_async((adapter), (addr), (val)) #define rtw_writeN(adapter, addr, length, data) \
#define rtw_write32_async(adapter, addr, val) _rtw_write32_async((adapter), (addr), (val)) _rtw_writeN((adapter), (addr), (length), (data))
#define rtw_write8_async(adapter, addr, val) \
#define rtw_write_mem(adapter, addr, cnt, mem) _rtw_write_mem((adapter), (addr), (cnt), (mem)) _rtw_write8_async((adapter), (addr), (val))
#define rtw_write_port(adapter, addr, cnt, mem) _rtw_write_port((adapter), (addr), (cnt), (mem)) #define rtw_write16_async(adapter, addr, val) \
#define rtw_write_port_and_wait(adapter, addr, cnt, mem, timeout_ms) _rtw_write_port_and_wait((adapter), (addr), (cnt), (mem), (timeout_ms)) _rtw_write16_async((adapter), (addr), (val))
#define rtw_write32_async(adapter, addr, val) \
_rtw_write32_async((adapter), (addr), (val))
#define rtw_write_mem(adapter, addr, cnt, mem) \
_rtw_write_mem((adapter), (addr), (cnt), (mem))
#define rtw_write_port(adapter, addr, cnt, mem) \
_rtw_write_port((adapter), (addr), (cnt), (mem))
#define rtw_write_port_and_wait(adapter, addr, cnt, mem, timeout_ms) \
_rtw_write_port_and_wait((adapter), (addr), (cnt), (mem), (timeout_ms))
#define rtw_write_port_cancel(adapter) _rtw_write_port_cancel((adapter)) #define rtw_write_port_cancel(adapter) _rtw_write_port_cancel((adapter))
extern void rtw_write_scsi(struct adapter *adapter, u32 cnt, u8 *pmem); void rtw_write_scsi(struct adapter *adapter, u32 cnt, u8 *pmem);
/* ioreq */ /* ioreq */
extern void ioreq_read8(struct adapter *adapter, u32 addr, u8 *pval); void ioreq_read8(struct adapter *adapter, u32 addr, u8 *pval);
extern void ioreq_read16(struct adapter *adapter, u32 addr, u16 *pval); void ioreq_read16(struct adapter *adapter, u32 addr, u16 *pval);
extern void ioreq_read32(struct adapter *adapter, u32 addr, u32 *pval); void ioreq_read32(struct adapter *adapter, u32 addr, u32 *pval);
extern void ioreq_write8(struct adapter *adapter, u32 addr, u8 val); void ioreq_write8(struct adapter *adapter, u32 addr, u8 val);
extern void ioreq_write16(struct adapter *adapter, u32 addr, u16 val); void ioreq_write16(struct adapter *adapter, u32 addr, u16 val);
extern void ioreq_write32(struct adapter *adapter, u32 addr, u32 val); void ioreq_write32(struct adapter *adapter, u32 addr, u32 val);
uint async_read8(struct adapter *adapter, u32 addr, u8 *pbuff,
void (*_async_io_callback)(struct adapter *padater,
struct io_req *pio_req,
u8 *cnxt), u8 *cnxt);
uint async_read16(struct adapter *adapter, u32 addr, u8 *pbuff,
void (*_async_io_callback)(struct adapter *padater,
struct io_req *pio_req,
u8 *cnxt), u8 *cnxt);
uint async_read32(struct adapter *adapter, u32 addr, u8 *pbuff,
void (*_async_io_callback)(struct adapter *padater,
struct io_req *pio_req,
u8 *cnxt), u8 *cnxt);
extern uint async_read8(struct adapter *adapter, u32 addr, u8 *pbuff, void async_read_mem(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
void (*_async_io_callback)(struct adapter *padater, struct io_req *pio_req, u8 *cnxt), u8 *cnxt); void async_read_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
extern uint async_read16(struct adapter *adapter, u32 addr, u8 *pbuff,
void (*_async_io_callback)(struct adapter *padater, struct io_req *pio_req, u8 *cnxt), u8 *cnxt);
extern uint async_read32(struct adapter *adapter, u32 addr, u8 *pbuff,
void (*_async_io_callback)(struct adapter *padater, struct io_req *pio_req, u8 *cnxt), u8 *cnxt);
extern void async_read_mem(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem); void async_write8(struct adapter *adapter, u32 addr, u8 val,
extern void async_read_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem); void (*_async_io_callback)(struct adapter *padater,
struct io_req *pio_req,
u8 *cnxt), u8 *cnxt);
void async_write16(struct adapter *adapter, u32 addr, u16 val,
void (*_async_io_callback)(struct adapter *padater,
struct io_req *pio_req,
u8 *cnxt), u8 *cnxt);
void async_write32(struct adapter *adapter, u32 addr, u32 val,
void (*_async_io_callback)(struct adapter *padater,
struct io_req *pio_req,
u8 *cnxt), u8 *cnxt);
extern void async_write8(struct adapter *adapter, u32 addr, u8 val, void async_write_mem(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
void (*_async_io_callback)(struct adapter *padater, struct io_req *pio_req, u8 *cnxt), u8 *cnxt); void async_write_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
extern void async_write16(struct adapter *adapter, u32 addr, u16 val,
void (*_async_io_callback)(struct adapter *padater, struct io_req *pio_req, u8 *cnxt), u8 *cnxt);
extern void async_write32(struct adapter *adapter, u32 addr, u32 val,
void (*_async_io_callback)(struct adapter *padater, struct io_req *pio_req, u8 *cnxt), u8 *cnxt);
extern void async_write_mem(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem); int rtw_init_io_priv(struct adapter *padapter,
extern void async_write_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem); void (*set_intf_ops)(struct _io_ops *pops));
uint alloc_io_queue(struct adapter *adapter);
int rtw_init_io_priv(struct adapter *padapter, void (*set_intf_ops)(struct _io_ops *pops)); void free_io_queue(struct adapter *adapter);
void async_bus_io(struct io_queue *pio_q);
void bus_sync_io(struct io_queue *pio_q);
extern uint alloc_io_queue(struct adapter *adapter); u32 _ioreq2rwmem(struct io_queue *pio_q);
extern void free_io_queue(struct adapter *adapter); void dev_power_down(struct adapter * Adapter, u8 bpwrup);
extern void async_bus_io(struct io_queue *pio_q);
extern void bus_sync_io(struct io_queue *pio_q);
extern u32 _ioreq2rwmem(struct io_queue *pio_q);
extern void dev_power_down(struct adapter * Adapter, u8 bpwrup);
/*
#define RTL_R8(reg) rtw_read8(padapter, reg)
#define RTL_R16(reg) rtw_read16(padapter, reg)
#define RTL_R32(reg) rtw_read32(padapter, reg)
#define RTL_W8(reg, val8) rtw_write8(padapter, reg, val8)
#define RTL_W16(reg, val16) rtw_write16(padapter, reg, val16)
#define RTL_W32(reg, val32) rtw_write32(padapter, reg, val32)
*/
/*
#define RTL_W8_ASYNC(reg, val8) rtw_write32_async(padapter, reg, val8)
#define RTL_W16_ASYNC(reg, val16) rtw_write32_async(padapter, reg, val16)
#define RTL_W32_ASYNC(reg, val32) rtw_write32_async(padapter, reg, val32)
#define RTL_WRITE_BB(reg, val32) phy_SetUsbBBReg(padapter, reg, val32)
#define RTL_READ_BB(reg) phy_QueryUsbBBReg(padapter, reg)
*/
#define PlatformEFIOWrite1Byte(_a,_b,_c) \ #define PlatformEFIOWrite1Byte(_a,_b,_c) \
rtw_write8(_a,_b,_c) rtw_write8(_a,_b,_c)

View file

@ -66,7 +66,7 @@
#define DEBUG_OID(dbg, str) \ #define DEBUG_OID(dbg, str) \
if ((!dbg)) { \ if ((!dbg)) { \
RT_TRACE(_module_rtl871x_ioctl_c_, _drv_info_, \ RT_TRACE(_module_rtl871x_ioctl_c_, _drv_info_, \
("%s(%d): %s", __func__, __LINE__, str)); \ ("%s(%d): %s", __func__, __line__, str)); \
} }
enum oid_type { enum oid_type {
@ -83,8 +83,7 @@ struct oid_funs_node {
int set_counter; /* count the number of set hits for this segment */ int set_counter; /* count the number of set hits for this segment */
}; };
struct oid_par_priv struct oid_par_priv {
{
void *adapter_context; void *adapter_context;
NDIS_OID oid; NDIS_OID oid;
void *information_buf; void *information_buf;
@ -96,13 +95,13 @@ struct oid_par_priv
}; };
struct oid_obj_priv { struct oid_obj_priv {
unsigned char dbg; /* 0: without OID debug message 1: with OID debug message */ unsigned char dbg; /* 0: without OID debug message
* 1: with OID debug message */
int (*oidfuns)(struct oid_par_priv *poid_par_priv); int (*oidfuns)(struct oid_par_priv *poid_par_priv);
}; };
#if defined(_RTW_MP_IOCTL_C_) #if defined(_RTW_MP_IOCTL_C_)
static int oid_null_function(struct oid_par_priv* poid_par_priv) static int oid_null_function(struct oid_par_priv *poid_par_priv) {
{
_func_enter_; _func_enter_;
_func_exit_; _func_exit_;
return NDIS_STATUS_SUCCESS; return NDIS_STATUS_SUCCESS;

View file

@ -24,59 +24,56 @@
#include <drv_types.h> #include <drv_types.h>
/* oid_rtl_seg_01_01 ************** */ /* oid_rtl_seg_01_01 ************** */
int oid_rt_get_signal_quality_hdl(struct oid_par_priv* poid_par_priv);/* 84 */ int oid_rt_get_signal_quality_hdl(struct oid_par_priv *poid_par_priv);/* 84 */
int oid_rt_get_small_packet_crc_hdl(struct oid_par_priv* poid_par_priv); int oid_rt_get_small_packet_crc_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_get_middle_packet_crc_hdl(struct oid_par_priv* poid_par_priv); int oid_rt_get_middle_packet_crc_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_get_large_packet_crc_hdl(struct oid_par_priv* poid_par_priv); int oid_rt_get_large_packet_crc_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_get_tx_retry_hdl(struct oid_par_priv* poid_par_priv); int oid_rt_get_tx_retry_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_get_rx_retry_hdl(struct oid_par_priv* poid_par_priv); int oid_rt_get_rx_retry_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_get_rx_total_packet_hdl(struct oid_par_priv* poid_par_priv); int oid_rt_get_rx_total_packet_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_get_tx_beacon_ok_hdl(struct oid_par_priv* poid_par_priv); int oid_rt_get_tx_beacon_ok_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_get_tx_beacon_err_hdl(struct oid_par_priv* poid_par_priv); int oid_rt_get_tx_beacon_err_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_set_fw_dig_state_hdl(struct oid_par_priv* poid_par_priv); /* 8a */ int oid_rt_pro_set_fw_dig_state_hdl(struct oid_par_priv *poid_par_priv);/* 8a */
int oid_rt_pro_set_fw_ra_state_hdl(struct oid_par_priv* poid_par_priv); /* 8b */ int oid_rt_pro_set_fw_ra_state_hdl(struct oid_par_priv *poid_par_priv); /* 8b */
int oid_rt_get_rx_icv_err_hdl(struct oid_par_priv* poid_par_priv);/* 93 */ int oid_rt_get_rx_icv_err_hdl(struct oid_par_priv *poid_par_priv);/* 93 */
int oid_rt_set_encryption_algorithm_hdl(struct oid_par_priv* poid_par_priv); int oid_rt_set_encryption_algorithm_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_get_preamble_mode_hdl(struct oid_par_priv* poid_par_priv); int oid_rt_get_preamble_mode_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_get_ap_ip_hdl(struct oid_par_priv* poid_par_priv); int oid_rt_get_ap_ip_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_get_channelplan_hdl(struct oid_par_priv* poid_par_priv); int oid_rt_get_channelplan_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_set_channelplan_hdl(struct oid_par_priv* poid_par_priv); int oid_rt_set_channelplan_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_set_preamble_mode_hdl(struct oid_par_priv* poid_par_priv); int oid_rt_set_preamble_mode_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_set_bcn_intvl_hdl(struct oid_par_priv* poid_par_priv); int oid_rt_set_bcn_intvl_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_dedicate_probe_hdl(struct oid_par_priv* poid_par_priv); int oid_rt_dedicate_probe_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_get_total_tx_bytes_hdl(struct oid_par_priv* poid_par_priv); int oid_rt_get_total_tx_bytes_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_get_total_rx_bytes_hdl(struct oid_par_priv* poid_par_priv); int oid_rt_get_total_rx_bytes_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_current_tx_power_level_hdl(struct oid_par_priv* poid_par_priv); int oid_rt_current_tx_power_level_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_get_enc_key_mismatch_count_hdl(struct oid_par_priv* poid_par_priv); int oid_rt_get_enc_key_mismatch_count_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_get_enc_key_match_count_hdl(struct oid_par_priv* poid_par_priv); int oid_rt_get_enc_key_match_count_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_get_channel_hdl(struct oid_par_priv* poid_par_priv); int oid_rt_get_channel_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_get_hardware_radio_off_hdl(struct oid_par_priv* poid_par_priv); int oid_rt_get_hardware_radio_off_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_get_key_mismatch_hdl(struct oid_par_priv* poid_par_priv); int oid_rt_get_key_mismatch_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_supported_wireless_mode_hdl(struct oid_par_priv* poid_par_priv); int oid_rt_supported_wireless_mode_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_get_channel_list_hdl(struct oid_par_priv* poid_par_priv); int oid_rt_get_channel_list_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_get_scan_in_progress_hdl(struct oid_par_priv* poid_par_priv); int oid_rt_get_scan_in_progress_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_forced_data_rate_hdl(struct oid_par_priv* poid_par_priv); int oid_rt_forced_data_rate_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_wireless_mode_for_scan_list_hdl(struct oid_par_priv* poid_par_priv); int oid_rt_wireless_mode_for_scan_list_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_get_bss_wireless_mode_hdl(struct oid_par_priv* poid_par_priv); int oid_rt_get_bss_wireless_mode_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_scan_with_magic_packet_hdl(struct oid_par_priv* poid_par_priv); int oid_rt_scan_with_magic_packet_hdl(struct oid_par_priv *poid_par_priv);
/* oid_rtl_seg_01_03 section start ************** */ /* oid_rtl_seg_01_03 section start ************** */
int oid_rt_ap_get_associated_station_list_hdl(struct oid_par_priv* poid_par_priv); int oid_rt_ap_get_associated_station_list_hdl(struct oid_par_priv *priv);
int oid_rt_ap_switch_into_ap_mode_hdl(struct oid_par_priv* poid_par_priv); int oid_rt_ap_switch_into_ap_mode_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_ap_supported_hdl(struct oid_par_priv* poid_par_priv); int oid_rt_ap_supported_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_ap_set_passphrase_hdl(struct oid_par_priv* poid_par_priv); int oid_rt_ap_set_passphrase_hdl(struct oid_par_priv *poid_par_priv);
/* oid_rtl_seg_01_11 */ /* oid_rtl_seg_01_11 */
int oid_rt_pro_rf_write_registry_hdl(struct oid_par_priv* poid_par_priv); int oid_rt_pro_rf_write_registry_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_rf_read_registry_hdl(struct oid_par_priv* poid_par_priv); int oid_rt_pro_rf_read_registry_hdl(struct oid_par_priv *poid_par_priv);
/* oid_rtl_seg_03_00 section start ************** */ /* oid_rtl_seg_03_00 section start ************** */
int oid_rt_get_connect_state_hdl(struct oid_par_priv* poid_par_priv); int oid_rt_get_connect_state_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_set_default_key_id_hdl(struct oid_par_priv* poid_par_priv); int oid_rt_set_default_key_id_hdl(struct oid_par_priv *poid_par_priv);
#endif #endif

View file

@ -25,20 +25,22 @@
typedef u8 NDIS_802_11_PMKID_VALUE[16]; typedef u8 NDIS_802_11_PMKID_VALUE[16];
u8 rtw_set_802_11_add_key(struct adapter * padapter, struct ndis_802_11_key * key); u8 rtw_set_802_11_add_key(struct adapter *adapt, struct ndis_802_11_key *key);
u8 rtw_set_802_11_authentication_mode(struct adapter *pdapter, enum ndis_802_11_auth_mode authmode); u8 rtw_set_802_11_authentication_mode(struct adapter *adapt,
u8 rtw_set_802_11_bssid(struct adapter* padapter, u8 *bssid); enum ndis_802_11_auth_mode authmode);
u8 rtw_set_802_11_add_wep(struct adapter * padapter, struct ndis_802_11_wep * wep); u8 rtw_set_802_11_bssid(struct adapter*adapter, u8 *bssid);
u8 rtw_set_802_11_disassociate(struct adapter * padapter); u8 rtw_set_802_11_add_wep(struct adapter *adapter, struct ndis_802_11_wep *wep);
u8 rtw_set_802_11_bssid_list_scan(struct adapter* padapter, struct ndis_802_11_ssid *pssid, int ssid_max_num); u8 rtw_set_802_11_disassociate(struct adapter *adapter);
u8 rtw_set_802_11_infrastructure_mode(struct adapter * padapter, enum ndis_802_11_network_infra networktype); u8 rtw_set_802_11_bssid_list_scan(struct adapter*adapter,
u8 rtw_set_802_11_remove_wep(struct adapter * padapter, u32 keyindex); struct ndis_802_11_ssid *pssid,
u8 rtw_set_802_11_ssid(struct adapter * padapter, struct ndis_802_11_ssid * ssid); int ssid_max_num);
u8 rtw_set_802_11_remove_key(struct adapter * padapter, struct ndis_802_11_remove_key * key); u8 rtw_set_802_11_infrastructure_mode(struct adapter *adapter,
enum ndis_802_11_network_infra type);
u8 rtw_set_802_11_remove_wep(struct adapter *adapter, u32 keyindex);
u8 rtw_set_802_11_ssid(struct adapter *adapt, struct ndis_802_11_ssid *ssid);
u8 rtw_set_802_11_remove_key(struct adapter *adapt,
struct ndis_802_11_remove_key *key);
u8 rtw_validate_ssid(struct ndis_802_11_ssid *ssid); u8 rtw_validate_ssid(struct ndis_802_11_ssid *ssid);
u16 rtw_get_cur_max_rate(struct adapter *adapter); u16 rtw_get_cur_max_rate(struct adapter *adapter);
int rtw_set_scan_mode(struct adapter *adapter, enum rt_scan_type scan_mode); int rtw_set_scan_mode(struct adapter *adapter, enum rt_scan_type scan_mode);
int rtw_set_channel_plan(struct adapter *adapter, u8 channel_plan); int rtw_set_channel_plan(struct adapter *adapter, u8 channel_plan);

View file

@ -22,26 +22,18 @@
#include <osdep_service.h> #include <osdep_service.h>
#include <drv_types.h> #include <drv_types.h>
struct xmit_frame *rtw_IOL_accquire_xmit_frame(struct adapter *adapter);
int rtw_IOL_append_cmds(struct xmit_frame *xmit_frame, u8 *IOL_cmds, u32 cmd_len);
int rtw_IOL_append_LLT_cmd(struct xmit_frame *xmit_frame, u8 page_boundary);
int rtw_IOL_exec_cmds_sync(struct adapter *adapter, struct xmit_frame *xmit_frame, u32 max_wating_ms, u32 bndy_cnt);
bool rtw_IOL_applied(struct adapter *adapter);
int rtw_IOL_append_DELAY_US_cmd(struct xmit_frame *xmit_frame, u16 us);
int rtw_IOL_append_DELAY_MS_cmd(struct xmit_frame *xmit_frame, u16 ms);
int rtw_IOL_append_END_cmd(struct xmit_frame *xmit_frame);
#define IOREG_CMD_END_LEN 4 #define IOREG_CMD_END_LEN 4
struct ioreg_cfg{ struct ioreg_cfg {
u8 length; u8 length;
u8 cmd_id; u8 cmd_id;
__le16 address; __le16 address;
__le32 data; __le32 data;
__le32 mask; __le32 mask;
}; };
enum ioreg_cmd{
enum ioreg_cmd {
IOREG_CMD_LLT = 0x01, IOREG_CMD_LLT = 0x01,
IOREG_CMD_REFUSE = 0x02, IOREG_CMD_REFUSE = 0x02,
IOREG_CMD_EFUSE_PATH = 0x03, IOREG_CMD_EFUSE_PATH = 0x03,
@ -53,16 +45,38 @@ enum ioreg_cmd{
IOREG_CMD_DELAY_MS = 0x11, IOREG_CMD_DELAY_MS = 0x11,
IOREG_CMD_END = 0xFF, IOREG_CMD_END = 0xFF,
}; };
void read_efuse_from_txpktbuf(struct adapter *adapter, int bcnhead, u8 *content, u16 *size);
int _rtw_IOL_append_WB_cmd(struct xmit_frame *xmit_frame, u16 addr, u8 value, u8 mask); struct xmit_frame *rtw_IOL_accquire_xmit_frame(struct adapter *adapter);
int _rtw_IOL_append_WW_cmd(struct xmit_frame *xmit_frame, u16 addr, u16 value, u16 mask); int rtw_IOL_append_cmds(struct xmit_frame *xmit_frame, u8 *IOL_cmds,
int _rtw_IOL_append_WD_cmd(struct xmit_frame *xmit_frame, u16 addr, u32 value, u32 mask); u32 cmd_len);
int _rtw_IOL_append_WRF_cmd(struct xmit_frame *xmit_frame, u8 rf_path, u16 addr, u32 value, u32 mask); int rtw_IOL_append_LLT_cmd(struct xmit_frame *xmit_frame, u8 page_boundary);
#define rtw_IOL_append_WB_cmd(xmit_frame, addr, value,mask) _rtw_IOL_append_WB_cmd((xmit_frame), (addr), (value) ,(mask)) int rtw_IOL_exec_cmds_sync(struct adapter *adapter,
#define rtw_IOL_append_WW_cmd(xmit_frame, addr, value,mask) _rtw_IOL_append_WW_cmd((xmit_frame), (addr), (value),(mask)) struct xmit_frame *xmit_frame, u32 max_wating_ms,
#define rtw_IOL_append_WD_cmd(xmit_frame, addr, value,mask) _rtw_IOL_append_WD_cmd((xmit_frame), (addr), (value),(mask)) u32 bndy_cnt);
#define rtw_IOL_append_WRF_cmd(xmit_frame, rf_path, addr, value,mask) _rtw_IOL_append_WRF_cmd((xmit_frame),(rf_path), (addr), (value),(mask)) bool rtw_IOL_applied(struct adapter *adapter);
int rtw_IOL_append_DELAY_US_cmd(struct xmit_frame *xmit_frame, u16 us);
int rtw_IOL_append_DELAY_MS_cmd(struct xmit_frame *xmit_frame, u16 ms);
int rtw_IOL_append_END_cmd(struct xmit_frame *xmit_frame);
void read_efuse_from_txpktbuf(struct adapter *adapter, int bcnhead,
u8 *content, u16 *size);
int _rtw_IOL_append_WB_cmd(struct xmit_frame *xmit_frame, u16 addr,
u8 value, u8 mask);
int _rtw_IOL_append_WW_cmd(struct xmit_frame *xmit_frame, u16 addr,
u16 value, u16 mask);
int _rtw_IOL_append_WD_cmd(struct xmit_frame *xmit_frame, u16 addr,
u32 value, u32 mask);
int _rtw_IOL_append_WRF_cmd(struct xmit_frame *xmit_frame, u8 rf_path,
u16 addr, u32 value, u32 mask);
#define rtw_IOL_append_WB_cmd(xmit_frame, addr, value, mask) \
_rtw_IOL_append_WB_cmd((xmit_frame), (addr), (value) ,(mask))
#define rtw_IOL_append_WW_cmd(xmit_frame, addr, value, mask) \
_rtw_IOL_append_WW_cmd((xmit_frame), (addr), (value),(mask))
#define rtw_IOL_append_WD_cmd(xmit_frame, addr, value, mask) \
_rtw_IOL_append_WD_cmd((xmit_frame), (addr), (value), (mask))
#define rtw_IOL_append_WRF_cmd(xmit_frame, rf_path, addr, value, mask) \
_rtw_IOL_append_WRF_cmd((xmit_frame),(rf_path), (addr), (value), (mask))
u8 rtw_IOL_cmd_boundary_handle(struct xmit_frame *pxmit_frame); u8 rtw_IOL_cmd_boundary_handle(struct xmit_frame *pxmit_frame);
void rtw_IOL_cmd_buf_dump(struct adapter *Adapter,int buf_len,u8 *pbuf); void rtw_IOL_cmd_buf_dump(struct adapter *Adapter,int buf_len,u8 *pbuf);

View file

@ -80,9 +80,12 @@ enum LED_STATE_871x {
LED_BLINK_NORMAL = 3, LED_BLINK_NORMAL = 3,
LED_BLINK_SLOWLY = 4, LED_BLINK_SLOWLY = 4,
LED_BLINK_POWER_ON = 5, LED_BLINK_POWER_ON = 5,
LED_BLINK_SCAN = 6, /* LED is blinking during scanning period, the # of times to blink is depend on time for scanning. */ LED_BLINK_SCAN = 6, /* LED is blinking during scanning period,
* the # of times to blink is depend on time
* for scanning. */
LED_BLINK_NO_LINK = 7, /* LED is blinking during no link state. */ LED_BLINK_NO_LINK = 7, /* LED is blinking during no link state. */
LED_BLINK_StartToBlink = 8,/* Customzied for Sercomm Printer Server case */ LED_BLINK_StartToBlink = 8,/* Customzied for Sercomm Printer
* Server case */
LED_BLINK_TXRX = 9, LED_BLINK_TXRX = 9,
LED_BLINK_WPS = 10, /* LED is blinkg during WPS communication */ LED_BLINK_WPS = 10, /* LED is blinkg during WPS communication */
LED_BLINK_WPS_STOP = 11, /* for ALPHA */ LED_BLINK_WPS_STOP = 11, /* for ALPHA */
@ -104,9 +107,11 @@ enum LED_PIN_871x {
struct LED_871x { struct LED_871x {
struct adapter *padapter; struct adapter *padapter;
enum LED_PIN_871x LedPin; /* Identify how to implement this SW led. */ enum LED_PIN_871x LedPin; /* Identify how to implement this
* SW led. */
enum LED_STATE_871x CurrLedState; /* Current LED state. */ enum LED_STATE_871x CurrLedState; /* Current LED state. */
enum LED_STATE_871x BlinkingLedState; /* Next state for blinking, either RTW_LED_ON or RTW_LED_OFF are. */ enum LED_STATE_871x BlinkingLedState; /* Next state for blinking,
* either RTW_LED_ON or RTW_LED_OFF are. */
u8 bLedOn; /* true if LED is ON, false if LED is OFF. */ u8 bLedOn; /* true if LED is ON, false if LED is OFF. */
@ -125,37 +130,37 @@ struct LED_871x {
u8 bLedLinkBlinkInProgress; u8 bLedLinkBlinkInProgress;
u8 bLedStartToLinkBlinkInProgress; u8 bLedStartToLinkBlinkInProgress;
u8 bLedScanBlinkInProgress; u8 bLedScanBlinkInProgress;
struct work_struct BlinkWorkItem; /* Workitem used by BlinkTimer to manipulate H/W to blink LED. */ struct work_struct BlinkWorkItem; /* Workitem used by BlinkTimer to
* manipulate H/W to blink LED. */
}; };
#define IS_LED_WPS_BLINKING(_LED_871x) (((struct LED_871x *)_LED_871x)->CurrLedState==LED_BLINK_WPS \ #define IS_LED_WPS_BLINKING(_LED_871x) \
|| ((struct LED_871x *)_LED_871x)->CurrLedState==LED_BLINK_WPS_STOP \ (((struct LED_871x *)_LED_871x)->CurrLedState == LED_BLINK_WPS || \
|| ((struct LED_871x *)_LED_871x)->bLedWPSBlinkInProgress) ((struct LED_871x *)_LED_871x)->CurrLedState == LED_BLINK_WPS_STOP || \
((struct LED_871x *)_LED_871x)->bLedWPSBlinkInProgress)
#define IS_LED_BLINKING(_LED_871x) (((struct LED_871x *)_LED_871x)->bLedWPSBlinkInProgress \ #define IS_LED_BLINKING(_LED_871x) \
||((struct LED_871x *)_LED_871x)->bLedScanBlinkInProgress) (((struct LED_871x *)_LED_871x)->bLedWPSBlinkInProgress || \
((struct LED_871x *)_LED_871x)->bLedScanBlinkInProgress)
/* */
/* LED customization. */ /* LED customization. */
/* */
enum LED_STRATEGY_871x { enum LED_STRATEGY_871x {
SW_LED_MODE0 = 0, /* SW control 1 LED via GPIO0. It is default option. */ SW_LED_MODE0 = 0, /* SW control 1 LED via GPIO0. It is default option.*/
SW_LED_MODE1= 1, /* 2 LEDs, through LED0 and LED1. For ALPHA. */ SW_LED_MODE1= 1, /* 2 LEDs, through LED0 and LED1. For ALPHA. */
SW_LED_MODE2 = 2, /* SW control 1 LED via GPIO0, customized for AzWave 8187 minicard. */ SW_LED_MODE2 = 2, /* SW control 1 LED via GPIO0, customized for AzWave
SW_LED_MODE3 = 3, /* SW control 1 LED via GPIO0, customized for Sercomm Printer Server case. */ * 8187 minicard. */
SW_LED_MODE3 = 3, /* SW control 1 LED via GPIO0, customized for Sercomm
* Printer Server case. */
SW_LED_MODE4 = 4, /* for Edimax / Belkin */ SW_LED_MODE4 = 4, /* for Edimax / Belkin */
SW_LED_MODE5 = 5, /* for Sercomm / Belkin */ SW_LED_MODE5 = 5, /* for Sercomm / Belkin */
SW_LED_MODE6 = 6, /* for 88CU minicard, porting from ce SW_LED_MODE7 */ SW_LED_MODE6 = 6, /* for 88CU minicard, porting from ce SW_LED_MODE7 */
HW_LED = 50, /* HW control 2 LEDs, LED0 and LED1 (there are 4 different control modes, see MAC.CONFIG1 for details.) */ HW_LED = 50, /* HW control 2 LEDs, LED0 and LED1 (there are 4
* different control modes, see MAC.CONFIG1 for details.)*/
LED_ST_NONE = 99, LED_ST_NONE = 99,
}; };
void void LedControl871x(struct adapter *padapter, enum LED_CTL_MODE LedAction);
LedControl871x(
struct adapter *padapter,
enum LED_CTL_MODE LedAction
);
struct led_priv{ struct led_priv{
/* add for led controll */ /* add for led controll */
@ -163,14 +168,15 @@ struct led_priv{
struct LED_871x SwLed1; struct LED_871x SwLed1;
enum LED_STRATEGY_871x LedStrategy; enum LED_STRATEGY_871x LedStrategy;
u8 bRegUseLed; u8 bRegUseLed;
void (*LedControlHandler)(struct adapter *padapter, enum LED_CTL_MODE LedAction); void (*LedControlHandler)(struct adapter *padapter,
enum LED_CTL_MODE LedAction);
/* add for led controll */ /* add for led controll */
}; };
#define rtw_led_control(adapter, LedAction) \ #define rtw_led_control(adapt, action) \
do { \ do { \
if ((adapter)->ledpriv.LedControlHandler) \ if ((adapt)->ledpriv.LedControlHandler) \
(adapter)->ledpriv.LedControlHandler((adapter), (LedAction)); \ (adapt)->ledpriv.LedControlHandler((adapt), (action)); \
} while (0) } while (0)
void BlinkTimerCallback(void *data); void BlinkTimerCallback(void *data);
@ -178,18 +184,14 @@ void BlinkWorkItemCallback(struct work_struct *work);
void ResetLedStatus(struct LED_871x * pLed); void ResetLedStatus(struct LED_871x * pLed);
void void InitLed871x(struct adapter *padapter, struct LED_871x *pLed,
InitLed871x( enum LED_PIN_871x LedPin);
struct adapter *padapter,
struct LED_871x *pLed,
enum LED_PIN_871x LedPin
);
void DeInitLed871x(struct LED_871x *pLed); void DeInitLed871x(struct LED_871x *pLed);
/* hal... */ /* hal... */
void BlinkHandler(struct LED_871x * pLed); void BlinkHandler(struct LED_871x * pLed);
void SwLedOn(struct adapter *padapter, struct LED_871x * pLed); void SwLedOn(struct adapter *padapter, struct LED_871x *pLed);
void SwLedOff(struct adapter *padapter, struct LED_871x *pLed); void SwLedOff(struct adapter *padapter, struct LED_871x *pLed);
#endif /* __RTW_LED_H_ */ #endif /* __RTW_LED_H_ */

View file

@ -38,7 +38,7 @@
#define WIFI_NULL_STATE 0x00000000 #define WIFI_NULL_STATE 0x00000000
#define WIFI_ASOC_STATE 0x00000001 /* Under Linked state... */ #define WIFI_ASOC_STATE 0x00000001 /* Under Linked state */
#define WIFI_REASOC_STATE 0x00000002 #define WIFI_REASOC_STATE 0x00000002
#define WIFI_SLEEP_STATE 0x00000004 #define WIFI_SLEEP_STATE 0x00000004
#define WIFI_STATION_STATE 0x00000008 #define WIFI_STATION_STATE 0x00000008
@ -80,30 +80,29 @@ enum rt_scan_type {
SCAN_MIX, SCAN_MIX,
}; };
enum SCAN_RESULT_TYPE enum SCAN_RESULT_TYPE {
{
SCAN_RESULT_P2P_ONLY = 0, /* Will return all the P2P devices. */ SCAN_RESULT_P2P_ONLY = 0, /* Will return all the P2P devices. */
SCAN_RESULT_ALL = 1, /* Will return all the scanned device, include AP. */ SCAN_RESULT_ALL = 1, /* Will return all the scanned device,
SCAN_RESULT_WFD_TYPE = 2 /* Will just return the correct WFD device. */ * include AP. */
/* If this device is Miracast sink device, it will just return all the Miracast source devices. */ SCAN_RESULT_WFD_TYPE = 2 /* Will just return the correct WFD
* device. */
/* If this device is Miracast sink
* device, it will just return all the
* Miracast source devices. */
}; };
/* /*
there are several "locks" in mlme_priv, there are several "locks" in mlme_priv,
since mlme_priv is a shared resource between many threads, since mlme_priv is a shared resource between many threads,
like ISR/Call-Back functions, the OID handlers, and even timer functions. like ISR/Call-Back functions, the OID handlers, and even timer functions.
Each _queue has its own locks, already. Each _queue has its own locks, already.
Other items are protected by mlme_priv.lock. Other items are protected by mlme_priv.lock.
To avoid possible dead lock, any thread trying to modifiying mlme_priv To avoid possible dead lock, any thread trying to modifiying mlme_priv
SHALL not lock up more than one locks at a time! SHALL not lock up more than one lock at a time!
*/ */
#define traffic_threshold 10 #define traffic_threshold 10
#define traffic_scan_period 500 #define traffic_scan_period 500
@ -122,8 +121,10 @@ struct rt_link_detect {
bool bTxBusyTraffic; bool bTxBusyTraffic;
bool bRxBusyTraffic; bool bRxBusyTraffic;
bool bHigherBusyTraffic; /* For interrupt migration purpose. */ bool bHigherBusyTraffic; /* For interrupt migration purpose. */
bool bHigherBusyRxTraffic; /* We may disable Tx interrupt according as Rx traffic. */ bool bHigherBusyRxTraffic; /* We may disable Tx interrupt according
bool bHigherBusyTxTraffic; /* We may disable Tx interrupt according as Tx traffic. */ * to Rx traffic. */
bool bHigherBusyTxTraffic; /* We may disable Tx interrupt according
* to Tx traffic. */
}; };
struct profile_info { struct profile_info {
@ -132,75 +133,95 @@ struct profile_info {
u8 peermac[ ETH_ALEN ]; u8 peermac[ ETH_ALEN ];
}; };
struct tx_invite_req_info{ struct tx_invite_req_info {
u8 token; u8 token;
u8 benable; u8 benable;
u8 go_ssid[ WLAN_SSID_MAXLEN ]; u8 go_ssid[ WLAN_SSID_MAXLEN ];
u8 ssidlen; u8 ssidlen;
u8 go_bssid[ ETH_ALEN ]; u8 go_bssid[ ETH_ALEN ];
u8 peer_macaddr[ ETH_ALEN ]; u8 peer_macaddr[ ETH_ALEN ];
u8 operating_ch; /* This information will be set by using the p2p_set op_ch=x */ u8 operating_ch; /* This information will be set by using the
* p2p_set op_ch=x */
u8 peer_ch; /* The listen channel for peer P2P device */ u8 peer_ch; /* The listen channel for peer P2P device */
}; };
struct tx_invite_resp_info{ struct tx_invite_resp_info {
u8 token; /* Used to record the dialog token of p2p invitation request frame. */ u8 token; /* Used to record the dialog token of p2p invitation
* request frame. */
}; };
struct tx_provdisc_req_info{ struct tx_provdisc_req_info {
u16 wps_config_method_request; /* Used when sending the provisioning request frame */ u16 wps_config_method_request; /* Used when sending the
u16 peer_channel_num[2]; /* The channel number which the receiver stands. */ * provisioning request frame*/
u16 peer_channel_num[2]; /* The channel number which the
* receiver stands. */
struct ndis_802_11_ssid ssid; struct ndis_802_11_ssid ssid;
u8 peerDevAddr[ ETH_ALEN ]; /* Peer device address */ u8 peerDevAddr[ETH_ALEN]; /* Peer device address */
u8 peerIFAddr[ ETH_ALEN ]; /* Peer interface address */ u8 peerIFAddr[ETH_ALEN]; /* Peer interface address */
u8 benable; /* This provision discovery request frame is trigger to send or not */ u8 benable; /* This provision discovery
* request frame is trigger
* to send or not */
}; };
struct rx_provdisc_req_info{ /* When peer device issue prov_disc_req first, we should store the following informations */ /* When peer device issue prov_disc_req first, we should store the following
u8 peerDevAddr[ ETH_ALEN ]; /* Peer device address */ * information */
u8 strconfig_method_desc_of_prov_disc_req[4]; /* description for the config method located in the provisioning discovery request frame. */ /* The UI must know this information to know which config method the
/* The UI must know this information to know which config method the remote p2p device is requiring. */ * remote p2p device needs. */
struct rx_provdisc_req_info {
u8 peerDevAddr[ETH_ALEN]; /* Peer device address */
u8 strconfig_method_desc_of_prov_disc_req[4]; /* description
* for the config method located in the provisioning
* discovery request frame. */
}; };
struct tx_nego_req_info{ struct tx_nego_req_info {
u16 peer_channel_num[2]; /* The channel number which the receiver stands. */ u16 peer_channel_num[2]; /* The channel number. */
u8 peerDevAddr[ ETH_ALEN ]; /* Peer device address */ u8 peerDevAddr[ETH_ALEN]; /* Peer device address */
u8 benable; /* This negoitation request frame is trigger to send or not */ u8 benable; /* This negotiation request frame is
* trigger to send or not */
}; };
struct group_id_info{ struct group_id_info {
u8 go_device_addr[ ETH_ALEN ]; /* The GO's device address of this P2P group */ u8 go_device_addr[ ETH_ALEN ]; /* The GO's device address of
* this P2P group */
u8 ssid[ WLAN_SSID_MAXLEN ]; /* The SSID of this P2P group */ u8 ssid[ WLAN_SSID_MAXLEN ]; /* The SSID of this P2P group */
}; };
struct scan_limit_info{ struct scan_limit_info {
u8 scan_op_ch_only; /* When this flag is set, the driver should just scan the operation channel */ u8 scan_op_ch_only; /* When this flag is set, the driver
u8 operation_ch[2]; /* Store the operation channel of invitation request frame */ * should only scan the op. channel */
u8 operation_ch[2]; /* Store the op. chan of invitation */
}; };
struct wifidirect_info{ struct wifidirect_info {
struct adapter* padapter; struct adapter *padapter;
struct timer_list find_phase_timer; struct timer_list find_phase_timer;
struct timer_list restore_p2p_state_timer; struct timer_list restore_p2p_state_timer;
/* Used to do the scanning. After confirming the peer is availalble, the driver transmits the P2P frame to peer. */ /* Used to do the scanning. After confirming the peer is availalble,
* the driver transmits the P2P frame to peer. */
struct timer_list pre_tx_scan_timer; struct timer_list pre_tx_scan_timer;
struct timer_list reset_ch_sitesurvey; struct timer_list reset_ch_sitesurvey;
struct timer_list reset_ch_sitesurvey2; /* Just for resetting the scan limit function by using p2p nego */ struct timer_list reset_ch_sitesurvey2; /* Just for resetting the scan
* limit function by using p2p nego */
struct tx_provdisc_req_info tx_prov_disc_info; struct tx_provdisc_req_info tx_prov_disc_info;
struct rx_provdisc_req_info rx_prov_disc_info; struct rx_provdisc_req_info rx_prov_disc_info;
struct tx_invite_req_info invitereq_info; struct tx_invite_req_info invitereq_info;
struct profile_info profileinfo[ P2P_MAX_PERSISTENT_GROUP_NUM ]; /* Store the profile information of persistent group */ /* Store the profile information of persistent group */
struct profile_info profileinfo[P2P_MAX_PERSISTENT_GROUP_NUM];
struct tx_invite_resp_info inviteresp_info; struct tx_invite_resp_info inviteresp_info;
struct tx_nego_req_info nego_req_info; struct tx_nego_req_info nego_req_info;
struct group_id_info groupid_info; /* Store the group id information when doing the group negotiation handshake. */ /* Store the group id info when doing the group negot handshake. */
struct scan_limit_info rx_invitereq_info; /* Used for get the limit scan channel from the Invitation procedure */ struct group_id_info groupid_info;
struct scan_limit_info p2p_info; /* Used for get the limit scan channel from the P2P negotiation handshake */ /* Used for get the limit scan channel from the Invitation procedure */
struct scan_limit_info rx_invitereq_info;
/* Used for get the limit scan chan from the P2P negotiation handshake*/
struct scan_limit_info p2p_info;
enum P2P_ROLE role; enum P2P_ROLE role;
enum P2P_STATE pre_p2p_state; enum P2P_STATE pre_p2p_state;
enum P2P_STATE p2p_state; enum P2P_STATE p2p_state;
u8 device_addr[ETH_ALEN]; /* The device address should be the mac address of this device. */ /* The device address should be the mac address of this device. */
u8 device_addr[ETH_ALEN];
u8 interface_addr[ETH_ALEN]; u8 interface_addr[ETH_ALEN];
u8 social_chan[4]; u8 social_chan[4];
u8 listen_channel; u8 listen_channel;
@ -209,45 +230,63 @@ struct wifidirect_info{
u8 support_rate[8]; u8 support_rate[8];
u8 p2p_wildcard_ssid[P2P_WILDCARD_SSID_LEN]; u8 p2p_wildcard_ssid[P2P_WILDCARD_SSID_LEN];
u8 intent; /* should only include the intent value. */ u8 intent; /* should only include the intent value. */
u8 p2p_peer_interface_addr[ ETH_ALEN ]; u8 p2p_peer_interface_addr[ETH_ALEN];
u8 p2p_peer_device_addr[ ETH_ALEN ]; u8 p2p_peer_device_addr[ETH_ALEN];
u8 peer_intent; /* Included the intent value and tie breaker value. */ u8 peer_intent; /* Included the intent value and tie breaker value. */
u8 device_name[ WPS_MAX_DEVICE_NAME_LEN ]; /* Device name for displaying on searching device screen */ /* Device name for displaying on searching device screen */
u8 device_name[WPS_MAX_DEVICE_NAME_LEN];
u8 device_name_len; u8 device_name_len;
u8 profileindex; /* Used to point to the index of profileinfo array */ u8 profileindex; /* Used to point to the index of profileinfo array */
u8 peer_operating_ch; u8 peer_operating_ch;
u8 find_phase_state_exchange_cnt; u8 find_phase_state_exchange_cnt;
u16 device_password_id_for_nego; /* The device password ID for group negotation */ /* The device password ID for group negotation */
u16 device_password_id_for_nego;
u8 negotiation_dialog_token; u8 negotiation_dialog_token;
u8 nego_ssid[ WLAN_SSID_MAXLEN ]; /* SSID information for group negotitation */ /* SSID information for group negotitation */
u8 nego_ssid[WLAN_SSID_MAXLEN];
u8 nego_ssidlen; u8 nego_ssidlen;
u8 p2p_group_ssid[WLAN_SSID_MAXLEN]; u8 p2p_group_ssid[WLAN_SSID_MAXLEN];
u8 p2p_group_ssid_len; u8 p2p_group_ssid_len;
u8 persistent_supported; /* Flag to know the persistent function should be supported or not. */ /* Flag to know if the persistent function should be supported or not.*/
/* In the Sigma test, the Sigma will provide this enable from the sta_set_p2p CAPI. */ u8 persistent_supported;
/* In the Sigma test, the Sigma will provide this enable from the
* sta_set_p2p CAPI. */
/* 0: disable */ /* 0: disable */
/* 1: enable */ /* 1: enable */
u8 session_available; /* Flag to set the WFD session available to enable or disable "by Sigma" */ u8 session_available; /* Flag to set the WFD session available to
/* In the Sigma test, the Sigma will disable the session available by using the sta_preset CAPI. */ * enable or disable "by Sigma" */
/* In the Sigma test, the Sigma will disable the session available
* by using the sta_preset CAPI. */
/* 0: disable */ /* 0: disable */
/* 1: enable */ /* 1: enable */
u8 wfd_tdls_enable; /* Flag to enable or disable the TDLS by WFD Sigma*/
u8 wfd_tdls_enable; /* Flag to enable or disable the TDLS by WFD Sigma */
/* 0: disable */ /* 0: disable */
/* 1: enable */ /* 1: enable */
u8 wfd_tdls_weaksec; /* Flag to enable or disable the weak security function for TDLS by WFD Sigma */ u8 wfd_tdls_weaksec; /* Flag to enable or disable the weak security
* function for TDLS by WFD Sigma */
/* 0: disable */ /* 0: disable */
/* In this case, the driver can't issue the tdsl setup request frame. */ /* In this case, the driver can't issue the tdsl
* setup request frame. */
/* 1: enable */ /* 1: enable */
/* In this case, the driver can issue the tdls setup request frame */ /* In this case, the driver can issue the tdls
* setup request frame */
/* even the current security is weak security. */ /* even the current security is weak security. */
enum P2P_WPSINFO ui_got_wps_info; /* This field will store the WPS value (PIN value or PBC) that UI had got from the user. */ /* This field will store the WPS value (PIN value or PBC) that UI had
u16 supported_wps_cm; /* This field describes the WPS config method which this driver supported. */ * got from the user. */
/* The value should be the combination of config method defined in page104 of WPS v2.0 spec. */ enum P2P_WPSINFO ui_got_wps_info;
uint channel_list_attr_len; /* This field will contain the length of body of P2P Channel List attribute of group negotitation response frame. */ u16 supported_wps_cm; /* This field describes the WPS config method
u8 channel_list_attr[100]; /* This field will contain the body of P2P Channel List attribute of group negotitation response frame. */ * which this driver supported. */
/* We will use the channel_cnt and channel_list fields when constructing the group negotitation confirm frame. */ /* The value should be the combination of config
* method defined in page104 of WPS v2.0 spec.*/
/* This field will contain the length of body of P2P Channel List
* attribute of group negotiation response frame. */
uint channel_list_attr_len;
/* This field will contain the body of P2P Channel List attribute of
* group negotitation response frame. */
/* We will use the channel_cnt and channel_list fields when constructing
* the group negotiation confirm frame. */
u8 channel_list_attr[100];
enum P2P_PS_MODE p2p_ps_mode; /* indicate p2p ps mode */ enum P2P_PS_MODE p2p_ps_mode; /* indicate p2p ps mode */
enum P2P_PS_STATE p2p_ps_state; /* indicate p2p ps state */ enum P2P_PS_STATE p2p_ps_state; /* indicate p2p ps state */
u8 noa_index; /* Identifies and instance of Notice of Absence timing. */ u8 noa_index; /* Identifies and instance of Notice of Absence timing. */
@ -255,18 +294,23 @@ struct wifidirect_info{
u8 opp_ps; /* opportunistic power save. */ u8 opp_ps; /* opportunistic power save. */
u8 noa_num; /* number of NoA descriptor in P2P IE. */ u8 noa_num; /* number of NoA descriptor in P2P IE. */
u8 noa_count[P2P_MAX_NOA_NUM]; /* Count for owner, Type of client. */ u8 noa_count[P2P_MAX_NOA_NUM]; /* Count for owner, Type of client. */
u32 noa_duration[P2P_MAX_NOA_NUM]; /* Max duration for owner, preferred or min acceptable duration for client. */ /* Max duration for owner, preferred or min acceptable duration for
u32 noa_interval[P2P_MAX_NOA_NUM]; /* Length of interval for owner, preferred or max acceptable interval of client. */ * client. */
u32 noa_start_time[P2P_MAX_NOA_NUM]; /* schedule expressed in terms of the lower 4 bytes of the TSF timer. */ u32 noa_duration[P2P_MAX_NOA_NUM];
/* Length of interval for owner, preferred or max acceptable interval
* of client. */
u32 noa_interval[P2P_MAX_NOA_NUM];
/* schedule expressed in terms of the lower 4 bytes of the TSF timer. */
u32 noa_start_time[P2P_MAX_NOA_NUM];
}; };
struct tdls_ss_record{ /* signal strength record */ struct tdls_ss_record { /* signal strength record */
u8 macaddr[ETH_ALEN]; u8 macaddr[ETH_ALEN];
u8 RxPWDBAll; u8 RxPWDBAll;
u8 is_tdls_sta; /* true: direct link sta, false: else */ u8 is_tdls_sta; /* true: direct link sta, false: else */
}; };
struct tdls_info{ struct tdls_info {
u8 ap_prohibited; u8 ap_prohibited;
uint setup_state; uint setup_state;
u8 sta_cnt; u8 sta_cnt;
@ -286,7 +330,6 @@ struct tdls_info{
}; };
struct mlme_priv { struct mlme_priv {
spinlock_t lock; spinlock_t lock;
int fw_state; /* shall we protect this variable? maybe not necessarily... */ int fw_state; /* shall we protect this variable? maybe not necessarily... */
u8 bScanInProcess; u8 bScanInProcess;
@ -307,8 +350,6 @@ struct mlme_priv {
struct wlan_network cur_network; struct wlan_network cur_network;
/* uint wireless_mode; no used, remove it */
u32 scan_interval; u32 scan_interval;
struct timer_list assoc_timer; struct timer_list assoc_timer;
@ -327,11 +368,8 @@ struct mlme_priv {
/* Number of HT AP/stations 20 MHz */ /* Number of HT AP/stations 20 MHz */
/* int num_sta_ht_20mhz; */ /* int num_sta_ht_20mhz; */
int num_FortyMHzIntolerant; int num_FortyMHzIntolerant;
struct ht_priv htpriv; struct ht_priv htpriv;
struct rt_link_detect LinkDetectInfo; struct rt_link_detect LinkDetectInfo;
struct timer_list dynamic_chk_timer; /* dynamic/periodic check timer */ struct timer_list dynamic_chk_timer; /* dynamic/periodic check timer */
@ -358,7 +396,7 @@ struct mlme_priv {
int olbc; /* Overlapping Legacy BSS Condition */ int olbc; /* Overlapping Legacy BSS Condition */
/* Number of HT associated stations that do not support greenfield */ /* Number of HT assoc sta that do not support greenfield */
int num_sta_ht_no_gf; int num_sta_ht_no_gf;
/* Number of associated non-HT stations */ /* Number of associated non-HT stations */
@ -404,52 +442,49 @@ struct mlme_priv {
#ifdef CONFIG_AP_MODE #ifdef CONFIG_AP_MODE
struct hostapd_priv struct hostapd_priv {
{
struct adapter *padapter; struct adapter *padapter;
}; };
extern int hostapd_mode_init(struct adapter *padapter); int hostapd_mode_init(struct adapter *padapter);
extern void hostapd_mode_unload(struct adapter *padapter); void hostapd_mode_unload(struct adapter *padapter);
#endif #endif
extern unsigned char WPA_TKIP_CIPHER[4]; extern unsigned char WPA_TKIP_CIPHER[4];
extern unsigned char RSN_TKIP_CIPHER[4]; extern unsigned char RSN_TKIP_CIPHER[4];
extern unsigned char REALTEK_96B_IE[]; extern unsigned char REALTEK_96B_IE[];
extern unsigned char MCS_rate_2R[16]; extern unsigned char MCS_rate_2R[16];
extern unsigned char MCS_rate_1R[16]; extern unsigned char MCS_rate_1R[16];
extern void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf); void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf);
extern void rtw_survey_event_callback(struct adapter *adapter, u8 *pbuf); void rtw_survey_event_callback(struct adapter *adapter, u8 *pbuf);
extern void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf); void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf);
extern void rtw_joinbss_event_callback(struct adapter *adapter, u8 *pbuf); void rtw_joinbss_event_callback(struct adapter *adapter, u8 *pbuf);
extern void rtw_stassoc_event_callback(struct adapter *adapter, u8 *pbuf); void rtw_stassoc_event_callback(struct adapter *adapter, u8 *pbuf);
extern void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf); void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf);
extern void rtw_atimdone_event_callback(struct adapter *adapter, u8 *pbuf); void rtw_atimdone_event_callback(struct adapter *adapter, u8 *pbuf);
extern void rtw_cpwm_event_callback(struct adapter *adapter, u8 *pbuf); void rtw_cpwm_event_callback(struct adapter *adapter, u8 *pbuf);
void indicate_wx_scan_complete_event(struct adapter *padapter); void indicate_wx_scan_complete_event(struct adapter *padapter);
void rtw_indicate_wx_assoc_event(struct adapter *padapter); void rtw_indicate_wx_assoc_event(struct adapter *padapter);
void rtw_indicate_wx_disassoc_event(struct adapter *padapter); void rtw_indicate_wx_disassoc_event(struct adapter *padapter);
extern int event_thread(void *context); int event_thread(void *context);
extern void rtw_join_timeout_handler(void* FunctionContext); void rtw_join_timeout_handler(void *FunctionContext);
extern void _rtw_scan_timeout_handler(void* FunctionContext); void _rtw_scan_timeout_handler(void *FunctionContext);
extern void rtw_free_network_queue(struct adapter *adapter,u8 isfreeall); void rtw_free_network_queue(struct adapter *adapter, u8 isfreeall);
extern int rtw_init_mlme_priv(struct adapter *adapter);/* (struct mlme_priv *pmlmepriv); */ int rtw_init_mlme_priv(struct adapter *adapter);
extern void rtw_free_mlme_priv (struct mlme_priv *pmlmepriv); void rtw_free_mlme_priv (struct mlme_priv *pmlmepriv);
extern int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv); int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv);
extern int rtw_set_key(struct adapter *adapter, struct security_priv *psecuritypriv, int keyid, u8 set_tx); int rtw_set_key(struct adapter *adapter, struct security_priv *psecuritypriv,
extern int rtw_set_auth(struct adapter *adapter, struct security_priv *psecuritypriv); int keyid, u8 set_tx);
int rtw_set_auth(struct adapter *adapter, struct security_priv *psecuritypriv);
__inline static u8 *get_bssid(struct mlme_priv *pmlmepriv) static inline u8 *get_bssid(struct mlme_priv *pmlmepriv)
{ /* if sta_mode:pmlmepriv->cur_network.network.MacAddress=> bssid */ { /* if sta_mode:pmlmepriv->cur_network.network.MacAddress=> bssid */
/* if adhoc_mode:pmlmepriv->cur_network.network.MacAddress=> ibss mac address */ /* if adhoc_mode:pmlmepriv->cur_network.network.MacAddress=> ibss mac address */
return pmlmepriv->cur_network.network.MacAddress; return pmlmepriv->cur_network.network.MacAddress;
} }
__inline static int check_fwstate(struct mlme_priv *pmlmepriv, int state) static inline int check_fwstate(struct mlme_priv *pmlmepriv, int state)
{ {
if (pmlmepriv->fw_state & state) if (pmlmepriv->fw_state & state)
return true; return true;
@ -457,7 +492,7 @@ __inline static int check_fwstate(struct mlme_priv *pmlmepriv, int state)
return false; return false;
} }
__inline static int get_fwstate(struct mlme_priv *pmlmepriv) static inline int get_fwstate(struct mlme_priv *pmlmepriv)
{ {
return pmlmepriv->fw_state; return pmlmepriv->fw_state;
} }
@ -469,127 +504,131 @@ __inline static int get_fwstate(struct mlme_priv *pmlmepriv)
* ### NOTE:#### (!!!!) * ### NOTE:#### (!!!!)
* MUST TAKE CARE THAT BEFORE CALLING THIS FUNC, YOU SHOULD HAVE LOCKED pmlmepriv->lock * MUST TAKE CARE THAT BEFORE CALLING THIS FUNC, YOU SHOULD HAVE LOCKED pmlmepriv->lock
*/ */
__inline static void set_fwstate(struct mlme_priv *pmlmepriv, int state) static inline void set_fwstate(struct mlme_priv *pmlmepriv, int state)
{ {
pmlmepriv->fw_state |= state; pmlmepriv->fw_state |= state;
/* FOR HW integration */ /* FOR HW integration */
if (_FW_UNDER_SURVEY==state){ if (_FW_UNDER_SURVEY==state)
pmlmepriv->bScanInProcess = true; pmlmepriv->bScanInProcess = true;
}
} }
__inline static void _clr_fwstate_(struct mlme_priv *pmlmepriv, int state) static inline void _clr_fwstate_(struct mlme_priv *pmlmepriv, int state)
{ {
pmlmepriv->fw_state &= ~state; pmlmepriv->fw_state &= ~state;
/* FOR HW integration */ /* FOR HW integration */
if (_FW_UNDER_SURVEY==state){ if (_FW_UNDER_SURVEY==state)
pmlmepriv->bScanInProcess = false; pmlmepriv->bScanInProcess = false;
}
} }
/* /*
* No Limit on the calling context, * No Limit on the calling context,
* therefore set it to be the critical section... * therefore set it to be the critical section...
*/ */
__inline static void clr_fwstate(struct mlme_priv *pmlmepriv, int state) static inline void clr_fwstate(struct mlme_priv *pmlmepriv, int state)
{ {
unsigned long irqL; unsigned long irql;
_enter_critical_bh(&pmlmepriv->lock, &irqL); _enter_critical_bh(&pmlmepriv->lock, &irql);
if (check_fwstate(pmlmepriv, state) == true) if (check_fwstate(pmlmepriv, state) == true)
pmlmepriv->fw_state ^= state; pmlmepriv->fw_state ^= state;
_exit_critical_bh(&pmlmepriv->lock, &irqL); _exit_critical_bh(&pmlmepriv->lock, &irql);
} }
__inline static void clr_fwstate_ex(struct mlme_priv *pmlmepriv, int state) static inline void clr_fwstate_ex(struct mlme_priv *pmlmepriv, int state)
{ {
unsigned long irqL; unsigned long irql;
_enter_critical_bh(&pmlmepriv->lock, &irqL); _enter_critical_bh(&pmlmepriv->lock, &irql);
_clr_fwstate_(pmlmepriv, state); _clr_fwstate_(pmlmepriv, state);
_exit_critical_bh(&pmlmepriv->lock, &irqL); _exit_critical_bh(&pmlmepriv->lock, &irql);
} }
__inline static void up_scanned_network(struct mlme_priv *pmlmepriv) static inline void up_scanned_network(struct mlme_priv *pmlmepriv)
{ {
unsigned long irqL; unsigned long irql;
_enter_critical_bh(&pmlmepriv->lock, &irqL); _enter_critical_bh(&pmlmepriv->lock, &irql);
pmlmepriv->num_of_scanned++; pmlmepriv->num_of_scanned++;
_exit_critical_bh(&pmlmepriv->lock, &irqL); _exit_critical_bh(&pmlmepriv->lock, &irql);
} }
__inline static void down_scanned_network(struct mlme_priv *pmlmepriv) static inline void down_scanned_network(struct mlme_priv *pmlmepriv)
{ {
unsigned long irqL; unsigned long irql;
_enter_critical_bh(&pmlmepriv->lock, &irqL); _enter_critical_bh(&pmlmepriv->lock, &irql);
pmlmepriv->num_of_scanned--; pmlmepriv->num_of_scanned--;
_exit_critical_bh(&pmlmepriv->lock, &irqL); _exit_critical_bh(&pmlmepriv->lock, &irql);
} }
__inline static void set_scanned_network_val(struct mlme_priv *pmlmepriv, int val) static inline void set_scanned_network_val(struct mlme_priv *pmlmepriv, int val)
{ {
unsigned long irqL; unsigned long irql;
_enter_critical_bh(&pmlmepriv->lock, &irqL); _enter_critical_bh(&pmlmepriv->lock, &irql);
pmlmepriv->num_of_scanned = val; pmlmepriv->num_of_scanned = val;
_exit_critical_bh(&pmlmepriv->lock, &irqL); _exit_critical_bh(&pmlmepriv->lock, &irql);
} }
extern u16 rtw_get_capability(struct wlan_bssid_ex *bss); u16 rtw_get_capability(struct wlan_bssid_ex *bss);
extern void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *target); void rtw_update_scanned_network(struct adapter *adapter,
extern void rtw_disconnect_hdl_under_linked(struct adapter* adapter, struct sta_info *psta, u8 free_assoc); struct wlan_bssid_ex *target);
extern void rtw_generate_random_ibss(u8 *pibss); void rtw_disconnect_hdl_under_linked(struct adapter *adapter,
extern struct wlan_network* rtw_find_network(struct __queue *scanned_queue, u8 *addr); struct sta_info *psta, u8 free_assoc);
extern struct wlan_network* rtw_get_oldest_wlan_network(struct __queue *scanned_queue); void rtw_generate_random_ibss(u8 *pibss);
struct wlan_network *rtw_find_network(struct __queue *scanned_queue, u8 *addr);
struct wlan_network *rtw_get_oldest_wlan_network(struct __queue *scanned_queue);
extern void rtw_free_assoc_resources(struct adapter* adapter, int lock_scanned_queue); void rtw_free_assoc_resources(struct adapter *adapter, int lock_scanned_queue);
extern void rtw_indicate_disconnect(struct adapter* adapter); void rtw_indicate_disconnect(struct adapter *adapter);
extern void rtw_indicate_connect(struct adapter* adapter); void rtw_indicate_connect(struct adapter *adapter);
void rtw_indicate_scan_done( struct adapter *padapter, bool aborted); void rtw_indicate_scan_done( struct adapter *padapter, bool aborted);
void rtw_scan_abort(struct adapter *adapter); void rtw_scan_abort(struct adapter *adapter);
extern int rtw_restruct_sec_ie(struct adapter *adapter,u8 *in_ie,u8 *out_ie,uint in_len); int rtw_restruct_sec_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie,
extern int rtw_restruct_wmm_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_len, uint initial_out_len); uint in_len);
extern void rtw_init_registrypriv_dev_network(struct adapter *adapter); int rtw_restruct_wmm_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie,
uint in_len, uint initial_out_len);
void rtw_init_registrypriv_dev_network(struct adapter *adapter);
extern void rtw_update_registrypriv_dev_network(struct adapter *adapter); void rtw_update_registrypriv_dev_network(struct adapter *adapter);
extern void rtw_get_encrypt_decrypt_from_registrypriv(struct adapter *adapter); void rtw_get_encrypt_decrypt_from_registrypriv(struct adapter *adapter);
extern void _rtw_join_timeout_handler(struct adapter *adapter); void _rtw_join_timeout_handler(struct adapter *adapter);
extern void rtw_scan_timeout_handler(struct adapter *adapter); void rtw_scan_timeout_handler(struct adapter *adapter);
extern void rtw_dynamic_check_timer_handlder(struct adapter *adapter); void rtw_dynamic_check_timer_handlder(struct adapter *adapter);
#define rtw_is_scan_deny(adapter) false #define rtw_is_scan_deny(adapter) false
#define rtw_clear_scan_deny(adapter) do {} while (0) #define rtw_clear_scan_deny(adapter) do {} while (0)
#define rtw_set_scan_deny_timer_hdl(adapter) do {} while (0) #define rtw_set_scan_deny_timer_hdl(adapter) do {} while (0)
#define rtw_set_scan_deny(adapter, ms) do {} while (0) #define rtw_set_scan_deny(adapter, ms) do {} while (0)
extern int _rtw_init_mlme_priv(struct adapter *padapter); int _rtw_init_mlme_priv(struct adapter *padapter);
void rtw_free_mlme_priv_ie_data(struct mlme_priv *pmlmepriv); void rtw_free_mlme_priv_ie_data(struct mlme_priv *pmlmepriv);
extern void _rtw_free_mlme_priv(struct mlme_priv *pmlmepriv); void _rtw_free_mlme_priv(struct mlme_priv *pmlmepriv);
extern int _rtw_enqueue_network(struct __queue *queue, struct wlan_network *pnetwork); int _rtw_enqueue_network(struct __queue *queue, struct wlan_network *pnetwork);
extern struct wlan_network* _rtw_dequeue_network(struct __queue *queue); struct wlan_network *_rtw_dequeue_network(struct __queue *queue);
extern struct wlan_network* _rtw_alloc_network(struct mlme_priv *pmlmepriv); struct wlan_network *_rtw_alloc_network(struct mlme_priv *pmlmepriv);
extern void _rtw_free_network(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwork, u8 isfreeall); void _rtw_free_network(struct mlme_priv *pmlmepriv,
extern void _rtw_free_network_nolock(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwork); struct wlan_network *pnetwork, u8 isfreeall);
void _rtw_free_network_nolock(struct mlme_priv *pmlmepriv,
struct wlan_network *pnetwork);
extern struct wlan_network* _rtw_find_network(struct __queue *scanned_queue, u8 *addr); struct wlan_network* _rtw_find_network(struct __queue *scanned_queue, u8 *addr);
extern void _rtw_free_network_queue(struct adapter* padapter, u8 isfreeall); void _rtw_free_network_queue(struct adapter *padapter, u8 isfreeall);
extern int rtw_if_up(struct adapter *padapter); int rtw_if_up(struct adapter *padapter);
u8 *rtw_get_capability_from_ie(u8 *ie); u8 *rtw_get_capability_from_ie(u8 *ie);
@ -599,9 +638,11 @@ u8 *rtw_get_beacon_interval_from_ie(u8 *ie);
void rtw_joinbss_reset(struct adapter *padapter); void rtw_joinbss_reset(struct adapter *padapter);
unsigned int rtw_restructure_ht_ie(struct adapter *padapter, u8 *in_ie, u8 *out_ie, uint in_len, uint *pout_len); unsigned int rtw_restructure_ht_ie(struct adapter *padapter, u8 *in_ie,
u8 *out_ie, uint in_len, uint *pout_len);
void rtw_update_ht_cap(struct adapter *padapter, u8 *pie, uint ie_len); void rtw_update_ht_cap(struct adapter *padapter, u8 *pie, uint ie_len);
void rtw_issue_addbareq_cmd(struct adapter *padapter, struct xmit_frame *pxmitframe); void rtw_issue_addbareq_cmd(struct adapter *padapter,
struct xmit_frame *pxmitframe);
int rtw_is_same_ibss(struct adapter *adapter, struct wlan_network *pnetwork); int rtw_is_same_ibss(struct adapter *adapter, struct wlan_network *pnetwork);
int is_same_network(struct wlan_bssid_ex *src, struct wlan_bssid_ex *dst); int is_same_network(struct wlan_bssid_ex *src, struct wlan_bssid_ex *dst);
@ -610,4 +651,5 @@ void rtw_roaming(struct adapter *padapter, struct wlan_network *tgt_network);
void _rtw_roaming(struct adapter *padapter, struct wlan_network *tgt_network); void _rtw_roaming(struct adapter *padapter, struct wlan_network *tgt_network);
void rtw_stassoc_hw_rpt(struct adapter *adapter,struct sta_info *psta); void rtw_stassoc_hw_rpt(struct adapter *adapter,struct sta_info *psta);
#endif /* __RTL871X_MLME_H_ */ #endif /* __RTL871X_MLME_H_ */

View file

@ -103,15 +103,13 @@ extern unsigned char P2P_OUI[];
extern unsigned char WMM_INFO_OUI[]; extern unsigned char WMM_INFO_OUI[];
extern unsigned char WMM_PARA_OUI[]; extern unsigned char WMM_PARA_OUI[];
/* */
/* Channel Plan Type. */ /* Channel Plan Type. */
/* Note: */ /* Note: */
/* We just add new channel plan when the new channel plan is different from any of the following */ /* We just add new channel plan when the new channel plan is different
/* channel plan. */ * from any of the following channel plan. */
/* If you just wnat to customize the acitions(scan period or join actions) about one of the channel plan, */ /* If you just wnat to customize the acitions(scan period or join actions)
* about one of the channel plan, */
/* customize them in struct rt_channel_info in the RT_CHANNEL_LIST. */ /* customize them in struct rt_channel_info in the RT_CHANNEL_LIST. */
/* */
enum RT_CHANNEL_DOMAIN { enum RT_CHANNEL_DOMAIN {
/* old channel plan mapping ===== */ /* old channel plan mapping ===== */
RT_CHANNEL_DOMAIN_FCC = 0x00, RT_CHANNEL_DOMAIN_FCC = 0x00,
@ -165,7 +163,7 @@ enum RT_CHANNEL_DOMAIN {
}; };
enum RT_CHANNEL_DOMAIN_2G { enum RT_CHANNEL_DOMAIN_2G {
RT_CHANNEL_DOMAIN_2G_WORLD = 0x00, /* Worldwird 13 */ RT_CHANNEL_DOMAIN_2G_WORLD = 0x00, /* Worldwide 13 */
RT_CHANNEL_DOMAIN_2G_ETSI1 = 0x01, /* Europe */ RT_CHANNEL_DOMAIN_2G_ETSI1 = 0x01, /* Europe */
RT_CHANNEL_DOMAIN_2G_FCC1 = 0x02, /* US */ RT_CHANNEL_DOMAIN_2G_FCC1 = 0x02, /* US */
RT_CHANNEL_DOMAIN_2G_MKK1 = 0x03, /* Japan */ RT_CHANNEL_DOMAIN_2G_MKK1 = 0x03, /* Japan */
@ -178,10 +176,10 @@ enum RT_CHANNEL_DOMAIN_2G {
enum RT_CHANNEL_DOMAIN_5G { enum RT_CHANNEL_DOMAIN_5G {
RT_CHANNEL_DOMAIN_5G_NULL = 0x00, RT_CHANNEL_DOMAIN_5G_NULL = 0x00,
RT_CHANNEL_DOMAIN_5G_ETSI1 = 0x01, /* Europe */ RT_CHANNEL_DOMAIN_5G_ETSI1 = 0x01, /* Europe */
RT_CHANNEL_DOMAIN_5G_ETSI2 = 0x02, /* Australia, New Zealand */ RT_CHANNEL_DOMAIN_5G_ETSI2 = 0x02, /* Australia, NZ */
RT_CHANNEL_DOMAIN_5G_ETSI3 = 0x03, /* Russia */ RT_CHANNEL_DOMAIN_5G_ETSI3 = 0x03, /* Russia */
RT_CHANNEL_DOMAIN_5G_FCC1 = 0x04, /* US */ RT_CHANNEL_DOMAIN_5G_FCC1 = 0x04, /* US */
RT_CHANNEL_DOMAIN_5G_FCC2 = 0x05, /* FCC o/w DFS Channels */ RT_CHANNEL_DOMAIN_5G_FCC2 = 0x05, /* FCC o/w DFS Chan */
RT_CHANNEL_DOMAIN_5G_FCC3 = 0x06, /* India, Mexico */ RT_CHANNEL_DOMAIN_5G_FCC3 = 0x06, /* India, Mexico */
RT_CHANNEL_DOMAIN_5G_FCC4 = 0x07, /* Venezuela */ RT_CHANNEL_DOMAIN_5G_FCC4 = 0x07, /* Venezuela */
RT_CHANNEL_DOMAIN_5G_FCC5 = 0x08, /* China */ RT_CHANNEL_DOMAIN_5G_FCC5 = 0x08, /* China */
@ -201,7 +199,9 @@ enum RT_CHANNEL_DOMAIN_5G {
RT_CHANNEL_DOMAIN_5G_MAX, RT_CHANNEL_DOMAIN_5G_MAX,
}; };
#define rtw_is_channel_plan_valid(chplan) (chplan<RT_CHANNEL_DOMAIN_MAX || chplan == RT_CHANNEL_DOMAIN_REALTEK_DEFINE) #define rtw_is_channel_plan_valid(chplan) \
(chplan < RT_CHANNEL_DOMAIN_MAX || \
chplan == RT_CHANNEL_DOMAIN_REALTEK_DEFINE)
struct rt_channel_plan { struct rt_channel_plan {
unsigned char Channel[MAX_CHANNEL_NUM]; unsigned char Channel[MAX_CHANNEL_NUM];
@ -239,7 +239,7 @@ enum HT_IOT_PEER {
HT_IOT_PEER_CISCO = 6, HT_IOT_PEER_CISCO = 6,
HT_IOT_PEER_MERU = 7, HT_IOT_PEER_MERU = 7,
HT_IOT_PEER_MARVELL = 8, HT_IOT_PEER_MARVELL = 8,
HT_IOT_PEER_REALTEK_SOFTAP = 9,/* peer is RealTek SOFT_AP, by Bohn, 2009.12.17 */ HT_IOT_PEER_REALTEK_SOFTAP = 9,/* peer is RealTek SOFT_AP */
HT_IOT_PEER_SELF_SOFTAP = 10, /* Self is SoftAP */ HT_IOT_PEER_SELF_SOFTAP = 10, /* Self is SoftAP */
HT_IOT_PEER_AIRGO = 11, HT_IOT_PEER_AIRGO = 11,
HT_IOT_PEER_INTEL = 12, HT_IOT_PEER_INTEL = 12,
@ -261,18 +261,17 @@ enum SCAN_STATE {
struct mlme_handler { struct mlme_handler {
unsigned int num; unsigned int num;
char* str; char *str;
unsigned int (*func)(struct adapter *padapter, union recv_frame *precv_frame); unsigned int (*func)(struct adapter *adapt, union recv_frame *frame);
}; };
struct action_handler { struct action_handler {
unsigned int num; unsigned int num;
char* str; char* str;
unsigned int (*func)(struct adapter *padapter, union recv_frame *precv_frame); unsigned int (*func)(struct adapter *adapt, union recv_frame *frame);
}; };
struct ss_res struct ss_res {
{
int state; int state;
int bss_cnt; int bss_cnt;
int channel_idx; int channel_idx;
@ -300,7 +299,10 @@ struct ss_res
#define WIFI_FW_ASSOC_STATE 0x00002000 #define WIFI_FW_ASSOC_STATE 0x00002000
#define WIFI_FW_ASSOC_SUCCESS 0x00004000 #define WIFI_FW_ASSOC_SUCCESS 0x00004000
#define WIFI_FW_LINKING_STATE (WIFI_FW_AUTH_NULL | WIFI_FW_AUTH_STATE | WIFI_FW_AUTH_SUCCESS |WIFI_FW_ASSOC_STATE) #define WIFI_FW_LINKING_STATE (WIFI_FW_AUTH_NULL | \
WIFI_FW_AUTH_STATE | \
WIFI_FW_AUTH_SUCCESS | \
WIFI_FW_ASSOC_STATE)
struct FW_Sta_Info { struct FW_Sta_Info {
struct sta_info *psta; struct sta_info *psta;
@ -315,11 +317,12 @@ struct FW_Sta_Info {
* When one iface acted as AP mode and the other iface is STA mode and scanning, * When one iface acted as AP mode and the other iface is STA mode and scanning,
* it should switch back to AP's operating channel periodically. * it should switch back to AP's operating channel periodically.
* Parameters info: * Parameters info:
* When the driver scanned RTW_SCAN_NUM_OF_CH channels, it would switch back to AP's operating channel for * When the driver scanned RTW_SCAN_NUM_OF_CH channels, it would switch back to
* AP's operating channel for
* RTW_STAY_AP_CH_MILLISECOND * SURVEY_TO milliseconds. * RTW_STAY_AP_CH_MILLISECOND * SURVEY_TO milliseconds.
* Example: * Example:
* For chip supports 2.4G + 5GHz and AP mode is operating in channel 1, * For chip supports 2.4G + 5GHz and AP mode is operating in channel 1,
* RTW_SCAN_NUM_OF_CH is 8, RTW_STAY_AP_CH_MILLISECOND is 3 and SURVEY_TO is 100. * RTW_SCAN_NUM_OF_CH is 8, RTW_STAY_AP_CH_MS is 3 and SURVEY_TO is 100.
* When it's STA mode gets set_scan command, * When it's STA mode gets set_scan command,
* it would * it would
* 1. Doing the scan on channel 1.2.3.4.5.6.7.8 * 1. Doing the scan on channel 1.2.3.4.5.6.7.8
@ -338,7 +341,8 @@ struct mlme_ext_info {
u32 auth_algo; /* 802.11 auth, could be open, shared, auto */ u32 auth_algo; /* 802.11 auth, could be open, shared, auto */
u32 authModeToggle; u32 authModeToggle;
u32 enc_algo;/* encrypt algorithm; */ u32 enc_algo;/* encrypt algorithm; */
u32 key_index; /* this is only valid for legendary wep, 0~3 for key id. */ u32 key_index; /* this is only valid for legacy wep,
* 0~3 for key id. */
u32 iv; u32 iv;
u8 chg_txt[128]; u8 chg_txt[128];
u16 aid; u16 aid;
@ -370,14 +374,18 @@ struct mlme_ext_info {
struct WMM_para_element WMM_param; struct WMM_para_element WMM_param;
struct HT_caps_element HT_caps; struct HT_caps_element HT_caps;
struct HT_info_element HT_info; struct HT_info_element HT_info;
struct wlan_bssid_ex network;/* join network or bss_network, if in ap mode, it is the same to cur_network.network */ struct wlan_bssid_ex network;/* join network or bss_network,
* if in ap mode, it is the same
* as cur_network.network */
struct FW_Sta_Info FW_sta_info[NUM_STA]; struct FW_Sta_Info FW_sta_info[NUM_STA];
}; };
/* The channel information about this channel including joining, scanning, and power constraints. */ /* The channel information about this channel including joining,
* scanning, and power constraints. */
struct rt_channel_info { struct rt_channel_info {
u8 ChannelNum; /* The channel number. */ u8 ChannelNum; /* The channel number. */
enum rt_scan_type ScanType; /* Scan type such as passive or active scan. */ enum rt_scan_type ScanType; /* Scan type such as passive
* or active scan. */
u32 rx_count; u32 rx_count;
}; };
@ -386,7 +394,7 @@ int rtw_ch_set_search_ch(struct rt_channel_info *ch_set, const u32 ch);
/* P2P_MAX_REG_CLASSES - Maximum number of regulatory classes */ /* P2P_MAX_REG_CLASSES - Maximum number of regulatory classes */
#define P2P_MAX_REG_CLASSES 10 #define P2P_MAX_REG_CLASSES 10
/* P2P_MAX_REG_CLASS_CHANNELS - Maximum number of channels per regulatory class */ /* P2P_MAX_REG_CLASS_CHANNELS - Maximum number of chan per regulatory class */
#define P2P_MAX_REG_CLASS_CHANNELS 20 #define P2P_MAX_REG_CLASS_CHANNELS 20
/* struct p2p_channels - List of supported channels */ /* struct p2p_channels - List of supported channels */
@ -413,24 +421,22 @@ struct p2p_oper_class_map {
u8 min_chan; u8 min_chan;
u8 max_chan; u8 max_chan;
u8 inc; u8 inc;
enum { BW20, BW40PLUS, BW40MINUS } bw; enum {BW20, BW40PLUS, BW40MINUS} bw;
}; };
struct mlme_ext_priv struct mlme_ext_priv {
{
struct adapter *padapter; struct adapter *padapter;
u8 mlmeext_init; u8 mlmeext_init;
ATOMIC_T event_seq; ATOMIC_T event_seq;
u16 mgnt_seq; u16 mgnt_seq;
/* struct fw_priv fwpriv; */
unsigned char cur_channel; unsigned char cur_channel;
unsigned char cur_bwmode; unsigned char cur_bwmode;
unsigned char cur_ch_offset;/* PRIME_CHNL_OFFSET */ unsigned char cur_ch_offset;/* PRIME_CHNL_OFFSET */
unsigned char cur_wireless_mode; /* NETWORK_TYPE */ unsigned char cur_wireless_mode; /* NETWORK_TYPE */
unsigned char oper_channel; /* saved channel info when call set_channel_bw */ unsigned char oper_channel; /* saved chan info when call
* set_channel_bw */
unsigned char oper_bwmode; unsigned char oper_bwmode;
unsigned char oper_ch_offset;/* PRIME_CHNL_OFFSET */ unsigned char oper_ch_offset;/* PRIME_CHNL_OFFSET */
@ -441,8 +447,10 @@ struct mlme_ext_priv
unsigned char datarate[NumRates]; unsigned char datarate[NumRates];
struct ss_res sitesurvey_res; struct ss_res sitesurvey_res;
struct mlme_ext_info mlmext_info;/* for sta/adhoc mode, including current scanning/connecting/connected related info. */ struct mlme_ext_info mlmext_info;/* for sta/adhoc mode, including
/* for ap mode, network includes ap's cap_info */ * current scan/connecting/connected
* related info. For ap mode,
* network includes ap's cap_info*/
struct timer_list survey_timer; struct timer_list survey_timer;
struct timer_list link_timer; struct timer_list link_timer;
u16 chan_scan_time; u16 chan_scan_time;
@ -457,7 +465,6 @@ struct mlme_ext_priv
#ifdef CONFIG_AP_MODE #ifdef CONFIG_AP_MODE
unsigned char bstart_bss; unsigned char bstart_bss;
#endif #endif
u8 update_channel_plan_by_ap_done; u8 update_channel_plan_by_ap_done;
/* recv_decache check for Action_public frame */ /* recv_decache check for Action_public frame */
u8 action_public_dialog_token; u8 action_public_dialog_token;
@ -465,17 +472,17 @@ struct mlme_ext_priv
u8 active_keep_alive_check; u8 active_keep_alive_check;
}; };
int init_mlme_ext_priv(struct adapter* padapter); int init_mlme_ext_priv(struct adapter *adapter);
int init_hw_mlme_ext(struct adapter *padapter); int init_hw_mlme_ext(struct adapter *padapter);
void free_mlme_ext_priv (struct mlme_ext_priv *pmlmeext); void free_mlme_ext_priv (struct mlme_ext_priv *pmlmeext);
extern void init_mlme_ext_timer(struct adapter *padapter); extern void init_mlme_ext_timer(struct adapter *padapter);
extern void init_addba_retry_timer(struct adapter *padapter, struct sta_info *psta); extern void init_addba_retry_timer(struct adapter *adapt, struct sta_info *sta);
extern struct xmit_frame *alloc_mgtxmitframe(struct xmit_priv *pxmitpriv); extern struct xmit_frame *alloc_mgtxmitframe(struct xmit_priv *pxmitpriv);
unsigned char networktype_to_raid(unsigned char network_type); unsigned char networktype_to_raid(unsigned char network_type);
u8 judge_network_type(struct adapter *padapter, unsigned char *rate, int ratelen); u8 judge_network_type(struct adapter *padapter, unsigned char *rate, int len);
void get_rate_set(struct adapter *padapter, unsigned char *pbssrate, int *bssrate_len); void get_rate_set(struct adapter *padapter, unsigned char *pbssrate, int *len);
void UpdateBrateTbl(struct adapter *padapter,u8 *mBratesOS); void UpdateBrateTbl(struct adapter *padapter, u8 *mBratesOS);
void UpdateBrateTblForSoftAP(u8 *bssrateset, u32 bssratelen); void UpdateBrateTblForSoftAP(u8 *bssrateset, u32 bssratelen);
void Save_DM_Func_Flag(struct adapter *padapter); void Save_DM_Func_Flag(struct adapter *padapter);
@ -491,9 +498,11 @@ void rtw_set_oper_bw(struct adapter *adapter, u8 bw);
u8 rtw_get_oper_choffset(struct adapter *adapter); u8 rtw_get_oper_choffset(struct adapter *adapter);
void rtw_set_oper_choffset(struct adapter *adapter, u8 offset); void rtw_set_oper_choffset(struct adapter *adapter, u8 offset);
void set_channel_bwmode(struct adapter *padapter, unsigned char channel, unsigned char channel_offset, unsigned short bwmode); void set_channel_bwmode(struct adapter *padapter, unsigned char channel,
unsigned char channel_offset, unsigned short bwmode);
void SelectChannel(struct adapter *padapter, unsigned char channel); void SelectChannel(struct adapter *padapter, unsigned char channel);
void SetBWMode(struct adapter *padapter, unsigned short bwmode, unsigned char channel_offset); void SetBWMode(struct adapter *padapter, unsigned short bwmode,
unsigned char channel_offset);
unsigned int decide_wait_for_beacon_timeout(unsigned int bcn_interval); unsigned int decide_wait_for_beacon_timeout(unsigned int bcn_interval);
@ -503,18 +512,19 @@ void clear_cam_entry(struct adapter *padapter, u8 entry);
void invalidate_cam_all(struct adapter *padapter); void invalidate_cam_all(struct adapter *padapter);
void CAM_empty_entry(struct adapter * Adapter, u8 ucIndex); void CAM_empty_entry(struct adapter * Adapter, u8 ucIndex);
int allocate_fw_sta_entry(struct adapter *padapter); int allocate_fw_sta_entry(struct adapter *padapter);
void flush_all_cam_entry(struct adapter *padapter); void flush_all_cam_entry(struct adapter *padapter);
bool IsLegal5GChannel(struct adapter * Adapter, u8 channel); bool IsLegal5GChannel(struct adapter * Adapter, u8 channel);
void site_survey(struct adapter *padapter); void site_survey(struct adapter *padapter);
u8 collect_bss_info(struct adapter *padapter, union recv_frame *precv_frame, struct wlan_bssid_ex *bssid); u8 collect_bss_info(struct adapter *padapter, union recv_frame *precv_frame,
void update_network(struct wlan_bssid_ex *dst, struct wlan_bssid_ex *src, struct adapter * padapter, bool update_ie); struct wlan_bssid_ex *bssid);
void update_network(struct wlan_bssid_ex *dst, struct wlan_bssid_ex *src,
struct adapter *adapter, bool update_ie);
int get_bsstype(unsigned short capability); int get_bsstype(unsigned short capability);
u8* get_my_bssid(struct wlan_bssid_ex *pnetwork); u8 *get_my_bssid(struct wlan_bssid_ex *pnetwork);
u16 get_beacon_interval(struct wlan_bssid_ex *bss); u16 get_beacon_interval(struct wlan_bssid_ex *bss);
int is_client_associated_to_ap(struct adapter *padapter); int is_client_associated_to_ap(struct adapter *padapter);
@ -523,24 +533,26 @@ int is_IBSS_empty(struct adapter *padapter);
unsigned char check_assoc_AP(u8 *pframe, uint len); unsigned char check_assoc_AP(u8 *pframe, uint len);
int WMM_param_handler(struct adapter *padapter, struct ndis_802_11_var_ie * pIE); int WMM_param_handler(struct adapter *padapter, struct ndis_802_11_var_ie *pIE);
void WMMOnAssocRsp(struct adapter *padapter); void WMMOnAssocRsp(struct adapter *padapter);
void HT_caps_handler(struct adapter *padapter, struct ndis_802_11_var_ie * pIE); void HT_caps_handler(struct adapter *padapter, struct ndis_802_11_var_ie *pIE);
void HT_info_handler(struct adapter *padapter, struct ndis_802_11_var_ie * pIE); void HT_info_handler(struct adapter *padapter, struct ndis_802_11_var_ie *pIE);
void HTOnAssocRsp(struct adapter *padapter); void HTOnAssocRsp(struct adapter *padapter);
void ERP_IE_handler(struct adapter *padapter, struct ndis_802_11_var_ie * pIE); void ERP_IE_handler(struct adapter *padapter, struct ndis_802_11_var_ie *pIE);
void VCS_update(struct adapter *padapter, struct sta_info *psta); void VCS_update(struct adapter *padapter, struct sta_info *psta);
void update_beacon_info(struct adapter *padapter, u8 *pframe, uint len, struct sta_info *psta); void update_beacon_info(struct adapter *padapter, u8 *pframe, uint len,
struct sta_info *psta);
int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len); int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len);
void update_IOT_info(struct adapter *padapter); void update_IOT_info(struct adapter *padapter);
void update_capinfo(struct adapter * Adapter, u16 updateCap); void update_capinfo(struct adapter *adapter, u16 updatecap);
void update_wireless_mode(struct adapter * padapter); void update_wireless_mode(struct adapter *padapter);
void update_tx_basic_rate(struct adapter *padapter, u8 modulation); void update_tx_basic_rate(struct adapter *padapter, u8 modulation);
void update_bmc_sta_support_rate(struct adapter *padapter, u32 mac_id); void update_bmc_sta_support_rate(struct adapter *padapter, u32 mac_id);
int update_sta_support_rate(struct adapter *padapter, u8* pvar_ie, uint var_ie_len, int cam_idx); int update_sta_support_rate(struct adapter *padapter, u8 *pvar_ie,
uint var_ie_len, int cam_idx);
/* for sta/adhoc mode */ /* for sta/adhoc mode */
void update_sta_info(struct adapter *padapter, struct sta_info *psta); void update_sta_info(struct adapter *padapter, struct sta_info *psta);
@ -550,85 +562,126 @@ unsigned int update_MSC_rate(struct HT_caps_element *pHT_caps);
void Update_RA_Entry(struct adapter *padapter, u32 mac_id); void Update_RA_Entry(struct adapter *padapter, u32 mac_id);
void set_sta_rate(struct adapter *padapter, struct sta_info *psta); void set_sta_rate(struct adapter *padapter, struct sta_info *psta);
unsigned int receive_disconnect(struct adapter *padapter, unsigned char *MacAddr, unsigned short reason); unsigned int receive_disconnect(struct adapter *padapter,
unsigned char *macaddr, unsigned short reason);
unsigned char get_highest_rate_idx(u32 mask); unsigned char get_highest_rate_idx(u32 mask);
int support_short_GI(struct adapter *padapter, struct HT_caps_element *pHT_caps); int support_short_GI(struct adapter *padapter, struct HT_caps_element *caps);
unsigned int is_ap_in_tkip(struct adapter *padapter); unsigned int is_ap_in_tkip(struct adapter *padapter);
unsigned int is_ap_in_wep(struct adapter *padapter); unsigned int is_ap_in_wep(struct adapter *padapter);
unsigned int should_forbid_n_rate(struct adapter * padapter); unsigned int should_forbid_n_rate(struct adapter *padapter);
void report_join_res(struct adapter *padapter, int res); void report_join_res(struct adapter *padapter, int res);
void report_survey_event(struct adapter *padapter, union recv_frame *precv_frame); void report_survey_event(struct adapter *padapter, union recv_frame *precv_frame);
void report_surveydone_event(struct adapter *padapter); void report_surveydone_event(struct adapter *padapter);
void report_del_sta_event(struct adapter *padapter, unsigned char* MacAddr, unsigned short reason); void report_del_sta_event(struct adapter *padapter,
void report_add_sta_event(struct adapter *padapter, unsigned char* MacAddr, int cam_idx); unsigned char *addr, unsigned short reason);
void report_add_sta_event(struct adapter *padapter, unsigned char* addr,
int cam_idx);
void beacon_timing_control(struct adapter *padapter); void beacon_timing_control(struct adapter *padapter);
extern u8 set_tx_beacon_cmd(struct adapter*padapter); extern u8 set_tx_beacon_cmd(struct adapter*padapter);
unsigned int setup_beacon_frame(struct adapter *padapter, unsigned char *beacon_frame); unsigned int setup_beacon_frame(struct adapter *padapter,
unsigned char *beacon_frame);
void update_mgnt_tx_rate(struct adapter *padapter, u8 rate); void update_mgnt_tx_rate(struct adapter *padapter, u8 rate);
void update_mgntframe_attrib(struct adapter *padapter, struct pkt_attrib *pattrib); void update_mgntframe_attrib(struct adapter *padapter,
struct pkt_attrib *pattrib);
void dump_mgntframe(struct adapter *padapter, struct xmit_frame *pmgntframe); void dump_mgntframe(struct adapter *padapter, struct xmit_frame *pmgntframe);
s32 dump_mgntframe_and_wait(struct adapter *padapter, struct xmit_frame *pmgntframe, int timeout_ms); s32 dump_mgntframe_and_wait(struct adapter *padapter,
s32 dump_mgntframe_and_wait_ack(struct adapter *padapter, struct xmit_frame *pmgntframe); struct xmit_frame *pmgntframe, int timeout_ms);
s32 dump_mgntframe_and_wait_ack(struct adapter *padapter,
struct xmit_frame *pmgntframe);
#ifdef CONFIG_P2P #ifdef CONFIG_P2P
void issue_probersp_p2p(struct adapter *padapter, unsigned char *da); void issue_probersp_p2p(struct adapter *padapter, unsigned char *da);
void issue_p2p_provision_request( struct adapter *padapter, u8* pssid, u8 ussidlen, u8* pdev_raddr); void issue_p2p_provision_request(struct adapter *padapter, u8 *pssid,
void issue_p2p_GO_request(struct adapter *padapter, u8* raddr); u8 ussidlen, u8 *pdev_raddr);
void issue_p2p_GO_request(struct adapter *padapter, u8 *raddr);
void issue_probereq_p2p(struct adapter *padapter, u8 *da); void issue_probereq_p2p(struct adapter *padapter, u8 *da);
int issue_probereq_p2p_ex(struct adapter *adapter, u8 *da, int try_cnt, int wait_ms); int issue_probereq_p2p_ex(struct adapter *adapter, u8 *da, int try_cnt,
void issue_p2p_invitation_response(struct adapter *padapter, u8* raddr, u8 dialogToken, u8 success); int wait_ms);
void issue_p2p_invitation_request(struct adapter *padapter, u8* raddr ); void issue_p2p_invitation_response(struct adapter *padapter, u8 *raddr,
u8 dialogToken, u8 success);
void issue_p2p_invitation_request(struct adapter *padapter, u8* raddr);
#endif /* CONFIG_P2P */ #endif /* CONFIG_P2P */
void issue_beacon(struct adapter *padapter, int timeout_ms); void issue_beacon(struct adapter *padapter, int timeout_ms);
void issue_probersp(struct adapter *padapter, unsigned char *da, u8 is_valid_p2p_probereq); void issue_probersp(struct adapter *padapter, unsigned char *da,
u8 is_valid_p2p_probereq);
void issue_assocreq(struct adapter *padapter); void issue_assocreq(struct adapter *padapter);
void issue_asocrsp(struct adapter *padapter, unsigned short status, struct sta_info *pstat, int pkt_type); void issue_asocrsp(struct adapter *padapter, unsigned short status,
void issue_auth(struct adapter *padapter, struct sta_info *psta, unsigned short status); struct sta_info *pstat, int pkt_type);
void issue_probereq(struct adapter *padapter, struct ndis_802_11_ssid *pssid, u8 *da); void issue_auth(struct adapter *padapter, struct sta_info *psta,
s32 issue_probereq_ex(struct adapter *padapter, struct ndis_802_11_ssid *pssid, u8* da, int try_cnt, int wait_ms); unsigned short status);
int issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned int power_mode, int try_cnt, int wait_ms); void issue_probereq(struct adapter *padapter, struct ndis_802_11_ssid *pssid,
int issue_qos_nulldata(struct adapter *padapter, unsigned char *da, u16 tid, int try_cnt, int wait_ms); u8 *da);
int issue_deauth(struct adapter *padapter, unsigned char *da, unsigned short reason); s32 issue_probereq_ex(struct adapter *adapter, struct ndis_802_11_ssid *pssid,
int issue_deauth_ex(struct adapter *padapter, u8 *da, unsigned short reason, int try_cnt, int wait_ms); u8* da, int try_cnt, int wait_ms);
void issue_action_spct_ch_switch (struct adapter *padapter, u8 *ra, u8 new_ch, u8 ch_offset); int issue_nulldata(struct adapter *padapter, unsigned char *da,
void issue_action_BA(struct adapter *padapter, unsigned char *raddr, unsigned char action, unsigned short status); unsigned int power_mode, int try_cnt, int wait_ms);
int issue_qos_nulldata(struct adapter *padapter, unsigned char *da,
u16 tid, int try_cnt, int wait_ms);
int issue_deauth(struct adapter *padapter, unsigned char *da,
unsigned short reason);
int issue_deauth_ex(struct adapter *padapter, u8 *da, unsigned short reason,
int try_cnt, int wait_ms);
void issue_action_spct_ch_switch(struct adapter *padapter, u8 *ra, u8 new_ch,
u8 ch_offset);
void issue_action_BA(struct adapter *padapter, unsigned char *raddr,
unsigned char action, unsigned short status);
unsigned int send_delba(struct adapter *padapter, u8 initiator, u8 *addr); unsigned int send_delba(struct adapter *padapter, u8 initiator, u8 *addr);
unsigned int send_beacon(struct adapter *padapter); unsigned int send_beacon(struct adapter *padapter);
void start_clnt_assoc(struct adapter *padapter); void start_clnt_assoc(struct adapter *padapter);
void start_clnt_auth(struct adapter* padapter); void start_clnt_auth(struct adapter *padapter);
void start_clnt_join(struct adapter* padapter); void start_clnt_join(struct adapter *padapter);
void start_create_ibss(struct adapter* padapter); void start_create_ibss(struct adapter *padapter);
unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame); unsigned int OnAssocReq(struct adapter *padapter,
unsigned int OnAssocRsp(struct adapter *padapter, union recv_frame *precv_frame); union recv_frame *precv_frame);
unsigned int OnProbeReq(struct adapter *padapter, union recv_frame *precv_frame); unsigned int OnAssocRsp(struct adapter *padapter,
unsigned int OnProbeRsp(struct adapter *padapter, union recv_frame *precv_frame); union recv_frame *precv_frame);
unsigned int DoReserved(struct adapter *padapter, union recv_frame *precv_frame); unsigned int OnProbeReq(struct adapter *padapter,
unsigned int OnBeacon(struct adapter *padapter, union recv_frame *precv_frame); union recv_frame *precv_frame);
unsigned int OnAtim(struct adapter *padapter, union recv_frame *precv_frame); unsigned int OnProbeRsp(struct adapter *padapter,
unsigned int OnDisassoc(struct adapter *padapter, union recv_frame *precv_frame); union recv_frame *precv_frame);
unsigned int OnAuth(struct adapter *padapter, union recv_frame *precv_frame); unsigned int DoReserved(struct adapter *padapter,
unsigned int OnAuthClient(struct adapter *padapter, union recv_frame *precv_frame); union recv_frame *precv_frame);
unsigned int OnDeAuth(struct adapter *padapter, union recv_frame *precv_frame); unsigned int OnBeacon(struct adapter *padapter,
unsigned int OnAction(struct adapter *padapter, union recv_frame *precv_frame); union recv_frame *precv_frame);
unsigned int OnAtim(struct adapter *padapter,
unsigned int on_action_spct(struct adapter *padapter, union recv_frame *precv_frame); union recv_frame *precv_frame);
unsigned int OnAction_qos(struct adapter *padapter, union recv_frame *precv_frame); unsigned int OnDisassoc(struct adapter *padapter,
unsigned int OnAction_dls(struct adapter *padapter, union recv_frame *precv_frame); union recv_frame *precv_frame);
unsigned int OnAction_back(struct adapter *padapter, union recv_frame *precv_frame); unsigned int OnAuth(struct adapter *padapter,
unsigned int on_action_public(struct adapter *padapter, union recv_frame *precv_frame); union recv_frame *precv_frame);
unsigned int OnAction_ht(struct adapter *padapter, union recv_frame *precv_frame); unsigned int OnAuthClient(struct adapter *padapter,
unsigned int OnAction_wmm(struct adapter *padapter, union recv_frame *precv_frame); union recv_frame *precv_frame);
unsigned int OnAction_p2p(struct adapter *padapter, union recv_frame *precv_frame); unsigned int OnDeAuth(struct adapter *padapter,
union recv_frame *precv_frame);
unsigned int OnAction(struct adapter *padapter,
union recv_frame *precv_frame);
unsigned int on_action_spct(struct adapter *padapter,
union recv_frame *precv_frame);
unsigned int OnAction_qos(struct adapter *padapter,
union recv_frame *precv_frame);
unsigned int OnAction_dls(struct adapter *padapter,
union recv_frame *precv_frame);
unsigned int OnAction_back(struct adapter *padapter,
union recv_frame *precv_frame);
unsigned int on_action_public(struct adapter *padapter,
union recv_frame *precv_frame);
unsigned int OnAction_ht(struct adapter *padapter,
union recv_frame *precv_frame);
unsigned int OnAction_wmm(struct adapter *padapter,
union recv_frame *precv_frame);
unsigned int OnAction_p2p(struct adapter *padapter,
union recv_frame *precv_frame);
void mlmeext_joinbss_event_callback(struct adapter *padapter, int join_res); void mlmeext_joinbss_event_callback(struct adapter *padapter, int join_res);
void mlmeext_sta_del_event_callback(struct adapter *padapter); void mlmeext_sta_del_event_callback(struct adapter *padapter);
void mlmeext_sta_add_event_callback(struct adapter *padapter, struct sta_info *psta); void mlmeext_sta_add_event_callback(struct adapter *padapter,
struct sta_info *psta);
void linked_status_chk(struct adapter *padapter); void linked_status_chk(struct adapter *padapter);
@ -646,20 +699,19 @@ void addba_timer_hdl(struct sta_info *psta);
_set_timer(&(mlmeext)->link_timer, (ms)); \ _set_timer(&(mlmeext)->link_timer, (ms)); \
} while (0) } while (0)
extern int cckrates_included(unsigned char *rate, int ratelen); int cckrates_included(unsigned char *rate, int ratelen);
extern int cckratesonly_included(unsigned char *rate, int ratelen); int cckratesonly_included(unsigned char *rate, int ratelen);
extern void process_addba_req(struct adapter *padapter, u8 *paddba_req, u8 *addr); void process_addba_req(struct adapter *padapter, u8 *paddba_req, u8 *addr);
extern void update_TSF(struct mlme_ext_priv *pmlmeext, u8 *pframe, uint len); void update_TSF(struct mlme_ext_priv *pmlmeext, u8 *pframe, uint len);
extern void correct_TSF(struct adapter *padapter, struct mlme_ext_priv *pmlmeext); void correct_TSF(struct adapter *padapter, struct mlme_ext_priv *pmlmeext);
struct cmd_hdl { struct cmd_hdl {
uint parmsize; uint parmsize;
u8 (*h2cfuns)(struct adapter *padapter, u8 *pbuf); u8 (*h2cfuns)(struct adapter *padapter, u8 *pbuf);
}; };
u8 read_macreg_hdl(struct adapter *padapter, u8 *pbuf); u8 read_macreg_hdl(struct adapter *padapter, u8 *pbuf);
u8 write_macreg_hdl(struct adapter *padapter, u8 *pbuf); u8 write_macreg_hdl(struct adapter *padapter, u8 *pbuf);
u8 read_bbreg_hdl(struct adapter *padapter, u8 *pbuf); u8 read_bbreg_hdl(struct adapter *padapter, u8 *pbuf);
@ -685,17 +737,16 @@ u8 tx_beacon_hdl(struct adapter *padapter, unsigned char *pbuf);
u8 set_ch_hdl(struct adapter *padapter, u8 *pbuf); u8 set_ch_hdl(struct adapter *padapter, u8 *pbuf);
u8 set_chplan_hdl(struct adapter *padapter, unsigned char *pbuf); u8 set_chplan_hdl(struct adapter *padapter, unsigned char *pbuf);
u8 led_blink_hdl(struct adapter *padapter, unsigned char *pbuf); u8 led_blink_hdl(struct adapter *padapter, unsigned char *pbuf);
u8 set_csa_hdl(struct adapter *padapter, unsigned char *pbuf); /* Kurt: Handling DFS channel switch announcement ie. */ /* Handling DFS channel switch announcement ie. */
u8 set_csa_hdl(struct adapter *padapter, unsigned char *pbuf);
u8 tdls_hdl(struct adapter *padapter, unsigned char *pbuf); u8 tdls_hdl(struct adapter *padapter, unsigned char *pbuf);
#define GEN_DRV_CMD_HANDLER(size, cmd) {size, &cmd ## _hdl}, #define GEN_DRV_CMD_HANDLER(size, cmd) {size, &cmd ## _hdl},
#define GEN_MLME_EXT_HANDLER(size, cmd) {size, cmd}, #define GEN_MLME_EXT_HANDLER(size, cmd) {size, cmd},
#ifdef _RTW_CMD_C_ #ifdef _RTW_CMD_C_
static struct cmd_hdl wlancmds[] = static struct cmd_hdl wlancmds[] = {
{
GEN_DRV_CMD_HANDLER(0, NULL) /*0*/ GEN_DRV_CMD_HANDLER(0, NULL) /*0*/
GEN_DRV_CMD_HANDLER(0, NULL) GEN_DRV_CMD_HANDLER(0, NULL)
GEN_DRV_CMD_HANDLER(0, NULL) GEN_DRV_CMD_HANDLER(0, NULL)
@ -714,7 +765,8 @@ static struct cmd_hdl wlancmds[] =
GEN_MLME_EXT_HANDLER(sizeof (struct disconnect_parm), disconnect_hdl) GEN_MLME_EXT_HANDLER(sizeof (struct disconnect_parm), disconnect_hdl)
GEN_MLME_EXT_HANDLER(sizeof (struct createbss_parm), createbss_hdl) GEN_MLME_EXT_HANDLER(sizeof (struct createbss_parm), createbss_hdl)
GEN_MLME_EXT_HANDLER(sizeof (struct setopmode_parm), setopmode_hdl) GEN_MLME_EXT_HANDLER(sizeof (struct setopmode_parm), setopmode_hdl)
GEN_MLME_EXT_HANDLER(sizeof (struct sitesurvey_parm), sitesurvey_cmd_hdl) /*18*/ GEN_MLME_EXT_HANDLER(sizeof (struct sitesurvey_parm),
sitesurvey_cmd_hdl) /*18*/
GEN_MLME_EXT_HANDLER(sizeof (struct setauth_parm), setauth_hdl) GEN_MLME_EXT_HANDLER(sizeof (struct setauth_parm), setauth_hdl)
GEN_MLME_EXT_HANDLER(sizeof (struct setkey_parm), setkey_hdl) /*20*/ GEN_MLME_EXT_HANDLER(sizeof (struct setkey_parm), setkey_hdl) /*20*/
GEN_MLME_EXT_HANDLER(sizeof (struct set_stakey_parm), set_stakey_hdl) GEN_MLME_EXT_HANDLER(sizeof (struct set_stakey_parm), set_stakey_hdl)
@ -751,52 +803,44 @@ static struct cmd_hdl wlancmds[] =
GEN_MLME_EXT_HANDLER(0, NULL) GEN_MLME_EXT_HANDLER(0, NULL)
GEN_MLME_EXT_HANDLER(0, NULL) GEN_MLME_EXT_HANDLER(0, NULL)
GEN_MLME_EXT_HANDLER(0, NULL) GEN_MLME_EXT_HANDLER(0, NULL)
GEN_MLME_EXT_HANDLER(sizeof(struct Tx_Beacon_param), tx_beacon_hdl) /*55*/ GEN_MLME_EXT_HANDLER(sizeof(struct Tx_Beacon_param),
tx_beacon_hdl) /*55*/
GEN_MLME_EXT_HANDLER(0, mlme_evt_hdl) /*56*/ GEN_MLME_EXT_HANDLER(0, mlme_evt_hdl) /*56*/
GEN_MLME_EXT_HANDLER(0, rtw_drvextra_cmd_hdl) /*57*/ GEN_MLME_EXT_HANDLER(0, rtw_drvextra_cmd_hdl) /*57*/
GEN_MLME_EXT_HANDLER(0, h2c_msg_hdl) /*58*/ GEN_MLME_EXT_HANDLER(0, h2c_msg_hdl) /*58*/
GEN_MLME_EXT_HANDLER(sizeof(struct SetChannelPlan_param), set_chplan_hdl) /*59*/ GEN_MLME_EXT_HANDLER(sizeof(struct SetChannelPlan_param),
GEN_MLME_EXT_HANDLER(sizeof(struct LedBlink_param), led_blink_hdl) /*60*/ set_chplan_hdl) /*59*/
GEN_MLME_EXT_HANDLER(sizeof(struct LedBlink_param),
led_blink_hdl) /*60*/
GEN_MLME_EXT_HANDLER(sizeof(struct SetChannelSwitch_param), set_csa_hdl) /*61*/ GEN_MLME_EXT_HANDLER(sizeof(struct SetChannelSwitch_param),
GEN_MLME_EXT_HANDLER(sizeof(struct TDLSoption_param), tdls_hdl) /*62*/ set_csa_hdl) /*61*/
GEN_MLME_EXT_HANDLER(sizeof(struct TDLSoption_param),
tdls_hdl) /*62*/
}; };
#endif #endif
struct C2HEvent_Header struct C2HEvent_Header {
{
#ifdef __LITTLE_ENDIAN #ifdef __LITTLE_ENDIAN
unsigned int len:16; unsigned int len:16;
unsigned int ID:8; unsigned int ID:8;
unsigned int seq:8; unsigned int seq:8;
#elif defined(__BIG_ENDIAN) #elif defined(__BIG_ENDIAN)
unsigned int seq:8; unsigned int seq:8;
unsigned int ID:8; unsigned int ID:8;
unsigned int len:16; unsigned int len:16;
#else
# error "Must be LITTLE or BIG Endian"
#endif #endif
unsigned int rsvd; unsigned int rsvd;
}; };
void rtw_dummy_event_callback(struct adapter *adapter , u8 *pbuf); void rtw_dummy_event_callback(struct adapter *adapter, u8 *pbuf);
void rtw_fwdbg_event_callback(struct adapter *adapter , u8 *pbuf); void rtw_fwdbg_event_callback(struct adapter *adapter, u8 *pbuf);
enum rtw_c2h_event enum rtw_c2h_event {
{ GEN_EVT_CODE(_Read_MACREG) = 0, /*0*/
GEN_EVT_CODE(_Read_MACREG)=0, /*0*/
GEN_EVT_CODE(_Read_BBREG), GEN_EVT_CODE(_Read_BBREG),
GEN_EVT_CODE(_Read_RFREG), GEN_EVT_CODE(_Read_RFREG),
GEN_EVT_CODE(_Read_EEPROM), GEN_EVT_CODE(_Read_EEPROM),
@ -810,7 +854,7 @@ enum rtw_c2h_event
GEN_EVT_CODE(_JoinBss) , /*10*/ GEN_EVT_CODE(_JoinBss) , /*10*/
GEN_EVT_CODE(_AddSTA), GEN_EVT_CODE(_AddSTA),
GEN_EVT_CODE(_DelSTA), GEN_EVT_CODE(_DelSTA),
GEN_EVT_CODE(_AtimDone) , GEN_EVT_CODE(_AtimDone),
GEN_EVT_CODE(_TX_Report), GEN_EVT_CODE(_TX_Report),
GEN_EVT_CODE(_CCX_Report), /*15*/ GEN_EVT_CODE(_CCX_Report), /*15*/
GEN_EVT_CODE(_DTM_Report), GEN_EVT_CODE(_DTM_Report),
@ -821,15 +865,15 @@ enum rtw_c2h_event
GEN_EVT_CODE(_ADDBA), GEN_EVT_CODE(_ADDBA),
GEN_EVT_CODE(_C2HBCN), GEN_EVT_CODE(_C2HBCN),
GEN_EVT_CODE(_ReportPwrState), /* filen: only for PCIE, USB */ GEN_EVT_CODE(_ReportPwrState), /* filen: only for PCIE, USB */
GEN_EVT_CODE(_CloseRF), /* filen: only for PCIE, work around ASPM */ GEN_EVT_CODE(_CloseRF), /* filen: only for PCIE,
* work around ASPM */
MAX_C2HEVT MAX_C2HEVT
}; };
#ifdef _RTW_MLME_EXT_C_ #ifdef _RTW_MLME_EXT_C_
static struct fwevent wlanevents[] = static struct fwevent wlanevents[] = {
{
{0, rtw_dummy_event_callback}, /*0*/ {0, rtw_dummy_event_callback}, /*0*/
{0, NULL}, {0, NULL},
{0, NULL}, {0, NULL},
@ -839,8 +883,7 @@ static struct fwevent wlanevents[] =
{0, NULL}, {0, NULL},
{0, NULL}, {0, NULL},
{0, &rtw_survey_event_callback}, /*8*/ {0, &rtw_survey_event_callback}, /*8*/
{sizeof (struct surveydone_event), &rtw_surveydone_event_callback}, /*9*/ {sizeof (struct surveydone_event), &rtw_surveydone_event_callback},/*9*/
{0, &rtw_joinbss_event_callback}, /*10*/ {0, &rtw_joinbss_event_callback}, /*10*/
{sizeof(struct stassoc_event), &rtw_stassoc_event_callback}, {sizeof(struct stassoc_event), &rtw_stassoc_event_callback},
{sizeof(struct stadel_event), &rtw_stadel_event_callback}, {sizeof(struct stadel_event), &rtw_stadel_event_callback},

View file

@ -73,12 +73,12 @@
#define NDIS_STATUS_SAP_IN_USE ((int)0xC0010021L) #define NDIS_STATUS_SAP_IN_USE ((int)0xC0010021L)
#define NDIS_STATUS_INVALID_ADDRESS ((int)0xC0010022L) #define NDIS_STATUS_INVALID_ADDRESS ((int)0xC0010022L)
#define NDIS_STATUS_VC_NOT_ACTIVATED ((int)0xC0010023L) #define NDIS_STATUS_VC_NOT_ACTIVATED ((int)0xC0010023L)
#define NDIS_STATUS_DEST_OUT_OF_ORDER ((int)0xC0010024L) /* cause 27 */ #define NDIS_STATUS_DEST_OUT_OF_ORDER ((int)0xC0010024L) /*cause 27*/
#define NDIS_STATUS_VC_NOT_AVAILABLE ((int)0xC0010025L) /* cause 35,45 */ #define NDIS_STATUS_VC_NOT_AVAILABLE ((int)0xC0010025L) /*cause 35,45 */
#define NDIS_STATUS_CELLRATE_NOT_AVAILABLE ((int)0xC0010026L) /* cause 37 */ #define NDIS_STATUS_CELLRATE_NOT_AVAILABLE ((int)0xC0010026L) /*cause 37*/
#define NDIS_STATUS_INCOMPATABLE_QOS ((int)0xC0010027L) /* cause 49 */ #define NDIS_STATUS_INCOMPATABLE_QOS ((int)0xC0010027L) /*cause 49*/
#define NDIS_STATUS_AAL_PARAMS_UNSUPPORTED ((int)0xC0010028L) /* cause 93 */ #define NDIS_STATUS_AAL_PARAMS_UNSUPPORTED ((int)0xC0010028L) /*cause 93*/
#define NDIS_STATUS_NO_ROUTE_TO_DESTINATION ((int)0xC0010029L) /* cause 3 */ #define NDIS_STATUS_NO_ROUTE_TO_DESTINATION ((int)0xC0010029L) /*cause 3 */
enum antenna_path { enum antenna_path {
ANTENNA_NONE = 0x00, ANTENNA_NONE = 0x00,
@ -166,7 +166,8 @@ struct mpt_context {
/* 8190 PCI does not support NDIS_WORK_ITEM. */ /* 8190 PCI does not support NDIS_WORK_ITEM. */
/* Work Item for Mass Production Test. */ /* Work Item for Mass Production Test. */
/* Event used to sync the case unloading driver and MptWorkItem is still in progress. */ /* Event used to sync the case unloading driver and MptWorkItem
* is still in progress. */
/* Indicate a MptWorkItem is scheduled and not yet finished. */ /* Indicate a MptWorkItem is scheduled and not yet finished. */
bool bMptWorkItemInProgress; bool bMptWorkItemInProgress;
/* An instance which implements function and context of MptWorkItem. */ /* An instance which implements function and context of MptWorkItem. */
@ -220,11 +221,6 @@ struct mpt_context {
bool bMptEnableAckCounter; bool bMptEnableAckCounter;
u32 MptAckCounter; u32 MptAckCounter;
/* SD3 Willis For 8192S to save 1T/2T RF table for ACUT Only fro ACUT delete later ~~~! */
/* s8 BufOfLines[2][MAX_LINES_HWCONFIG_TXT][MAX_BYTES_LINE_HWCONFIG_TXT]; */
/* s8 BufOfLines[2][MP_MAX_LINES][MP_MAX_LINES_BYTES]; */
/* s32 RfReadLine[2]; */
u8 APK_bound[2]; /* for APK path A/path B */ u8 APK_bound[2]; /* for APK path A/path B */
bool bMptIndexEven; bool bMptIndexEven;
@ -240,7 +236,6 @@ struct mpt_context {
u8 btInBuf[100]; u8 btInBuf[100];
u32 mptOutLen; u32 mptOutLen;
u8 mptOutBuf[100]; u8 mptOutBuf[100];
}; };
enum { enum {
@ -275,18 +270,17 @@ enum {
MP_NULL, MP_NULL,
}; };
struct mp_priv struct mp_priv {
{
struct adapter *papdater; struct adapter *papdater;
/* Testing Flag */ /* Testing Flag */
u32 mode;/* 0 for normal type packet, 1 for loopback packet (16bytes TXCMD) */ /* 0 for normal type packet, 1 for loopback packet (16bytes TXCMD) */
u32 mode;
u32 prev_fw_state; u32 prev_fw_state;
/* OID cmd handler */ /* OID cmd handler */
struct mp_wiparam workparam; struct mp_wiparam workparam;
/* u8 act_in_progress; */
/* Tx Section */ /* Tx Section */
u8 TID; u8 TID;
@ -425,88 +419,77 @@ enum encry_ctrl_state {
SW_ENCRY_HW_DECRY /* sw encryption & hw decryption */ SW_ENCRY_HW_DECRY /* sw encryption & hw decryption */
}; };
/* */ s32 init_mp_priv(struct adapter *padapter);
/* extern struct mp_xmit_frame *alloc_mp_xmitframe(struct mp_priv *pmp_priv); */ void free_mp_priv(struct mp_priv *pmp_priv);
/* extern int free_mp_xmitframe(struct xmit_priv *pxmitpriv, struct mp_xmit_frame *pmp_xmitframe); */ s32 MPT_InitializeAdapter(struct adapter *padapter, u8 Channel);
void MPT_DeInitAdapter(struct adapter *padapter);
s32 mp_start_test(struct adapter *padapter);
void mp_stop_test(struct adapter *padapter);
extern s32 init_mp_priv(struct adapter * padapter); u32 _read_rfreg(struct adapter *padapter, u8 rfpath, u32 addr, u32 bitmask);
extern void free_mp_priv(struct mp_priv *pmp_priv); void _write_rfreg(struct adapter *padapter, u8 rfpath, u32 addr, u32 bitmask, u32 val);
extern s32 MPT_InitializeAdapter(struct adapter * padapter, u8 Channel);
extern void MPT_DeInitAdapter(struct adapter * padapter);
extern s32 mp_start_test(struct adapter * padapter);
extern void mp_stop_test(struct adapter * padapter);
/* */ u32 read_macreg(struct adapter *padapter, u32 addr, u32 sz);
void write_macreg(struct adapter *padapter, u32 addr, u32 val, u32 sz);
u32 read_bbreg(struct adapter *padapter, u32 addr, u32 bitmask);
void write_bbreg(struct adapter *padapter, u32 addr, u32 bitmask, u32 val);
u32 read_rfreg(struct adapter *padapter, u8 rfpath, u32 addr);
void write_rfreg(struct adapter *padapter, u8 rfpath, u32 addr, u32 val);
extern u32 _read_rfreg(struct adapter * padapter, u8 rfpath, u32 addr, u32 bitmask); void SetChannel(struct adapter *pAdapter);
extern void _write_rfreg(struct adapter * padapter, u8 rfpath, u32 addr, u32 bitmask, u32 val); void SetBandwidth(struct adapter *pAdapter);
void SetTxPower(struct adapter *pAdapter);
void SetAntennaPathPower(struct adapter *pAdapter);
void SetDataRate(struct adapter *pAdapter);
extern u32 read_macreg(struct adapter *padapter, u32 addr, u32 sz); void SetAntenna(struct adapter *pAdapter);
extern void write_macreg(struct adapter *padapter, u32 addr, u32 val, u32 sz);
extern u32 read_bbreg(struct adapter *padapter, u32 addr, u32 bitmask);
extern void write_bbreg(struct adapter *padapter, u32 addr, u32 bitmask, u32 val);
extern u32 read_rfreg(struct adapter * padapter, u8 rfpath, u32 addr);
extern void write_rfreg(struct adapter * padapter, u8 rfpath, u32 addr, u32 val);
extern void SetChannel(struct adapter * pAdapter); s32 SetThermalMeter(struct adapter *pAdapter, u8 target_ther);
extern void SetBandwidth(struct adapter * pAdapter); void GetThermalMeter(struct adapter *pAdapter, u8 *value);
extern void SetTxPower(struct adapter * pAdapter);
extern void SetAntennaPathPower(struct adapter * pAdapter);
extern void SetDataRate(struct adapter * pAdapter);
extern void SetAntenna(struct adapter * pAdapter); void SetContinuousTx(struct adapter *pAdapter, u8 bStart);
void SetSingleCarrierTx(struct adapter *pAdapter, u8 bStart);
void SetSingleToneTx(struct adapter *pAdapter, u8 bStart);
void SetCarrierSuppressionTx(struct adapter *pAdapter, u8 bStart);
void PhySetTxPowerLevel(struct adapter *pAdapter);
extern s32 SetThermalMeter(struct adapter * pAdapter, u8 target_ther); void fill_txdesc_for_mp(struct adapter *padapter, struct tx_desc *ptxdesc);
extern void GetThermalMeter(struct adapter * pAdapter, u8 *value); void SetPacketTx(struct adapter *padapter);
void SetPacketRx(struct adapter *pAdapter, u8 bStartRx);
extern void SetContinuousTx(struct adapter * pAdapter, u8 bStart); void ResetPhyRxPktCount(struct adapter *pAdapter);
extern void SetSingleCarrierTx(struct adapter * pAdapter, u8 bStart); u32 GetPhyRxPktReceived(struct adapter *pAdapter);
extern void SetSingleToneTx(struct adapter * pAdapter, u8 bStart); u32 GetPhyRxPktCRC32Error(struct adapter *pAdapter);
extern void SetCarrierSuppressionTx(struct adapter * pAdapter, u8 bStart);
extern void PhySetTxPowerLevel(struct adapter * pAdapter);
extern void fill_txdesc_for_mp(struct adapter * padapter, struct tx_desc *ptxdesc); s32 SetPowerTracking(struct adapter *padapter, u8 enable);
extern void SetPacketTx(struct adapter * padapter); void GetPowerTracking(struct adapter *padapter, u8 *enable);
extern void SetPacketRx(struct adapter * pAdapter, u8 bStartRx); u32 mp_query_psd(struct adapter *pAdapter, u8 *data);
void Hal_SetAntenna(struct adapter *pAdapter);
extern void ResetPhyRxPktCount(struct adapter * pAdapter); void Hal_SetBandwidth(struct adapter *pAdapter);
extern u32 GetPhyRxPktReceived(struct adapter * pAdapter); void Hal_SetTxPower(struct adapter *pAdapter);
extern u32 GetPhyRxPktCRC32Error(struct adapter * pAdapter); void Hal_SetCarrierSuppressionTx(struct adapter *pAdapter, u8 bStart);
void Hal_SetSingleToneTx(struct adapter *pAdapter, u8 bStart);
extern s32 SetPowerTracking(struct adapter * padapter, u8 enable); void Hal_SetSingleCarrierTx (struct adapter *pAdapter, u8 bStart);
extern void GetPowerTracking(struct adapter * padapter, u8 *enable); void Hal_SetContinuousTx (struct adapter *pAdapter, u8 bStart);
void Hal_SetBandwidth(struct adapter *pAdapter);
extern u32 mp_query_psd(struct adapter * pAdapter, u8 *data); void Hal_SetDataRate(struct adapter *pAdapter);
void Hal_SetChannel(struct adapter *pAdapter);
void Hal_SetAntennaPathPower(struct adapter *pAdapter);
extern void Hal_SetAntenna(struct adapter * pAdapter); s32 Hal_SetThermalMeter(struct adapter *pAdapter, u8 target_ther);
extern void Hal_SetBandwidth(struct adapter * pAdapter); s32 Hal_SetPowerTracking(struct adapter *padapter, u8 enable);
void Hal_GetPowerTracking(struct adapter *padapter, u8 * enable);
extern void Hal_SetTxPower(struct adapter * pAdapter); void Hal_GetThermalMeter(struct adapter *pAdapter, u8 *value);
extern void Hal_SetCarrierSuppressionTx(struct adapter * pAdapter, u8 bStart); void Hal_mpt_SwitchRfSetting(struct adapter *pAdapter);
extern void Hal_SetSingleToneTx ( struct adapter * pAdapter , u8 bStart ); void Hal_MPT_CCKTxPowerAdjust(struct adapter * Adapter, bool bInCH14);
extern void Hal_SetSingleCarrierTx (struct adapter * pAdapter, u8 bStart); void Hal_MPT_CCKTxPowerAdjustbyIndex(struct adapter *pAdapter, bool beven);
extern void Hal_SetContinuousTx (struct adapter * pAdapter, u8 bStart); void Hal_SetCCKTxPower(struct adapter *pAdapter, u8 * TxPower);
extern void Hal_SetBandwidth(struct adapter * pAdapter); void Hal_SetOFDMTxPower(struct adapter *pAdapter, u8 * TxPower);
void Hal_TriggerRFThermalMeter(struct adapter *pAdapter);
extern void Hal_SetDataRate(struct adapter * pAdapter); u8 Hal_ReadRFThermalMeter(struct adapter *pAdapter);
extern void Hal_SetChannel(struct adapter * pAdapter); void Hal_SetCCKContinuousTx(struct adapter *pAdapter, u8 bStart);
extern void Hal_SetAntennaPathPower(struct adapter * pAdapter); void Hal_SetOFDMContinuousTx(struct adapter *pAdapter, u8 bStart);
extern s32 Hal_SetThermalMeter(struct adapter * pAdapter, u8 target_ther); void Hal_ProSetCrystalCap (struct adapter *pAdapter , u32 CrystalCapVal);
extern s32 Hal_SetPowerTracking(struct adapter * padapter, u8 enable); void _rtw_mp_xmit_priv(struct xmit_priv *pxmitpriv);
extern void Hal_GetPowerTracking(struct adapter * padapter, u8 * enable); void MP_PHY_SetRFPathSwitch(struct adapter *pAdapter ,bool bMain);
extern void Hal_GetThermalMeter(struct adapter * pAdapter, u8 *value);
extern void Hal_mpt_SwitchRfSetting(struct adapter * pAdapter);
extern void Hal_MPT_CCKTxPowerAdjust(struct adapter * Adapter, bool bInCH14);
extern void Hal_MPT_CCKTxPowerAdjustbyIndex(struct adapter * pAdapter, bool beven);
extern void Hal_SetCCKTxPower(struct adapter * pAdapter, u8 * TxPower);
extern void Hal_SetOFDMTxPower(struct adapter * pAdapter, u8 * TxPower);
extern void Hal_TriggerRFThermalMeter(struct adapter * pAdapter);
extern u8 Hal_ReadRFThermalMeter(struct adapter * pAdapter);
extern void Hal_SetCCKContinuousTx(struct adapter * pAdapter, u8 bStart);
extern void Hal_SetOFDMContinuousTx(struct adapter * pAdapter, u8 bStart);
extern void Hal_ProSetCrystalCap (struct adapter * pAdapter , u32 CrystalCapVal);
extern void _rtw_mp_xmit_priv(struct xmit_priv *pxmitpriv);
extern void MP_PHY_SetRFPathSwitch(struct adapter * pAdapter ,bool bMain);
#endif /* _RTW_MP_H_ */ #endif /* _RTW_MP_H_ */

View file

@ -79,13 +79,13 @@ int oid_rt_pro_set_tx_power_control_hdl(struct oid_par_priv *poid_par_priv);
/* oid_rtl_seg_81_80_20 */ /* oid_rtl_seg_81_80_20 */
int oid_rt_pro_query_tx_packet_sent_hdl(struct oid_par_priv *poid_par_priv); int oid_rt_pro_query_tx_packet_sent_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_query_rx_packet_received_hdl(struct oid_par_priv *poid_par_priv); int oid_rt_pro_query_rx_packet_received_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_query_rx_packet_crc32_error_hdl(struct oid_par_priv *poid_par_priv); int oid_rt_pro_query_rx_packet_crc32_error_hdl(struct oid_par_priv *par_priv);
int oid_rt_pro_reset_tx_packet_sent_hdl(struct oid_par_priv *poid_par_priv); int oid_rt_pro_reset_tx_packet_sent_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_reset_rx_packet_received_hdl(struct oid_par_priv *poid_par_priv); int oid_rt_pro_reset_rx_packet_received_hdl(struct oid_par_priv *par_priv);
int oid_rt_pro_set_modulation_hdl(struct oid_par_priv *poid_par_priv); int oid_rt_pro_set_modulation_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_set_continuous_tx_hdl(struct oid_par_priv *poid_par_priv); int oid_rt_pro_set_continuous_tx_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_set_single_carrier_tx_hdl(struct oid_par_priv *poid_par_priv); int oid_rt_pro_set_single_carrier_tx_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_set_carrier_suppression_tx_hdl(struct oid_par_priv *poid_par_priv); int oid_rt_pro_set_carrier_suppression_tx_hdl(struct oid_par_priv *par_priv);
int oid_rt_pro_set_single_tone_tx_hdl(struct oid_par_priv *poid_par_priv); int oid_rt_pro_set_single_tone_tx_hdl(struct oid_par_priv *poid_par_priv);
/* oid_rtl_seg_81_87 */ /* oid_rtl_seg_81_87 */
@ -105,7 +105,7 @@ int oid_rt_pro_burst_read_register_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_burst_write_register_hdl(struct oid_par_priv *poid_par_priv); int oid_rt_pro_burst_write_register_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_write_txcmd_hdl(struct oid_par_priv *poid_par_priv); int oid_rt_pro_write_txcmd_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_read16_eeprom_hdl(struct oid_par_priv *poid_par_priv); int oid_rt_pro_read16_eeprom_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_write16_eeprom_hdl (struct oid_par_priv *poid_par_priv); int oid_rt_pro_write16_eeprom_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro8711_wi_poll_hdl(struct oid_par_priv *poid_par_priv); int oid_rt_pro8711_wi_poll_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro8711_pkt_loss_hdl(struct oid_par_priv *poid_par_priv); int oid_rt_pro8711_pkt_loss_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_rd_attrib_mem_hdl(struct oid_par_priv *poid_par_priv); int oid_rt_rd_attrib_mem_hdl(struct oid_par_priv *poid_par_priv);
@ -146,7 +146,7 @@ int oid_rt_pro_set_pkt_test_mode_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_get_thermal_meter_hdl(struct oid_par_priv *poid_par_priv); int oid_rt_get_thermal_meter_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_reset_phy_rx_packet_count_hdl(struct oid_par_priv *poid_par_priv); int oid_rt_reset_phy_rx_packet_count_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_get_phy_rx_packet_received_hdl(struct oid_par_priv *poid_par_priv); int oid_rt_get_phy_rx_packet_received_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_get_phy_rx_packet_crc32_error_hdl(struct oid_par_priv *poid_par_priv); int oid_rt_get_phy_rx_packet_crc32_error_hdl(struct oid_par_priv *par_priv);
int oid_rt_set_power_down_hdl(struct oid_par_priv *poid_par_priv); int oid_rt_set_power_down_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_get_power_mode_hdl(struct oid_par_priv *poid_par_priv); int oid_rt_get_power_mode_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_trigger_gpio_hdl(struct oid_par_priv *poid_par_priv); int oid_rt_pro_trigger_gpio_hdl(struct oid_par_priv *poid_par_priv);
@ -161,17 +161,17 @@ static const struct oid_obj_priv oid_rtl_seg_81_80_00[] = {
{1, &oid_null_function}, /* 0x04 OID_RT_PRO_SET_PREAMBLE */ {1, &oid_null_function}, /* 0x04 OID_RT_PRO_SET_PREAMBLE */
{1, &oid_null_function}, /* 0x05 OID_RT_PRO_SET_SCRAMBLER */ {1, &oid_null_function}, /* 0x05 OID_RT_PRO_SET_SCRAMBLER */
{1, &oid_null_function}, /* 0x06 OID_RT_PRO_SET_FILTER_BB */ {1, &oid_null_function}, /* 0x06 OID_RT_PRO_SET_FILTER_BB */
{1, &oid_null_function}, /* 0x07 OID_RT_PRO_SET_MANUAL_DIVERSITY_BB */ {1, &oid_null_function},/* 0x07 OID_RT_PRO_SET_MANUAL_DIVERSITY_BB */
{1, &oid_rt_pro_set_channel_direct_call_hdl}, /* 0x08 */ {1, &oid_rt_pro_set_channel_direct_call_hdl}, /* 0x08 */
{1, &oid_null_function}, /* 0x09 OID_RT_PRO_SET_SLEEP_MODE_DIRECT_CALL */ {1, &oid_null_function},/* 0x09 OID_RT_PRO_SET_SLEEP_MODE_DIRECT_CALL */
{1, &oid_null_function}, /* 0x0A OID_RT_PRO_SET_WAKE_MODE_DIRECT_CALL */ {1, &oid_null_function},/* 0x0A OID_RT_PRO_SET_WAKE_MODE_DIRECT_CALL */
{1, &oid_rt_pro_set_continuous_tx_hdl}, /* 0x0B OID_RT_PRO_SET_TX_CONTINUOUS_DIRECT_CALL */ {1, &oid_rt_pro_set_continuous_tx_hdl}, /* 0x0B OID_RT_PRO_SET_TX_CONTINUOUS_DIRECT_CALL */
{1, &oid_rt_pro_set_single_carrier_tx_hdl}, /* 0x0C OID_RT_PRO_SET_SINGLE_CARRIER_TX_CONTINUOUS */ {1, &oid_rt_pro_set_single_carrier_tx_hdl},/* 0x0C OID_RT_PRO_SET_SINGLE_CARRIER_TX_CONTINUOUS */
{1, &oid_null_function}, /* 0x0D OID_RT_PRO_SET_TX_ANTENNA_BB */ {1, &oid_null_function}, /* 0x0D OID_RT_PRO_SET_TX_ANTENNA_BB */
{1, &oid_rt_pro_set_antenna_bb_hdl}, /* 0x0E */ {1, &oid_rt_pro_set_antenna_bb_hdl}, /* 0x0E */
{1, &oid_null_function}, /* 0x0F OID_RT_PRO_SET_CR_SCRAMBLER */ {1, &oid_null_function}, /* 0x0F OID_RT_PRO_SET_CR_SCRAMBLER */
{1, &oid_null_function}, /* 0x10 OID_RT_PRO_SET_CR_NEW_FILTER */ {1, &oid_null_function}, /* 0x10 OID_RT_PRO_SET_CR_NEW_FILTER */
{1, &oid_rt_pro_set_tx_power_control_hdl}, /* 0x11 OID_RT_PRO_SET_TX_POWER_CONTROL */ {1, &oid_rt_pro_set_tx_power_control_hdl},/* 0x11 OID_RT_PRO_SET_TX_POWER_CONTROL */
{1, &oid_null_function}, /* 0x12 OID_RT_PRO_SET_CR_TX_CONFIG */ {1, &oid_null_function}, /* 0x12 OID_RT_PRO_SET_CR_TX_CONFIG */
{1, &oid_null_function}, /* 0x13 OID_RT_PRO_GET_TX_POWER_CONTROL */ {1, &oid_null_function}, /* 0x13 OID_RT_PRO_GET_TX_POWER_CONTROL */
{1, &oid_null_function}, /* 0x14 OID_RT_PRO_GET_CR_SIGNAL_QUALITY */ {1, &oid_null_function}, /* 0x14 OID_RT_PRO_GET_CR_SIGNAL_QUALITY */