Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 278043
b: refs/heads/master
c: 6f2a73f
h: refs/heads/master
i:
  278041: 2ae7c29
  278039: 051909e
v: v3
  • Loading branch information
Vasanthakumar Thiagarajan authored and Kalle Valo committed Nov 11, 2011
1 parent 18f3c60 commit f82ea98
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 18 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: f74bac54a507a1b71be352d422b25cb5fd38db54
refs/heads/master: 6f2a73f9e5c7013e14cf898fead81a363cdf0548
21 changes: 12 additions & 9 deletions trunk/drivers/net/wireless/ath/ath6kl/cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
return -ENOENT;
}

key = &ar->keys[sme->key_idx];
key = &vif->keys[sme->key_idx];
key->key_len = sme->key_len;
memcpy(key->key, sme->key, key->key_len);
key->cipher = vif->prwise_crypto;
Expand Down Expand Up @@ -856,7 +856,7 @@ static int ath6kl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev,
return -ENOENT;
}

key = &ar->keys[key_index];
key = &vif->keys[key_index];
memset(key, 0, sizeof(struct ath6kl_key));

if (pairwise)
Expand Down Expand Up @@ -934,8 +934,9 @@ static int ath6kl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev,
*/
ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "Delay WEP key configuration "
"until AP mode has been started\n");
ar->wep_key_list[key_index].key_len = key->key_len;
memcpy(ar->wep_key_list[key_index].key, key->key, key->key_len);
vif->wep_key_list[key_index].key_len = key->key_len;
memcpy(vif->wep_key_list[key_index].key, key->key,
key->key_len);
return 0;
}

Expand All @@ -955,6 +956,7 @@ static int ath6kl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *ndev,
const u8 *mac_addr)
{
struct ath6kl *ar = (struct ath6kl *)ath6kl_priv(ndev);
struct ath6kl_vif *vif = netdev_priv(ndev);

ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: index %d\n", __func__, key_index);

Expand All @@ -968,13 +970,13 @@ static int ath6kl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *ndev,
return -ENOENT;
}

