Commit 3450334f authored by Vasanthakumar Thiagarajan's avatar Vasanthakumar Thiagarajan Committed by Kalle Valo

ath6kl: Move ssid and crypto information to vif structure

Signed-off-by: default avatarVasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent 59c98449
This diff is collapsed.
......@@ -398,6 +398,15 @@ struct ath6kl_vif {
struct net_device *ndev;
struct ath6kl *ar;
unsigned long flags;
int ssid_len;
u8 ssid[IEEE80211_MAX_SSID_LEN];
u8 dot11_auth_mode;
u8 auth_mode;
u8 prwise_crypto;
u8 prwise_crypto_len;
u8 grp_crypto;
u8 grp_crypto_len;
u8 def_txkey_index;
};
/* Flag info */
......@@ -426,17 +435,8 @@ struct ath6kl {
struct ath6kl_vif *vif;
spinlock_t lock;
struct semaphore sem;
int ssid_len;
u8 ssid[IEEE80211_MAX_SSID_LEN];
u8 next_mode;
u8 nw_type;
u8 dot11_auth_mode;
u8 auth_mode;
u8 prwise_crypto;
u8 prwise_crypto_len;
u8 grp_crypto;
u8 grp_crypto_len;
u8 def_txkey_index;
struct ath6kl_wep_key wep_key_list[WMI_MAX_KEY_INDEX + 1];
u8 bssid[ETH_ALEN];
u8 req_bssid[ETH_ALEN];
......
......@@ -75,15 +75,18 @@ struct sk_buff *ath6kl_buf_alloc(int size)
void ath6kl_init_profile_info(struct ath6kl *ar)
{
ar->ssid_len = 0;
memset(ar->ssid, 0, sizeof(ar->ssid));
ar->dot11_auth_mode = OPEN_AUTH;
ar->auth_mode = NONE_AUTH;
ar->prwise_crypto = NONE_CRYPT;
ar->prwise_crypto_len = 0;
ar->grp_crypto = NONE_CRYPT;
ar->grp_crypto_len = 0;
/* TODO: Findout vif */
struct ath6kl_vif *vif = ar->vif;
vif->ssid_len = 0;
memset(vif->ssid, 0, sizeof(vif->ssid));
vif->dot11_auth_mode = OPEN_AUTH;
vif->auth_mode = NONE_AUTH;
vif->prwise_crypto = NONE_CRYPT;
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(ar->req_bssid, 0, sizeof(ar->req_bssid));
memset(ar->bssid, 0, sizeof(ar->bssid));
......@@ -245,8 +248,10 @@ static int ath6kl_init_service_ep(struct ath6kl *ar)
void ath6kl_init_control_info(struct ath6kl *ar)
{
struct ath6kl_vif *vif = ar->vif;
ath6kl_init_profile_info(ar);
ar->def_txkey_index = 0;
vif->def_txkey_index = 0;
memset(ar->wep_key_list, 0, sizeof(ar->wep_key_list));
ar->ch_hint = 0;
}
......
......@@ -498,13 +498,15 @@ void ath6kl_stop_endpoint(struct net_device *dev, bool keep_profile,
static void ath6kl_install_static_wep_keys(struct ath6kl *ar)
{
/* TODO: Findout vif */
struct ath6kl_vif *vif = ar->vif;
u8 index;
u8 keyusage;
for (index = WMI_MIN_KEY_INDEX; index <= WMI_MAX_KEY_INDEX; index++) {
if (ar->wep_key_list[index].key_len) {
keyusage = GROUP_USAGE;
if (index == ar->def_txkey_index)
if (index == vif->def_txkey_index)
keyusage |= TX_USAGE;
ath6kl_wmi_addkey_cmd(ar->wmi,
......@@ -532,9 +534,9 @@ void ath6kl_connect_ap_mode_bss(struct ath6kl *ar, u16 channel)
ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "AP mode started on %u MHz\n", channel);
switch (ar->auth_mode) {
switch (vif->auth_mode) {
case NONE_AUTH:
if (ar->prwise_crypto == WEP_CRYPT)
if (vif->prwise_crypto == WEP_CRYPT)
ath6kl_install_static_wep_keys(ar);
break;
case WPA_PSK_AUTH:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment