kfree(msg);
}
-u8 wilc_connected_ssid[6] = {0};
static void handle_connect(struct work_struct *work)
{
struct host_if_msg *msg = container_of(work, struct host_if_msg, work);
return;
}
- if (memcmp(conn_attr->bssid, wilc_connected_ssid, ETH_ALEN) == 0) {
- netdev_err(vif->ndev, "Discard connect request\n");
- goto error;
- }
-
bss_param = conn_attr->params;
if (!bss_param) {
netdev_err(vif->ndev, "Required BSSID not found\n");
cur_byte = wid_list[wid_cnt].val;
wid_cnt++;
- if (conn_attr->bssid)
- memcpy(wilc_connected_ssid,
- conn_attr->bssid, ETH_ALEN);
-
result = wilc_send_config_pkt(vif, SET_CFG, wid_list,
wid_cnt,
wilc_get_vif_idx(vif));
kfree(hif_drv->usr_conn_req.ies);
hif_drv->usr_conn_req.ies = NULL;
- eth_zero_addr(wilc_connected_ssid);
-
out:
kfree(msg);
}
}
}
- if (mac_status == MAC_STATUS_CONNECTED &&
- conn_info.status != WLAN_STATUS_SUCCESS) {
- netdev_err(vif->ndev,
- "Received MAC status is MAC_STATUS_CONNECTED, Assoc Resp is not SUCCESS\n");
- eth_zero_addr(wilc_connected_ssid);
- } else if (mac_status == MAC_STATUS_DISCONNECTED) {
- netdev_err(vif->ndev, "Received MAC status is MAC_STATUS_DISCONNECTED\n");
- eth_zero_addr(wilc_connected_ssid);
- }
-
if (hif_drv->usr_conn_req.bssid) {
memcpy(conn_info.bssid, hif_drv->usr_conn_req.bssid, 6);
vif->obtaining_ip = false;
wilc_set_power_mgmt(vif, 0, 0);
- eth_zero_addr(wilc_connected_ssid);
-
result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1,
wilc_get_vif_idx(vif));
connect_status = WLAN_STATUS_UNSPECIFIED_FAILURE;
wilc_wlan_set_bssid(priv->dev, null_bssid,
STATION_MODE);
- eth_zero_addr(wilc_connected_ssid);
if (!wfi_drv->p2p_connect)
wlan_channel = INVALID_CHANNEL;
wilc_ie = false;
eth_zero_addr(priv->associated_bss);
wilc_wlan_set_bssid(priv->dev, null_bssid, STATION_MODE);
- eth_zero_addr(wilc_connected_ssid);
if (!wfi_drv->p2p_connect)
wlan_channel = INVALID_CHANNEL;
nw_info = &priv->scanned_shadow[sel_bssi_idx];
} else {
ret = -ENOENT;
- vif->connecting = false;
- return ret;
+ goto out_error;
+ }
+
+ if (ether_addr_equal_unaligned(vif->bssid, nw_info->bssid)) {
+ ret = -EALREADY;
+ goto out_error;
}
memset(priv->wep_key, 0, sizeof(priv->wep_key));
ret = -ENOTSUPP;
netdev_err(dev, "%s: Unsupported cipher\n",
__func__);
- vif->connecting = false;
- return ret;
+ goto out_error;
}
}
security, auth_type,
nw_info->ch,
nw_info->join_params);
- if (ret != 0) {
+ if (ret) {
+ u8 null_bssid[ETH_ALEN] = {0};
+
netdev_err(dev, "wilc_set_join_req(): Error\n");
ret = -ENOENT;
- vif->connecting = false;
- return ret;
+ wilc_wlan_set_bssid(dev, null_bssid, STATION_MODE);
+ goto out_error;
}
+ return 0;
+out_error:
+ vif->connecting = false;
return ret;
}