mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2025-05-08 14:33:05 +00:00
rtl8188eu: Remove code used only for Windows
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
2caee63170
commit
a68c6cc26e
42 changed files with 9 additions and 1912 deletions
|
@ -54,10 +54,6 @@ jackson@realtek.com.tw
|
|||
#include <rtw_io.h>
|
||||
#include <osdep_intf.h>
|
||||
|
||||
#if defined (PLATFORM_LINUX) && defined (PLATFORM_WINDOWS)
|
||||
#error "Shall be Linux or Windows, but not both!\n"
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
#include <sdio_ops.h>
|
||||
#endif
|
||||
|
|
|
@ -26,171 +26,4 @@
|
|||
#include <wifi.h>
|
||||
|
||||
|
||||
#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;
|
||||
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("_query_802_11_capability(): szAuthEnc size is too large.\n"));
|
||||
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*)&(psecuritypriv->sec_bss);
|
||||
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
|
||||
|
||||
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("\n Adapter->ndisauthtype==Ndis802_11AuthModeWPA)?0xdd:0x30 [%d]",pDest[0]));
|
||||
supp_ie=&psecuritypriv->supplicant_ie[0];
|
||||
for(i=0;i<supp_ie[0];i++)
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("IEs [%d] = 0x%x \n\n", i,supp_ie[i]));
|
||||
}
|
||||
|
||||
i=13; //0~11 is fixed information element
|
||||
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("i= %d tgt_network->network.IELength=%d\n\n", i,(int)psecnetwork->IELength));
|
||||
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;
|
||||
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("iteration i=%d IEs [%d] = 0x%x \n\n", i,i,supp_ie[i+1]));
|
||||
|
||||
}
|
||||
|
||||
|
||||
pAssocInfo->RequestIELength += (2 + supp_ie[1+i]);// (2 + psecnetwork->IEs[1+i]+4);
|
||||
|
||||
}
|
||||
|
||||
|
||||
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("\n psecnetwork != NULL,fwstate==_FW_UNDER_LINKING \n"));
|
||||
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------
|
||||
// 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];
|
||||
|
||||
for(i=0;i<auth_ie[0];i++)
|
||||
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("IEs [%d] = 0x%x \n\n", i,auth_ie[i]));
|
||||
|
||||
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;
|
||||
|
||||
|
||||
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("\n tgt_network != NULL,fwstate==_FW_LINKED \n"));
|
||||
}
|
||||
}
|
||||
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("\n exit query_802_11_association_information \n"));
|
||||
_func_exit_;
|
||||
|
||||
return _TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -237,102 +237,6 @@ _func_exit_;
|
|||
return ret;
|
||||
}
|
||||
|
||||
#ifdef PLATFORM_WINDOWS
|
||||
u8 rtw_pnp_set_power_wakeup(_adapter* padapter)
|
||||
{
|
||||
u8 res=_SUCCESS;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("==>rtw_pnp_set_power_wakeup!!!\n"));
|
||||
|
||||
res = rtw_setstandby_cmd(padapter, 0);
|
||||
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("<==rtw_pnp_set_power_wakeup!!!\n"));
|
||||
|
||||
_func_exit_;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
u8 rtw_pnp_set_power_sleep(_adapter* padapter)
|
||||
{
|
||||
u8 res=_SUCCESS;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("==>rtw_pnp_set_power_sleep!!!\n"));
|
||||
//DbgPrint("+rtw_pnp_set_power_sleep\n");
|
||||
|
||||
res = rtw_setstandby_cmd(padapter, 1);
|
||||
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("<==rtw_pnp_set_power_sleep!!!\n"));
|
||||
|
||||
_func_exit_;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
u8 rtw_set_802_11_reload_defaults(_adapter * padapter, NDIS_802_11_RELOAD_DEFAULTS reloadDefaults)
|
||||
{
|
||||
_func_enter_;
|
||||
|
||||
switch( reloadDefaults)
|
||||
{
|
||||
case Ndis802_11ReloadWEPKeys:
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("SetInfo OID_802_11_RELOAD_DEFAULTS : Ndis802_11ReloadWEPKeys\n"));
|
||||
break;
|
||||
}
|
||||
|
||||
// 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...
|
||||
|
||||
_func_exit_;
|
||||
|
||||
return _TRUE;
|
||||
}
|
||||
|
||||
u8 set_802_11_test(_adapter* padapter, NDIS_802_11_TEST *test)
|
||||
{
|
||||
u8 ret=_TRUE;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
_func_exit_;
|
||||
|
||||
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;
|
||||
|
|
|
@ -279,17 +279,6 @@ _func_enter_;
|
|||
|
||||
if(!isfreeall)
|
||||
{
|
||||
#ifdef PLATFORM_WINDOWS
|
||||
|
||||
delta_time = (curr_time -pnetwork->last_scanned)/10;
|
||||
|
||||
if(delta_time < lifetime*1000000)// unit:usec
|
||||
{
|
||||
goto exit;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef PLATFORM_LINUX
|
||||
|
||||
delta_time = (curr_time -pnetwork->last_scanned)/HZ;
|
||||
|
|
|
@ -1438,10 +1438,6 @@ void rtw_init_pwrctrl_priv(PADAPTER padapter)
|
|||
|
||||
_func_enter_;
|
||||
|
||||
#ifdef PLATFORM_WINDOWS
|
||||
pwrctrlpriv->pnp_current_pwr_state=NdisDeviceStateD0;
|
||||
#endif
|
||||
|
||||
_init_pwrlock(&pwrctrlpriv->lock);
|
||||
pwrctrlpriv->rf_pwrstate = rf_on;
|
||||
pwrctrlpriv->ips_enter_cnts=0;
|
||||
|
|
|
@ -35,12 +35,6 @@
|
|||
#include <rtl8723a_hal.h>
|
||||
#endif
|
||||
|
||||
#if defined (PLATFORM_LINUX) && defined (PLATFORM_WINDOWS)
|
||||
|
||||
#error "Shall be Linux or Windows, but not both!\n"
|
||||
|
||||
#endif
|
||||
|
||||
#include <wifi.h>
|
||||
#include <circ_buf.h>
|
||||
|
||||
|
@ -136,8 +130,6 @@ _func_enter_;
|
|||
#ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS
|
||||
#ifdef PLATFORM_LINUX
|
||||
_init_timer(&precvpriv->signal_stat_timer, padapter->pnetdev, RTW_TIMER_HDL_NAME(signal_stat), padapter);
|
||||
#elif defined(PLATFORM_OS_CE) || defined(PLATFORM_WINDOWS)
|
||||
_init_timer(&precvpriv->signal_stat_timer, padapter->hndis_adapter, RTW_TIMER_HDL_NAME(signal_stat), padapter);
|
||||
#endif
|
||||
|
||||
precvpriv->signal_stat_sampling_interval = 1000; //ms
|
||||
|
@ -272,10 +264,6 @@ _func_enter_;
|
|||
#endif
|
||||
|
||||
|
||||
#ifdef PLATFORM_WINDOWS
|
||||
rtw_os_read_port(padapter, precvframe->u.hdr.precvbuf);
|
||||
#endif
|
||||
|
||||
#if defined(PLATFORM_LINUX) || defined(PLATFORM_FREEBSD)
|
||||
|
||||
if(precvframe->u.hdr.pkt)
|
||||
|
@ -3112,9 +3100,6 @@ exit:
|
|||
|
||||
return ret;
|
||||
#else // || defined (PLATFORM_LINUX) || defined (PLATFORM_FREEBSD)
|
||||
#ifdef PLATFORM_WINDOWS
|
||||
_irqL irql;
|
||||
#endif //PLATFORM_WINDOWS
|
||||
unsigned char *ptr, *pdata, *pbuf, *psnap_type;
|
||||
union recv_frame *pnrframe, *pnrframe_new;
|
||||
int a_len, mv_len, padding_len;
|
||||
|
@ -3125,9 +3110,6 @@ exit:
|
|||
struct recv_priv *precvpriv = &padapter->recvpriv;
|
||||
_queue *pfree_recv_queue = &(precvpriv->free_recv_queue);
|
||||
int ret = _SUCCESS;
|
||||
#ifdef PLATFORM_WINDOWS
|
||||
struct recv_buf *precvbuf = prframe->u.hdr.precvbuf;
|
||||
#endif //PLATFORM_WINDOWS
|
||||
a_len = prframe->u.hdr.len - prframe->u.hdr.attrib.hdrlen;
|
||||
|
||||
recvframe_pull(prframe, prframe->u.hdr.attrib.hdrlen);
|
||||
|
@ -3363,14 +3345,6 @@ exit:
|
|||
pdata += (type_len + ETH_HLEN + padding_len);
|
||||
pnrframe_new->u.hdr.rx_head = pnrframe_new->u.hdr.rx_data = pnrframe_new->u.hdr.rx_tail = pdata;
|
||||
pnrframe_new->u.hdr.rx_end = pdata + a_len + padding_len;//
|
||||
|
||||
#ifdef PLATFORM_WINDOWS
|
||||
pnrframe_new->u.hdr.precvbuf=precvbuf;
|
||||
_enter_critical_bh(&precvbuf->recvbuf_lock, &irql);
|
||||
precvbuf->ref_cnt++;
|
||||
_exit_critical_bh(&precvbuf->recvbuf_lock, &irql);
|
||||
#endif //PLATFORM_WINDOWS
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -3079,14 +3079,6 @@ int tdls_verify_mic(u8 *kck, u8 trans_seq,
|
|||
}
|
||||
#endif //CONFIG_TDLS
|
||||
|
||||
#ifdef PLATFORM_WINDOWS
|
||||
void rtw_use_tkipkey_handler (
|
||||
IN PVOID SystemSpecific1,
|
||||
IN PVOID FunctionContext,
|
||||
IN PVOID SystemSpecific2,
|
||||
IN PVOID SystemSpecific3
|
||||
)
|
||||
#endif
|
||||
#ifdef PLATFORM_LINUX
|
||||
void rtw_use_tkipkey_handler(void *FunctionContext)
|
||||
#endif
|
||||
|
|
|
@ -27,12 +27,6 @@
|
|||
#include <mlme_osdep.h>
|
||||
|
||||
|
||||
#if defined (PLATFORM_LINUX) && defined (PLATFORM_WINDOWS)
|
||||
|
||||
#error "Shall be Linux or Windows, but not both!\n"
|
||||
|
||||
#endif
|
||||
|
||||
#include <sta_info.h>
|
||||
|
||||
void _rtw_init_stainfo(struct sta_info *psta);
|
||||
|
|
|
@ -28,14 +28,6 @@
|
|||
#include <circ_buf.h>
|
||||
#include <ip.h>
|
||||
|
||||
#if defined (PLATFORM_LINUX) && defined (PLATFORM_WINDOWS)
|
||||
#error "Shall be Linux or Windows, but not both!\n"
|
||||
#endif
|
||||
|
||||
#ifdef PLATFORM_WINDOWS
|
||||
#include <if_ether.h>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_USB_HCI
|
||||
#include <usb_ops.h>
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue