aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/wilc1000
diff options
context:
space:
mode:
authorAjay Singh <ajay.kathat@microchip.com>2019-02-02 19:17:07 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-02-04 12:38:41 +0100
commit0ae6cb7a24b253609b577bc0710771a327c5339c (patch)
tree29c26ba38461386b79f7e88b26896932ad480050 /drivers/staging/wilc1000
parentstaging: wilc1000: rename timeout related macros (diff)
downloadlinux-dev-0ae6cb7a24b253609b577bc0710771a327c5339c.tar.xz
linux-dev-0ae6cb7a24b253609b577bc0710771a327c5339c.zip
staging: wilc1000: make use of iface type to identify p2p interface
Remove SSID string compare instead use interface type check for p2p client interface. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wilc1000')
-rw-r--r--drivers/staging/wilc1000/host_interface.h1
-rw-r--r--drivers/staging/wilc1000/wilc_wfi_cfgoperations.c19
2 files changed, 6 insertions, 14 deletions
diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h
index 7f3fc4c8cb8f..8fa97a7af03e 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -153,7 +153,6 @@ struct host_if_drv {
struct remain_ch remain_on_ch;
u8 remain_on_ch_pending;
u64 p2p_timeout;
- u8 p2p_connect;
enum host_if_state hif_state;
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 95230d745e3b..faffcc866b1e 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -159,7 +159,7 @@ static void cfg_connect_result(enum conn_event conn_disconn_evt, u8 mac_status,
connect_status = WLAN_STATUS_UNSPECIFIED_FAILURE;
wilc_wlan_set_bssid(priv->dev, NULL, WILC_STATION_MODE);
- if (!wfi_drv->p2p_connect)
+ if (vif->iftype != WILC_CLIENT_MODE)
wlan_channel = INVALID_CHANNEL;
netdev_err(dev, "Unspecified failure\n");
@@ -185,7 +185,7 @@ static void cfg_connect_result(enum conn_event conn_disconn_evt, u8 mac_status,
eth_zero_addr(priv->associated_bss);
wilc_wlan_set_bssid(priv->dev, NULL, WILC_STATION_MODE);
- if (!wfi_drv->p2p_connect)
+ if (vif->iftype != WILC_CLIENT_MODE)
wlan_channel = INVALID_CHANNEL;
if (wfi_drv->ifc_up && dev == wl->vif[1]->ndev)
@@ -329,11 +329,6 @@ static int connect(struct wiphy *wiphy, struct net_device *dev,
vif->connecting = true;
- if (!(strncmp(sme->ssid, "DIRECT-", 7)))
- wfi_drv->p2p_connect = 1;
- else
- wfi_drv->p2p_connect = 0;
-
memset(priv->wep_key, 0, sizeof(priv->wep_key));
memset(priv->wep_key_len, 0, sizeof(priv->wep_key_len));
@@ -436,7 +431,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev,
curr_channel = ieee80211_frequency_to_channel(bss->channel->center_freq);
- if (!wfi_drv->p2p_connect)
+ if (vif->iftype != WILC_CLIENT_MODE)
wlan_channel = curr_channel;
wilc_wlan_set_bssid(dev, bss->bssid, WILC_STATION_MODE);
@@ -452,7 +447,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev,
if (ret) {
netdev_err(dev, "wilc_set_join_req(): Error\n");
ret = -ENOENT;
- if (!wfi_drv->p2p_connect)
+ if (vif->iftype != WILC_CLIENT_MODE)
wlan_channel = INVALID_CHANNEL;
wilc_wlan_set_bssid(dev, NULL, WILC_STATION_MODE);
wfi_drv->conn_info.conn_result = NULL;
@@ -477,7 +472,6 @@ static int disconnect(struct wiphy *wiphy, struct net_device *dev,
struct wilc_priv *priv = wiphy_priv(wiphy);
struct wilc_vif *vif = netdev_priv(priv->dev);
struct wilc *wilc = vif->wilc;
- struct host_if_drv *wfi_drv;
int ret;
vif->connecting = false;
@@ -491,15 +485,14 @@ static int disconnect(struct wiphy *wiphy, struct net_device *dev,
return 0;
}
- wfi_drv = (struct host_if_drv *)priv->hif_drv;
- if (!wfi_drv->p2p_connect)
+ if (vif->iftype != WILC_CLIENT_MODE)
wlan_channel = INVALID_CHANNEL;
wilc_wlan_set_bssid(priv->dev, NULL, WILC_STATION_MODE);
priv->p2p.local_random = 0x01;
priv->p2p.recv_random = 0x00;
priv->p2p.is_wilc_ie = false;
- wfi_drv->p2p_timeout = 0;
+ priv->hif_drv->p2p_timeout = 0;
ret = wilc_disconnect(vif);
if (ret != 0) {