diff --git a/Makefile b/Makefile index 4f823ee..b7e62a8 100755 --- a/Makefile +++ b/Makefile @@ -32,7 +32,6 @@ CONFIG_PCI_HCI = n CONFIG_SDIO_HCI = n CONFIG_GSPI_HCI = n -CONFIG_MP_INCLUDED = y CONFIG_POWER_SAVING = y CONFIG_USB_AUTOSUSPEND = n CONFIG_HW_PWRP_DETECTION = n @@ -298,10 +297,6 @@ _HAL_INTFS_FILES += hal/$(RTL871X)/$(HCI_NAME)/$(HCI_NAME)_ops_linux.o endif endif -ifeq ($(CONFIG_MP_INCLUDED), y) -_HAL_INTFS_FILES += hal/$(RTL871X)/$(RTL871X)_mp.o -endif - _HAL_INTFS_FILES += $(CHIP_FILES) @@ -321,11 +316,6 @@ EXTRA_CFLAGS += -DCONFIG_USB_AUTOSUSPEND endif endif -ifeq ($(CONFIG_MP_INCLUDED), y) -#MODULE_NAME := $(MODULE_NAME)_mp -EXTRA_CFLAGS += -DCONFIG_MP_INCLUDED -endif - ifeq ($(CONFIG_POWER_SAVING), y) EXTRA_CFLAGS += -DCONFIG_POWER_SAVING endif @@ -797,13 +787,6 @@ $(MODULE_NAME)-y += $(_HAL_INTFS_FILES) $(MODULE_NAME)-y += $(_OS_INTFS_FILES) -$(MODULE_NAME)-$(CONFIG_MP_INCLUDED) += core/rtw_mp.o \ - core/rtw_mp_ioctl.o -ifeq ($(CONFIG_RTL8723A), y) - -$(MODULE_NAME)-$(CONFIG_MP_INCLUDED)+= core/rtw_bt_mp.o -endif - obj-$(CONFIG_RTL8188EU) := $(MODULE_NAME).o else diff --git a/include/autoconf.h b/include/autoconf.h index ee37a3c..99381d8 100755 --- a/include/autoconf.h +++ b/include/autoconf.h @@ -85,7 +85,6 @@ //#define CONFIG_USB_INTERRUPT_IN_PIPE #endif -//#ifndef CONFIG_MP_INCLUDED #define CONFIG_IPS #ifdef CONFIG_IPS //#define CONFIG_IPS_LEVEL_2 //enable this to set default IPS mode to IPS_LEVEL_2 @@ -120,9 +119,6 @@ #endif #define CONFIG_IOL -//#else //#ifndef CONFIG_MP_INCLUDED - -//#endif //#ifndef CONFIG_MP_INCLUDED #define CONFIG_AP_MODE #ifdef CONFIG_AP_MODE @@ -269,14 +265,7 @@ //#define RTL8191C_FPGA_NETWORKTYPE_ADHOC 0 -#ifdef CONFIG_MP_INCLUDED - #define MP_DRIVER 1 - #define CONFIG_MP_IWPRIV_SUPPORT - //#undef CONFIG_USB_TX_AGGREGATION - //#undef CONFIG_USB_RX_AGGREGATION -#else #define MP_DRIVER 0 -#endif /* diff --git a/include/drv_types.h b/include/drv_types.h index 57bd517..1bad8d9 100755 --- a/include/drv_types.h +++ b/include/drv_types.h @@ -91,10 +91,6 @@ typedef struct _ADAPTER _adapter, ADAPTER,*PADAPTER; #include #endif -#ifdef CONFIG_MP_INCLUDED -#include -#endif - #ifdef CONFIG_BR_EXT #include #endif // CONFIG_BR_EXT @@ -503,9 +499,6 @@ struct _ADAPTER{ struct workqueue_struct *priv_checkbt_wq; struct delayed_work checkbt_work; #endif -#ifdef CONFIG_MP_INCLUDED - struct mp_priv mppriv; -#endif #ifdef CONFIG_DRVEXT_MODULE struct drvext_priv drvextpriv; diff --git a/include/rtw_ioctl.h b/include/rtw_ioctl.h index ad6ac5d..9202daf 100755 --- a/include/rtw_ioctl.h +++ b/include/rtw_ioctl.h @@ -103,16 +103,6 @@ struct oid_obj_priv { NDIS_STATUS (*oidfuns)(struct oid_par_priv *poid_par_priv); }; -#if (defined(CONFIG_MP_INCLUDED) && defined(_RTW_MP_IOCTL_C_)) || \ - (defined(PLATFORM_WINDOWS) && defined(_RTW_IOCTL_RTL_C_)) -static NDIS_STATUS oid_null_function(struct oid_par_priv* poid_par_priv) -{ - _func_enter_; - _func_exit_; - return NDIS_STATUS_SUCCESS; -} -#endif - #ifdef PLATFORM_WINDOWS int TranslateNdisPsToRtPs(IN NDIS_802_11_POWER_MODE ndisPsMode); diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index da7c494..5ddbbfe 100755 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -2211,17 +2211,6 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy } #endif //CONFIG_CONCURRENT_MODE -#ifdef CONFIG_MP_INCLUDED -if (padapter->registrypriv.mp_mode == 1) -{ - if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == _TRUE) - { - ret = -EPERM; - goto exit; - } -} -#endif - _enter_critical_bh(&pwdev_priv->scan_req_lock, &irqL); pwdev_priv->scan_request = request; _exit_critical_bh(&pwdev_priv->scan_req_lock, &irqL); diff --git a/os_dep/linux/ioctl_linux.c b/os_dep/linux/ioctl_linux.c index 81161bd..69158e9 100755 --- a/os_dep/linux/ioctl_linux.c +++ b/os_dep/linux/ioctl_linux.c @@ -31,18 +31,13 @@ #include #include -//#ifdef CONFIG_MP_INCLUDED #include -//#endif #ifdef CONFIG_USB_HCI #include #endif //CONFIG_USB_HCI #include -#ifdef CONFIG_MP_INCLUDED -#include -#endif //#ifdef CONFIG_MP_INCLUDED #ifdef CONFIG_RTL8192C #include #endif @@ -2003,26 +1998,6 @@ _func_enter_; #ifdef DBG_IOCTL DBG_871X("DBG_IOCTL %s:%d\n",__FUNCTION__, __LINE__); #endif -/* -#ifdef CONFIG_CONCURRENT_MODE - if(padapter->iface_type > PRIMARY_IFACE) - { - ret = -1; - goto exit; - } -#endif -*/ - -#ifdef CONFIG_MP_INCLUDED -if (padapter->registrypriv.mp_mode == 1) -{ - if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == _TRUE) - { - ret = -1; - goto exit; - } -} -#endif if(_FAIL == rtw_pwr_wakeup(padapter)) { ret= -1; @@ -3975,57 +3950,7 @@ static int rtw_mp_ioctl_hdl(struct net_device *dev, struct iw_request_info *info } //DBG_871X("%s: %d\n", __func__, poidparam->subcode); -#ifdef CONFIG_MP_INCLUDED -if (padapter->registrypriv.mp_mode == 1) -{ - phandler = mp_ioctl_hdl + poidparam->subcode; - - if ((phandler->paramsize != 0) && (poidparam->len < phandler->paramsize)) - { - RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_err_, - ("no matching drvext param size %d vs %d\r\n", - poidparam->len, phandler->paramsize)); - ret = -EINVAL; - goto _rtw_mp_ioctl_hdl_exit; - } - - if (phandler->handler) - { - oid_par.adapter_context = padapter; - oid_par.oid = phandler->oid; - oid_par.information_buf = poidparam->data; - oid_par.information_buf_len = poidparam->len; - oid_par.dbg = 0; - - BytesWritten = 0; - BytesNeeded = 0; - - if (bset) { - oid_par.bytes_rw = &BytesRead; - oid_par.bytes_needed = &BytesNeeded; - oid_par.type_of_oid = SET_OID; - } else { - oid_par.bytes_rw = &BytesWritten; - oid_par.bytes_needed = &BytesNeeded; - oid_par.type_of_oid = QUERY_OID; - } - - status = phandler->handler(&oid_par); - - //todo:check status, BytesNeeded, etc. - } - else { - DBG_871X("rtw_mp_ioctl_hdl(): err!, subcode=%d, oid=%d, handler=%p\n", - poidparam->subcode, phandler->oid, phandler->handler); - ret = -EFAULT; - goto _rtw_mp_ioctl_hdl_exit; - } -} -else -#endif -{ rtw_dbg_mode_hdl(padapter, poidparam->subcode, poidparam->data, poidparam->len); -} if (bset == 0x00) {//query info if (copy_to_user(p->pointer, pparmbuf, len)) @@ -10260,1741 +10185,6 @@ exit: return err; } -#if defined(CONFIG_MP_INCLUDED) && defined(CONFIG_MP_IWPRIV_SUPPORT) -/* - * Input Format: %s,%d,%d - * %s is width, could be - * "b" for 1 byte - * "w" for WORD (2 bytes) - * "dw" for DWORD (4 bytes) - * 1st %d is address(offset) - * 2st %d is data to write - */ -static int rtw_mp_write_reg(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *wrqu, char *extra) -{ - char *pch, *pnext, *ptmp; - char *width_str; - char width; - u32 addr, data; - int ret; - PADAPTER padapter = rtw_netdev_priv(dev); - char input[wrqu->length]; - - if (copy_from_user(input, wrqu->pointer, wrqu->length)) - return -EFAULT; - - _rtw_memset(extra, 0, wrqu->length); - - pch = input; - - pnext = strpbrk(pch, " ,.-"); - if (pnext == NULL) return -EINVAL; - *pnext = 0; - width_str = pch; - - pch = pnext + 1; - pnext = strpbrk(pch, " ,.-"); - if (pnext == NULL) return -EINVAL; - *pnext = 0; - addr = simple_strtoul(pch, &ptmp, 16); - if (addr > 0x3FFF) return -EINVAL; - - pch = pnext + 1; - if ((pch - extra) >= wrqu->length) return -EINVAL; - data = simple_strtoul(pch, &ptmp, 16); - - ret = 0; - width = width_str[0]; - switch (width) { - case 'b': - // 1 byte - if (data > 0xFF) { - ret = -EINVAL; - break; - } - rtw_write8(padapter, addr, data); - break; - case 'w': - // 2 bytes - if (data > 0xFFFF) { - ret = -EINVAL; - break; - } - rtw_write16(padapter, addr, data); - break; - case 'd': - // 4 bytes - rtw_write32(padapter, addr, data); - break; - default: - ret = -EINVAL; - break; - } - - return ret; -} - -/* - * Input Format: %s,%d - * %s is width, could be - * "b" for 1 byte - * "w" for WORD (2 bytes) - * "dw" for DWORD (4 bytes) - * %d is address(offset) - * - * Return: - * %d for data readed - */ -static int rtw_mp_read_reg(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *wrqu, char *extra) -{ - char input[wrqu->length]; - char *pch, *pnext, *ptmp; - char *width_str; - char width; - char data[20],tmp[20]; - u32 addr; - //u32 *data = (u32*)extra; - u32 ret, i=0, j=0, strtout=0; - PADAPTER padapter = rtw_netdev_priv(dev); - - - if (wrqu->length > 128) - return -EFAULT; - - if (copy_from_user(input, wrqu->pointer, wrqu->length)) - return -EFAULT; - - _rtw_memset(data, 0, 20); - _rtw_memset(tmp, 0, 20); - _rtw_memset(extra, 0, wrqu->length); - - pch = input; - pnext = strpbrk(pch, " ,.-"); - if (pnext == NULL) return -EINVAL; - *pnext = 0; - width_str = pch; - - pch = pnext + 1; - if ((pch - input) >= wrqu->length) return -EINVAL; - - addr = simple_strtoul(pch, &ptmp, 16); - if (addr > 0x3FFF) return -EINVAL; - - ret = 0; - width = width_str[0]; - switch (width) - { - case 'b': - // 1 byte - // *(u8*)data = rtw_read8(padapter, addr); - sprintf(extra, "%d\n", rtw_read8(padapter, addr)); - wrqu->length = strlen(extra); - break; - case 'w': - // 2 bytes - //*(u16*)data = rtw_read16(padapter, addr); - sprintf(data, "%04x\n", rtw_read16(padapter, addr)); - for( i=0 ; i <= strlen(data) ; i++) - { - if( i%2==0 ) - { - tmp[j]=' '; - j++; - } - if ( data[i] != '\0' ) - tmp[j] = data[i]; - - j++; - } - pch = tmp; - DBG_871X("pch=%s",pch); - - while( *pch != '\0' ) - { - pnext = strpbrk(pch, " "); - if (!pnext) - break; - - pnext++; - if ( *pnext != '\0' ) - { - strtout = simple_strtoul (pnext , &ptmp, 16); - sprintf( extra, "%s %d" ,extra ,strtout ); - } - else{ - break; - } - pch = pnext; - } - wrqu->length = 7; - break; - case 'd': - // 4 bytes - //*data = rtw_read32(padapter, addr); - sprintf(data, "%08x", rtw_read32(padapter, addr)); - //add read data format blank - for( i=0 ; i <= strlen(data) ; i++) - { - if( i%2==0 ) - { - tmp[j]=' '; - j++; - } - if ( data[i] != '\0' ) - tmp[j] = data[i]; - - j++; - } - pch = tmp; - DBG_871X("pch=%s",pch); - - while( *pch != '\0' ) - { - pnext = strpbrk(pch, " "); - if (!pnext) - break; - - pnext++; - if ( *pnext != '\0' ) - { - strtout = simple_strtoul (pnext , &ptmp, 16); - sprintf( extra, "%s %d" ,extra ,strtout ); - } - else{ - break; - } - pch = pnext; - } - wrqu->length = strlen(extra); - break; - - default: - wrqu->length = 0; - ret = -EINVAL; - break; - - } - - return ret; -} - -/* - * Input Format: %d,%x,%x - * %d is RF path, should be smaller than MAX_RF_PATH_NUMS - * 1st %x is address(offset) - * 2st %x is data to write - */ - static int rtw_mp_write_rf(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *wrqu, char *extra) -{ -/*static int rtw_mp_write_rf(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) -*/ - u32 path, addr, data; - int ret; - PADAPTER padapter = rtw_netdev_priv(dev); - char input[wrqu->length]; - - if (copy_from_user(input, wrqu->pointer, wrqu->length)) - return -EFAULT; - - - ret = sscanf(input, "%d,%x,%x", &path, &addr, &data); - if (ret < 3) return -EINVAL; - - if (path >= MAX_RF_PATH_NUMS) return -EINVAL; - if (addr > 0xFF) return -EINVAL; - if (data > 0xFFFFF) return -EINVAL; - - _rtw_memset(extra, 0, wrqu->length); - - write_rfreg(padapter, path, addr, data); - - sprintf(extra, "write_rf completed \n"); - wrqu->length = strlen(extra); - - return 0; -} - -/* - * Input Format: %d,%x - * %d is RF path, should be smaller than MAX_RF_PATH_NUMS - * %x is address(offset) - * - * Return: - * %d for data readed - */ -static int rtw_mp_read_rf(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *wrqu, char *extra) -{ - char input[wrqu->length]; - char *pch, *pnext, *ptmp; - char data[20],tmp[20]; - //u32 *data = (u32*)extra; - u32 path, addr; - u32 ret,i=0 ,j=0,strtou=0; - PADAPTER padapter = rtw_netdev_priv(dev); - - - if (wrqu->length > 128) return -EFAULT; - if (copy_from_user(input, wrqu->pointer, wrqu->length)) - return -EFAULT; - - ret = sscanf(input, "%d,%x", &path, &addr); - if (ret < 2) return -EINVAL; - - if (path >= MAX_RF_PATH_NUMS) return -EINVAL; - if (addr > 0xFF) return -EINVAL; - - _rtw_memset(extra, 0, wrqu->length); - - //*data = read_rfreg(padapter, path, addr); - sprintf(data, "%08x", read_rfreg(padapter, path, addr)); - //add read data format blank - for( i=0 ; i <= strlen(data) ; i++) - { - if( i%2==0 ) - { - tmp[j]=' '; - j++; - } - tmp[j] = data[i]; - j++; - } - pch = tmp; - DBG_871X("pch=%s",pch); - - while( *pch != '\0' ) - { - pnext = strpbrk(pch, " "); - pnext++; - if ( *pnext != '\0' ) - { - strtou = simple_strtoul (pnext , &ptmp, 16); - sprintf( extra, "%s %d" ,extra ,strtou ); - } - else{ - break; - } - pch = pnext; - } - wrqu->length = strlen(extra); - - return 0; -} - -static int rtw_mp_start(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *wrqu, char *extra) -{ - u8 val8; - PADAPTER padapter = rtw_netdev_priv(dev); - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); - struct dm_priv *pdmpriv = &pHalData->dmpriv; - struct hal_ops *pHalFunc = &padapter->HalFunc; -#ifdef CONFIG_BT_COEXIST - PBT30Info pBTInfo; - PBT_MGNT pBtMgnt; - - pBTInfo = GET_BT_INFO(padapter); - pBtMgnt = &pBTInfo->BtMgnt; -#endif - if(padapter->registrypriv.mp_mode ==0) - { - #ifdef CONFIG_RTL8723A - DBG_871X("_rtw_mp_xmit_priv for Download BT patch FW\n"); - _rtw_mp_xmit_priv(&padapter->xmitpriv); - #endif - - padapter->registrypriv.mp_mode =1; - rtw_pm_set_ips(padapter,IPS_NONE); - LeaveAllPowerSaveMode(padapter); - MPT_InitializeAdapter(padapter, 1); -#ifdef CONFIG_BT_COEXIST - pHalData->bt_coexist.BluetoothCoexist = 0; - pBtMgnt->ExtConfig.bManualControl = _TRUE; - pdmpriv->DMFlag &= (~DYNAMIC_FUNC_BT); - BT_HaltProcess(padapter); - DBG_871X("Set disable BT_COEXIST\n"); - //padapter->registrypriv.mp_mode =0; - //pHalFunc->hal_init(padapter); - //padapter->registrypriv.mp_mode =1; - // Force to switch Antenna to WiFi - rtw_write16(padapter, 0x870, 0x300); - rtw_write16(padapter, 0x860, 0x110); -#endif - } - - if (padapter->registrypriv.mp_mode == 0) - return -EPERM; - - if (padapter->mppriv.mode == MP_OFF) { - if (mp_start_test(padapter) == _FAIL) - return -EPERM; - padapter->mppriv.mode = MP_ON; - MPT_PwrCtlDM(padapter,0); - } - - return 0; -} - -static int rtw_mp_stop(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *wrqu, char *extra) -{ - PADAPTER padapter = rtw_netdev_priv(dev); - - if(padapter->registrypriv.mp_mode ==1) - { - MPT_DeInitAdapter(padapter); - padapter->registrypriv.mp_mode=0; - DBG_871X("rtw_mp_stop -> registrypriv.mp_mode=%d ",padapter->registrypriv.mp_mode); - - if (padapter->mppriv.mode != MP_OFF) { - //mp_stop_test(padapter); - padapter->mppriv.mode = MP_OFF; - } - } - - return 0; -} - -extern int wifirate2_ratetbl_inx(unsigned char rate); - -static int rtw_mp_rate(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *wrqu, char *extra) -{ - u32 rate = MPT_RATE_1M; - u8 input[wrqu->length]; - PADAPTER padapter = rtw_netdev_priv(dev); - - if (copy_from_user(input, wrqu->pointer, wrqu->length)) - return -EFAULT; - - rate = rtw_atoi(input); - sprintf( extra, "Set data rate to %d" , rate ); - - if(rate <= 0x7f) - rate = wifirate2_ratetbl_inx( (u8)rate); - else - rate =(rate-0x80+MPT_RATE_MCS0); - - //DBG_871X("%s: rate=%d\n", __func__, rate); - - if (rate >= MPT_RATE_LAST ) - return -EINVAL; - - padapter->mppriv.rateidx = rate; - Hal_SetDataRate(padapter); - - wrqu->length = strlen(extra) + 1; - return 0; -} - -static int rtw_mp_channel(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *wrqu, char *extra) -{ - - PADAPTER padapter = rtw_netdev_priv(dev); - u8 input[wrqu->length]; - u32 channel = 1; - - if (copy_from_user(input, wrqu->pointer, wrqu->length)) - return -EFAULT; - - channel = rtw_atoi(input); - //DBG_871X("%s: channel=%d\n", __func__, channel); - sprintf( extra, "Change channel %d to channel %d", padapter->mppriv.channel , channel ); - - padapter->mppriv.channel = channel; - Hal_SetChannel(padapter); - - wrqu->length = strlen(extra) + 1; - return 0; -} - -static int rtw_mp_bandwidth(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *wrqu, char *extra) -{ - u32 bandwidth=0, sg=0; - //u8 buffer[40]; - PADAPTER padapter = rtw_netdev_priv(dev); - //if (copy_from_user(buffer, (void*)wrqu->data.pointer, wrqu->data.length)) - // return -EFAULT; - - //DBG_871X("%s:iwpriv in=%s\n", __func__, extra); - - sscanf(extra, "40M=%d,shortGI=%d", &bandwidth, &sg); - - if (bandwidth != HT_CHANNEL_WIDTH_40) - bandwidth = HT_CHANNEL_WIDTH_20; - - //DBG_871X("%s: bw=%d sg=%d \n", __func__, bandwidth , sg); - - padapter->mppriv.bandwidth = (u8)bandwidth; - padapter->mppriv.preamble = sg; - - SetBandwidth(padapter); - - return 0; -} - -static int rtw_mp_txpower(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *wrqu, char *extra) -{ - u32 idx_a=0,idx_b=0,MsetPower=1; - u8 input[wrqu->length]; - - PADAPTER padapter = rtw_netdev_priv(dev); - - if (copy_from_user(input, wrqu->pointer, wrqu->length)) - return -EFAULT; - - MsetPower = strncmp(input, "off", 3); - sscanf(input,"patha=%d,pathb=%d",&idx_a,&idx_b); - //DBG_871X("%s: tx_pwr_idx_a=%x b=%x\n", __func__, idx_a, idx_b); - if(MsetPower==0) - { - padapter->mppriv.bSetTxPower = 0; - sprintf( extra, "MP Set power off"); - } - else - { - sprintf( extra, "Set power level path_A:%d path_B:%d", idx_a , idx_b ); - padapter->mppriv.txpoweridx = (u8)idx_a; - padapter->mppriv.txpoweridx_b = (u8)idx_b; - padapter->mppriv.bSetTxPower = 1; - Hal_SetAntennaPathPower(padapter); - } - wrqu->length = strlen(extra) + 1; - return 0; -} - -static int rtw_mp_ant_tx(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *wrqu, char *extra) -{ - u8 i; - u8 input[wrqu->length]; - u16 antenna = 0; - PADAPTER padapter = rtw_netdev_priv(dev); - - if (copy_from_user(input, wrqu->pointer, wrqu->length)) - return -EFAULT; - - //DBG_871X("%s: input=%s\n", __func__, input); - - sprintf( extra, "switch Tx antenna to %s", input ); - - for (i=0; i < strlen(input); i++) - { - switch(input[i]) - { - case 'a' : - antenna|=ANTENNA_A; - break; - case 'b': - antenna|=ANTENNA_B; - break; - } - } - //antenna |= BIT(extra[i]-'a'); - //DBG_871X("%s: antenna=0x%x\n", __func__, antenna); - padapter->mppriv.antenna_tx = antenna; - //DBG_871X("%s:mppriv.antenna_rx=%d\n", __func__, padapter->mppriv.antenna_tx); - - Hal_SetAntenna(padapter); - - wrqu->length = strlen(extra) + 1; - return 0; -} - -static int rtw_mp_ant_rx(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *wrqu, char *extra) -{ - u8 i; - u16 antenna = 0; - u8 input[wrqu->length]; - PADAPTER padapter = rtw_netdev_priv(dev); - - if (copy_from_user(input, wrqu->pointer, wrqu->length)) - return -EFAULT; - //DBG_871X("%s: input=%s\n", __func__, input); - _rtw_memset(extra, 0, wrqu->length); - - sprintf( extra, "switch Rx antenna to %s", input ); - - for (i=0; i < strlen(input); i++) { - - switch( input[i] ) - { - case 'a' : - antenna|=ANTENNA_A; - break; - case 'b': - antenna|=ANTENNA_B; - break; - } - } - - //DBG_871X("%s: antenna=0x%x\n", __func__, antenna); - padapter->mppriv.antenna_rx = antenna; - //DBG_871X("%s:mppriv.antenna_rx=%d\n", __func__, padapter->mppriv.antenna_rx); - Hal_SetAntenna(padapter); - wrqu->length = strlen(extra); - - return 0; -} - -static int rtw_mp_ctx(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *wrqu, char *extra) -{ - u32 pkTx = 1, countPkTx = 1, cotuTx = 1, CarrSprTx = 1, scTx = 1, sgleTx = 1, stop = 1; - u32 bStartTest = 1; - u32 count = 0; - struct mp_priv *pmp_priv; - struct pkt_attrib *pattrib; - - PADAPTER padapter = rtw_netdev_priv(dev); - - - pmp_priv = &padapter->mppriv; - - if (copy_from_user(extra, wrqu->pointer, wrqu->length)) - return -EFAULT; - - DBG_871X("%s: in=%s\n", __func__, extra); - - countPkTx = strncmp(extra, "count=", 5); // strncmp TRUE is 0 - cotuTx = strncmp(extra, "background", 20); - CarrSprTx = strncmp(extra, "background,cs", 20); - scTx = strncmp(extra, "background,sc", 20); - sgleTx = strncmp(extra, "background,stone", 20); - pkTx = strncmp(extra, "background,pkt", 20); - stop = strncmp(extra, "stop", 4); - sscanf(extra, "count=%d,pkt", &count); - - //DBG_871X("%s: count=%d countPkTx=%d cotuTx=%d CarrSprTx=%d scTx=%d sgleTx=%d pkTx=%d stop=%d\n", __func__, count, countPkTx, cotuTx, CarrSprTx, pkTx, sgleTx, scTx, stop); - _rtw_memset(extra, '\0', sizeof(extra)); - - if (stop == 0) { - bStartTest = 0; // To set Stop - pmp_priv->tx.stop = 1; - sprintf( extra, "Stop continuous Tx"); - } else { - bStartTest = 1; - if (pmp_priv->mode != MP_ON) { - if (pmp_priv->tx.stop != 1) { - DBG_871X("%s: MP_MODE != ON %d\n", __func__, pmp_priv->mode); - return -EFAULT; - } - } - } - - if (pkTx == 0 || countPkTx == 0) - pmp_priv->mode = MP_PACKET_TX; - if (sgleTx == 0) - pmp_priv->mode = MP_SINGLE_TONE_TX; - if (cotuTx == 0) - pmp_priv->mode = MP_CONTINUOUS_TX; - if (CarrSprTx == 0) - pmp_priv->mode = MP_CARRIER_SUPPRISSION_TX; - if (scTx == 0) - pmp_priv->mode = MP_SINGLE_CARRIER_TX; - - switch (pmp_priv->mode) - { - case MP_PACKET_TX: - - //DBG_871X("%s:pkTx %d\n", __func__,bStartTest); - if (bStartTest == 0) - { - pmp_priv->tx.stop = 1; - pmp_priv->mode = MP_ON; - sprintf( extra, "Stop continuous Tx"); - } - else if (pmp_priv->tx.stop == 1) - { - sprintf( extra, "Start continuous DA=ffffffffffff len=1500 count=%u,\n",count); - //DBG_871X("%s:countPkTx %d\n", __func__,count); - pmp_priv->tx.stop = 0; - pmp_priv->tx.count = count; - pmp_priv->tx.payload = 2; - pattrib = &pmp_priv->tx.attrib; - pattrib->pktlen = 1500; - _rtw_memset(pattrib->dst, 0xFF, ETH_ALEN); - SetPacketTx(padapter); - } - else { - //DBG_871X("%s: pkTx not stop\n", __func__); - return -EFAULT; - } - wrqu->length = strlen(extra); - return 0; - - case MP_SINGLE_TONE_TX: - //DBG_871X("%s: sgleTx %d \n", __func__, bStartTest); - if (bStartTest != 0){ - sprintf( extra, "Start continuous DA=ffffffffffff len=1500 \n infinite=yes."); - } - Hal_SetSingleToneTx(padapter, (u8)bStartTest); - break; - - case MP_CONTINUOUS_TX: - //DBG_871X("%s: cotuTx %d\n", __func__, bStartTest); - if (bStartTest != 0){ - sprintf( extra, "Start continuous DA=ffffffffffff len=1500 \n infinite=yes."); - } - Hal_SetContinuousTx(padapter, (u8)bStartTest); - break; - - case MP_CARRIER_SUPPRISSION_TX: - //DBG_871X("%s: CarrSprTx %d\n", __func__, bStartTest); - if (bStartTest != 0){ - if( pmp_priv->rateidx <= MPT_RATE_11M ) - { - sprintf( extra, "Start continuous DA=ffffffffffff len=1500 \n infinite=yes."); - Hal_SetCarrierSuppressionTx(padapter, (u8)bStartTest); - }else - sprintf( extra, "Specify carrier suppression but not CCK rate"); - } - break; - - case MP_SINGLE_CARRIER_TX: - //DBG_871X("%s: scTx %d\n", __func__, bStartTest); - if (bStartTest != 0){ - sprintf( extra, "Start continuous DA=ffffffffffff len=1500 \n infinite=yes."); - } - Hal_SetSingleCarrierTx(padapter, (u8)bStartTest); - break; - - default: - //DBG_871X("%s:No Match MP_MODE\n", __func__); - sprintf( extra, "Error! Continuous-Tx is not on-going."); - return -EFAULT; - } - - if ( bStartTest==1 && pmp_priv->mode != MP_ON) { - struct mp_priv *pmp_priv = &padapter->mppriv; - if (pmp_priv->tx.stop == 0) { - pmp_priv->tx.stop = 1; - //DBG_871X("%s: pkt tx is running...\n", __func__); - rtw_msleep_os(5); - } - pmp_priv->tx.stop = 0; - pmp_priv->tx.count = 1; - SetPacketTx(padapter); - } else { - pmp_priv->mode = MP_ON; - } - - wrqu->length = strlen(extra); - return 0; -} - - -static int rtw_mp_disable_bt_coexist(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) -{ - PADAPTER padapter = (PADAPTER)rtw_netdev_priv(dev); - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); - struct dm_priv *pdmpriv = &pHalData->dmpriv; - struct hal_ops *pHalFunc = &padapter->HalFunc; - - u8 input[wrqu->data.length]; - u32 bt_coexist; - -#ifdef CONFIG_BT_COEXIST - PBT30Info pBTInfo; - PBT_MGNT pBtMgnt; - - pBTInfo = GET_BT_INFO(padapter); - pBtMgnt = &pBTInfo->BtMgnt; -#endif - if (copy_from_user(input, wrqu->data.pointer, wrqu->data.length)) - return -EFAULT; - - bt_coexist = rtw_atoi(input); - - if( bt_coexist == 0 ) - { - RT_TRACE(_module_mp_, _drv_info_, - ("Set OID_RT_SET_DISABLE_BT_COEXIST: disable BT_COEXIST\n")); - DBG_871X("Set OID_RT_SET_DISABLE_BT_COEXIST: disable BT_COEXIST\n"); -#ifdef CONFIG_BT_COEXIST - pHalData->bt_coexist.BluetoothCoexist = 0; - pBtMgnt->ExtConfig.bManualControl = _TRUE; - pdmpriv->DMFlag &= (~DYNAMIC_FUNC_BT); - BT_HaltProcess(padapter); -#if 1 - padapter->registrypriv.mp_mode=0; - pHalFunc->hal_init(padapter); - padapter->registrypriv.mp_mode=1; -#endif - // Force to switch Antenna to WiFi - rtw_write16(padapter, 0x870, 0x300); - rtw_write16(padapter, 0x860, 0x110); -#endif - //BT_SetManualControl(pAdapter, TRUE); - } - else - { - RT_TRACE(_module_mp_, _drv_info_, - ("Set OID_RT_SET_DISABLE_BT_COEXIST: enable BT_COEXIST\n")); -#ifdef CONFIG_BT_COEXIST - pBtMgnt->ExtConfig.bManualControl = _FALSE; -#endif - //BT_SetManualControl(pAdapter, FALSE); - } - - return 0; -} - - -static int rtw_mp_arx(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *wrqu, char *extra) -{ - u8 bStartRx=0,bStopRx=0,bQueryPhy=0,bQueryMac=0; - u32 cckok=0,cckcrc=0,ofdmok=0,ofdmcrc=0,htok=0,htcrc=0,OFDM_FA=0,CCK_FA=0,DropPacket=0,vht_ok=0,vht_err=0; - u8 input[wrqu->length]; - u32 mac_cck_ok=0, mac_ofdm_ok=0, mac_ht_ok=0, mac_vht_ok=0; - u32 mac_cck_err=0, mac_ofdm_err=0, mac_ht_err=0, mac_vht_err=0; - PADAPTER padapter = rtw_netdev_priv(dev); - - - if (copy_from_user(input, wrqu->pointer, wrqu->length)) - return -EFAULT; - - DBG_871X("%s: %s\n", __func__, input); - - bStartRx = (strncmp(input, "start", 5)==0)?1:0; // strncmp TRUE is 0 - bStopRx = (strncmp(input, "stop", 5)==0)?1:0; // strncmp TRUE is 0 - bQueryPhy = (strncmp(input, "phy", 3)==0)?1:0; // strncmp TRUE is 0 - bQueryMac = (strncmp(input, "mac", 3)==0)?1:0; // strncmp TRUE is 0 - - if(bStartRx) - { - sprintf( extra, "start"); - SetPacketRx(padapter, bStartRx); - } - else if(bStopRx) - { - SetPacketRx(padapter, 0); - sprintf( extra, "Received packet OK:%d CRC error:%d",padapter->mppriv.rx_pktcount,padapter->mppriv.rx_crcerrpktcount); - } - else if(bQueryPhy) - { - - //if (IS_HARDWARE_TYPE_JAGUAR(padapter)) - #ifdef CONFIG_RTL8188A - { - cckok = PHY_QueryBBReg(padapter, 0xF04, 0x3FFF); // [13:0] - ofdmok = PHY_QueryBBReg(padapter, 0xF14, 0x3FFF); // [13:0] - htok = PHY_QueryBBReg(padapter, 0xF10, 0x3FFF); // [13:0] - vht_ok = PHY_QueryBBReg(padapter, 0xF0C, 0x3FFF); // [13:0] - - cckcrc = PHY_QueryBBReg(padapter, 0xF04, 0x3FFF0000); // [29:16] - ofdmcrc = PHY_QueryBBReg(padapter, 0xF14, 0x3FFF0000); // [29:16] - htcrc = PHY_QueryBBReg(padapter, 0xF10, 0x3FFF0000); // [29:16] - vht_err = PHY_QueryBBReg(padapter, 0xF0C, 0x3FFF0000); // [29:16] - } - #else - { - cckok = PHY_QueryBBReg(padapter, 0xF88, bMaskDWord); - ofdmok = PHY_QueryBBReg(padapter, 0xF94, bMaskLWord); - htok = PHY_QueryBBReg(padapter, 0xF90, bMaskLWord); - vht_ok = 0; - - cckcrc = PHY_QueryBBReg(padapter, 0xF84, bMaskDWord); - ofdmcrc = PHY_QueryBBReg(padapter, 0xF94, bMaskHWord); - htcrc = PHY_QueryBBReg(padapter, 0xF90, bMaskHWord); - vht_err = 0; - } - #endif - CCK_FA=(rtw_read8(padapter, 0xa5b )<<8 ) | (rtw_read8(padapter, 0xa5c)); - sprintf( extra, "Phy Received packet OK:%d CRC error:%d FA Counter: %d",cckok+ofdmok+htok+vht_ok,cckcrc+ofdmcrc+htcrc+vht_err,OFDM_FA+CCK_FA); - } - else if(bQueryMac) - { - - // for 8723A - { - PHY_SetMacReg(padapter, 0x664, BIT28|BIT29|BIT30|BIT31, 0x3); - mac_cck_ok = PHY_QueryMacReg(padapter, 0x664, bMaskLWord); // [15:0] - PHY_SetMacReg(padapter, 0x664, BIT28|BIT29|BIT30|BIT31, 0x0); - mac_ofdm_ok = PHY_QueryMacReg(padapter, 0x664, bMaskLWord); // [15:0] - PHY_SetMacReg(padapter, 0x664, BIT28|BIT29|BIT30|BIT31, 0x6); - mac_ht_ok = PHY_QueryMacReg(padapter, 0x664, bMaskLWord); // [15:0] - mac_vht_ok = 0; - - PHY_SetMacReg(padapter, 0x664, BIT28|BIT29|BIT30|BIT31, 0x4); - mac_cck_err = PHY_QueryMacReg(padapter, 0x664, bMaskLWord); // [15:0] - PHY_SetMacReg(padapter, 0x664, BIT28|BIT29|BIT30|BIT31, 0x1); - mac_ofdm_err = PHY_QueryMacReg(padapter, 0x664, bMaskLWord); // [15:0] - PHY_SetMacReg(padapter, 0x664, BIT28|BIT29|BIT30|BIT31, 0x7); - mac_ht_err = PHY_QueryMacReg(padapter, 0x664, bMaskLWord); // [15:0] - mac_vht_err = 0; - //Mac_DropPacket - rtw_write32(padapter, 0x664, (rtw_read32(padapter, 0x0664)& 0x0FFFFFFF)| Mac_DropPacket); - DropPacket = rtw_read32(padapter, 0x664)& 0x0000FFFF; - } - - sprintf( extra, "Mac Received packet OK: %d , CRC error: %d , FA Counter: %d , Drop Packets: %d\n", - mac_cck_ok+mac_ofdm_ok+mac_ht_ok+mac_vht_ok,mac_cck_err+mac_ofdm_err+mac_ht_err+mac_vht_err,OFDM_FA+CCK_FA,DropPacket); - } - wrqu->length = strlen(extra) + 1; - return 0; -} - -static int rtw_mp_trx_query(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *wrqu, char *extra) -{ - u32 txok,txfail,rxok,rxfail; - PADAPTER padapter = rtw_netdev_priv(dev); - //if (copy_from_user(extra, wrqu->data.pointer, wrqu->data.length)) - // return -EFAULT; - - txok=padapter->mppriv.tx.sended; - txfail=0; - rxok = padapter->mppriv.rx_pktcount; - rxfail = padapter->mppriv.rx_crcerrpktcount; - - _rtw_memset(extra, '\0', 128); - - sprintf(extra, "Tx OK:%d, Tx Fail:%d, Rx OK:%d, CRC error:%d ", txok, txfail,rxok,rxfail); - - wrqu->length=strlen(extra)+1; - - return 0; -} - -static int rtw_mp_pwrtrk(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *wrqu, char *extra) -{ - u8 enable; - u32 thermal; - s32 ret; - PADAPTER padapter = rtw_netdev_priv(dev); - u8 input[wrqu->length]; - - if (copy_from_user(input, wrqu->pointer, wrqu->length)) - return -EFAULT; - - _rtw_memset(extra, 0, wrqu->length); - - enable = 1; - if (wrqu->length > 1) { // not empty string - if (strncmp(input, "stop", 4) == 0) - { - enable = 0; - sprintf(extra, "mp tx power tracking stop"); - } - else if (sscanf(input, "ther=%d", &thermal)) { - ret = Hal_SetThermalMeter(padapter, (u8)thermal); - if (ret == _FAIL) return -EPERM; - sprintf(extra, "mp tx power tracking start,target value=%d ok ",thermal); - }else { - return -EINVAL; - } - } - - ret = Hal_SetPowerTracking(padapter, enable); - if (ret == _FAIL) return -EPERM; - - wrqu->length = strlen(extra); - - return 0; -} - -static int rtw_mp_psd(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *wrqu, char *extra) -{ - PADAPTER padapter = rtw_netdev_priv(dev); - u8 input[wrqu->length]; - - if (copy_from_user(input, wrqu->pointer, wrqu->length)) - return -EFAULT; - - strcpy(extra,input); - - wrqu->length = mp_query_psd(padapter, extra); - - return 0; -} - -static int rtw_mp_thermal(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *wrqu, char *extra) -{ - u8 val; - u16 bwrite=1; - - #if defined(CONFIG_RTL8192C) || defined(CONFIG_RTL8192D) - u16 addr=EEPROM_THERMAL_METER; - #endif - #ifdef CONFIG_RTL8723A - u16 addr=EEPROM_THERMAL_METER_8723A; - #endif - #if defined(CONFIG_RTL8188E) - u16 addr=EEPROM_THERMAL_METER_88E; - #endif - - u16 cnt=1; - u16 max_available_size=0; - PADAPTER padapter = rtw_netdev_priv(dev); - - if (copy_from_user(extra, wrqu->pointer, wrqu->length)) - return -EFAULT; - - //DBG_871X("print extra %s \n",extra); - - bwrite = strncmp(extra, "write", 6); // strncmp TRUE is 0 - - Hal_GetThermalMeter(padapter, &val); - - if( bwrite == 0 ) - { - //DBG_871X("to write val:%d",val); - EFUSE_GetEfuseDefinition(padapter, EFUSE_WIFI, TYPE_AVAILABLE_EFUSE_BYTES_TOTAL, (PVOID)&max_available_size, _FALSE); - if( 2 > max_available_size ) - { - DBG_871X("no available efuse!\n"); - return -EFAULT; - } - if ( rtw_efuse_map_write(padapter, addr, cnt, &val) == _FAIL ) - { - DBG_871X("rtw_efuse_map_write error \n"); - return -EFAULT; - } - else - { - sprintf(extra, " efuse write ok :%d", val); - } - } - else - { - sprintf(extra, "%d", val); - } - wrqu->length = strlen(extra); - - return 0; -} - -static int rtw_mp_reset_stats(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *wrqu, char *extra) -{ - struct mp_priv *pmp_priv; - struct pkt_attrib *pattrib; - PADAPTER padapter = rtw_netdev_priv(dev); - - pmp_priv = &padapter->mppriv; - - pmp_priv->tx.sended = 0; - pmp_priv->tx_pktcount = 0; - pmp_priv->rx_pktcount = 0; - pmp_priv->rx_crcerrpktcount = 0; - - //reset phy counter - write_bbreg(padapter,0xf14,BIT16,0x1); - rtw_msleep_os(10); - write_bbreg(padapter,0xf14,BIT16,0x0); - //reset mac counter - PHY_SetMacReg(padapter, 0x664, BIT27, 0x1); - PHY_SetMacReg(padapter, 0x664, BIT27, 0x0); - return 0; -} - -static int rtw_mp_dump(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *wrqu, char *extra) -{ - u32 value,i,j=1,path; - u8 input[wrqu->length]; - u8 rf_type,path_nums = 0; - PADAPTER padapter = rtw_netdev_priv(dev); - struct mp_priv *pmp_priv; - struct pkt_attrib *pattrib; - - pmp_priv = &padapter->mppriv; - - if (copy_from_user(input, wrqu->pointer, wrqu->length)) - return -EFAULT; - - if ( strncmp(input, "all", 4)==0 ) - { - printk("\n======= MAC REG =======\n"); - for ( i=0x0;i<0x300;i+=4 ) - { - if(j%4==1) printk("0x%02x ",i); - printk(" 0x%08x ",rtw_read32(padapter,i)); - if((j++)%4 == 0) printk("\n"); - } - for( i=0x400;i<0x1000;i+=4 ) - { - if(j%4==1) DBG_871X("0x%02x",i); - printk(" 0x%08x ",rtw_read32(padapter,i)); - if((j++)%4 == 0) printk("\n"); - } - - i,j=1; - rtw_hal_get_hwreg(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type)); - bb_reg_dump(padapter); - rf_reg_dump(padapter); - /* - printk("\n======= RF REG =======\n"); - if(( RF_1T2R == rf_type ) ||( RF_1T1R ==rf_type )) - path_nums = 1; - else - path_nums = 2; - - for(path=0;pathlength]; - u32 valxcap; - - if (copy_from_user(input, wrqu->pointer, wrqu->length)) - return -EFAULT; - - DBG_871X("%s:iwpriv in=%s\n", __func__, input); - - sscanf(input, "xcap=%d", &valxcap); - - Hal_ProSetCrystalCap( padapter , valxcap ); - - sprintf( extra, "Set xcap=%d",valxcap ); - wrqu->length = strlen(extra) + 1; - -return 0; - -} - -static int rtw_mp_SetRFPath(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) -{ - PADAPTER padapter = rtw_netdev_priv(dev); - char input[wrqu->data.length]; - u8 bMain=1,bTurnoff=1; - - if (copy_from_user(input, wrqu->data.pointer, wrqu->data.length)) - return -EFAULT; - DBG_871X("%s:iwpriv in=%s\n", __func__, input); - - bMain = strncmp(input, "1", 2); // strncmp TRUE is 0 - bTurnoff = strncmp(input, "0", 3); // strncmp TRUE is 0 - - if(bMain==0) - { - MP_PHY_SetRFPathSwitch(padapter,_TRUE); - DBG_871X("%s:PHY_SetRFPathSwitch=TRUE\n", __func__); - } - else if(bTurnoff==0) - { - MP_PHY_SetRFPathSwitch(padapter,_FALSE); - DBG_871X("%s:PHY_SetRFPathSwitch=FALSE\n", __func__); - } - - return 0; -} - -static int rtw_mp_QueryDrv(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) -{ - PADAPTER padapter = rtw_netdev_priv(dev); - char input[wrqu->data.length]; - u8 qAutoLoad=1; - - EEPROM_EFUSE_PRIV *pEEPROM = GET_EEPROM_EFUSE_PRIV(padapter); - - if (copy_from_user(input, wrqu->data.pointer, wrqu->data.length)) - return -EFAULT; - DBG_871X("%s:iwpriv in=%s\n", __func__, input); - - qAutoLoad = strncmp(input, "autoload", 8); // strncmp TRUE is 0 - - if(qAutoLoad==0) - { - DBG_871X("%s:qAutoLoad\n", __func__); - - if(pEEPROM->bautoload_fail_flag) - sprintf(extra, "fail"); - else - sprintf(extra, "ok"); - } - wrqu->data.length = strlen(extra) + 1; - return 0; -} - -/* update Tx AGC offset */ -static int rtw_mp_antBdiff(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *wrqu, char *extra) -{ - - - // MPT_ProSetTxAGCOffset - return 0; -} - - -static int rtw_mp_PwrCtlDM(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *wrqu, char *extra) -{ - PADAPTER padapter = rtw_netdev_priv(dev); - u8 input[wrqu->length]; - u8 bstart=1; - - if (copy_from_user(input, wrqu->pointer, wrqu->length)) - return -EFAULT; - - bstart = strncmp(input, "start", 5); // strncmp TRUE is 0 - if(bstart==0){ - sprintf(extra, "PwrCtlDM start \n"); - MPT_PwrCtlDM(padapter,1); - }else{ - sprintf(extra, "PwrCtlDM stop \n"); - MPT_PwrCtlDM(padapter,0); - } - wrqu->length = strlen(extra); - - return 0; -} - - -#ifdef CONFIG_RTL8723A - -/* update Tx AGC offset */ -static int rtw_mp_SetBT(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) -{ - PADAPTER padapter = rtw_netdev_priv(dev); - struct hal_ops *pHalFunc = &padapter->HalFunc; - - BT_REQ_CMD BtReq; - PMPT_CONTEXT pMptCtx=&(padapter->mppriv.MptCtx); - PBT_RSP_CMD pBtRsp=(PBT_RSP_CMD)&pMptCtx->mptOutBuf[0]; - char input[128]; - char *pch, *ptmp, *token, *tmp[2]={0x00,0x00}; - u8 setdata[100]; - u8 resetbt=0x00; - u8 H2cSetbtmac[6]; - - u16 testmode=1,ready=1,trxparam=1,setgen=1,getgen=1,testctrl=1,testbt=1,readtherm=1,setbtmac=1; - u32 i,ii,jj,kk,cnts,status; - PRT_FIRMWARE_8723A pBTFirmware = NULL; - - if (copy_from_user(extra, wrqu->data.pointer, wrqu->data.length)) - return -EFAULT; - if(strlen(extra)<1) return -EFAULT; - - DBG_871X("%s:iwpriv in=%s\n", __func__, extra); - ready = strncmp(extra, "ready", 5); - testmode = strncmp(extra, "testmode", 8); // strncmp TRUE is 0 - trxparam = strncmp(extra, "trxparam", 8); - setgen = strncmp(extra, "setgen", 6); - getgen = strncmp(extra, "getgen", 6); - testctrl = strncmp(extra, "testctrl", 8); - testbt = strncmp(extra, "testbt", 6); - readtherm = strncmp(extra, "readtherm", 9); - setbtmac = strncmp(extra, "setbtmac", 8); - - if ( strncmp(extra, "dlfw", 4) == 0) - { - padapter->registrypriv.mp_mode =0; - pHalFunc->hal_init(padapter); - padapter->registrypriv.mp_mode =1; - MPT_PwrCtlDM(padapter,0); - rtw_write32(padapter, 0xcc, (rtw_read32(padapter, 0xcc)| 0x00000004)); - rtw_write32(padapter, 0x6b, (rtw_read32(padapter, 0x6b)& 0xFFFFFFEF)); - rtw_msleep_os(600); - //rtw_write32(padapter, 0x6a, (rtw_read32(padapter, 0x6a)& 0xFFFFFFFE)); - rtw_write32(padapter, 0x6b, (rtw_read32(padapter, 0x6b)| 0x00000010)); - rtw_write32(padapter, 0xcc, (rtw_read32(padapter, 0xcc)& 0xFFFFFFFB)); - rtw_msleep_os(1200); - - DBG_871X("padapter->bBTFWReady == _FALSE rtl8723a_FirmwareDownload !\n"); - status = rtl8723a_FirmwareDownload(padapter); - #if 0 - FillH2CCmd(padapter, 0x32, 1, &resetbt); - rtw_msleep_os(1000); - - if(padapter->bBTFWReady == _FALSE && padapter->registrypriv.mp_mode == 1) - { - //pMptCtx->h2cReqNum=0; - DBG_871X("padapter->bBTFWReady == _FALSE rtl8723a_FirmwareDownload !\n"); - status = rtl8723a_FirmwareDownload(padapter); - } - else - { - pBTFirmware = (PRT_FIRMWARE_8723A)rtw_zmalloc(sizeof(RT_FIRMWARE_8723A)); - DBG_871X("rtl8723a_FirmwareDownload go to FirmwareDownloadBT !\n"); - FirmwareDownloadBT(padapter, pBTFirmware); - if (pBTFirmware) - rtw_mfree((u8*)pBTFirmware, sizeof(RT_FIRMWARE_8723A)); - } - #endif - DBG_871X("Wait for FirmwareDownloadBT fw boot!\n"); - rtw_msleep_os(1000); - _rtw_memset(extra,'\0', wrqu->data.length); - BtReq.opCodeVer=1; - BtReq.OpCode=0; - BtReq.paraLength=0; - mptbt_BtControlProcess(padapter,&BtReq); - rtw_msleep_os(100); - for (i=4; imptOutLen; i++) - { - DBG_8192C("FirmwareDownloadBT ready = 0x%x ", pMptCtx->mptOutBuf[i]); - if( (pMptCtx->mptOutBuf[i]==0x00) && (pMptCtx->mptOutBuf[i+1]==0x00)) - { - sprintf(extra, "download FW Fail.\n"); - } - else - { - sprintf(extra, "download FW OK.\n"); - goto exit; - } - } - - goto exit; - } - - if ( strncmp(extra, "down", 4) == 0){ - DBG_871X("SetBT down for to hal_init !\n"); - mp_stop_test(padapter); - pHalFunc->hal_init(padapter); - mp_start_test(padapter); - MPT_PwrCtlDM(padapter,0); - rtw_write32(padapter, 0xcc, (rtw_read32(padapter, 0xcc)| 0x00000004)); - rtw_write32(padapter, 0x6b, (rtw_read32(padapter, 0x6b)& 0xFFFFFFEF)); - rtw_msleep_os(600); - //rtw_write32(padapter, 0x6a, (rtw_read32(padapter, 0x6a)& 0xFFFFFFFE)); - rtw_write32(padapter, 0x6b, (rtw_read32(padapter, 0x6b)| 0x00000010)); - rtw_write32(padapter, 0xcc, (rtw_read32(padapter, 0xcc)& 0xFFFFFFFB)); - rtw_msleep_os(1200); - goto exit; - } - if ( strncmp(extra, "disable", 4) == 0){ - DBG_871X("SetBT enable !\n"); - rtw_write32(padapter, 0x6a, (rtw_read32(padapter, 0x6a)& 0xFFFFFFFB)); - rtw_msleep_os(500); - goto exit; - } - if ( strncmp(extra, "enable", 4) == 0){ - DBG_871X("SetBT disable !\n"); - rtw_write32(padapter, 0x6a, (rtw_read32(padapter, 0x6a)| 0x00000004)); - rtw_msleep_os(500); - goto exit; - } - - if( ready!=0 && testmode!=0 && trxparam!=0 && setgen!=0 && getgen!=0 && testctrl!=0 && testbt!=0 && readtherm!=0 &&setbtmac!=0) - return -EFAULT; - - if( testbt==0 ) - { - BtReq.opCodeVer=1; - BtReq.OpCode=6; - BtReq.paraLength=cnts/2; - goto todo; - } - if( ready==0 ) - { - BtReq.opCodeVer=1; - BtReq.OpCode=0; - BtReq.paraLength=0; - goto todo; - } - - DBG_871X("%s:after strncmp\n", __func__); - pch = extra; - i = 0; - while ((token = strsep(&pch, ",")) != NULL) - { - if (i > 1) break; - tmp[i] = token; - i++; - } - - if ((tmp[0]==NULL) && (tmp[1]==NULL)) - { - return -EFAULT; - } - else - { - cnts = strlen(tmp[1]); - if (cnts<1) return -EFAULT; - - DBG_871X("%s: cnts=%d\n", __FUNCTION__, cnts); - DBG_871X("%s: data=%s\n", __FUNCTION__, tmp[1]); - - for (jj=0, kk=0; jjdata.length); - - mptbt_BtControlProcess(padapter,&BtReq); - - if(readtherm==0){ - sprintf(extra,"BT thermal="); - for (i=4; imptOutLen; i++) - { - if( (pMptCtx->mptOutBuf[i]==0x00) && (pMptCtx->mptOutBuf[i+1]==0x00)) - goto exit; - DBG_8192C("0x%x ", pMptCtx->mptOutBuf[i]); - sprintf(extra, "%s %d ", extra, pMptCtx->mptOutBuf[i]); - } - }else{ - for (i=4; imptOutLen; i++) - { - DBG_8192C("0x%x ", pMptCtx->mptOutBuf[i]); - sprintf(extra, "%s 0x%x ", extra, pMptCtx->mptOutBuf[i]); - } - } - -exit: - wrqu->data.length = strlen(extra) + 1; - -return status; - -} - -#endif //#ifdef CONFIG_RTL8723A - -static int rtw_mp_set(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wdata, char *extra) -{ - struct iw_point *wrqu = (struct iw_point *)wdata; - u32 subcmd = wrqu->flags; - PADAPTER padapter = rtw_netdev_priv(dev); - - if (padapter == NULL) - { - return -ENETDOWN; - } - - if((padapter->bup == _FALSE )||(padapter->hw_init_completed == _FALSE)) - { - DBG_871X(" %s fail =>(padapter->bup == _FALSE )||(padapter->hw_init_completed == _FALSE) \n",__FUNCTION__); - return -ENETDOWN; - } - - if( (padapter->bSurpriseRemoved == _TRUE) || ( padapter->bDriverStopped == _TRUE)) - { - DBG_871X("%s fail =>(padapter->bSurpriseRemoved == _TRUE) || ( padapter->bDriverStopped == _TRUE) \n",__FUNCTION__); - return -ENETDOWN; - } - - //_rtw_memset(extra, 0x00, IW_PRIV_SIZE_MASK); - - if (extra == NULL) - { - wrqu->length = 0; - return -EIO; - } - - switch(subcmd) - { - case MP_START: - DBG_871X("set case mp_start \n"); - rtw_mp_start (dev,info,wrqu,extra); - break; - - case MP_STOP: - DBG_871X("set case mp_stop \n"); - rtw_mp_stop (dev,info,wrqu,extra); - break; - - case MP_BANDWIDTH: - DBG_871X("set case mp_bandwidth \n"); - rtw_mp_bandwidth (dev,info,wrqu,extra); - break; - - case MP_RESET_STATS: - DBG_871X("set case MP_RESET_STATS \n"); - rtw_mp_reset_stats (dev,info,wrqu,extra); - break; - case MP_SetRFPathSwh: - DBG_871X("set MP_SetRFPathSwitch \n"); - rtw_mp_SetRFPath (dev,info,wdata,extra); - break; - case CTA_TEST: - DBG_871X("set CTA_TEST\n"); - rtw_cta_test_start (dev, info, wdata, extra); - break; - case MP_DISABLE_BT_COEXIST: - DBG_871X("set case MP_DISABLE_BT_COEXIST \n"); - rtw_mp_disable_bt_coexist(dev, info, wdata, extra); - break; -#ifdef CONFIG_WOWLAN - case MP_WOW_ENABLE: - DBG_871X("set case MP_WOW_ENABLE: %s \n", extra); - rtw_wowlan_ctrl(dev, info, wdata, extra); - break; -#endif - } - - - return 0; -} - - -static int rtw_mp_get(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wdata, char *extra) -{ - struct iw_point *wrqu = (struct iw_point *)wdata; - u32 subcmd = wrqu->flags; - PADAPTER padapter = rtw_netdev_priv(dev); - - //DBG_871X("in mp_get extra= %s \n",extra); - - if (padapter == NULL) - { - return -ENETDOWN; - } - if (extra == NULL) - { - wrqu->length = 0; - return -EIO; - } - - switch(subcmd) - { - case WRITE_REG : - rtw_mp_write_reg (dev,info,wrqu,extra); - break; - - case WRITE_RF: - rtw_mp_write_rf (dev,info,wrqu,extra); - break; - - case MP_PHYPARA: - DBG_871X("mp_get MP_PHYPARA \n"); - rtw_mp_phypara(dev,info,wrqu,extra); - break; - - case MP_CHANNEL: - DBG_871X("set case mp_channel \n"); - rtw_mp_channel (dev,info,wrqu,extra); - break; - - case READ_REG: - DBG_871X("mp_get READ_REG \n"); - rtw_mp_read_reg (dev,info,wrqu,extra); - break; - case READ_RF: - DBG_871X("mp_get READ_RF \n"); - rtw_mp_read_rf (dev,info,wrqu,extra); - break; - - case MP_RATE: - DBG_871X("set case mp_rate \n"); - rtw_mp_rate (dev,info,wrqu,extra); - break; - - case MP_TXPOWER: - DBG_871X("set case MP_TXPOWER \n"); - rtw_mp_txpower (dev,info,wrqu,extra); - break; - - case MP_ANT_TX: - DBG_871X("set case MP_ANT_TX \n"); - rtw_mp_ant_tx (dev,info,wrqu,extra); - break; - - case MP_ANT_RX: - DBG_871X("set case MP_ANT_RX \n"); - rtw_mp_ant_rx (dev,info,wrqu,extra); - break; - - case MP_QUERY: - //DBG_871X("mp_get mp_query MP_QUERY \n"); - rtw_mp_trx_query(dev,info,wrqu,extra); - break; - - case MP_CTX: - DBG_871X("set case MP_CTX \n"); - rtw_mp_ctx (dev,info,wrqu,extra); - break; - - case MP_ARX: - DBG_871X("set case MP_ARX \n"); - rtw_mp_arx (dev,info,wrqu,extra); - break; - - case EFUSE_GET: - DBG_871X("efuse get EFUSE_GET \n"); - rtw_mp_efuse_get(dev,info,wdata,extra); - break; - - case MP_DUMP: - DBG_871X("set case MP_DUMP \n"); - rtw_mp_dump (dev,info,wrqu,extra); - break; - case MP_PSD: - DBG_871X("set case MP_PSD \n"); - rtw_mp_psd (dev,info,wrqu,extra); - break; - case MP_THER: - DBG_871X("set case MP_THER \n"); - rtw_mp_thermal (dev,info,wrqu,extra); - break; - case MP_PwrCtlDM: - DBG_871X("set MP_PwrCtlDM\n"); - rtw_mp_PwrCtlDM (dev,info,wrqu,extra); - break; - case MP_QueryDrvStats: - DBG_871X("mp_get MP_QueryDrvStats \n"); - rtw_mp_QueryDrv (dev,info,wdata,extra); - break; - case MP_PWRTRK: - DBG_871X("set case MP_PWRTRK \n"); - rtw_mp_pwrtrk (dev,info,wrqu,extra); - break; - case EFUSE_SET: - DBG_871X("set case efuse set \n"); - rtw_mp_efuse_set (dev,info,wdata,extra); - break; - -#ifdef CONFIG_RTL8723A - case MP_SetBT: - DBG_871X("set MP_SetBT \n"); - rtw_mp_SetBT (dev,info,wdata,extra); - break; -#endif - - } - - rtw_msleep_os(10); //delay 5ms for sending pkt before exit adb shell operation -return 0; -} - -#endif //#if defined(CONFIG_MP_INCLUDED) && defined(CONFIG_MP_IWPRIV_SUPPORT) - static int rtw_wfd_tdls_enable(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) @@ -13460,71 +11650,6 @@ static iw_handler rtw_handlers[] = NULL, /*---hole---*/ }; -#if 0 -//defined(CONFIG_MP_INCLUDED) && defined(CONFIG_MP_IWPRIV_SUPPORT) - -static const struct iw_priv_args rtw_private_args[] = -{ - { SIOCIWFIRSTPRIV + 0x00, IW_PRIV_TYPE_CHAR | 1024, 0 , ""}, //set - { SIOCIWFIRSTPRIV + 0x01, IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK , ""},//get -/* --- sub-ioctls definitions --- */ - { MP_START , IW_PRIV_TYPE_CHAR | 1024, 0, "mp_start" }, //set - { MP_PHYPARA, IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_phypara" },//get - { MP_STOP , IW_PRIV_TYPE_CHAR | 1024, 0, "mp_stop" }, //set - { MP_CHANNEL , IW_PRIV_TYPE_CHAR | 1024 , IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_channel" },//get - { MP_BANDWIDTH , IW_PRIV_TYPE_CHAR | 1024, 0, "mp_bandwidth"}, //set - { MP_RATE , IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_rate" },//get - { MP_RESET_STATS , IW_PRIV_TYPE_CHAR | 1024, 0, "mp_reset_stats"}, - { MP_QUERY , IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK , "mp_query"}, //get - { MP_NULL, IW_PRIV_TYPE_CHAR | 128, 0,"NULL"},//set - { READ_REG , IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "read_reg" }, - { MP_NULL, IW_PRIV_TYPE_CHAR | 128, 0,"NULL"},//set - { MP_RATE , IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_rate" }, - { MP_NULL, IW_PRIV_TYPE_CHAR | 128, 0,"NULL"},//set - { READ_RF , IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "read_rf" }, - { MP_NULL, IW_PRIV_TYPE_CHAR | 128, 0,"NULL"},//set - { MP_PSD , IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_psd"}, - { MP_NULL, IW_PRIV_TYPE_CHAR | 128, 0,"NULL"},//set - { MP_DUMP, IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_dump" }, - { MP_NULL, IW_PRIV_TYPE_CHAR | 128, 0,"NULL"},//set - { MP_TXPOWER , IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_txpower"}, - { MP_NULL, IW_PRIV_TYPE_CHAR | 128, 0,"NULL"},//set - { MP_ANT_TX , IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_ant_tx"}, - { MP_NULL, IW_PRIV_TYPE_CHAR | 128, 0,"NULL"},//set - { MP_ANT_RX , IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_ant_rx"}, - { WRITE_REG, IW_PRIV_TYPE_CHAR | 1024, 0,"write_reg"},//set - { MP_NULL, IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "NULL" }, - { WRITE_RF, IW_PRIV_TYPE_CHAR | 1024, 0,"write_rf"},//set - { MP_NULL, IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "NULL" }, - { MP_NULL, IW_PRIV_TYPE_CHAR | 128, 0,"NULL"},//set - { MP_CTX , IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_ctx"}, - { MP_NULL, IW_PRIV_TYPE_CHAR | 128, 0,"NULL"},//set - { MP_ARX , IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_arx"}, - { MP_NULL, IW_PRIV_TYPE_CHAR | 128, 0,"NULL"},//set - { MP_THER , IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_ther"}, - { EFUSE_SET, IW_PRIV_TYPE_CHAR | 1024, 0, "efuse_set" }, - { EFUSE_GET, IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "efuse_get" }, - { MP_PWRTRK , IW_PRIV_TYPE_CHAR | 1024, 0, "mp_pwrtrk"}, - { MP_QueryDrvStats, IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_drvquery" }, - { MP_IOCTL, IW_PRIV_TYPE_CHAR | 1024, 0, "mp_ioctl"}, // mp_ioctl - { MP_SetRFPathSwh, IW_PRIV_TYPE_CHAR | 1024, 0, "mp_setrfpath" }, - -#ifdef CONFIG_RTL8723A - { MP_SetBT, IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_setbt" }, -#endif - - { SIOCIWFIRSTPRIV + 0x02, IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK , "test"},//set -}; - - -static iw_handler rtw_private_handler[] = -{ - rtw_mp_set, - rtw_mp_get, -}; - -#else // not inlucde MP - static const struct iw_priv_args rtw_private_args[] = { { SIOCIWFIRSTPRIV + 0x0, @@ -13633,46 +11758,6 @@ static const struct iw_priv_args rtw_private_args[] = { }, #endif // CONFIG_INTEL_WIDI -#ifdef CONFIG_MP_INCLUDED - - { SIOCIWFIRSTPRIV + 0x0E, IW_PRIV_TYPE_CHAR | 1024, 0 , ""}, //set - { SIOCIWFIRSTPRIV + 0x0F, IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK , ""},//get -/* --- sub-ioctls definitions --- */ - - { MP_START , IW_PRIV_TYPE_CHAR | 1024, 0, "mp_start" }, //set - { MP_PHYPARA, IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_phypara" },//get - { MP_STOP , IW_PRIV_TYPE_CHAR | 1024, 0, "mp_stop" }, //set - { MP_CHANNEL , IW_PRIV_TYPE_CHAR | 1024 , IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_channel" },//get - { MP_BANDWIDTH , IW_PRIV_TYPE_CHAR | 1024, 0, "mp_bandwidth"}, //set - { MP_RATE , IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_rate" },//get - { MP_RESET_STATS , IW_PRIV_TYPE_CHAR | 1024, 0, "mp_reset_stats"}, - { MP_QUERY , IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK , "mp_query"}, //get - { READ_REG , IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "read_reg" }, - { MP_RATE , IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_rate" }, - { READ_RF , IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "read_rf" }, - { MP_PSD , IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_psd"}, - { MP_DUMP, IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_dump" }, - { MP_TXPOWER , IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_txpower"}, - { MP_ANT_TX , IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_ant_tx"}, - { MP_ANT_RX , IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_ant_rx"}, - { WRITE_REG , IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "write_reg" }, - { WRITE_RF , IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "write_rf" }, - { MP_CTX , IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_ctx"}, - { MP_ARX , IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_arx"}, - { MP_THER , IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_ther"}, - { EFUSE_SET, IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "efuse_set" }, - { EFUSE_GET, IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "efuse_get" }, - { MP_PWRTRK , IW_PRIV_TYPE_CHAR | 1024, 0, "mp_pwrtrk"}, - { MP_QueryDrvStats, IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_drvquery" }, - { MP_IOCTL, IW_PRIV_TYPE_CHAR | 1024, 0, "mp_ioctl"}, // mp_ioctl - { MP_SetRFPathSwh, IW_PRIV_TYPE_CHAR | 1024, 0, "mp_setrfpath" }, - { MP_PwrCtlDM, IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_pwrctldm" }, -#ifdef CONFIG_RTL8723A - { MP_SetBT, IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "mp_setbt" }, - { MP_DISABLE_BT_COEXIST, IW_PRIV_TYPE_CHAR | 1024, 0, "mp_disa_btcoex"}, -#endif - { CTA_TEST, IW_PRIV_TYPE_CHAR | 1024, 0, "cta_test"}, -#endif #ifdef CONFIG_WOWLAN { MP_WOW_ENABLE , IW_PRIV_TYPE_CHAR | 1024, 0, "wow_enable" }, //set #endif @@ -13704,13 +11789,8 @@ static iw_handler rtw_private_handler[] = rtw_wx_write_rf, //0x0C rtw_wx_read_rf, //0x0D -#ifndef CONFIG_MP_INCLUDED rtw_wx_priv_null, //0x0E rtw_wx_priv_null, //0x0F -#else - rtw_mp_set, //0x0E - rtw_mp_get, //0x0F -#endif rtw_p2p_set, //0x10 rtw_p2p_get, //0x11 NULL, //0x12 @@ -13734,8 +11814,6 @@ static iw_handler rtw_private_handler[] = #endif // CONFIG_INTEL_WIDI }; -#endif // #if defined(CONFIG_MP_INCLUDED) && defined(CONFIG_MP_IWPRIV_SUPPORT) - #if WIRELESS_EXT >= 17 static struct iw_statistics *rtw_get_wireless_stats(struct net_device *dev) { diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c index f16c2bc..8bb6208 100755 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -1543,14 +1543,6 @@ _func_enter_; rtw_init_pwrctrl_priv(padapter); - //_rtw_memset((u8 *)&padapter->qospriv, 0, sizeof (struct qos_priv));//move to mlme_priv - -#ifdef CONFIG_MP_INCLUDED - if (init_mp_priv(padapter) == _FAIL) { - DBG_871X("%s: initialize MP private data Fail!\n", __func__); - } -#endif - ret8 = rtw_init_default_value(padapter); rtw_hal_dm_init(padapter); diff --git a/os_dep/linux/sdio_intf.c b/os_dep/linux/sdio_intf.c index f64a96b..0e1b1ab 100755 --- a/os_dep/linux/sdio_intf.c +++ b/os_dep/linux/sdio_intf.c @@ -820,10 +820,6 @@ _func_enter_; DBG_871X(KERN_NOTICE "%s: device had been removed!\n", __func__); } } -#ifdef CONFIG_MP_INCLUDED - if (padapter->registrypriv.mp_mode == 1) - MPT_DeInitAdapter(padapter); -#endif #if defined(CONFIG_HAS_EARLYSUSPEND) || defined(CONFIG_ANDROID_POWER) rtw_unregister_early_suspend(dvobj_to_pwrctl(dvobj)); #endif diff --git a/os_dep/linux/usb_intf.c b/os_dep/linux/usb_intf.c index d3f6dd2..8f8ddbb 100755 --- a/os_dep/linux/usb_intf.c +++ b/os_dep/linux/usb_intf.c @@ -2001,10 +2001,6 @@ _func_enter_; //DBG_871X("r871xu_dev_remove():module removed\n"); padapter->hw_init_completed = _FALSE; }*/ -#ifdef CONFIG_MP_INCLUDED - if (padapter->registrypriv.mp_mode == 1) - MPT_DeInitAdapter(padapter); -#endif #if defined(CONFIG_HAS_EARLYSUSPEND) || defined(CONFIG_ANDROID_POWER) rtw_unregister_early_suspend(dvobj_to_pwrctl(dvobj)); #endif