aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2011-07-15 10:05:24 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-07-15 10:05:24 -0400
commit95a943c162d74b20d869917bdf5df11293c35b63 (patch)
treec69d5cb97a4d97b6062a276ecdfa8582535193af /include/net
parentecae42d37045ec71831d0e0e493e00b0e0732edd (diff)
parent95acac61ba66c4abd40e038dae8c1ed2e176c7b1 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem
Conflicts: net/bluetooth/l2cap_core.c
Diffstat (limited to 'include/net')
-rw-r--r--include/net/bluetooth/bluetooth.h12
-rw-r--r--include/net/bluetooth/hci.h18
-rw-r--r--include/net/bluetooth/hci_core.h29
-rw-r--r--include/net/bluetooth/l2cap.h25
-rw-r--r--include/net/bluetooth/mgmt.h2
-rw-r--r--include/net/bluetooth/smp.h1
-rw-r--r--include/net/cfg80211.h1
-rw-r--r--include/net/mac80211.h171
8 files changed, 221 insertions, 38 deletions
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
index 7bccaf921cab..e727555d4ee9 100644
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -56,6 +56,7 @@
56#define BT_SECURITY 4 56#define BT_SECURITY 4
57struct bt_security { 57struct bt_security {
58 __u8 level; 58 __u8 level;
59 __u8 key_size;
59}; 60};
60#define BT_SECURITY_SDP 0 61#define BT_SECURITY_SDP 0
61#define BT_SECURITY_LOW 1 62#define BT_SECURITY_LOW 1
@@ -76,9 +77,12 @@ struct bt_power {
76#define BT_POWER_FORCE_ACTIVE_OFF 0 77#define BT_POWER_FORCE_ACTIVE_OFF 0
77#define BT_POWER_FORCE_ACTIVE_ON 1 78#define BT_POWER_FORCE_ACTIVE_ON 1
78 79
79#define BT_INFO(fmt, arg...) printk(KERN_INFO "Bluetooth: " fmt "\n" , ## arg) 80__attribute__((format (printf, 2, 3)))
80#define BT_ERR(fmt, arg...) printk(KERN_ERR "%s: " fmt "\n" , __func__ , ## arg) 81int bt_printk(const char *level, const char *fmt, ...);
81#define BT_DBG(fmt, arg...) pr_debug("%s: " fmt "\n" , __func__ , ## arg) 82
83#define BT_INFO(fmt, arg...) bt_printk(KERN_INFO, pr_fmt(fmt), ##arg)
84#define BT_ERR(fmt, arg...) bt_printk(KERN_ERR, pr_fmt(fmt), ##arg)
85#define BT_DBG(fmt, arg...) pr_debug(fmt "\n", ##arg)
82 86
83/* Connection and socket states */ 87/* Connection and socket states */
84enum { 88enum {
@@ -204,7 +208,7 @@ out:
204 return NULL; 208 return NULL;
205} 209}
206 210
207int bt_err(__u16 code); 211int bt_to_errno(__u16 code);
208 212
209extern int hci_sock_init(void); 213extern int hci_sock_init(void);
210extern void hci_sock_cleanup(void); 214extern void hci_sock_cleanup(void);
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 65345cd215be..be30aabe7b88 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -211,11 +211,16 @@ enum {
211#define LMP_EDR_3S_ESCO 0x80 211#define LMP_EDR_3S_ESCO 0x80
212 212
213#define LMP_EXT_INQ 0x01 213#define LMP_EXT_INQ 0x01
214#define LMP_SIMUL_LE_BR 0x02
214#define LMP_SIMPLE_PAIR 0x08 215#define LMP_SIMPLE_PAIR 0x08
215#define LMP_NO_FLUSH 0x40 216#define LMP_NO_FLUSH 0x40
216 217
217#define LMP_LSTO 0x01 218#define LMP_LSTO 0x01
218#define LMP_INQ_TX_PWR 0x02 219#define LMP_INQ_TX_PWR 0x02
220#define LMP_EXTFEATURES 0x80
221
222/* Extended LMP features */
223#define LMP_HOST_LE 0x02
219 224
220/* Connection modes */ 225/* Connection modes */
221#define HCI_CM_ACTIVE 0x0000 226#define HCI_CM_ACTIVE 0x0000
@@ -254,6 +259,10 @@ enum {
254#define HCI_LK_UNAUTH_COMBINATION 0x04 259#define HCI_LK_UNAUTH_COMBINATION 0x04
255#define HCI_LK_AUTH_COMBINATION 0x05 260#define HCI_LK_AUTH_COMBINATION 0x05
256#define HCI_LK_CHANGED_COMBINATION 0x06 261#define HCI_LK_CHANGED_COMBINATION 0x06
262/* The spec doesn't define types for SMP keys */
263#define HCI_LK_SMP_LTK 0x81
264#define HCI_LK_SMP_IRK 0x82
265#define HCI_LK_SMP_CSRK 0x83
257 266
258/* ----- HCI Commands ---- */ 267/* ----- HCI Commands ---- */
259#define HCI_OP_NOP 0x0000 268#define HCI_OP_NOP 0x0000
@@ -653,6 +662,12 @@ struct hci_rp_read_local_oob_data {
653 662
654#define HCI_OP_READ_INQ_RSP_TX_POWER 0x0c58 663#define HCI_OP_READ_INQ_RSP_TX_POWER 0x0c58
655 664
665#define HCI_OP_WRITE_LE_HOST_SUPPORTED 0x0c6d
666struct hci_cp_write_le_host_supported {
667 __u8 le;
668 __u8 simul;
669} __packed;
670
656#define HCI_OP_READ_LOCAL_VERSION 0x1001 671#define HCI_OP_READ_LOCAL_VERSION 0x1001
657struct hci_rp_read_local_version { 672struct hci_rp_read_local_version {
658 __u8 status; 673 __u8 status;
@@ -676,6 +691,9 @@ struct hci_rp_read_local_features {
676} __packed; 691} __packed;
677 692
678#define HCI_OP_READ_LOCAL_EXT_FEATURES 0x1004 693#define HCI_OP_READ_LOCAL_EXT_FEATURES 0x1004
694struct hci_cp_read_local_ext_features {
695 __u8 page;
696} __packed;
679struct hci_rp_read_local_ext_features { 697struct hci_rp_read_local_ext_features {
680 __u8 status; 698 __u8 status;
681 __u8 page; 699 __u8 page;
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 19639df80e67..8f441b8b2963 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -75,12 +75,28 @@ struct bt_uuid {
75 u8 svc_hint; 75 u8 svc_hint;
76}; 76};
77 77
78struct key_master_id {
79 __le16 ediv;
80 u8 rand[8];
81} __packed;
82
83struct link_key_data {
84 bdaddr_t bdaddr;
85 u8 type;
86 u8 val[16];
87 u8 pin_len;
88 u8 dlen;
89 u8 data[0];
90} __packed;
91
78struct link_key { 92struct link_key {
79 struct list_head list; 93 struct list_head list;
80 bdaddr_t bdaddr; 94 bdaddr_t bdaddr;
81 u8 type; 95 u8 type;
82 u8 val[16]; 96 u8 val[16];
83 u8 pin_len; 97 u8 pin_len;
98 u8 dlen;
99 u8 data[0];
84}; 100};
85 101
86struct oob_data { 102struct oob_data {
@@ -114,6 +130,7 @@ struct hci_dev {
114 __u8 major_class; 130 __u8 major_class;
115 __u8 minor_class; 131 __u8 minor_class;
116 __u8 features[8]; 132 __u8 features[8];
133 __u8 extfeatures[8];
117 __u8 commands[64]; 134 __u8 commands[64];
118 __u8 ssp_mode; 135 __u8 ssp_mode;
119 __u8 hci_ver; 136 __u8 hci_ver;
@@ -224,7 +241,6 @@ struct hci_conn {
224 struct list_head list; 241 struct list_head list;
225 242
226 atomic_t refcnt; 243 atomic_t refcnt;
227 spinlock_t lock;
228 244
229 bdaddr_t dst; 245 bdaddr_t dst;
230 __u8 dst_type; 246 __u8 dst_type;
@@ -246,11 +262,11 @@ struct hci_conn {
246 __u8 sec_level; 262 __u8 sec_level;
247 __u8 pending_sec_level; 263 __u8 pending_sec_level;
248 __u8 pin_length; 264 __u8 pin_length;
265 __u8 enc_key_size;
249 __u8 io_capability; 266 __u8 io_capability;
250 __u8 power_save; 267 __u8 power_save;
251 __u16 disc_timeout; 268 __u16 disc_timeout;
252 unsigned long pend; 269 unsigned long pend;
253 __u8 ltk[16];
254 270
255 __u8 remote_cap; 271 __u8 remote_cap;
256 __u8 remote_oob; 272 __u8 remote_oob;
@@ -273,7 +289,6 @@ struct hci_conn {
273 struct hci_dev *hdev; 289 struct hci_dev *hdev;
274 void *l2cap_data; 290 void *l2cap_data;
275 void *sco_data; 291 void *sco_data;
276 void *priv;
277 292
278 struct hci_conn *link; 293 struct hci_conn *link;
279 294
@@ -539,6 +554,11 @@ int hci_link_keys_clear(struct hci_dev *hdev);
539struct link_key *hci_find_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr); 554struct link_key *hci_find_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr);
540int hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, int new_key, 555int hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, int new_key,
541 bdaddr_t *bdaddr, u8 *val, u8 type, u8 pin_len); 556 bdaddr_t *bdaddr, u8 *val, u8 type, u8 pin_len);
557struct link_key *hci_find_ltk(struct hci_dev *hdev, __le16 ediv, u8 rand[8]);
558struct link_key *hci_find_link_key_type(struct hci_dev *hdev,
559 bdaddr_t *bdaddr, u8 type);
560int hci_add_ltk(struct hci_dev *hdev, int new_key, bdaddr_t *bdaddr,
561 u8 key_size, __le16 ediv, u8 rand[8], u8 ltk[16]);
542int hci_remove_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr); 562int hci_remove_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr);
543 563
544int hci_remote_oob_data_clear(struct hci_dev *hdev); 564int hci_remote_oob_data_clear(struct hci_dev *hdev);
@@ -580,6 +600,9 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
580#define lmp_no_flush_capable(dev) ((dev)->features[6] & LMP_NO_FLUSH) 600#define lmp_no_flush_capable(dev) ((dev)->features[6] & LMP_NO_FLUSH)
581#define lmp_le_capable(dev) ((dev)->features[4] & LMP_LE) 601#define lmp_le_capable(dev) ((dev)->features[4] & LMP_LE)
582 602
603/* ----- Extended LMP capabilities ----- */
604#define lmp_host_le_capable(dev) ((dev)->extfeatures[0] & LMP_HOST_LE)
605
583/* ----- HCI protocols ----- */ 606/* ----- HCI protocols ----- */
584struct hci_proto { 607struct hci_proto {
585 char *name; 608 char *name;
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index 9c18e555b6ed..4f34ad25e75c 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -37,7 +37,6 @@
37#define L2CAP_DEFAULT_MONITOR_TO 12000 /* 12 seconds */ 37#define L2CAP_DEFAULT_MONITOR_TO 12000 /* 12 seconds */
38#define L2CAP_DEFAULT_MAX_PDU_SIZE 1009 /* Sized for 3-DH5 packet */ 38#define L2CAP_DEFAULT_MAX_PDU_SIZE 1009 /* Sized for 3-DH5 packet */
39#define L2CAP_DEFAULT_ACK_TO 200 39#define L2CAP_DEFAULT_ACK_TO 200
40#define L2CAP_LOCAL_BUSY_TRIES 12
41#define L2CAP_LE_DEFAULT_MTU 23 40#define L2CAP_LE_DEFAULT_MTU 23
42 41
43#define L2CAP_CONN_TIMEOUT (40000) /* 40 seconds */ 42#define L2CAP_CONN_TIMEOUT (40000) /* 40 seconds */
@@ -130,6 +129,12 @@ struct l2cap_conninfo {
130#define L2CAP_SDU_END 0x8000 129#define L2CAP_SDU_END 0x8000
131#define L2CAP_SDU_CONTINUE 0xC000 130#define L2CAP_SDU_CONTINUE 0xC000
132 131
132/* L2CAP Command rej. reasons */
133#define L2CAP_REJ_NOT_UNDERSTOOD 0x0000
134#define L2CAP_REJ_MTU_EXCEEDED 0x0001
135#define L2CAP_REJ_INVALID_CID 0x0002
136
137
133/* L2CAP structures */ 138/* L2CAP structures */
134struct l2cap_hdr { 139struct l2cap_hdr {
135 __le16 len; 140 __le16 len;
@@ -144,8 +149,19 @@ struct l2cap_cmd_hdr {
144} __packed; 149} __packed;
145#define L2CAP_CMD_HDR_SIZE 4 150#define L2CAP_CMD_HDR_SIZE 4
146 151
147struct l2cap_cmd_rej { 152struct l2cap_cmd_rej_unk {
153 __le16 reason;
154} __packed;
155
156struct l2cap_cmd_rej_mtu {
148 __le16 reason; 157 __le16 reason;
158 __le16 max_mtu;
159} __packed;
160
161struct l2cap_cmd_rej_cid {
162 __le16 reason;
163 __le16 scid;
164 __le16 dcid;
149} __packed; 165} __packed;
150 166
151struct l2cap_conn_req { 167struct l2cap_conn_req {
@@ -352,8 +368,6 @@ struct l2cap_chan {
352 struct sk_buff *tx_send_head; 368 struct sk_buff *tx_send_head;
353 struct sk_buff_head tx_q; 369 struct sk_buff_head tx_q;
354 struct sk_buff_head srej_q; 370 struct sk_buff_head srej_q;
355 struct sk_buff_head busy_q;
356 struct work_struct busy_work;
357 struct list_head srej_l; 371 struct list_head srej_l;
358 372
359 struct list_head list; 373 struct list_head list;
@@ -422,6 +436,7 @@ struct l2cap_conn {
422struct l2cap_pinfo { 436struct l2cap_pinfo {
423 struct bt_sock bt; 437 struct bt_sock bt;
424 struct l2cap_chan *chan; 438 struct l2cap_chan *chan;
439 struct sk_buff *rx_busy_skb;
425}; 440};
426 441
427enum { 442enum {
@@ -449,7 +464,6 @@ enum {
449 CONN_REJ_ACT, 464 CONN_REJ_ACT,
450 CONN_SEND_FBIT, 465 CONN_SEND_FBIT,
451 CONN_RNR_SENT, 466 CONN_RNR_SENT,
452 CONN_SAR_RETRY,
453}; 467};
454 468
455#define __set_chan_timer(c, t) l2cap_set_timer(c, &c->chan_timer, (t)) 469#define __set_chan_timer(c, t) l2cap_set_timer(c, &c->chan_timer, (t))
@@ -498,5 +512,6 @@ void l2cap_chan_close(struct l2cap_chan *chan, int reason);
498void l2cap_chan_destroy(struct l2cap_chan *chan); 512void l2cap_chan_destroy(struct l2cap_chan *chan);
499int l2cap_chan_connect(struct l2cap_chan *chan); 513int l2cap_chan_connect(struct l2cap_chan *chan);
500int l2cap_chan_send(struct l2cap_chan *chan, struct msghdr *msg, size_t len); 514int l2cap_chan_send(struct l2cap_chan *chan, struct msghdr *msg, size_t len);
515void l2cap_chan_busy(struct l2cap_chan *chan, int busy);
501 516
502#endif /* __L2CAP_H */ 517#endif /* __L2CAP_H */
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h
index 45bea25d737f..5428fd32ccec 100644
--- a/include/net/bluetooth/mgmt.h
+++ b/include/net/bluetooth/mgmt.h
@@ -101,6 +101,8 @@ struct mgmt_key_info {
101 u8 type; 101 u8 type;
102 u8 val[16]; 102 u8 val[16];
103 u8 pin_len; 103 u8 pin_len;
104 u8 dlen;
105 u8 data[0];
104} __packed; 106} __packed;
105 107
106#define MGMT_OP_LOAD_KEYS 0x000D 108#define MGMT_OP_LOAD_KEYS 0x000D
diff --git a/include/net/bluetooth/smp.h b/include/net/bluetooth/smp.h
index 4fb7d198a876..46c457612300 100644
--- a/include/net/bluetooth/smp.h
+++ b/include/net/bluetooth/smp.h
@@ -118,5 +118,6 @@ struct smp_cmd_security_req {
118/* SMP Commands */ 118/* SMP Commands */
119int smp_conn_security(struct l2cap_conn *conn, __u8 sec_level); 119int smp_conn_security(struct l2cap_conn *conn, __u8 sec_level);
120int smp_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb); 120int smp_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb);
121int smp_distribute_keys(struct l2cap_conn *conn, __u8 force);
121 122
122#endif /* __SMP_H */ 123#endif /* __SMP_H */
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 4bf101bada4e..5390e3245a1a 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -3055,6 +3055,7 @@ void cfg80211_cqm_pktloss_notify(struct net_device *dev,
3055 * @dev: network device 3055 * @dev: network device
3056 * @bssid: BSSID of AP (to avoid races) 3056 * @bssid: BSSID of AP (to avoid races)
3057 * @replay_ctr: new replay counter 3057 * @replay_ctr: new replay counter
3058 * @gfp: allocation flags
3058 */ 3059 */
3059void cfg80211_gtk_rekey_notify(struct net_device *dev, const u8 *bssid, 3060void cfg80211_gtk_rekey_notify(struct net_device *dev, const u8 *bssid,
3060 const u8 *replay_ctr, gfp_t gfp); 3061 const u8 *replay_ctr, gfp_t gfp);
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 2474019f47d3..ea2c8c36477c 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -20,6 +20,7 @@
20#include <linux/device.h> 20#include <linux/device.h>
21#include <linux/ieee80211.h> 21#include <linux/ieee80211.h>
22#include <net/cfg80211.h> 22#include <net/cfg80211.h>
23#include <asm/unaligned.h>
23 24
24/** 25/**
25 * DOC: Introduction 26 * DOC: Introduction
@@ -193,6 +194,17 @@ enum ieee80211_bss_change {
193#define IEEE80211_BSS_ARP_ADDR_LIST_LEN 4 194#define IEEE80211_BSS_ARP_ADDR_LIST_LEN 4
194 195
195/** 196/**
197 * enum ieee80211_rssi_event - RSSI threshold event
198 * An indicator for when RSSI goes below/above a certain threshold.
199 * @RSSI_EVENT_HIGH: AP's rssi crossed the high threshold set by the driver.
200 * @RSSI_EVENT_LOW: AP's rssi crossed the low threshold set by the driver.
201 */
202enum ieee80211_rssi_event {
203 RSSI_EVENT_HIGH,
204 RSSI_EVENT_LOW,
205};
206
207/**
196 * struct ieee80211_bss_conf - holds the BSS's changing parameters 208 * struct ieee80211_bss_conf - holds the BSS's changing parameters
197 * 209 *
198 * This structure keeps information about a BSS (and an association 210 * This structure keeps information about a BSS (and an association
@@ -962,21 +974,6 @@ enum sta_notify_cmd {
962}; 974};
963 975
964/** 976/**
965 * enum ieee80211_tkip_key_type - get tkip key
966 *
967 * Used by drivers which need to get a tkip key for skb. Some drivers need a
968 * phase 1 key, others need a phase 2 key. A single function allows the driver
969 * to get the key, this enum indicates what type of key is required.
970 *
971 * @IEEE80211_TKIP_P1_KEY: the driver needs a phase 1 key
972 * @IEEE80211_TKIP_P2_KEY: the driver needs a phase 2 key
973 */
974enum ieee80211_tkip_key_type {
975 IEEE80211_TKIP_P1_KEY,
976 IEEE80211_TKIP_P2_KEY,
977};
978
979/**
980 * enum ieee80211_hw_flags - hardware flags 977 * enum ieee80211_hw_flags - hardware flags
981 * 978 *
982 * These flags are used to indicate hardware capabilities to 979 * These flags are used to indicate hardware capabilities to
@@ -1881,6 +1878,8 @@ enum ieee80211_ampdu_mlme_action {
1881 * @set_bitrate_mask: Set a mask of rates to be used for rate control selection 1878 * @set_bitrate_mask: Set a mask of rates to be used for rate control selection
1882 * when transmitting a frame. Currently only legacy rates are handled. 1879 * when transmitting a frame. Currently only legacy rates are handled.
1883 * The callback can sleep. 1880 * The callback can sleep.
1881 * @rssi_callback: Notify driver when the average RSSI goes above/below
1882 * thresholds that were registered previously. The callback can sleep.
1884 */ 1883 */
1885struct ieee80211_ops { 1884struct ieee80211_ops {
1886 void (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); 1885 void (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb);
@@ -1989,6 +1988,8 @@ struct ieee80211_ops {
1989 bool (*tx_frames_pending)(struct ieee80211_hw *hw); 1988 bool (*tx_frames_pending)(struct ieee80211_hw *hw);
1990 int (*set_bitrate_mask)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 1989 int (*set_bitrate_mask)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1991 const struct cfg80211_bitrate_mask *mask); 1990 const struct cfg80211_bitrate_mask *mask);
1991 void (*rssi_callback)(struct ieee80211_hw *hw,
1992 enum ieee80211_rssi_event rssi_event);
1992}; 1993};
1993 1994
1994/** 1995/**
@@ -2579,21 +2580,111 @@ struct sk_buff *
2579ieee80211_get_buffered_bc(struct ieee80211_hw *hw, struct ieee80211_vif *vif); 2580ieee80211_get_buffered_bc(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
2580 2581
2581/** 2582/**
2582 * ieee80211_get_tkip_key - get a TKIP rc4 for skb 2583 * ieee80211_get_tkip_p1k_iv - get a TKIP phase 1 key for IV32
2584 *
2585 * This function returns the TKIP phase 1 key for the given IV32.
2586 *
2587 * @keyconf: the parameter passed with the set key
2588 * @iv32: IV32 to get the P1K for
2589 * @p1k: a buffer to which the key will be written, as 5 u16 values
2590 */
2591void ieee80211_get_tkip_p1k_iv(struct ieee80211_key_conf *keyconf,
2592 u32 iv32, u16 *p1k);
2593
2594/**
2595 * ieee80211_get_tkip_p1k - get a TKIP phase 1 key
2596 *
2597 * This function returns the TKIP phase 1 key for the IV32 taken
2598 * from the given packet.
2599 *
2600 * @keyconf: the parameter passed with the set key
2601 * @skb: the packet to take the IV32 value from that will be encrypted
2602 * with this P1K
2603 * @p1k: a buffer to which the key will be written, as 5 u16 values
2604 */
2605static inline void ieee80211_get_tkip_p1k(struct ieee80211_key_conf *keyconf,
2606 struct sk_buff *skb, u16 *p1k)
2607{
2608 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
2609 const u8 *data = (u8 *)hdr + ieee80211_hdrlen(hdr->frame_control);
2610 u32 iv32 = get_unaligned_le32(&data[4]);
2611
2612 ieee80211_get_tkip_p1k_iv(keyconf, iv32, p1k);
2613}
2614
2615/**
2616 * ieee80211_get_tkip_p2k - get a TKIP phase 2 key
2617 *
2618 * This function computes the TKIP RC4 key for the IV values
2619 * in the packet.
2620 *
2621 * @keyconf: the parameter passed with the set key
2622 * @skb: the packet to take the IV32/IV16 values from that will be
2623 * encrypted with this key
2624 * @p2k: a buffer to which the key will be written, 16 bytes
2625 */
2626void ieee80211_get_tkip_p2k(struct ieee80211_key_conf *keyconf,
2627 struct sk_buff *skb, u8 *p2k);
2628
2629/**
2630 * struct ieee80211_key_seq - key sequence counter
2583 * 2631 *
2584 * This function computes a TKIP rc4 key for an skb. It computes 2632 * @tkip: TKIP data, containing IV32 and IV16 in host byte order
2585 * a phase 1 key if needed (iv16 wraps around). This function is to 2633 * @ccmp: PN data, most significant byte first (big endian,
2586 * be used by drivers which can do HW encryption but need to compute 2634 * reverse order than in packet)
2587 * to phase 1/2 key in SW. 2635 * @aes_cmac: PN data, most significant byte first (big endian,
2636 * reverse order than in packet)
2637 */
2638struct ieee80211_key_seq {
2639 union {
2640 struct {
2641 u32 iv32;
2642 u16 iv16;
2643 } tkip;
2644 struct {
2645 u8 pn[6];
2646 } ccmp;
2647 struct {
2648 u8 pn[6];
2649 } aes_cmac;
2650 };
2651};
2652
2653/**
2654 * ieee80211_get_key_tx_seq - get key TX sequence counter
2588 * 2655 *
2589 * @keyconf: the parameter passed with the set key 2656 * @keyconf: the parameter passed with the set key
2590 * @skb: the skb for which the key is needed 2657 * @seq: buffer to receive the sequence data
2591 * @type: TBD 2658 *
2592 * @key: a buffer to which the key will be written 2659 * This function allows a driver to retrieve the current TX IV/PN
2660 * for the given key. It must not be called if IV generation is
2661 * offloaded to the device.
2662 *
2663 * Note that this function may only be called when no TX processing
2664 * can be done concurrently, for example when queues are stopped
2665 * and the stop has been synchronized.
2593 */ 2666 */
2594void ieee80211_get_tkip_key(struct ieee80211_key_conf *keyconf, 2667void ieee80211_get_key_tx_seq(struct ieee80211_key_conf *keyconf,
2595 struct sk_buff *skb, 2668 struct ieee80211_key_seq *seq);
2596 enum ieee80211_tkip_key_type type, u8 *key); 2669
2670/**
2671 * ieee80211_get_key_rx_seq - get key RX sequence counter
2672 *
2673 * @keyconf: the parameter passed with the set key
2674 * @tid: The TID, or -1 for the management frame value (CCMP only);
2675 * the value on TID 0 is also used for non-QoS frames. For
2676 * CMAC, only TID 0 is valid.
2677 * @seq: buffer to receive the sequence data
2678 *
2679 * This function allows a driver to retrieve the current RX IV/PNs
2680 * for the given key. It must not be called if IV checking is done
2681 * by the device and not by mac80211.
2682 *
2683 * Note that this function may only be called when no RX processing
2684 * can be done concurrently.
2685 */
2686void ieee80211_get_key_rx_seq(struct ieee80211_key_conf *keyconf,
2687 int tid, struct ieee80211_key_seq *seq);
2597 2688
2598/** 2689/**
2599 * ieee80211_gtk_rekey_notify - notify userspace supplicant of rekeying 2690 * ieee80211_gtk_rekey_notify - notify userspace supplicant of rekeying
@@ -2933,6 +3024,29 @@ void ieee80211_beacon_loss(struct ieee80211_vif *vif);
2933void ieee80211_connection_loss(struct ieee80211_vif *vif); 3024void ieee80211_connection_loss(struct ieee80211_vif *vif);
2934 3025
2935/** 3026/**
3027 * ieee80211_resume_disconnect - disconnect from AP after resume
3028 *
3029 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
3030 *
3031 * Instructs mac80211 to disconnect from the AP after resume.
3032 * Drivers can use this after WoWLAN if they know that the
3033 * connection cannot be kept up, for example because keys were
3034 * used while the device was asleep but the replay counters or
3035 * similar cannot be retrieved from the device during resume.
3036 *
3037 * Note that due to implementation issues, if the driver uses
3038 * the reconfiguration functionality during resume the interface
3039 * will still be added as associated first during resume and then
3040 * disconnect normally later.
3041 *
3042 * This function can only be called from the resume callback and
3043 * the driver must not be holding any of its own locks while it
3044 * calls this function, or at least not any locks it needs in the
3045 * key configuration paths (if it supports HW crypto).
3046 */
3047void ieee80211_resume_disconnect(struct ieee80211_vif *vif);
3048
3049/**
2936 * ieee80211_disable_dyn_ps - force mac80211 to temporarily disable dynamic psm 3050 * ieee80211_disable_dyn_ps - force mac80211 to temporarily disable dynamic psm
2937 * 3051 *
2938 * @vif: &struct ieee80211_vif pointer from the add_interface callback. 3052 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
@@ -3240,4 +3354,9 @@ ieee80211_vif_type_p2p(struct ieee80211_vif *vif)
3240 return ieee80211_iftype_p2p(vif->type, vif->p2p); 3354 return ieee80211_iftype_p2p(vif->type, vif->p2p);
3241} 3355}
3242 3356
3357void ieee80211_enable_rssi_reports(struct ieee80211_vif *vif,
3358 int rssi_min_thold,
3359 int rssi_max_thold);
3360
3361void ieee80211_disable_rssi_reports(struct ieee80211_vif *vif);
3243#endif /* MAC80211_H */ 3362#endif /* MAC80211_H */