Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 183871
b: refs/heads/master
c: b3fbdcf
h: refs/heads/master
i:
  183869: b84b000
  183867: 0e30c77
  183863: e079816
  183855: 5278aae
  183839: e02e950
  183807: 6a6d42c
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed Jan 22, 2010
1 parent 3677666 commit 8794050
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 26 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e4fca007b06165900d0e44e8d5e251376819bf5d
refs/heads/master: b3fbdcf49f940d0703c356441e0daf045e64e076
11 changes: 8 additions & 3 deletions trunk/drivers/net/wireless/b43/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -844,8 +844,10 @@ static void rx_tkip_phase1_write(struct b43_wldev *dev, u8 index, u32 iv32,
}

static void b43_op_update_tkip_key(struct ieee80211_hw *hw,
struct ieee80211_key_conf *keyconf, const u8 *addr,
u32 iv32, u16 *phase1key)
struct ieee80211_vif *vif,
struct ieee80211_key_conf *keyconf,
struct ieee80211_sta *sta,
u32 iv32, u16 *phase1key)
{
struct b43_wl *wl = hw_to_b43_wl(hw);
struct b43_wldev *dev;
Expand All @@ -863,7 +865,10 @@ static void b43_op_update_tkip_key(struct ieee80211_hw *hw,
keymac_write(dev, index, NULL); /* First zero out mac to avoid race */

rx_tkip_phase1_write(dev, index, iv32, phase1key);
keymac_write(dev, index, addr);
/* only pairwise TKIP keys are supported right now */
if (WARN_ON(!sta))
goto out_unlock;
keymac_write(dev, index, sta->addr);

out_unlock:
mutex_unlock(&wl->mutex);
Expand Down
10 changes: 7 additions & 3 deletions trunk/drivers/net/wireless/iwlwifi/iwl-agn.c
Original file line number Diff line number Diff line change
Expand Up @@ -2839,14 +2839,18 @@ void iwl_config_ap(struct iwl_priv *priv)
}

static void iwl_mac_update_tkip_key(struct ieee80211_hw *hw,
struct ieee80211_key_conf *keyconf, const u8 *addr,
u32 iv32, u16 *phase1key)
struct ieee80211_vif *vif,
struct ieee80211_key_conf *keyconf,
struct ieee80211_sta *sta,
u32 iv32, u16 *phase1key)
{

struct iwl_priv *priv = hw->priv;
IWL_DEBUG_MAC80211(priv, "enter\n");

iwl_update_tkip_key(priv, keyconf, addr, iv32, phase1key);
iwl_update_tkip_key(priv, keyconf,
sta ? sta->addr : iwl_bcast_addr,
iv32, phase1key);

IWL_DEBUG_MAC80211(priv, "leave\n");
}
Expand Down
6 changes: 4 additions & 2 deletions trunk/include/net/mac80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -1614,8 +1614,10 @@ struct ieee80211_ops {
struct ieee80211_vif *vif, struct ieee80211_sta *sta,
struct ieee80211_key_conf *key);
void (*update_tkip_key)(struct ieee80211_hw *hw,
struct ieee80211_key_conf *conf, const u8 *address,
u32 iv32, u16 *phase1key);
struct ieee80211_vif *vif,
struct ieee80211_key_conf *conf,
struct ieee80211_sta *sta,
u32 iv32, u16 *phase1key);
int (*hw_scan)(struct ieee80211_hw *hw,
struct cfg80211_scan_request *req);
void (*sw_scan_start)(struct ieee80211_hw *hw);
Expand Down
14 changes: 10 additions & 4 deletions trunk/net/mac80211/driver-ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,16 +137,22 @@ static inline int drv_set_key(struct ieee80211_local *local,
}

static inline void drv_update_tkip_key(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct ieee80211_key_conf *conf,
const u8 *address, u32 iv32,
struct sta_info *sta, u32 iv32,
u16 *phase1key)
{
struct ieee80211_sta *ista = NULL;

might_sleep();

if (sta)
ista = &sta->sta;

if (local->ops->update_tkip_key)
local->ops->update_tkip_key(&local->hw, conf, address,
iv32, phase1key);
trace_drv_update_tkip_key(local, conf, address, iv32);
local->ops->update_tkip_key(&local->hw, &sdata->vif, conf,
ista, iv32, phase1key);
trace_drv_update_tkip_key(local, sdata, conf, ista, iv32);
}

static inline int drv_hw_scan(struct ieee80211_local *local,
Expand Down
15 changes: 9 additions & 6 deletions trunk/net/mac80211/driver-trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -331,26 +331,29 @@ TRACE_EVENT(drv_set_key,

TRACE_EVENT(drv_update_tkip_key,
TP_PROTO(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct ieee80211_key_conf *conf,
const u8 *address, u32 iv32),
struct ieee80211_sta *sta, u32 iv32),

TP_ARGS(local, conf, address, iv32),
TP_ARGS(local, sdata, conf, sta, iv32),

TP_STRUCT__entry(
LOCAL_ENTRY
__array(u8, addr, 6)
VIF_ENTRY
STA_ENTRY
__field(u32, iv32)
),

TP_fast_assign(
LOCAL_ASSIGN;
memcpy(__entry->addr, address, 6);
VIF_ASSIGN;
STA_ASSIGN;
__entry->iv32 = iv32;
),

TP_printk(
LOCAL_PR_FMT " addr:%pM iv32:%#x",
LOCAL_PR_ARG, __entry->addr, __entry->iv32
LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " iv32:%#x",
LOCAL_PR_ARG,VIF_PR_ARG,STA_PR_ARG, __entry->iv32
)
);

Expand Down
12 changes: 5 additions & 7 deletions trunk/net/mac80211/tkip.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,14 +304,12 @@ int ieee80211_tkip_decrypt_data(struct crypto_blkcipher *tfm,
if (key->local->ops->update_tkip_key &&
key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE &&
key->u.tkip.rx[queue].state != TKIP_STATE_PHASE1_HW_UPLOADED) {
static const u8 bcast[ETH_ALEN] =
{0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
const u8 *sta_addr = key->sta->sta.addr;
struct ieee80211_sub_if_data *sdata = key->sdata;

if (is_multicast_ether_addr(ra))
sta_addr = bcast;

drv_update_tkip_key(key->local, &key->conf, sta_addr,
if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
sdata = container_of(key->sdata->bss,
struct ieee80211_sub_if_data, u.ap);
drv_update_tkip_key(key->local, sdata, &key->conf, key->sta,
iv32, key->u.tkip.rx[queue].p1k);
key->u.tkip.rx[queue].state = TKIP_STATE_PHASE1_HW_UPLOADED;
}
Expand Down

0 comments on commit 8794050

Please sign in to comment.