diff --git a/core/rtw_cmd.c b/core/rtw_cmd.c index 92b2505..072d672 100644 --- a/core/rtw_cmd.c +++ b/core/rtw_cmd.c @@ -171,15 +171,6 @@ sint _rtw_init_evt_priv(struct evt_priv *pevtpriv) pevtpriv->c2h_mem = pevtpriv->allocated_c2h_mem + 4\ - ((u32)(pevtpriv->allocated_c2h_mem) & 3); -#ifdef PLATFORM_OS_XP - pevtpriv->pc2h_mdl = IoAllocateMdl((u8 *)pevtpriv->c2h_mem, C2H_MEM_SZ , FALSE, FALSE, NULL); - - if (pevtpriv->pc2h_mdl == NULL) { - res = _FAIL; - goto exit; - } - MmBuildMdlForNonPagedPool(pevtpriv->pc2h_mdl); -#endif #endif /* end of CONFIG_SDIO_HCI */ _rtw_init_queue(&(pevtpriv->evt_queue)); @@ -1384,15 +1375,6 @@ u8 rtw_joinbss_cmd(_adapter *padapter, struct wlan_network *pnetwork) res = _FAIL; goto exit; } -#if 0 - /* for IEs is pointer */ - t_len = sizeof(ULONG) + sizeof(NDIS_802_11_MAC_ADDRESS) + 2 + - sizeof(NDIS_802_11_SSID) + sizeof(ULONG) + - sizeof(NDIS_802_11_RSSI) + sizeof(NDIS_802_11_NETWORK_TYPE) + - sizeof(NDIS_802_11_CONFIGURATION) + - sizeof(NDIS_802_11_NETWORK_INFRASTRUCTURE) + - sizeof(NDIS_802_11_RATES_EX) + sizeof(WLAN_PHY_INFO) + sizeof(ULONG) + MAX_IE_SZ; -#endif /* for IEs is fix buf size */ t_len = sizeof(WLAN_BSSID_EX); @@ -1536,15 +1518,6 @@ u8 rtw_joinbss_cmd(_adapter *padapter, struct wlan_network *pnetwork) } #endif -#if 0 - psecuritypriv->supplicant_ie[0] = (u8)psecnetwork->IELength; - - if (psecnetwork->IELength < (256 - 1)) - _rtw_memcpy(&psecuritypriv->supplicant_ie[1], &psecnetwork->IEs[0], psecnetwork->IELength); - else - _rtw_memcpy(&psecuritypriv->supplicant_ie[1], &psecnetwork->IEs[0], (256 - 1)); -#endif - pcmd->cmdsz = sizeof(WLAN_BSSID_EX); #ifdef CONFIG_RTL8712 @@ -4729,11 +4702,6 @@ void rtw_create_ibss_post_hdl(_adapter *padapter, int status) /* copy pdev_network information to pmlmepriv->cur_network */ _rtw_memcpy(&mlme_cur_network->network, pdev_network, (get_WLAN_BSSID_EX_sz(pdev_network))); -#if 0 - /* reset DSConfig */ - mlme_cur_network->network.Configuration.DSConfig = (u32)rtw_ch2freq(pdev_network->Configuration.DSConfig); -#endif - _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING); _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); /* we will set _FW_LINKED when there is one more sat to join us (rtw_stassoc_event_callback) */ diff --git a/core/rtw_efuse.c b/core/rtw_efuse.c index cb2e213..8caca5e 100644 --- a/core/rtw_efuse.c +++ b/core/rtw_efuse.c @@ -2364,13 +2364,7 @@ efuse_ShadowRead4Byte( * 11/12/2008 MHC Create Version 0. * *---------------------------------------------------------------------------*/ -#ifdef PLATFORM -static VOID -efuse_ShadowWrite1Byte( - IN PADAPTER pAdapter, - IN u16 Offset, - IN u8 Value); -#endif /* PLATFORM */ + static VOID efuse_ShadowWrite1Byte( IN PADAPTER pAdapter, @@ -2683,9 +2677,7 @@ u8 mac_hidden_wl_func_to_hal_wl_func(u8 func) return wl_func; } -#ifdef PLATFORM_LINUX #ifdef CONFIG_ADAPTOR_INFO_CACHING_FILE -/* #include */ int isAdaptorInfoFileValid(void) { @@ -2723,14 +2715,6 @@ int retriveAdaptorInfoFile(char *path, u8 *efuse_data) ret = _SUCCESS; else ret = _FAIL; - -#if 0 - if (isAdaptorInfoFileValid()) - return 0; - else - return _FAIL; -#endif - } else { RTW_INFO("%s NULL pointer\n", __FUNCTION__); ret = _FAIL; @@ -2945,5 +2929,3 @@ exit: return ret; } #endif /* CONFIG_EFUSE_CONFIG_FILE */ - -#endif /* PLATFORM_LINUX */ diff --git a/core/rtw_io.c b/core/rtw_io.c index 683da16..6f0738f 100644 --- a/core/rtw_io.c +++ b/core/rtw_io.c @@ -52,10 +52,6 @@ jackson@realtek.com.tw #include #include -#if defined(PLATFORM_LINUX) && defined (PLATFORM_WINDOWS) - #error "Shall be Linux or Windows, but not both!\n" -#endif - #ifdef CONFIG_SDIO_HCI #define rtw_le16_to_cpu(val) val #define rtw_le32_to_cpu(val) val @@ -633,11 +629,6 @@ u8 dbg_rtw_sd_f0_read8(_adapter *adapter, u32 addr, const char *caller, const in { u8 val = _rtw_sd_f0_read8(adapter, addr); -#if 0 - if (match_read_sniff_ranges(addr, 1)) - RTW_INFO("DBG_IO %s:%d rtw_sd_f0_read8(0x%04x) return 0x%02x\n", caller, line, addr, val); -#endif - return val; } diff --git a/core/rtw_ioctl_query.c b/core/rtw_ioctl_query.c index 4f8232d..e7d3be5 100644 --- a/core/rtw_ioctl_query.c +++ b/core/rtw_ioctl_query.c @@ -19,153 +19,4 @@ ******************************************************************************/ #define _RTW_IOCTL_QUERY_C_ -#include - -#ifdef PLATFORM_WINDOWS -/* - * Added for WPA2-PSK, by Annie, 2005-09-20. - * */ -u8 -query_802_11_capability( - _adapter *Adapter, - u8 *pucBuf, - u32 *pulOutLen -) -{ - static NDIS_802_11_AUTHENTICATION_ENCRYPTION szAuthEnc[] = { - {Ndis802_11AuthModeOpen, Ndis802_11EncryptionDisabled}, - {Ndis802_11AuthModeOpen, Ndis802_11Encryption1Enabled}, - {Ndis802_11AuthModeShared, Ndis802_11EncryptionDisabled}, - {Ndis802_11AuthModeShared, Ndis802_11Encryption1Enabled}, - {Ndis802_11AuthModeWPA, Ndis802_11Encryption2Enabled}, - {Ndis802_11AuthModeWPA, Ndis802_11Encryption3Enabled}, - {Ndis802_11AuthModeWPAPSK, Ndis802_11Encryption2Enabled}, - {Ndis802_11AuthModeWPAPSK, Ndis802_11Encryption3Enabled}, - {Ndis802_11AuthModeWPANone, Ndis802_11Encryption2Enabled}, - {Ndis802_11AuthModeWPANone, Ndis802_11Encryption3Enabled}, - {Ndis802_11AuthModeWPA2, Ndis802_11Encryption2Enabled}, - {Ndis802_11AuthModeWPA2, Ndis802_11Encryption3Enabled}, - {Ndis802_11AuthModeWPA2PSK, Ndis802_11Encryption2Enabled}, - {Ndis802_11AuthModeWPA2PSK, Ndis802_11Encryption3Enabled} - }; - static ULONG ulNumOfPairSupported = sizeof(szAuthEnc) / sizeof(NDIS_802_11_AUTHENTICATION_ENCRYPTION); - NDIS_802_11_CAPABILITY *pCap = (NDIS_802_11_CAPABILITY *)pucBuf; - u8 *pucAuthEncryptionSupported = (u8 *) pCap->AuthenticationEncryptionSupported; - - - pCap->Length = sizeof(NDIS_802_11_CAPABILITY); - if (ulNumOfPairSupported > 1) - pCap->Length += (ulNumOfPairSupported - 1) * sizeof(NDIS_802_11_AUTHENTICATION_ENCRYPTION); - - pCap->Version = 2; - pCap->NoOfPMKIDs = NUM_PMKID_CACHE; - pCap->NoOfAuthEncryptPairsSupported = ulNumOfPairSupported; - - if (sizeof(szAuthEnc) <= 240) /* 240 = 256 - 4*4 */ { /* SecurityInfo.szCapability: only 256 bytes in size. */ - _rtw_memcpy(pucAuthEncryptionSupported, (u8 *)szAuthEnc, sizeof(szAuthEnc)); - *pulOutLen = pCap->Length; - return _TRUE; - } else { - *pulOutLen = 0; - return _FALSE; - } -} - -u8 query_802_11_association_information(_adapter *padapter, PNDIS_802_11_ASSOCIATION_INFORMATION pAssocInfo) -{ - struct wlan_network *tgt_network; - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); - struct security_priv *psecuritypriv = &(padapter->securitypriv); - WLAN_BSSID_EX *psecnetwork = (WLAN_BSSID_EX *)&pmlmepriv->cur_network.network; - u8 *pDest = (u8 *)pAssocInfo + sizeof(NDIS_802_11_ASSOCIATION_INFORMATION); - unsigned char i, *auth_ie, *supp_ie; - - /* NdisZeroMemory(pAssocInfo, sizeof(NDIS_802_11_ASSOCIATION_INFORMATION)); */ - _rtw_memset(pAssocInfo, 0, sizeof(NDIS_802_11_ASSOCIATION_INFORMATION)); - /* pAssocInfo->Length = sizeof(NDIS_802_11_ASSOCIATION_INFORMATION); */ - - /* ------------------------------------------------------ */ - /* Association Request related information */ - /* ------------------------------------------------------ */ - /* Req_1. AvailableRequestFixedIEs */ - if (psecnetwork != NULL) { - - pAssocInfo->AvailableRequestFixedIEs |= NDIS_802_11_AI_REQFI_CAPABILITIES | NDIS_802_11_AI_REQFI_CURRENTAPADDRESS; - pAssocInfo->RequestFixedIEs.Capabilities = (unsigned short) *&psecnetwork->IEs[10]; - _rtw_memcpy(pAssocInfo->RequestFixedIEs.CurrentAPAddress, - &psecnetwork->MacAddress, 6); - - pAssocInfo->OffsetRequestIEs = sizeof(NDIS_802_11_ASSOCIATION_INFORMATION); - - if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING | _FW_LINKED) == _TRUE) { - - if (psecuritypriv->ndisauthtype >= Ndis802_11AuthModeWPA2) - pDest[0] = 48; /* RSN Information Element */ - else - pDest[0] = 221; /* WPA(SSN) Information Element */ - - supp_ie = &psecuritypriv->supplicant_ie[0]; - - i = 13; /* 0~11 is fixed information element */ - while ((i < supp_ie[0]) && (i < 256)) { - if ((unsigned char)supp_ie[i] == pDest[0]) { - _rtw_memcpy((u8 *)(pDest), - &supp_ie[i], - supp_ie[1 + i] + 2); - - break; - } - - i = i + supp_ie[i + 1] + 2; - if (supp_ie[1 + i] == 0) - i = i + 1; - - } - - - pAssocInfo->RequestIELength += (2 + supp_ie[1 + i]); /* (2 + psecnetwork->IEs[1+i]+4); */ - - } - - - - } - - - /* ------------------------------------------------------ */ - /* Association Response related information */ - /* ------------------------------------------------------ */ - - if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) { - tgt_network = &(pmlmepriv->cur_network); - if (tgt_network != NULL) { - pAssocInfo->AvailableResponseFixedIEs = - NDIS_802_11_AI_RESFI_CAPABILITIES - | NDIS_802_11_AI_RESFI_ASSOCIATIONID - ; - - pAssocInfo->ResponseFixedIEs.Capabilities = (unsigned short) *&tgt_network->network.IEs[10]; - pAssocInfo->ResponseFixedIEs.StatusCode = 0; - pAssocInfo->ResponseFixedIEs.AssociationId = (unsigned short) tgt_network->aid; - - pDest = (u8 *)pAssocInfo + sizeof(NDIS_802_11_ASSOCIATION_INFORMATION) + pAssocInfo->RequestIELength; - auth_ie = &psecuritypriv->authenticator_ie[0]; - - - i = auth_ie[0] - 12; - if (i > 0) { - _rtw_memcpy((u8 *)&pDest[0], &auth_ie[1], i); - pAssocInfo->ResponseIELength = i; - } - - - pAssocInfo->OffsetResponseIEs = sizeof(NDIS_802_11_ASSOCIATION_INFORMATION) + pAssocInfo->RequestIELength; - - - } - } - - return _TRUE; -} -#endif diff --git a/core/rtw_ioctl_set.c b/core/rtw_ioctl_set.c index 45bb5e4..f2881ed 100644 --- a/core/rtw_ioctl_set.c +++ b/core/rtw_ioctl_set.c @@ -22,7 +22,6 @@ #include #include - extern void indicate_wx_scan_complete_event(_adapter *padapter); #define IS_MAC_ADDRESS_BROADCAST(addr) \ @@ -50,7 +49,6 @@ u8 rtw_validate_ssid(NDIS_802_11_SSID *ssid) u8 i; u8 ret = _TRUE; - if (ssid->SsidLength > 32) { ret = _FALSE; goto exit; @@ -68,7 +66,6 @@ u8 rtw_validate_ssid(NDIS_802_11_SSID *ssid) exit: - return ret; } @@ -82,12 +79,10 @@ u8 rtw_do_join(_adapter *padapter) _queue *queue = &(pmlmepriv->scanned_queue); u8 ret = _SUCCESS; - _enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); phead = get_list_head(queue); plist = get_next(phead); - pmlmepriv->cur_network.join_res = -2; set_fwstate(pmlmepriv, _FW_UNDER_LINKING); @@ -150,23 +145,10 @@ u8 rtw_do_join(_adapter *padapter) pmlmepriv->to_join = _FALSE; - } else { /* can't associate ; reset under-linking */ _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING); -#if 0 - if ((check_fwstate(pmlmepriv, WIFI_STATION_STATE) == _TRUE)) { - if (_rtw_memcmp(pmlmepriv->cur_network.network.Ssid.Ssid, pmlmepriv->assoc_ssid.Ssid, pmlmepriv->assoc_ssid.SsidLength)) { - /* for funk to do roaming */ - /* funk will reconnect, but funk will not sitesurvey before reconnect */ - if (pmlmepriv->sitesurveyctrl.traffic_busy == _FALSE) - rtw_sitesurvey_cmd(padapter, &pmlmepriv->assoc_ssid, 1, NULL, 0); - } - - } -#endif - /* when set_ssid/set_bssid for rtw_do_join(), but there are no desired bss in scanning queue */ /* we try to issue sitesurvey firstly */ if (pmlmepriv->LinkDetectInfo.bBusyTraffic == _FALSE @@ -192,84 +174,6 @@ exit: return ret; } -#ifdef PLATFORM_WINDOWS -u8 rtw_pnp_set_power_wakeup(_adapter *padapter) -{ - u8 res = _SUCCESS; - - - - res = rtw_setstandby_cmd(padapter, 0); - - - - return res; -} - -u8 rtw_pnp_set_power_sleep(_adapter *padapter) -{ - u8 res = _SUCCESS; - - - /* DbgPrint("+rtw_pnp_set_power_sleep\n"); */ - - res = rtw_setstandby_cmd(padapter, 1); - - - - return res; -} - -u8 rtw_set_802_11_reload_defaults(_adapter *padapter, NDIS_802_11_RELOAD_DEFAULTS reloadDefaults) -{ - - - - /* SecClearAllKeys(Adapter); */ - /* 8711 CAM was not for En/Decrypt only */ - /* so, we can't clear all keys. */ - /* should we disable WPAcfg (ox0088) bit 1-2, instead of clear all CAM */ - - /* TO DO... */ - - - return _TRUE; -} - -u8 set_802_11_test(_adapter *padapter, NDIS_802_11_TEST *test) -{ - u8 ret = _TRUE; - - - switch (test->Type) { - case 1: - NdisMIndicateStatus(padapter->hndis_adapter, NDIS_STATUS_MEDIA_SPECIFIC_INDICATION, (PVOID)&test->AuthenticationEvent, test->Length - 8); - NdisMIndicateStatusComplete(padapter->hndis_adapter); - break; - - case 2: - NdisMIndicateStatus(padapter->hndis_adapter, NDIS_STATUS_MEDIA_SPECIFIC_INDICATION, (PVOID)&test->RssiTrigger, sizeof(NDIS_802_11_RSSI)); - NdisMIndicateStatusComplete(padapter->hndis_adapter); - break; - - default: - ret = _FALSE; - break; - } - - - return ret; -} - -u8 rtw_set_802_11_pmkid(_adapter *padapter, NDIS_802_11_PMKID *pmkid) -{ - u8 ret = _SUCCESS; - - return ret; -} - -#endif - u8 rtw_set_802_11_bssid(_adapter *padapter, u8 *bssid) { _irqL irqL; @@ -277,7 +181,6 @@ u8 rtw_set_802_11_bssid(_adapter *padapter, u8 *bssid) struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - RTW_PRINT("set bssid:%pM\n", bssid); if ((bssid[0] == 0x00 && bssid[1] == 0x00 && bssid[2] == 0x00 && bssid[3] == 0x00 && bssid[4] == 0x00 && bssid[5] == 0x00) || @@ -288,7 +191,6 @@ u8 rtw_set_802_11_bssid(_adapter *padapter, u8 *bssid) _enter_critical_bh(&pmlmepriv->lock, &irqL); - RTW_INFO("Set BSSID under fw_state=0x%08x\n", get_fwstate(pmlmepriv)); if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == _TRUE) goto handle_tkip_countermeasure; @@ -336,7 +238,6 @@ release_mlme_lock: exit: - return status; } @@ -349,7 +250,6 @@ u8 rtw_set_802_11_ssid(_adapter *padapter, NDIS_802_11_SSID *ssid) struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct wlan_network *pnetwork = &pmlmepriv->cur_network; - RTW_PRINT("set ssid [%s] fw_state=0x%08x\n", ssid->Ssid, get_fwstate(pmlmepriv)); @@ -433,7 +333,6 @@ release_mlme_lock: exit: - return status; } @@ -447,7 +346,6 @@ u8 rtw_set_802_11_connect(_adapter *padapter, u8 *bssid, NDIS_802_11_SSID *ssid) bool ssid_valid = _TRUE; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - if (!ssid || rtw_validate_ssid(ssid) == _FALSE) ssid_valid = _FALSE; @@ -503,7 +401,6 @@ release_mlme_lock: exit: - return status; } @@ -516,8 +413,6 @@ u8 rtw_set_802_11_infrastructure_mode(_adapter *padapter, NDIS_802_11_NETWORK_INFRASTRUCTURE *pold_state = &(cur_network->network.InfrastructureMode); u8 ap2sta_mode = _FALSE; - - if (*pold_state != networktype) { /* RTW_INFO("change mode, old_mode=%d, new_mode=%d, fw_state=0x%x\n", *pold_state, networktype, get_fwstate(pmlmepriv)); */ @@ -580,21 +475,17 @@ u8 rtw_set_802_11_infrastructure_mode(_adapter *padapter, /* SecClearAllKeys(adapter); */ - _exit_critical_bh(&pmlmepriv->lock, &irqL); } - return _TRUE; } - u8 rtw_set_802_11_disassociate(_adapter *padapter) { _irqL irqL; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - _enter_critical_bh(&pmlmepriv->lock, &irqL); if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) { @@ -609,7 +500,6 @@ u8 rtw_set_802_11_disassociate(_adapter *padapter) _exit_critical_bh(&pmlmepriv->lock, &irqL); - return _TRUE; } @@ -634,8 +524,6 @@ u8 rtw_set_802_11_bssid_list_scan(_adapter *padapter, NDIS_802_11_SSID *pssid, i struct mlme_priv *pmlmepriv = &padapter->mlmepriv; u8 res = _TRUE; - - if (padapter == NULL) { res = _FALSE; goto exit; @@ -650,7 +538,6 @@ u8 rtw_set_802_11_bssid_list_scan(_adapter *padapter, NDIS_802_11_SSID *pssid, i /* Scan or linking is in progress, do nothing. */ res = _TRUE; - } else { if (rtw_is_scan_deny(padapter)) { RTW_INFO(FUNC_ADPT_FMT": scan deny\n", FUNC_ADPT_ARG(padapter)); @@ -666,7 +553,6 @@ u8 rtw_set_802_11_bssid_list_scan(_adapter *padapter, NDIS_802_11_SSID *pssid, i } exit: - return res; } #endif @@ -676,11 +562,8 @@ u8 rtw_set_802_11_authentication_mode(_adapter *padapter, NDIS_802_11_AUTHENTICA int res; u8 ret; - - psecuritypriv->ndisauthtype = authmode; - if (psecuritypriv->ndisauthtype > 3) psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_8021X; @@ -696,7 +579,6 @@ u8 rtw_set_802_11_authentication_mode(_adapter *padapter, NDIS_802_11_AUTHENTICA else ret = _FALSE; - return ret; } @@ -709,7 +591,6 @@ u8 rtw_set_802_11_add_wep(_adapter *padapter, NDIS_802_11_WEP *wep) struct security_priv *psecuritypriv = &(padapter->securitypriv); u8 ret = _SUCCESS; - bdefaultkey = (wep->KeyIndex & 0x40000000) > 0 ? _FALSE : _TRUE; /* for ??? */ btransmitkey = (wep->KeyIndex & 0x80000000) > 0 ? _TRUE : _FALSE; /* for ??? */ keyid = wep->KeyIndex & 0x3fffffff; @@ -731,21 +612,18 @@ u8 rtw_set_802_11_add_wep(_adapter *padapter, NDIS_802_11_WEP *wep) break; } - _rtw_memcpy(&(psecuritypriv->dot11DefKey[keyid].skey[0]), &(wep->KeyMaterial), wep->KeyLength); psecuritypriv->dot11DefKeylen[keyid] = wep->KeyLength; psecuritypriv->dot11PrivacyKeyIndex = keyid; - res = rtw_set_key(padapter, psecuritypriv, keyid, 1, _TRUE); if (res == _FAIL) ret = _FALSE; exit: - return ret; } @@ -755,7 +633,6 @@ u8 rtw_set_802_11_remove_wep(_adapter *padapter, u32 keyindex) u8 ret = _SUCCESS; - if (keyindex >= 0x80000000 || padapter == NULL) { ret = _FALSE; @@ -782,7 +659,6 @@ u8 rtw_set_802_11_remove_wep(_adapter *padapter, u32 keyindex) exit: - return ret; } @@ -797,7 +673,6 @@ u8 rtw_set_802_11_add_key(_adapter *padapter, NDIS_802_11_KEY *key) u8 bgrouptkey = _FALSE;/* can be remove later */ u8 ret = _SUCCESS; - if (((key->KeyIndex & 0x80000000) == 0) && ((key->KeyIndex & 0x40000000) > 0)) { /* It is invalid to clear bit 31 and set bit 30. If the miniport driver encounters this combination, */ @@ -809,7 +684,6 @@ u8 rtw_set_802_11_add_key(_adapter *padapter, NDIS_802_11_KEY *key) if (key->KeyIndex & 0x40000000) { /* Pairwise key */ - pbssid = get_bssid(&padapter->mlmepriv); stainfo = rtw_get_stainfo(&padapter->stapriv, pbssid); @@ -819,9 +693,6 @@ u8 rtw_set_802_11_add_key(_adapter *padapter, NDIS_802_11_KEY *key) encryptionalgo = padapter->securitypriv.dot11PrivacyAlgrthm; } - - - if (key->KeyIndex & 0x000000FF) { /* The key index is specified in the lower 8 bits by values of zero to 255. */ /* The key index should be set to zero for a Pairwise key, and the driver should fail with */ @@ -869,7 +740,6 @@ u8 rtw_set_802_11_add_key(_adapter *padapter, NDIS_802_11_KEY *key) } else { /* Group key - KeyIndex(BIT30==0) */ - /* when add wep key through add key and didn't assigned encryption type before */ if ((padapter->securitypriv.ndisauthtype <= 3) && (padapter->securitypriv.dot118021XGrpPrivacy == 0)) { @@ -887,7 +757,6 @@ u8 rtw_set_802_11_add_key(_adapter *padapter, NDIS_802_11_KEY *key) encryptionalgo = padapter->securitypriv.dot11PrivacyAlgrthm; - } else { encryptionalgo = padapter->securitypriv.dot118021XGrpPrivacy; @@ -925,7 +794,6 @@ u8 rtw_set_802_11_add_key(_adapter *padapter, NDIS_802_11_KEY *key) bgroup = _TRUE; - } /* If WEP encryption algorithm, just call rtw_set_802_11_add_wep(). */ @@ -935,13 +803,11 @@ u8 rtw_set_802_11_add_key(_adapter *padapter, NDIS_802_11_KEY *key) u32 len = FIELD_OFFSET(NDIS_802_11_KEY, KeyMaterial) + key->KeyLength; NDIS_802_11_WEP *wep = &padapter->securitypriv.ndiswep; - wep->Length = len; keyindex = key->KeyIndex & 0x7fffffff; wep->KeyIndex = keyindex ; wep->KeyLength = key->KeyLength; - _rtw_memcpy(wep->KeyMaterial, key->KeyMaterial, key->KeyLength); _rtw_memcpy(&(padapter->securitypriv.dot11DefKey[keyindex].skey[0]), key->KeyMaterial, key->KeyLength); @@ -987,12 +853,10 @@ u8 rtw_set_802_11_add_key(_adapter *padapter, NDIS_802_11_KEY *key) _rtw_memcpy(&padapter->securitypriv.dot118021XGrptxmickey[(u8)((key->KeyIndex) & 0x03)], key->KeyMaterial + 16, 8); _rtw_memcpy(&padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex) & 0x03)], key->KeyMaterial + 24, 8); - } else { _rtw_memcpy(&padapter->securitypriv.dot118021XGrptxmickey[(u8)((key->KeyIndex) & 0x03)], key->KeyMaterial + 24, 8); _rtw_memcpy(&padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex) & 0x03)], key->KeyMaterial + 16, 8); - } /* set group key by index */ @@ -1004,7 +868,6 @@ u8 rtw_set_802_11_add_key(_adapter *padapter, NDIS_802_11_KEY *key) padapter->securitypriv.bcheck_grpkey = _FALSE; - res = rtw_set_key(padapter, &padapter->securitypriv, key->KeyIndex, 1, _TRUE); if (res == _FAIL) @@ -1028,7 +891,6 @@ u8 rtw_set_802_11_add_key(_adapter *padapter, NDIS_802_11_KEY *key) /* _set_timer(&padapter->securitypriv.tkip_timer, 50); */ - /* if TKIP, save the Receive/Transmit MIC key in KeyMaterial[128-255] */ if ((key->KeyIndex & 0x10000000)) { _rtw_memcpy(&stainfo->dot11tkiptxmickey, key->KeyMaterial + 16, 8); @@ -1044,29 +906,17 @@ u8 rtw_set_802_11_add_key(_adapter *padapter, NDIS_802_11_KEY *key) } - /* Set key to CAM through H2C command */ -#if 0 - if (bgrouptkey) { /* never go to here */ - res = rtw_setstakey_cmd(padapter, stainfo, GROUP_KEY, _TRUE); - } else { - res = rtw_setstakey_cmd(padapter, stainfo, UNICAST_KEY, _TRUE); - } -#else res = rtw_setstakey_cmd(padapter, stainfo, UNICAST_KEY, _TRUE); -#endif if (res == _FALSE) ret = _FAIL; - } - } exit: - return ret; } @@ -1080,7 +930,6 @@ u8 rtw_set_802_11_remove_key(_adapter *padapter, NDIS_802_11_REMOVE_KEY *key) u8 keyIndex = (u8)key->KeyIndex & 0x03; u8 ret = _SUCCESS; - if ((key->KeyIndex & 0xbffffffc) > 0) { ret = _FAIL; goto exit; @@ -1116,7 +965,6 @@ u8 rtw_set_802_11_remove_key(_adapter *padapter, NDIS_802_11_REMOVE_KEY *key) exit: - return _TRUE; } diff --git a/core/rtw_mp.c b/core/rtw_mp.c index 16c1389..51c4a84 100644 --- a/core/rtw_mp.c +++ b/core/rtw_mp.c @@ -19,9 +19,6 @@ ******************************************************************************/ #define _RTW_MP_C_ #include -#ifdef PLATFORM_FREEBSD - #include /* for RFHIGHPID */ -#endif #include "../hal/phydm/phydm_precomp.h" #if defined(CONFIG_RTL8723B) || defined(CONFIG_RTL8821A) @@ -166,65 +163,6 @@ static void _init_mp_priv_(struct mp_priv *pmp_priv) } -#ifdef PLATFORM_WINDOWS -#if 0 -void mp_wi_callback( - IN NDIS_WORK_ITEM *pwk_item, - IN PVOID cntx -) -{ - _adapter *padapter = (_adapter *)cntx; - struct mp_priv *pmppriv = &padapter->mppriv; - struct mp_wi_cntx *pmp_wi_cntx = &pmppriv->wi_cntx; - - /* Execute specified action. */ - if (pmp_wi_cntx->curractfunc != NULL) { - LARGE_INTEGER cur_time; - ULONGLONG start_time, end_time; - NdisGetCurrentSystemTime(&cur_time); /* driver version */ - start_time = cur_time.QuadPart / 10; /* The return value is in microsecond */ - - pmp_wi_cntx->curractfunc(padapter); - - NdisGetCurrentSystemTime(&cur_time); /* driver version */ - end_time = cur_time.QuadPart / 10; /* The return value is in microsecond */ - - } - - NdisAcquireSpinLock(&(pmp_wi_cntx->mp_wi_lock)); - pmp_wi_cntx->bmp_wi_progress = _FALSE; - NdisReleaseSpinLock(&(pmp_wi_cntx->mp_wi_lock)); - - if (pmp_wi_cntx->bmpdrv_unload) - NdisSetEvent(&(pmp_wi_cntx->mp_wi_evt)); - -} -#endif - -static int init_mp_priv_by_os(struct mp_priv *pmp_priv) -{ - struct mp_wi_cntx *pmp_wi_cntx; - - if (pmp_priv == NULL) - return _FAIL; - - pmp_priv->rx_testcnt = 0; - pmp_priv->rx_testcnt1 = 0; - pmp_priv->rx_testcnt2 = 0; - - pmp_priv->tx_testcnt = 0; - pmp_priv->tx_testcnt1 = 0; - - pmp_wi_cntx = &pmp_priv->wi_cntx - pmp_wi_cntx->bmpdrv_unload = _FALSE; - pmp_wi_cntx->bmp_wi_progress = _FALSE; - pmp_wi_cntx->curractfunc = NULL; - - return _SUCCESS; -} -#endif - -#ifdef PLATFORM_LINUX static int init_mp_priv_by_os(struct mp_priv *pmp_priv) { int i, res; @@ -265,7 +203,6 @@ _exit_init_mp_priv: return res; } -#endif static void mp_init_xmit_attrib(struct mp_tx *pmptx, PADAPTER padapter) { @@ -279,21 +216,13 @@ static void mp_init_xmit_attrib(struct mp_tx *pmptx, PADAPTER padapter) _rtw_memset(pmptx->desc, 0, TXDESC_SIZE); pattrib->ether_type = 0x8712; -#if 0 - _rtw_memcpy(pattrib->src, adapter_mac_addr(padapter), ETH_ALEN); - _rtw_memcpy(pattrib->ta, pattrib->src, ETH_ALEN); -#endif _rtw_memset(pattrib->dst, 0xFF, ETH_ALEN); - /* pattrib->dhcp_pkt = 0; - * pattrib->pktlen = 0; */ pattrib->ack_policy = 0; - /* pattrib->pkt_hdrlen = ETH_HLEN; */ pattrib->hdrlen = WLAN_HDR_A3_LEN; pattrib->subtype = WIFI_DATA; pattrib->priority = 0; pattrib->qsel = pattrib->priority; - /* do_queue_select(padapter, pattrib); */ pattrib->nr_frags = 1; pattrib->encrypt = 0; pattrib->bswenc = _FALSE; @@ -545,9 +474,6 @@ static void PHY_LCCalibrate(PADAPTER padapter) phy_lc_calibrate_8723d(&(GET_HAL_DATA(padapter)->odmpriv)); #endif } else if (IS_HARDWARE_TYPE_8821C(padapter)) { -#ifdef CONFIG_RTL8821C - /*phy_iq_calibrate_8821c(&(GET_HAL_DATA(padapter)->odmpriv));*/ -#endif } } @@ -555,45 +481,6 @@ static void PHY_LCCalibrate(PADAPTER padapter) static u8 PHY_QueryRFPathSwitch(PADAPTER padapter) { u8 bmain = 0; -/* - if (IS_HARDWARE_TYPE_8723B(padapter)) { -#ifdef CONFIG_RTL8723B - bmain = PHY_QueryRFPathSwitch_8723B(padapter); -#endif - } else if (IS_HARDWARE_TYPE_8188E(padapter)) { -#ifdef CONFIG_RTL8188E - bmain = PHY_QueryRFPathSwitch_8188E(padapter); -#endif - } else if (IS_HARDWARE_TYPE_8814A(padapter)) { -#ifdef CONFIG_RTL8814A - bmain = PHY_QueryRFPathSwitch_8814A(padapter); -#endif - } else if (IS_HARDWARE_TYPE_8812(padapter) || IS_HARDWARE_TYPE_8821(padapter)) { -#if defined(CONFIG_RTL8812A) || defined(CONFIG_RTL8821A) - bmain = PHY_QueryRFPathSwitch_8812A(padapter); -#endif - } else if (IS_HARDWARE_TYPE_8192E(padapter)) { -#ifdef CONFIG_RTL8192E - bmain = PHY_QueryRFPathSwitch_8192E(padapter); -#endif - } else if (IS_HARDWARE_TYPE_8703B(padapter)) { -#ifdef CONFIG_RTL8703B - bmain = PHY_QueryRFPathSwitch_8703B(padapter); -#endif - } else if (IS_HARDWARE_TYPE_8188F(padapter)) { -#ifdef CONFIG_RTL8188F - bmain = PHY_QueryRFPathSwitch_8188F(padapter); -#endif - } else if (IS_HARDWARE_TYPE_8822B(padapter)) { -#ifdef CONFIG_RTL8822B - bmain = PHY_QueryRFPathSwitch_8822B(padapter); -#endif - } else if (IS_HARDWARE_TYPE_8723D(padapter)) { -#ifdef CONFIG_RTL8723D - bmain = PHY_QueryRFPathSwitch_8723D(padapter); -#endif - } else -*/ if (IS_HARDWARE_TYPE_8821C(padapter)) { #ifdef CONFIG_RTL8821C @@ -701,16 +588,10 @@ MPT_InitializeAdapter( /* Don't accept any packets */ rtw_write32(pAdapter, REG_RCR, 0); - /* ledsetting = rtw_read32(pAdapter, REG_LEDCFG0); */ - /* rtw_write32(pAdapter, REG_LEDCFG0, ledsetting & ~LED0DIS); */ - - /* rtw_write32(pAdapter, REG_LEDCFG0, 0x08080); */ ledsetting = rtw_read32(pAdapter, REG_LEDCFG0); - PHY_LCCalibrate(pAdapter); PHY_IQCalibrate(pAdapter, _FALSE); - /* dm_check_txpowertracking(&pHalData->odmpriv); */ /* trigger thermal meter */ PHY_SetRFPathSwitch(pAdapter, 1/*pHalData->bDefaultAntenna*/); /* default use Main */ @@ -766,15 +647,6 @@ MPT_DeInitAdapter( #if defined(CONFIG_RTL8723B) phy_set_bb_reg(pAdapter, 0xA01, BIT0, 1); /* /suggestion by jerry for MP Rx. */ #endif -#if 0 /* for Windows */ - PlatformFreeWorkItem(&(pMptCtx->MptWorkItem)); - - while (pMptCtx->bMptWorkItemInProgress) { - if (NdisWaitEvent(&(pMptCtx->MptWorkItemEvent), 50)) - break; - } - NdisFreeSpinLock(&(pMptCtx->MptWorkItemSpinLock)); -#endif } static u8 mpt_ProStartTest(PADAPTER padapter) @@ -798,7 +670,6 @@ static u8 mpt_ProStartTest(PADAPTER padapter) */ s32 SetPowerTracking(PADAPTER padapter, u8 enable) { - hal_mpt_SetPowerTracking(padapter, enable); return 0; } @@ -1141,48 +1012,6 @@ end_of_mp_stop_test: } } /*---------------------------hal\rtl8192c\MPT_Phy.c---------------------------*/ -#if 0 -/* #ifdef CONFIG_USB_HCI */ -static VOID mpt_AdjustRFRegByRateByChan92CU(PADAPTER pAdapter, u8 RateIdx, u8 Channel, u8 BandWidthID) -{ - u8 eRFPath; - u32 rfReg0x26; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter); - - - if (RateIdx < MPT_RATE_6M) /* CCK rate,for 88cu */ - rfReg0x26 = 0xf400; - else if ((RateIdx >= MPT_RATE_6M) && (RateIdx <= MPT_RATE_54M)) {/* OFDM rate,for 88cu */ - if ((4 == Channel) || (8 == Channel) || (12 == Channel)) - rfReg0x26 = 0xf000; - else if ((5 == Channel) || (7 == Channel) || (13 == Channel) || (14 == Channel)) - rfReg0x26 = 0xf400; - else - rfReg0x26 = 0x4f200; - } else if ((RateIdx >= MPT_RATE_MCS0) && (RateIdx <= MPT_RATE_MCS15)) { - /* MCS 20M ,for 88cu */ /* MCS40M rate,for 88cu */ - - if (CHANNEL_WIDTH_20 == BandWidthID) { - if ((4 == Channel) || (8 == Channel)) - rfReg0x26 = 0xf000; - else if ((5 == Channel) || (7 == Channel) || (13 == Channel) || (14 == Channel)) - rfReg0x26 = 0xf400; - else - rfReg0x26 = 0x4f200; - } else { - if ((4 == Channel) || (8 == Channel)) - rfReg0x26 = 0xf000; - else if ((5 == Channel) || (7 == Channel)) - rfReg0x26 = 0xf400; - else - rfReg0x26 = 0x4f200; - } - } - - for (eRFPath = 0; eRFPath < pHalData->NumTotalRFPath; eRFPath++) - write_rfreg(pAdapter, eRFPath, RF_SYN_G2, rfReg0x26); -} -#endif /*----------------------------------------------------------------------------- * Function: mpt_SwitchRfSetting * @@ -1937,22 +1766,9 @@ void SetPacketTx(PADAPTER padapter) rtw_mfree(pmp_priv->TXradomBuffer, 4096); /* 3 6. start thread */ -#ifdef PLATFORM_LINUX pmp_priv->tx.PktTxThread = kthread_run(mp_xmit_packet_thread, pmp_priv, "RTW_MP_THREAD"); if (IS_ERR(pmp_priv->tx.PktTxThread)) RTW_INFO("Create PktTx Thread Fail !!!!!\n"); -#endif -#ifdef PLATFORM_FREEBSD - { - struct proc *p; - struct thread *td; - pmp_priv->tx.PktTxThread = kproc_kthread_add(mp_xmit_packet_thread, pmp_priv, - &p, &td, RFHIGHPID, 0, "MPXmitThread", "MPXmitThread"); - - if (pmp_priv->tx.PktTxThread < 0) - RTW_INFO("Create PktTx Thread Fail !!!!!\n"); - } -#endif Rtw_MPSetMacTxEDCA(padapter); exit: @@ -2100,11 +1916,9 @@ u32 mp_query_psd(PADAPTER pAdapter, u8 *data) u32 psd_data = 0; -#ifdef PLATFORM_LINUX if (!netif_running(pAdapter->pnetdev)) { return 0; } -#endif if (check_fwstate(&pAdapter->mlmepriv, WIFI_MP_STATE) == _FALSE) { return 0; @@ -2138,92 +1952,6 @@ u32 mp_query_psd(PADAPTER pAdapter, u8 *data) return strlen(data) + 1; } - -#if 0 -void _rtw_mp_xmit_priv(struct xmit_priv *pxmitpriv) -{ - int i, res; - _adapter *padapter = pxmitpriv->adapter; - struct xmit_frame *pxmitframe = (struct xmit_frame *) pxmitpriv->pxmit_frame_buf; - struct xmit_buf *pxmitbuf = (struct xmit_buf *)pxmitpriv->pxmitbuf; - - u32 max_xmit_extbuf_size = MAX_XMIT_EXTBUF_SZ; - u32 num_xmit_extbuf = NR_XMIT_EXTBUFF; - if (padapter->registrypriv.mp_mode == 0) { - max_xmit_extbuf_size = MAX_XMIT_EXTBUF_SZ; - num_xmit_extbuf = NR_XMIT_EXTBUFF; - } else { - max_xmit_extbuf_size = 6000; - num_xmit_extbuf = 8; - } - - pxmitbuf = (struct xmit_buf *)pxmitpriv->pxmit_extbuf; - for (i = 0; i < num_xmit_extbuf; i++) { - rtw_os_xmit_resource_free(padapter, pxmitbuf, (max_xmit_extbuf_size + XMITBUF_ALIGN_SZ), _FALSE); - - pxmitbuf++; - } - - if (pxmitpriv->pallocated_xmit_extbuf) - rtw_vmfree(pxmitpriv->pallocated_xmit_extbuf, num_xmit_extbuf * sizeof(struct xmit_buf) + 4); - - if (padapter->registrypriv.mp_mode == 0) { - max_xmit_extbuf_size = 6000; - num_xmit_extbuf = 8; - } else { - max_xmit_extbuf_size = MAX_XMIT_EXTBUF_SZ; - num_xmit_extbuf = NR_XMIT_EXTBUFF; - } - - /* Init xmit extension buff */ - _rtw_init_queue(&pxmitpriv->free_xmit_extbuf_queue); - - pxmitpriv->pallocated_xmit_extbuf = rtw_zvmalloc(num_xmit_extbuf * sizeof(struct xmit_buf) + 4); - - if (pxmitpriv->pallocated_xmit_extbuf == NULL) { - res = _FAIL; - goto exit; - } - - pxmitpriv->pxmit_extbuf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(pxmitpriv->pallocated_xmit_extbuf), 4); - - pxmitbuf = (struct xmit_buf *)pxmitpriv->pxmit_extbuf; - - for (i = 0; i < num_xmit_extbuf; i++) { - _rtw_init_listhead(&pxmitbuf->list); - - pxmitbuf->priv_data = NULL; - pxmitbuf->padapter = padapter; - pxmitbuf->buf_tag = XMITBUF_MGNT; - - res = rtw_os_xmit_resource_alloc(padapter, pxmitbuf, max_xmit_extbuf_size + XMITBUF_ALIGN_SZ, _TRUE); - if (res == _FAIL) { - res = _FAIL; - goto exit; - } - -#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) - pxmitbuf->phead = pxmitbuf->pbuf; - pxmitbuf->pend = pxmitbuf->pbuf + max_xmit_extbuf_size; - pxmitbuf->len = 0; - pxmitbuf->pdata = pxmitbuf->ptail = pxmitbuf->phead; -#endif - - rtw_list_insert_tail(&pxmitbuf->list, &(pxmitpriv->free_xmit_extbuf_queue.queue)); -#ifdef DBG_XMIT_BUF_EXT - pxmitbuf->no = i; -#endif - pxmitbuf++; - - } - - pxmitpriv->free_xmit_extbuf_cnt = num_xmit_extbuf; - -exit: - ; -} -#endif - u8 mpt_to_mgnt_rate( IN ULONG MptRateIdx diff --git a/core/rtw_mp_ioctl.c b/core/rtw_mp_ioctl.c index 33bd6d2..b658e10 100644 --- a/core/rtw_mp_ioctl.c +++ b/core/rtw_mp_ioctl.c @@ -29,7 +29,6 @@ NDIS_STATUS oid_rt_wireless_mode_hdl(struct oid_par_priv *poid_par_priv) NDIS_STATUS status = NDIS_STATUS_SUCCESS; PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - if (poid_par_priv->information_buf_len < sizeof(u8)) return NDIS_STATUS_INVALID_LENGTH; @@ -41,23 +40,17 @@ NDIS_STATUS oid_rt_wireless_mode_hdl(struct oid_par_priv *poid_par_priv) } else status = NDIS_STATUS_NOT_ACCEPTED; - return status; } /* **************** oid_rtl_seg_81_87_80 section start **************** */ NDIS_STATUS oid_rt_pro_write_bb_reg_hdl(struct oid_par_priv *poid_par_priv) { -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif struct bb_reg_param *pbbreg; u16 offset; u32 value; NDIS_STATUS status = NDIS_STATUS_SUCCESS; PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - if (poid_par_priv->type_of_oid != SET_OID) return NDIS_STATUS_NOT_ACCEPTED; @@ -72,28 +65,21 @@ NDIS_STATUS oid_rt_pro_write_bb_reg_hdl(struct oid_par_priv *poid_par_priv) value = pbbreg->value; - _irqlevel_changed_(&oldirql, LOWER); write_bbreg(Adapter, offset, 0xFFFFFFFF, value); _irqlevel_changed_(&oldirql, RAISE); - return status; } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_pro_read_bb_reg_hdl(struct oid_par_priv *poid_par_priv) { -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif struct bb_reg_param *pbbreg; u16 offset; u32 value; NDIS_STATUS status = NDIS_STATUS_SUCCESS; PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - if (poid_par_priv->type_of_oid != QUERY_OID) return NDIS_STATUS_NOT_ACCEPTED; @@ -113,15 +99,11 @@ NDIS_STATUS oid_rt_pro_read_bb_reg_hdl(struct oid_par_priv *poid_par_priv) pbbreg->value = value; *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; - return status; } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_pro_write_rf_reg_hdl(struct oid_par_priv *poid_par_priv) { -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif struct rf_reg_param *pbbreg; u8 path; u8 offset; @@ -129,8 +111,6 @@ NDIS_STATUS oid_rt_pro_write_rf_reg_hdl(struct oid_par_priv *poid_par_priv) NDIS_STATUS status = NDIS_STATUS_SUCCESS; PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - if (poid_par_priv->type_of_oid != SET_OID) return NDIS_STATUS_NOT_ACCEPTED; @@ -150,20 +130,15 @@ NDIS_STATUS oid_rt_pro_write_rf_reg_hdl(struct oid_par_priv *poid_par_priv) offset = (u8)pbbreg->offset; value = pbbreg->value; - _irqlevel_changed_(&oldirql, LOWER); write_rfreg(Adapter, path, offset, value); _irqlevel_changed_(&oldirql, RAISE); - return status; } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_pro_read_rf_reg_hdl(struct oid_par_priv *poid_par_priv) { -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif struct rf_reg_param *pbbreg; u8 path; u8 offset; @@ -171,8 +146,6 @@ NDIS_STATUS oid_rt_pro_read_rf_reg_hdl(struct oid_par_priv *poid_par_priv) PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); NDIS_STATUS status = NDIS_STATUS_SUCCESS; - - if (poid_par_priv->type_of_oid != QUERY_OID) return NDIS_STATUS_NOT_ACCEPTED; @@ -197,8 +170,6 @@ NDIS_STATUS oid_rt_pro_read_rf_reg_hdl(struct oid_par_priv *poid_par_priv) *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; - - return status; } /* **************** oid_rtl_seg_81_87_00 section end**************** @@ -208,15 +179,10 @@ NDIS_STATUS oid_rt_pro_read_rf_reg_hdl(struct oid_par_priv *poid_par_priv) * ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_pro_set_data_rate_hdl(struct oid_par_priv *poid_par_priv) { -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif u32 ratevalue;/* 4 */ NDIS_STATUS status = NDIS_STATUS_SUCCESS; PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - if (poid_par_priv->type_of_oid != SET_OID) return NDIS_STATUS_NOT_ACCEPTED; @@ -233,21 +199,15 @@ NDIS_STATUS oid_rt_pro_set_data_rate_hdl(struct oid_par_priv *poid_par_priv) SetDataRate(Adapter); _irqlevel_changed_(&oldirql, RAISE); - return status; } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_pro_start_test_hdl(struct oid_par_priv *poid_par_priv) { -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif u32 mode; NDIS_STATUS status = NDIS_STATUS_SUCCESS; PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - if (Adapter->registrypriv.mp_mode == 0) return NDIS_STATUS_NOT_ACCEPTED; @@ -269,21 +229,14 @@ NDIS_STATUS oid_rt_pro_start_test_hdl(struct oid_par_priv *poid_par_priv) exit: _irqlevel_changed_(&oldirql, RAISE); - - return status; } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_pro_stop_test_hdl(struct oid_par_priv *poid_par_priv) { -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif NDIS_STATUS status = NDIS_STATUS_SUCCESS; PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - if (poid_par_priv->type_of_oid != SET_OID) return NDIS_STATUS_NOT_ACCEPTED; @@ -291,22 +244,15 @@ NDIS_STATUS oid_rt_pro_stop_test_hdl(struct oid_par_priv *poid_par_priv) mp_stop_test(Adapter); _irqlevel_changed_(&oldirql, RAISE); - - return status; } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_pro_set_channel_direct_call_hdl(struct oid_par_priv *poid_par_priv) { -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif u32 Channel; NDIS_STATUS status = NDIS_STATUS_SUCCESS; PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - if (poid_par_priv->information_buf_len != sizeof(u32)) return NDIS_STATUS_INVALID_LENGTH; @@ -327,22 +273,16 @@ NDIS_STATUS oid_rt_pro_set_channel_direct_call_hdl(struct oid_par_priv *poid_par SetChannel(Adapter); _irqlevel_changed_(&oldirql, RAISE); - return status; } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_set_bandwidth_hdl(struct oid_par_priv *poid_par_priv) { -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif u16 bandwidth; u16 channel_offset; NDIS_STATUS status = NDIS_STATUS_SUCCESS; PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context); - - if (poid_par_priv->type_of_oid != SET_OID) return NDIS_STATUS_NOT_ACCEPTED; @@ -361,22 +301,15 @@ NDIS_STATUS oid_rt_set_bandwidth_hdl(struct oid_par_priv *poid_par_priv) SetBandwidth(padapter); _irqlevel_changed_(&oldirql, RAISE); - - return status; } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_pro_set_antenna_bb_hdl(struct oid_par_priv *poid_par_priv) { -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif u32 antenna; NDIS_STATUS status = NDIS_STATUS_SUCCESS; PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - if (poid_par_priv->information_buf_len != sizeof(u32)) return NDIS_STATUS_INVALID_LENGTH; @@ -394,21 +327,15 @@ NDIS_STATUS oid_rt_pro_set_antenna_bb_hdl(struct oid_par_priv *poid_par_priv) *(u32 *)poid_par_priv->information_buf = antenna; } - return status; } NDIS_STATUS oid_rt_pro_set_tx_power_control_hdl(struct oid_par_priv *poid_par_priv) { -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif u32 tx_pwr_idx; NDIS_STATUS status = NDIS_STATUS_SUCCESS; PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - if (poid_par_priv->type_of_oid != SET_OID) return NDIS_STATUS_NOT_ACCEPTED; @@ -421,12 +348,10 @@ NDIS_STATUS oid_rt_pro_set_tx_power_control_hdl(struct oid_par_priv *poid_par_pr Adapter->mppriv.txpoweridx = (u8)tx_pwr_idx; - _irqlevel_changed_(&oldirql, LOWER); SetTxPower(Adapter); _irqlevel_changed_(&oldirql, RAISE); - return status; } @@ -438,7 +363,6 @@ NDIS_STATUS oid_rt_pro_query_tx_packet_sent_hdl(struct oid_par_priv *poid_par_pr NDIS_STATUS status = NDIS_STATUS_SUCCESS; PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - if (poid_par_priv->type_of_oid != QUERY_OID) { status = NDIS_STATUS_NOT_ACCEPTED; return status; @@ -450,7 +374,6 @@ NDIS_STATUS oid_rt_pro_query_tx_packet_sent_hdl(struct oid_par_priv *poid_par_pr } else status = NDIS_STATUS_INVALID_LENGTH; - return status; } /* ------------------------------------------------------------------------------ */ @@ -459,7 +382,6 @@ NDIS_STATUS oid_rt_pro_query_rx_packet_received_hdl(struct oid_par_priv *poid_pa NDIS_STATUS status = NDIS_STATUS_SUCCESS; PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - if (poid_par_priv->type_of_oid != QUERY_OID) { status = NDIS_STATUS_NOT_ACCEPTED; return status; @@ -470,7 +392,6 @@ NDIS_STATUS oid_rt_pro_query_rx_packet_received_hdl(struct oid_par_priv *poid_pa } else status = NDIS_STATUS_INVALID_LENGTH; - return status; } /* ------------------------------------------------------------------------------ */ @@ -479,7 +400,6 @@ NDIS_STATUS oid_rt_pro_query_rx_packet_crc32_error_hdl(struct oid_par_priv *poid NDIS_STATUS status = NDIS_STATUS_SUCCESS; PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - if (poid_par_priv->type_of_oid != QUERY_OID) { status = NDIS_STATUS_NOT_ACCEPTED; return status; @@ -490,7 +410,6 @@ NDIS_STATUS oid_rt_pro_query_rx_packet_crc32_error_hdl(struct oid_par_priv *poid } else status = NDIS_STATUS_INVALID_LENGTH; - return status; } /* ------------------------------------------------------------------------------ */ @@ -500,7 +419,6 @@ NDIS_STATUS oid_rt_pro_reset_tx_packet_sent_hdl(struct oid_par_priv *poid_par_pr NDIS_STATUS status = NDIS_STATUS_SUCCESS; PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - if (poid_par_priv->type_of_oid != SET_OID) { status = NDIS_STATUS_NOT_ACCEPTED; return status; @@ -508,7 +426,6 @@ NDIS_STATUS oid_rt_pro_reset_tx_packet_sent_hdl(struct oid_par_priv *poid_par_pr Adapter->mppriv.tx_pktcount = 0; - return status; } /* ------------------------------------------------------------------------------ */ @@ -517,7 +434,6 @@ NDIS_STATUS oid_rt_pro_reset_rx_packet_received_hdl(struct oid_par_priv *poid_pa NDIS_STATUS status = NDIS_STATUS_SUCCESS; PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - if (poid_par_priv->type_of_oid != SET_OID) { status = NDIS_STATUS_NOT_ACCEPTED; return status; @@ -529,19 +445,14 @@ NDIS_STATUS oid_rt_pro_reset_rx_packet_received_hdl(struct oid_par_priv *poid_pa } else status = NDIS_STATUS_INVALID_LENGTH; - return status; } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_reset_phy_rx_packet_count_hdl(struct oid_par_priv *poid_par_priv) { -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif NDIS_STATUS status = NDIS_STATUS_SUCCESS; PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - if (poid_par_priv->type_of_oid != SET_OID) { status = NDIS_STATUS_NOT_ACCEPTED; return status; @@ -551,20 +462,14 @@ NDIS_STATUS oid_rt_reset_phy_rx_packet_count_hdl(struct oid_par_priv *poid_par_p ResetPhyRxPktCount(Adapter); _irqlevel_changed_(&oldirql, RAISE); - return status; } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_get_phy_rx_packet_received_hdl(struct oid_par_priv *poid_par_priv) { -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif NDIS_STATUS status = NDIS_STATUS_SUCCESS; PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - if (poid_par_priv->type_of_oid != QUERY_OID) return NDIS_STATUS_NOT_ACCEPTED; @@ -577,25 +482,17 @@ NDIS_STATUS oid_rt_get_phy_rx_packet_received_hdl(struct oid_par_priv *poid_par_ *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; - - return status; } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_get_phy_rx_packet_crc32_error_hdl(struct oid_par_priv *poid_par_priv) { -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif NDIS_STATUS status = NDIS_STATUS_SUCCESS; PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - if (poid_par_priv->type_of_oid != QUERY_OID) return NDIS_STATUS_NOT_ACCEPTED; - if (poid_par_priv->information_buf_len != sizeof(ULONG)) return NDIS_STATUS_INVALID_LENGTH; @@ -605,22 +502,15 @@ NDIS_STATUS oid_rt_get_phy_rx_packet_crc32_error_hdl(struct oid_par_priv *poid_p *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; - - return status; } /* **************** oid_rtl_seg_81_80_20 section end **************** */ NDIS_STATUS oid_rt_pro_set_continuous_tx_hdl(struct oid_par_priv *poid_par_priv) { -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif u32 bStartTest; NDIS_STATUS status = NDIS_STATUS_SUCCESS; PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - if (poid_par_priv->type_of_oid != SET_OID) return NDIS_STATUS_NOT_ACCEPTED; @@ -641,21 +531,15 @@ NDIS_STATUS oid_rt_pro_set_continuous_tx_hdl(struct oid_par_priv *poid_par_priv) } _irqlevel_changed_(&oldirql, RAISE); - return status; } NDIS_STATUS oid_rt_pro_set_single_carrier_tx_hdl(struct oid_par_priv *poid_par_priv) { -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif u32 bStartTest; NDIS_STATUS status = NDIS_STATUS_SUCCESS; PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - if (poid_par_priv->type_of_oid != SET_OID) return NDIS_STATUS_NOT_ACCEPTED; @@ -676,21 +560,15 @@ NDIS_STATUS oid_rt_pro_set_single_carrier_tx_hdl(struct oid_par_priv *poid_par_p } _irqlevel_changed_(&oldirql, RAISE); - return status; } NDIS_STATUS oid_rt_pro_set_carrier_suppression_tx_hdl(struct oid_par_priv *poid_par_priv) { -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif u32 bStartTest; NDIS_STATUS status = NDIS_STATUS_SUCCESS; PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - if (poid_par_priv->type_of_oid != SET_OID) return NDIS_STATUS_NOT_ACCEPTED; @@ -711,21 +589,15 @@ NDIS_STATUS oid_rt_pro_set_carrier_suppression_tx_hdl(struct oid_par_priv *poid_ } _irqlevel_changed_(&oldirql, RAISE); - return status; } NDIS_STATUS oid_rt_pro_set_single_tone_tx_hdl(struct oid_par_priv *poid_par_priv) { -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif u32 bStartTest; NDIS_STATUS status = NDIS_STATUS_SUCCESS; PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - if (poid_par_priv->type_of_oid != SET_OID) return NDIS_STATUS_NOT_ACCEPTED; @@ -735,7 +607,6 @@ NDIS_STATUS oid_rt_pro_set_single_tone_tx_hdl(struct oid_par_priv *poid_par_priv SetSingleToneTx(Adapter, (u8)bStartTest); _irqlevel_changed_(&oldirql, RAISE); - return status; } @@ -748,9 +619,6 @@ NDIS_STATUS oid_rt_pro_trigger_gpio_hdl(struct oid_par_priv *poid_par_priv) { PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif NDIS_STATUS status = NDIS_STATUS_SUCCESS; if (poid_par_priv->type_of_oid != SET_OID) @@ -760,62 +628,22 @@ NDIS_STATUS oid_rt_pro_trigger_gpio_hdl(struct oid_par_priv *poid_par_priv) rtw_hal_set_hwreg(Adapter, HW_VAR_TRIGGER_GPIO_0, 0); _irqlevel_changed_(&oldirql, RAISE); - return status; } /* **************** oid_rtl_seg_81_80_00 section end **************** * ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_pro8711_join_bss_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - - PNDIS_802_11_SSID pssid; - - - if (poid_par_priv->type_of_oid != SET_OID) - return NDIS_STATUS_NOT_ACCEPTED; - - *poid_par_priv->bytes_needed = (u32)sizeof(NDIS_802_11_SSID); - *poid_par_priv->bytes_rw = 0; - if (poid_par_priv->information_buf_len < *poid_par_priv->bytes_needed) - return NDIS_STATUS_INVALID_LENGTH; - - pssid = (PNDIS_802_11_SSID)poid_par_priv->information_buf; - - _irqlevel_changed_(&oldirql, LOWER); - - if (mp_start_joinbss(Adapter, pssid) == _FAIL) - status = NDIS_STATUS_NOT_ACCEPTED; - - _irqlevel_changed_(&oldirql, RAISE); - - *poid_par_priv->bytes_rw = sizeof(NDIS_802_11_SSID); - - - return status; -#else return 0; -#endif } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_pro_read_register_hdl(struct oid_par_priv *poid_par_priv) { -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif pRW_Reg RegRWStruct; u32 offset, width; NDIS_STATUS status = NDIS_STATUS_SUCCESS; PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - if (poid_par_priv->type_of_oid != QUERY_OID) return NDIS_STATUS_NOT_ACCEPTED; @@ -845,22 +673,16 @@ NDIS_STATUS oid_rt_pro_read_register_hdl(struct oid_par_priv *poid_par_priv) *poid_par_priv->bytes_rw = width; - return status; } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_pro_write_register_hdl(struct oid_par_priv *poid_par_priv) { -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif pRW_Reg RegRWStruct; u32 offset, width, value; NDIS_STATUS status = NDIS_STATUS_SUCCESS; PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context); - - if (poid_par_priv->type_of_oid != SET_OID) return NDIS_STATUS_NOT_ACCEPTED; @@ -899,406 +721,77 @@ NDIS_STATUS oid_rt_pro_write_register_hdl(struct oid_par_priv *poid_par_priv) _irqlevel_changed_(&oldirql, RAISE); - - return status; } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_pro_burst_read_register_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif - pBurst_RW_Reg pBstRwReg; - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context); - - - - if (poid_par_priv->type_of_oid != QUERY_OID) - return NDIS_STATUS_NOT_ACCEPTED; - - pBstRwReg = (pBurst_RW_Reg)poid_par_priv->information_buf; - - _irqlevel_changed_(&oldirql, LOWER); - rtw_read_mem(padapter, pBstRwReg->offset, (u32)pBstRwReg->len, pBstRwReg->Data); - _irqlevel_changed_(&oldirql, RAISE); - - *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; - - - - return status; -#else return 0; -#endif } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_pro_burst_write_register_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif - pBurst_RW_Reg pBstRwReg; - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context); - - - - if (poid_par_priv->type_of_oid != SET_OID) - return NDIS_STATUS_NOT_ACCEPTED; - - pBstRwReg = (pBurst_RW_Reg)poid_par_priv->information_buf; - - _irqlevel_changed_(&oldirql, LOWER); - rtw_write_mem(padapter, pBstRwReg->offset, (u32)pBstRwReg->len, pBstRwReg->Data); - _irqlevel_changed_(&oldirql, RAISE); - - - - return status; -#else return 0; -#endif } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_pro_write_txcmd_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif - - TX_CMD_Desc *TxCmd_Info; - - - if (poid_par_priv->type_of_oid != SET_OID) - return NDIS_STATUS_NOT_ACCEPTED; - - - TxCmd_Info = (TX_CMD_Desc *)poid_par_priv->information_buf; - - - _irqlevel_changed_(&oldirql, LOWER); - - rtw_write32(Adapter, TxCmd_Info->offset + 0, (unsigned int)TxCmd_Info->TxCMD.value[0]); - rtw_write32(Adapter, TxCmd_Info->offset + 4, (unsigned int)TxCmd_Info->TxCMD.value[1]); - - _irqlevel_changed_(&oldirql, RAISE); - - - - return status; -#else return 0; -#endif } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_pro_read16_eeprom_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif - pEEPROM_RWParam pEEPROM; - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context); - - - - if (poid_par_priv->type_of_oid != QUERY_OID) - return NDIS_STATUS_NOT_ACCEPTED; - - pEEPROM = (pEEPROM_RWParam)poid_par_priv->information_buf; - - _irqlevel_changed_(&oldirql, LOWER); - pEEPROM->value = eeprom_read16(padapter, (u16)(pEEPROM->offset >> 1)); - _irqlevel_changed_(&oldirql, RAISE); - - *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; - - - - return status; -#else return 0; -#endif } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_pro_write16_eeprom_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif - pEEPROM_RWParam pEEPROM; - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context); - - - - if (poid_par_priv->type_of_oid != SET_OID) - return NDIS_STATUS_NOT_ACCEPTED; - - pEEPROM = (pEEPROM_RWParam)poid_par_priv->information_buf; - - _irqlevel_changed_(&oldirql, LOWER); - eeprom_write16(padapter, (u16)(pEEPROM->offset >> 1), pEEPROM->value); - _irqlevel_changed_(&oldirql, RAISE); - - *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; - - - return status; -#else return 0; -#endif } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_pro8711_wi_poll_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - - struct mp_wiparam *pwi_param; - - - if (poid_par_priv->type_of_oid != QUERY_OID) - return NDIS_STATUS_NOT_ACCEPTED; - - if (poid_par_priv->information_buf_len < sizeof(struct mp_wiparam)) - return NDIS_STATUS_INVALID_LENGTH; - - if (Adapter->mppriv.workparam.bcompleted == _FALSE) - return NDIS_STATUS_NOT_ACCEPTED; - - pwi_param = (struct mp_wiparam *)poid_par_priv->information_buf; - - _rtw_memcpy(pwi_param, &Adapter->mppriv.workparam, sizeof(struct mp_wiparam)); - Adapter->mppriv.act_in_progress = _FALSE; - *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; - - - return status; -#else return 0; -#endif } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_pro8711_pkt_loss_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - - - - if (poid_par_priv->type_of_oid != QUERY_OID) - return NDIS_STATUS_NOT_ACCEPTED; - - if (poid_par_priv->information_buf_len < sizeof(uint) * 2) { - return NDIS_STATUS_INVALID_LENGTH; - } - - if (*(uint *)poid_par_priv->information_buf == 1) /* init==1 */ - Adapter->mppriv.rx_pktloss = 0; - - *((uint *)poid_par_priv->information_buf + 1) = Adapter->mppriv.rx_pktloss; - *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; - - - return status; -#else return 0; -#endif } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_rd_attrib_mem_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - struct io_queue *pio_queue = (struct io_queue *)Adapter->pio_queue; - struct intf_hdl *pintfhdl = &pio_queue->intf; - -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - -#ifdef CONFIG_SDIO_HCI - void (*_attrib_read)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem); -#endif - - - - if (poid_par_priv->type_of_oid != QUERY_OID) - return NDIS_STATUS_NOT_ACCEPTED; - -#ifdef CONFIG_SDIO_HCI - _irqlevel_changed_(&oldirql, LOWER); - { - u32 *plmem = (u32 *)poid_par_priv->information_buf + 2; - _attrib_read = pintfhdl->io_ops._attrib_read; - _attrib_read(pintfhdl, *((u32 *)poid_par_priv->information_buf), - *((u32 *)poid_par_priv->information_buf + 1), (u8 *)plmem); - *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; - } - _irqlevel_changed_(&oldirql, RAISE); -#endif - - - return status; -#else return 0; -#endif } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_wr_attrib_mem_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - struct io_queue *pio_queue = (struct io_queue *)Adapter->pio_queue; - struct intf_hdl *pintfhdl = &pio_queue->intf; - -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - -#ifdef CONFIG_SDIO_HCI - void (*_attrib_write)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem); -#endif - - - if (poid_par_priv->type_of_oid != SET_OID) - return NDIS_STATUS_NOT_ACCEPTED; - -#ifdef CONFIG_SDIO_HCI - _irqlevel_changed_(&oldirql, LOWER); - { - u32 *plmem = (u32 *)poid_par_priv->information_buf + 2; - _attrib_write = pintfhdl->io_ops._attrib_write; - _attrib_write(pintfhdl, *(u32 *)poid_par_priv->information_buf, - *((u32 *)poid_par_priv->information_buf + 1), (u8 *)plmem); - } - _irqlevel_changed_(&oldirql, RAISE); -#endif - - - return status; -#else return 0; -#endif } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_pro_set_rf_intfs_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - - - - if (poid_par_priv->type_of_oid != SET_OID) - return NDIS_STATUS_NOT_ACCEPTED; - - _irqlevel_changed_(&oldirql, LOWER); - - if (rtw_setrfintfs_cmd(Adapter, *(unsigned char *)poid_par_priv->information_buf) == _FAIL) - status = NDIS_STATUS_NOT_ACCEPTED; - - _irqlevel_changed_(&oldirql, RAISE); - - - return status; -#else return 0; -#endif } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_poll_rx_status_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - - - if (poid_par_priv->type_of_oid != QUERY_OID) - return NDIS_STATUS_NOT_ACCEPTED; - - _rtw_memcpy(poid_par_priv->information_buf, (unsigned char *)&Adapter->mppriv.rxstat, sizeof(struct recv_stat)); - *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; - - - return status; -#else return 0; -#endif } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_pro_cfg_debug_message_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - - PCFG_DBG_MSG_STRUCT pdbg_msg; - - - -#if 0/*#ifdef CONFIG_DEBUG_RTL871X*/ - - pdbg_msg = (PCFG_DBG_MSG_STRUCT)(poid_par_priv->information_buf); - - if (poid_par_priv->type_of_oid == SET_OID) { - - GlobalDebugLevel = pdbg_msg->DebugLevel; - GlobalDebugComponents = (pdbg_msg->DebugComponent_H32 << 32) | pdbg_msg->DebugComponent_L32; - } else { - pdbg_msg->DebugLevel = GlobalDebugLevel; - pdbg_msg->DebugComponent_H32 = (u32)(GlobalDebugComponents >> 32); - pdbg_msg->DebugComponent_L32 = (u32)GlobalDebugComponents; - *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; - - } - -#endif - - - return status; -#else return 0; -#endif } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_pro_set_data_rate_ex_hdl(struct oid_par_priv *poid_par_priv) { PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif NDIS_STATUS status = NDIS_STATUS_SUCCESS; - - if (poid_par_priv->type_of_oid != SET_OID) return NDIS_STATUS_NOT_ACCEPTED; @@ -1309,21 +802,15 @@ NDIS_STATUS oid_rt_pro_set_data_rate_ex_hdl(struct oid_par_priv *poid_par_priv) _irqlevel_changed_(&oldirql, RAISE); - return status; } /* ----------------------------------------------------------------------------- */ NDIS_STATUS oid_rt_get_thermal_meter_hdl(struct oid_par_priv *poid_par_priv) { -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif NDIS_STATUS status = NDIS_STATUS_SUCCESS; u8 thermal = 0; PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - if (poid_par_priv->type_of_oid != QUERY_OID) return NDIS_STATUS_NOT_ACCEPTED; @@ -1337,62 +824,19 @@ NDIS_STATUS oid_rt_get_thermal_meter_hdl(struct oid_par_priv *poid_par_priv) *(u32 *)poid_par_priv->information_buf = (u32)thermal; *poid_par_priv->bytes_rw = sizeof(u32); - return status; } /* ----------------------------------------------------------------------------- */ NDIS_STATUS oid_rt_pro_read_tssi_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - - - - if (poid_par_priv->type_of_oid != SET_OID) - return NDIS_STATUS_NOT_ACCEPTED; - - if (Adapter->mppriv.act_in_progress == _TRUE) - return NDIS_STATUS_NOT_ACCEPTED; - - if (poid_par_priv->information_buf_len < sizeof(u8)) - return NDIS_STATUS_INVALID_LENGTH; - - /* init workparam */ - Adapter->mppriv.act_in_progress = _TRUE; - Adapter->mppriv.workparam.bcompleted = _FALSE; - Adapter->mppriv.workparam.act_type = MPT_READ_TSSI; - Adapter->mppriv.workparam.io_offset = 0; - Adapter->mppriv.workparam.io_value = 0xFFFFFFFF; - - _irqlevel_changed_(&oldirql, LOWER); - - if (!rtw_gettssi_cmd(Adapter, 0, (u8 *)&Adapter->mppriv.workparam.io_value)) - status = NDIS_STATUS_NOT_ACCEPTED; - - _irqlevel_changed_(&oldirql, RAISE); - - - return status; -#else return 0; -#endif } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_pro_set_power_tracking_hdl(struct oid_par_priv *poid_par_priv) { -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif NDIS_STATUS status = NDIS_STATUS_SUCCESS; PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - /* if (poid_par_priv->type_of_oid != SET_OID) * return NDIS_STATUS_NOT_ACCEPTED; */ @@ -1410,541 +854,69 @@ NDIS_STATUS oid_rt_pro_set_power_tracking_hdl(struct oid_par_priv *poid_par_priv GetPowerTracking(Adapter, (u8 *)poid_par_priv->information_buf); _irqlevel_changed_(&oldirql, RAISE); - return status; } /* ----------------------------------------------------------------------------- */ NDIS_STATUS oid_rt_pro_set_basic_rate_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif - u32 ratevalue; - u8 datarates[NumRates]; - int i; - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context); - - - - if (poid_par_priv->type_of_oid != SET_OID) - return NDIS_STATUS_NOT_ACCEPTED; -#if 0 - ratevalue = *((u32 *)poid_par_priv->information_buf); - - for (i = 0; i < NumRates; i++) { - if (ratevalue == mpdatarate[i]) - datarates[i] = mpdatarate[i]; - else - datarates[i] = 0xff; - } - - _irqlevel_changed_(&oldirql, LOWER); - - if (rtw_setbasicrate_cmd(padapter, datarates) != _SUCCESS) - status = NDIS_STATUS_NOT_ACCEPTED; - - _irqlevel_changed_(&oldirql, RAISE); -#endif - - - return status; -#else return 0; -#endif } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_pro_qry_pwrstate_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - - - if (poid_par_priv->type_of_oid != QUERY_OID) - return NDIS_STATUS_NOT_ACCEPTED; - - if (poid_par_priv->information_buf_len < 8) - return NDIS_STATUS_INVALID_LENGTH; - - *poid_par_priv->bytes_rw = 8; - _rtw_memcpy(poid_par_priv->information_buf, &(adapter_to_pwrctl(Adapter)->pwr_mode), 8); - *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; - - - - return status; -#else return 0; -#endif } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_pro_set_pwrstate_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - - uint pwr_mode, smart_ps; - - - - if (poid_par_priv->type_of_oid != SET_OID) - return NDIS_STATUS_NOT_ACCEPTED; - - *poid_par_priv->bytes_rw = 0; - *poid_par_priv->bytes_needed = 8; - - if (poid_par_priv->information_buf_len < 8) - return NDIS_STATUS_INVALID_LENGTH; - - pwr_mode = *(uint *)(poid_par_priv->information_buf); - smart_ps = *(uint *)((int)poid_par_priv->information_buf + 4); - - *poid_par_priv->bytes_rw = 8; - - - return status; -#else return 0; -#endif } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_pro_h2c_set_rate_table_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - - struct setratable_parm *prate_table; - u8 res; - - - if (poid_par_priv->type_of_oid != SET_OID) - return NDIS_STATUS_NOT_ACCEPTED; - - *poid_par_priv->bytes_needed = sizeof(struct setratable_parm); - if (poid_par_priv->information_buf_len < sizeof(struct setratable_parm)) - return NDIS_STATUS_INVALID_LENGTH; - - prate_table = (struct setratable_parm *)poid_par_priv->information_buf; - - _irqlevel_changed_(&oldirql, LOWER); - res = rtw_setrttbl_cmd(Adapter, prate_table); - _irqlevel_changed_(&oldirql, RAISE); - - if (res == _FAIL) - status = NDIS_STATUS_FAILURE; - - - return status; -#else return 0; -#endif } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_pro_h2c_get_rate_table_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - - - if (poid_par_priv->type_of_oid != QUERY_OID) - return NDIS_STATUS_NOT_ACCEPTED; - -#if 0 - struct mp_wi_cntx *pmp_wi_cntx = &(Adapter->mppriv.wi_cntx); - u8 res = _SUCCESS; - DEBUG_INFO(("===> Set OID_RT_PRO_H2C_GET_RATE_TABLE.\n")); - - if (pmp_wi_cntx->bmp_wi_progress == _TRUE) { - DEBUG_ERR(("\n mp workitem is progressing, not allow to set another workitem right now!!!\n")); - Status = NDIS_STATUS_NOT_ACCEPTED; - break; - } else { - pmp_wi_cntx->bmp_wi_progress = _TRUE; - pmp_wi_cntx->param.bcompleted = _FALSE; - pmp_wi_cntx->param.act_type = MPT_GET_RATE_TABLE; - pmp_wi_cntx->param.io_offset = 0x0; - pmp_wi_cntx->param.bytes_cnt = sizeof(struct getratable_rsp); - pmp_wi_cntx->param.io_value = 0xffffffff; - - res = rtw_getrttbl_cmd(Adapter, (struct getratable_rsp *)pmp_wi_cntx->param.data); - *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; - if (res != _SUCCESS) - Status = NDIS_STATUS_NOT_ACCEPTED; - } - DEBUG_INFO(("\n <=== Set OID_RT_PRO_H2C_GET_RATE_TABLE.\n")); -#endif - - - return status; -#else return 0; -#endif } /* **************** oid_rtl_seg_87_12_00 section start **************** */ NDIS_STATUS oid_rt_pro_encryption_ctrl_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - struct security_priv *psecuritypriv = &Adapter->securitypriv; - - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - - ENCRY_CTRL_STATE encry_mode; - - - *poid_par_priv->bytes_needed = sizeof(u8); - if (poid_par_priv->information_buf_len < *poid_par_priv->bytes_needed) - return NDIS_STATUS_INVALID_LENGTH; - - if (poid_par_priv->type_of_oid == SET_OID) { - encry_mode = *((u8 *)poid_par_priv->information_buf); - switch (encry_mode) { - case HW_CONTROL: -#if 0 - Adapter->registrypriv.software_decrypt = _FALSE; - Adapter->registrypriv.software_encrypt = _FALSE; -#else - psecuritypriv->sw_decrypt = _FALSE; - psecuritypriv->sw_encrypt = _FALSE; -#endif - break; - case SW_CONTROL: -#if 0 - Adapter->registrypriv.software_decrypt = _TRUE; - Adapter->registrypriv.software_encrypt = _TRUE; -#else - psecuritypriv->sw_decrypt = _TRUE; - psecuritypriv->sw_encrypt = _TRUE; -#endif - break; - case HW_ENCRY_SW_DECRY: -#if 0 - Adapter->registrypriv.software_decrypt = _TRUE; - Adapter->registrypriv.software_encrypt = _FALSE; -#else - psecuritypriv->sw_decrypt = _TRUE; - psecuritypriv->sw_encrypt = _FALSE; -#endif - break; - case SW_ENCRY_HW_DECRY: -#if 0 - Adapter->registrypriv.software_decrypt = _FALSE; - Adapter->registrypriv.software_encrypt = _TRUE; -#else - psecuritypriv->sw_decrypt = _FALSE; - psecuritypriv->sw_encrypt = _TRUE; -#endif - break; - } - - } else { -#if 0 - if (Adapter->registrypriv.software_encrypt == _FALSE) { - if (Adapter->registrypriv.software_decrypt == _FALSE) - encry_mode = HW_CONTROL; - else - encry_mode = HW_ENCRY_SW_DECRY; - } else { - if (Adapter->registrypriv.software_decrypt == _FALSE) - encry_mode = SW_ENCRY_HW_DECRY; - else - encry_mode = SW_CONTROL; - } -#else - - if ((psecuritypriv->sw_encrypt == _FALSE) && (psecuritypriv->sw_decrypt == _FALSE)) - encry_mode = HW_CONTROL; - else if ((psecuritypriv->sw_encrypt == _FALSE) && (psecuritypriv->sw_decrypt == _TRUE)) - encry_mode = HW_ENCRY_SW_DECRY; - else if ((psecuritypriv->sw_encrypt == _TRUE) && (psecuritypriv->sw_decrypt == _FALSE)) - encry_mode = SW_ENCRY_HW_DECRY; - else if ((psecuritypriv->sw_encrypt == _TRUE) && (psecuritypriv->sw_decrypt == _TRUE)) - encry_mode = SW_CONTROL; - -#endif - - *(u8 *)poid_par_priv->information_buf = encry_mode; - *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; - - } - - return status; -#else return 0; -#endif } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_pro_add_sta_info_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - - struct sta_info *psta = NULL; - UCHAR *macaddr; - - - if (poid_par_priv->type_of_oid != SET_OID) - return NDIS_STATUS_NOT_ACCEPTED; - - *poid_par_priv->bytes_needed = ETH_ALEN; - if (poid_par_priv->information_buf_len < *poid_par_priv->bytes_needed) - return NDIS_STATUS_INVALID_LENGTH; - - macaddr = (UCHAR *) poid_par_priv->information_buf ; - - - _irqlevel_changed_(&oldirql, LOWER); - - psta = rtw_get_stainfo(&Adapter->stapriv, macaddr); - - if (psta == NULL) { /* the sta have been in sta_info_queue => do nothing */ - psta = rtw_alloc_stainfo(&Adapter->stapriv, macaddr); - - if (psta == NULL) { - status = NDIS_STATUS_FAILURE; - } - } - - _irqlevel_changed_(&oldirql, RAISE); - - return status; -#else return 0; -#endif } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_pro_dele_sta_info_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - - struct sta_info *psta = NULL; - UCHAR *macaddr; - - - if (poid_par_priv->type_of_oid != SET_OID) - return NDIS_STATUS_NOT_ACCEPTED; - - *poid_par_priv->bytes_needed = ETH_ALEN; - if (poid_par_priv->information_buf_len < *poid_par_priv->bytes_needed) - return NDIS_STATUS_INVALID_LENGTH; - - macaddr = (UCHAR *) poid_par_priv->information_buf ; - - psta = rtw_get_stainfo(&Adapter->stapriv, macaddr); - if (psta != NULL) { - /* _enter_critical(&(Adapter->stapriv.sta_hash_lock), &irqL); */ - rtw_free_stainfo(Adapter, psta); - /* _exit_critical(&(Adapter->stapriv.sta_hash_lock), &irqL); */ - } - - return status; -#else return 0; -#endif } /* ------------------------------------------------------------------------------ */ -#if 0 -static u32 mp_query_drv_var(_adapter *padapter, u8 offset, u32 var) -{ -#ifdef CONFIG_SDIO_HCI - - if (offset == 1) { - u16 tmp_blk_num; - tmp_blk_num = rtw_read16(padapter, SDIO_RX0_RDYBLK_NUM); - if (adapter_to_dvobj(padapter)->rxblknum != tmp_blk_num) { - /* sd_recv_rxfifo(padapter); */ - } - } - -#if 0 - if (offset <= 100) { /* For setting data rate and query data rate */ - if (offset == 100) { /* For query data rate */ - var = padapter->registrypriv.tx_rate; - - } else if (offset < 0x1d) { /* For setting data rate */ - padapter->registrypriv.tx_rate = offset; - var = padapter->registrypriv.tx_rate; - padapter->registrypriv.use_rate = _TRUE; - } else { /* not use the data rate */ - padapter->registrypriv.use_rate = _FALSE; - } - } else if (offset <= 110) { /* for setting debug level */ - if (offset == 110) { /* For query data rate */ - padapter->registrypriv.dbg_level = GlobalDebugLevel; - var = padapter->registrypriv.dbg_level; - } else if (offset < 110 && offset > 100) { - padapter->registrypriv.dbg_level = GlobalDebugLevel = offset - 100; - var = padapter->registrypriv.dbg_level; - - } - } else if (offset > 110 && offset < 116) { - if (115 == offset) { - } else { - switch (offset) { - case 111: - adapter_to_dvobj(padapter)->tx_block_mode = 1; - adapter_to_dvobj(padapter)->rx_block_mode = 1; - break; - case 112: - adapter_to_dvobj(padapter)->tx_block_mode = 1; - adapter_to_dvobj(padapter)->rx_block_mode = 0; - break; - case 113: - adapter_to_dvobj(padapter)->tx_block_mode = 0; - adapter_to_dvobj(padapter)->rx_block_mode = 1; - break; - case 114: - adapter_to_dvobj(padapter)->tx_block_mode = 0; - adapter_to_dvobj(padapter)->rx_block_mode = 0; - break; - default: - break; - - } - - } - - } else if (offset >= 127) { - u64 prnt_dbg_comp; - u8 chg_idx; - u64 tmp_dbg_comp; - chg_idx = offset - 0x80; - tmp_dbg_comp = BIT(chg_idx); - prnt_dbg_comp = padapter->registrypriv.dbg_component = GlobalDebugComponents; - if (offset == 127) { - /* prnt_dbg_comp=padapter->registrypriv.dbg_component= GlobalDebugComponents; */ - var = (u32)(padapter->registrypriv.dbg_component); - prnt_dbg_comp = GlobalDebugComponents; - prnt_dbg_comp = GlobalDebugComponents = padapter->registrypriv.dbg_component; - - } else { - prnt_dbg_comp = GlobalDebugComponents; - prnt_dbg_comp = GlobalDebugComponents = padapter->registrypriv.dbg_component; - - if (GlobalDebugComponents & tmp_dbg_comp) { - /* this bit is already set, now clear it */ - GlobalDebugComponents = GlobalDebugComponents & (~tmp_dbg_comp); - } else { - /* this bit is not set, now set it. */ - GlobalDebugComponents = GlobalDebugComponents | tmp_dbg_comp; - } - prnt_dbg_comp = GlobalDebugComponents; - - var = (u32)(GlobalDebugComponents); - /* GlobalDebugComponents=padapter->registrypriv.dbg_component; */ - - } - } -#endif -#endif - - return var; -} -#endif NDIS_STATUS oid_rt_pro_query_dr_variable_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - - DR_VARIABLE_STRUCT *pdrv_var; - - - if (poid_par_priv->type_of_oid != QUERY_OID) - return NDIS_STATUS_NOT_ACCEPTED; - - *poid_par_priv->bytes_needed = sizeof(DR_VARIABLE_STRUCT); - if (poid_par_priv->information_buf_len < *poid_par_priv->bytes_needed) - return NDIS_STATUS_INVALID_LENGTH; - - - pdrv_var = (struct _DR_VARIABLE_STRUCT_ *)poid_par_priv->information_buf; - - _irqlevel_changed_(&oldirql, LOWER); - pdrv_var->variable = mp_query_drv_var(Adapter, pdrv_var->offset, pdrv_var->variable); - _irqlevel_changed_(&oldirql, RAISE); - - *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; - - - return status; -#else return 0; -#endif } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_pro_rx_packet_type_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - - - if (poid_par_priv->information_buf_len < sizeof(UCHAR)) { - status = NDIS_STATUS_INVALID_LENGTH; - *poid_par_priv->bytes_needed = sizeof(UCHAR); - return status; - } - - if (poid_par_priv->type_of_oid == SET_OID) { - Adapter->mppriv.rx_with_status = *(UCHAR *) poid_par_priv->information_buf; - - - } else { - *(UCHAR *) poid_par_priv->information_buf = Adapter->mppriv.rx_with_status; - *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; - - - /* *(u32 *)&Adapter->eeprompriv.mac_addr[0]=rtw_read32(Adapter, 0x10250050); */ - /* *(u16 *)&Adapter->eeprompriv.mac_addr[4]=rtw_read16(Adapter, 0x10250054); */ - } -#endif - return NDIS_STATUS_SUCCESS; } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_pro_read_efuse_hdl(struct oid_par_priv *poid_par_priv) { -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif PEFUSE_ACCESS_STRUCT pefuse; u8 *data; u16 addr = 0, cnts = 0, max_available_size = 0; NDIS_STATUS status = NDIS_STATUS_SUCCESS; PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - if (poid_par_priv->type_of_oid != QUERY_OID) return NDIS_STATUS_NOT_ACCEPTED; @@ -1956,7 +928,6 @@ NDIS_STATUS oid_rt_pro_read_efuse_hdl(struct oid_par_priv *poid_par_priv) cnts = pefuse->cnts; data = pefuse->data; - EFUSE_GetEfuseDefinition(Adapter, EFUSE_WIFI, TYPE_AVAILABLE_EFUSE_BYTES_TOTAL, (PVOID)&max_available_size, _FALSE); if ((addr + cnts) > max_available_size) { @@ -1970,23 +941,17 @@ NDIS_STATUS oid_rt_pro_read_efuse_hdl(struct oid_par_priv *poid_par_priv) *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; _irqlevel_changed_(&oldirql, RAISE); - return status; } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_pro_write_efuse_hdl(struct oid_par_priv *poid_par_priv) { -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif PEFUSE_ACCESS_STRUCT pefuse; u8 *data; u16 addr = 0, cnts = 0, max_available_size = 0; NDIS_STATUS status = NDIS_STATUS_SUCCESS; PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - if (poid_par_priv->type_of_oid != SET_OID) return NDIS_STATUS_NOT_ACCEPTED; @@ -1995,7 +960,6 @@ NDIS_STATUS oid_rt_pro_write_efuse_hdl(struct oid_par_priv *poid_par_priv) cnts = pefuse->cnts; data = pefuse->data; - EFUSE_GetEfuseDefinition(Adapter, EFUSE_WIFI, TYPE_AVAILABLE_EFUSE_BYTES_TOTAL, (PVOID)&max_available_size, _FALSE); if ((addr + cnts) > max_available_size) { @@ -2007,21 +971,15 @@ NDIS_STATUS oid_rt_pro_write_efuse_hdl(struct oid_par_priv *poid_par_priv) status = NDIS_STATUS_FAILURE; _irqlevel_changed_(&oldirql, RAISE); - return status; } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_pro_rw_efuse_pgpkt_hdl(struct oid_par_priv *poid_par_priv) { -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif PPGPKT_STRUCT ppgpkt; NDIS_STATUS status = NDIS_STATUS_SUCCESS; PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - *poid_par_priv->bytes_rw = 0; if (poid_par_priv->information_buf_len < sizeof(PGPKT_STRUCT)) @@ -2051,22 +1009,16 @@ NDIS_STATUS oid_rt_pro_rw_efuse_pgpkt_hdl(struct oid_par_priv *poid_par_priv) _irqlevel_changed_(&oldirql, RAISE); - - return status; } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_get_efuse_current_size_hdl(struct oid_par_priv *poid_par_priv) { -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif u16 size; u8 ret; NDIS_STATUS status = NDIS_STATUS_SUCCESS; PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - if (poid_par_priv->type_of_oid != QUERY_OID) return NDIS_STATUS_NOT_ACCEPTED; @@ -2082,7 +1034,6 @@ NDIS_STATUS oid_rt_get_efuse_current_size_hdl(struct oid_par_priv *poid_par_priv } else status = NDIS_STATUS_FAILURE; - return status; } /* ------------------------------------------------------------------------------ */ @@ -2091,7 +1042,6 @@ NDIS_STATUS oid_rt_get_efuse_max_size_hdl(struct oid_par_priv *poid_par_priv) NDIS_STATUS status = NDIS_STATUS_SUCCESS; PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - if (poid_par_priv->type_of_oid != QUERY_OID) return NDIS_STATUS_NOT_ACCEPTED; @@ -2101,8 +1051,6 @@ NDIS_STATUS oid_rt_get_efuse_max_size_hdl(struct oid_par_priv *poid_par_priv) *(u32 *)poid_par_priv->information_buf = efuse_GetMaxSize(Adapter); *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; - - return status; } /* ------------------------------------------------------------------------------ */ @@ -2110,30 +1058,21 @@ NDIS_STATUS oid_rt_pro_efuse_hdl(struct oid_par_priv *poid_par_priv) { NDIS_STATUS status; - - if (poid_par_priv->type_of_oid == QUERY_OID) status = oid_rt_pro_read_efuse_hdl(poid_par_priv); else status = oid_rt_pro_write_efuse_hdl(poid_par_priv); - - return status; } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_pro_efuse_map_hdl(struct oid_par_priv *poid_par_priv) { -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif u8 *data; NDIS_STATUS status = NDIS_STATUS_SUCCESS; PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); u16 mapLen = 0; - - EFUSE_GetEfuseDefinition(Adapter, EFUSE_WIFI, TYPE_EFUSE_MAP_LEN, (PVOID)&mapLen, _FALSE); *poid_par_priv->bytes_rw = 0; @@ -2164,57 +1103,22 @@ NDIS_STATUS oid_rt_pro_efuse_map_hdl(struct oid_par_priv *poid_par_priv) _irqlevel_changed_(&oldirql, RAISE); - - return status; } NDIS_STATUS oid_rt_set_crystal_cap_hdl(struct oid_par_priv *poid_par_priv) { NDIS_STATUS status = NDIS_STATUS_SUCCESS; -#if 0 - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif - - u32 crystal_cap = 0; - - - if (poid_par_priv->type_of_oid != SET_OID) - return NDIS_STATUS_NOT_ACCEPTED; - - if (poid_par_priv->information_buf_len < sizeof(u32)) - return NDIS_STATUS_INVALID_LENGTH; - - crystal_cap = *((u32 *)poid_par_priv->information_buf); /* 4 */ - if (crystal_cap > 0xf) - return NDIS_STATUS_NOT_ACCEPTED; - - Adapter->mppriv.curr_crystalcap = crystal_cap; - - _irqlevel_changed_(&oldirql, LOWER); - SetCrystalCap(Adapter); - _irqlevel_changed_(&oldirql, RAISE); - - -#endif return status; } NDIS_STATUS oid_rt_set_rx_packet_type_hdl(struct oid_par_priv *poid_par_priv) { -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif u8 rx_pkt_type; /* u32 rcr_val32; */ NDIS_STATUS status = NDIS_STATUS_SUCCESS; /* PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context); */ - - if (poid_par_priv->type_of_oid != SET_OID) return NDIS_STATUS_NOT_ACCEPTED; @@ -2223,131 +1127,17 @@ NDIS_STATUS oid_rt_set_rx_packet_type_hdl(struct oid_par_priv *poid_par_priv) rx_pkt_type = *((u8 *)poid_par_priv->information_buf); /* 4 */ -#if 0 - _irqlevel_changed_(&oldirql, LOWER); -#if 0 - rcr_val8 = rtw_read8(Adapter, 0x10250048);/* RCR */ - rcr_val8 &= ~(RCR_AB | RCR_AM | RCR_APM | RCR_AAP); - - if (rx_pkt_type == RX_PKT_BROADCAST) - rcr_val8 |= (RCR_AB | RCR_ACRC32); - else if (rx_pkt_type == RX_PKT_DEST_ADDR) - rcr_val8 |= (RCR_AAP | RCR_AM | RCR_ACRC32); - else if (rx_pkt_type == RX_PKT_PHY_MATCH) - rcr_val8 |= (RCR_APM | RCR_ACRC32); - else - rcr_val8 &= ~(RCR_AAP | RCR_APM | RCR_AM | RCR_AB | RCR_ACRC32); - rtw_write8(padapter, 0x10250048, rcr_val8); -#else - rcr_val32 = rtw_read32(padapter, RCR);/* RCR = 0x10250048 */ - rcr_val32 &= ~(RCR_CBSSID | RCR_AB | RCR_AM | RCR_APM | RCR_AAP); -#if 0 - if (rx_pkt_type == RX_PKT_BROADCAST) - rcr_val32 |= (RCR_AB | RCR_AM | RCR_APM | RCR_AAP | RCR_ACRC32); - else if (rx_pkt_type == RX_PKT_DEST_ADDR) { - /* rcr_val32 |= (RCR_CBSSID|RCR_AAP|RCR_AM|RCR_ACRC32); */ - rcr_val32 |= (RCR_CBSSID | RCR_APM | RCR_ACRC32); - } else if (rx_pkt_type == RX_PKT_PHY_MATCH) { - rcr_val32 |= (RCR_APM | RCR_ACRC32); - /* rcr_val32 |= (RCR_AAP|RCR_ACRC32); */ - } else - rcr_val32 &= ~(RCR_AAP | RCR_APM | RCR_AM | RCR_AB | RCR_ACRC32); -#else - switch (rx_pkt_type) { - case RX_PKT_BROADCAST: - rcr_val32 |= (RCR_AB | RCR_AM | RCR_APM | RCR_AAP | RCR_ACRC32); - break; - case RX_PKT_DEST_ADDR: - rcr_val32 |= (RCR_AB | RCR_AM | RCR_APM | RCR_AAP | RCR_ACRC32); - break; - case RX_PKT_PHY_MATCH: - rcr_val32 |= (RCR_APM | RCR_ACRC32); - break; - default: - rcr_val32 &= ~(RCR_AAP | RCR_APM | RCR_AM | RCR_AB | RCR_ACRC32); - break; - } - - if (rx_pkt_type == RX_PKT_DEST_ADDR) - padapter->mppriv.check_mp_pkt = 1; - else - padapter->mppriv.check_mp_pkt = 0; -#endif - rtw_write32(padapter, RCR, rcr_val32); - -#endif - _irqlevel_changed_(&oldirql, RAISE); -#endif - return status; } NDIS_STATUS oid_rt_pro_set_tx_agc_offset_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - - u32 txagc; - - - if (poid_par_priv->type_of_oid != SET_OID) - return NDIS_STATUS_NOT_ACCEPTED; - - if (poid_par_priv->information_buf_len < sizeof(u32)) - return NDIS_STATUS_INVALID_LENGTH; - - txagc = *(u32 *)poid_par_priv->information_buf; - - _irqlevel_changed_(&oldirql, LOWER); - SetTxAGCOffset(Adapter, txagc); - _irqlevel_changed_(&oldirql, RAISE); - - - return status; -#else return 0; -#endif } NDIS_STATUS oid_rt_pro_set_pkt_test_mode_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - - struct mlme_priv *pmlmepriv = &Adapter->mlmepriv; - struct mp_priv *pmppriv = &Adapter->mppriv; - u32 type; - - - if (poid_par_priv->type_of_oid != SET_OID) - return NDIS_STATUS_NOT_ACCEPTED; - - if (poid_par_priv->information_buf_len < sizeof(u32)) - return NDIS_STATUS_INVALID_LENGTH; - - type = *(u32 *)poid_par_priv->information_buf; - - if (_LOOPBOOK_MODE_ == type) { - pmppriv->mode = type; - set_fwstate(pmlmepriv, WIFI_MP_LPBK_STATE); /* append txdesc */ - } else if (_2MAC_MODE_ == type) { - pmppriv->mode = type; - _clr_fwstate_(pmlmepriv, WIFI_MP_LPBK_STATE); - } else - status = NDIS_STATUS_NOT_ACCEPTED; - - - return status; -#else return 0; -#endif } unsigned int mp_ioctl_xmit_packet_hdl(struct oid_par_priv *poid_par_priv) @@ -2357,7 +1147,6 @@ unsigned int mp_ioctl_xmit_packet_hdl(struct oid_par_priv *poid_par_priv) struct mp_priv *pmp_priv; struct pkt_attrib *pattrib; - pparm = (PMP_XMIT_PARM)poid_par_priv->information_buf; padapter = (PADAPTER)poid_par_priv->adapter_context; pmp_priv = &padapter->mppriv; @@ -2383,152 +1172,33 @@ unsigned int mp_ioctl_xmit_packet_hdl(struct oid_par_priv *poid_par_priv) return NDIS_STATUS_SUCCESS; } -#if 0 -unsigned int mp_ioctl_xmit_packet_hdl(struct oid_par_priv *poid_par_priv) -{ - unsigned char *pframe, *pmp_pkt; - struct ethhdr *pethhdr; - struct pkt_attrib *pattrib; - struct rtw_ieee80211_hdr *pwlanhdr; - unsigned short *fctrl; - int llc_sz, payload_len; - struct mp_xmit_frame *pxframe = NULL; - struct mp_xmit_packet *pmp_xmitpkt = (struct mp_xmit_packet *)param; - u8 addr3[] = {0x02, 0xE0, 0x4C, 0x87, 0x66, 0x55}; - - /* RTW_INFO("+mp_ioctl_xmit_packet_hdl\n"); */ - - pxframe = alloc_mp_xmitframe(&padapter->mppriv); - if (pxframe == NULL) { - DEBUG_ERR(("Can't alloc pmpframe %d:%s\n", __LINE__, __FILE__)); - return -1; - } - - /* mp_xmit_pkt */ - payload_len = pmp_xmitpkt->len - 14; - pmp_pkt = (unsigned char *)pmp_xmitpkt->mem; - pethhdr = (struct ethhdr *)pmp_pkt; - - /* RTW_INFO("payload_len=%d, pkt_mem=0x%x\n", pmp_xmitpkt->len, (void*)pmp_xmitpkt->mem); */ - - /* RTW_INFO("pxframe=0x%x\n", (void*)pxframe); */ - /* RTW_INFO("pxframe->mem=0x%x\n", (void*)pxframe->mem); */ - - /* update attribute */ - pattrib = &pxframe->attrib; - memset((u8 *)(pattrib), 0, sizeof(struct pkt_attrib)); - pattrib->pktlen = pmp_xmitpkt->len; - pattrib->ether_type = ntohs(pethhdr->h_proto); - pattrib->hdrlen = 24; - pattrib->nr_frags = 1; - pattrib->priority = 0; -#ifndef CONFIG_MP_LINUX - if (IS_MCAST(pethhdr->h_dest)) - pattrib->mac_id = 4; - else - pattrib->mac_id = 5; -#else - pattrib->mac_id = 5; -#endif - - /* */ - memset(pxframe->mem, 0 , WLANHDR_OFFSET); - pframe = (u8 *)(pxframe->mem) + WLANHDR_OFFSET; - - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; - - fctrl = &(pwlanhdr->frame_ctl); - *(fctrl) = 0; - set_frame_sub_type(pframe, WIFI_DATA); - - _rtw_memcpy(pwlanhdr->addr1, pethhdr->h_dest, ETH_ALEN); - _rtw_memcpy(pwlanhdr->addr2, pethhdr->h_source, ETH_ALEN); - - _rtw_memcpy(pwlanhdr->addr3, addr3, ETH_ALEN); - - pwlanhdr->seq_ctl = 0; - pframe += pattrib->hdrlen; - - llc_sz = rtw_put_snap(pframe, pattrib->ether_type); - pframe += llc_sz; - - _rtw_memcpy(pframe, (void *)(pmp_pkt + 14), payload_len); - - pattrib->last_txcmdsz = pattrib->hdrlen + llc_sz + payload_len; - - DEBUG_INFO(("issuing mp_xmit_frame, tx_len=%d, ether_type=0x%x\n", pattrib->last_txcmdsz, pattrib->ether_type)); - xmit_mp_frame(padapter, pxframe); - - return _SUCCESS; -} -#endif /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_set_power_down_hdl(struct oid_par_priv *poid_par_priv) { -#ifdef PLATFORM_OS_XP - _irqL oldirql; -#endif u8 bpwrup; NDIS_STATUS status = NDIS_STATUS_SUCCESS; -#ifdef PLATFORM_LINUX #if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context); #endif -#endif - if (poid_par_priv->type_of_oid != SET_OID) { status = NDIS_STATUS_NOT_ACCEPTED; return status; } - _irqlevel_changed_(&oldirql, LOWER); bpwrup = *(u8 *)poid_par_priv->information_buf; /* CALL the power_down function */ -#ifdef PLATFORM_LINUX #if defined(CONFIG_RTL8712) /* Linux MP insmod unknown symbol */ dev_power_down(padapter, bpwrup); -#endif #endif _irqlevel_changed_(&oldirql, RAISE); - /* DEBUG_ERR(("\n <=== Query OID_RT_PRO_READ_REGISTER. */ - /* Add:0x%08x Width:%d Value:0x%08x\n",RegRWStruct->offset,RegRWStruct->width,RegRWStruct->value)); */ - - return status; } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_get_power_mode_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - /* #ifdef PLATFORM_OS_XP */ - /* _irqL oldirql; - * #endif */ - - - if (poid_par_priv->type_of_oid != QUERY_OID) { - status = NDIS_STATUS_NOT_ACCEPTED; - return status; - } - if (poid_par_priv->information_buf_len < sizeof(u32)) { - status = NDIS_STATUS_INVALID_LENGTH; - return status; - } - - - /* _irqlevel_changed_(&oldirql, LOWER); */ - *(int *)poid_par_priv->information_buf = Adapter->registrypriv.low_power ? POWER_LOW : POWER_NORMAL; - *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; - /* _irqlevel_changed_(&oldirql, RAISE); */ - - - return status; -#else return 0; -#endif } diff --git a/core/rtw_recv.c b/core/rtw_recv.c index c8265bf..8a7cc05 100755 --- a/core/rtw_recv.c +++ b/core/rtw_recv.c @@ -22,13 +22,6 @@ #include #include -#if defined(PLATFORM_LINUX) && defined (PLATFORM_WINDOWS) - - #error "Shall be Linux or Windows, but not both!\n" - -#endif - - #ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) void rtw_signal_stat_timer_hdl(RTW_TIMER_HDL_ARGS); @@ -657,22 +650,10 @@ union recv_frame *decryptor(_adapter *padapter, union recv_frame *precv_frame) default: break; } - } else if (prxattrib->bdecrypted == 1 - && prxattrib->encrypt > 0 - && (psecuritypriv->busetkipkey == 1 || prxattrib->encrypt != _TKIP_) - ) { -#if 0 - if ((prxstat->icv == 1) && (prxattrib->encrypt != _AES_)) { - psecuritypriv->hw_decrypted = _FALSE; - - - rtw_free_recvframe(precv_frame, &padapter->recvpriv.free_recv_queue); - - return_packet = NULL; - - } else -#endif - { + } else if (prxattrib->bdecrypted == 1 && + prxattrib->encrypt > 0 && + (psecuritypriv->busetkipkey == 1 || + prxattrib->encrypt != _TKIP_)) { DBG_COUNTER(padapter->rx_logs.core_rx_post_decrypt_hw); psecuritypriv->hw_decrypted = _TRUE; @@ -685,7 +666,6 @@ union recv_frame *decryptor(_adapter *padapter, union recv_frame *precv_frame) psecuritypriv->hw_decrypted); #endif - } } else { DBG_COUNTER(padapter->rx_logs.core_rx_post_decrypt_unknown); #ifdef DBG_RX_DECRYPTOR @@ -701,13 +681,10 @@ union recv_frame *decryptor(_adapter *padapter, union recv_frame *precv_frame) if (res == _FAIL) { rtw_free_recvframe(return_packet, &padapter->recvpriv.free_recv_queue); return_packet = NULL; - } else + } else { prxattrib->bdecrypted = _TRUE; - /* recvframe_chkmic(adapter, precv_frame); */ /* move to recvframme_defrag function */ - - + } return return_packet; - } /* ###set the security information in the recv_frame */ union recv_frame *portctrl(_adapter *adapter, union recv_frame *precv_frame); @@ -1672,12 +1649,6 @@ sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv_frame) /* RTW_INFO("handling ps-poll, q_len=%d, tim=%x\n", psta->sleepq_len, pstapriv->tim_bitmap); */ -#if 0 - _exit_critical_bh(&psta->sleep_q.lock, &irqL); - if (rtw_hal_xmit(padapter, pxmitframe) == _TRUE) - rtw_os_xmit_complete(padapter, pxmitframe); - _enter_critical_bh(&psta->sleep_q.lock, &irqL); -#endif rtw_hal_xmitframe_enqueue(padapter, pxmitframe); if (psta->sleepq_len == 0) { @@ -1729,23 +1700,9 @@ sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv_frame) } union recv_frame *recvframe_chk_defrag(PADAPTER padapter, union recv_frame *precv_frame); -sint validate_recv_mgnt_frame(PADAPTER padapter, union recv_frame *precv_frame); + sint validate_recv_mgnt_frame(PADAPTER padapter, union recv_frame *precv_frame) { - /* struct mlme_priv *pmlmepriv = &adapter->mlmepriv; */ - - -#if 0 - if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE) { -#ifdef CONFIG_NATIVEAP_MLME - mgt_dispatcher(padapter, precv_frame); -#else - rtw_hostapd_mlme_rx(padapter, precv_frame); -#endif - } else - mgt_dispatcher(padapter, precv_frame); -#endif - precv_frame = recvframe_chk_defrag(padapter, precv_frame); if (precv_frame == NULL) { return _SUCCESS; @@ -2020,17 +1977,6 @@ static sint validate_80211w_mgmt(_adapter *adapter, union recv_frame *precv_fram RTW_INFO("%s mgmt allocate fail !!!!!!!!!\n", __FUNCTION__); goto validate_80211w_fail; } -#if 0 - /* dump the packet content before decrypt */ - { - int pp; - RTW_INFO("pattrib->pktlen = %d =>", pattrib->pkt_len); - for (pp = 0; pp < pattrib->pkt_len; pp++) - RTW_INFO(" %02x ", ptr[pp]); - RTW_INFO("\n"); - } -#endif - precv_frame = decryptor(adapter, precv_frame); /* save actual management data frame body */ _rtw_memcpy(mgmt_DATA, ptr + pattrib->hdrlen + pattrib->iv_len, data_len); @@ -2039,16 +1985,6 @@ static sint validate_80211w_mgmt(_adapter *adapter, union recv_frame *precv_fram /* remove the iv and icv length */ pattrib->pkt_len = pattrib->pkt_len - pattrib->iv_len - pattrib->icv_len; rtw_mfree(mgmt_DATA, data_len); -#if 0 - /* print packet content after decryption */ - { - int pp; - RTW_INFO("after decryption pattrib->pktlen = %d @@=>", pattrib->pkt_len); - for (pp = 0; pp < pattrib->pkt_len; pp++) - RTW_INFO(" %02x ", ptr[pp]); - RTW_INFO("\n"); - } -#endif if (!precv_frame) { RTW_INFO("%s mgmt descrypt fail !!!!!!!!!\n", __FUNCTION__); goto validate_80211w_fail; @@ -2493,22 +2429,6 @@ sint wlanhdr_to_ethhdr(union recv_frame *precvframe) } else if (eth_type == 0x8712) { /* append rx status for mp test packets */ /* ptr -= 16; */ /* _rtw_memcpy(ptr, get_rxmem(precvframe), 16); */ - } else { -#ifdef PLATFORM_OS_XP - NDIS_PACKET_8021Q_INFO VlanPriInfo; - UINT32 UserPriority = precvframe->u.hdr.attrib.priority; - UINT32 VlanID = (pvlan != NULL ? get_vlan_id(pvlan) : 0); - - VlanPriInfo.Value = /* Get current value. */ - NDIS_PER_PACKET_INFO_FROM_PACKET(precvframe->u.hdr.pkt, Ieee8021QInfo); - - VlanPriInfo.TagHeader.UserPriority = UserPriority; - VlanPriInfo.TagHeader.VlanId = VlanID ; - - VlanPriInfo.TagHeader.CanonicalFormatId = 0; /* Should be zero. */ - VlanPriInfo.TagHeader.Reserved = 0; /* Should be zero. */ - NDIS_PER_PACKET_INFO_FROM_PACKET(precvframe->u.hdr.pkt, Ieee8021QInfo) = VlanPriInfo.Value; -#endif } if (eth_type == 0x8712) { /* append rx status for mp test packets */ @@ -2533,7 +2453,6 @@ exit: #if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) -#ifdef PLATFORM_LINUX static void recvframe_expand_pkt( PADAPTER padapter, union recv_frame *prframe) @@ -2586,9 +2505,6 @@ static void recvframe_expand_pkt( pfhdr->rx_tail = skb_tail_pointer(ppkt); pfhdr->rx_end = skb_end_pointer(ppkt); } -#else -#warning "recvframe_expand_pkt not implement, defrag may crash system" -#endif #endif /* perform defrag */ @@ -3019,12 +2935,6 @@ int recv_indicatepkts_in_order(_adapter *padapter, struct recv_reorder_ctrl *pre phead = get_list_head(ppending_recvframe_queue); plist = get_next(phead); -#if 0 - /* Check if there is any other indication thread running. */ - if (pTS->RxIndicateState == RXTS_INDICATE_PROCESSING) - return; -#endif - /* Handling some condition for forced indicate case. */ if (bforced == _TRUE) { pdbgpriv->dbg_rx_ampdu_forced_indicate_count++; @@ -3054,16 +2964,6 @@ int recv_indicatepkts_in_order(_adapter *padapter, struct recv_reorder_ctrl *pre pattrib = &prframe->u.hdr.attrib; if (!SN_LESS(preorder_ctrl->indicate_seq, pattrib->seq_num)) { - -#if 0 - /* This protect buffer from overflow. */ - if (index >= REORDER_WIN_SIZE) { - RT_ASSERT(FALSE, ("IndicateRxReorderList(): Buffer overflow!!\n")); - bPktInBuf = TRUE; - break; - } -#endif - plist = get_next(plist); rtw_list_delete(&(prframe->u.hdr.list)); @@ -3075,30 +2975,8 @@ int recv_indicatepkts_in_order(_adapter *padapter, struct recv_reorder_ctrl *pre #endif } -#if 0 - index++; - if (index == 1) { - /* Cancel previous pending timer. */ - /* PlatformCancelTimer(Adapter, &pTS->RxPktPendingTimer); */ - if (bforced != _TRUE) { - /* RTW_INFO("_cancel_timer(&preorder_ctrl->reordering_ctrl_timer, &bcancelled);\n"); */ - _cancel_timer(&preorder_ctrl->reordering_ctrl_timer, &bcancelled); - } - } -#endif - - /* Set this as a lock to make sure that only one thread is indicating packet. */ - /* pTS->RxIndicateState = RXTS_INDICATE_PROCESSING; */ - - /* Indicate packets */ - /* RT_ASSERT((index<=REORDER_WIN_SIZE), ("RxReorderIndicatePacket(): Rx Reorder buffer full!!\n")); */ - - /* indicate this recv_frame */ - /* DbgPrint("recv_indicatepkts_in_order, indicate_seq=%d, seq_num=%d\n", precvpriv->indicate_seq, pattrib->seq_num); */ if (!pattrib->amsdu) { - /* RTW_INFO("recv_indicatepkts_in_order, amsdu!=1, indicate_seq=%d, seq_num=%d\n", preorder_ctrl->indicate_seq, pattrib->seq_num); */ - if (!RTW_CANNOT_RUN(padapter)) rtw_recv_indicatepkt(padapter, prframe);/*indicate this recv_frame*/ @@ -3122,29 +3000,9 @@ int recv_indicatepkts_in_order(_adapter *padapter, struct recv_reorder_ctrl *pre } - /* _rtw_spinunlock_ex(&ppending_recvframe_queue->lock); */ - /* _exit_critical_ex(&ppending_recvframe_queue->lock, &irql); */ - -#if 0 - /* Release the indication lock and set to new indication step. */ - if (bPktInBuf) { - /* Set new pending timer. */ - /* pTS->RxIndicateState = RXTS_INDICATE_REORDER; */ - /* PlatformSetTimer(Adapter, &pTS->RxPktPendingTimer, pHTInfo->RxReorderPendingTime); */ - - _set_timer(&preorder_ctrl->reordering_ctrl_timer, REORDER_WAIT_TIME); - } else { - /* pTS->RxIndicateState = RXTS_INDICATE_IDLE; */ - } -#endif - /* _exit_critical_ex(&ppending_recvframe_queue->lock, &irql); */ - - /* return _TRUE; */ return bPktInBuf; - } -int recv_indicatepkt_reorder(_adapter *padapter, union recv_frame *prframe); int recv_indicatepkt_reorder(_adapter *padapter, union recv_frame *prframe) { _irqL irql; @@ -3244,31 +3102,16 @@ int recv_indicatepkt_reorder(_adapter *padapter, union recv_frame *prframe) /* s2. check if winstart_b(indicate_seq) needs to been updated */ if (!check_indicate_seq(preorder_ctrl, pattrib->seq_num)) { pdbgpriv->dbg_rx_ampdu_drop_count++; - /* pHTInfo->RxReorderDropCounter++; */ - /* ReturnRFDList(Adapter, pRfd); */ - /* _exit_critical_ex(&ppending_recvframe_queue->lock, &irql); */ - /* return _FAIL; */ #ifdef DBG_RX_DROP_FRAME RTW_INFO("DBG_RX_DROP_FRAME %s check_indicate_seq fail\n", __FUNCTION__); #endif -#if 0 - rtw_recv_indicatepkt(padapter, prframe); - - _exit_critical_bh(&ppending_recvframe_queue->lock, &irql); - - goto _success_exit; -#else goto _err_exit; -#endif } /* s3. Insert all packet into Reorder Queue to maintain its ordering. */ if (!enqueue_reorder_recvframe(preorder_ctrl, prframe)) { - /* DbgPrint("recv_indicatepkt_reorder, enqueue_reorder_recvframe fail!\n"); */ - /* _exit_critical_ex(&ppending_recvframe_queue->lock, &irql); */ - /* return _FAIL; */ #ifdef DBG_RX_DROP_FRAME RTW_INFO("DBG_RX_DROP_FRAME %s enqueue_reorder_recvframe fail\n", __FUNCTION__); #endif @@ -3413,24 +3256,6 @@ int validate_mp_recv_frame(_adapter *adapter, union recv_frame *precv_frame) pmptx = &pmppriv->tx; -#if 0 - if (1) { - u8 bDumpRxPkt; - type = GetFrameType(ptr); - subtype = get_frame_sub_type(ptr); /* bit(7)~bit(2) */ - - rtw_hal_get_def_var(adapter, HAL_DEF_DBG_DUMP_RXPKT, &(bDumpRxPkt)); - if (bDumpRxPkt == 1) { /* dump all rx packets */ - int i; - RTW_INFO("############ type:0x%02x subtype:0x%02x #################\n", type, subtype); - - for (i = 0; i < 64; i = i + 8) - RTW_INFO("%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:\n", *(ptr + i), - *(ptr + i + 1), *(ptr + i + 2) , *(ptr + i + 3) , *(ptr + i + 4), *(ptr + i + 5), *(ptr + i + 6), *(ptr + i + 7)); - RTW_INFO("#############################\n"); - } - } -#endif if (pmppriv->bloopback) { if (_rtw_memcmp(ptr + 24, pmptx->buf + 24, precv_frame->u.hdr.len - 24) == _FALSE) { RTW_INFO("Compare payload content Fail !!!\n"); @@ -3672,36 +3497,6 @@ static sint fill_radiotap_hdr(_adapter *padapter, union recv_frame *precvframe, { #define CHAN2FREQ(a) ((a < 14) ? (2407+5*a) : (5000+5*a)) -#if 0 -#define RTW_RX_RADIOTAP_PRESENT (\ - (1 << IEEE80211_RADIOTAP_TSFT) | \ - (1 << IEEE80211_RADIOTAP_FLAGS) | \ - (1 << IEEE80211_RADIOTAP_RATE) | \ - (1 << IEEE80211_RADIOTAP_CHANNEL) | \ - (0 << IEEE80211_RADIOTAP_FHSS) | \ - (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL) | \ - (1 << IEEE80211_RADIOTAP_DBM_ANTNOISE) | \ - (0 << IEEE80211_RADIOTAP_LOCK_QUALITY) | \ - (0 << IEEE80211_RADIOTAP_TX_ATTENUATION) | \ - (0 << IEEE80211_RADIOTAP_DB_TX_ATTENUATION) | \ - (0 << IEEE80211_RADIOTAP_DBM_TX_POWER) | \ - (1 << IEEE80211_RADIOTAP_ANTENNA) | \ - (1 << IEEE80211_RADIOTAP_DB_ANTSIGNAL) | \ - (0 << IEEE80211_RADIOTAP_DB_ANTNOISE) | \ - (0 << IEEE80211_RADIOTAP_RX_FLAGS) | \ - (0 << IEEE80211_RADIOTAP_TX_FLAGS) | \ - (0 << IEEE80211_RADIOTAP_RTS_RETRIES) | \ - (0 << IEEE80211_RADIOTAP_DATA_RETRIES) | \ - (0 << IEEE80211_RADIOTAP_MCS) | \ - (0 << IEEE80211_RADIOTAP_RADIOTAP_NAMESPACE)| \ - (0 << IEEE80211_RADIOTAP_VENDOR_NAMESPACE) | \ - (0 << IEEE80211_RADIOTAP_EXT) | \ - 0) - - /* (0 << IEEE80211_RADIOTAP_AMPDU_STATUS) | \ */ - /* (0 << IEEE80211_RADIOTAP_VHT) | \ */ -#endif - #ifndef IEEE80211_RADIOTAP_RX_FLAGS #define IEEE80211_RADIOTAP_RX_FLAGS 14 #endif @@ -3835,18 +3630,6 @@ static sint fill_radiotap_hdr(_adapter *padapter, union recv_frame *precvframe, hdr_buf[rt_len] = pattrib->phy_info.RecvSignalPower; rt_len += 1; -#if 0 - /* dBm Antenna Noise */ - rtap_hdr->it_present |= (1 << IEEE80211_RADIOTAP_DBM_ANTNOISE); - hdr_buf[rt_len] = 0; - rt_len += 1; - - /* Signal Quality */ - rtap_hdr->it_present |= (1 << IEEE80211_RADIOTAP_LOCK_QUALITY); - hdr_buf[rt_len] = pattrib->phy_info.SignalQuality; - rt_len += 1; -#endif - /* Antenna */ rtap_hdr->it_present |= (1 << IEEE80211_RADIOTAP_ANTENNA); hdr_buf[rt_len] = 0; /* pHalData->rf_type; */ @@ -3854,10 +3637,6 @@ static sint fill_radiotap_hdr(_adapter *padapter, union recv_frame *precvframe, /* RX flags */ rtap_hdr->it_present |= (1 << IEEE80211_RADIOTAP_RX_FLAGS); -#if 0 - tmp_16bit = cpu_to_le16(0); - memcpy(ptr, &tmp_16bit, 1); -#endif rt_len += 2; /* MCS information */ @@ -4094,21 +3873,6 @@ int recv_func_posthandle(_adapter *padapter, union recv_frame *prframe) } #endif -#if 0 - if (padapter->adapter_type == PRIMARY_ADAPTER) { - RTW_INFO("+++\n"); - { - int i; - u8 *ptr = get_recvframe_data(prframe); - for (i = 0; i < 140; i = i + 8) - RTW_INFO("%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:", *(ptr + i), - *(ptr + i + 1), *(ptr + i + 2) , *(ptr + i + 3) , *(ptr + i + 4), *(ptr + i + 5), *(ptr + i + 6), *(ptr + i + 7)); - - } - RTW_INFO("---\n"); - } -#endif - #ifdef CONFIG_TDLS /* check TDLS frame */ psnap_type = get_recvframe_data(orig_prframe) + pattrib->hdrlen + pattrib->iv_len + SNAP_SIZE; @@ -4587,22 +4351,6 @@ void rx_query_phy_status( if (_rtw_memcmp(adapter_mac_addr(padapter), sa, ETH_ALEN) == _TRUE) { static u32 start_time = 0; -#if 0 /*For debug */ - if (IsFrameTypeCtrl(wlanhdr)) { - RTW_INFO("-->Control frame: Y\n"); - RTW_INFO("-->pkt_len: %d\n", pattrib->pkt_len); - RTW_INFO("-->Sub Type = 0x%X\n", get_frame_sub_type(wlanhdr)); - } - - /* Dump first 40 bytes of header */ - int i = 0; - - for (i = 0; i < 40; i++) - RTW_INFO("%d: %X\n", i, *((u8 *)wlanhdr + i)); - - RTW_INFO("\n"); -#endif - if ((start_time == 0) || (rtw_get_passing_time_ms(start_time) > 5000)) { RTW_PRINT("Warning!!! %s: Confilc mac addr!!\n", __func__); start_time = rtw_get_current_time(); diff --git a/core/rtw_security.c b/core/rtw_security.c index f165d54..ea77149 100644 --- a/core/rtw_security.c +++ b/core/rtw_security.c @@ -987,13 +987,11 @@ static void next_key(u8 *key, sint round); static void byte_sub(u8 *in, u8 *out); static void shift_row(u8 *in, u8 *out); static void mix_column(u8 *in, u8 *out); -#ifndef PLATFORM_FREEBSD static void add_round_key(u8 *shiftrow_in, u8 *mcol_in, u8 *block_in, sint round, u8 *out); -#endif /* PLATFORM_FREEBSD */ static void aes128k128d(u8 *key, u8 *data, u8 *ciphertext); @@ -2002,28 +2000,6 @@ u32 rtw_aes_decrypt(_adapter *padapter, u8 *precvframe) prwskey = &stainfo->dot118021x_UncstKey.skey[0]; length = ((union recv_frame *)precvframe)->u.hdr.len - prxattrib->hdrlen - prxattrib->iv_len; -#if 0 - /* add for CONFIG_IEEE80211W, debug */ - if (0) - RTW_INFO("@@@@@@@@@@@@@@@@@@ length=%d, prxattrib->hdrlen=%d, prxattrib->pkt_len=%d\n" - , length, prxattrib->hdrlen, prxattrib->pkt_len); - if (0) { - int no; - /* test print PSK */ - RTW_INFO("PSK key below:\n"); - for (no = 0; no < 16; no++) - RTW_INFO(" %02x ", prwskey[no]); - RTW_INFO("\n"); - } - if (0) { - int no; - /* test print PSK */ - RTW_INFO("frame:\n"); - for (no = 0; no < prxattrib->pkt_len; no++) - RTW_INFO(" %02x ", pframe[no]); - RTW_INFO("\n"); - } -#endif res = aes_decipher(prwskey, prxattrib->hdrlen, pframe, length); @@ -2097,26 +2073,6 @@ u32 rtw_BIP_verify(_adapter *padapter, u8 *precvframe) , BIP_AAD, ori_len, mic)) goto BIP_exit; -#if 0 - /* management packet content */ - { - int pp; - RTW_INFO("pkt: "); - for (pp = 0; pp < pattrib->pkt_len; pp++) - RTW_INFO(" %02x ", pframe[pp]); - RTW_INFO("\n"); - /* BIP AAD + management frame body + MME(MIC is zero) */ - RTW_INFO("AAD+PKT: "); - for (pp = 0; pp < ori_len; pp++) - RTW_INFO(" %02x ", BIP_AAD[pp]); - RTW_INFO("\n"); - /* show the MIC result */ - RTW_INFO("mic: "); - for (pp = 0; pp < 16; pp++) - RTW_INFO(" %02x ", mic[pp]); - RTW_INFO("\n"); - } -#endif /* MIC field should be last 8 bytes of packet (packet without FCS) */ if (_rtw_memcmp(mic, pframe + pattrib->pkt_len - 8, 8)) { pmlmeext->mgnt_80211w_IPN_rx = temp_ipn; @@ -2133,7 +2089,6 @@ BIP_exit: } #endif /* CONFIG_IEEE80211W */ -#ifndef PLATFORM_FREEBSD /* compress 512-bits */ static int sha256_compress(struct sha256_state *md, unsigned char *buf) { @@ -2403,7 +2358,6 @@ static void hmac_sha256_vector(u8 *key, size_t key_len, size_t num_elem, _len[1] = 32; sha256_vector(2, _addr, _len, mac); } -#endif /* PLATFORM_FREEBSD */ /** * sha256_prf - SHA256-based Pseudo-Random Function (IEEE 802.11r, 8.5.1.5.2) * @key: Key for PRF @@ -2417,7 +2371,6 @@ static void hmac_sha256_vector(u8 *key, size_t key_len, size_t num_elem, * This function is used to derive new, cryptographically separate keys from a * given key. */ -#ifndef PLATFORM_FREEBSD /* Baron */ static void sha256_prf(u8 *key, size_t key_len, char *label, u8 *data, size_t data_len, u8 *buf, size_t buf_len) { @@ -2454,7 +2407,6 @@ static void sha256_prf(u8 *key, size_t key_len, char *label, counter++; } } -#endif /* PLATFORM_FREEBSD Baron */ /* AES tables*/ const u32 Te0[256] = { @@ -2633,7 +2585,6 @@ const u8 rcons[] = { * * @return the number of rounds for the given cipher key size. */ -#ifndef PLATFORM_FREEBSD /* Baron */ static void rijndaelKeySetupEnc(u32 rk[/*44*/], const u8 cipherKey[]) { int i; @@ -2850,7 +2801,6 @@ int omac1_aes_128(u8 *key, u8 *data, size_t data_len, u8 *mac) { return omac1_aes_128_vector(key, 1, &data, &data_len, mac); } -#endif /* PLATFORM_FREEBSD Baron */ #ifdef CONFIG_TDLS void wpa_tdls_generate_tpk(_adapter *padapter, PVOID sta) diff --git a/core/rtw_sreset.c b/core/rtw_sreset.c index 6d241ca..434be7c 100644 --- a/core/rtw_sreset.c +++ b/core/rtw_sreset.c @@ -264,7 +264,7 @@ void sreset_stop_adapter(_adapter *padapter) rtw_cancel_all_timer(padapter); /* TODO: OS and HCI independent */ -#if defined(PLATFORM_LINUX) && defined(CONFIG_USB_HCI) +#if defined(CONFIG_USB_HCI) tasklet_kill(&pxmitpriv->xmit_tasklet); #endif @@ -292,7 +292,7 @@ void sreset_start_adapter(_adapter *padapter) sreset_restore_network_status(padapter); /* TODO: OS and HCI independent */ -#if defined(PLATFORM_LINUX) && defined(CONFIG_USB_HCI) +#if defined(CONFIG_USB_HCI) tasklet_hi_schedule(&pxmitpriv->xmit_tasklet); #endif diff --git a/core/rtw_sta_mgt.c b/core/rtw_sta_mgt.c index 4c8e9b9..3541e6d 100644 --- a/core/rtw_sta_mgt.c +++ b/core/rtw_sta_mgt.c @@ -21,13 +21,6 @@ #include -#if defined(PLATFORM_LINUX) && defined (PLATFORM_WINDOWS) - - #error "Shall be Linux or Windows, but not both!\n" - -#endif - - bool test_st_match_rule(_adapter *adapter, u8 *local_naddr, u8 *local_port, u8 *remote_naddr, u8 *remote_port) { if (ntohs(*((u16 *)local_port)) == 5001 || ntohs(*((u16 *)remote_port)) == 5001) diff --git a/core/rtw_xmit.c b/core/rtw_xmit.c index 2d791d9..2511abd 100644 --- a/core/rtw_xmit.c +++ b/core/rtw_xmit.c @@ -22,11 +22,6 @@ #include #include -#if defined(PLATFORM_LINUX) && defined (PLATFORM_WINDOWS) - #error "Shall be Linux or Windows, but not both!\n" -#endif - - static u8 P802_1H_OUI[P80211_OUI_LEN] = { 0x00, 0x00, 0xf8 }; static u8 RFC1042_OUI[P80211_OUI_LEN] = { 0x00, 0x00, 0x00 }; @@ -37,11 +32,9 @@ static void _init_txservq(struct tx_servq *ptxservq) ptxservq->qcnt = 0; } - void _rtw_init_sta_xmit_priv(struct sta_xmit_priv *psta_xmitpriv) { - _rtw_memset((unsigned char *)psta_xmitpriv, 0, sizeof(struct sta_xmit_priv)); spin_lock_init(&psta_xmitpriv->lock); @@ -56,7 +49,6 @@ void _rtw_init_sta_xmit_priv(struct sta_xmit_priv *psta_xmitpriv) _rtw_init_listhead(&psta_xmitpriv->legacy_dz); _rtw_init_listhead(&psta_xmitpriv->apsd); - } s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, _adapter *padapter) @@ -66,7 +58,6 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, _adapter *padapter) struct xmit_frame *pxframe; sint res = _SUCCESS; - /* We don't need to memset padapter->XXX to zero, because adapter is allocated by rtw_zvmalloc(). */ /* _rtw_memset((unsigned char *)pxmitpriv, 0, sizeof(struct xmit_priv)); */ @@ -134,7 +125,6 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, _adapter *padapter) pxmitpriv->frag_len = MAX_FRAG_THRESHOLD; - /* init xmit_buf */ _rtw_init_queue(&pxmitpriv->free_xmitbuf_queue); _rtw_init_queue(&pxmitpriv->pending_xmitbuf_queue); @@ -307,7 +297,6 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, _adapter *padapter) pxmitpriv->voq_cnt = 0; #endif - #ifdef CONFIG_XMIT_ACK pxmitpriv->ack_tx = _FALSE; _rtw_mutex_init(&pxmitpriv->ack_tx_mutex); @@ -340,7 +329,6 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, _adapter *padapter) exit: - return res; } @@ -365,7 +353,6 @@ void rtw_mfree_xmit_priv_lock(struct xmit_priv *pxmitpriv) _rtw_spinlock_free(&pxmitpriv->pending_xmitbuf_queue.lock); } - void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv) { int i; @@ -373,7 +360,6 @@ void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv) struct xmit_frame *pxmitframe = (struct xmit_frame *) pxmitpriv->pxmit_frame_buf; struct xmit_buf *pxmitbuf = (struct xmit_buf *)pxmitpriv->pxmitbuf; - rtw_hal_free_xmit_priv(padapter); rtw_mfree_xmit_priv_lock(pxmitpriv); @@ -396,7 +382,6 @@ void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv) if (pxmitpriv->pallocated_frame_buf) rtw_vmfree(pxmitpriv->pallocated_frame_buf, NR_XMITFRAME * sizeof(struct xmit_frame) + 4); - if (pxmitpriv->pallocated_xmitbuf) rtw_vmfree(pxmitpriv->pallocated_xmitbuf, NR_XMITBUFF * sizeof(struct xmit_buf) + 4); @@ -799,19 +784,6 @@ static void update_attrib_vcs_info(_adapter *padapter, struct xmit_frame *pxmitf } } else { while (_TRUE) { -#if 0 /* Todo */ - /* check IOT action */ - if (pHTInfo->IOTAction & HT_IOT_ACT_FORCED_CTS2SELF) { - pattrib->vcs_mode = CTS_TO_SELF; - pattrib->rts_rate = MGN_24M; - break; - } else if (pHTInfo->IOTAction & (HT_IOT_ACT_FORCED_RTS | HT_IOT_ACT_PURE_N_MODE)) { - pattrib->vcs_mode = RTS_CTS; - pattrib->rts_rate = MGN_24M; - break; - } -#endif - /* IOT action */ if ((pmlmeinfo->assoc_AP_vendor == HT_IOT_PEER_ATHEROS) && (pattrib->ampdu_en == _TRUE) && (padapter->securitypriv.dot11PrivacyAlgrthm == _AES_)) { @@ -819,7 +791,6 @@ static void update_attrib_vcs_info(_adapter *padapter, struct xmit_frame *pxmitf break; } - /* check ERP protection */ if (pattrib->rtsen || pattrib->cts2self) { if (pattrib->rtsen) @@ -1028,7 +999,6 @@ static s32 update_attrib_sec_info(_adapter *padapter, struct pkt_attrib *pattrib else TKIP_IV(pattrib->iv, psta->dot11txpn, 0); - _rtw_memcpy(pattrib->dot11tkiptxmickey.skey, psta->dot11tkiptxmickey.skey, 16); break; @@ -1061,7 +1031,6 @@ static s32 update_attrib_sec_info(_adapter *padapter, struct pkt_attrib *pattrib if (pattrib->encrypt > 0) _rtw_memcpy(pattrib->dot118021x_UncstKey.skey, psta->dot118021x_UncstKey.skey, 16); - if (pattrib->encrypt && ((padapter->securitypriv.sw_encrypt == _TRUE) || (psecuritypriv->hw_decrypted == _FALSE))) { pattrib->bswenc = _TRUE; @@ -1124,7 +1093,6 @@ static void set_qos(struct pkt_file *ppktfile, struct pkt_attrib *pattrib) struct iphdr ip_hdr; s32 UserPriority = 0; - _rtw_open_pktfile(ppktfile->pkt, ppktfile); _rtw_pktfile_read(ppktfile, (unsigned char *)ðerhdr, ETH_HLEN); @@ -1137,7 +1105,6 @@ static void set_qos(struct pkt_file *ppktfile, struct pkt_attrib *pattrib) /* else if (pattrib->ether_type == 0x888e) { - UserPriority = 7; } */ @@ -1154,26 +1121,11 @@ u8 rtw_check_tdls_established(_adapter *padapter, struct pkt_attrib *pattrib) pattrib->direct_link = _FALSE; if (padapter->tdlsinfo.link_established == _TRUE) { pattrib->ptdls_sta = rtw_get_stainfo(&padapter->stapriv, pattrib->dst); -#if 1 if ((pattrib->ptdls_sta != NULL) && (pattrib->ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE) && (pattrib->ether_type != 0x0806)) { pattrib->direct_link = _TRUE; - /* RTW_INFO("send ptk to "MAC_FMT" using direct link\n", MAC_ARG(pattrib->dst)); */ } -#else - if (pattrib->ptdls_sta != NULL && - pattrib->ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE) { - pattrib->direct_link = _TRUE; -#if 0 - RTW_INFO("send ptk to "MAC_FMT" using direct link\n", MAC_ARG(pattrib->dst)); -#endif - } - - /* ARP frame may be helped by AP*/ - if (pattrib->ether_type != 0x0806) - pattrib->direct_link = _FALSE; -#endif } return pattrib->direct_link; @@ -1221,7 +1173,6 @@ s32 update_tdls_attrib(_adapter *padapter, struct pkt_attrib *pattrib) update_attrib_phy_info(padapter, pattrib, psta); - exit: return res; @@ -1256,7 +1207,6 @@ static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattr struct xmit_priv *pxmitpriv = &padapter->xmitpriv; sint res = _SUCCESS; - DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib); _rtw_open_pktfile(pkt, &pktfile); @@ -1264,11 +1214,9 @@ static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattr pattrib->ether_type = ntohs(etherhdr.h_proto); - _rtw_memcpy(pattrib->dst, ðerhdr.h_dest, ETH_ALEN); _rtw_memcpy(pattrib->src, ðerhdr.h_source, ETH_ALEN); - if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == _TRUE) || (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == _TRUE)) { _rtw_memcpy(pattrib->ra, pattrib->dst, ETH_ALEN); @@ -1403,14 +1351,9 @@ static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattr #ifdef CONFIG_WAPI_SUPPORT if ((pattrib->ether_type == 0x88B4) || (pattrib->ether_type == 0x0806) || (pattrib->ether_type == 0x888e) || (pattrib->dhcp_pkt == 1)) #else /* !CONFIG_WAPI_SUPPORT */ -#if 0 - if ((pattrib->ether_type == 0x0806) || (pattrib->ether_type == 0x888e) || (pattrib->dhcp_pkt == 1)) -#else /* only ICMP/DHCP packets is as SPECIAL_PACKET, and leave LPS when tx IMCP/DHCP packets. */ - /* if ((pattrib->ether_type == 0x888e) || (pattrib->dhcp_pkt == 1) ) */ if (pattrib->icmp_pkt == 1) rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_LEAVE, 1); else if (pattrib->dhcp_pkt == 1) -#endif #endif { DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib_active); @@ -1472,7 +1415,6 @@ static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattr exit: - return res; } @@ -1514,7 +1456,6 @@ static s32 xmitframe_addmic(_adapter *padapter, struct xmit_frame *pxmitframe) } */ - #ifdef CONFIG_USB_TX_AGGREGATION hw_hdr_offset = TXDESC_SIZE + (pxmitframe->pkt_offset * PACKET_OFFSET_SZ);; #else @@ -1570,7 +1511,6 @@ static s32 xmitframe_addmic(_adapter *padapter, struct xmit_frame *pxmitframe) if (pattrib->qos_en) priority[0] = (u8)pxmitframe->attrib.priority; - rtw_secmicappend(&micdata, &priority[0], 4); payload = pframe; @@ -1599,7 +1539,6 @@ static s32 xmitframe_addmic(_adapter *padapter, struct xmit_frame *pxmitframe) } } - return _SUCCESS; } @@ -1611,7 +1550,6 @@ static s32 xmitframe_swencrypt(_adapter *padapter, struct xmit_frame *pxmitframe struct pkt_attrib *pattrib = &pxmitframe->attrib; /* struct security_priv *psecuritypriv=&padapter->securitypriv; */ - /* if((psecuritypriv->sw_encrypt)||(pattrib->bswenc)) */ if (pattrib->bswenc) { #ifdef DBG_TX_SW_ENCRYPTOR @@ -1640,7 +1578,6 @@ static s32 xmitframe_swencrypt(_adapter *padapter, struct xmit_frame *pxmitframe } - return _SUCCESS; } @@ -1659,7 +1596,6 @@ s32 rtw_make_wlanhdr(_adapter *padapter , u8 *hdr, struct pkt_attrib *pattrib) /* sint bmcst = IS_MCAST(pattrib->ra); */ - /* psta = rtw_get_stainfo(&padapter->stapriv, pattrib->ra); if(pattrib->psta != psta) @@ -1773,7 +1709,6 @@ s32 rtw_make_wlanhdr(_adapter *padapter , u8 *hdr, struct pkt_attrib *pattrib) return _FAIL; } - if (psta) { psta->sta_xmitpriv.txseq_tid[pattrib->priority]++; psta->sta_xmitpriv.txseq_tid[pattrib->priority] &= 0xFFF; @@ -1782,13 +1717,6 @@ s32 rtw_make_wlanhdr(_adapter *padapter , u8 *hdr, struct pkt_attrib *pattrib) SetSeqNum(hdr, pattrib->seqnum); #ifdef CONFIG_80211N_HT -#if 0 /* move into update_attrib_phy_info(). */ - /* check if enable ampdu */ - if (pattrib->ht_en && psta->htpriv.ampdu_enable) { - if (psta->htpriv.agg_enable_bitmap & BIT(pattrib->priority)) - pattrib->ampdu_en = _TRUE; - } -#endif /* re-check if enable ampdu by BA_starting_seqctrl */ if (pattrib->ampdu_en == _TRUE) { u16 tx_seq; @@ -1820,7 +1748,6 @@ s32 rtw_make_wlanhdr(_adapter *padapter , u8 *hdr, struct pkt_attrib *pattrib) exit: - return res; } @@ -1955,7 +1882,6 @@ s32 rtw_make_tdls_wlanhdr(_adapter *padapter , u8 *hdr, struct pkt_attrib *pattr sint res = _SUCCESS; u16 *fctrl = &pwlanhdr->frame_ctl; - _rtw_memset(hdr, 0, WLANHDR_OFFSET); set_frame_sub_type(fctrl, pattrib->subtype); @@ -2041,10 +1967,8 @@ s32 rtw_make_tdls_wlanhdr(_adapter *padapter , u8 *hdr, struct pkt_attrib *pattr SetSeqNum(hdr, pattrib->seqnum); } - exit: - return res; } @@ -2062,7 +1986,6 @@ s32 rtw_xmit_tdls_coalesce(_adapter *padapter, struct xmit_frame *pxmitframe, st s32 bmcst = IS_MCAST(pattrib->ra); s32 res = _SUCCESS; - if (pattrib->psta) psta = pattrib->psta; else { @@ -2150,7 +2073,6 @@ s32 rtw_xmit_tdls_coalesce(_adapter *padapter, struct xmit_frame *pxmitframe, st exit: - return res; } #endif /* CONFIG_TDLS */ @@ -2254,7 +2176,6 @@ s32 rtw_xmitframe_coalesce_amsdu(_adapter *padapter, struct xmit_frame *pxmitfra return _FAIL; } - pbuf_start = pxmitframe->buf_addr; #ifdef CONFIG_USB_TX_AGGREGATION @@ -2430,7 +2351,6 @@ s32 rtw_xmitframe_coalesce(_adapter *padapter, _pkt *pkt, struct xmit_frame *pxm s32 bmcst = IS_MCAST(pattrib->ra); s32 res = _SUCCESS; - /* if (pattrib->psta) { @@ -2448,7 +2368,6 @@ s32 rtw_xmitframe_coalesce(_adapter *padapter, _pkt *pkt, struct xmit_frame *pxm return _FAIL; } - if(!(psta->state &_FW_LINKED)) { RTW_INFO("%s, psta->state(0x%x) != _FW_LINKED\n", __func__, psta->state); @@ -2500,41 +2419,8 @@ s32 rtw_xmitframe_coalesce(_adapter *padapter, _pkt *pkt, struct xmit_frame *pxm /* adding icv, if necessary... */ if (pattrib->iv_len) { -#if 0 - /* if (check_fwstate(pmlmepriv, WIFI_MP_STATE)) */ - /* psta = rtw_get_stainfo(pstapriv, get_bssid(pmlmepriv)); */ - /* else */ - /* psta = rtw_get_stainfo(pstapriv, pattrib->ra); */ - - if (psta != NULL) { - switch (pattrib->encrypt) { - case _WEP40_: - case _WEP104_: - WEP_IV(pattrib->iv, psta->dot11txpn, pattrib->key_idx); - break; - case _TKIP_: - if (bmcst) - TKIP_IV(pattrib->iv, psta->dot11txpn, pattrib->key_idx); - else - TKIP_IV(pattrib->iv, psta->dot11txpn, 0); - break; - case _AES_: - if (bmcst) - AES_IV(pattrib->iv, psta->dot11txpn, pattrib->key_idx); - else - AES_IV(pattrib->iv, psta->dot11txpn, 0); - break; -#ifdef CONFIG_WAPI_SUPPORT - case _SMS4_: - rtw_wapi_get_iv(padapter, pattrib->ra, pattrib->iv); - break; -#endif - } - } -#endif _rtw_memcpy(pframe, pattrib->iv, pattrib->iv_len); - pframe += pattrib->iv_len; mpdu_len -= pattrib->iv_len; @@ -2549,7 +2435,6 @@ s32 rtw_xmitframe_coalesce(_adapter *padapter, _pkt *pkt, struct xmit_frame *pxm if ((pattrib->icv_len > 0) && (pattrib->bswenc)) mpdu_len -= pattrib->icv_len; - if (bmcst) { /* don't do fragment to broadcat/multicast packets */ mem_sz = _rtw_pktfile_read(&pktfile, pframe, pattrib->pktlen); @@ -2598,7 +2483,6 @@ s32 rtw_xmitframe_coalesce(_adapter *padapter, _pkt *pkt, struct xmit_frame *pxm exit: - return res; } @@ -2639,7 +2523,6 @@ s32 rtw_mgmt_xmitframe_coalesce(_adapter *padapter, _pkt *pkt, struct xmit_frame _enter_critical_bh(&padapter->security_key_mutex, &irqL); - /* IGTK key is not install, it may not support 802.11w */ if (padapter->securitypriv.binstallBIPkey != _TRUE) { RTW_INFO("no instll BIP key\n"); @@ -2681,41 +2564,13 @@ s32 rtw_mgmt_xmitframe_coalesce(_adapter *padapter, _pkt *pkt, struct xmit_frame _rtw_memcpy(BIP_AAD + 2, pwlanhdr->addr1, 18); /* copy management fram body */ _rtw_memcpy(BIP_AAD + BIP_AAD_SIZE, MGMT_body, frame_body_len); -#if 0 - /* dump total packet include MME with zero MIC */ - { - int i; - RTW_INFO("Total packet: "); - for (i = 0; i < BIP_AAD_SIZE + frame_body_len; i++) - RTW_INFO(" %02x ", BIP_AAD[i]); - RTW_INFO("\n"); - } -#endif /* calculate mic */ if (omac1_aes_128(padapter->securitypriv.dot11wBIPKey[padapter->securitypriv.dot11wBIPKeyid].skey , BIP_AAD, BIP_AAD_SIZE + frame_body_len, mic)) goto xmitframe_coalesce_fail; -#if 0 - /* dump calculated mic result */ - { - int i; - RTW_INFO("Calculated mic result: "); - for (i = 0; i < 16; i++) - RTW_INFO(" %02x ", mic[i]); - RTW_INFO("\n"); - } -#endif /* copy right BIP mic value, total is 128bits, we use the 0~63 bits */ _rtw_memcpy(pframe - 8, mic, 8); - /*/dump all packet after mic ok - { - int pp; - RTW_INFO("pattrib->pktlen = %d\n", pattrib->pktlen); - for(pp=0;pp< pattrib->pktlen; pp++) - RTW_INFO(" %02x ", mem_start[pp]); - RTW_INFO("\n"); - }*/ } else { /* unicast mgmt frame TX */ /* start to encrypt mgmt frame */ if (subtype == WIFI_DEAUTH || subtype == WIFI_DISASSOC || @@ -2789,16 +2644,6 @@ s32 rtw_mgmt_xmitframe_coalesce(_adapter *padapter, _pkt *pkt, struct xmit_frame pframe += pattrib->pktlen - pattrib->hdrlen; /* add 8 bytes CCMP IV header to length */ pattrib->pktlen += pattrib->iv_len; -#if 0 - /* dump management packet include AES IV header */ - { - int i; - RTW_INFO("Management pkt + IV: "); - /* for(i=0; ipktlen; i++) */ - - RTW_INFO("@@@@@@@@@@@@@\n"); - } -#endif if ((pattrib->icv_len > 0) && (pattrib->bswenc)) { _rtw_memcpy(pframe, pattrib->icv, pattrib->icv_len); @@ -2811,16 +2656,6 @@ s32 rtw_mgmt_xmitframe_coalesce(_adapter *padapter, _pkt *pkt, struct xmit_frame /* set protected bit must be beofre SW encrypt */ SetPrivacy(mem_start); -#if 0 - /* dump management packet include AES header */ - { - int i; - RTW_INFO("prepare to enc Management pkt + IV: "); - for (i = 0; i < pattrib->pktlen; i++) - RTW_INFO(" %02x ", mem_start[i]); - RTW_INFO("@@@@@@@@@@@@@\n"); - } -#endif /* software encrypt */ xmitframe_swencrypt(padapter, pxmitframe); } @@ -2851,7 +2686,6 @@ s32 rtw_put_snap(u8 *data, u16 h_proto) struct ieee80211_snap_hdr *snap; u8 *oui; - snap = (struct ieee80211_snap_hdr *)data; snap->dsap = 0xaa; snap->ssap = 0xaa; @@ -2868,7 +2702,6 @@ s32 rtw_put_snap(u8 *data, u16 h_proto) *(u16 *)(data + SNAP_SIZE) = htons(h_proto); - return SNAP_SIZE + sizeof(u16); } @@ -2881,7 +2714,6 @@ void rtw_update_protection(_adapter *padapter, u8 *ie, uint ie_len) struct xmit_priv *pxmitpriv = &padapter->xmitpriv; struct registry_priv *pregistrypriv = &padapter->registrypriv; - switch (pxmitpriv->vcs_setting) { case DISABLE_VCS: pxmitpriv->vcs = NONE_VCS; @@ -2910,7 +2742,6 @@ void rtw_update_protection(_adapter *padapter, u8 *ie, uint ie_len) } - } void rtw_count_tx_stats(PADAPTER padapter, struct xmit_frame *pxmitframe, int sz) @@ -2959,7 +2790,6 @@ static struct xmit_buf *__rtw_alloc_cmd_xmitbuf(struct xmit_priv *pxmitpriv, { struct xmit_buf *pxmitbuf = NULL; - pxmitbuf = &pxmitpriv->pcmd_xmitbuf[buf_type]; if (pxmitbuf != NULL) { pxmitbuf->priv_data = NULL; @@ -2988,7 +2818,6 @@ static struct xmit_buf *__rtw_alloc_cmd_xmitbuf(struct xmit_priv *pxmitpriv, exit: - return pxmitbuf; } @@ -3033,7 +2862,6 @@ struct xmit_buf *rtw_alloc_xmitbuf_ext(struct xmit_priv *pxmitpriv) _list *plist, *phead; _queue *pfree_queue = &pxmitpriv->free_xmit_extbuf_queue; - _enter_critical(&pfree_queue->lock, &irqL); if (_rtw_queue_empty(pfree_queue) == _TRUE) @@ -3055,7 +2883,6 @@ struct xmit_buf *rtw_alloc_xmitbuf_ext(struct xmit_priv *pxmitpriv) RTW_INFO("DBG_XMIT_BUF_EXT ALLOC no=%d, free_xmit_extbuf_cnt=%d\n", pxmitbuf->no, pxmitpriv->free_xmit_extbuf_cnt); #endif - pxmitbuf->priv_data = NULL; #if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) @@ -3081,7 +2908,6 @@ struct xmit_buf *rtw_alloc_xmitbuf_ext(struct xmit_priv *pxmitpriv) _exit_critical(&pfree_queue->lock, &irqL); - return pxmitbuf; } @@ -3090,7 +2916,6 @@ s32 rtw_free_xmitbuf_ext(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf) _irqL irqL; _queue *pfree_queue = &pxmitpriv->free_xmit_extbuf_queue; - if (pxmitbuf == NULL) return _FAIL; @@ -3106,7 +2931,6 @@ s32 rtw_free_xmitbuf_ext(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf) _exit_critical(&pfree_queue->lock, &irqL); - return _SUCCESS; } @@ -3117,7 +2941,6 @@ struct xmit_buf *rtw_alloc_xmitbuf(struct xmit_priv *pxmitpriv) _list *plist, *phead; _queue *pfree_xmitbuf_queue = &pxmitpriv->free_xmitbuf_queue; - /* RTW_INFO("+rtw_alloc_xmitbuf\n"); */ _enter_critical(&pfree_xmitbuf_queue->lock, &irqL); @@ -3171,7 +2994,6 @@ struct xmit_buf *rtw_alloc_xmitbuf(struct xmit_priv *pxmitpriv) _exit_critical(&pfree_xmitbuf_queue->lock, &irqL); - return pxmitbuf; } @@ -3180,7 +3002,6 @@ s32 rtw_free_xmitbuf(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf) _irqL irqL; _queue *pfree_xmitbuf_queue = &pxmitpriv->free_xmitbuf_queue; - /* RTW_INFO("+rtw_free_xmitbuf\n"); */ if (pxmitbuf == NULL) @@ -3209,7 +3030,6 @@ s32 rtw_free_xmitbuf(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf) _exit_critical(&pfree_xmitbuf_queue->lock, &irqL); } - return _SUCCESS; } @@ -3274,7 +3094,6 @@ struct xmit_frame *rtw_alloc_xmitframe(struct xmit_priv *pxmitpriv)/* (_queue *p _list *plist, *phead; _queue *pfree_xmit_queue = &pxmitpriv->free_xmit_queue; - _enter_critical_bh(&pfree_xmit_queue->lock, &irqL); if (_rtw_queue_empty(pfree_xmit_queue) == _TRUE) { @@ -3294,7 +3113,6 @@ struct xmit_frame *rtw_alloc_xmitframe(struct xmit_priv *pxmitpriv)/* (_queue *p rtw_init_xmitframe(pxframe); - return pxframe; } @@ -3305,7 +3123,6 @@ struct xmit_frame *rtw_alloc_xmitframe_ext(struct xmit_priv *pxmitpriv) _list *plist, *phead; _queue *queue = &pxmitpriv->free_xframe_ext_queue; - _enter_critical_bh(&queue->lock, &irqL); if (_rtw_queue_empty(queue) == _TRUE) { @@ -3323,7 +3140,6 @@ struct xmit_frame *rtw_alloc_xmitframe_ext(struct xmit_priv *pxmitpriv) rtw_init_xmitframe(pxframe); - return pxframe; } @@ -3363,7 +3179,6 @@ s32 rtw_free_xmitframe(struct xmit_priv *pxmitpriv, struct xmit_frame *pxmitfram _adapter *padapter = pxmitpriv->adapter; _pkt *pndis_pkt = NULL; - if (pxmitframe == NULL) { goto exit; } @@ -3406,7 +3221,6 @@ check_pkt_complete: exit: - return _SUCCESS; } @@ -3416,7 +3230,6 @@ void rtw_free_xmitframe_queue(struct xmit_priv *pxmitpriv, _queue *pframequeue) _list *plist, *phead; struct xmit_frame *pxmitframe; - _enter_critical_bh(&(pframequeue->lock), &irqL); phead = get_list_head(pframequeue); @@ -3457,32 +3270,10 @@ static struct xmit_frame *dequeue_one_xmitframe(struct xmit_priv *pxmitpriv, str while ((rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) == _FALSE) { pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list); - /* xmitframe_plist = get_next(xmitframe_plist); */ - - /*#ifdef RTK_DMP_PLATFORM - #ifdef CONFIG_USB_TX_AGGREGATION - if((ptxservq->qcnt>0) && (ptxservq->qcnt<=2)) - { - pxmitframe = NULL; - - tasklet_schedule(&pxmitpriv->xmit_tasklet); - - break; - } - #endif - #endif*/ rtw_list_delete(&pxmitframe->list); ptxservq->qcnt--; - - /* rtw_list_insert_tail(&pxmitframe->list, &phwxmit->pending); */ - - /* ptxservq->qcnt--; */ - break; - - /* pxmitframe = NULL; */ - } return pxmitframe; @@ -3565,7 +3356,6 @@ exit: return pxmitframe; } - struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmit *phwxmit_i, sint entry) { _irqL irqL0; @@ -3581,7 +3371,6 @@ struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmi /* int j, tmp, acirp_cnt[4]; */ #endif - inx[0] = 0; inx[1] = 1; inx[2] = 2; @@ -3589,13 +3378,6 @@ struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmi if (pregpriv->wifi_spec == 1) { int j, tmp, acirp_cnt[4]; -#if 0 - if (flags < XMIT_QUEUE_ENTRY) { - /* priority exchange according to the completed xmitbuf flags. */ - inx[flags] = 0; - inx[0] = flags; - } -#endif #if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_PCI_HCI) for (j = 0; j < 4; j++) @@ -3653,7 +3435,6 @@ struct tx_servq *rtw_get_sta_pending(_adapter *padapter, struct sta_info *psta, { struct tx_servq *ptxservq = NULL; - switch (up) { case 1: case 2: @@ -3682,7 +3463,6 @@ struct tx_servq *rtw_get_sta_pending(_adapter *padapter, struct sta_info *psta, } - return ptxservq; } #else @@ -3692,7 +3472,6 @@ __inline static struct tx_servq *rtw_get_sta_pending struct tx_servq *ptxservq; struct hw_xmit *phwxmits = padapter->xmitpriv.hwxmits; - #ifdef CONFIG_RTL8711 if (IS_MCAST(psta->hwaddr)) { @@ -3735,7 +3514,6 @@ __inline static struct tx_servq *rtw_get_sta_pending } - return ptxservq; } #endif @@ -3755,7 +3533,6 @@ s32 rtw_xmit_classifier(_adapter *padapter, struct xmit_frame *pxmitframe) struct hw_xmit *phwxmits = padapter->xmitpriv.hwxmits; sint res = _SUCCESS; - DBG_COUNTER(padapter->tx_logs.core_tx_enqueue_class); /* @@ -3806,7 +3583,6 @@ s32 rtw_xmit_classifier(_adapter *padapter, struct xmit_frame *pxmitframe) exit: - return res; } @@ -3868,10 +3644,8 @@ void rtw_alloc_hwxmits(_adapter *padapter) hwxmits[3] .sta_queue = &pxmitpriv->bk_pending; } else { - } - } void rtw_free_hwxmits(_adapter *padapter) @@ -4003,7 +3777,6 @@ int rtw_br_client_tx(_adapter *padapter, struct sk_buff **pskb) if (skb_is_nonlinear(skb)) DEBUG_ERR("%s(): skb_is_nonlinear!!\n", __FUNCTION__); - #if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)) res = skb_linearize(skb, GFP_ATOMIC); #else /* (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)) */ @@ -4043,21 +3816,6 @@ int rtw_br_client_tx(_adapter *padapter, struct sk_buff **pskb) *((unsigned short *)(skb->data + MACADDRLEN * 2 + 2)) = vlan_hdr; } } -#if 0 - else { - if (*((unsigned short *)(skb->data + MACADDRLEN * 2)) == __constant_htons(ETH_P_8021Q)) - is_vlan_tag = 1; - - if (is_vlan_tag) { - if (ICMPV6_MCAST_MAC(skb->data) && ICMPV6_PROTO1A_VALN(skb->data)) - memcpy(skb->data + MACADDRLEN, GET_MY_HWADDR(padapter), MACADDRLEN); - } else { - if (ICMPV6_MCAST_MAC(skb->data) && ICMPV6_PROTO1A(skb->data)) - memcpy(skb->data + MACADDRLEN, GET_MY_HWADDR(padapter), MACADDRLEN); - } - } -#endif /* 0 */ - /* check if SA is equal to our MAC */ if (memcmp(skb->data + MACADDRLEN, GET_MY_HWADDR(padapter), MACADDRLEN)) { /* priv->ext_stats.tx_drops++; */ @@ -4571,7 +4329,6 @@ sint xmitframe_enqueue_for_sleeping_sta(_adapter *padapter, struct xmit_frame *p return ret; } - if (bmcst) { _enter_critical_bh(&psta->sleep_q.lock, &irqL); @@ -4615,7 +4372,6 @@ sint xmitframe_enqueue_for_sleeping_sta(_adapter *padapter, struct xmit_frame *p } - _enter_critical_bh(&psta->sleep_q.lock, &irqL); if (psta->state & WIFI_SLEEP_STATE) { @@ -4738,7 +4494,6 @@ void stop_sta_xmit(_adapter *padapter, struct sta_info *psta) /* for BC/MC Frames */ psta_bmc = rtw_get_bcmc_stainfo(padapter); - _enter_critical_bh(&pxmitpriv->lock, &irqL0); psta->state |= WIFI_SLEEP_STATE; @@ -4748,20 +4503,15 @@ void stop_sta_xmit(_adapter *padapter, struct sta_info *psta) #endif /* CONFIG_TDLS */ pstapriv->sta_dz_bitmap |= BIT(psta->aid); - - dequeue_xmitframes_to_sleeping_queue(padapter, psta, &pstaxmitpriv->vo_q.sta_pending); rtw_list_delete(&(pstaxmitpriv->vo_q.tx_pending)); - dequeue_xmitframes_to_sleeping_queue(padapter, psta, &pstaxmitpriv->vi_q.sta_pending); rtw_list_delete(&(pstaxmitpriv->vi_q.tx_pending)); - dequeue_xmitframes_to_sleeping_queue(padapter, psta, &pstaxmitpriv->be_q.sta_pending); rtw_list_delete(&(pstaxmitpriv->be_q.tx_pending)); - dequeue_xmitframes_to_sleeping_queue(padapter, psta, &pstaxmitpriv->bk_q.sta_pending); rtw_list_delete(&(pstaxmitpriv->bk_q.tx_pending)); @@ -4769,19 +4519,16 @@ void stop_sta_xmit(_adapter *padapter, struct sta_info *psta) if (!(psta->tdls_sta_state & TDLS_LINKED_STATE) && (psta_bmc != NULL)) { #endif /* CONFIG_TDLS */ - /* for BC/MC Frames */ pstaxmitpriv = &psta_bmc->sta_xmitpriv; dequeue_xmitframes_to_sleeping_queue(padapter, psta_bmc, &pstaxmitpriv->be_q.sta_pending); rtw_list_delete(&(pstaxmitpriv->be_q.tx_pending)); - #ifdef CONFIG_TDLS } #endif /* CONFIG_TDLS */ _exit_critical_bh(&pxmitpriv->lock, &irqL0); - } void wakeup_sta_to_xmit(_adapter *padapter, struct sta_info *psta) @@ -4796,7 +4543,6 @@ void wakeup_sta_to_xmit(_adapter *padapter, struct sta_info *psta) psta_bmc = rtw_get_bcmc_stainfo(padapter); - /* _enter_critical_bh(&psta->sleep_q.lock, &irqL); */ _enter_critical_bh(&pxmitpriv->lock, &irqL); @@ -4859,7 +4605,6 @@ void wakeup_sta_to_xmit(_adapter *padapter, struct sta_info *psta) */ rtw_hal_xmitframe_enqueue(padapter, pxmitframe); - } if (psta->sleepq_len == 0) { @@ -4915,7 +4660,6 @@ void wakeup_sta_to_xmit(_adapter *padapter, struct sta_info *psta) else pxmitframe->attrib.mdata = 0; - pxmitframe->attrib.triggered = 1; /* _exit_critical_bh(&psta_bmc->sleep_q.lock, &irqL); @@ -4969,7 +4713,6 @@ void xmit_delivery_enabled_frames(_adapter *padapter, struct sta_info *psta) struct sta_priv *pstapriv = &padapter->stapriv; struct xmit_priv *pxmitpriv = &padapter->xmitpriv; - /* _enter_critical_bh(&psta->sleep_q.lock, &irqL); */ _enter_critical_bh(&pxmitpriv->lock, &irqL); @@ -5089,7 +4832,6 @@ struct xmit_buf *dequeue_pending_xmitbuf( struct xmit_buf *pxmitbuf; _queue *pqueue; - pxmitbuf = NULL; pqueue = &pxmitpriv->pending_xmitbuf_queue; @@ -5119,7 +4861,6 @@ static struct xmit_buf *dequeue_pending_xmitbuf_under_survey( #endif _queue *pqueue; - pxmitbuf = NULL; pqueue = &pxmitpriv->pending_xmitbuf_queue; @@ -5241,7 +4982,6 @@ thread_return rtw_xmit_thread(thread_context context) s32 err; PADAPTER padapter; - err = _SUCCESS; padapter = (PADAPTER)context; @@ -5460,9 +5200,7 @@ void rtw_sctx_init(struct submit_ctx *sctx, int timeout_ms) { sctx->timeout_ms = timeout_ms; sctx->submit_time = rtw_get_current_time(); -#ifdef PLATFORM_LINUX /* TODO: add condition wating interface for other os */ init_completion(&sctx->done); -#endif sctx->status = RTW_SCTX_SUBMITTED; } @@ -5472,7 +5210,6 @@ int rtw_sctx_wait(struct submit_ctx *sctx, const char *msg) unsigned long expire; int status = 0; -#ifdef PLATFORM_LINUX expire = sctx->timeout_ms ? msecs_to_jiffies(sctx->timeout_ms) : MAX_SCHEDULE_TIMEOUT; if (!wait_for_completion_timeout(&sctx->done, expire)) { /* timeout, do something?? */ @@ -5480,7 +5217,6 @@ int rtw_sctx_wait(struct submit_ctx *sctx, const char *msg) RTW_INFO("%s timeout: %s\n", __func__, msg); } else status = sctx->status; -#endif if (status == RTW_SCTX_DONE_SUCCESS) ret = _SUCCESS; @@ -5509,9 +5245,7 @@ void rtw_sctx_done_err(struct submit_ctx **sctx, int status) if (rtw_sctx_chk_waring_status(status)) RTW_INFO("%s status:%d\n", __func__, status); (*sctx)->status = status; -#ifdef PLATFORM_LINUX complete(&((*sctx)->done)); -#endif *sctx = NULL; } }