Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

wil6210: Don't use wdev->sme_state

sme_state is private wdev's variable.
Track connection state internally

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Vladimir Kondratiev and committed by
John W. Linville
b338f74e adc2d122

+13 -13
+4
drivers/net/wireless/ath/wil6210/cfg80211.c
··· 322 322 * FW don't support scan after connection attempt 323 323 */ 324 324 set_bit(wil_status_dontscan, &wil->status); 325 + set_bit(wil_status_fwconnecting, &wil->status); 325 326 326 327 rc = wmi_send(wil, WMI_CONNECT_CMDID, &conn, sizeof(conn)); 327 328 if (rc == 0) { 328 329 /* Connect can take lots of time */ 329 330 mod_timer(&wil->connect_timer, 330 331 jiffies + msecs_to_jiffies(2000)); 332 + } else { 333 + clear_bit(wil_status_dontscan, &wil->status); 334 + clear_bit(wil_status_fwconnecting, &wil->status); 331 335 } 332 336 333 337 out:
+6 -12
drivers/net/wireless/ath/wil6210/main.c
··· 56 56 { 57 57 uint i; 58 58 struct net_device *ndev = wil_to_ndev(wil); 59 - struct wireless_dev *wdev = wil->wdev; 60 59 61 60 wil_dbg_misc(wil, "%s()\n", __func__); 62 61 63 62 wil_link_off(wil); 64 - clear_bit(wil_status_fwconnected, &wil->status); 65 - 66 - switch (wdev->sme_state) { 67 - case CFG80211_SME_CONNECTED: 68 - cfg80211_disconnected(ndev, WLAN_STATUS_UNSPECIFIED_FAILURE, 63 + if (test_bit(wil_status_fwconnected, &wil->status)) { 64 + clear_bit(wil_status_fwconnected, &wil->status); 65 + cfg80211_disconnected(ndev, 66 + WLAN_STATUS_UNSPECIFIED_FAILURE, 69 67 NULL, 0, GFP_KERNEL); 70 - break; 71 - case CFG80211_SME_CONNECTING: 68 + } else if (test_bit(wil_status_fwconnecting, &wil->status)) { 72 69 cfg80211_connect_result(ndev, bssid, NULL, 0, NULL, 0, 73 70 WLAN_STATUS_UNSPECIFIED_FAILURE, 74 71 GFP_KERNEL); 75 - break; 76 - default: 77 - break; 78 72 } 79 - 73 + clear_bit(wil_status_fwconnecting, &wil->status); 80 74 for (i = 0; i < ARRAY_SIZE(wil->vring_tx); i++) 81 75 wil_vring_fini_tx(wil, i); 82 76
+1
drivers/net/wireless/ath/wil6210/wil6210.h
··· 186 186 187 187 enum { /* for wil6210_priv.status */ 188 188 wil_status_fwready = 0, 189 + wil_status_fwconnecting, 189 190 wil_status_fwconnected, 190 191 wil_status_dontscan, 191 192 wil_status_reset_done,
+2 -1
drivers/net/wireless/ath/wil6210/wmi.c
··· 409 409 410 410 if ((wdev->iftype == NL80211_IFTYPE_STATION) || 411 411 (wdev->iftype == NL80211_IFTYPE_P2P_CLIENT)) { 412 - if (wdev->sme_state != CFG80211_SME_CONNECTING) { 412 + if (!test_bit(wil_status_fwconnecting, &wil->status)) { 413 413 wil_err(wil, "Not in connecting state\n"); 414 414 return; 415 415 } ··· 433 433 434 434 cfg80211_new_sta(ndev, evt->bssid, &sinfo, GFP_KERNEL); 435 435 } 436 + clear_bit(wil_status_fwconnecting, &wil->status); 436 437 set_bit(wil_status_fwconnected, &wil->status); 437 438 438 439 /* FIXME FW can transmit only ucast frames to peer */