diff options
author | Ivo van Doorn <ivdoorn@gmail.com> | 2008-04-17 13:41:02 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-05-07 15:02:11 -0400 |
commit | 1c014420583564ac09e3b67006f2e7050861e66b (patch) | |
tree | 12f075007d1e7d603a6142ba0a4f32b2dee1cefb /include/net | |
parent | 6f4083aadd57e3da12fa4e67fcadaec23138a315 (diff) |
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')
-rw-r--r-- | include/net/mac80211.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 4a80d74975e8..27ef9f761ac5 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -286,8 +286,17 @@ enum mac80211_tx_control_flags { | |||
286 | 286 | ||
287 | /* Transmit control fields. This data structure is passed to low-level driver | 287 | /* Transmit control fields. This data structure is passed to low-level driver |
288 | * with each TX frame. The low-level driver is responsible for configuring | 288 | * with each TX frame. The low-level driver is responsible for configuring |
289 | * the hardware to use given values (depending on what is supported). */ | 289 | * the hardware to use given values (depending on what is supported). |
290 | 290 | * | |
291 | * NOTE: Be careful with using the pointers outside of the ieee80211_ops->tx() | ||
292 | * context (i.e. when defering the work to a workqueue). | ||
293 | * The vif pointer is valid until the it has been removed with the | ||
294 | * ieee80211_ops->remove_interface() callback funtion. | ||
295 | * The hw_key pointer is valid until it has been removed with the | ||
296 | * ieee80211_ops->set_key() callback function. | ||
297 | * The tx_rate and alt_retry_rate pointers are valid until the phy is | ||
298 | * deregistered. | ||
299 | */ | ||
291 | struct ieee80211_tx_control { | 300 | struct ieee80211_tx_control { |
292 | struct ieee80211_vif *vif; | 301 | struct ieee80211_vif *vif; |
293 | struct ieee80211_rate *tx_rate; | 302 | struct ieee80211_rate *tx_rate; |
@@ -298,9 +307,11 @@ struct ieee80211_tx_control { | |||
298 | /* retry rate for the last retries */ | 307 | /* retry rate for the last retries */ |
299 | struct ieee80211_rate *alt_retry_rate; | 308 | struct ieee80211_rate *alt_retry_rate; |
300 | 309 | ||
310 | /* Key used for hardware encryption | ||
311 | * NULL if IEEE80211_TXCTL_DO_NOT_ENCRYPT is set */ | ||
312 | struct ieee80211_key_conf *hw_key; | ||
313 | |||
301 | u32 flags; /* tx control flags defined above */ | 314 | u32 flags; /* tx control flags defined above */ |
302 | u8 key_idx; /* keyidx from hw->set_key(), undefined if | ||
303 | * IEEE80211_TXCTL_DO_NOT_ENCRYPT is set */ | ||
304 | u8 retry_limit; /* 1 = only first attempt, 2 = one retry, .. | 315 | u8 retry_limit; /* 1 = only first attempt, 2 = one retry, .. |
305 | * This could be used when set_retry_limit | 316 | * This could be used when set_retry_limit |
306 | * is not implemented by the driver */ | 317 | * is not implemented by the driver */ |