rtl8188eu: Remove the PLATFORM_LINUX tests

This configuration parameter is always selected.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2014-12-15 18:29:43 -06:00
parent dd606233f2
commit 62ef49de15
46 changed files with 6 additions and 870 deletions

View file

@ -1222,7 +1222,6 @@ Efuse_InitSomeVar(
_rtw_memset((PVOID)&fakeBTEfuseModifiedMap[0], 0xff, EFUSE_BT_MAX_MAP_LEN); _rtw_memset((PVOID)&fakeBTEfuseModifiedMap[0], 0xff, EFUSE_BT_MAX_MAP_LEN);
} }
#ifdef PLATFORM_LINUX
#ifdef CONFIG_ADAPTOR_INFO_CACHING_FILE #ifdef CONFIG_ADAPTOR_INFO_CACHING_FILE
//#include <rtw_eeprom.h> //#include <rtw_eeprom.h>
@ -1278,6 +1277,3 @@ int retriveAdaptorInfoFile(char *path, struct eeprom_priv * eeprom_priv)
return ret; return ret;
} }
#endif //CONFIG_ADAPTOR_INFO_CACHING_FILE #endif //CONFIG_ADAPTOR_INFO_CACHING_FILE
#endif //PLATFORM_LINUX

View file

@ -1538,9 +1538,7 @@ u8 *rtw_get_p2p_ie(u8 *in_ie, int in_len, u8 *p2p_ie, uint *p2p_ielen)
{ {
eid = in_ie[cnt]; eid = in_ie[cnt];
if ((in_len < 0) || (cnt > MAX_IE_SZ)) { if ((in_len < 0) || (cnt > MAX_IE_SZ)) {
#ifdef PLATFORM_LINUX
dump_stack(); dump_stack();
#endif
return NULL; return NULL;
} }
if( ( eid == _VENDOR_SPECIFIC_IE_ ) && ( _rtw_memcmp( &in_ie[cnt+2], p2p_oui, 4) == _TRUE ) ) if( ( eid == _VENDOR_SPECIFIC_IE_ ) && ( _rtw_memcmp( &in_ie[cnt+2], p2p_oui, 4) == _TRUE ) )

View file

@ -277,20 +277,13 @@ _func_enter_;
(check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)==_TRUE ) ) (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)==_TRUE ) )
lifetime = 1; lifetime = 1;
if(!isfreeall) if (!isfreeall) {
{
#ifdef PLATFORM_LINUX
delta_time = (curr_time -pnetwork->last_scanned)/HZ; delta_time = (curr_time -pnetwork->last_scanned)/HZ;
if (delta_time < lifetime)// unit:sec if (delta_time < lifetime)// unit:sec
{
goto exit; goto exit;
} }
#endif
}
_enter_critical_bh(&free_queue->lock, &irqL); _enter_critical_bh(&free_queue->lock, &irqL);
rtw_list_delete(&(pnetwork->list)); rtw_list_delete(&(pnetwork->list));

View file

@ -9930,7 +9930,6 @@ static void process_80211d(PADAPTER padapter, WLAN_BSSID_EX *bssid)
chplan_ap.Len = i; chplan_ap.Len = i;
#ifdef CONFIG_DEBUG_RTL871X #ifdef CONFIG_DEBUG_RTL871X
#ifdef PLATFORM_LINUX
i = 0; i = 0;
DBG_871X("%s: AP[%s] channel plan {", __func__, bssid->Ssid.Ssid); DBG_871X("%s: AP[%s] channel plan {", __func__, bssid->Ssid.Ssid);
while ((i < chplan_ap.Len) && (chplan_ap.Channel[i] != 0)) while ((i < chplan_ap.Len) && (chplan_ap.Channel[i] != 0))
@ -9939,12 +9938,10 @@ static void process_80211d(PADAPTER padapter, WLAN_BSSID_EX *bssid)
i++; i++;
} }
DBG_871X("}\n"); DBG_871X("}\n");
#endif
#endif #endif
_rtw_memcpy(chplan_sta, pmlmeext->channel_set, sizeof(chplan_sta)); _rtw_memcpy(chplan_sta, pmlmeext->channel_set, sizeof(chplan_sta));
#ifdef CONFIG_DEBUG_RTL871X #ifdef CONFIG_DEBUG_RTL871X
#ifdef PLATFORM_LINUX
i = 0; i = 0;
DBG_871X("%s: STA channel plan {", __func__); DBG_871X("%s: STA channel plan {", __func__);
while ((i < MAX_CHANNEL_NUM) && (chplan_sta[i].ChannelNum != 0)) while ((i < MAX_CHANNEL_NUM) && (chplan_sta[i].ChannelNum != 0))
@ -9953,7 +9950,6 @@ static void process_80211d(PADAPTER padapter, WLAN_BSSID_EX *bssid)
i++; i++;
} }
DBG_871X("}\n"); DBG_871X("}\n");
#endif
#endif #endif
_rtw_memset(pmlmeext->channel_set, 0, sizeof(pmlmeext->channel_set)); _rtw_memset(pmlmeext->channel_set, 0, sizeof(pmlmeext->channel_set));
@ -10106,7 +10102,6 @@ static void process_80211d(PADAPTER padapter, WLAN_BSSID_EX *bssid)
pmlmeext->update_channel_plan_by_ap_done = 1; pmlmeext->update_channel_plan_by_ap_done = 1;
#ifdef CONFIG_DEBUG_RTL871X #ifdef CONFIG_DEBUG_RTL871X
#ifdef PLATFORM_LINUX
k = 0; k = 0;
DBG_871X("%s: new STA channel plan {", __func__); DBG_871X("%s: new STA channel plan {", __func__);
while ((k < MAX_CHANNEL_NUM) && (chplan_new[k].ChannelNum != 0)) while ((k < MAX_CHANNEL_NUM) && (chplan_new[k].ChannelNum != 0))
@ -10115,24 +10110,6 @@ static void process_80211d(PADAPTER padapter, WLAN_BSSID_EX *bssid)
k++; k++;
} }
DBG_871X("}\n"); DBG_871X("}\n");
#endif
#endif
#if 0
// recover the right channel index
channel = chplan_sta[pmlmeext->sitesurvey_res.channel_idx].ChannelNum;
k = 0;
while ((k < MAX_CHANNEL_NUM) && (chplan_new[k].ChannelNum != 0))
{
if (chplan_new[k].ChannelNum == channel) {
RT_TRACE(_module_rtl871x_mlme_c_, _drv_notice_,
("%s: change mlme_ext sitesurvey channel index from %d to %d\n",
__FUNCTION__, pmlmeext->sitesurvey_res.channel_idx, k));
pmlmeext->sitesurvey_res.channel_idx = k;
break;
}
k++;
}
#endif #endif
} }

View file

@ -2881,11 +2881,9 @@ NDIS_STATUS oid_rt_set_power_down_hdl(struct oid_par_priv *poid_par_priv)
#endif #endif
u8 bpwrup; u8 bpwrup;
NDIS_STATUS status = NDIS_STATUS_SUCCESS; NDIS_STATUS status = NDIS_STATUS_SUCCESS;
#ifdef PLATFORM_LINUX
#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) #if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context); PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
#endif #endif
#endif
_func_enter_; _func_enter_;
@ -2901,10 +2899,8 @@ _func_enter_;
bpwrup = *(u8 *)poid_par_priv->information_buf; bpwrup = *(u8 *)poid_par_priv->information_buf;
//CALL the power_down function //CALL the power_down function
#ifdef PLATFORM_LINUX
#if defined(CONFIG_RTL8712) //Linux MP insmod unknown symbol #if defined(CONFIG_RTL8712) //Linux MP insmod unknown symbol
dev_power_down(padapter,bpwrup); dev_power_down(padapter,bpwrup);
#endif
#endif #endif
_irqlevel_changed_(&oldirql, RAISE); _irqlevel_changed_(&oldirql, RAISE);

View file

@ -1487,9 +1487,7 @@ _func_enter_;
#endif // CONFIG_LPS_RPWM_TIMER #endif // CONFIG_LPS_RPWM_TIMER
#endif // CONFIG_LPS_LCLK #endif // CONFIG_LPS_LCLK
#ifdef PLATFORM_LINUX
_init_timer(&(pwrctrlpriv->pwr_state_check_timer), padapter->pnetdev, pwr_state_check_handler, (u8 *)padapter); _init_timer(&(pwrctrlpriv->pwr_state_check_timer), padapter->pnetdev, pwr_state_check_handler, (u8 *)padapter);
#endif
#ifdef CONFIG_RESUME_IN_WORKQUEUE #ifdef CONFIG_RESUME_IN_WORKQUEUE
_init_workitem(&pwrctrlpriv->resume_work, resume_workitem_callback, NULL); _init_workitem(&pwrctrlpriv->resume_work, resume_workitem_callback, NULL);

View file

@ -128,9 +128,7 @@ _func_enter_;
res = rtw_hal_init_recv_priv(padapter); res = rtw_hal_init_recv_priv(padapter);
#ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS #ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS
#ifdef PLATFORM_LINUX
_init_timer(&precvpriv->signal_stat_timer, padapter->pnetdev, RTW_TIMER_HDL_NAME(signal_stat), padapter); _init_timer(&precvpriv->signal_stat_timer, padapter->pnetdev, RTW_TIMER_HDL_NAME(signal_stat), padapter);
#endif
precvpriv->signal_stat_sampling_interval = 1000; //ms precvpriv->signal_stat_sampling_interval = 1000; //ms
//precvpriv->signal_stat_converging_constant = 5000; //ms //precvpriv->signal_stat_converging_constant = 5000; //ms
@ -2542,7 +2540,6 @@ _func_exit_;
#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) #if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
#ifdef PLATFORM_LINUX
static void recvframe_expand_pkt( static void recvframe_expand_pkt(
PADAPTER padapter, PADAPTER padapter,
union recv_frame *prframe) union recv_frame *prframe)
@ -2591,9 +2588,6 @@ static void recvframe_expand_pkt(
pfhdr->rx_tail = skb_tail_pointer(ppkt); pfhdr->rx_tail = skb_tail_pointer(ppkt);
pfhdr->rx_end = skb_end_pointer(ppkt); pfhdr->rx_end = skb_end_pointer(ppkt);
} }
#else
#warning "recvframe_expand_pkt not implement, defrag may crash system"
#endif
#endif #endif
//perform defrag //perform defrag

View file

@ -3071,9 +3071,7 @@ int tdls_verify_mic(u8 *kck, u8 trans_seq,
} }
#endif //CONFIG_TDLS #endif //CONFIG_TDLS
#ifdef PLATFORM_LINUX
void rtw_use_tkipkey_handler(void *FunctionContext) void rtw_use_tkipkey_handler(void *FunctionContext)
#endif
{ {
_adapter *padapter = (_adapter *)FunctionContext; _adapter *padapter = (_adapter *)FunctionContext;

View file

@ -270,7 +270,7 @@ void sreset_stop_adapter(_adapter *padapter)
rtw_cancel_all_timer(padapter); rtw_cancel_all_timer(padapter);
/* TODO: OS and HCI independent */ /* TODO: OS and HCI independent */
#if defined(PLATFORM_LINUX) && defined(CONFIG_USB_HCI) #if defined(CONFIG_USB_HCI)
tasklet_kill(&pxmitpriv->xmit_tasklet); tasklet_kill(&pxmitpriv->xmit_tasklet);
#endif #endif
@ -300,7 +300,7 @@ void sreset_start_adapter(_adapter *padapter)
} }
/* TODO: OS and HCI independent */ /* TODO: OS and HCI independent */
#if defined(PLATFORM_LINUX) && defined(CONFIG_USB_HCI) #if defined(CONFIG_USB_HCI)
tasklet_hi_schedule(&pxmitpriv->xmit_tasklet); tasklet_hi_schedule(&pxmitpriv->xmit_tasklet);
#endif #endif

View file

