Commit 8c8b65e3 authored by Vasanthakumar Thiagarajan's avatar Vasanthakumar Thiagarajan Committed by Kalle Valo

ath6kl: Move bssid 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 f5938f24
...@@ -363,7 +363,7 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, ...@@ -363,7 +363,7 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
vif->ssid_len == sme->ssid_len && vif->ssid_len == sme->ssid_len &&
!memcmp(vif->ssid, sme->ssid, vif->ssid_len)) { !memcmp(vif->ssid, sme->ssid, vif->ssid_len)) {
ar->reconnect_flag = true; ar->reconnect_flag = true;
status = ath6kl_wmi_reconnect_cmd(ar->wmi, ar->req_bssid, status = ath6kl_wmi_reconnect_cmd(ar->wmi, vif->req_bssid,
ar->ch_hint); ar->ch_hint);
up(&ar->sem); up(&ar->sem);
...@@ -384,9 +384,9 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, ...@@ -384,9 +384,9 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
if (sme->channel) if (sme->channel)
ar->ch_hint = sme->channel->center_freq; ar->ch_hint = sme->channel->center_freq;
memset(ar->req_bssid, 0, sizeof(ar->req_bssid)); memset(vif->req_bssid, 0, sizeof(vif->req_bssid));
if (sme->bssid && !is_broadcast_ether_addr(sme->bssid)) if (sme->bssid && !is_broadcast_ether_addr(sme->bssid))
memcpy(ar->req_bssid, sme->bssid, sizeof(ar->req_bssid)); memcpy(vif->req_bssid, sme->bssid, sizeof(vif->req_bssid));
ath6kl_set_wpa_version(ar, sme->crypto.wpa_versions); ath6kl_set_wpa_version(ar, sme->crypto.wpa_versions);
...@@ -461,7 +461,7 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, ...@@ -461,7 +461,7 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
vif->prwise_crypto_len, vif->prwise_crypto_len,
vif->grp_crypto, vif->grp_crypto_len, vif->grp_crypto, vif->grp_crypto_len,
vif->ssid_len, vif->ssid, vif->ssid_len, vif->ssid,
ar->req_bssid, ar->ch_hint, vif->req_bssid, ar->ch_hint,
ar->connect_ctrl_flags); ar->connect_ctrl_flags);
up(&ar->sem); up(&ar->sem);
...@@ -644,7 +644,7 @@ static int ath6kl_cfg80211_disconnect(struct wiphy *wiphy, ...@@ -644,7 +644,7 @@ static int ath6kl_cfg80211_disconnect(struct wiphy *wiphy,
vif->ssid_len = 0; vif->ssid_len = 0;
if (!test_bit(SKIP_SCAN, &ar->flag)) if (!test_bit(SKIP_SCAN, &ar->flag))
memset(ar->req_bssid, 0, sizeof(ar->req_bssid)); memset(vif->req_bssid, 0, sizeof(vif->req_bssid));
up(&ar->sem); up(&ar->sem);
...@@ -1071,10 +1071,13 @@ static int ath6kl_cfg80211_set_default_key(struct wiphy *wiphy, ...@@ -1071,10 +1071,13 @@ static int ath6kl_cfg80211_set_default_key(struct wiphy *wiphy,
void ath6kl_cfg80211_tkip_micerr_event(struct ath6kl *ar, u8 keyid, void ath6kl_cfg80211_tkip_micerr_event(struct ath6kl *ar, u8 keyid,
bool ismcast) bool ismcast)
{ {
/* TODO: Findout vif */
struct ath6kl_vif *vif = ar->vif;
ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, ath6kl_dbg(ATH6KL_DBG_WLAN_CFG,
"%s: keyid %d, ismcast %d\n", __func__, keyid, ismcast); "%s: keyid %d, ismcast %d\n", __func__, keyid, ismcast);
cfg80211_michael_mic_failure(ar->net_dev, ar->bssid, cfg80211_michael_mic_failure(ar->net_dev, vif->bssid,
(ismcast ? NL80211_KEYTYPE_GROUP : (ismcast ? NL80211_KEYTYPE_GROUP :
NL80211_KEYTYPE_PAIRWISE), keyid, NULL, NL80211_KEYTYPE_PAIRWISE), keyid, NULL,
GFP_KERNEL); GFP_KERNEL);
...@@ -1261,9 +1264,10 @@ static int ath6kl_cfg80211_join_ibss(struct wiphy *wiphy, ...@@ -1261,9 +1264,10 @@ static int ath6kl_cfg80211_join_ibss(struct wiphy *wiphy,
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
memset(ar->req_bssid, 0, sizeof(ar->req_bssid)); memset(vif->req_bssid, 0, sizeof(vif->req_bssid));
if (ibss_param->bssid && !is_broadcast_ether_addr(ibss_param->bssid)) if (ibss_param->bssid && !is_broadcast_ether_addr(ibss_param->bssid))
memcpy(ar->req_bssid, ibss_param->bssid, sizeof(ar->req_bssid)); memcpy(vif->req_bssid, ibss_param->bssid,
sizeof(vif->req_bssid));
ath6kl_set_wpa_version(ar, 0); ath6kl_set_wpa_version(ar, 0);
...@@ -1296,7 +1300,7 @@ static int ath6kl_cfg80211_join_ibss(struct wiphy *wiphy, ...@@ -1296,7 +1300,7 @@ static int ath6kl_cfg80211_join_ibss(struct wiphy *wiphy,
vif->prwise_crypto_len, vif->prwise_crypto_len,
vif->grp_crypto, vif->grp_crypto_len, vif->grp_crypto, vif->grp_crypto_len,
vif->ssid_len, vif->ssid, vif->ssid_len, vif->ssid,
ar->req_bssid, ar->ch_hint, vif->req_bssid, ar->ch_hint,
ar->connect_ctrl_flags); ar->connect_ctrl_flags);
set_bit(CONNECT_PEND, &vif->flags); set_bit(CONNECT_PEND, &vif->flags);
...@@ -1399,7 +1403,7 @@ static int ath6kl_get_station(struct wiphy *wiphy, struct net_device *dev, ...@@ -1399,7 +1403,7 @@ static int ath6kl_get_station(struct wiphy *wiphy, struct net_device *dev,
int ret; int ret;
u8 mcs; u8 mcs;
if (memcmp(mac, ar->bssid, ETH_ALEN) != 0) if (memcmp(mac, vif->bssid, ETH_ALEN) != 0)
return -ENOENT; return -ENOENT;
if (down_interruptible(&ar->sem)) if (down_interruptible(&ar->sem))
...@@ -1509,7 +1513,8 @@ static int ath6kl_flush_pmksa(struct wiphy *wiphy, struct net_device *netdev) ...@@ -1509,7 +1513,8 @@ static int ath6kl_flush_pmksa(struct wiphy *wiphy, struct net_device *netdev)
struct ath6kl_vif *vif = netdev_priv(netdev); struct ath6kl_vif *vif = netdev_priv(netdev);
if (test_bit(CONNECTED, &vif->flags)) if (test_bit(CONNECTED, &vif->flags))
return ath6kl_wmi_setpmkid_cmd(ar->wmi, ar->bssid, NULL, false); return ath6kl_wmi_setpmkid_cmd(ar->wmi, vif->bssid,
NULL, false);
return 0; return 0;
} }
......
...@@ -409,6 +409,8 @@ struct ath6kl_vif { ...@@ -409,6 +409,8 @@ struct ath6kl_vif {
u8 def_txkey_index; u8 def_txkey_index;
u8 next_mode; u8 next_mode;
u8 nw_type; u8 nw_type;
u8 bssid[ETH_ALEN];
u8 req_bssid[ETH_ALEN];
}; };
/* Flag info */ /* Flag info */
...@@ -438,8 +440,6 @@ struct ath6kl { ...@@ -438,8 +440,6 @@ struct ath6kl {
spinlock_t lock; spinlock_t lock;
struct semaphore sem; struct semaphore sem;
struct ath6kl_wep_key wep_key_list[WMI_MAX_KEY_INDEX + 1]; struct ath6kl_wep_key wep_key_list[WMI_MAX_KEY_INDEX + 1];
u8 bssid[ETH_ALEN];
u8 req_bssid[ETH_ALEN];
u16 ch_hint; u16 ch_hint;
u16 bss_ch; u16 bss_ch;
u16 listen_intvl_b; u16 listen_intvl_b;
......
...@@ -88,8 +88,8 @@ void ath6kl_init_profile_info(struct ath6kl *ar) ...@@ -88,8 +88,8 @@ void ath6kl_init_profile_info(struct ath6kl *ar)
vif->grp_crypto = NONE_CRYPT; vif->grp_crypto = NONE_CRYPT;
vif->grp_crypto_len = 0; vif->grp_crypto_len = 0;
memset(ar->wep_key_list, 0, sizeof(ar->wep_key_list)); memset(ar->wep_key_list, 0, sizeof(ar->wep_key_list));
memset(ar->req_bssid, 0, sizeof(ar->req_bssid)); memset(vif->req_bssid, 0, sizeof(vif->req_bssid));
memset(ar->bssid, 0, sizeof(ar->bssid)); memset(vif->bssid, 0, sizeof(vif->bssid));
ar->bss_ch = 0; ar->bss_ch = 0;
vif->nw_type = vif->next_mode = INFRA_NETWORK; vif->nw_type = vif->next_mode = INFRA_NETWORK;
} }
......
...@@ -464,7 +464,7 @@ void ath6kl_stop_endpoint(struct net_device *dev, bool keep_profile, ...@@ -464,7 +464,7 @@ void ath6kl_stop_endpoint(struct net_device *dev, bool keep_profile,
if (discon_issued) if (discon_issued)
ath6kl_disconnect_event(ar, DISCONNECT_CMD, ath6kl_disconnect_event(ar, DISCONNECT_CMD,
(vif->nw_type & AP_NETWORK) ? (vif->nw_type & AP_NETWORK) ?
bcast_mac : ar->bssid, bcast_mac : vif->bssid,
0, NULL, 0); 0, NULL, 0);
ar->user_key_ctrl = 0; ar->user_key_ctrl = 0;
...@@ -943,7 +943,7 @@ void ath6kl_deep_sleep_enable(struct ath6kl *ar) ...@@ -943,7 +943,7 @@ void ath6kl_deep_sleep_enable(struct ath6kl *ar)
switch (ar->sme_state) { switch (ar->sme_state) {
case SME_CONNECTING: case SME_CONNECTING:
cfg80211_connect_result(ar->net_dev, ar->bssid, NULL, 0, cfg80211_connect_result(ar->net_dev, vif->bssid, NULL, 0,
NULL, 0, NULL, 0,
WLAN_STATUS_UNSPECIFIED_FAILURE, WLAN_STATUS_UNSPECIFIED_FAILURE,
GFP_KERNEL); GFP_KERNEL);
...@@ -1057,7 +1057,7 @@ void ath6kl_connect_event(struct ath6kl *ar, u16 channel, u8 *bssid, ...@@ -1057,7 +1057,7 @@ void ath6kl_connect_event(struct ath6kl *ar, u16 channel, u8 *bssid,
assoc_req_len, assoc_resp_len, assoc_req_len, assoc_resp_len,
assoc_info); assoc_info);
memcpy(ar->bssid, bssid, sizeof(ar->bssid)); memcpy(vif->bssid, bssid, sizeof(vif->bssid));
ar->bss_ch = channel; ar->bss_ch = channel;
if ((vif->nw_type == INFRA_NETWORK)) if ((vif->nw_type == INFRA_NETWORK))
...@@ -1433,7 +1433,7 @@ void ath6kl_disconnect_event(struct ath6kl *ar, u8 reason, u8 *bssid, ...@@ -1433,7 +1433,7 @@ void ath6kl_disconnect_event(struct ath6kl *ar, u8 reason, u8 *bssid,
ar->user_key_ctrl = 0; ar->user_key_ctrl = 0;
netif_stop_queue(ar->net_dev); netif_stop_queue(ar->net_dev);
memset(ar->bssid, 0, sizeof(ar->bssid)); memset(vif->bssid, 0, sizeof(vif->bssid));
ar->bss_ch = 0; ar->bss_ch = 0;
ath6kl_tx_data_cleanup(ar); ath6kl_tx_data_cleanup(ar);
......
...@@ -988,7 +988,7 @@ static int ath6kl_wmi_bssinfo_event_rx(struct wmi *wmi, u8 *datap, int len) ...@@ -988,7 +988,7 @@ static int ath6kl_wmi_bssinfo_event_rx(struct wmi *wmi, u8 *datap, int len)
return -EINVAL; return -EINVAL;
if (bih->frame_type == BEACON_FTYPE && test_bit(CONNECTED, &vif->flags) if (bih->frame_type == BEACON_FTYPE && test_bit(CONNECTED, &vif->flags)
&& memcmp(bih->bssid, ar->bssid, ETH_ALEN) == 0) { && memcmp(bih->bssid, vif->bssid, ETH_ALEN) == 0) {
const u8 *tim; const u8 *tim;
tim = cfg80211_find_ie(WLAN_EID_TIM, buf + 8 + 2 + 2, tim = cfg80211_find_ie(WLAN_EID_TIM, buf + 8 + 2 + 2,
len - 8 - 2 - 2); len - 8 - 2 - 2);
......
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