if (!ar->keys[key_index].key_len) {
if (!vif->keys[key_index].key_len) {
ath6kl_dbg(ATH6KL_DBG_WLAN_CFG,
"%s: index %d is empty\n", __func__, key_index);
return 0;
}

ar->keys[key_index].key_len = 0;
vif->keys[key_index].key_len = 0;

return ath6kl_wmi_deletekey_cmd(ar->wmi, key_index);
}
Expand All @@ -986,6 +988,7 @@ static int ath6kl_cfg80211_get_key(struct wiphy *wiphy, struct net_device *ndev,
struct key_params *))
{
struct ath6kl *ar = (struct ath6kl *)ath6kl_priv(ndev);
struct ath6kl_vif *vif = netdev_priv(ndev);
struct ath6kl_key *key = NULL;
struct key_params params;

Expand All @@ -1001,7 +1004,7 @@ static int ath6kl_cfg80211_get_key(struct wiphy *wiphy, struct net_device *ndev,
return -ENOENT;
}

key = &ar->keys[key_index];
key = &vif->keys[key_index];
memset(&params, 0, sizeof(params));
params.cipher = key->cipher;
params.key_len = key->key_len;
Expand Down Expand Up @@ -1038,14 +1041,14 @@ static int ath6kl_cfg80211_set_default_key(struct wiphy *wiphy,
return -ENOENT;
}

if (!ar->keys[key_index].key_len) {
if (!vif->keys[key_index].key_len) {
ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: invalid key index %d\n",
__func__, key_index);
return -EINVAL;
}

vif->def_txkey_index = key_index;
key = &ar->keys[vif->def_txkey_index];
key = &vif->keys[vif->def_txkey_index];
key_usage = GROUP_USAGE;
if (vif->prwise_crypto == WEP_CRYPT)
key_usage |= TX_USAGE;
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/net/wireless/ath/ath6kl/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,8 @@ struct ath6kl_vif {
u8 req_bssid[ETH_ALEN];
u16 ch_hint;
u16 bss_ch;
struct ath6kl_wep_key wep_key_list[WMI_MAX_KEY_INDEX + 1];
struct ath6kl_key keys[WMI_MAX_KEY_INDEX + 1];
};

/* Flag info */
Expand Down Expand Up @@ -441,7 +443,6 @@ struct ath6kl {
struct ath6kl_vif *vif;
spinlock_t lock;
struct semaphore sem;
struct ath6kl_wep_key wep_key_list[WMI_MAX_KEY_INDEX + 1];
u16 listen_intvl_b;
u16 listen_intvl_t;
u8 lrssi_roam_threshold;
Expand Down Expand Up @@ -480,7 +481,6 @@ struct ath6kl {
u8 rx_meta_ver;
struct wireless_dev *wdev;
struct cfg80211_scan_request *scan_req;
struct ath6kl_key keys[WMI_MAX_KEY_INDEX + 1];
enum sme_state sme_state;
enum wlan_low_pwr_state wlan_pwr_state;
struct wmi_scan_params_cmd sc_params;
Expand Down
5 changes: 3 additions & 2 deletions trunk/drivers/net/wireless/ath/ath6kl/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void ath6kl_init_profile_info(struct ath6kl *ar)
vif->prwise_crypto_len = 0;
vif->grp_crypto = NONE_CRYPT;
vif->grp_crypto_len = 0;
memset(ar->wep_key_list, 0, sizeof(ar->wep_key_list));
memset(vif->wep_key_list, 0, sizeof(vif->wep_key_list));
memset(vif->req_bssid, 0, sizeof(vif->req_bssid));
memset(vif->bssid, 0, sizeof(vif->bssid));
vif->bss_ch = 0;
Expand Down Expand Up @@ -248,11 +248,12 @@ static int ath6kl_init_service_ep(struct ath6kl *ar)

void ath6kl_init_control_info(struct ath6kl *ar)
{
/* TODO: Findout vif */
struct ath6kl_vif *vif = ar->vif;

ath6kl_init_profile_info(ar);
vif->def_txkey_index = 0;
memset(ar->wep_key_list, 0, sizeof(ar->wep_key_list));
memset(vif->wep_key_list, 0, sizeof(vif->wep_key_list));
vif->ch_hint = 0;
}

Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/net/wireless/ath/ath6kl/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ static void ath6kl_install_static_wep_keys(struct ath6kl *ar)
u8 keyusage;

for (index = WMI_MIN_KEY_INDEX; index <= WMI_MAX_KEY_INDEX; index++) {
if (ar->wep_key_list[index].key_len) {
if (vif->wep_key_list[index].key_len) {
keyusage = GROUP_USAGE;
if (index == vif->def_txkey_index)
keyusage |= TX_USAGE;
Expand All @@ -515,9 +515,9 @@ static void ath6kl_install_static_wep_keys(struct ath6kl *ar)
index,
WEP_CRYPT,
keyusage,
ar->wep_key_list[index].key_len,
vif->wep_key_list[index].key_len,
NULL,
ar->wep_key_list[index].key,
vif->wep_key_list[index].key,
KEY_OP_INIT_VAL, NULL,
NO_SYNC_WMIFLAG);
}
Expand Down Expand Up @@ -1384,7 +1384,7 @@ void ath6kl_disconnect_event(struct ath6kl *ar, u8 reason, u8 *bssid,
}

if (memcmp(ar->net_dev->dev_addr, bssid, ETH_ALEN) == 0) {
memset(ar->wep_key_list, 0, sizeof(ar->wep_key_list));
memset(vif->wep_key_list, 0, sizeof(vif->wep_key_list));
clear_bit(CONNECTED, &vif->flags);
}
return;
Expand Down

0 comments on commit f82ea98

Please sign in to comment.