@ -2542,9 +2542,7 @@ struct xmit_frame *rtw_alloc_xmitframe(struct xmit_priv *pxmitpriv)//(_queue *pf
struct xmit_frame *pxframe = NULL; struct xmit_frame *pxframe = NULL;
_list *plist, *phead; _list *plist, *phead;
_queue *pfree_xmit_queue = &pxmitpriv->free_xmit_queue; _queue *pfree_xmit_queue = &pxmitpriv->free_xmit_queue;
#ifdef PLATFORM_LINUX
_adapter *padapter = pxmitpriv->adapter; _adapter *padapter = pxmitpriv->adapter;
#endif //PLATFORM_LINUX
_func_enter_; _func_enter_;
@ -4243,9 +4241,7 @@ void rtw_sctx_init(struct submit_ctx *sctx, int timeout_ms)
{ {
sctx->timeout_ms = timeout_ms; sctx->timeout_ms = timeout_ms;
sctx->submit_time= rtw_get_current_time(); sctx->submit_time= rtw_get_current_time();
#ifdef PLATFORM_LINUX /* TODO: add condition wating interface for other os */
init_completion(&sctx->done); init_completion(&sctx->done);
#endif
sctx->status = RTW_SCTX_SUBMITTED; sctx->status = RTW_SCTX_SUBMITTED;
} }
@ -4255,7 +4251,6 @@ int rtw_sctx_wait(struct submit_ctx *sctx)
unsigned long expire; unsigned long expire;
int status = 0; int status = 0;
#ifdef PLATFORM_LINUX
expire= sctx->timeout_ms ? msecs_to_jiffies(sctx->timeout_ms) : MAX_SCHEDULE_TIMEOUT; expire= sctx->timeout_ms ? msecs_to_jiffies(sctx->timeout_ms) : MAX_SCHEDULE_TIMEOUT;
if (!wait_for_completion_timeout(&sctx->done, expire)) { if (!wait_for_completion_timeout(&sctx->done, expire)) {
/* timeout, do something?? */ /* timeout, do something?? */
@ -4264,7 +4259,6 @@ int rtw_sctx_wait(struct submit_ctx *sctx)
} else { } else {
status = sctx->status; status = sctx->status;
} }
#endif
if (status == RTW_SCTX_DONE_SUCCESS) { if (status == RTW_SCTX_DONE_SUCCESS) {
ret = _SUCCESS; ret = _SUCCESS;
@ -4294,9 +4288,7 @@ void rtw_sctx_done_err(struct submit_ctx **sctx, int status)
if (rtw_sctx_chk_waring_status(status)) if (rtw_sctx_chk_waring_status(status))
DBG_871X("%s status:%d\n", __func__, status); DBG_871X("%s status:%d\n", __func__, status);
(*sctx)->status = status; (*sctx)->status = status;
#ifdef PLATFORM_LINUX
complete(&((*sctx)->done)); complete(&((*sctx)->done));
#endif
*sctx = NULL; *sctx = NULL;
} }
} }

View file

@ -8956,14 +8956,9 @@ GetPSDData(
//Read PSD report, Reg8B4[15:0] //Read PSD report, Reg8B4[15:0]
psd_report = ODM_GetBBReg(pDM_Odm,0x8B4, bMaskDWord) & 0x0000FFFF; psd_report = ODM_GetBBReg(pDM_Odm,0x8B4, bMaskDWord) & 0x0000FFFF;
#if 1//(DEV_BUS_TYPE == RT_PCI_INTERFACE) && ( (RT_PLATFORM == PLATFORM_LINUX) || (RT_PLATFORM == PLATFORM_MACOSX))
psd_report = (u4Byte) (ConvertTo_dB(psd_report))+(u4Byte)(initial_gain_psd-0x1c); psd_report = (u4Byte) (ConvertTo_dB(psd_report))+(u4Byte)(initial_gain_psd-0x1c);
#else
psd_report = (int) (20*log10((double)psd_report))+(int)(initial_gain_psd-0x1c);
#endif
return psd_report; return psd_report;
} }
u4Byte u4Byte

View file

@ -1109,9 +1109,6 @@ typedef enum _ANT_DIV_TYPE
// 2011/09/22 MH Copy from SD4 defined structure. We use to support PHY DM integration. // 2011/09/22 MH Copy from SD4 defined structure. We use to support PHY DM integration.
// //
#if(DM_ODM_SUPPORT_TYPE & ODM_MP) #if(DM_ODM_SUPPORT_TYPE & ODM_MP)
#if (RT_PLATFORM != PLATFORM_LINUX)
typedef
#endif
struct DM_Out_Source_Dynamic_Mechanism_Structure struct DM_Out_Source_Dynamic_Mechanism_Structure
#else// for AP,ADSL,CE Team #else// for AP,ADSL,CE Team
typedef struct DM_Out_Source_Dynamic_Mechanism_Structure typedef struct DM_Out_Source_Dynamic_Mechanism_Structure
@ -1414,11 +1411,7 @@ typedef struct DM_Out_Source_Dynamic_Mechanism_Structure
#if(DM_ODM_SUPPORT_TYPE & ODM_MP) #if(DM_ODM_SUPPORT_TYPE & ODM_MP)
#if (RT_PLATFORM != PLATFORM_LINUX)
} DM_ODM_T, *PDM_ODM_T; // DM_Dynamic_Mechanism_Structure
#else
}; };
#endif
#else// for AP,ADSL,CE Team #else// for AP,ADSL,CE Team
} DM_ODM_T, *PDM_ODM_T; // DM_Dynamic_Mechanism_Structure } DM_ODM_T, *PDM_ODM_T; // DM_Dynamic_Mechanism_Structure

View file

@ -149,10 +149,7 @@ static void dm_CheckPbcGPIO(_adapter *padapter)
{ // 0 is the default value and it means the application monitors the HW PBC doesn't privde its pid to driver. { // 0 is the default value and it means the application monitors the HW PBC doesn't privde its pid to driver.
return; return;
} }
#ifdef PLATFORM_LINUX
rtw_signal_process(padapter->pid[0], SIGUSR1); rtw_signal_process(padapter->pid[0], SIGUSR1);
#endif
#endif #endif
} }
} }

View file

@ -125,12 +125,9 @@ s32 rtl8188es_init_recv_priv(PADAPTER padapter)
goto initbuferror; goto initbuferror;
//3 2. init tasklet //3 2. init tasklet
#ifdef PLATFORM_LINUX
tasklet_init(&precvpriv->recv_tasklet, tasklet_init(&precvpriv->recv_tasklet,
(void(*)(unsigned long))rtl8188es_recv_tasklet, (void(*)(unsigned long))rtl8188es_recv_tasklet,
(unsigned long)padapter); (unsigned long)padapter);
#endif
goto exit; goto exit;
initbuferror: initbuferror:
@ -174,9 +171,7 @@ void rtl8188es_free_recv_priv(PADAPTER padapter)
precvpriv = &padapter->recvpriv; precvpriv = &padapter->recvpriv;
//3 1. kill tasklet //3 1. kill tasklet
#ifdef PLATFORM_LINUX
tasklet_kill(&precvpriv->recv_tasklet); tasklet_kill(&precvpriv->recv_tasklet);
#endif
//3 2. free all recv buffers //3 2. free all recv buffers
precvbuf = (struct recv_buf*)precvpriv->precv_buf; precvbuf = (struct recv_buf*)precvpriv->precv_buf;
@ -347,9 +342,7 @@ static void rtl8188es_recv_tasklet(void *priv)
// The case of can't allocte recvframe should be temporary, // The case of can't allocte recvframe should be temporary,
// schedule again and hope recvframe is available next time. // schedule again and hope recvframe is available next time.
#ifdef PLATFORM_LINUX
tasklet_schedule(&precvpriv->recv_tasklet); tasklet_schedule(&precvpriv->recv_tasklet);
#endif
return; return;
} }
@ -599,9 +592,7 @@ static s32 pre_recv_entry(union recv_frame *precvframe, struct recv_buf *precvbu
// The case of can't allocte skb is serious and may never be recovered, // The case of can't allocte skb is serious and may never be recovered,
// once bDriverStopped is enable, this task should be stopped. // once bDriverStopped is enable, this task should be stopped.
if (secondary_padapter->bDriverStopped == _FALSE) if (secondary_padapter->bDriverStopped == _FALSE)
#ifdef PLATFORM_LINUX
tasklet_schedule(&precvpriv->recv_tasklet); tasklet_schedule(&precvpriv->recv_tasklet);
#endif
return ret; return ret;
} }
pkt_copy->dev = secondary_padapter->pnetdev; pkt_copy->dev = secondary_padapter->pnetdev;
@ -690,9 +681,7 @@ static void rtl8188es_recv_tasklet(void *priv)
// The case of can't allocte recvframe should be temporary, // The case of can't allocte recvframe should be temporary,
// schedule again and hope recvframe is available next time. // schedule again and hope recvframe is available next time.
#ifdef PLATFORM_LINUX
tasklet_schedule(&precvpriv->recv_tasklet); tasklet_schedule(&precvpriv->recv_tasklet);
#endif
return; return;
} }
@ -738,9 +727,7 @@ static void rtl8188es_recv_tasklet(void *priv)
// The case of can't allocte skb is serious and may never be recovered, // The case of can't allocte skb is serious and may never be recovered,
// once bDriverStopped is enable, this task should be stopped. // once bDriverStopped is enable, this task should be stopped.
if (padapter->bDriverStopped == _FALSE) { if (padapter->bDriverStopped == _FALSE) {
#ifdef PLATFORM_LINUX
tasklet_schedule(&precvpriv->recv_tasklet); tasklet_schedule(&precvpriv->recv_tasklet);
#endif
} }
return; return;

View file

@ -1672,11 +1672,9 @@ s32 rtl8188es_init_xmit_priv(PADAPTER padapter)
struct xmit_priv *pxmitpriv = &padapter->xmitpriv; struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
#ifdef CONFIG_SDIO_TX_TASKLET #ifdef CONFIG_SDIO_TX_TASKLET
#ifdef PLATFORM_LINUX
tasklet_init(&pxmitpriv->xmit_tasklet, tasklet_init(&pxmitpriv->xmit_tasklet,
(void(*)(unsigned long))rtl8188es_xmit_tasklet, (void(*)(unsigned long))rtl8188es_xmit_tasklet,
(unsigned long)padapter); (unsigned long)padapter);
#endif
#else //CONFIG_SDIO_TX_TASKLET #else //CONFIG_SDIO_TX_TASKLET
_rtw_init_sema(&pxmitpriv->SdioXmitSema, 0); _rtw_init_sema(&pxmitpriv->SdioXmitSema, 0);

View file

@ -1583,9 +1583,7 @@ static void sd_rxhandler(PADAPTER padapter, struct recv_buf *precvbuf)
rtw_enqueue_recvbuf(precvbuf, ppending_queue); rtw_enqueue_recvbuf(precvbuf, ppending_queue);
//3 2. schedule tasklet //3 2. schedule tasklet
#ifdef PLATFORM_LINUX
tasklet_schedule(&precvpriv->recv_tasklet); tasklet_schedule(&precvpriv->recv_tasklet);
#endif
} }
void sd_int_dpc(PADAPTER padapter) void sd_int_dpc(PADAPTER padapter)

View file

@ -63,21 +63,17 @@ int rtl8188eu_init_recv_priv(_adapter *padapter)
_rtw_init_sema(&precvpriv->terminate_recvthread_sema, 0);//will be removed _rtw_init_sema(&precvpriv->terminate_recvthread_sema, 0);//will be removed
#endif #endif
#ifdef PLATFORM_LINUX
tasklet_init(&precvpriv->recv_tasklet, tasklet_init(&precvpriv->recv_tasklet,
(void(*)(unsigned long))rtl8188eu_recv_tasklet, (void(*)(unsigned long))rtl8188eu_recv_tasklet,
(unsigned long)padapter); (unsigned long)padapter);
#endif
#ifdef CONFIG_USB_INTERRUPT_IN_PIPE #ifdef CONFIG_USB_INTERRUPT_IN_PIPE
#ifdef PLATFORM_LINUX
precvpriv->int_in_urb = usb_alloc_urb(0, GFP_KERNEL); precvpriv->int_in_urb = usb_alloc_urb(0, GFP_KERNEL);
if(precvpriv->int_in_urb == NULL){ if(precvpriv->int_in_urb == NULL){
res= _FAIL; res= _FAIL;
DBG_8192C("alloc_urb for interrupt in endpoint fail !!!!\n"); DBG_8192C("alloc_urb for interrupt in endpoint fail !!!!\n");
goto exit; goto exit;
} }
#endif
precvpriv->int_in_buf = rtw_zmalloc(INTERRUPT_MSG_FORMAT_LEN); precvpriv->int_in_buf = rtw_zmalloc(INTERRUPT_MSG_FORMAT_LEN);
if(precvpriv->int_in_buf == NULL){ if(precvpriv->int_in_buf == NULL){
res= _FAIL; res= _FAIL;
@ -132,7 +128,6 @@ int rtl8188eu_init_recv_priv(_adapter *padapter)
precvpriv->free_recv_buf_queue_cnt = NR_RECVBUFF; precvpriv->free_recv_buf_queue_cnt = NR_RECVBUFF;
#ifdef PLATFORM_LINUX
skb_queue_head_init(&precvpriv->rx_skb_queue); skb_queue_head_init(&precvpriv->rx_skb_queue);
@ -166,12 +161,9 @@ int rtl8188eu_init_recv_priv(_adapter *padapter)
} }
#endif #endif
#endif
exit: exit:
return res; return res;
} }
void rtl8188eu_free_recv_priv (_adapter *padapter) void rtl8188eu_free_recv_priv (_adapter *padapter)
@ -192,19 +184,13 @@ void rtl8188eu_free_recv_priv (_adapter *padapter)
rtw_mfree(precvpriv->pallocated_recv_buf, NR_RECVBUFF *sizeof(struct recv_buf) + 4); rtw_mfree(precvpriv->pallocated_recv_buf, NR_RECVBUFF *sizeof(struct recv_buf) + 4);
#ifdef CONFIG_USB_INTERRUPT_IN_PIPE #ifdef CONFIG_USB_INTERRUPT_IN_PIPE
#ifdef PLATFORM_LINUX
if(precvpriv->int_in_urb) if(precvpriv->int_in_urb)
{
usb_free_urb(precvpriv->int_in_urb); usb_free_urb(precvpriv->int_in_urb);
}
#endif//PLATFORM_LINUX
if(precvpriv->int_in_buf) if(precvpriv->int_in_buf)
rtw_mfree(precvpriv->int_in_buf, INTERRUPT_MSG_FORMAT_LEN); rtw_mfree(precvpriv->int_in_buf, INTERRUPT_MSG_FORMAT_LEN);
#endif//CONFIG_USB_INTERRUPT_IN_PIPE #endif//CONFIG_USB_INTERRUPT_IN_PIPE
#ifdef PLATFORM_LINUX
if (skb_queue_len(&precvpriv->rx_skb_queue)) { if (skb_queue_len(&precvpriv->rx_skb_queue)) {
DBG_8192C(KERN_WARNING "rx_skb_queue not empty\n"); DBG_8192C(KERN_WARNING "rx_skb_queue not empty\n");
} }
@ -221,8 +207,6 @@ void rtl8188eu_free_recv_priv (_adapter *padapter)
#endif #endif
#endif
} }

