aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/defs.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/libertas/defs.h')
-rw-r--r--drivers/net/wireless/libertas/defs.h101
1 files changed, 80 insertions, 21 deletions
diff --git a/drivers/net/wireless/libertas/defs.h b/drivers/net/wireless/libertas/defs.h
index 80dd9ea19c8e..4dd43e59bda0 100644
--- a/drivers/net/wireless/libertas/defs.h
+++ b/drivers/net/wireless/libertas/defs.h
@@ -7,14 +7,79 @@
7 7
8#include <linux/spinlock.h> 8#include <linux/spinlock.h>
9 9
10extern unsigned int libertas_debug;
11
12#ifdef CONFIG_LIBERTAS_DEBUG 10#ifdef CONFIG_LIBERTAS_DEBUG
13#define DEBUG 11#define DEBUG
14#define PROC_DEBUG 12#define PROC_DEBUG
15#endif 13#endif
16 14
17#define DRV_NAME "usb8xxx" 15#ifndef DRV_NAME
16#define DRV_NAME "libertas"
17#endif
18
19
20#define LBS_DEB_ENTER 0x00000001
21#define LBS_DEB_LEAVE 0x00000002
22#define LBS_DEB_MAIN 0x00000004
23#define LBS_DEB_NET 0x00000008
24#define LBS_DEB_MESH 0x00000010
25#define LBS_DEB_WEXT 0x00000020
26#define LBS_DEB_IOCTL 0x00000040
27#define LBS_DEB_SCAN 0x00000080
28#define LBS_DEB_ASSOC 0x00000100
29#define LBS_DEB_JOIN 0x00000200
30#define LBS_DEB_11D 0x00000400
31#define LBS_DEB_DEBUGFS 0x00000800
32#define LBS_DEB_ETHTOOL 0x00001000
33#define LBS_DEB_HOST 0x00002000
34#define LBS_DEB_CMD 0x00004000
35#define LBS_DEB_RX 0x00008000
36#define LBS_DEB_TX 0x00010000
37#define LBS_DEB_USB 0x00020000
38#define LBS_DEB_CS 0x00040000
39#define LBS_DEB_FW 0x00080000
40#define LBS_DEB_THREAD 0x00100000
41#define LBS_DEB_HEX 0x00200000
42
43extern unsigned int libertas_debug;
44
45#ifdef DEBUG
46#define LBS_DEB_LL(grp, fmt, args...) \
47do { if ((libertas_debug & (grp)) == (grp)) \
48 printk(KERN_DEBUG DRV_NAME "%s: " fmt, \
49 in_interrupt() ? " (INT)" : "", ## args); } while (0)
50#else
51#define LBS_DEB_LL(grp, fmt, args...) do {} while (0)
52#endif
53
54#define lbs_deb_enter(grp) \
55 LBS_DEB_LL(grp | LBS_DEB_ENTER, "%s():%d enter\n", __FUNCTION__, __LINE__);
56#define lbs_deb_enter_args(grp, fmt, args...) \
57 LBS_DEB_LL(grp | LBS_DEB_ENTER, "%s(" fmt "):%d\n", __FUNCTION__, ## args, __LINE__);
58#define lbs_deb_leave(grp) \
59 LBS_DEB_LL(grp | LBS_DEB_LEAVE, "%s():%d leave\n", __FUNCTION__, __LINE__);
60#define lbs_deb_leave_args(grp, fmt, args...) \
61 LBS_DEB_LL(grp | LBS_DEB_LEAVE, "%s():%d leave, " fmt "\n", \
62 __FUNCTION__, __LINE__, ##args);
63#define lbs_deb_main(fmt, args...) LBS_DEB_LL(LBS_DEB_MAIN, fmt, ##args)
64#define lbs_deb_net(fmt, args...) LBS_DEB_LL(LBS_DEB_NET, fmt, ##args)
65#define lbs_deb_mesh(fmt, args...) LBS_DEB_LL(LBS_DEB_MESH, fmt, ##args)
66#define lbs_deb_wext(fmt, args...) LBS_DEB_LL(LBS_DEB_WEXT, fmt, ##args)
67#define lbs_deb_ioctl(fmt, args...) LBS_DEB_LL(LBS_DEB_IOCTL, fmt, ##args)
68#define lbs_deb_scan(fmt, args...) LBS_DEB_LL(LBS_DEB_SCAN, fmt, ##args)
69#define lbs_deb_assoc(fmt, args...) LBS_DEB_LL(LBS_DEB_ASSOC, fmt, ##args)
70#define lbs_deb_join(fmt, args...) LBS_DEB_LL(LBS_DEB_JOIN, fmt, ##args)
71#define lbs_deb_11d(fmt, args...) LBS_DEB_LL(LBS_DEB_11D, fmt, ##args)
72#define lbs_deb_debugfs(fmt, args...) LBS_DEB_LL(LBS_DEB_DEBUGFS, fmt, ##args)
73#define lbs_deb_ethtool(fmt, args...) LBS_DEB_LL(LBS_DEB_ETHTOOL, fmt, ##args)
74#define lbs_deb_host(fmt, args...) LBS_DEB_LL(LBS_DEB_HOST, fmt, ##args)
75#define lbs_deb_cmd(fmt, args...) LBS_DEB_LL(LBS_DEB_CMD, fmt, ##args)
76#define lbs_deb_rx(fmt, args...) LBS_DEB_LL(LBS_DEB_RX, fmt, ##args)
77#define lbs_deb_tx(fmt, args...) LBS_DEB_LL(LBS_DEB_TX, fmt, ##args)
78#define lbs_deb_fw(fmt, args...) LBS_DEB_LL(LBS_DEB_FW, fmt, ##args)
79#define lbs_deb_usb(fmt, args...) LBS_DEB_LL(LBS_DEB_USB, fmt, ##args)
80#define lbs_deb_usbd(dev, fmt, args...) LBS_DEB_LL(LBS_DEB_USB, "%s:" fmt, (dev)->bus_id, ##args)
81#define lbs_deb_cs(fmt, args...) LBS_DEB_LL(LBS_DEB_CS, fmt, ##args)
82#define lbs_deb_thread(fmt, args...) LBS_DEB_LL(LBS_DEB_THREAD, fmt, ##args)
18 83
19#define lbs_pr_info(format, args...) \ 84#define lbs_pr_info(format, args...) \
20 printk(KERN_INFO DRV_NAME": " format, ## args) 85 printk(KERN_INFO DRV_NAME": " format, ## args)
@@ -24,37 +89,25 @@ extern unsigned int libertas_debug;
24 printk(KERN_ALERT DRV_NAME": " format, ## args) 89 printk(KERN_ALERT DRV_NAME": " format, ## args)
25 90
26#ifdef DEBUG 91#ifdef DEBUG
27#define lbs_pr_debug(level, format, args...) \
28 do { if (libertas_debug >= level) \
29 printk(KERN_INFO DRV_NAME": " format, ##args); } while (0)
30#define lbs_dev_dbg(level, device, format, args...) \
31 lbs_pr_debug(level, "%s: " format, \
32 (device)->bus_id , ## args)
33
34static inline void lbs_dbg_hex(char *prompt, u8 * buf, int len) 92static inline void lbs_dbg_hex(char *prompt, u8 * buf, int len)
35{ 93{
36 int i = 0; 94 int i = 0;
37 95
38 if (!libertas_debug) 96 if (!(libertas_debug & LBS_DEB_HEX))
39 return; 97 return;
40 98
41 printk(KERN_DEBUG "%s: ", prompt); 99 printk(KERN_DEBUG "%s: ", prompt);
42 for (i = 1; i <= len; i++) { 100 for (i = 1; i <= len; i++) {
43 printk(KERN_DEBUG "%02x ", (u8) * buf); 101 printk("%02x ", (u8) * buf);
44 buf++; 102 buf++;
45 } 103 }
46 printk("\n"); 104 printk("\n");
47} 105}
48#else 106#else
49#define lbs_pr_debug(level, format, args...) do {} while (0)
50#define lbs_dev_dbg(level, device, format, args...) do {} while (0)
51#define lbs_dbg_hex(x,y,z) do {} while (0) 107#define lbs_dbg_hex(x,y,z) do {} while (0)
52#endif 108#endif
53 109
54#define ENTER() lbs_pr_debug(1, "Enter: %s, %s:%i\n", \ 110
55 __FUNCTION__, __FILE__, __LINE__)
56#define LEAVE() lbs_pr_debug(1, "Leave: %s, %s:%i\n", \
57 __FUNCTION__, __FILE__, __LINE__)
58 111
59/** Buffer Constants */ 112/** Buffer Constants */
60 113
@@ -74,7 +127,6 @@ static inline void lbs_dbg_hex(char *prompt, u8 * buf, int len)
74#define MRVDRV_NUM_OF_CMD_BUFFER 10 127#define MRVDRV_NUM_OF_CMD_BUFFER 10
75#define MRVDRV_SIZE_OF_CMD_BUFFER (2 * 1024) 128#define MRVDRV_SIZE_OF_CMD_BUFFER (2 * 1024)
76#define MRVDRV_MAX_CHANNEL_SIZE 14 129#define MRVDRV_MAX_CHANNEL_SIZE 14
77#define MRVDRV_MAX_BSSID_LIST 64
78#define MRVDRV_ASSOCIATION_TIME_OUT 255 130#define MRVDRV_ASSOCIATION_TIME_OUT 255
79#define MRVDRV_SNAP_HEADER_LEN 8 131#define MRVDRV_SNAP_HEADER_LEN 8
80 132
@@ -104,6 +156,13 @@ static inline void lbs_dbg_hex(char *prompt, u8 * buf, int len)
104#define MRVDRV_MAX_BEACON_INTERVAL 1000 156#define MRVDRV_MAX_BEACON_INTERVAL 1000
105#define MRVDRV_BEACON_INTERVAL 100 157#define MRVDRV_BEACON_INTERVAL 100
106 158
159/** INT status Bit Definition*/
160#define his_cmddnldrdy 0x01
161#define his_cardevent 0x02
162#define his_cmdupldrdy 0x04
163
164#define SBI_EVENT_CAUSE_SHIFT 3
165
107/** TxPD status */ 166/** TxPD status */
108 167
109/* Station firmware use TxPD status field to report final Tx transmit 168/* Station firmware use TxPD status field to report final Tx transmit
@@ -205,8 +264,6 @@ typedef struct _wlan_adapter wlan_adapter;
205extern const char libertas_driver_version[]; 264extern const char libertas_driver_version[];
206extern u16 libertas_region_code_to_index[MRVDRV_MAX_REGION_CODE]; 265extern u16 libertas_region_code_to_index[MRVDRV_MAX_REGION_CODE];
207 266
208extern u8 libertas_wlan_data_rates[WLAN_SUPPORTED_RATES];
209
210extern u8 libertas_supported_rates[G_SUPPORTED_RATES]; 267extern u8 libertas_supported_rates[G_SUPPORTED_RATES];
211 268
212extern u8 libertas_adhoc_rates_g[G_SUPPORTED_RATES]; 269extern u8 libertas_adhoc_rates_g[G_SUPPORTED_RATES];
@@ -316,6 +373,8 @@ enum SNMP_MIB_VALUE_e {
316/* Default values for fwt commands. */ 373/* Default values for fwt commands. */
317#define FWT_DEFAULT_METRIC 0 374#define FWT_DEFAULT_METRIC 0
318#define FWT_DEFAULT_DIR 1 375#define FWT_DEFAULT_DIR 1
376/* Default Rate, 11Mbps */
377#define FWT_DEFAULT_RATE 3
319#define FWT_DEFAULT_SSN 0xffffffff 378#define FWT_DEFAULT_SSN 0xffffffff
320#define FWT_DEFAULT_DSN 0 379#define FWT_DEFAULT_DSN 0
321#define FWT_DEFAULT_HOPCOUNT 0 380#define FWT_DEFAULT_HOPCOUNT 0