Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 159147
b: refs/heads/master
c: 6e5db0a
h: refs/heads/master
i:
  159145: 01c169f
  159143: f0972ee
v: v3
  • Loading branch information
Zhu Yi authored and John W. Linville committed Jul 24, 2009
1 parent 93c8c55 commit c9d65c1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 71 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: b6c321718e1376b1a55afc63cce090a2c4573417
refs/heads/master: 6e5db0a8454b44bf88fa74cf437a507ec08f436d
43 changes: 1 addition & 42 deletions trunk/drivers/net/wireless/iwmc3200wifi/cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,34 +158,6 @@ static int iwm_key_init(struct iwm_key *key, u8 key_index,
return 0;
}

static int iwm_reset_profile(struct iwm_priv *iwm)
{
int ret;

if (!iwm->umac_profile_active)
return 0;

/*
* If there is a current active profile, but no
* default key, it's not worth trying to associate again.
*/
if (iwm->default_key < 0)
return 0;

/*
* Here we have an active profile, but a key setting changed.
* We thus have to invalidate the current profile, and push the
* new one. Keys will be pushed when association takes place.
*/
ret = iwm_invalidate_mlme_profile(iwm);
if (ret < 0) {
IWM_ERR(iwm, "Couldn't invalidate profile\n");
return ret;
}

return iwm_send_mlme_profile(iwm);
}

static int iwm_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev,
u8 key_index, const u8 *mac_addr,
struct key_params *params)
Expand Down Expand Up @@ -245,10 +217,6 @@ static int iwm_cfg80211_del_key(struct wiphy *wiphy, struct net_device *ndev,
if (key_index == iwm->default_key)
iwm->default_key = -1;

/* If the interface is down, we just cache this */
if (!test_bit(IWM_STATUS_READY, &iwm->status))
return 0;

return iwm_set_key(iwm, 1, key);
}

Expand All @@ -257,7 +225,6 @@ static int iwm_cfg80211_set_default_key(struct wiphy *wiphy,
u8 key_index)
{
struct iwm_priv *iwm = ndev_to_iwm(ndev);
int ret;

IWM_DBG_WEXT(iwm, DBG, "Default key index is: %d\n", key_index);

Expand All @@ -268,15 +235,7 @@ static int iwm_cfg80211_set_default_key(struct wiphy *wiphy,

iwm->default_key = key_index;

/* If the interface is down, we just cache this */
if (!test_bit(IWM_STATUS_READY, &iwm->status))
return 0;

ret = iwm_set_tx_key(iwm, key_index);
if (ret < 0)
return ret;

return iwm_reset_profile(iwm);
return iwm_set_tx_key(iwm, key_index);
}

int iwm_cfg80211_get_station(struct wiphy *wiphy, struct net_device *ndev,
Expand Down
29 changes: 1 addition & 28 deletions trunk/drivers/net/wireless/iwmc3200wifi/commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -584,12 +584,6 @@ int iwm_set_key(struct iwm_priv *iwm, bool remove, struct iwm_key *key)
struct iwm_umac_key_tkip *tkip = (struct iwm_umac_key_tkip *)cmd;
struct iwm_umac_key_ccmp *ccmp = (struct iwm_umac_key_ccmp *)cmd;

/*
* We check if our current profile is valid.
* If not, we dont push the key, we just cache them,
* so that with the next siwsessid call, the keys
* will be actually pushed.
*/
if (!remove) {
ret = iwm_check_profile(iwm);
if (ret < 0)
Expand Down Expand Up @@ -727,7 +721,7 @@ int iwm_set_key(struct iwm_priv *iwm, bool remove, struct iwm_key *key)

int iwm_send_mlme_profile(struct iwm_priv *iwm)
{
int ret, i;
int ret;
struct iwm_umac_profile profile;

memcpy(&profile, iwm->umac_profile, sizeof(profile));
Expand All @@ -742,27 +736,6 @@ int iwm_send_mlme_profile(struct iwm_priv *iwm)
return ret;
}

for (i = 0; i < IWM_NUM_KEYS; i++)
if (iwm->keys[i].key_len) {
struct iwm_key *key = &iwm->keys[i];

/* Wait for the profile before sending the keys */
wait_event_interruptible_timeout(iwm->mlme_queue,
(test_bit(IWM_STATUS_ASSOCIATING, &iwm->status) ||
test_bit(IWM_STATUS_ASSOCIATED, &iwm->status)),
3 * HZ);

ret = iwm_set_key(iwm, 0, key);
if (ret)
return ret;

if (iwm->default_key == i) {
ret = iwm_set_tx_key(iwm, i);
if (ret)
return ret;
}
}

return 0;
}

Expand Down

0 comments on commit c9d65c1

Please sign in to comment.