View file

@ -33,11 +33,9 @@ s32 rtl8188eu_init_xmit_priv(_adapter *padapter)
struct xmit_priv *pxmitpriv = &padapter->xmitpriv; struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
#ifdef PLATFORM_LINUX
tasklet_init(&pxmitpriv->xmit_tasklet, tasklet_init(&pxmitpriv->xmit_tasklet,
(void(*)(unsigned long))rtl8188eu_xmit_tasklet, (void(*)(unsigned long))rtl8188eu_xmit_tasklet,
(unsigned long)padapter); (unsigned long)padapter);
#endif
#ifdef CONFIG_TX_EARLY_MODE #ifdef CONFIG_TX_EARLY_MODE
pHalData->bEarlyModeEnable = padapter->registrypriv.early_mode; pHalData->bEarlyModeEnable = padapter->registrypriv.early_mode;
#endif #endif
@ -51,33 +49,11 @@ void rtl8188eu_free_xmit_priv(_adapter *padapter)
u8 urb_zero_packet_chk(_adapter *padapter, int sz) u8 urb_zero_packet_chk(_adapter *padapter, int sz)
{ {
#if 1
u8 blnSetTxDescOffset; u8 blnSetTxDescOffset;
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
blnSetTxDescOffset = (((sz + TXDESC_SIZE) % pHalData->UsbBulkOutSize) ==0)?1:0; blnSetTxDescOffset = (((sz + TXDESC_SIZE) % pHalData->UsbBulkOutSize) ==0)?1:0;
#else
struct dvobj_priv *pdvobj = adapter_to_dvobj(padapter);
if ( pdvobj->ishighspeed )
{
if ( ( (sz + TXDESC_SIZE) % 512 ) == 0 ) {
blnSetTxDescOffset = 1;
} else {
blnSetTxDescOffset = 0;
}
}
else
{
if ( ( (sz + TXDESC_SIZE) % 64 ) == 0 ) {
blnSetTxDescOffset = 1;
} else {
blnSetTxDescOffset = 0;
}
}
#endif
return blnSetTxDescOffset; return blnSetTxDescOffset;
} }
void rtl8188eu_cal_txdesc_chksum(struct tx_desc *ptxdesc) void rtl8188eu_cal_txdesc_chksum(struct tx_desc *ptxdesc)
@ -1215,9 +1191,7 @@ s32 rtl8188eu_hal_xmitframe_enqueue(_adapter *padapter, struct xmit_frame *pxmit
} }
else else
{ {
#ifdef PLATFORM_LINUX
tasklet_hi_schedule(&pxmitpriv->xmit_tasklet); tasklet_hi_schedule(&pxmitpriv->xmit_tasklet);
#endif
} }
return err; return err;
@ -1229,18 +1203,15 @@ s32 rtl8188eu_hal_xmitframe_enqueue(_adapter *padapter, struct xmit_frame *pxmit
static void rtl8188eu_hostap_mgnt_xmit_cb(struct urb *urb) static void rtl8188eu_hostap_mgnt_xmit_cb(struct urb *urb)
{ {
#ifdef PLATFORM_LINUX
struct sk_buff *skb = (struct sk_buff *)urb->context; struct sk_buff *skb = (struct sk_buff *)urb->context;
//DBG_8192C("%s\n", __FUNCTION__); //DBG_8192C("%s\n", __FUNCTION__);
rtw_skb_free(skb); rtw_skb_free(skb);
#endif
} }
s32 rtl8188eu_hostap_mgnt_xmit_entry(_adapter *padapter, _pkt *pkt) s32 rtl8188eu_hostap_mgnt_xmit_entry(_adapter *padapter, _pkt *pkt)
{ {
#ifdef PLATFORM_LINUX
u16 fc; u16 fc;
int rc, len, pipe; int rc, len, pipe;
unsigned int bmcst, tid, qsel; unsigned int bmcst, tid, qsel;
@ -1349,9 +1320,6 @@ s32 rtl8188eu_hostap_mgnt_xmit_entry(_adapter *padapter, _pkt *pkt)
_exit: _exit:
rtw_skb_free(skb); rtw_skb_free(skb);
#endif
return 0; return 0;
} }

View file

@ -1068,88 +1068,6 @@ USB_AggModeSwitch(
IN PADAPTER Adapter IN PADAPTER Adapter
) )
{ {
#if 0
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter);
PMGNT_INFO pMgntInfo = &(Adapter->MgntInfo);
//pHalData->UsbRxHighSpeedMode = FALSE;
// How to measure the RX speed? We assume that when traffic is more than
if (pMgntInfo->bRegAggDMEnable == FALSE)
{
return; // Inf not support.
}
if (pMgntInfo->LinkDetectInfo.bHigherBusyRxTraffic == TRUE &&
pHalData->UsbRxHighSpeedMode == FALSE)
{
pHalData->UsbRxHighSpeedMode = TRUE;
RT_TRACE(COMP_INIT, DBG_LOUD, ("UsbAggModeSwitchCheck to HIGH\n"));
}
else if (pMgntInfo->LinkDetectInfo.bHigherBusyRxTraffic == FALSE &&
pHalData->UsbRxHighSpeedMode == TRUE)
{
pHalData->UsbRxHighSpeedMode = FALSE;
RT_TRACE(COMP_INIT, DBG_LOUD, ("UsbAggModeSwitchCheck to LOW\n"));
}
else
{
return;
}
#if USB_RX_AGGREGATION_92C
if (pHalData->UsbRxHighSpeedMode == TRUE)
{
// 2010/12/10 MH The parameter is tested by SD1 engineer and SD3 channel emulator.
// USB mode
#if (RT_PLATFORM == PLATFORM_LINUX)
if (pMgntInfo->LinkDetectInfo.bTxBusyTraffic)
{
pHalData->RxAggBlockCount = 16;
pHalData->RxAggBlockTimeout = 7;
}
else
#endif
{
pHalData->RxAggBlockCount = 40;
pHalData->RxAggBlockTimeout = 5;
}
// Mix mode
pHalData->RxAggPageCount = 72;
pHalData->RxAggPageTimeout = 6;
}
else
{
// USB mode
pHalData->RxAggBlockCount = pMgntInfo->RegRxAggBlockCount;
pHalData->RxAggBlockTimeout = pMgntInfo->RegRxAggBlockTimeout;
// Mix mode
pHalData->RxAggPageCount = pMgntInfo->RegRxAggPageCount;
pHalData->RxAggPageTimeout = pMgntInfo->RegRxAggPageTimeout;
}
if (pHalData->RxAggBlockCount > MAX_RX_AGG_BLKCNT)
pHalData->RxAggBlockCount = MAX_RX_AGG_BLKCNT;
#if (OS_WIN_FROM_VISTA(OS_VERSION)) || (RT_PLATFORM == PLATFORM_LINUX) // do not support WINXP to prevent usbehci.sys BSOD
if (IS_WIRELESS_MODE_N_24G(Adapter) || IS_WIRELESS_MODE_N_5G(Adapter))
{
//
// 2010/12/24 MH According to V1012 QC IOT test, XP BSOD happen when running chariot test
// with the aggregation dynamic change!! We need to disable the function to prevent it is broken
// in usbehci.sys.
//
usb_AggSettingRxUpdate_8188E(Adapter);
// 2010/12/27 MH According to designer's suggstion, we can only modify Timeout value. Otheriwse
// there might many HW incorrect behavior, the XP BSOD at usbehci.sys may be relative to the
// issue. Base on the newest test, we can not enable block cnt > 30, otherwise XP usbehci.sys may
// BSOD.
}
#endif
#endif
#endif
} // USB_AggModeSwitch } // USB_AggModeSwitch
static VOID static VOID
@ -1157,68 +1075,6 @@ _InitOperationMode(
IN PADAPTER Adapter IN PADAPTER Adapter
) )
{ {
#if 0//gtest
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(Adapter);
u1Byte regBwOpMode = 0;
u4Byte regRATR = 0, regRRSR = 0;
//1 This part need to modified according to the rate set we filtered!!
//
// Set RRSR, RATR, and REG_BWOPMODE registers
//
switch(Adapter->RegWirelessMode)
{
case WIRELESS_MODE_B:
regBwOpMode = BW_OPMODE_20MHZ;
regRATR = RATE_ALL_CCK;
regRRSR = RATE_ALL_CCK;
break;
case WIRELESS_MODE_A:
regBwOpMode = BW_OPMODE_5G |BW_OPMODE_20MHZ;
regRATR = RATE_ALL_OFDM_AG;
regRRSR = RATE_ALL_OFDM_AG;
break;
case WIRELESS_MODE_G:
regBwOpMode = BW_OPMODE_20MHZ;
regRATR = RATE_ALL_CCK | RATE_ALL_OFDM_AG;
regRRSR = RATE_ALL_CCK | RATE_ALL_OFDM_AG;
break;
case WIRELESS_MODE_AUTO:
if (Adapter->bInHctTest)
{
regBwOpMode = BW_OPMODE_20MHZ;
regRATR = RATE_ALL_CCK | RATE_ALL_OFDM_AG;
regRRSR = RATE_ALL_CCK | RATE_ALL_OFDM_AG;
}
else
{
regBwOpMode = BW_OPMODE_20MHZ;
regRATR = RATE_ALL_CCK | RATE_ALL_OFDM_AG | RATE_ALL_OFDM_1SS | RATE_ALL_OFDM_2SS;
regRRSR = RATE_ALL_CCK | RATE_ALL_OFDM_AG;
}
break;
case WIRELESS_MODE_N_24G:
// It support CCK rate by default.
// CCK rate will be filtered out only when associated AP does not support it.
regBwOpMode = BW_OPMODE_20MHZ;
regRATR = RATE_ALL_CCK | RATE_ALL_OFDM_AG | RATE_ALL_OFDM_1SS | RATE_ALL_OFDM_2SS;
regRRSR = RATE_ALL_CCK | RATE_ALL_OFDM_AG;
break;
case WIRELESS_MODE_N_5G:
regBwOpMode = BW_OPMODE_5G;
regRATR = RATE_ALL_OFDM_AG | RATE_ALL_OFDM_1SS | RATE_ALL_OFDM_2SS;
regRRSR = RATE_ALL_OFDM_AG;
break;
default: //for MacOSX compiler warning.
break;
}
// Ziv ????????
//PlatformEFIOWrite4Byte(Adapter, REG_INIRTS_RATE_SEL, regRRSR);
PlatformEFIOWrite1Byte(Adapter, REG_BWOPMODE, regBwOpMode);
#endif
} }

View file

@ -39,11 +39,6 @@
#define CONFIG_RTL8188E #define CONFIG_RTL8188E
#define PLATFORM_LINUX
//#define CONFIG_IOCTL_CFG80211
//#define CONFIG_IEEE80211W
#if defined(CONFIG_PLATFORM_ACTIONS_ATM702X) #if defined(CONFIG_PLATFORM_ACTIONS_ATM702X)
#ifndef CONFIG_IOCTL_CFG80211 #ifndef CONFIG_IOCTL_CFG80211
#define CONFIG_IOCTL_CFG80211 #define CONFIG_IOCTL_CFG80211

View file

@ -38,8 +38,6 @@
#define _FALSE FALSE #define _FALSE FALSE
#endif #endif
#ifdef PLATFORM_LINUX
#include <linux/types.h> #include <linux/types.h>
#define IN #define IN
#define OUT #define OUT
@ -65,8 +63,6 @@
typedef __kernel_ssize_t SSIZE_T; typedef __kernel_ssize_t SSIZE_T;
#define FIELD_OFFSET(s,field) ((SSIZE_T)&((s*)(0))->field) #define FIELD_OFFSET(s,field) ((SSIZE_T)&((s*)(0))->field)
#endif
#define MEM_ALIGNMENT_OFFSET (sizeof (SIZE_T)) #define MEM_ALIGNMENT_OFFSET (sizeof (SIZE_T))
#define MEM_ALIGNMENT_PADDING (sizeof(SIZE_T) - 1) #define MEM_ALIGNMENT_PADDING (sizeof(SIZE_T) - 1)

View file

