static INT CFG80211_VirtualIF_Close(struct net_device *dev_p) { struct rtmp_adapter *pAd; pAd = RTMP_OS_NETDEV_GET_PRIV(dev_p); ASSERT(pAd); DBGPRINT(RT_DEBUG_TRACE, ("%s: ===> %s\n", __FUNCTION__, RTMP_OS_NETDEV_GET_DEVNAME(dev_p))); RTMP_OS_NETDEV_STOP_QUEUE(dev_p); if (netif_carrier_ok(dev_p)) netif_carrier_off(dev_p); #ifdef CONFIG_STA_SUPPORT if (INFRA_ON(pAd)) AsicEnableBssSync(pAd); else if (ADHOC_ON(pAd)) AsicEnableIbssSync(pAd); #else else AsicDisableSync(pAd); #endif //VIRTUAL_IF_DOWN(pAd); RT_MOD_DEC_USE_COUNT(); return 0; }
VOID RTMP_CFG80211_VirtualIF_Remove( IN struct rtmp_adapter *pAd, IN struct net_device * dev_p, IN uint32_t DevType) { bool isGoOn = false; struct rtmp_wifi_dev *wdev; if (dev_p) { RTMP_CFG80211_RemoveVifEntry(pAd, dev_p); RTMP_OS_NETDEV_STOP_QUEUE(dev_p); { /* Never Opened When New Netdevice on */ RtmpOSNetDevDetach(dev_p); } if (dev_p->ieee80211_ptr) { kfree(dev_p->ieee80211_ptr); dev_p->ieee80211_ptr = NULL; } } }
/* ======================================================================== Routine Description: Close a virtual network interface. Arguments: pDev which WLAN network interface Return Value: 0: close successfully otherwise: close fail Note: ======================================================================== */ INT MBSS_Close(PNET_DEV pDev) { PRTMP_ADAPTER pAd; INT BssId; pAd = RTMP_OS_NETDEV_GET_PRIV(pDev); BssId = RT28xx_MBSS_IdxGet(pAd, pDev); if (BssId < 0) return -1; RTMP_OS_NETDEV_STOP_QUEUE(pDev); /* kick out all stas behind the Bss */ MbssKickOutStas(pAd, BssId, REASON_DISASSOC_INACTIVE); pAd->ApCfg.MBSSID[BssId].bBcnSntReq = FALSE; APMakeAllBssBeacon(pAd); APUpdateAllBeaconFrame(pAd); #ifdef MESH_SUPPORT MeshMakeBeacon(pAd, MESH_BEACON_IDX(pAd)); MeshUpdateBeaconFrame(pAd, MESH_BEACON_IDX(pAd)); #endif /* MESH_SUPPORT */ return 0; }
VOID RTMP_CFG80211_DummyP2pIf_Remove( IN VOID *pAdSrc) { PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)pAdSrc; PCFG80211_CTRL cfg80211_ctrl = &pAd->cfg80211_ctrl; PNET_DEV dummy_p2p_net_dev = (PNET_DEV)cfg80211_ctrl->dummy_p2p_net_dev; DBGPRINT(RT_DEBUG_TRACE, (" %s =====> \n", __FUNCTION__)); RtmpOSNetDevProtect(1); if (dummy_p2p_net_dev) { RTMP_OS_NETDEV_STOP_QUEUE(dummy_p2p_net_dev); RtmpOSNetDevDetach(dummy_p2p_net_dev); if (dummy_p2p_net_dev->ieee80211_ptr) { kfree(dummy_p2p_net_dev->ieee80211_ptr); dummy_p2p_net_dev->ieee80211_ptr = NULL; } RtmpOSNetDevProtect(0); RtmpOSNetDevFree(dummy_p2p_net_dev); RtmpOSNetDevProtect(1); cfg80211_ctrl->flg_cfg_dummy_p2p_init = FALSE; } RtmpOSNetDevProtect(0); DBGPRINT(RT_DEBUG_TRACE, (" %s <=====\n", __FUNCTION__)); }
/* ======================================================================== Routine Description: Close a virtual network interface. Arguments: dev_p which WLAN network interface Return Value: 0: close successfully otherwise: close fail Note: ======================================================================== */ INT ApCli_VirtualIF_Close( IN PNET_DEV dev_p) { UCHAR ifIndex; PRTMP_ADAPTER pAd; pAd = RTMP_OS_NETDEV_GET_PRIV(dev_p); ASSERT(pAd); DBGPRINT(RT_DEBUG_TRACE, ("%s: ===> %s\n", __FUNCTION__, RTMP_OS_NETDEV_GET_DEVNAME(dev_p))); for (ifIndex = 0; ifIndex < MAX_APCLI_NUM; ifIndex++) { if (pAd->ApCfg.ApCliTab[ifIndex].dev == dev_p) { RTMP_OS_NETDEV_STOP_QUEUE(dev_p); // send disconnect-req to sta State Machine. if (pAd->ApCfg.ApCliTab[ifIndex].Enable) { MlmeEnqueue(pAd, APCLI_CTRL_STATE_MACHINE, APCLI_CTRL_DISCONNECT_REQ, 0, NULL, ifIndex); RTMP_MLME_HANDLER(pAd); DBGPRINT(RT_DEBUG_TRACE, ("(%s) ApCli interface[%d] startdown.\n", __FUNCTION__, ifIndex)); } break; } } VIRTUAL_IF_DOWN(pAd); RT_MOD_DEC_USE_COUNT(); return 0; } /* End of ApCli_VirtualIF_Close */
/* ======================================================================== Routine Description: Close a virtual network interface. Arguments: pDev which WLAN network interface Return Value: 0: close successfully otherwise: close fail Note: ======================================================================== */ INT MBSS_VirtualIF_Close( IN PNET_DEV pDev) { PRTMP_ADAPTER pAd; INT BssId; DBGPRINT(RT_DEBUG_TRACE, ("%s: ===> MBSSVirtualIF_close\n", RTMP_OS_NETDEV_GET_DEVNAME(pDev))); pAd = RTMP_OS_NETDEV_GET_PRIV(pDev); BssId = RT28xx_MBSS_IdxGet(pAd, pDev); if (BssId < 0) return -1; RTMP_OS_NETDEV_STOP_QUEUE(pDev); /* kick out all stas behind the Bss */ MbssKickOutStas(pAd, BssId, REASON_DISASSOC_INACTIVE); pAd->ApCfg.MBSSID[BssId].bBcnSntReq = FALSE; APMakeAllBssBeacon(pAd); APUpdateAllBeaconFrame(pAd); VIRTUAL_IF_DOWN(pAd); RT_MOD_DEC_USE_COUNT(); return 0; } /* End of MBSS_VirtualIF_Close */
VOID RTMP_CFG80211_DummyP2pIf_Remove( IN struct rtmp_adapter *pAd) { PCFG80211_CTRL cfg80211_ctrl = &pAd->cfg80211_ctrl; struct net_device *dummy_p2p_net_dev = (PNET_DEV)cfg80211_ctrl->dummy_p2p_net_dev; DBGPRINT(RT_DEBUG_TRACE, (" %s =====> \n", __FUNCTION__)); RtmpOSNetDevProtect(1); if (dummy_p2p_net_dev) { RTMP_OS_NETDEV_STOP_QUEUE(dummy_p2p_net_dev); RtmpOSNetDevDetach(dummy_p2p_net_dev); if (dummy_p2p_net_dev->ieee80211_ptr) { kfree(dummy_p2p_net_dev->ieee80211_ptr); dummy_p2p_net_dev->ieee80211_ptr = NULL; } RtmpOSNetDevProtect(0); RtmpOSNetDevFree(dummy_p2p_net_dev); RtmpOSNetDevProtect(1); cfg80211_ctrl->flg_cfg_dummy_p2p_init = false; } RtmpOSNetDevProtect(0); DBGPRINT(RT_DEBUG_TRACE, (" %s <=====\n", __FUNCTION__)); }
static INT CFG80211_VirtualIF_Close(PNET_DEV dev_p) { VOID *pAdSrc; pAdSrc = RTMP_OS_NETDEV_GET_PRIV(dev_p); ASSERT(pAdSrc); PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)pAdSrc; #ifdef RT_CFG80211_P2P_SUPPORT if (dev_p->ieee80211_ptr->iftype == RT_CMD_80211_IFTYPE_P2P_CLIENT) { DBGPRINT(RT_DEBUG_TRACE, ("CFG80211_VirtualIF_Close\n")); CFG80211OS_ScanEnd(pAd->pCfg80211_CB, TRUE); RT_MOD_DEC_USE_COUNT(); return ApCli_Close(pAd, dev_p); } #endif /* RT_CFG80211_P2P_SUPPORT */ DBGPRINT(RT_DEBUG_TRACE, ("%s: ===> %s\n", __FUNCTION__, RTMP_OS_NETDEV_GET_DEVNAME(dev_p))); RTMP_OS_NETDEV_STOP_QUEUE(dev_p); if (netif_carrier_ok(dev_p)) netif_carrier_off(dev_p); else AsicDisableSync(pAd); //VIRTUAL_IF_DOWN(pAd); RT_MOD_DEC_USE_COUNT(); return 0; }
VOID RTMP_CFG80211_VirtualIF_Remove( IN VOID *pAdSrc, IN PNET_DEV dev_p, IN UINT32 DevType) { PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)pAdSrc; BOOLEAN isGoOn = FALSE; struct wifi_dev *wdev; if (dev_p) { RTMP_CFG80211_RemoveVifEntry(pAd, dev_p); RTMP_OS_NETDEV_STOP_QUEUE(dev_p); #ifdef RT_CFG80211_P2P_SUPPORT pAd->cfg80211_ctrl.Cfg80211VifDevSet.isGoingOn = FALSE; isGoOn = RTMP_CFG80211_VIF_P2P_GO_ON(pAd); if (isGoOn) { RtmpOSNetDevDetach(dev_p); pAd->ApCfg.MBSSID[MAIN_MBSSID].MSSIDDev = NULL; } else if (pAd->flg_apcli_init) { wdev = &pAd->ApCfg.ApCliTab[MAIN_MBSSID].wdev; OPSTATUS_CLEAR_FLAG(pAd, fOP_AP_STATUS_MEDIA_STATE_CONNECTED); cfg80211_disconnected(dev_p, 0, NULL, 0, GFP_KERNEL); NdisZeroMemory(pAd->ApCfg.ApCliTab[MAIN_MBSSID].CfgApCliBssid, MAC_ADDR_LEN); RtmpOSNetDevDetach(dev_p); rtmp_wdev_idx_unreg(pAd, wdev); pAd->flg_apcli_init = FALSE; wdev->if_dev = NULL; } else #endif /* RT_CFG80211_P2P_SUPPORT */ { /* Never Opened When New Netdevice on */ RtmpOSNetDevDetach(dev_p); } if (dev_p->ieee80211_ptr) { kfree(dev_p->ieee80211_ptr); dev_p->ieee80211_ptr = NULL; } } }
static INT CFG80211_VirtualIF_Close(PNET_DEV dev_p) { VOID *pAdSrc; pAdSrc = RTMP_OS_NETDEV_GET_PRIV(dev_p); ASSERT(pAdSrc); PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)pAdSrc; #ifdef RT_CFG80211_P2P_SUPPORT if (dev_p->ieee80211_ptr->iftype == RT_CMD_80211_IFTYPE_P2P_CLIENT) { DBGPRINT(RT_DEBUG_TRACE, ("CFG80211_VirtualIF_Close\n")); CFG80211OS_ScanEnd(pAd->pCfg80211_CB, TRUE); RT_MOD_DEC_USE_COUNT(); return ApCli_Close(pAd, dev_p); } #endif /* RT_CFG80211_P2P_SUPPORT */ #ifdef CONFIG_SNIFFER_SUPPORT #ifdef CONFIG_AP_SUPPORT if(dev_p->ieee80211_ptr->iftype == RT_CMD_80211_IFTYPE_MONITOR) { pAd->ApCfg.BssType = BSS_INFRA; AsicSetRxFilter(pAd); } #endif /*CONFIG_AP_SUPPORT*/ #endif /*CONFIG_SNIFFER_SUPPORT*/ DBGPRINT(RT_DEBUG_TRACE, ("%s: ===> %s\n", __FUNCTION__, RTMP_OS_NETDEV_GET_DEVNAME(dev_p))); RTMP_OS_NETDEV_STOP_QUEUE(dev_p); if (netif_carrier_ok(dev_p)) netif_carrier_off(dev_p); #ifdef CONFIG_STA_SUPPORT if (INFRA_ON(pAd)) AsicEnableBssSync(pAd); else if (ADHOC_ON(pAd)) AsicEnableIbssSync(pAd); #else else AsicDisableSync(pAd); #endif //VIRTUAL_IF_DOWN(pAd); RT_MOD_DEC_USE_COUNT(); return 0; }
BOOLEAN blockNetIf(BLOCK_QUEUE_ENTRY *pBlockQueueEntry, PNET_DEV pNetDev) { NETIF_ENTRY *pNetIfEntry = NULL; if ((pNetIfEntry = (NETIF_ENTRY *)removeHeadList(&freeNetIfEntryList)) != NULL) { RTMP_OS_NETDEV_STOP_QUEUE(pNetDev); pNetIfEntry->pNetDev = pNetDev; insertTailList(&pBlockQueueEntry->NetIfList, (RT_LIST_ENTRY *)pNetIfEntry); pBlockQueueEntry->SwTxQueueBlockFlag = TRUE; MTWF_LOG(DBG_CAT_ALL, DBG_SUBCAT_ALL, DBG_LVL_TRACE, ("RTMP_OS_NETDEV_STOP_QUEUE(%s)\n", RTMP_OS_NETDEV_GET_DEVNAME(pNetDev))); } else return FALSE; return TRUE; }
/* ======================================================================== Routine Description: Close a virtual network interface. Arguments: pDev which WLAN network interface Return Value: 0: close successfully otherwise: close fail Note: ======================================================================== */ INT MBSS_VirtualIF_Close(struct net_device *pDev) { VOID *pAd; DBGPRINT(RT_DEBUG_TRACE, ("%s: ===> MBSSVirtualIF_close\n", RTMP_OS_NETDEV_GET_DEVNAME(pDev))); pAd = RTMP_OS_NETDEV_GET_PRIV(pDev); RTMP_OS_NETDEV_STOP_QUEUE(pDev); RTMP_AP_IoctlHandle(pAd, NULL, CMD_RTPRIV_IOCTL_MBSS_CLOSE, 0, pDev, 0); VIRTUAL_IF_DOWN(pAd); RT_MOD_DEC_USE_COUNT(); return 0; }
INT WdsVirtualIF_close(PNET_DEV dev) { VOID *pAd; MTWF_LOG(DBG_CAT_ALL, DBG_SUBCAT_ALL, DBG_LVL_TRACE, ("%s: ===> VirtualIF_close\n", RTMP_OS_NETDEV_GET_DEVNAME(dev))); pAd = RTMP_OS_NETDEV_GET_PRIV(dev); //RTMP_OS_NETDEV_CARRIER_OFF(dev); RTMP_OS_NETDEV_STOP_QUEUE(dev); VIRTUAL_IF_DOWN(pAd); RT_MOD_DEC_USE_COUNT(); return 0; }
INT WdsVirtualIF_close( IN PNET_DEV dev) { VOID *pAd; DBGPRINT(RT_DEBUG_TRACE, ("%s: ===> VirtualIF_close\n", RTMP_OS_NETDEV_GET_DEVNAME(dev))); pAd = RTMP_OS_NETDEV_GET_PRIV(dev); //RTMP_OS_NETDEV_CARRIER_OFF(dev); RTMP_OS_NETDEV_STOP_QUEUE(dev); VIRTUAL_IF_DOWN(pAd); RT_MOD_DEC_USE_COUNT(); return 0; }
static INT CFG80211_VirtualIF_Close(PNET_DEV dev_p) { VOID *pAdSrc; pAdSrc = RTMP_OS_NETDEV_GET_PRIV(dev_p); ASSERT(pAdSrc); PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)pAdSrc; if ((dev_p->ieee80211_ptr->iftype == RT_CMD_80211_IFTYPE_P2P_CLIENT) #ifdef CFG80211_MULTI_STA || (dev_p->ieee80211_ptr->iftype == RT_CMD_80211_IFTYPE_STATION) #endif /* CFG80211_MULTI_STA */ ) { DBGPRINT(RT_DEBUG_TRACE, ("CFG80211_VirtualIF_Close\n")); CFG80211OS_ScanEnd(pAd->pCfg80211_CB, TRUE); if (pAd->cfg80211_ctrl.FlgCfg80211Scanning) pAd->cfg80211_ctrl.FlgCfg80211Scanning = FALSE; RT_MOD_DEC_USE_COUNT(); return ApCli_Close(pAd, dev_p); } DBGPRINT(RT_DEBUG_TRACE, ("%s: ===> %s\n", __FUNCTION__, RTMP_OS_NETDEV_GET_DEVNAME(dev_p))); RTMP_OS_NETDEV_STOP_QUEUE(dev_p); if (netif_carrier_ok(dev_p)) netif_carrier_off(dev_p); if (INFRA_ON(pAd)) AsicEnableBssSync(pAd, pAd->CommonCfg.BeaconPeriod); else if (ADHOC_ON(pAd)) AsicEnableIbssSync(pAd); else AsicDisableSync(pAd); //VIRTUAL_IF_DOWN(pAd); RT_MOD_DEC_USE_COUNT(); return 0; }
BOOLEAN blockNetIf( IN PBLOCK_QUEUE_ENTRY pBlockQueueEntry, IN PNET_DEV pNetDev) { PNETIF_ENTRY pNetIfEntry = NULL; if ((pNetIfEntry = (PNETIF_ENTRY)removeHeadList(&freeNetIfEntryList)) != NULL) { RTMP_OS_NETDEV_STOP_QUEUE(pNetDev); pNetIfEntry->pNetDev = pNetDev; insertTailList(&pBlockQueueEntry->NetIfList, (PLIST_ENTRY)pNetIfEntry); pBlockQueueEntry->SwTxQueueBlockFlag = TRUE; DBGPRINT(RT_DEBUG_TRACE, ("RTMP_OS_NETDEV_STOP_QUEUE(%s)\n", RTMP_OS_NETDEV_GET_DEVNAME(pNetDev))); } else return FALSE; return TRUE; }
/* ======================================================================== Routine Description: Close a virtual network interface. Arguments: dev_p which WLAN network interface Return Value: 0: close successfully otherwise: close fail Note: ======================================================================== */ int P2P_VirtualIF_Close( IN PNET_DEV dev_p) { VOID *pAd; pAd = RTMP_OS_NETDEV_GET_PRIV(dev_p); ASSERT(pAd); DBGPRINT(RT_DEBUG_TRACE, ("%s: ===> %s\n", __FUNCTION__, RTMP_OS_NETDEV_GET_DEVNAME(dev_p))); /* stop p2p. */ RTMP_OS_NETDEV_STOP_QUEUE(dev_p); RTMP_COM_IoctlHandle(pAd, NULL, CMD_RTPRIV_IOCTL_P2P_CLOSE, 0, dev_p, 0); VIRTUAL_IF_DOWN(pAd); RT_MOD_DEC_USE_COUNT(); return 0; }
/* ======================================================================== Routine Description: Close a virtual network interface. Arguments: pDev which WLAN network interface Return Value: 0: close successfully otherwise: close fail Note: ======================================================================== */ int MBSS_Close( IN PNET_DEV pDev) { PRTMP_ADAPTER pAd; int BssId; pAd = RTMP_OS_NETDEV_GET_PRIV(pDev); BssId = RT28xx_MBSS_IdxGet(pAd, pDev); if (BssId < 0) return -1; RTMP_OS_NETDEV_STOP_QUEUE(pDev); /* kick out all stas behind the Bss */ MbssKickOutStas(pAd, BssId, REASON_DISASSOC_INACTIVE); pAd->ApCfg.MBSSID[BssId].bBcnSntReq = FALSE; APMakeAllBssBeacon(pAd); APUpdateAllBeaconFrame(pAd); return 0; }
VOID RTMP_CFG80211_VirtualIF_Remove( IN VOID *pAdSrc, IN PNET_DEV dev_p, IN UINT32 DevType) { PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)pAdSrc; BOOLEAN isGoOn = FALSE; struct wifi_dev *wdev; #ifdef RT_CFG80211_P2P_SUPPORT UINT apidx = CFG_GO_BSSID_IDX; #else UINT apidx = MAIN_MBSSID; #endif /*RT_CFG80211_P2P_SUPPORT*/ if (dev_p) { pAd->cfg80211_ctrl.Cfg80211VifDevSet.isGoingOn = FALSE; RTMP_CFG80211_RemoveVifEntry(pAd, dev_p); RTMP_OS_NETDEV_STOP_QUEUE(dev_p); #ifdef RT_CFG80211_P2P_CONCURRENT_DEVICE isGoOn = RTMP_CFG80211_VIF_P2P_GO_ON(pAd); if (isGoOn) { wdev = &pAd->ApCfg.MBSSID[apidx].wdev; BSS_STRUCT *pMbss = &pAd->ApCfg.MBSSID[CFG_GO_BSSID_IDX]; struct wifi_dev *pwdev = &pMbss->wdev; if (pAd->Mlme.bStartScc == TRUE) { pAd->Mlme.bStartScc = FALSE; AsicSwitchChannel(pAd, pAd->StaCfg.wdev.CentralChannel, FALSE); AsicLockChannel(pAd, pAd->StaCfg.wdev.CentralChannel); bbp_set_bw(pAd, pAd->StaCfg.wdev.bw); } pwdev->channel = 0; pwdev->CentralChannel= 0; pwdev->bw = 0; pwdev->extcha = EXTCHA_NONE; /*after p2p cli connect , neet to change to default configure*/ pAd->CommonCfg.RegTransmitSetting.field.EXTCHA = EXTCHA_BELOW; pAd->CommonCfg.RegTransmitSetting.field.BW = BW_40; pAd->CommonCfg.HT_Disable = 0; SetCommonHT(pAd); wdev_bcn_buf_deinit(pAd, &pAd->ApCfg.MBSSID[apidx].bcn_buf); RtmpOSNetDevDetach(dev_p); rtmp_wdev_idx_unreg(pAd, wdev); wdev->if_dev = NULL; } else #endif /* RT_CFG80211_P2P_CONCURRENT_DEVICE */ if (pAd->flg_apcli_init) { wdev = &pAd->ApCfg.ApCliTab[MAIN_MBSSID].wdev; //actually not mcc still need to check this! if (pAd->Mlme.bStartScc == TRUE) { printk("GC remove & switch to Infra BW = %d pAd->StaCfg.wdev.CentralChannel %d \n",pAd->StaCfg.wdev.bw,pAd->StaCfg.wdev.CentralChannel); pAd->Mlme.bStartScc = FALSE; AsicSwitchChannel(pAd, pAd->StaCfg.wdev.CentralChannel, FALSE); AsicLockChannel(pAd, pAd->StaCfg.wdev.CentralChannel); bbp_set_bw(pAd, pAd->StaCfg.wdev.bw); } wdev->CentralChannel = 0; wdev->channel= 0; wdev->bw = HT_BW_20; wdev->extcha = EXTCHA_NONE; OPSTATUS_CLEAR_FLAG(pAd, fOP_AP_STATUS_MEDIA_STATE_CONNECTED); cfg80211_disconnected(dev_p, 0, NULL, 0, GFP_KERNEL); NdisZeroMemory(pAd->ApCfg.ApCliTab[MAIN_MBSSID].CfgApCliBssid, MAC_ADDR_LEN); RtmpOSNetDevDetach(dev_p); rtmp_wdev_idx_unreg(pAd, wdev); pAd->flg_apcli_init = FALSE; wdev->if_dev = NULL; } else /* Never Opened When New Netdevice on */ { RtmpOSNetDevDetach(dev_p); } if (dev_p->ieee80211_ptr) { kfree(dev_p->ieee80211_ptr); dev_p->ieee80211_ptr = NULL; } } }
static INT CFG80211_DummyP2pIf_Close( IN PNET_DEV dev_p) { struct wireless_dev *wdev = dev_p->ieee80211_ptr; #ifdef RT_CFG80211_P2P_STATIC_CONCURRENT_DEVICE VOID *pAdSrc; pAdSrc = RTMP_OS_NETDEV_GET_PRIV(dev_p); ASSERT(pAdSrc); PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)pAdSrc; PCFG80211_CTRL cfg80211_ctrl = &pAd->cfg80211_ctrl; BOOLEAN isGoOn = FALSE; UINT apidx = 1; struct wifi_dev *Wdev; #endif /* RT_CFG80211_P2P_STATIC_CONCURRENT_DEVICE */ if (!wdev) return -EINVAL; #ifdef RT_CFG80211_P2P_STATIC_CONCURRENT_DEVICE if (pAd->flg_apcli_init) { DBGPRINT(RT_DEBUG_TRACE, ("ApCli_Close\n")); CFG80211OS_ScanEnd(pAd->pCfg80211_CB, TRUE); // RT_MOD_DEC_USE_COUNT(); ApCli_Close(pAd, dev_p); } DBGPRINT(RT_DEBUG_TRACE, ("%s: ===> %s\n", __FUNCTION__, RTMP_OS_NETDEV_GET_DEVNAME(dev_p))); RTMP_OS_NETDEV_STOP_QUEUE(dev_p); if (INFRA_ON(pAd)) AsicEnableBssSync(pAd,100); else if (ADHOC_ON(pAd)) AsicEnableIbssSync(pAd); else AsicDisableSync(pAd); //VIRTUAL_IF_DOWN(pAd); if (cfg80211_ctrl->dummy_p2p_net_dev) { //iverson if (isGoOn) { Wdev = &pAd->ApCfg.MBSSID[apidx].wdev; wdev_bcn_buf_deinit(pAd, &pAd->ApCfg.MBSSID[apidx].bcn_buf); rtmp_wdev_idx_unreg(pAd, Wdev); Wdev->if_dev = NULL; } else if (pAd->flg_apcli_init) { Wdev = &pAd->ApCfg.ApCliTab[MAIN_MBSSID].wdev; OPSTATUS_CLEAR_FLAG(pAd, fOP_AP_STATUS_MEDIA_STATE_CONNECTED); cfg80211_disconnected(dev_p, 0, NULL, 0, GFP_KERNEL); CFG80211OS_ScanEnd(pAd->pCfg80211_CB, TRUE); NdisZeroMemory(pAd->ApCfg.ApCliTab[MAIN_MBSSID].CfgApCliBssid, MAC_ADDR_LEN); // RtmpOSNetDevDetach(dev_p); rtmp_wdev_idx_unreg(pAd, Wdev); pAd->flg_apcli_init = FALSE; // Wdev->if_dev = NULL; } } AsicSetBssid(pAd, pAd->cfg80211_ctrl.P2PCurrentAddress, 0x1); AsicSetBssid(pAd, pAd->CurrentAddress, 0x0); #endif /* RT_CFG80211_P2P_STATIC_CONCURRENT_DEVICE */ wdev->wiphy->interface_modes = (wdev->wiphy->interface_modes) & (~(BIT(NL80211_IFTYPE_P2P_CLIENT) | BIT(NL80211_IFTYPE_P2P_GO) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)) | BIT(RT_CMD_80211_IFTYPE_P2P_DEVICE) #endif /* LINUX_VERSION_CODE: 3.7.0 */ )); #ifdef RT_CFG80211_P2P_STATIC_CONCURRENT_DEVICE RT_MOD_DEC_USE_COUNT(); #endif /* RT_CFG80211_P2P_STATIC_CONCURRENT_DEVICE */ return 0; }