aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/wireless/hostap/hostap_common.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/hostap/hostap_common.h')
-rw-r--r--drivers/net/wireless/hostap/hostap_common.h68
1 files changed, 26 insertions, 42 deletions
diff --git a/drivers/net/wireless/hostap/hostap_common.h b/drivers/net/wireless/hostap/hostap_common.h
index 6f4fa9dc308..4230102ac9e 100644
--- a/drivers/net/wireless/hostap/hostap_common.h
+++ b/drivers/net/wireless/hostap/hostap_common.h
@@ -1,27 +1,11 @@
#ifndef HOSTAP_COMMON_H
#define HOSTAP_COMMON_H
-#define BIT(x) (1 << (x))
-
-#define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]
-#define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x"
-
+#include <linux/types.h>
+#include <linux/if_ether.h>
/* IEEE 802.11 defines */
-/* Information Element IDs */
-#define WLAN_EID_SSID 0
-#define WLAN_EID_SUPP_RATES 1
-#define WLAN_EID_FH_PARAMS 2
-#define WLAN_EID_DS_PARAMS 3
-#define WLAN_EID_CF_PARAMS 4
-#define WLAN_EID_TIM 5
-#define WLAN_EID_IBSS_PARAMS 6
-#define WLAN_EID_CHALLENGE 16
-#define WLAN_EID_RSN 48
-#define WLAN_EID_GENERIC 221
-
-
/* HFA384X Configuration RIDs */
#define HFA384X_RID_CNFPORTTYPE 0xFC00
#define HFA384X_RID_CNFOWNMACADDR 0xFC01
@@ -191,11 +175,11 @@
struct hfa384x_comp_ident
{
- u16 id;
- u16 variant;
- u16 major;
- u16 minor;
-} __attribute__ ((packed));
+ __le16 id;
+ __le16 variant;
+ __le16 major;
+ __le16 minor;
+} __packed;
#define HFA384X_COMP_ID_PRI 0x15
#define HFA384X_COMP_ID_STA 0x1f
@@ -203,34 +187,34 @@ struct hfa384x_comp_ident
struct hfa384x_sup_range
{
- u16 role;
- u16 id;
- u16 variant;
- u16 bottom;
- u16 top;
-} __attribute__ ((packed));
+ __le16 role;
+ __le16 id;
+ __le16 variant;
+ __le16 bottom;
+ __le16 top;
+} __packed;
struct hfa384x_build_id
{
- u16 pri_seq;
- u16 sec_seq;
-} __attribute__ ((packed));
+ __le16 pri_seq;
+ __le16 sec_seq;
+} __packed;
/* FD01 - Download Buffer */
struct hfa384x_rid_download_buffer
{
- u16 page;
- u16 offset;
- u16 length;
-} __attribute__ ((packed));
+ __le16 page;
+ __le16 offset;
+ __le16 length;
+} __packed;
/* BSS connection quality (RID FD43 range, RID FD51 dBm-normalized) */
struct hfa384x_comms_quality {
- u16 comm_qual; /* 0 .. 92 */
- u16 signal_level; /* 27 .. 154 */
- u16 noise_level; /* 27 .. 154 */
-} __attribute__ ((packed));
+ __le16 comm_qual; /* 0 .. 92 */
+ __le16 signal_level; /* 27 .. 154 */
+ __le16 noise_level; /* 27 .. 154 */
+} __packed;
/* netdevice private ioctls (used, e.g., with iwpriv from user space) */
@@ -365,9 +349,9 @@ enum {
#define PRISM2_HOSTAPD_MAX_BUF_SIZE 1024
#define PRISM2_HOSTAPD_RID_HDR_LEN \
-((int) (&((struct prism2_hostapd_param *) 0)->u.rid.data))
+offsetof(struct prism2_hostapd_param, u.rid.data)
#define PRISM2_HOSTAPD_GENERIC_ELEMENT_HDR_LEN \
-((int) (&((struct prism2_hostapd_param *) 0)->u.generic_elem.data))
+offsetof(struct prism2_hostapd_param, u.generic_elem.data)
/* Maximum length for algorithm names (-1 for nul termination) used in ioctl()
*/