@ -161,13 +161,8 @@
* Do the prototypes. Somebody might want to take the * Do the prototypes. Somebody might want to take the
* address or some such sick thing.. * address or some such sick thing..
*/ */
#if defined(PLATFORM_LINUX) || (defined (__GLIBC__) && __GLIBC__ >= 2)
extern __u32 ntohl(__u32); extern __u32 ntohl(__u32);
extern __u32 htonl(__u32); extern __u32 htonl(__u32);
#else //defined(PLATFORM_LINUX) || (defined (__GLIBC__) && __GLIBC__ >= 2)
extern unsigned long int ntohl(unsigned long int);
extern unsigned long int htonl(unsigned long int);
#endif
extern unsigned short int ntohs(unsigned short int); extern unsigned short int ntohs(unsigned short int);
extern unsigned short int htons(unsigned short int); extern unsigned short int htons(unsigned short int);
@ -178,13 +173,8 @@ extern unsigned short int htons(unsigned short int);
#define ___ntohl(x) __be32_to_cpu(x) #define ___ntohl(x) __be32_to_cpu(x)
#define ___ntohs(x) __be16_to_cpu(x) #define ___ntohs(x) __be16_to_cpu(x)
#if defined(PLATFORM_LINUX) || (defined (__GLIBC__) && __GLIBC__ >= 2)
#define htonl(x) ___htonl(x) #define htonl(x) ___htonl(x)
#define ntohl(x) ___ntohl(x) #define ntohl(x) ___ntohl(x)
#else
#define htonl(x) ((unsigned long)___htonl(x))
#define ntohl(x) ((unsigned long)___ntohl(x))
#endif
#define htons(x) ___htons(x) #define htons(x) ___htons(x)
#define ntohs(x) ___ntohs(x) #define ntohs(x) ___ntohs(x)

View file

@ -144,14 +144,12 @@ __inline static__ void __swahb32s(__u32 *addr)
*/ */
#endif /* __BYTEORDER_HAS_U64__ */ #endif /* __BYTEORDER_HAS_U64__ */
#if defined(PLATFORM_LINUX)
#define swahw32 __swahw32 #define swahw32 __swahw32
#define swahb32 __swahb32 #define swahb32 __swahb32
#define swahw32p __swahw32p #define swahw32p __swahw32p
#define swahb32p __swahb32p #define swahb32p __swahb32p
#define swahw32s __swahw32s #define swahw32s __swahw32s
#define swahb32s __swahb32s #define swahb32s __swahb32s
#endif
#endif /* _LINUX_BYTEORDER_SWABB_H */ #endif /* _LINUX_BYTEORDER_SWABB_H */

View file

