aboutsummaryrefslogtreecommitdiff
path: root/at76_usb.h
diff options
context:
space:
mode:
Diffstat (limited to 'at76_usb.h')
-rw-r--r--at76_usb.h234
1 files changed, 117 insertions, 117 deletions
diff --git a/at76_usb.h b/at76_usb.h
index f517621..9980f05 100644
--- a/at76_usb.h
+++ b/at76_usb.h
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2002,2003 Oliver Kurth
- * (c) 2003,2004 Jörg Albert <joerg.albert@gmx.de>
- * (c) 2007 Guido Guenther <agx@sigxcpu.org>
+ * (c) 2003,2004 Jörg Albert <joerg.albert@gmx.de>
+ * (c) 2007 Guido Guenther <agx@sigxcpu.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -25,86 +25,86 @@
#include <net/ieee80211.h>
/* current driver version */
-#define DRIVER_VERSION "0.15dev"
+#define DRIVER_VERSION "0.15dev"
/* our private ioctl's */
/* preamble length (0 - long, 1 - short, 2 - auto) */
-#define AT76_SET_SHORT_PREAMBLE (SIOCIWFIRSTPRIV + 0)
-#define AT76_GET_SHORT_PREAMBLE (SIOCIWFIRSTPRIV + 1)
+#define AT76_SET_SHORT_PREAMBLE (SIOCIWFIRSTPRIV + 0)
+#define AT76_GET_SHORT_PREAMBLE (SIOCIWFIRSTPRIV + 1)
/* which debug channels are enabled */
-#define AT76_SET_DEBUG (SIOCIWFIRSTPRIV + 2)
-#define AT76_GET_DEBUG (SIOCIWFIRSTPRIV + 3)
+#define AT76_SET_DEBUG (SIOCIWFIRSTPRIV + 2)
+#define AT76_GET_DEBUG (SIOCIWFIRSTPRIV + 3)
/* power save mode (incl. the Atmel proprietary smart save mode) */
-#define AT76_SET_POWERSAVE_MODE (SIOCIWFIRSTPRIV + 4)
-#define AT76_GET_POWERSAVE_MODE (SIOCIWFIRSTPRIV + 5)
+#define AT76_SET_POWERSAVE_MODE (SIOCIWFIRSTPRIV + 4)
+#define AT76_GET_POWERSAVE_MODE (SIOCIWFIRSTPRIV + 5)
/* min and max channel times for scan */
-#define AT76_SET_SCAN_TIMES (SIOCIWFIRSTPRIV + 6)
-#define AT76_GET_SCAN_TIMES (SIOCIWFIRSTPRIV + 7)
+#define AT76_SET_SCAN_TIMES (SIOCIWFIRSTPRIV + 6)
+#define AT76_GET_SCAN_TIMES (SIOCIWFIRSTPRIV + 7)
/* scan mode (0 - active, 1 - passive) */
-#define AT76_SET_SCAN_MODE (SIOCIWFIRSTPRIV + 8)
-#define AT76_GET_SCAN_MODE (SIOCIWFIRSTPRIV + 9)
+#define AT76_SET_SCAN_MODE (SIOCIWFIRSTPRIV + 8)
+#define AT76_GET_SCAN_MODE (SIOCIWFIRSTPRIV + 9)
/* international roaming (0 - disabled, 1 - enabled */
-#define AT76_SET_INTL_ROAMING (SIOCIWFIRSTPRIV + 10)
-#define AT76_GET_INTL_ROAMING (SIOCIWFIRSTPRIV + 11)
-
-#define CMD_STATUS_IDLE 0x00
-#define CMD_STATUS_COMPLETE 0x01
-#define CMD_STATUS_UNKNOWN 0x02
-#define CMD_STATUS_INVALID_PARAMETER 0x03
-#define CMD_STATUS_FUNCTION_NOT_SUPPORTED 0x04
-#define CMD_STATUS_TIME_OUT 0x07
-#define CMD_STATUS_IN_PROGRESS 0x08
-#define CMD_STATUS_HOST_FAILURE 0xff
-#define CMD_STATUS_SCAN_FAILED 0xf0
+#define AT76_SET_INTL_ROAMING (SIOCIWFIRSTPRIV + 10)
+#define AT76_GET_INTL_ROAMING (SIOCIWFIRSTPRIV + 11)
+
+#define CMD_STATUS_IDLE 0x00
+#define CMD_STATUS_COMPLETE 0x01
+#define CMD_STATUS_UNKNOWN 0x02
+#define CMD_STATUS_INVALID_PARAMETER 0x03
+#define CMD_STATUS_FUNCTION_NOT_SUPPORTED 0x04
+#define CMD_STATUS_TIME_OUT 0x07
+#define CMD_STATUS_IN_PROGRESS 0x08
+#define CMD_STATUS_HOST_FAILURE 0xff
+#define CMD_STATUS_SCAN_FAILED 0xf0
/* answers to get op mode */
-#define OPMODE_NONE 0x00
-#define OPMODE_NORMAL_NIC_WITH_FLASH 0x01
-#define OPMODE_HW_CONFIG_MODE 0x02
-#define OPMODE_DFU_MODE_WITH_FLASH 0x03
-#define OPMODE_NORMAL_NIC_WITHOUT_FLASH 0x04
-
-#define CMD_SET_MIB 0x01
-#define CMD_GET_MIB 0x02
-#define CMD_SCAN 0x03
-#define CMD_JOIN 0x04
-#define CMD_START_IBSS 0x05
-#define CMD_RADIO 0x06
-#define CMD_STARTUP 0x0B
-#define CMD_GETOPMODE 0x33
-
-#define MIB_LOCAL 0x01
-#define MIB_MAC_ADD 0x02
-#define MIB_MAC 0x03
-#define MIB_MAC_MGMT 0x05
-#define MIB_MAC_WEP 0x06
-#define MIB_PHY 0x07
-#define MIB_FW_VERSION 0x08
-#define MIB_MDOMAIN 0x09
-
-#define ADHOC_MODE 1
-#define INFRASTRUCTURE_MODE 2
+#define OPMODE_NONE 0x00
+#define OPMODE_NORMAL_NIC_WITH_FLASH 0x01
+#define OPMODE_HW_CONFIG_MODE 0x02
+#define OPMODE_DFU_MODE_WITH_FLASH 0x03
+#define OPMODE_NORMAL_NIC_WITHOUT_FLASH 0x04
+
+#define CMD_SET_MIB 0x01
+#define CMD_GET_MIB 0x02
+#define CMD_SCAN 0x03
+#define CMD_JOIN 0x04
+#define CMD_START_IBSS 0x05
+#define CMD_RADIO 0x06
+#define CMD_STARTUP 0x0B
+#define CMD_GETOPMODE 0x33
+
+#define MIB_LOCAL 0x01
+#define MIB_MAC_ADD 0x02
+#define MIB_MAC 0x03
+#define MIB_MAC_MGMT 0x05
+#define MIB_MAC_WEP 0x06
+#define MIB_PHY 0x07
+#define MIB_FW_VERSION 0x08
+#define MIB_MDOMAIN 0x09
+
+#define ADHOC_MODE 1
+#define INFRASTRUCTURE_MODE 2
/* values for struct mib_local, field preamble_type */
-#define PREAMBLE_TYPE_LONG 0
-#define PREAMBLE_TYPE_SHORT 1
-#define PREAMBLE_TYPE_AUTO 2
+#define PREAMBLE_TYPE_LONG 0
+#define PREAMBLE_TYPE_SHORT 1
+#define PREAMBLE_TYPE_AUTO 2
/* values for tx_rate */
-#define TX_RATE_1MBIT 0
-#define TX_RATE_2MBIT 1
-#define TX_RATE_5_5MBIT 2
-#define TX_RATE_11MBIT 3
-#define TX_RATE_AUTO 4
+#define TX_RATE_1MBIT 0
+#define TX_RATE_2MBIT 1
+#define TX_RATE_5_5MBIT 2
+#define TX_RATE_11MBIT 3
+#define TX_RATE_AUTO 4
/* power management modes */
-#define AT76_PM_OFF 1
-#define AT76_PM_ON 2
-#define AT76_PM_SMART 3
+#define AT76_PM_OFF 1
+#define AT76_PM_ON 2
+#define AT76_PM_SMART 3
/* international roaming state */
-#define IR_OFF 0
-#define IR_ON 1
+#define IR_OFF 0
+#define IR_ON 1
struct hwcfg_r505 {
u8 cr39_values[14];
@@ -145,8 +145,8 @@ union at76_hwcfg {
struct hwcfg_r505 r5;
};
-#define WEP_SMALL_KEY_LEN (40/8)
-#define WEP_LARGE_KEY_LEN (104/8)
+#define WEP_SMALL_KEY_LEN (40/8)
+#define WEP_LARGE_KEY_LEN (104/8)
struct at76_card_config {
u8 exclude_unencrypted;
@@ -201,8 +201,8 @@ struct at76_tx_buffer {
} __attribute__ ((packed));
/* defines for scan_type below */
-#define SCAN_TYPE_ACTIVE 0
-#define SCAN_TYPE_PASSIVE 1
+#define SCAN_TYPE_ACTIVE 0
+#define SCAN_TYPE_PASSIVE 1
struct at76_req_scan {
u8 bssid[ETH_ALEN];
@@ -381,19 +381,19 @@ struct reg_domain {
u32 channel_map; /* if bit N is set, channel (N+1) is allowed */
};
-/* how long do we keep a (I)BSS in the bss_list in jiffies
+/* how long do we keep a (I)BSS in the bss_list in jiffies
this should be long enough for the user to retrieve the table
(by iwlist ?) after the device started, because all entries from
other channels than the one the device locks on get removed, too */
-#define BSS_LIST_TIMEOUT (120*HZ)
+#define BSS_LIST_TIMEOUT (120 * HZ)
/* struct to store BSS info found during scan */
-#define BSS_LIST_MAX_RATE_LEN 32 /* 32 rates should be enough ... */
+#define BSS_LIST_MAX_RATE_LEN 32 /* 32 rates should be enough ... */
struct bss_info {
struct list_head list;
u8 bssid[ETH_ALEN]; /* bssid */
- u8 ssid[IW_ESSID_MAX_SIZE + 1]; /* ssid, +1 for trailing \0
+ u8 ssid[IW_ESSID_MAX_SIZE + 1]; /* ssid, +1 for trailing \0
to make it printable */
u8 ssid_len; /* length of ssid above */
u8 channel;
@@ -423,9 +423,9 @@ struct rx_data_buf {
struct sk_buff *skb; /* == NULL if entry is free */
};
-#define NR_RX_DATA_BUF 8
+#define NR_RX_DATA_BUF 8
/* how often do we try to submit a rx urb until giving up */
-#define NR_SUBMIT_RX_TRIES 8
+#define NR_SUBMIT_RX_TRIES 8
/* Data for one loaded firmware file */
struct fwentry {
@@ -506,7 +506,7 @@ struct at76_priv {
the bss_list. It must acquire bss_list_spinlock
before and must not remove curr_bss nor
new_bss ! */
- struct bss_info *curr_bss; /* if istate == AUTH, ASSOC, REASSOC, JOIN or CONN
+ struct bss_info *curr_bss; /* if istate == AUTH, ASSOC, REASSOC, JOIN or CONN
priv->bss[curr_bss] is the currently selected BSS
we operate on */
struct bss_info *new_bss; /* if istate == REASSOC priv->new_bss
@@ -549,7 +549,7 @@ struct at76_priv {
struct at76_card_config card_config;
- int rx_data_fcs_len; /* length of the trailing FCS
+ int rx_data_fcs_len; /* length of the trailing FCS
(0 for fw <= 0.84.x, 4 otherwise) */
/* store rx fragments until complete */
@@ -582,7 +582,7 @@ struct at76_rx_radiotap {
(1 << IEEE80211_RADIOTAP_DB_ANTSIGNAL) | \
(1 << IEEE80211_RADIOTAP_DB_ANTNOISE)
-#define BEACON_MAX_DATA_LENGTH 1500
+#define BEACON_MAX_DATA_LENGTH 1500
#define DISASSOC_FRAME_SIZE \
(AT76_TX_HDRLEN + sizeof(struct ieee80211_disassoc))
@@ -590,83 +590,83 @@ struct at76_rx_radiotap {
/* the maximum size of an AssocReq packet */
#define ASSOCREQ_MAX_SIZE \
(AT76_TX_HDRLEN + sizeof(struct ieee80211_assoc_request) + \
- 1+1+IW_ESSID_MAX_SIZE + 1+1+4)
+ 1 + 1 + IW_ESSID_MAX_SIZE + 1 + 1 + 4)
/* the maximum size of a ReAssocReq packet */
#define REASSOCREQ_MAX_SIZE \
(AT76_TX_HDRLEN + sizeof(struct ieee80211_reassoc_request) + \
- 1+1+IW_ESSID_MAX_SIZE + 1+1+4)
+ 1 + 1 + IW_ESSID_MAX_SIZE + 1 + 1 + 4)
/* for shared secret auth, add the challenge text size */
#define AUTH_FRAME_SIZE (AT76_TX_HDRLEN + sizeof(struct ieee80211_auth))
/* how often do we re-try these packets ? */
-#define AUTH_RETRIES 3
-#define ASSOC_RETRIES 3
-#define DISASSOC_RETRIES 3
+#define AUTH_RETRIES 3
+#define ASSOC_RETRIES 3
+#define DISASSOC_RETRIES 3
/* the beacon timeout in infra mode when we are connected (in seconds) */
-#define BEACON_TIMEOUT 10
+#define BEACON_TIMEOUT 10
/* the interval in ticks we poll if scan is completed */
-#define SCAN_POLL_INTERVAL (HZ/4)
+#define SCAN_POLL_INTERVAL (HZ / 4)
/* the interval in ticks to wait for a command to be completed */
-#define CMD_COMPLETION_TIMEOUT (5 * HZ)
+#define CMD_COMPLETION_TIMEOUT (5 * HZ)
-#define DEF_RTS_THRESHOLD 1536
-#define DEF_FRAG_THRESHOLD 1536
-#define DEF_SHORT_RETRY_LIMIT 8
-#define DEF_CHANNEL 10
+#define DEF_RTS_THRESHOLD 1536
+#define DEF_FRAG_THRESHOLD 1536
+#define DEF_SHORT_RETRY_LIMIT 8
+#define DEF_CHANNEL 10
-#define MAX_RTS_THRESHOLD (MAX_FRAG_THRESHOLD + 1)
+#define MAX_RTS_THRESHOLD (MAX_FRAG_THRESHOLD + 1)
/* the max padding size for tx in bytes (see calc_padding) */
-#define MAX_PADDING_SIZE 53
+#define MAX_PADDING_SIZE 53
/* at76_debug bits */
-#define DBG_PROGRESS 0x00000001 /* progress of scan-join-(auth-assoc)-connected */
-#define DBG_BSS_TABLE 0x00000002 /* show the bss table after scans */
-#define DBG_IOCTL 0x00000004 /* ioctl calls / settings */
-#define DBG_DEVENT 0x00000008 /* at76_devents */
-#define DBG_TX_DATA 0x00000010 /* tx header */
+#define DBG_PROGRESS 0x00000001 /* progress of scan-join-(auth-assoc)-connected */
+#define DBG_BSS_TABLE 0x00000002 /* show the bss table after scans */
+#define DBG_IOCTL 0x00000004 /* ioctl calls / settings */
+#define DBG_DEVENT 0x00000008 /* at76_devents */
+#define DBG_TX_DATA 0x00000010 /* tx header */
#define DBG_TX_DATA_CONTENT 0x00000020 /* tx content */
-#define DBG_TX_MGMT 0x00000040
-#define DBG_RX_DATA 0x00000080 /* rx data header */
+#define DBG_TX_MGMT 0x00000040
+#define DBG_RX_DATA 0x00000080 /* rx data header */
#define DBG_RX_DATA_CONTENT 0x00000100 /* rx data content */
-#define DBG_RX_MGMT 0x00000200 /* rx mgmt header except beacon and probe responses */
-#define DBG_RX_BEACON 0x00000400 /* rx beacon */
-#define DBG_RX_CTRL 0x00000800 /* rx control */
+#define DBG_RX_MGMT 0x00000200 /* rx mgmt header except beacon and probe responses */
+#define DBG_RX_BEACON 0x00000400 /* rx beacon */
+#define DBG_RX_CTRL 0x00000800 /* rx control */
#define DBG_RX_MGMT_CONTENT 0x00001000 /* rx mgmt content */
-#define DBG_RX_FRAGS 0x00002000 /* rx data fragment handling */
-#define DBG_DEVSTART 0x00004000 /* fw download, device start */
-#define DBG_URB 0x00008000 /* rx urb status, ... */
+#define DBG_RX_FRAGS 0x00002000 /* rx data fragment handling */
+#define DBG_DEVSTART 0x00004000 /* fw download, device start */
+#define DBG_URB 0x00008000 /* rx urb status, ... */
#define DBG_RX_ATMEL_HDR 0x00010000 /* the Atmel specific header of each rx packet */
-#define DBG_PROC_ENTRY 0x00020000 /* procedure entries and exits */
-#define DBG_PM 0x00040000 /* power management settings */
-#define DBG_BSS_MATCH 0x00080000 /* show why a certain bss did not match */
-#define DBG_PARAMS 0x00100000 /* show the configured parameters */
+#define DBG_PROC_ENTRY 0x00020000 /* procedure entries and exits */
+#define DBG_PM 0x00040000 /* power management settings */
+#define DBG_BSS_MATCH 0x00080000 /* show why a certain bss did not match */
+#define DBG_PARAMS 0x00100000 /* show the configured parameters */
#define DBG_WAIT_COMPLETE 0x00200000 /* show the wait_completion progress */
#define DBG_RX_FRAGS_SKB 0x00400000 /* show skb header for incoming rx fragments */
#define DBG_BSS_TABLE_RM 0x00800000 /* inform on removal of old bss table entries */
#define DBG_MONITOR_MODE 0x01000000 /* debugs from monitor mode */
-#define DBG_MIB 0x02000000 /* dump all MIBs in startup_device */
-#define DBG_MGMT_TIMER 0x04000000 /* dump mgmt_timer ops */
-#define DBG_WE_EVENTS 0x08000000 /* dump wireless events */
-#define DBG_FW 0x10000000 /* firmware download */
-#define DBG_DFU 0x20000000 /* device firmware upgrade */
+#define DBG_MIB 0x02000000 /* dump all MIBs in startup_device */
+#define DBG_MGMT_TIMER 0x04000000 /* dump mgmt_timer ops */
+#define DBG_WE_EVENTS 0x08000000 /* dump wireless events */
+#define DBG_FW 0x10000000 /* firmware download */
+#define DBG_DFU 0x20000000 /* device firmware upgrade */
-#define DBG_DEFAULTS 0
+#define DBG_DEFAULTS 0
/* Use our own dbg macro */
#define at76_dbg(bits, format, arg...) \
do { \
if (at76_debug & (bits)) \
- printk(KERN_DEBUG DRIVER_NAME ": " format "\n" , ## arg);\
+ printk(KERN_DEBUG DRIVER_NAME ": " format "\n" , ## arg); \
} while (0)
#define at76_assert(x) \
- do {\
+ do { \
if (!(x)) \
- err("%d: assertion " #x " failed", __LINE__);\
+ err("%d: assertion " #x " failed", __LINE__); \
} while (0)
#endif /* _AT76_USB_H */