summaryrefslogtreecommitdiffstats
path: root/include/net/mac80211.h
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2008-04-17 19:41:02 +0200
committerJohn W. Linville <linville@tuxdriver.com>2008-05-07 15:02:11 -0400
commit1c014420583564ac09e3b67006f2e7050861e66b (patch)
tree12f075007d1e7d603a6142ba0a4f32b2dee1cefb /include/net/mac80211.h
parent6f4083aadd57e3da12fa4e67fcadaec23138a315 (diff)
downloadop-kernel-dev-1c014420583564ac09e3b67006f2e7050861e66b.zip
op-kernel-dev-1c014420583564ac09e3b67006f2e7050861e66b.tar.gz
mac80211: Replace ieee80211_tx_control->key_idx with ieee80211_key_conf
The hw_key_idx inside the ieee80211_key_conf structure does not provide all the information drivers might need to perform hardware encryption. This is in particular true for rt2x00 who needs to know the key algorithm and whether it is a shared or pairwise key. By passing the ieee80211_key_conf pointer it assures us that drivers can make full use of all information that it should know about a particular key. Additionally this patch updates all drivers to grab the hw_key_idx from the ieee80211_key_conf structure. v2: Removed bogus u16 cast v3: Add warning about ieee80211_tx_control pointers v4: Update warning about ieee80211_tx_control pointers Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include/net/mac80211.h')
-rw-r--r--include/net/mac80211.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 4a80d74..27ef9f7 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -286,8 +286,17 @@ enum mac80211_tx_control_flags {
/* Transmit control fields. This data structure is passed to low-level driver
* with each TX frame. The low-level driver is responsible for configuring
- * the hardware to use given values (depending on what is supported). */
-
+ * the hardware to use given values (depending on what is supported).
+ *
+ * NOTE: Be careful with using the pointers outside of the ieee80211_ops->tx()
+ * context (i.e. when defering the work to a workqueue).
+ * The vif pointer is valid until the it has been removed with the
+ * ieee80211_ops->remove_interface() callback funtion.
+ * The hw_key pointer is valid until it has been removed with the
+ * ieee80211_ops->set_key() callback function.
+ * The tx_rate and alt_retry_rate pointers are valid until the phy is
+ * deregistered.
+ */
struct ieee80211_tx_control {
struct ieee80211_vif *vif;
struct ieee80211_rate *tx_rate;
@@ -298,9 +307,11 @@ struct ieee80211_tx_control {
/* retry rate for the last retries */
struct ieee80211_rate *alt_retry_rate;
+ /* Key used for hardware encryption
+ * NULL if IEEE80211_TXCTL_DO_NOT_ENCRYPT is set */
+ struct ieee80211_key_conf *hw_key;
+
u32 flags; /* tx control flags defined above */
- u8 key_idx; /* keyidx from hw->set_key(), undefined if
- * IEEE80211_TXCTL_DO_NOT_ENCRYPT is set */
u8 retry_limit; /* 1 = only first attempt, 2 = one retry, ..
* This could be used when set_retry_limit
* is not implemented by the driver */
OpenPOWER on IntegriCloud