@ -12,9 +12,7 @@
#include <drv_types_ce.h> #include <drv_types_ce.h>
#endif #endif
#ifdef PLATFORM_LINUX
#include <drv_types_linux.h> #include <drv_types_linux.h>
#endif
typedef enum cust_gpio_modes { typedef enum cust_gpio_modes {
WLAN_PWDN_ON, WLAN_PWDN_ON,

View file

@ -31,18 +31,7 @@
#include <osdep_service.h> #include <osdep_service.h>
#include <wlan_bssdef.h> #include <wlan_bssdef.h>
#ifdef PLATFORM_OS_XP
#include <drv_types_xp.h>
#endif
#ifdef PLATFORM_OS_CE
#include <drv_types_ce.h>
#endif
#ifdef PLATFORM_LINUX
#include <drv_types_linux.h> #include <drv_types_linux.h>
#endif
enum _NIC_VERSION { enum _NIC_VERSION {
@ -323,10 +312,8 @@ struct dvobj_priv
u8 * usb_vendor_req_buf; u8 * usb_vendor_req_buf;
#endif #endif
#ifdef PLATFORM_LINUX
struct usb_interface *pusbintf; struct usb_interface *pusbintf;
struct usb_device *pusbdev; struct usb_device *pusbdev;
#endif//PLATFORM_LINUX
#endif//CONFIG_USB_HCI #endif//CONFIG_USB_HCI
@ -335,7 +322,6 @@ struct dvobj_priv
#ifdef CONFIG_PCI_HCI #ifdef CONFIG_PCI_HCI
#ifdef PLATFORM_LINUX
struct pci_dev *ppcidev; struct pci_dev *ppcidev;
//PCI MEM map //PCI MEM map
@ -365,7 +351,6 @@ struct dvobj_priv
u8 b_support_aspm; // If it supports ASPM, Offset[560h] = 0x40, otherwise Offset[560h] = 0x00. u8 b_support_aspm; // If it supports ASPM, Offset[560h] = 0x40, otherwise Offset[560h] = 0x00.
u8 b_support_backdoor; u8 b_support_backdoor;
u8 bdma64; u8 bdma64;
#endif//PLATFORM_LINUX
#endif//CONFIG_PCI_HCI #endif//CONFIG_PCI_HCI
}; };
@ -373,12 +358,9 @@ struct dvobj_priv
#define dvobj_to_pwrctl(dvobj) (&(dvobj->pwrctl_priv)) #define dvobj_to_pwrctl(dvobj) (&(dvobj->pwrctl_priv))
#define pwrctl_to_dvobj(pwrctl) container_of(pwrctl, struct dvobj_priv, pwrctl_priv) #define pwrctl_to_dvobj(pwrctl) container_of(pwrctl, struct dvobj_priv, pwrctl_priv)
#ifdef PLATFORM_LINUX
static struct device *dvobj_to_dev(struct dvobj_priv *dvobj) static struct device *dvobj_to_dev(struct dvobj_priv *dvobj)
{ {
/* todo: get interface type from dvobj and the return the dev accordingly */ /* todo: get interface type from dvobj and the return the dev accordingly */
#ifdef RTW_DVOBJ_CHIP_HW_TYPE
#endif
#ifdef CONFIG_USB_HCI #ifdef CONFIG_USB_HCI
return &dvobj->pusbintf->dev; return &dvobj->pusbintf->dev;
@ -393,7 +375,6 @@ static struct device *dvobj_to_dev(struct dvobj_priv *dvobj)
return &dvobj->ppcidev->dev; return &dvobj->ppcidev->dev;
#endif #endif
} }
#endif
enum _IFACE_TYPE { enum _IFACE_TYPE {
IFACE_PORT0, //mapping to port0 for C/D series chips IFACE_PORT0, //mapping to port0 for C/D series chips
@ -525,15 +506,9 @@ struct _ADAPTER{
_thread_hdl_ xmitThread; _thread_hdl_ xmitThread;
_thread_hdl_ recvThread; _thread_hdl_ recvThread;
#ifndef PLATFORM_LINUX
NDIS_STATUS (*dvobj_init)(struct dvobj_priv *dvobj);
void (*dvobj_deinit)(struct dvobj_priv *dvobj);
#endif
void (*intf_start)(_adapter * adapter); void (*intf_start)(_adapter * adapter);
void (*intf_stop)(_adapter * adapter); void (*intf_stop)(_adapter * adapter);
#ifdef PLATFORM_LINUX
_nic_hdl pnetdev; _nic_hdl pnetdev;
// used by rtw_rereg_nd_name related function // used by rtw_rereg_nd_name related function
@ -554,8 +529,6 @@ struct _ADAPTER{
struct wireless_dev *rtw_wdev; struct wireless_dev *rtw_wdev;
#endif //CONFIG_IOCTL_CFG80211 #endif //CONFIG_IOCTL_CFG80211
#endif //end of PLATFORM_LINUX
int net_closed; int net_closed;
u8 bFWReady; u8 bFWReady;

View file

@ -24,9 +24,7 @@
#include <basic_types.h> #include <basic_types.h>
// SPI Header Files // SPI Header Files
#ifdef PLATFORM_LINUX
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#endif
typedef struct gspi_data typedef struct gspi_data
@ -37,12 +35,10 @@ typedef struct gspi_data
u8 rx_block_mode; u8 rx_block_mode;
u32 block_transfer_len; u32 block_transfer_len;
#ifdef PLATFORM_LINUX
struct spi_device *func; struct spi_device *func;
struct workqueue_struct *priv_wq; struct workqueue_struct *priv_wq;
struct delayed_work irq_work; struct delayed_work irq_work;
#endif
} GSPI_DATA, *PGSPI_DATA; } GSPI_DATA, *PGSPI_DATA;
#endif // #ifndef __DRV_TYPES_GSPI_H__ #endif // #ifndef __DRV_TYPES_GSPI_H__

View file

@ -24,17 +24,7 @@
#include <basic_types.h> #include <basic_types.h>
// SDIO Header Files // SDIO Header Files
#ifdef PLATFORM_LINUX
#include <linux/mmc/sdio_func.h> #include <linux/mmc/sdio_func.h>
#endif
#ifdef PLATFORM_OS_XP
#include <wdm.h>
#include <ntddsd.h>
#endif
#ifdef PLATFORM_OS_CE
#include <sdcardddk.h>
#endif
typedef struct sdio_data typedef struct sdio_data
{ {
@ -44,27 +34,8 @@ typedef struct sdio_data
u8 rx_block_mode; u8 rx_block_mode;
u32 block_transfer_len; u32 block_transfer_len;
#ifdef PLATFORM_LINUX
struct sdio_func *func; struct sdio_func *func;
_thread_hdl_ sys_sdio_irq_thd; _thread_hdl_ sys_sdio_irq_thd;
#endif
#ifdef PLATFORM_OS_XP
PDEVICE_OBJECT pphysdevobj;
PDEVICE_OBJECT pfuncdevobj;
PDEVICE_OBJECT pnextdevobj;
SDBUS_INTERFACE_STANDARD sdbusinft;
u8 nextdevstacksz;
#endif
#ifdef PLATFORM_OS_CE
SD_DEVICE_HANDLE hDevice;
SD_CARD_RCA sd_rca;
SD_CARD_INTERFACE card_intf;
BOOLEAN enableIsarWithStatus;
WCHAR active_path[MAX_ACTIVE_REG_PATH];
SD_HOST_BLOCK_CAPABILITY sd_host_blk_cap;
#endif
} SDIO_DATA, *PSDIO_DATA; } SDIO_DATA, *PSDIO_DATA;
#endif #endif

View file

@ -28,12 +28,7 @@
#include <drv_types.h> #include <drv_types.h>
#include "wifi.h" #include "wifi.h"
#if defined PLATFORM_OS_XP
#include <ntstrsafe.h>
#endif
#if defined PLATFORM_LINUX
#include <linux/wireless.h> #include <linux/wireless.h>
#endif
#else #else
#include <list.h> #include <list.h>
@ -753,8 +748,6 @@ struct ieee80211_softmac_stats{
#define BIP_AAD_SIZE 20 #define BIP_AAD_SIZE 20
#endif //CONFIG_IEEE80211W #endif //CONFIG_IEEE80211W
#if defined(PLATFORM_LINUX) || defined(CONFIG_RTL8711FW)
struct ieee80211_security { struct ieee80211_security {
u16 active_key:2, u16 active_key:2,
enabled:1, enabled:1,
@ -767,8 +760,6 @@ struct ieee80211_security {
u16 flags; u16 flags;
} __attribute__ ((packed)); } __attribute__ ((packed));
#endif
/* /*
802.11 data frame from AP 802.11 data frame from AP
@ -809,8 +800,6 @@ struct ieee80211_header_data {
#define MFIE_TYPE_RATES_EX 50 #define MFIE_TYPE_RATES_EX 50
#define MFIE_TYPE_GENERIC 221 #define MFIE_TYPE_GENERIC 221
#if defined(PLATFORM_LINUX) || defined(CONFIG_RTL8711FW)
struct ieee80211_info_element_hdr { struct ieee80211_info_element_hdr {
u8 id; u8 id;
u8 len; u8 len;
@ -821,7 +810,6 @@ struct ieee80211_info_element {
u8 len; u8 len;
u8 data[0]; u8 data[0];
} __attribute__ ((packed)); } __attribute__ ((packed));
#endif
/* /*
* These are the data types that can make up management packets * These are the data types that can make up management packets
@ -844,9 +832,6 @@ struct ieee80211_info_element {
#define IEEE80211_DEFAULT_BASIC_RATE 10 #define IEEE80211_DEFAULT_BASIC_RATE 10
#if defined(PLATFORM_LINUX) || defined(CONFIG_RTL8711FW)
struct ieee80211_authentication { struct ieee80211_authentication {
struct ieee80211_header_data header; struct ieee80211_header_data header;
u16 algorithm; u16 algorithm;
@ -855,7 +840,6 @@ struct ieee80211_authentication {
//struct ieee80211_info_element_hdr info_element; //struct ieee80211_info_element_hdr info_element;
} __attribute__ ((packed)); } __attribute__ ((packed));
struct ieee80211_probe_response { struct ieee80211_probe_response {
struct ieee80211_header_data header; struct ieee80211_header_data header;
u32 time_stamp[2]; u32 time_stamp[2];
@ -884,7 +868,6 @@ struct ieee80211_assoc_response_frame {
u16 aid; u16 aid;
// struct ieee80211_info_element info_element; /* supported rates */ // struct ieee80211_info_element info_element; /* supported rates */
} __attribute__ ((packed)); } __attribute__ ((packed));
#endif
struct ieee80211_txb { struct ieee80211_txb {
u8 nr_frags; u8 nr_frags;

View file

@ -48,7 +48,6 @@
#define PMKID_LEN 16 #define PMKID_LEN 16
#ifdef PLATFORM_LINUX
struct wpa_ie_hdr { struct wpa_ie_hdr {
u8 elem_id; u8 elem_id;
u8 len; u8 len;
@ -103,8 +102,6 @@ struct wme_parameter_element {
} __attribute__ ((packed)); } __attribute__ ((packed));
#endif
#define WPA_PUT_LE16(a, val) \ #define WPA_PUT_LE16(a, val) \
do { \ do { \
(a)[1] = ((u16) (val)) >> 8; \ (a)[1] = ((u16) (val)) >> 8; \
@ -179,8 +176,6 @@ enum ieee80211_back_parties {
WLAN_BACK_TIMER = 2, WLAN_BACK_TIMER = 2,
}; };
#ifdef PLATFORM_LINUX
struct ieee80211_mgmt { struct ieee80211_mgmt {
u16 frame_control; u16 frame_control;
u16 duration; u16 duration;
@ -307,9 +302,6 @@ struct ieee80211_mgmt {
} __attribute__ ((packed)) u; } __attribute__ ((packed)) u;
}__attribute__ ((packed)); }__attribute__ ((packed));
#endif
/* mgmt header + 1 byte category code */ /* mgmt header + 1 byte category code */
#define IEEE80211_MIN_ACTION_SIZE FIELD_OFFSET(struct ieee80211_mgmt, u.action.u) #define IEEE80211_MIN_ACTION_SIZE FIELD_OFFSET(struct ieee80211_mgmt, u.action.u)

View file

@ -91,8 +91,6 @@
#define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */ #define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */
#define IPOPT_TS_PRESPEC 3 /* specified modules only */ #define IPOPT_TS_PRESPEC 3 /* specified modules only */
#ifdef PLATFORM_LINUX
struct ip_options { struct ip_options {
__u32 faddr; /* Saved first hop address */ __u32 faddr; /* Saved first hop address */
unsigned char optlen; unsigned char optlen;
@ -114,7 +112,6 @@ struct ip_options {
}; };
#define optlength(opt) (sizeof(struct ip_options) + opt->optlen) #define optlength(opt) (sizeof(struct ip_options) + opt->optlen)
#endif
struct iphdr { struct iphdr {
#if defined(__LITTLE_ENDIAN_BITFIELD) #if defined(__LITTLE_ENDIAN_BITFIELD)

View file

@ -51,7 +51,6 @@ The protection mechanism is through the pending queue.
_mutex ioctl_mutex; _mutex ioctl_mutex;
#ifdef PLATFORM_LINUX
#ifdef CONFIG_USB_HCI #ifdef CONFIG_USB_HCI
// when in USB, IO is through interrupt in/out endpoints // when in USB, IO is through interrupt in/out endpoints
struct usb_device *udev; struct usb_device *udev;
@ -63,31 +62,8 @@ The protection mechanism is through the pending queue.
u8 bio_irp_timeout; u8 bio_irp_timeout;
u8 bio_timer_cancel; u8 bio_timer_cancel;
#endif #endif
#endif
#ifdef PLATFORM_OS_XP
#ifdef CONFIG_SDIO_HCI
// below is for io_rwmem...
PMDL pmdl;
PSDBUS_REQUEST_PACKET sdrp;
PSDBUS_REQUEST_PACKET recv_sdrp;
PSDBUS_REQUEST_PACKET xmit_sdrp;
PIRP piorw_irp;
#endif
#ifdef CONFIG_USB_HCI
PURB piorw_urb;
PIRP piorw_irp;
u8 io_irp_cnt;
u8 bio_irp_pending;
_sema io_retevt;
#endif
#endif
}; };
#ifdef CONFIG_R871X_TEST #ifdef CONFIG_R871X_TEST
int rtw_start_pseudo_adhoc(_adapter *padapter); int rtw_start_pseudo_adhoc(_adapter *padapter);
int rtw_stop_pseudo_adhoc(_adapter *padapter); int rtw_stop_pseudo_adhoc(_adapter *padapter);
@ -104,7 +80,6 @@ void rtw_cancel_dynamic_chk_timer(_adapter *padapter);
#endif #endif
void rtw_cancel_all_timer(_adapter *padapter); void rtw_cancel_all_timer(_adapter *padapter);
#ifdef PLATFORM_LINUX
int rtw_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); int rtw_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
int rtw_init_netdev_name(struct net_device *pnetdev, const char *ifname); int rtw_init_netdev_name(struct net_device *pnetdev, const char *ifname);
@ -121,7 +96,6 @@ void rtw_proc_remove_one(struct net_device *dev);
static void rtw_proc_init_one(struct net_device *dev){} static void rtw_proc_init_one(struct net_device *dev){}
static void rtw_proc_remove_one(struct net_device *dev){} static void rtw_proc_remove_one(struct net_device *dev){}
#endif //!CONFIG_PROC_DEBUG #endif //!CONFIG_PROC_DEBUG
#endif //PLATFORM_LINUX
void rtw_ips_dev_unload(_adapter *padapter); void rtw_ips_dev_unload(_adapter *padapter);

View file

@ -36,7 +36,6 @@
#define _FALSE 0 #define _FALSE 0
#ifdef PLATFORM_LINUX
#include <linux/version.h> #include <linux/version.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/compiler.h> #include <linux/compiler.h>
@ -264,9 +263,7 @@ __inline static void _cancel_timer(_timer *ptimer,u8 *bcancelled)
*bcancelled= _TRUE;//TRUE ==1; FALSE==0 *bcancelled= _TRUE;//TRUE ==1; FALSE==0
} }
#ifdef PLATFORM_LINUX
#define RTW_TIMER_HDL_ARGS void *FunctionContext #define RTW_TIMER_HDL_ARGS void *FunctionContext
#endif
#define RTW_TIMER_HDL_NAME(name) rtw_##name##_timer_hdl #define RTW_TIMER_HDL_NAME(name) rtw_##name##_timer_hdl
#define RTW_DECLARE_TIMER_HDL(name) void RTW_TIMER_HDL_NAME(name)(RTW_TIMER_HDL_ARGS) #define RTW_DECLARE_TIMER_HDL(name) void RTW_TIMER_HDL_NAME(name)(RTW_TIMER_HDL_ARGS)
@ -351,176 +348,6 @@ static inline void rtw_netif_stop_queue(struct net_device *pnetdev)
#endif #endif
} }
#endif // PLATFORM_LINUX
#ifdef PLATFORM_OS_XP
#include <ndis.h>
#include <ntddk.h>
#include <ntddndis.h>
#include <ntdef.h>
#ifdef CONFIG_USB_HCI
#include <usb.h>
#include <usbioctl.h>
#include <usbdlib.h>
#endif
typedef KSEMAPHORE _sema;
typedef LIST_ENTRY _list;
typedef NDIS_STATUS _OS_STATUS;
typedef NDIS_SPIN_LOCK _lock;
typedef KMUTEX _mutex;
typedef KIRQL _irqL;
// USB_PIPE for WINCE , but handle can be use just integer under windows
typedef NDIS_HANDLE _nic_hdl;
typedef NDIS_MINIPORT_TIMER _timer;
struct __queue {
LIST_ENTRY queue;
_lock lock;
};
typedef NDIS_PACKET _pkt;
typedef NDIS_BUFFER _buffer;
typedef struct __queue _queue;
typedef PKTHREAD _thread_hdl_;
typedef void thread_return;
typedef void* thread_context;
typedef NDIS_WORK_ITEM _workitem;
#define thread_exit() PsTerminateSystemThread(STATUS_SUCCESS);
#define HZ 10000000
#define SEMA_UPBND (0x7FFFFFFF) //8192
__inline static _list *get_next(_list *list)
{
return list->Flink;
}
__inline static _list *get_list_head(_queue *queue)
{
return (&(queue->queue));
}
#define LIST_CONTAINOR(ptr, type, member) CONTAINING_RECORD(ptr, type, member)
__inline static _enter_critical(_lock *plock, _irqL *pirqL)
{
NdisAcquireSpinLock(plock);
}
__inline static _exit_critical(_lock *plock, _irqL *pirqL)
{
NdisReleaseSpinLock(plock);
}
__inline static _enter_critical_ex(_lock *plock, _irqL *pirqL)
{
NdisDprAcquireSpinLock(plock);
}
__inline static _exit_critical_ex(_lock *plock, _irqL *pirqL)
{
NdisDprReleaseSpinLock(plock);
}
__inline static void _enter_critical_bh(_lock *plock, _irqL *pirqL)
{
NdisDprAcquireSpinLock(plock);
}
__inline static void _exit_critical_bh(_lock *plock, _irqL *pirqL)
{
NdisDprReleaseSpinLock(plock);
}
__inline static _enter_critical_mutex(_mutex *pmutex, _irqL *pirqL)
{
KeWaitForSingleObject(pmutex, Executive, KernelMode, FALSE, NULL);
}
__inline static _exit_critical_mutex(_mutex *pmutex, _irqL *pirqL)
{
KeReleaseMutex(pmutex, FALSE);
}
__inline static void rtw_list_delete(_list *plist)
{
RemoveEntryList(plist);
InitializeListHead(plist);
}
__inline static void _init_timer(_timer *ptimer,_nic_hdl nic_hdl,void *pfunc,PVOID cntx)
{
NdisMInitializeTimer(ptimer, nic_hdl, pfunc, cntx);
}
__inline static void _set_timer(_timer *ptimer,u32 delay_time)
{
NdisMSetTimer(ptimer,delay_time);
}
__inline static void _cancel_timer(_timer *ptimer,u8 *bcancelled)
{
NdisMCancelTimer(ptimer,bcancelled);
}
__inline static void _init_workitem(_workitem *pwork, void *pfunc, PVOID cntx)
{
NdisInitializeWorkItem(pwork, pfunc, cntx);
}
__inline static void _set_workitem(_workitem *pwork)
{
NdisScheduleWorkItem(pwork);
}
#define ATOMIC_INIT(i) { (i) }
//
// Global Mutex: can only be used at PASSIVE level.
//
#define ACQUIRE_GLOBAL_MUTEX(_MutexCounter) \
{ \
while (NdisInterlockedIncrement((PULONG)&(_MutexCounter)) != 1)\
{ \
NdisInterlockedDecrement((PULONG)&(_MutexCounter)); \
NdisMSleep(10000); \
} \
}
#define RELEASE_GLOBAL_MUTEX(_MutexCounter) \
{ \
NdisInterlockedDecrement((PULONG)&(_MutexCounter)); \
}
#endif // PLATFORM_OS_XP
#ifdef PLATFORM_OS_CE
#include <osdep_ce_service.h>
#endif
#include <rtw_byteorder.h> #include <rtw_byteorder.h>
#ifndef BIT #ifndef BIT
@ -779,29 +606,23 @@ extern void rtw_yield_os(void);
__inline static unsigned char _cancel_timer_ex(_timer *ptimer) __inline static unsigned char _cancel_timer_ex(_timer *ptimer)
{ {
#ifdef PLATFORM_LINUX
return del_timer_sync(ptimer); return del_timer_sync(ptimer);
#endif
} }
static __inline void thread_enter(char *name) static __inline void thread_enter(char *name)
{ {
#ifdef PLATFORM_LINUX
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0)) #if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0))
daemonize("%s", name); daemonize("%s", name);
#endif #endif
allow_signal(SIGTERM); allow_signal(SIGTERM);
#endif
} }
__inline static void flush_signals_thread(void) __inline static void flush_signals_thread(void)
{ {
#ifdef PLATFORM_LINUX
if (signal_pending (current)) if (signal_pending (current))
{ {
flush_signals(current); flush_signals(current);
} }
#endif
} }
__inline static _OS_STATUS res_to_status(sint res) __inline static _OS_STATUS res_to_status(sint res)
@ -811,16 +632,10 @@ __inline static _OS_STATUS res_to_status(sint res)
__inline static void rtw_dump_stack(void) __inline static void rtw_dump_stack(void)
{ {
#ifdef PLATFORM_LINUX
dump_stack(); dump_stack();
#endif
} }
#ifdef PLATFORM_LINUX
#define rtw_warn_on(condition) WARN_ON(condition) #define rtw_warn_on(condition) WARN_ON(condition)
#else
#define rtw_warn_on(condition) do {} while (0)
#endif
#define _RND(sz, r) ((((sz)+((r)-1))/(r))*(r)) #define _RND(sz, r) ((((sz)+((r)-1))/(r))*(r))
#define RND4(x) (((x >> 2) + (((x & 3) == 0) ? 0: 1)) << 2) #define RND4(x) (((x >> 2) + (((x & 3) == 0) ? 0: 1)) << 2)
@ -898,17 +713,10 @@ __inline static u32 bitshift(u32 bitmask)
#endif #endif
//#ifdef __GNUC__ //#ifdef __GNUC__
#ifdef PLATFORM_LINUX
#define STRUCT_PACKED __attribute__ ((packed)) #define STRUCT_PACKED __attribute__ ((packed))
#else
#define STRUCT_PACKED
#endif
// limitation of path length // limitation of path length
#ifdef PLATFORM_LINUX
#define PATH_LENGTH_MAX PATH_MAX #define PATH_LENGTH_MAX PATH_MAX
#endif
// Suspend lock prevent system from going suspend // Suspend lock prevent system from going suspend
@ -957,7 +765,6 @@ extern struct net_device * rtw_alloc_etherdev(int sizeof_priv);
extern void rtw_free_netdev(struct net_device * netdev); extern void rtw_free_netdev(struct net_device * netdev);
#ifdef PLATFORM_LINUX
#define NDEV_FMT "%s" #define NDEV_FMT "%s"
#define NDEV_ARG(ndev) ndev->name #define NDEV_ARG(ndev) ndev->name
#define ADPT_FMT "%s" #define ADPT_FMT "%s"
@ -966,24 +773,12 @@ extern void rtw_free_netdev(struct net_device * netdev);
#define FUNC_NDEV_ARG(ndev) __func__, ndev->name #define FUNC_NDEV_ARG(ndev) __func__, ndev->name
#define FUNC_ADPT_FMT "%s(%s)" #define FUNC_ADPT_FMT "%s(%s)"
#define FUNC_ADPT_ARG(adapter) __func__, adapter->pnetdev->name #define FUNC_ADPT_ARG(adapter) __func__, adapter->pnetdev->name
#else
#define NDEV_FMT "%s"
#define NDEV_ARG(ndev) ""
#define ADPT_FMT "%s"
#define ADPT_ARG(adapter) ""
#define FUNC_NDEV_FMT "%s"
#define FUNC_NDEV_ARG(ndev) __func__
#define FUNC_ADPT_FMT "%s"
#define FUNC_ADPT_ARG(adapter) __func__
#endif
#ifdef PLATFORM_LINUX
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27))
#define rtw_signal_process(pid, sig) kill_pid(find_vpid((pid)),(sig), 1) #define rtw_signal_process(pid, sig) kill_pid(find_vpid((pid)),(sig), 1)
#else //(LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) #else //(LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27))
#define rtw_signal_process(pid, sig) kill_proc((pid), (sig), 1) #define rtw_signal_process(pid, sig) kill_proc((pid), (sig), 1)
#endif //(LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) #endif //(LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27))
#endif //PLATFORM_LINUX
extern u64 rtw_modular64(u64 x, u64 y); extern u64 rtw_modular64(u64 x, u64 y);
extern u64 rtw_division64(u64 x, u64 y); extern u64 rtw_division64(u64 x, u64 y);

