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;
+ 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++)
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;
+ 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, "\n");
return NULL;
wilc = vif->wilc;
for (i = 0; i < wilc->vif_num; i++)
- if (wilc->vif[i].ndev == wilc_netdev) {
- memcpy(wilc->vif[i].bssid, bssid, 6);
+ if (wilc->vif[i]->ndev == wilc_netdev) {
+ memcpy(wilc->vif[i]->bssid, bssid, 6);
ret = 0;
break;
}
u8 ret_val = 0;
for (i = 0; i < wilc->vif_num; i++)
- if (memcmp(wilc->vif[i].bssid, null_bssid, 6))
+ if (memcmp(wilc->vif[i]->bssid, null_bssid, 6))
ret_val++;
return ret_val;
if (txq_count < FLOW_CONTROL_LOWER_THRESHOLD) {
PRINT_D(TX_DBG, "Waking up queue\n");
- if (netif_queue_stopped(wl->vif[0].ndev))
- netif_wake_queue(wl->vif[0].ndev);
- if (netif_queue_stopped(wl->vif[1].ndev))
- netif_wake_queue(wl->vif[1].ndev);
+ if (netif_queue_stopped(wl->vif[0]->ndev))
+ netif_wake_queue(wl->vif[0]->ndev);
+ if (netif_queue_stopped(wl->vif[1]->ndev))
+ netif_wake_queue(wl->vif[1]->ndev);
}
if (ret == WILC_TX_ERR_NO_BUF) {
PRINT_D(INIT_DBG, "Mac address: %pM\n", mac_add);
for (i = 0; i < wl->vif_num; i++) {
- if (ndev == wl->vif[i].ndev) {
- memcpy(wl->vif[i].src_addr, mac_add, ETH_ALEN);
- wl->vif[i].hif_drv = priv->hWILCWFIDrv;
+ if (ndev == wl->vif[i]->ndev) {
+ memcpy(wl->vif[i]->src_addr, mac_add, ETH_ALEN);
+ wl->vif[i]->hif_drv = priv->hWILCWFIDrv;
break;
}
}
- memcpy(ndev->dev_addr, wl->vif[i].src_addr, ETH_ALEN);
+ memcpy(ndev->dev_addr, wl->vif[i]->src_addr, ETH_ALEN);
if (!is_valid_ether_addr(ndev->dev_addr)) {
PRINT_ER("Error: Wrong MAC address\n");
PRINT_D(TX_DBG, "Adding tx packet to TX Queue\n");
vif->netstats.tx_packets++;
vif->netstats.tx_bytes += tx_data->size;
- tx_data->pBssid = wilc->vif[vif->u8IfIdx].bssid;
+ tx_data->pBssid = wilc->vif[vif->u8IfIdx]->bssid;
queue_count = wilc_wlan_txq_add_net_pkt(ndev, (void *)tx_data,
tx_data->buff, tx_data->size,
linux_wlan_tx_complete);
if (queue_count > FLOW_CONTROL_UPPER_THRESHOLD) {
- netif_stop_queue(wilc->vif[0].ndev);
- netif_stop_queue(wilc->vif[1].ndev);
+ netif_stop_queue(wilc->vif[0]->ndev);
+ netif_stop_queue(wilc->vif[1]->ndev);
}
return 0;
struct wilc_vif *vif;
for (i = 0; i < wilc->vif_num; i++) {
- vif = netdev_priv(wilc->vif[i].ndev);
+ vif = netdev_priv(wilc->vif[i]->ndev);
if (vif->monitor_flag) {
WILC_WFI_monitor_rx(buff, size);
return;
}
}
- vif = netdev_priv(wilc->vif[1].ndev);
+ vif = netdev_priv(wilc->vif[1]->ndev);
if ((buff[0] == vif->g_struct_frame_reg[0].frame_type && vif->g_struct_frame_reg[0].reg) ||
(buff[0] == vif->g_struct_frame_reg[1].frame_type && vif->g_struct_frame_reg[1].reg))
- WILC_WFI_p2p_rx(wilc->vif[1].ndev, buff, size);
+ WILC_WFI_p2p_rx(wilc->vif[1]->ndev, buff, size);
}
void wilc_netdev_cleanup(struct wilc *wilc)
int i = 0;
struct wilc_vif *vif[NUM_CONCURRENT_IFC];
- if (wilc && (wilc->vif[0].ndev || wilc->vif[1].ndev)) {
+ if (wilc && (wilc->vif[0]->ndev || wilc->vif[1]->ndev)) {
unregister_inetaddr_notifier(&g_dev_notifier);
for (i = 0; i < NUM_CONCURRENT_IFC; i++)
- vif[i] = netdev_priv(wilc->vif[i].ndev);
+ vif[i] = netdev_priv(wilc->vif[i]->ndev);
}
if (wilc && wilc->firmware)
release_firmware(wilc->firmware);
- if (wilc && (wilc->vif[0].ndev || wilc->vif[1].ndev)) {
+ if (wilc && (wilc->vif[0]->ndev || wilc->vif[1]->ndev)) {
wilc_lock_timeout(wilc, &close_exit_sync, 12 * 1000);
for (i = 0; i < NUM_CONCURRENT_IFC; i++)
- if (wilc->vif[i].ndev)
+ if (wilc->vif[i]->ndev)
if (vif[i]->mac_opened)
- wilc_mac_close(wilc->vif[i].ndev);
+ wilc_mac_close(wilc->vif[i]->ndev);
for (i = 0; i < NUM_CONCURRENT_IFC; i++) {
- unregister_netdev(wilc->vif[i].ndev);
- wilc_free_wiphy(wilc->vif[i].ndev);
- free_netdev(wilc->vif[i].ndev);
+ unregister_netdev(wilc->vif[i]->ndev);
+ wilc_free_wiphy(wilc->vif[i]->ndev);
+ free_netdev(wilc->vif[i]->ndev);
}
}
vif->u8IfIdx = wl->vif_num;
vif->wilc_netdev = ndev;
vif->wilc = *wilc;
- wl->vif[wl->vif_num].ndev = ndev;
+ wl->vif[i] = vif;
+ wl->vif[wl->vif_num]->ndev = ndev;
wl->vif_num++;
ndev->netdev_ops = &wilc_netdev_ops;
if (!pstrWFIDrv->p2p_connect)
wlan_channel = INVALID_CHANNEL;
- if ((pstrWFIDrv->IFC_UP) && (dev == wl->vif[1].ndev)) {
+ if ((pstrWFIDrv->IFC_UP) && (dev == wl->vif[1]->ndev)) {
pstrDisconnectNotifInfo->u16reason = 3;
- } else if ((!pstrWFIDrv->IFC_UP) && (dev == wl->vif[1].ndev)) {
+ } else if ((!pstrWFIDrv->IFC_UP) && (dev == wl->vif[1]->ndev)) {
pstrDisconnectNotifInfo->u16reason = 1;
}
cfg80211_disconnected(dev, pstrDisconnectNotifInfo->u16reason, pstrDisconnectNotifInfo->ie,
KeyLen = params->key_len - 16;
}
- if (!g_gtk_keys_saved && netdev == wl->vif[0].ndev) {
+ if (!g_gtk_keys_saved && netdev == wl->vif[0]->ndev) {
g_add_gtk_key_params.key_idx = key_index;
g_add_gtk_key_params.pairwise = pairwise;
if (!mac_addr) {
KeyLen = params->key_len - 16;
}
- if (!g_ptk_keys_saved && netdev == wl->vif[0].ndev) {
+ if (!g_ptk_keys_saved && netdev == wl->vif[0]->ndev) {
g_add_ptk_key_params.key_idx = key_index;
g_add_ptk_key_params.pairwise = pairwise;
if (!mac_addr) {
vif = netdev_priv(netdev);
wl = vif->wilc;
- if (netdev == wl->vif[0].ndev) {
+ if (netdev == wl->vif[0]->ndev) {
g_ptk_keys_saved = false;
g_gtk_keys_saved = false;
g_wep_keys_saved = false;
if (wl->initialized) {
wilc_del_all_rx_ba_session(priv->hWILCWFIDrv,
- wl->vif[0].bssid, TID);
+ wl->vif[0]->bssid, TID);
wilc_wait_msg_queue_idle();
up(&wl->cfg_event);
wilc_initialized = 1;
vif->iftype = interface_type;
- wilc_set_wfi_drv_handler(wl->vif[0].hif_drv);
- wilc_set_mac_address(wl->vif[0].hif_drv,
- wl->vif[0].src_addr);
+ wilc_set_wfi_drv_handler(wl->vif[0]->hif_drv);
+ wilc_set_mac_address(wl->vif[0]->hif_drv,
+ wl->vif[0]->src_addr);
wilc_set_operation_mode(priv->hWILCWFIDrv, STATION_MODE);
if (g_wep_keys_saved) {
- wilc_set_wep_default_keyid(wl->vif[0].hif_drv,
+ wilc_set_wep_default_keyid(wl->vif[0]->hif_drv,
g_key_wep_params.key_idx);
- wilc_add_wep_key_bss_sta(wl->vif[0].hif_drv,
+ wilc_add_wep_key_bss_sta(wl->vif[0]->hif_drv,
g_key_wep_params.key,
g_key_wep_params.key_len,
g_key_wep_params.key_idx);
PRINT_D(CFG80211_DBG, "gtk %x %x %x\n", g_key_gtk_params.key[0],
g_key_gtk_params.key[1],
g_key_gtk_params.key[2]);
- add_key(wl->vif[0].ndev->ieee80211_ptr->wiphy,
- wl->vif[0].ndev,
+ add_key(wl->vif[0]->ndev->ieee80211_ptr->wiphy,
+ wl->vif[0]->ndev,
g_add_ptk_key_params.key_idx,
g_add_ptk_key_params.pairwise,
g_add_ptk_key_params.mac_addr,
(struct key_params *)(&g_key_ptk_params));
- add_key(wl->vif[0].ndev->ieee80211_ptr->wiphy,
- wl->vif[0].ndev,
+ add_key(wl->vif[0]->ndev->ieee80211_ptr->wiphy,
+ wl->vif[0]->ndev,
g_add_gtk_key_params.key_idx,
g_add_gtk_key_params.pairwise,
g_add_gtk_key_params.mac_addr,
PRINT_D(HOSTAPD_DBG, "Interface type = NL80211_IFTYPE_P2P_CLIENT\n");
wilc_del_all_rx_ba_session(priv->hWILCWFIDrv,
- wl->vif[0].bssid, TID);
+ wl->vif[0]->bssid, TID);
dev->ieee80211_ptr->iftype = type;
priv->wdev->iftype = type;
wilc1000_wlan_init(dev, vif);
wilc_initialized = 1;
- wilc_set_wfi_drv_handler(wl->vif[0].hif_drv);
- wilc_set_mac_address(wl->vif[0].hif_drv,
- wl->vif[0].src_addr);
+ wilc_set_wfi_drv_handler(wl->vif[0]->hif_drv);
+ wilc_set_mac_address(wl->vif[0]->hif_drv,
+ wl->vif[0]->src_addr);
wilc_set_operation_mode(priv->hWILCWFIDrv, STATION_MODE);
if (g_wep_keys_saved) {
- wilc_set_wep_default_keyid(wl->vif[0].hif_drv,
+ wilc_set_wep_default_keyid(wl->vif[0]->hif_drv,
g_key_wep_params.key_idx);
- wilc_add_wep_key_bss_sta(wl->vif[0].hif_drv,
+ wilc_add_wep_key_bss_sta(wl->vif[0]->hif_drv,
g_key_wep_params.key,
g_key_wep_params.key_len,
g_key_wep_params.key_idx);
PRINT_D(CFG80211_DBG, "gtk %x %x %x\n", g_key_gtk_params.key[0],
g_key_gtk_params.key[1],
g_key_gtk_params.key[2]);
- add_key(wl->vif[0].ndev->ieee80211_ptr->wiphy,
- wl->vif[0].ndev,
+ add_key(wl->vif[0]->ndev->ieee80211_ptr->wiphy,
+ wl->vif[0]->ndev,
g_add_ptk_key_params.key_idx,
g_add_ptk_key_params.pairwise,
g_add_ptk_key_params.mac_addr,
(struct key_params *)(&g_key_ptk_params));
- add_key(wl->vif[0].ndev->ieee80211_ptr->wiphy,
- wl->vif[0].ndev,
+ add_key(wl->vif[0]->ndev->ieee80211_ptr->wiphy,
+ wl->vif[0]->ndev,
g_add_gtk_key_params.key_idx,
g_add_gtk_key_params.pairwise,
g_add_gtk_key_params.mac_addr,
jiffies + msecs_to_jiffies(during_ip_time));
wilc_set_power_mgmt(priv->hWILCWFIDrv, 0, 0);
wilc_del_all_rx_ba_session(priv->hWILCWFIDrv,
- wl->vif[0].bssid, TID);
+ wl->vif[0]->bssid, TID);
wilc_enable_ps = false;
PRINT_D(HOSTAPD_DBG, "Interface type = NL80211_IFTYPE_GO\n");
dev->ieee80211_ptr->iftype = type;
wilc1000_wlan_init(dev, vif);
wilc_initialized = 1;
- wilc_set_wfi_drv_handler(wl->vif[0].hif_drv);
- wilc_set_mac_address(wl->vif[0].hif_drv,
- wl->vif[0].src_addr);
+ wilc_set_wfi_drv_handler(wl->vif[0]->hif_drv);
+ wilc_set_mac_address(wl->vif[0]->hif_drv,
+ wl->vif[0]->src_addr);
wilc_set_operation_mode(priv->hWILCWFIDrv, AP_MODE);
if (g_wep_keys_saved) {
- wilc_set_wep_default_keyid(wl->vif[0].hif_drv,
+ wilc_set_wep_default_keyid(wl->vif[0]->hif_drv,
g_key_wep_params.key_idx);
- wilc_add_wep_key_bss_sta(wl->vif[0].hif_drv,
+ wilc_add_wep_key_bss_sta(wl->vif[0]->hif_drv,
g_key_wep_params.key,
g_key_wep_params.key_len,
g_key_wep_params.key_idx);
g_key_gtk_params.key[1],
g_key_gtk_params.key[2],
g_key_gtk_params.cipher);
- add_key(wl->vif[0].ndev->ieee80211_ptr->wiphy,
- wl->vif[0].ndev,
+ add_key(wl->vif[0]->ndev->ieee80211_ptr->wiphy,
+ wl->vif[0]->ndev,
g_add_ptk_key_params.key_idx,
g_add_ptk_key_params.pairwise,
g_add_ptk_key_params.mac_addr,
(struct key_params *)(&g_key_ptk_params));
- add_key(wl->vif[0].ndev->ieee80211_ptr->wiphy,
- wl->vif[0].ndev,
+ add_key(wl->vif[0]->ndev->ieee80211_ptr->wiphy,
+ wl->vif[0]->ndev,
g_add_gtk_key_params.key_idx,
g_add_gtk_key_params.pairwise,
g_add_gtk_key_params.mac_addr,
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);
s32Error = wilc_add_beacon(priv->hWILCWFIDrv,
settings->beacon_interval,