diff options
author | Johannes Berg <johannes.berg@intel.com> | 2011-07-07 12:58:00 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-07-08 11:42:22 -0400 |
commit | 3ea542d3c2862142ae511fac5ce2dfc7419dcc53 (patch) | |
tree | 472807c6d2a0aefa050a63cc34d9e2a2f7a3f2a6 /include | |
parent | 9e26297a56453315ae6829aec609b5a6309af7b4 (diff) |
mac80211: allow drivers to access key sequence counter
In order to implement GTK rekeying, the device needs
to be able to encrypt frames with the right PN/IV and
check the PN/IV in RX frames. To be able to tell it
about all those counters, we need to be able to get
them from mac80211, this adds the required API.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/mac80211.h | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 0aae7bc1eeae..84770cedae2d 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -2592,6 +2592,66 @@ void ieee80211_get_tkip_p2k(struct ieee80211_key_conf *keyconf, | |||
2592 | struct sk_buff *skb, u8 *p2k); | 2592 | struct sk_buff *skb, u8 *p2k); |
2593 | 2593 | ||
2594 | /** | 2594 | /** |
2595 | * struct ieee80211_key_seq - key sequence counter | ||
2596 | * | ||
2597 | * @tkip: TKIP data, containing IV32 and IV16 in host byte order | ||
2598 | * @ccmp: PN data, most significant byte first (big endian, | ||
2599 | * reverse order than in packet) | ||
2600 | * @aes_cmac: PN data, most significant byte first (big endian, | ||
2601 | * reverse order than in packet) | ||
2602 | */ | ||
2603 | struct ieee80211_key_seq { | ||
2604 | union { | ||
2605 | struct { | ||
2606 | u32 iv32; | ||
2607 | u16 iv16; | ||
2608 | } tkip; | ||
2609 | struct { | ||
2610 | u8 pn[6]; | ||
2611 | } ccmp; | ||
2612 | struct { | ||
2613 | u8 pn[6]; | ||
2614 | } aes_cmac; | ||
2615 | }; | ||
2616 | }; | ||
2617 | |||
2618 | /** | ||
2619 | * ieee80211_get_key_tx_seq - get key TX sequence counter | ||
2620 | * | ||
2621 | * @keyconf: the parameter passed with the set key | ||
2622 | * @seq: buffer to receive the sequence data | ||
2623 | * | ||
2624 | * This function allows a driver to retrieve the current TX IV/PN | ||
2625 | * for the given key. It must not be called if IV generation is | ||
2626 | * offloaded to the device. | ||
2627 | * | ||
2628 | * Note that this function may only be called when no TX processing | ||
2629 | * can be done concurrently, for example when queues are stopped | ||
2630 | * and the stop has been synchronized. | ||
2631 | */ | ||
2632 | void ieee80211_get_key_tx_seq(struct ieee80211_key_conf *keyconf, | ||
2633 | struct ieee80211_key_seq *seq); | ||
2634 | |||
2635 | /** | ||
2636 | * ieee80211_get_key_rx_seq - get key RX sequence counter | ||
2637 | * | ||
2638 | * @keyconf: the parameter passed with the set key | ||
2639 | * @tid: The TID, or -1 for the management frame value (CCMP only); | ||
2640 | * the value on TID 0 is also used for non-QoS frames. For | ||
2641 | * CMAC, only TID 0 is valid. | ||
2642 | * @seq: buffer to receive the sequence data | ||
2643 | * | ||
2644 | * This function allows a driver to retrieve the current RX IV/PNs | ||
2645 | * for the given key. It must not be called if IV checking is done | ||
2646 | * by the device and not by mac80211. | ||
2647 | * | ||
2648 | * Note that this function may only be called when no RX processing | ||
2649 | * can be done concurrently. | ||
2650 | */ | ||
2651 | void ieee80211_get_key_rx_seq(struct ieee80211_key_conf *keyconf, | ||
2652 | int tid, struct ieee80211_key_seq *seq); | ||
2653 | |||
2654 | /** | ||
2595 | * ieee80211_gtk_rekey_notify - notify userspace supplicant of rekeying | 2655 | * ieee80211_gtk_rekey_notify - notify userspace supplicant of rekeying |
2596 | * @vif: virtual interface the rekeying was done on | 2656 | * @vif: virtual interface the rekeying was done on |
2597 | * @bssid: The BSSID of the AP, for checking association | 2657 | * @bssid: The BSSID of the AP, for checking association |