View file

@ -157,13 +157,11 @@ extern void eeprom_read_sz(_adapter * padapter, u16 reg,u8* data, u32 sz);
extern void read_eeprom_content_by_attrib(_adapter * padapter ); extern void read_eeprom_content_by_attrib(_adapter * padapter );
#ifdef PLATFORM_LINUX
#ifdef CONFIG_ADAPTOR_INFO_CACHING_FILE #ifdef CONFIG_ADAPTOR_INFO_CACHING_FILE
extern int isAdaptorInfoFileValid(void); extern int isAdaptorInfoFileValid(void);
extern int storeAdaptorInfoFile(char *path, struct eeprom_priv * eeprom_priv); extern int storeAdaptorInfoFile(char *path, struct eeprom_priv * eeprom_priv);
extern int retriveAdaptorInfoFile(char *path, struct eeprom_priv * eeprom_priv); extern int retriveAdaptorInfoFile(char *path, struct eeprom_priv * eeprom_priv);
#endif //CONFIG_ADAPTOR_INFO_CACHING_FILE #endif //CONFIG_ADAPTOR_INFO_CACHING_FILE
#endif //PLATFORM_LINUX
#endif //__RTL871X_EEPROM_H__ #endif //__RTL871X_EEPROM_H__

View file

@ -23,7 +23,6 @@
#include <osdep_service.h> #include <osdep_service.h>
#ifndef CONFIG_RTL8711FW #ifndef CONFIG_RTL8711FW
#ifdef PLATFORM_LINUX
#include <wlan_bssdef.h> #include <wlan_bssdef.h>
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)) #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26))
#include <asm/semaphore.h> #include <asm/semaphore.h>
@ -31,13 +30,10 @@
#include <linux/semaphore.h> #include <linux/semaphore.h>
#endif #endif
#include <linux/sem.h> #include <linux/sem.h>
#endif
#else #else
#include <wlan_bssdef.h> #include <wlan_bssdef.h>
#endif//CONFIG_RTL8711FW #endif//CONFIG_RTL8711FW
#ifdef CONFIG_H2CLBK #ifdef CONFIG_H2CLBK
#include <h2clbk.h> #include <h2clbk.h>
#endif #endif

View file

@ -25,7 +25,6 @@
#include <osdep_service.h> #include <osdep_service.h>
#include <osdep_intf.h> #include <osdep_intf.h>
#ifdef PLATFORM_LINUX
#include <asm/byteorder.h> #include <asm/byteorder.h>
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)) #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26))
#include <asm/semaphore.h> #include <asm/semaphore.h>
@ -47,14 +46,9 @@
#endif //CONFIG_USB_HCI #endif //CONFIG_USB_HCI
#endif //PLATFORM_LINUX
#define NUM_IOREQ 8 #define NUM_IOREQ 8
#ifdef PLATFORM_LINUX
#define MAX_PROT_SZ (64-16) #define MAX_PROT_SZ (64-16)
#endif
#define _IOREADY 0 #define _IOREADY 0
#define _IO_WAIT_COMPLETE 1 #define _IO_WAIT_COMPLETE 1

View file

@ -103,7 +103,7 @@ struct oid_obj_priv {
NDIS_STATUS (*oidfuns)(struct oid_par_priv *poid_par_priv); NDIS_STATUS (*oidfuns)(struct oid_par_priv *poid_par_priv);
}; };
#if defined(PLATFORM_LINUX) && defined(CONFIG_WIRELESS_EXT) #if defined(CONFIG_WIRELESS_EXT)
extern struct iw_handler_def rtw_handlers_def; extern struct iw_handler_def rtw_handlers_def;
#endif #endif

View file

@ -123,13 +123,7 @@ struct mp_xmit_frame
u8 *mem_addr; u8 *mem_addr;
u32 sz[8]; u32 sz[8];
#if defined(PLATFORM_OS_XP) || defined(PLATFORM_LINUX)
PURB pxmit_urb[8]; PURB pxmit_urb[8];
#endif
#ifdef PLATFORM_OS_XP
PIRP pxmit_irp[8];
#endif
u8 bpending[8]; u8 bpending[8];
sint ac_tag[8]; sint ac_tag[8];

View file

@ -290,9 +290,7 @@ struct recv_priv
u8 rx_pending_cnt; u8 rx_pending_cnt;
#ifdef CONFIG_USB_INTERRUPT_IN_PIPE #ifdef CONFIG_USB_INTERRUPT_IN_PIPE
#ifdef PLATFORM_LINUX
PURB int_in_urb; PURB int_in_urb;
#endif
u8 *int_in_buf; u8 *int_in_buf;
#endif //CONFIG_USB_INTERRUPT_IN_PIPE #endif //CONFIG_USB_INTERRUPT_IN_PIPE
@ -403,10 +401,8 @@ struct recv_buf
#endif #endif
#ifdef PLATFORM_LINUX
_pkt *pskb; _pkt *pskb;
u8 reuse; u8 reuse;
#endif
}; };

View file

@ -440,9 +440,7 @@ int tdls_verify_mic(u8 *kck, u8 trans_seq,
u8 *lnkid, u8 *rsnie, u8 *timeoutie, u8 *ftie); u8 *lnkid, u8 *rsnie, u8 *timeoutie, u8 *ftie);
#endif //CONFIG_TDLS #endif //CONFIG_TDLS
#ifdef PLATFORM_LINUX
void rtw_use_tkipkey_handler(void* FunctionContext); void rtw_use_tkipkey_handler(void* FunctionContext);
#endif
void rtw_sec_restore_wep_key(_adapter *adapter); void rtw_sec_restore_wep_key(_adapter *adapter);
u8 rtw_handle_tkip_countermeasure(_adapter* adapter, const char *caller); u8 rtw_handle_tkip_countermeasure(_adapter* adapter, const char *caller);

View file

@ -324,9 +324,7 @@ struct submit_ctx{
u32 submit_time; /* */ u32 submit_time; /* */
u32 timeout_ms; /* <0: not synchronous, 0: wait forever, >0: up to ms waiting */ u32 timeout_ms; /* <0: not synchronous, 0: wait forever, >0: up to ms waiting */
int status; /* status for operation */ int status; /* status for operation */
#ifdef PLATFORM_LINUX
struct completion done; struct completion done;
#endif
}; };
enum { enum {
@ -558,9 +556,7 @@ struct xmit_priv {
USB_TRANSFER usb_transfer_write_port; USB_TRANSFER usb_transfer_write_port;
// USB_TRANSFER usb_transfer_write_mem; // USB_TRANSFER usb_transfer_write_mem;
#endif #endif
#ifdef PLATFORM_LINUX
struct tasklet_struct xmit_tasklet; struct tasklet_struct xmit_tasklet;
#endif
//per AC pending irp //per AC pending irp
int beq_cnt; int beq_cnt;
int bkq_cnt; int bkq_cnt;
@ -574,16 +570,12 @@ struct xmit_priv {
struct rtw_tx_ring tx_ring[PCI_MAX_TX_QUEUE_COUNT]; struct rtw_tx_ring tx_ring[PCI_MAX_TX_QUEUE_COUNT];
int txringcount[PCI_MAX_TX_QUEUE_COUNT]; int txringcount[PCI_MAX_TX_QUEUE_COUNT];
u8 beaconDMAing; //flag of indicating beacon is transmiting to HW by DMA u8 beaconDMAing; //flag of indicating beacon is transmiting to HW by DMA
#ifdef PLATFORM_LINUX
struct tasklet_struct xmit_tasklet; struct tasklet_struct xmit_tasklet;
#endif #endif
#endif
#ifdef CONFIG_SDIO_HCI #ifdef CONFIG_SDIO_HCI
#ifdef CONFIG_SDIO_TX_TASKLET #ifdef CONFIG_SDIO_TX_TASKLET
#ifdef PLATFORM_LINUX
struct tasklet_struct xmit_tasklet; struct tasklet_struct xmit_tasklet;
#endif /* PLATFORM_LINUX */
#else #else
_thread_hdl_ SdioXmitThread; _thread_hdl_ SdioXmitThread;
_sema SdioXmitSema; _sema SdioXmitSema;

View file

@ -24,10 +24,7 @@
#include <osdep_service.h> #include <osdep_service.h>
#include <drv_types.h> #include <drv_types.h>
#include <osdep_intf.h> #include <osdep_intf.h>
#ifdef PLATFORM_LINUX
#include <sdio_ops_linux.h> #include <sdio_ops_linux.h>
#endif
extern void sdio_set_intf_ops(struct _io_ops *pops); extern void sdio_set_intf_ops(struct _io_ops *pops);

View file

@ -38,7 +38,6 @@ enum{
#define MAX_VENDOR_REQ_CMD_SIZE 254 //8188cu SIE Support #define MAX_VENDOR_REQ_CMD_SIZE 254 //8188cu SIE Support
#define MAX_USB_IO_CTL_SIZE (MAX_VENDOR_REQ_CMD_SIZE +ALIGNMENT_UNIT) #define MAX_USB_IO_CTL_SIZE (MAX_VENDOR_REQ_CMD_SIZE +ALIGNMENT_UNIT)
#ifdef PLATFORM_LINUX
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12))
#define rtw_usb_control_msg(dev, pipe, request, requesttype, value, index, data, size, timeout_ms) \ #define rtw_usb_control_msg(dev, pipe, request, requesttype, value, index, data, size, timeout_ms) \
usb_control_msg((dev), (pipe), (request), (requesttype), (value), (index), (data), (size), (timeout_ms)) usb_control_msg((dev), (pipe), (request), (requesttype), (value), (index), (data), (size), (timeout_ms))
@ -53,7 +52,6 @@ enum{
((timeout_ms) == 0) ||((timeout_ms)*HZ/1000>0)?((timeout_ms)*HZ/1000):1) ((timeout_ms) == 0) ||((timeout_ms)*HZ/1000>0)?((timeout_ms)*HZ/1000):1)
#endif #endif
#include <usb_ops_linux.h> #include <usb_ops_linux.h>
#endif //PLATFORM_LINUX
#ifdef CONFIG_RTL8192C #ifdef CONFIG_RTL8192C
void rtl8192cu_set_hw_type(_adapter *padapter); void rtl8192cu_set_hw_type(_adapter *padapter);

View file

@ -663,7 +663,6 @@ __inline static int IsFrameTypeCtrl(unsigned char *pframe)
* This structure refers to "HT BlockAckReq" as * This structure refers to "HT BlockAckReq" as
* described in 802.11n draft section 7.2.1.7.1 * described in 802.11n draft section 7.2.1.7.1
*/ */
#if defined(PLATFORM_LINUX) || defined(CONFIG_RTL8712FW)
struct rtw_ieee80211_bar { struct rtw_ieee80211_bar {
unsigned short frame_control; unsigned short frame_control;
unsigned short duration; unsigned short duration;
@ -672,7 +671,6 @@ struct rtw_ieee80211_bar {
unsigned short control; unsigned short control;
unsigned short start_seq_num; unsigned short start_seq_num;
} __attribute__((packed)); } __attribute__((packed));
#endif
/* 802.11 BAR control masks */ /* 802.11 BAR control masks */
#define IEEE80211_BAR_CTRL_ACK_POLICY_NORMAL 0x0000 #define IEEE80211_BAR_CTRL_ACK_POLICY_NORMAL 0x0000

View file

@ -20,12 +20,8 @@
#ifndef __WLAN_BSSDEF_H__ #ifndef __WLAN_BSSDEF_H__
#define __WLAN_BSSDEF_H__ #define __WLAN_BSSDEF_H__
#define MAX_IE_SZ 768 #define MAX_IE_SZ 768
#ifdef PLATFORM_LINUX
#define NDIS_802_11_LENGTH_SSID 32 #define NDIS_802_11_LENGTH_SSID 32
#define NDIS_802_11_LENGTH_RATES 8 #define NDIS_802_11_LENGTH_RATES 8
#define NDIS_802_11_LENGTH_RATES_EX 16 #define NDIS_802_11_LENGTH_RATES_EX 16
@ -293,9 +289,6 @@ typedef struct _NDIS_802_11_TEST
}tt; }tt;
} NDIS_802_11_TEST, *PNDIS_802_11_TEST; } NDIS_802_11_TEST, *PNDIS_802_11_TEST;
#endif //end of #ifdef PLATFORM_LINUX
#ifndef Ndis802_11APMode #ifndef Ndis802_11APMode
#define Ndis802_11APMode (Ndis802_11InfrastructureMax+1) #define Ndis802_11APMode (Ndis802_11InfrastructureMax+1)
#endif #endif

