Skip to content

Commit a1e36fc

Browse files
author
Adham Abozaeid
committed
wilc1000: staging: check if device is initialzied before changing vif
When killing hostapd, the interface is closed which deinitializes the device, then change virtual interface is called. This change checks if the device is initialized before sending the interface change command to the device Signed-off-by: Adham Abozaeid <[email protected]>
1 parent 1561726 commit a1e36fc

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

wilc/wilc_sdio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1174,5 +1174,5 @@ module_driver(wilc_sdio_driver,
11741174
sdio_register_driver,
11751175
sdio_unregister_driver);
11761176
MODULE_LICENSE("GPL");
1177-
MODULE_VERSION("15.3_RC2");
1177+
MODULE_VERSION("15.3");
11781178

wilc/wilc_spi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ static struct spi_driver wilc_spi_driver = {
238238
};
239239
module_spi_driver(wilc_spi_driver);
240240
MODULE_LICENSE("GPL");
241-
MODULE_VERSION("15.3_RC2");
241+
MODULE_VERSION("15.3");
242242

243243
static int spi_data_rsp(struct wilc *wilc, u8 cmd)
244244
{

wilc/wilc_wfi_cfgoperations.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1761,8 +1761,9 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
17611761
if (vif->iftype == WILC_AP_MODE || vif->iftype == WILC_GO_MODE)
17621762
wilc_wfi_deinit_mon_interface(wl, true);
17631763
vif->iftype = WILC_STATION_MODE;
1764-
wilc_set_operation_mode(vif, wilc_get_vif_idx(vif),
1765-
WILC_STATION_MODE, vif->idx);
1764+
if (wl->initialized)
1765+
wilc_set_operation_mode(vif, wilc_get_vif_idx(vif),
1766+
WILC_STATION_MODE, vif->idx);
17661767

17671768
memset(priv->assoc_stainfo.sta_associated_bss, 0,
17681769
WILC_MAX_NUM_STA * ETH_ALEN);
@@ -1776,8 +1777,9 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
17761777
priv->wdev.iftype = type;
17771778
vif->monitor_flag = 0;
17781779
vif->iftype = WILC_CLIENT_MODE;
1779-
wilc_set_operation_mode(vif, wilc_get_vif_idx(vif),
1780-
WILC_STATION_MODE, vif->idx);
1780+
if (wl->initialized)
1781+
wilc_set_operation_mode(vif, wilc_get_vif_idx(vif),
1782+
WILC_STATION_MODE, vif->idx);
17811783
break;
17821784

17831785
case NL80211_IFTYPE_AP:
@@ -1799,8 +1801,9 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
17991801
dev->ieee80211_ptr->iftype = type;
18001802
priv->wdev.iftype = type;
18011803
vif->iftype = WILC_GO_MODE;
1802-
wilc_set_operation_mode(vif, wilc_get_vif_idx(vif),
1803-
WILC_AP_MODE, vif->idx);
1804+
if (wl->initialized)
1805+
wilc_set_operation_mode(vif, wilc_get_vif_idx(vif),
1806+
WILC_AP_MODE, vif->idx);
18041807
break;
18051808
case NL80211_IFTYPE_MONITOR:
18061809
PRINT_INFO(vif->ndev, HOSTAPD_DBG,

0 commit comments

Comments
 (0)