bssid = mac_header + 10;
bssid1 = mac_header + 4;
- for (i = 0; i < wilc->vif_num; i++)
- if (!memcmp(bssid1, wilc->vif[i]->bssid, ETH_ALEN) ||
- !memcmp(bssid, wilc->vif[i]->bssid, ETH_ALEN))
- return wilc->vif[i]->ndev;
-
- PRINT_INFO(INIT_DBG, "Invalide handle\n");
- for (i = 0; i < 25; i++)
- PRINT_D(INIT_DBG, "%02x ", mac_header[i]);
- bssid = mac_header + 18;
- bssid1 = mac_header + 12;
- for (i = 0; i < wilc->vif_num; i++)
- if (!memcmp(bssid1, wilc->vif[i]->bssid, ETH_ALEN) ||
- !memcmp(bssid, wilc->vif[i]->bssid, ETH_ALEN))
- return wilc->vif[i]->ndev;
+ for (i = 0; i < wilc->vif_num; i++) {
+ if (wilc->vif[i]->mode == STATION_MODE)
+ if (!memcmp(bssid, wilc->vif[i]->bssid, ETH_ALEN))
+ return wilc->vif[i]->ndev;
+ if (wilc->vif[i]->mode == AP_MODE)
+ if (!memcmp(bssid1, wilc->vif[i]->bssid, ETH_ALEN))
+ return wilc->vif[i]->ndev;
+ }
- PRINT_INFO(INIT_DBG, "\n");
return NULL;
}
-int wilc_wlan_set_bssid(struct net_device *wilc_netdev, u8 *bssid)
+int wilc_wlan_set_bssid(struct net_device *wilc_netdev, u8 *bssid, u8 mode)
{
int i = 0;
int ret = -1;
for (i = 0; i < wilc->vif_num; i++)
if (wilc->vif[i]->ndev == wilc_netdev) {
memcpy(wilc->vif[i]->bssid, bssid, 6);
+ wilc->vif[i]->mode = mode;
ret = 0;
break;
}
if ((u8MacStatus == MAC_DISCONNECTED) &&
(pstrConnectInfo->u16ConnectStatus == SUCCESSFUL_STATUSCODE)) {
u16ConnectStatus = WLAN_STATUS_UNSPECIFIED_FAILURE;
- wilc_wlan_set_bssid(priv->dev, NullBssid);
+ wilc_wlan_set_bssid(priv->dev, NullBssid,
+ STATION_MODE);
eth_zero_addr(wilc_connected_ssid);
if (!pstrWFIDrv->p2p_connect)
p2p_recv_random = 0x00;
wilc_ie = false;
eth_zero_addr(priv->au8AssociatedBss);
- wilc_wlan_set_bssid(priv->dev, NullBssid);
+ wilc_wlan_set_bssid(priv->dev, NullBssid, STATION_MODE);
eth_zero_addr(wilc_connected_ssid);
if (!pstrWFIDrv->p2p_connect)
if (!pstrWFIDrv->p2p_connect)
wlan_channel = pstrNetworkInfo->u8channel;
- wilc_wlan_set_bssid(dev, pstrNetworkInfo->au8bssid);
+ wilc_wlan_set_bssid(dev, pstrNetworkInfo->au8bssid, STATION_MODE);
s32Error = wilc_set_join_req(vif, pstrNetworkInfo->au8bssid, sme->ssid,
sme->ssid_len, sme->ie, sme->ie_len,
pstrWFIDrv = (struct host_if_drv *)priv->hWILCWFIDrv;
if (!pstrWFIDrv->p2p_connect)
wlan_channel = INVALID_CHANNEL;
- wilc_wlan_set_bssid(priv->dev, NullBssid);
+ wilc_wlan_set_bssid(priv->dev, NullBssid, STATION_MODE);
PRINT_D(CFG80211_DBG, "Disconnecting with reason code(%d)\n", reason_code);
if (s32Error != 0)
PRINT_ER("Error in setting channel\n");
- wilc_wlan_set_bssid(dev, wl->vif[0]->src_addr);
+ wilc_wlan_set_bssid(dev, wl->vif[0]->src_addr, AP_MODE);
s32Error = wilc_add_beacon(vif, settings->beacon_interval,
settings->dtim_period, beacon->head_len,
PRINT_D(HOSTAPD_DBG, "Deleting beacon\n");
- wilc_wlan_set_bssid(dev, NullBssid);
+ wilc_wlan_set_bssid(dev, NullBssid, AP_MODE);
s32Error = wilc_del_beacon(vif);
u8 bssid[ETH_ALEN];
struct host_if_drv *hif_drv;
struct net_device *ndev;
+ u8 mode;
};
struct wilc {
void wilc1000_wlan_deinit(struct net_device *dev);
void WILC_WFI_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size);
int wilc_wlan_get_firmware(struct net_device *dev);
-int wilc_wlan_set_bssid(struct net_device *wilc_netdev, u8 *bssid);
+int wilc_wlan_set_bssid(struct net_device *wilc_netdev, u8 *bssid, u8 mode);
#endif
int wilc_mac_open(struct net_device *ndev);
int wilc_mac_close(struct net_device *ndev);
-int wilc_wlan_set_bssid(struct net_device *wilc_netdev, u8 *pBSSID);
void WILC_WFI_p2p_rx(struct net_device *dev, u8 *buff, u32 size);
void host_wakeup_notify(struct wilc *wilc);
void host_sleep_notify(struct wilc *wilc);