View file

@ -33,8 +33,6 @@ struct pkt_file {
SIZE_T buf_len; SIZE_T buf_len;
}; };
#ifdef PLATFORM_LINUX
#define NR_XMITFRAME 256 #define NR_XMITFRAME 256
struct xmit_priv; struct xmit_priv;
@ -46,8 +44,6 @@ struct xmit_buf;
extern int _rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev); extern int _rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev);
extern int rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev); extern int rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev);
#endif
void rtw_os_xmit_schedule(_adapter *padapter); void rtw_os_xmit_schedule(_adapter *padapter);
int rtw_os_xmit_resource_alloc(_adapter *padapter, struct xmit_buf *pxmitbuf,u32 alloc_sz); int rtw_os_xmit_resource_alloc(_adapter *padapter, struct xmit_buf *pxmitbuf,u32 alloc_sz);

View file

@ -25,9 +25,7 @@
#include <osdep_service.h> #include <osdep_service.h>
#include <drv_types.h> #include <drv_types.h>
#include <recv_osdep.h> #include <recv_osdep.h>
#ifdef PLATFORM_LINUX
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#endif
#ifdef RTK_DMP_PLATFORM #ifdef RTK_DMP_PLATFORM
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,12)) #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,12))
#include <linux/pageremap.h> #include <linux/pageremap.h>
@ -37,15 +35,11 @@
#define RT_TAG '1178' #define RT_TAG '1178'
#ifdef DBG_MEMORY_LEAK #ifdef DBG_MEMORY_LEAK
#ifdef PLATFORM_LINUX
#include <asm/atomic.h> #include <asm/atomic.h>
atomic_t _malloc_cnt = ATOMIC_INIT(0); atomic_t _malloc_cnt = ATOMIC_INIT(0);
atomic_t _malloc_size = ATOMIC_INIT(0); atomic_t _malloc_size = ATOMIC_INIT(0);
#endif
#endif /* DBG_MEMORY_LEAK */ #endif /* DBG_MEMORY_LEAK */
#if defined(PLATFORM_LINUX)
/* /*
* Translate the OS dependent @param error_code to OS independent RTW_STATUS_CODE * Translate the OS dependent @param error_code to OS independent RTW_STATUS_CODE
* @return: one of RTW_STATUS_CODE * @return: one of RTW_STATUS_CODE
@ -61,11 +55,6 @@ inline int RTW_STATUS_CODE(int error_code){
return _FAIL; return _FAIL;
} }
} }
#else
inline int RTW_STATUS_CODE(int error_code){
return error_code;
}
#endif
u32 rtw_atoi(u8* s) u32 rtw_atoi(u8* s)
{ {
@ -92,16 +81,12 @@ u32 rtw_atoi(u8* s)
inline u8* _rtw_vmalloc(u32 sz) inline u8* _rtw_vmalloc(u32 sz)
{ {
u8 *pbuf; u8 *pbuf;
#ifdef PLATFORM_LINUX
pbuf = vmalloc(sz); pbuf = vmalloc(sz);
#endif
#ifdef DBG_MEMORY_LEAK #ifdef DBG_MEMORY_LEAK
#ifdef PLATFORM_LINUX
if ( pbuf != NULL) { if ( pbuf != NULL) {
atomic_inc(&_malloc_cnt); atomic_inc(&_malloc_cnt);
atomic_add(sz, &_malloc_size); atomic_add(sz, &_malloc_size);
} }
#endif
#endif /* DBG_MEMORY_LEAK */ #endif /* DBG_MEMORY_LEAK */
return pbuf; return pbuf;
@ -110,24 +95,18 @@ inline u8* _rtw_vmalloc(u32 sz)
inline u8* _rtw_zvmalloc(u32 sz) inline u8* _rtw_zvmalloc(u32 sz)
{ {
u8 *pbuf; u8 *pbuf;
#ifdef PLATFORM_LINUX
pbuf = _rtw_vmalloc(sz); pbuf = _rtw_vmalloc(sz);
if (pbuf != NULL) if (pbuf != NULL)
memset(pbuf, 0, sz); memset(pbuf, 0, sz);
#endif
return pbuf; return pbuf;
} }
inline void _rtw_vmfree(u8 *pbuf, u32 sz) inline void _rtw_vmfree(u8 *pbuf, u32 sz)
{ {
#ifdef PLATFORM_LINUX
vfree(pbuf); vfree(pbuf);
#endif
#ifdef DBG_MEMORY_LEAK #ifdef DBG_MEMORY_LEAK
#ifdef PLATFORM_LINUX
atomic_dec(&_malloc_cnt); atomic_dec(&_malloc_cnt);
atomic_sub(sz, &_malloc_size); atomic_sub(sz, &_malloc_size);
#endif
#endif /* DBG_MEMORY_LEAK */ #endif /* DBG_MEMORY_LEAK */
} }
@ -136,7 +115,6 @@ u8* _rtw_malloc(u32 sz)
u8 *pbuf=NULL; u8 *pbuf=NULL;
#ifdef PLATFORM_LINUX
#ifdef RTK_DMP_PLATFORM #ifdef RTK_DMP_PLATFORM
if(sz > 0x4000) if(sz > 0x4000)
pbuf = (u8 *)dvr_malloc(sz); pbuf = (u8 *)dvr_malloc(sz);
@ -144,14 +122,11 @@ u8* _rtw_malloc(u32 sz)
#endif #endif
pbuf = kmalloc(sz,in_interrupt() ? GFP_ATOMIC : GFP_KERNEL); pbuf = kmalloc(sz,in_interrupt() ? GFP_ATOMIC : GFP_KERNEL);
#endif
#ifdef DBG_MEMORY_LEAK #ifdef DBG_MEMORY_LEAK
#ifdef PLATFORM_LINUX
if ( pbuf != NULL) { if ( pbuf != NULL) {
atomic_inc(&_malloc_cnt); atomic_inc(&_malloc_cnt);
atomic_add(sz, &_malloc_size); atomic_add(sz, &_malloc_size);
} }
#endif
#endif /* DBG_MEMORY_LEAK */ #endif /* DBG_MEMORY_LEAK */
return pbuf; return pbuf;
@ -165,9 +140,7 @@ u8* _rtw_zmalloc(u32 sz)
if (pbuf != NULL) { if (pbuf != NULL) {
#ifdef PLATFORM_LINUX
memset(pbuf, 0, sz); memset(pbuf, 0, sz);
#endif
} }
return pbuf; return pbuf;
@ -176,30 +149,22 @@ u8* _rtw_zmalloc(u32 sz)
void _rtw_mfree(u8 *pbuf, u32 sz) void _rtw_mfree(u8 *pbuf, u32 sz)
{ {
#ifdef PLATFORM_LINUX
#ifdef RTK_DMP_PLATFORM #ifdef RTK_DMP_PLATFORM
if(sz > 0x4000) if(sz > 0x4000)
dvr_free(pbuf); dvr_free(pbuf);
else else
#endif #endif
kfree(pbuf); kfree(pbuf);
#endif
#ifdef DBG_MEMORY_LEAK #ifdef DBG_MEMORY_LEAK
#ifdef PLATFORM_LINUX
atomic_dec(&_malloc_cnt); atomic_dec(&_malloc_cnt);
atomic_sub(sz, &_malloc_size); atomic_sub(sz, &_malloc_size);
#endif
#endif /* DBG_MEMORY_LEAK */ #endif /* DBG_MEMORY_LEAK */
} }
inline struct sk_buff *_rtw_skb_alloc(u32 sz) inline struct sk_buff *_rtw_skb_alloc(u32 sz)
{ {
#ifdef PLATFORM_LINUX
return __dev_alloc_skb(sz, in_interrupt() ? GFP_ATOMIC : GFP_KERNEL); return __dev_alloc_skb(sz, in_interrupt() ? GFP_ATOMIC : GFP_KERNEL);
#endif /* PLATFORM_LINUX */
} }
inline void _rtw_skb_free(struct sk_buff *skb) inline void _rtw_skb_free(struct sk_buff *skb)
@ -209,24 +174,18 @@ inline void _rtw_skb_free(struct sk_buff *skb)
inline struct sk_buff *_rtw_skb_copy(const struct sk_buff *skb) inline struct sk_buff *_rtw_skb_copy(const struct sk_buff *skb)
{ {
#ifdef PLATFORM_LINUX
return skb_copy(skb, in_interrupt() ? GFP_ATOMIC : GFP_KERNEL); return skb_copy(skb, in_interrupt() ? GFP_ATOMIC : GFP_KERNEL);
#endif /* PLATFORM_LINUX */
} }
inline struct sk_buff *_rtw_skb_clone(struct sk_buff *skb) inline struct sk_buff *_rtw_skb_clone(struct sk_buff *skb)
{ {
#ifdef PLATFORM_LINUX
return skb_clone(skb, in_interrupt() ? GFP_ATOMIC : GFP_KERNEL); return skb_clone(skb, in_interrupt() ? GFP_ATOMIC : GFP_KERNEL);
#endif /* PLATFORM_LINUX */
} }
inline int _rtw_netif_rx(_nic_hdl ndev, struct sk_buff *skb) inline int _rtw_netif_rx(_nic_hdl ndev, struct sk_buff *skb)
{ {
#ifdef PLATFORM_LINUX
skb->dev = ndev; skb->dev = ndev;
return netif_rx(skb); return netif_rx(skb);
#endif /* PLATFORM_LINUX */
} }
void _rtw_skb_queue_purge(struct sk_buff_head *list) void _rtw_skb_queue_purge(struct sk_buff_head *list)
@ -240,24 +199,20 @@ void _rtw_skb_queue_purge(struct sk_buff_head *list)
#ifdef CONFIG_USB_HCI #ifdef CONFIG_USB_HCI
inline void *_rtw_usb_buffer_alloc(struct usb_device *dev, size_t size, dma_addr_t *dma) inline void *_rtw_usb_buffer_alloc(struct usb_device *dev, size_t size, dma_addr_t *dma)
{ {
#ifdef PLATFORM_LINUX
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
return usb_alloc_coherent(dev, size, (in_interrupt() ? GFP_ATOMIC : GFP_KERNEL), dma); return usb_alloc_coherent(dev, size, (in_interrupt() ? GFP_ATOMIC : GFP_KERNEL), dma);
#else #else
return usb_buffer_alloc(dev, size, (in_interrupt() ? GFP_ATOMIC : GFP_KERNEL), dma); return usb_buffer_alloc(dev, size, (in_interrupt() ? GFP_ATOMIC : GFP_KERNEL), dma);
#endif #endif
#endif /* PLATFORM_LINUX */
} }
inline void _rtw_usb_buffer_free(struct usb_device *dev, size_t size, void *addr, dma_addr_t dma) inline void _rtw_usb_buffer_free(struct usb_device *dev, size_t size, void *addr, dma_addr_t dma)
{ {
#ifdef PLATFORM_LINUX
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
usb_free_coherent(dev, size, addr, dma); usb_free_coherent(dev, size, addr, dma);
#else #else
usb_buffer_free(dev, size, addr, dma); usb_buffer_free(dev, size, addr, dma);
#endif #endif
#endif /* PLATFORM_LINUX */
} }
#endif /* CONFIG_USB_HCI */ #endif /* CONFIG_USB_HCI */
@ -687,12 +642,7 @@ void _rtw_memset(void *pbuf, int c, u32 sz)
void _rtw_init_listhead(_list *list) void _rtw_init_listhead(_list *list)
{ {
#ifdef PLATFORM_LINUX
INIT_LIST_HEAD(list); INIT_LIST_HEAD(list);
#endif
} }
@ -703,33 +653,20 @@ Otherwise, there will be racing condition.
*/ */
u32 rtw_is_list_empty(_list *phead) u32 rtw_is_list_empty(_list *phead)
{ {
#ifdef PLATFORM_LINUX
if (list_empty(phead)) if (list_empty(phead))
return _TRUE; return _TRUE;
else else
return _FALSE; return _FALSE;
#endif
} }
void rtw_list_insert_head(_list *plist, _list *phead) void rtw_list_insert_head(_list *plist, _list *phead)
{ {
#ifdef PLATFORM_LINUX
list_add(plist, phead); list_add(plist, phead);
#endif
} }
void rtw_list_insert_tail(_list *plist, _list *phead) void rtw_list_insert_tail(_list *plist, _list *phead)
{ {
#ifdef PLATFORM_LINUX
list_add_tail(plist, phead); list_add_tail(plist, phead);
#endif
} }
@ -742,12 +679,7 @@ Caller must check if the list is empty before calling rtw_list_delete
void _rtw_init_sema(_sema *sema, int init_val) void _rtw_init_sema(_sema *sema, int init_val)
{ {
#ifdef PLATFORM_LINUX
sema_init(sema, init_val); sema_init(sema, init_val);
#endif
} }
void _rtw_free_sema(_sema *sema) void _rtw_free_sema(_sema *sema)
@ -756,59 +688,38 @@ void _rtw_free_sema(_sema *sema)
void _rtw_up_sema(_sema *sema) void _rtw_up_sema(_sema *sema)
{ {
#ifdef PLATFORM_LINUX
up(sema); up(sema);
#endif
} }
u32 _rtw_down_sema(_sema *sema) u32 _rtw_down_sema(_sema *sema)
{ {
#ifdef PLATFORM_LINUX
if (down_interruptible(sema)) if (down_interruptible(sema))
return _FAIL; return _FAIL;
else else
return _SUCCESS; return _SUCCESS;
#endif
} }
void _rtw_mutex_init(_mutex *pmutex) void _rtw_mutex_init(_mutex *pmutex)
{ {
#ifdef PLATFORM_LINUX
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
mutex_init(pmutex); mutex_init(pmutex);
#else #else
init_MUTEX(pmutex); init_MUTEX(pmutex);
#endif #endif
#endif
} }
void _rtw_mutex_free(_mutex *pmutex) void _rtw_mutex_free(_mutex *pmutex)
{ {
#ifdef PLATFORM_LINUX
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
mutex_destroy(pmutex); mutex_destroy(pmutex);
#endif #endif
#endif
} }
void _rtw_spinlock_init(_lock *plock) void _rtw_spinlock_init(_lock *plock)
{ {
#ifdef PLATFORM_LINUX
spin_lock_init(plock); spin_lock_init(plock);
#endif
} }
void _rtw_spinlock_free(_lock *plock) void _rtw_spinlock_free(_lock *plock)
@ -817,41 +728,23 @@ void _rtw_spinlock_free(_lock *plock)
void _rtw_spinlock(_lock *plock) void _rtw_spinlock(_lock *plock)
{ {
#ifdef PLATFORM_LINUX
spin_lock(plock); spin_lock(plock);
#endif
} }
void _rtw_spinunlock(_lock *plock) void _rtw_spinunlock(_lock *plock)
{ {
#ifdef PLATFORM_LINUX
spin_unlock(plock); spin_unlock(plock);
#endif
} }
void _rtw_spinlock_ex(_lock *plock) void _rtw_spinlock_ex(_lock *plock)
{ {
#ifdef PLATFORM_LINUX
spin_lock(plock); spin_lock(plock);
#endif
} }
void _rtw_spinunlock_ex(_lock *plock) void _rtw_spinunlock_ex(_lock *plock)
{ {
#ifdef PLATFORM_LINUX
spin_unlock(plock); spin_unlock(plock);
#endif
} }
void _rtw_init_queue(_queue *pqueue) void _rtw_init_queue(_queue *pqueue)
@ -880,47 +773,33 @@ u32 rtw_end_of_queue_search(_list *head, _list *plist)
u32 rtw_get_current_time(void) u32 rtw_get_current_time(void)
{ {
#ifdef PLATFORM_LINUX
return jiffies; return jiffies;
#endif
} }
inline u32 rtw_systime_to_ms(u32 systime) inline u32 rtw_systime_to_ms(u32 systime)
{ {
#ifdef PLATFORM_LINUX
return systime * 1000 / HZ; return systime * 1000 / HZ;
#endif
} }
inline u32 rtw_ms_to_systime(u32 ms) inline u32 rtw_ms_to_systime(u32 ms)
{ {
#ifdef PLATFORM_LINUX
return ms * HZ / 1000; return ms * HZ / 1000;
#endif
} }
// the input parameter start use the same unit as returned by rtw_get_current_time // the input parameter start use the same unit as returned by rtw_get_current_time
inline s32 rtw_get_passing_time_ms(u32 start) inline s32 rtw_get_passing_time_ms(u32 start)
{ {
#ifdef PLATFORM_LINUX
return rtw_systime_to_ms(jiffies-start); return rtw_systime_to_ms(jiffies-start);
#endif
} }
inline s32 rtw_get_time_interval_ms(u32 start, u32 end) inline s32 rtw_get_time_interval_ms(u32 start, u32 end)
{ {
#ifdef PLATFORM_LINUX
return rtw_systime_to_ms(end-start); return rtw_systime_to_ms(end-start);
#endif
} }
void rtw_sleep_schedulable(int ms) void rtw_sleep_schedulable(int ms)
{ {
#ifdef PLATFORM_LINUX
u32 delta; u32 delta;
delta = (ms * HZ)/1000;//(ms) delta = (ms * HZ)/1000;//(ms)
@ -931,34 +810,20 @@ void rtw_sleep_schedulable(int ms)
if (schedule_timeout(delta) != 0) { if (schedule_timeout(delta) != 0) {
return ; return ;
} }
return;
#endif
} }
void rtw_msleep_os(int ms) void rtw_msleep_os(int ms)
{ {
#ifdef PLATFORM_LINUX
msleep((unsigned int)ms); msleep((unsigned int)ms);
#endif
} }
void rtw_usleep_os(int us) void rtw_usleep_os(int us)
{ {
#ifdef PLATFORM_LINUX
// msleep((unsigned int)us);
if ( 1 < (us/1000) ) if ( 1 < (us/1000) )
msleep(1); msleep(1);
else else
msleep( (us/1000) + 1); msleep( (us/1000) + 1);
#endif
} }
@ -977,29 +842,17 @@ void _rtw_udelay_os(int us, const char *func, const int line)
#else #else
void rtw_mdelay_os(int ms) void rtw_mdelay_os(int ms)
{ {
#ifdef PLATFORM_LINUX
mdelay((unsigned long)ms); mdelay((unsigned long)ms);
#endif
} }
void rtw_udelay_os(int us) void rtw_udelay_os(int us)
{ {
#ifdef PLATFORM_LINUX
udelay((unsigned long)us); udelay((unsigned long)us);
#endif
} }
#endif #endif
void rtw_yield_os() void rtw_yield_os()
{ {
#ifdef PLATFORM_LINUX
yield(); yield();
#endif
} }
#define RTW_SUSPEND_LOCK_NAME "rtw_wifi" #define RTW_SUSPEND_LOCK_NAME "rtw_wifi"
@ -1086,75 +939,54 @@ inline void rtw_lock_ext_suspend_timeout(u32 timeout_ms)
inline void ATOMIC_SET(ATOMIC_T *v, int i) inline void ATOMIC_SET(ATOMIC_T *v, int i)
{ {
#ifdef PLATFORM_LINUX
atomic_set(v,i); atomic_set(v,i);
#endif
} }
inline int ATOMIC_READ(ATOMIC_T *v) inline int ATOMIC_READ(ATOMIC_T *v)
{ {
#ifdef PLATFORM_LINUX
return atomic_read(v); return atomic_read(v);
#endif
} }
inline void ATOMIC_ADD(ATOMIC_T *v, int i) inline void ATOMIC_ADD(ATOMIC_T *v, int i)
{ {
#ifdef PLATFORM_LINUX
atomic_add(i,v); atomic_add(i,v);
#endif
} }
inline void ATOMIC_SUB(ATOMIC_T *v, int i) inline void ATOMIC_SUB(ATOMIC_T *v, int i)
{ {
#ifdef PLATFORM_LINUX
atomic_sub(i,v); atomic_sub(i,v);
#endif
} }
inline void ATOMIC_INC(ATOMIC_T *v) inline void ATOMIC_INC(ATOMIC_T *v)
{ {
#ifdef PLATFORM_LINUX
atomic_inc(v); atomic_inc(v);
#endif
} }
inline void ATOMIC_DEC(ATOMIC_T *v) inline void ATOMIC_DEC(ATOMIC_T *v)
{ {
#ifdef PLATFORM_LINUX
atomic_dec(v); atomic_dec(v);
#endif
} }
inline int ATOMIC_ADD_RETURN(ATOMIC_T *v, int i) inline int ATOMIC_ADD_RETURN(ATOMIC_T *v, int i)
{ {
#ifdef PLATFORM_LINUX
return atomic_add_return(i,v); return atomic_add_return(i,v);
#endif
} }
inline int ATOMIC_SUB_RETURN(ATOMIC_T *v, int i) inline int ATOMIC_SUB_RETURN(ATOMIC_T *v, int i)
{ {
#ifdef PLATFORM_LINUX
return atomic_sub_return(i,v); return atomic_sub_return(i,v);
#endif
} }
inline int ATOMIC_INC_RETURN(ATOMIC_T *v) inline int ATOMIC_INC_RETURN(ATOMIC_T *v)
{ {
#ifdef PLATFORM_LINUX
return atomic_inc_return(v); return atomic_inc_return(v);
#endif
} }
inline int ATOMIC_DEC_RETURN(ATOMIC_T *v) inline int ATOMIC_DEC_RETURN(ATOMIC_T *v)
{ {
#ifdef PLATFORM_LINUX
return atomic_dec_return(v); return atomic_dec_return(v);
#endif
} }
#ifdef PLATFORM_LINUX
/* /*
* Open a file with the specific @param path, @param flag, @param mode * Open a file with the specific @param path, @param flag, @param mode
* @param fpp the pointer of struct file pointer to get struct file pointer while file opening is success * @param fpp the pointer of struct file pointer to get struct file pointer while file opening is success
@ -1326,7 +1158,6 @@ static int storeToFile(char *path, u8* buf, u32 sz)
} }
return ret; return ret;
} }
#endif //PLATFORM_LINUX
/* /*
* Test if the specifi @param path is a file and readable * Test if the specifi @param path is a file and readable
@ -1335,15 +1166,10 @@ static int storeToFile(char *path, u8* buf, u32 sz)
*/ */
int rtw_is_file_readable(char *path) int rtw_is_file_readable(char *path)
{ {
#ifdef PLATFORM_LINUX
if(isFileReadable(path) == 0) if(isFileReadable(path) == 0)
return _TRUE; return _TRUE;
else else
return _FALSE; return _FALSE;
#else
//Todo...
return _FALSE;
#endif
} }
/* /*
@ -1355,13 +1181,8 @@ int rtw_is_file_readable(char *path)
*/ */
int rtw_retrive_from_file(char *path, u8* buf, u32 sz) int rtw_retrive_from_file(char *path, u8* buf, u32 sz)
{ {
#ifdef PLATFORM_LINUX
int ret =retriveFromFile(path, buf, sz); int ret =retriveFromFile(path, buf, sz);
return ret>=0?ret:0; return ret>=0?ret:0;
#else
//Todo...
return 0;
#endif
} }
/* /*
@ -1373,17 +1194,11 @@ int rtw_retrive_from_file(char *path, u8* buf, u32 sz)
*/ */
int rtw_store_to_file(char *path, u8* buf, u32 sz) int rtw_store_to_file(char *path, u8* buf, u32 sz)
{ {
#ifdef PLATFORM_LINUX
int ret =storeToFile(path, buf, sz); int ret =storeToFile(path, buf, sz);
return ret>=0?ret:0; return ret>=0?ret:0;
#else
//Todo...
return 0;
#endif
} }
#if 1 //#ifdef MEM_ALLOC_REFINE_ADAPTOR #if 1 //#ifdef MEM_ALLOC_REFINE_ADAPTOR
#ifdef PLATFORM_LINUX
struct net_device *rtw_alloc_etherdev_with_old_priv(int sizeof_priv, void *old_priv) struct net_device *rtw_alloc_etherdev_with_old_priv(int sizeof_priv, void *old_priv)
{ {
struct net_device *pnetdev; struct net_device *pnetdev;
@ -1517,7 +1332,6 @@ error:
return -1; return -1;
} }
#endif
#endif //MEM_ALLOC_REFINE_ADAPTOR #endif //MEM_ALLOC_REFINE_ADAPTOR
#ifdef CONFIG_PLATFORM_SPRD #ifdef CONFIG_PLATFORM_SPRD
@ -1529,17 +1343,13 @@ error:
u64 rtw_modular64(u64 x, u64 y) u64 rtw_modular64(u64 x, u64 y)
{ {
#ifdef PLATFORM_LINUX
return do_div(x, y); return do_div(x, y);
#endif
} }
u64 rtw_division64(u64 x, u64 y) u64 rtw_division64(u64 x, u64 y)
{ {
#ifdef PLATFORM_LINUX
do_div(x, y); do_div(x, y);
return x; return x;
#endif
} }
void rtw_buf_free(u8 **buf, u32 *buf_len) void rtw_buf_free(u8 **buf, u32 *buf_len)