ahci: add pci quirk for JMB362
[safe/jmp/linux-2.6] / include / linux / wireless.h
index 2864b16..e6827ee 100644 (file)
 
 /***************************** INCLUDES *****************************/
 
-/* This header is used in user-space, therefore need to be sanitised
- * for that purpose. Those includes are usually not compatible with glibc.
- * To know which includes to use in user-space, check iwlib.h. */
-#ifdef __KERNEL__
-#include <linux/types.h>               /* for "caddr_t" et al          */
+#include <linux/types.h>               /* for __u* and __s* typedefs */
 #include <linux/socket.h>              /* for "struct sockaddr" et al  */
 #include <linux/if.h>                  /* for IFNAMSIZ and co... */
-#endif /* __KERNEL__ */
 
 /***************************** VERSION *****************************/
 /*
 #define SIOCIWFIRST    0x8B00
 #define SIOCIWLAST     SIOCIWLASTPRIV          /* 0x8BFF */
 #define IW_IOCTL_IDX(cmd)      ((cmd) - SIOCIWFIRST)
+#define IW_HANDLER(id, func)                   \
+       [IW_IOCTL_IDX(id)] = func
 
 /* Odd : get (world access), even : set (root access) */
 #define IW_IS_SET(cmd) (!((cmd) & 0x1))
 #define IW_AUTH_RX_UNENCRYPTED_EAPOL   8
 #define IW_AUTH_ROAMING_CONTROL                9
 #define IW_AUTH_PRIVACY_INVOKED                10
+#define IW_AUTH_CIPHER_GROUP_MGMT      11
+#define IW_AUTH_MFP                    12
 
 /* IW_AUTH_WPA_VERSION values (bit field) */
 #define IW_AUTH_WPA_VERSION_DISABLED   0x00000001
 #define IW_AUTH_WPA_VERSION_WPA                0x00000002
 #define IW_AUTH_WPA_VERSION_WPA2       0x00000004
 
-/* IW_AUTH_PAIRWISE_CIPHER and IW_AUTH_GROUP_CIPHER values (bit field) */
+/* IW_AUTH_PAIRWISE_CIPHER, IW_AUTH_GROUP_CIPHER, and IW_AUTH_CIPHER_GROUP_MGMT
+ * values (bit field) */
 #define IW_AUTH_CIPHER_NONE    0x00000001
 #define IW_AUTH_CIPHER_WEP40   0x00000002
 #define IW_AUTH_CIPHER_TKIP    0x00000004
 #define IW_AUTH_CIPHER_CCMP    0x00000008
 #define IW_AUTH_CIPHER_WEP104  0x00000010
+#define IW_AUTH_CIPHER_AES_CMAC        0x00000020
 
 /* IW_AUTH_KEY_MGMT values (bit field) */
 #define IW_AUTH_KEY_MGMT_802_1X        1
 #define IW_AUTH_ROAMING_DISABLE        1       /* user space program used for roaming
                                         * control */
 
+/* IW_AUTH_MFP (management frame protection) values */
+#define IW_AUTH_MFP_DISABLED   0       /* MFP disabled */
+#define IW_AUTH_MFP_OPTIONAL   1       /* MFP optional */
+#define IW_AUTH_MFP_REQUIRED   2       /* MFP required */
+
 /* SIOCSIWENCODEEXT definitions */
 #define IW_ENCODE_SEQ_MAX_SIZE 8
 /* struct iw_encode_ext ->alg */
 #define IW_ENCODE_ALG_WEP      1
 #define IW_ENCODE_ALG_TKIP     2
 #define IW_ENCODE_ALG_CCMP     3
+#define IW_ENCODE_ALG_PMK      4
+#define IW_ENCODE_ALG_AES_CMAC 5
 /* struct iw_encode_ext ->ext_flags */
 #define IW_ENCODE_EXT_TX_SEQ_VALID     0x00000001
 #define IW_ENCODE_EXT_RX_SEQ_VALID     0x00000002
 #define IW_ENC_CAPA_WPA2       0x00000002
 #define IW_ENC_CAPA_CIPHER_TKIP        0x00000004
 #define IW_ENC_CAPA_CIPHER_CCMP        0x00000008
+#define IW_ENC_CAPA_4WAY_HANDSHAKE     0x00000010
 
 /* Event capability macros - in (struct iw_range *)->event_capa
  * Because we have more than 32 possible events, we use an array of
  * 32 bit bitmasks. Note : 32 bits = 0x20 = 2^5. */
 #define IW_EVENT_CAPA_BASE(cmd)                ((cmd >= SIOCIWFIRSTPRIV) ? \
                                         (cmd - SIOCIWFIRSTPRIV + 0x60) : \
-                                        (cmd - SIOCSIWCOMMIT))
+                                        (cmd - SIOCIWFIRST))
 #define IW_EVENT_CAPA_INDEX(cmd)       (IW_EVENT_CAPA_BASE(cmd) >> 5)
 #define IW_EVENT_CAPA_MASK(cmd)                (1 << (IW_EVENT_CAPA_BASE(cmd) & 0x1F))
 /* Event capability constants - event autogenerated by the kernel
@@ -680,6 +689,19 @@ struct     iw_point
   __u16                flags;          /* Optional params */
 };
 
+#ifdef __KERNEL__
+#ifdef CONFIG_COMPAT
+
+#include <linux/compat.h>
+
+struct compat_iw_point {
+       compat_caddr_t pointer;
+       __u16 length;
+       __u16 flags;
+};
+#endif
+#endif
+
 /*
  *     A frequency
  *     For numbers lower than 10^9, we encode the number in 'm' and
@@ -1103,6 +1125,29 @@ struct iw_event
 #define IW_EV_POINT_LEN        (IW_EV_LCP_LEN + sizeof(struct iw_point) - \
                         IW_EV_POINT_OFF)
 
+#ifdef __KERNEL__
+#ifdef CONFIG_COMPAT
+struct __compat_iw_event {
+       __u16           len;                    /* Real length of this stuff */
+       __u16           cmd;                    /* Wireless IOCTL */
+       compat_caddr_t  pointer;
+};
+#define IW_EV_COMPAT_LCP_LEN offsetof(struct __compat_iw_event, pointer)
+#define IW_EV_COMPAT_POINT_OFF offsetof(struct compat_iw_point, length)
+
+/* Size of the various events for compat */
+#define IW_EV_COMPAT_CHAR_LEN  (IW_EV_COMPAT_LCP_LEN + IFNAMSIZ)
+#define IW_EV_COMPAT_UINT_LEN  (IW_EV_COMPAT_LCP_LEN + sizeof(__u32))
+#define IW_EV_COMPAT_FREQ_LEN  (IW_EV_COMPAT_LCP_LEN + sizeof(struct iw_freq))
+#define IW_EV_COMPAT_PARAM_LEN (IW_EV_COMPAT_LCP_LEN + sizeof(struct iw_param))
+#define IW_EV_COMPAT_ADDR_LEN  (IW_EV_COMPAT_LCP_LEN + sizeof(struct sockaddr))
+#define IW_EV_COMPAT_QUAL_LEN  (IW_EV_COMPAT_LCP_LEN + sizeof(struct iw_quality))
+#define IW_EV_COMPAT_POINT_LEN \
+       (IW_EV_COMPAT_LCP_LEN + sizeof(struct compat_iw_point) - \
+        IW_EV_COMPAT_POINT_OFF)
+#endif
+#endif
+
 /* Size of the Event prefix when packed in stream */
 #define IW_EV_LCP_PK_LEN       (4)
 /* Size of the various events when packed in stream */