rtl8723ds: Remove PLATFORM_LINUX symbol - it is the only one supported

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2017-10-16 23:17:59 -05:00
parent 58d8344823
commit 3c1cb50012
43 changed files with 104 additions and 647 deletions

View File

@ -2346,7 +2346,6 @@ u8 mac_hidden_wl_func_to_hal_wl_func(u8 func)
return wl_func; return wl_func;
} }
#ifdef PLATFORM_LINUX
#ifdef CONFIG_ADAPTOR_INFO_CACHING_FILE #ifdef CONFIG_ADAPTOR_INFO_CACHING_FILE
/* #include <rtw_eeprom.h> */ /* #include <rtw_eeprom.h> */
@ -2608,5 +2607,3 @@ exit:
return ret; return ret;
} }
#endif /* CONFIG_EFUSE_CONFIG_FILE */ #endif /* CONFIG_EFUSE_CONFIG_FILE */
#endif /* PLATFORM_LINUX */

View File

@ -162,7 +162,6 @@ static void _init_mp_priv_(struct mp_priv *pmp_priv)
} }
#ifdef PLATFORM_LINUX
static int init_mp_priv_by_os(struct mp_priv *pmp_priv) static int init_mp_priv_by_os(struct mp_priv *pmp_priv)
{ {
int i, res; int i, res;
@ -203,7 +202,6 @@ _exit_init_mp_priv:
return res; return res;
} }
#endif
static void mp_init_xmit_attrib(struct mp_tx *pmptx, PADAPTER padapter) static void mp_init_xmit_attrib(struct mp_tx *pmptx, PADAPTER padapter)
{ {
@ -1757,11 +1755,9 @@ void SetPacketTx(PADAPTER padapter)
rtw_mfree(pmp_priv->TXradomBuffer, 4096); rtw_mfree(pmp_priv->TXradomBuffer, 4096);
/* 3 6. start thread */ /* 3 6. start thread */
#ifdef PLATFORM_LINUX
pmp_priv->tx.PktTxThread = kthread_run(mp_xmit_packet_thread, pmp_priv, "RTW_MP_THREAD"); pmp_priv->tx.PktTxThread = kthread_run(mp_xmit_packet_thread, pmp_priv, "RTW_MP_THREAD");
if (IS_ERR(pmp_priv->tx.PktTxThread)) if (IS_ERR(pmp_priv->tx.PktTxThread))
RTW_INFO("Create PktTx Thread Fail !!!!!\n"); RTW_INFO("Create PktTx Thread Fail !!!!!\n");
#endif
Rtw_MPSetMacTxEDCA(padapter); Rtw_MPSetMacTxEDCA(padapter);
exit: exit:
@ -1909,11 +1905,9 @@ u32 mp_query_psd(PADAPTER pAdapter, u8 *data)
u32 psd_data = 0; u32 psd_data = 0;
#ifdef PLATFORM_LINUX
if (!netif_running(pAdapter->pnetdev)) { if (!netif_running(pAdapter->pnetdev)) {
return 0; return 0;
} }
#endif
if (check_fwstate(&pAdapter->mlmepriv, WIFI_MP_STATE) == _FALSE) { if (check_fwstate(&pAdapter->mlmepriv, WIFI_MP_STATE) == _FALSE) {
return 0; return 0;

View File

@ -2325,11 +2325,9 @@ NDIS_STATUS oid_rt_set_power_down_hdl(struct oid_par_priv *poid_par_priv)
{ {
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
if (poid_par_priv->type_of_oid != SET_OID) { if (poid_par_priv->type_of_oid != SET_OID) {
@ -2342,10 +2340,8 @@ NDIS_STATUS oid_rt_set_power_down_hdl(struct oid_par_priv *poid_par_priv)
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

@ -2400,7 +2400,6 @@ 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)
@ -2456,7 +2455,6 @@ static void recvframe_expand_pkt(
#else #else
#warning "recvframe_expand_pkt not implement, defrag may crash system" #warning "recvframe_expand_pkt not implement, defrag may crash system"
#endif #endif
#endif
/* perform defrag */ /* perform defrag */
union recv_frame *recvframe_defrag(_adapter *adapter, _queue *defrag_q); union recv_frame *recvframe_defrag(_adapter *adapter, _queue *defrag_q);

View File

@ -264,7 +264,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
@ -292,7 +292,7 @@ void sreset_start_adapter(_adapter *padapter)
sreset_restore_network_status(padapter); sreset_restore_network_status(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

@ -4966,9 +4966,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;
} }
@ -4978,7 +4976,6 @@ int rtw_sctx_wait(struct submit_ctx *sctx, const char *msg)
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?? */
@ -4986,7 +4983,6 @@ int rtw_sctx_wait(struct submit_ctx *sctx, const char *msg)
RTW_INFO("%s timeout: %s\n", __func__, msg); RTW_INFO("%s timeout: %s\n", __func__, msg);
} 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;
@ -5015,9 +5011,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))
RTW_INFO("%s status:%d\n", __func__, status); RTW_INFO("%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

@ -25,9 +25,7 @@
#define BT_TMP_BUF_SIZE 100 #define BT_TMP_BUF_SIZE 100
#ifdef PLATFORM_LINUX
#define rsprintf snprintf #define rsprintf snprintf
#endif
#define DCMD_Printf DBG_BT_INFO #define DCMD_Printf DBG_BT_INFO

View File

@ -1,80 +1 @@
#pragma once
#ifndef __INC_HW_IMG_H
#define __INC_HW_IMG_H
//
// 2011/03/15 MH Add for different IC HW image file selection. code size consideration.
//
#if RT_PLATFORM == PLATFORM_LINUX
#if (DEV_BUS_TYPE == RT_PCI_INTERFACE)
// For 92C
#define RTL8192CE_HWIMG_SUPPORT 1
#define RTL8192CE_TEST_HWIMG_SUPPORT 0
#define RTL8192CU_HWIMG_SUPPORT 0
#define RTL8192CU_TEST_HWIMG_SUPPORT 0
// For 92D
#define RTL8192DE_HWIMG_SUPPORT 1
#define RTL8192DE_TEST_HWIMG_SUPPORT 0
#define RTL8192DU_HWIMG_SUPPORT 0
#define RTL8192DU_TEST_HWIMG_SUPPORT 0
// For 8723
#define RTL8723E_HWIMG_SUPPORT 1
#define RTL8723U_HWIMG_SUPPORT 0
#define RTL8723S_HWIMG_SUPPORT 0
//For 88E
#define RTL8188EE_HWIMG_SUPPORT 0
#define RTL8188EU_HWIMG_SUPPORT 0
#define RTL8188ES_HWIMG_SUPPORT 0
#elif (DEV_BUS_TYPE == RT_USB_INTERFACE)
// For 92C
#define RTL8192CE_HWIMG_SUPPORT 0
#define RTL8192CE_TEST_HWIMG_SUPPORT 0
#define RTL8192CU_HWIMG_SUPPORT 1
#define RTL8192CU_TEST_HWIMG_SUPPORT 0
//For 92D
#define RTL8192DE_HWIMG_SUPPORT 0
#define RTL8192DE_TEST_HWIMG_SUPPORT 0
#define RTL8192DU_HWIMG_SUPPORT 1
#define RTL8192DU_TEST_HWIMG_SUPPORT 0
// For 8723
#define RTL8723E_HWIMG_SUPPORT 0
#define RTL8723U_HWIMG_SUPPORT 1
#define RTL8723S_HWIMG_SUPPORT 0
//For 88E
#define RTL8188EE_HWIMG_SUPPORT 0
#define RTL8188EU_HWIMG_SUPPORT 0
#define RTL8188ES_HWIMG_SUPPORT 0
#elif (DEV_BUS_TYPE == RT_SDIO_INTERFACE)
// For 92C
#define RTL8192CE_HWIMG_SUPPORT 0
#define RTL8192CE_TEST_HWIMG_SUPPORT 0
#define RTL8192CU_HWIMG_SUPPORT 1
#define RTL8192CU_TEST_HWIMG_SUPPORT 0
//For 92D
#define RTL8192DE_HWIMG_SUPPORT 0
#define RTL8192DE_TEST_HWIMG_SUPPORT 0
#define RTL8192DU_HWIMG_SUPPORT 1
#define RTL8192DU_TEST_HWIMG_SUPPORT 0
// For 8723
#define RTL8723E_HWIMG_SUPPORT 0
#define RTL8723U_HWIMG_SUPPORT 0
#define RTL8723S_HWIMG_SUPPORT 1
//For 88E
#define RTL8188EE_HWIMG_SUPPORT 0
#define RTL8188EU_HWIMG_SUPPORT 0
#define RTL8188ES_HWIMG_SUPPORT 0
#endif
#endif //__INC_HW_IMG_H

View File

@ -2334,11 +2334,7 @@ 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) (odm_ConvertTo_dB(psd_report))+(u4Byte)(initial_gain_psd-0x1c); psd_report = (u4Byte) (odm_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;

View File

@ -492,10 +492,6 @@ typedef enum _BASEBAND_CONFIG_PHY_REG_PG_VALUE_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_WIN) #if(DM_ODM_SUPPORT_TYPE & ODM_WIN)
#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
@ -927,11 +923,7 @@ typedef struct DM_Out_Source_Dynamic_Mechanism_Structure
#if(DM_ODM_SUPPORT_TYPE & ODM_WIN) #if(DM_ODM_SUPPORT_TYPE & ODM_WIN)
#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

@ -71,9 +71,7 @@ static void rtl8723ds_recv_tasklet(void *priv)
/* The case of can't allocate recvframe should be temporary, */ /* The case of can't allocate 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;
} }
@ -207,9 +205,7 @@ static void rtl8723ds_recv_tasklet(void *priv)
/* The case of can't allocate recvframe should be temporary, */ /* The case of can't allocate 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;
} }
@ -283,9 +279,7 @@ static void rtl8723ds_recv_tasklet(void *priv)
/* The case of can't allocate skb is serious and may never be recovered, */ /* The case of can't allocate 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 (!rtw_is_drv_stopped(padapter)) { if (!rtw_is_drv_stopped(padapter)) {
#ifdef PLATFORM_LINUX
tasklet_schedule(&precvpriv->recv_tasklet); tasklet_schedule(&precvpriv->recv_tasklet);
#endif
} }
return; return;
@ -426,11 +420,9 @@ s32 rtl8723ds_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))rtl8723ds_recv_tasklet, (void(*)(unsigned long))rtl8723ds_recv_tasklet,
(unsigned long)padapter); (unsigned long)padapter);
#endif
goto exit; goto exit;
@ -474,9 +466,7 @@ void rtl8723ds_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;

View File

@ -1452,9 +1452,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

@ -30,9 +30,6 @@
#endif #endif
#define CONFIG_SDIO_HCI #define CONFIG_SDIO_HCI
#define PLATFORM_LINUX
/* /*
* Wi-Fi Functions Config * Wi-Fi Functions Config
*/ */

View File

@ -36,43 +36,41 @@
#define _FALSE FALSE #define _FALSE FALSE
#endif #endif
#ifdef PLATFORM_LINUX #include <linux/version.h>
#include <linux/version.h> #include <linux/types.h>
#include <linux/types.h> #include <linux/module.h>
#include <linux/module.h> #include <linux/kernel.h>
#include <linux/kernel.h> #include <linux/init.h>
#include <linux/init.h> #include <linux/utsname.h>
#include <linux/utsname.h> #define IN
#define IN #define OUT
#define OUT #define VOID void
#define VOID void #define NDIS_OID uint
#define NDIS_OID uint #define NDIS_STATUS uint
#define NDIS_STATUS uint
typedef signed int sint; typedef signed int sint;
#ifndef PVOID
typedef void *PVOID;
/* #define PVOID (void *) */
#endif
#define UCHAR u8
#define USHORT u16
#define UINT u32
#define ULONG u32
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19))
typedef _Bool bool;
#endif
typedef void (*proc_t)(void *);
typedef __kernel_size_t SIZE_T;
typedef __kernel_ssize_t SSIZE_T;
#define FIELD_OFFSET(s, field) ((SSIZE_T)&((s *)(0))->field)
#ifndef PVOID
typedef void *PVOID;
/* #define PVOID (void *) */
#endif #endif
#define UCHAR u8
#define USHORT u16
#define UINT u32
#define ULONG u32
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19))
typedef _Bool bool;
#endif
typedef void (*proc_t)(void *);
typedef __kernel_size_t SIZE_T;
typedef __kernel_ssize_t SSIZE_T;
#define FIELD_OFFSET(s, field) ((SSIZE_T)&((s *)(0))->field)
#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

@ -97,50 +97,46 @@
* *
*/ */
/*
#if defined(PLATFORM_LINUX) * inside the kernel, we can use nicknames;
/* * outside of it, we must avoid POSIX namespace pollution...
* inside the kernel, we can use nicknames; */
* outside of it, we must avoid POSIX namespace pollution... #define cpu_to_le64 __cpu_to_le64
*/ #define le64_to_cpu __le64_to_cpu
#define cpu_to_le64 __cpu_to_le64 #define cpu_to_le32 __cpu_to_le32
#define le64_to_cpu __le64_to_cpu #define le32_to_cpu __le32_to_cpu
#define cpu_to_le32 __cpu_to_le32 #define cpu_to_le16 __cpu_to_le16
#define le32_to_cpu __le32_to_cpu #define le16_to_cpu __le16_to_cpu
#define cpu_to_le16 __cpu_to_le16 #define cpu_to_be64 __cpu_to_be64
#define le16_to_cpu __le16_to_cpu #define be64_to_cpu __be64_to_cpu
#define cpu_to_be64 __cpu_to_be64 #define cpu_to_be32 __cpu_to_be32
#define be64_to_cpu __be64_to_cpu #define be32_to_cpu __be32_to_cpu
#define cpu_to_be32 __cpu_to_be32 #define cpu_to_be16 __cpu_to_be16
#define be32_to_cpu __be32_to_cpu #define be16_to_cpu __be16_to_cpu
#define cpu_to_be16 __cpu_to_be16 #define cpu_to_le64p __cpu_to_le64p
#define be16_to_cpu __be16_to_cpu #define le64_to_cpup __le64_to_cpup
#define cpu_to_le64p __cpu_to_le64p #define cpu_to_le32p __cpu_to_le32p
#define le64_to_cpup __le64_to_cpup #define le32_to_cpup __le32_to_cpup
#define cpu_to_le32p __cpu_to_le32p #define cpu_to_le16p __cpu_to_le16p
#define le32_to_cpup __le32_to_cpup #define le16_to_cpup __le16_to_cpup
#define cpu_to_le16p __cpu_to_le16p #define cpu_to_be64p __cpu_to_be64p
#define le16_to_cpup __le16_to_cpup #define be64_to_cpup __be64_to_cpup
#define cpu_to_be64p __cpu_to_be64p #define cpu_to_be32p __cpu_to_be32p
#define be64_to_cpup __be64_to_cpup #define be32_to_cpup __be32_to_cpup
#define cpu_to_be32p __cpu_to_be32p #define cpu_to_be16p __cpu_to_be16p
#define be32_to_cpup __be32_to_cpup #define be16_to_cpup __be16_to_cpup
#define cpu_to_be16p __cpu_to_be16p #define cpu_to_le64s __cpu_to_le64s
#define be16_to_cpup __be16_to_cpup #define le64_to_cpus __le64_to_cpus
#define cpu_to_le64s __cpu_to_le64s #define cpu_to_le32s __cpu_to_le32s
#define le64_to_cpus __le64_to_cpus #define le32_to_cpus __le32_to_cpus
#define cpu_to_le32s __cpu_to_le32s #define cpu_to_le16s __cpu_to_le16s
#define le32_to_cpus __le32_to_cpus #define le16_to_cpus __le16_to_cpus
#define cpu_to_le16s __cpu_to_le16s #define cpu_to_be64s __cpu_to_be64s
#define le16_to_cpus __le16_to_cpus #define be64_to_cpus __be64_to_cpus
#define cpu_to_be64s __cpu_to_be64s #define cpu_to_be32s __cpu_to_be32s
#define be64_to_cpus __be64_to_cpus #define be32_to_cpus __be32_to_cpus
#define cpu_to_be32s __cpu_to_be32s #define cpu_to_be16s __cpu_to_be16s
#define be32_to_cpus __be32_to_cpus #define be16_to_cpus __be16_to_cpus
#define cpu_to_be16s __cpu_to_be16s
#define be16_to_cpus __be16_to_cpus
#endif
/* /*
* Handle ntohl and suches. These have various compatibility * Handle ntohl and suches. These have various compatibility
@ -165,15 +161,10 @@
* 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); extern unsigned short int ntohs(unsigned short int);
#else /* defined(PLATFORM_LINUX) || (defined (__GLIBC__) && __GLIBC__ >= 2) */ extern unsigned short int htons(unsigned short int);
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 htons(unsigned short int);
#if defined(__GNUC__) && (__GNUC__ >= 2) && defined(__OPTIMIZE__) || defined(PLATFORM_MPIXEL) #if defined(__GNUC__) && (__GNUC__ >= 2) && defined(__OPTIMIZE__) || defined(PLATFORM_MPIXEL)
@ -182,13 +173,8 @@
#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

@ -118,16 +118,14 @@ __inline static const __u32 __fswab32(__u32 x)
return __arch__swab32(x); return __arch__swab32(x);
} }
#if defined(PLATFORM_LINUX) #define swab16 __swab16
#define swab16 __swab16 #define swab32 __swab32
#define swab32 __swab32 #define swab64 __swab64
#define swab64 __swab64 #define swab16p __swab16p
#define swab16p __swab16p #define swab32p __swab32p
#define swab32p __swab32p #define swab64p __swab64p
#define swab64p __swab64p #define swab16s __swab16s
#define swab16s __swab16s #define swab32s __swab32s
#define swab32s __swab32s #define swab64s __swab64s
#define swab64s __swab64s
#endif
#endif /* _LINUX_BYTEORDER_SWAB_H */ #endif /* _LINUX_BYTEORDER_SWAB_H */

View File

@ -144,13 +144,11 @@ __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

@ -3,10 +3,7 @@
#include <drv_conf.h> #include <drv_conf.h>
#include <osdep_service.h> #include <osdep_service.h>
#include <drv_types_linux.h>
#ifdef PLATFORM_LINUX
#include <drv_types_linux.h>
#endif
typedef enum cust_gpio_modes { typedef enum cust_gpio_modes {
WLAN_PWDN_ON, WLAN_PWDN_ON,

View File

@ -39,9 +39,7 @@
#include <net/arp.h> #include <net/arp.h>
#endif #endif
#ifdef PLATFORM_LINUX
#include <drv_types_linux.h> #include <drv_types_linux.h>
#endif
#ifndef is_compat_task #ifndef is_compat_task
#define is_compat_task() 0 #define is_compat_task() 0
@ -968,10 +966,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 */
@ -979,7 +975,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 */
@ -1020,7 +1015,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 */
@ -1073,12 +1067,9 @@ static inline void dev_clr_drv_stopped(struct dvobj_priv *dvobj)
#define dev_is_surprise_removed(dvobj) (ATOMIC_READ(&dvobj->bSurpriseRemoved) == _TRUE) #define dev_is_surprise_removed(dvobj) (ATOMIC_READ(&dvobj->bSurpriseRemoved) == _TRUE)
#define dev_is_drv_stopped(dvobj) (ATOMIC_READ(&dvobj->bDriverStopped) == _TRUE) #define dev_is_drv_stopped(dvobj) (ATOMIC_READ(&dvobj->bDriverStopped) == _TRUE)
#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;
@ -1093,7 +1084,6 @@ static struct device *dvobj_to_dev(struct dvobj_priv *dvobj)
return &dvobj->ppcidev->dev; return &dvobj->ppcidev->dev;
#endif #endif
} }
#endif
_adapter *dvobj_get_port0_adapter(struct dvobj_priv *dvobj); _adapter *dvobj_get_port0_adapter(struct dvobj_priv *dvobj);
_adapter *dvobj_get_unregisterd_adapter(struct dvobj_priv *dvobj); _adapter *dvobj_get_unregisterd_adapter(struct dvobj_priv *dvobj);
@ -1261,11 +1251,6 @@ struct _ADAPTER {
_thread_hdl_ recvThread; _thread_hdl_ recvThread;
u8 registered; u8 registered;
#ifndef PLATFORM_LINUX
NDIS_STATUS(*dvobj_init)(struct dvobj_priv *dvobj);
void (*dvobj_deinit)(struct dvobj_priv *dvobj);
#endif
u32(*intf_init)(struct dvobj_priv *dvobj); u32(*intf_init)(struct dvobj_priv *dvobj);
void (*intf_deinit)(struct dvobj_priv *dvobj); void (*intf_deinit)(struct dvobj_priv *dvobj);
int (*intf_alloc_irq)(struct dvobj_priv *dvobj); int (*intf_alloc_irq)(struct dvobj_priv *dvobj);
@ -1275,7 +1260,6 @@ struct _ADAPTER {
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;
char old_ifname[IFNAMSIZ]; char old_ifname[IFNAMSIZ];
@ -1308,8 +1292,6 @@ struct _ADAPTER {
#endif /* CONFIG_IOCTL_CFG80211 */ #endif /* CONFIG_IOCTL_CFG80211 */
#endif /* PLATFORM_LINUX */
u8 mac_addr[ETH_ALEN]; u8 mac_addr[ETH_ALEN];
int net_closed; int net_closed;

View File

@ -21,7 +21,6 @@
#define __DRV_TYPES_GSPI_H__ #define __DRV_TYPES_GSPI_H__
/* SPI Header Files */ /* SPI Header Files */
#ifdef PLATFORM_LINUX
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include <linux/gpio.h> #include <linux/gpio.h>
@ -33,7 +32,6 @@
#include <mach/hardware.h> #include <mach/hardware.h>
#include <mach/irqs.h> #include <mach/irqs.h>
#include <custom_gpio.h> #include <custom_gpio.h>
#endif
typedef struct gspi_data { typedef struct gspi_data {
@ -43,12 +41,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

@ -21,9 +21,7 @@
#define __DRV_TYPES_PCI_H__ #define __DRV_TYPES_PCI_H__
#ifdef PLATFORM_LINUX #include <linux/pci.h>
#include <linux/pci.h>
#endif
#define INTEL_VENDOR_ID 0x8086 #define INTEL_VENDOR_ID 0x8086

View File

@ -21,7 +21,6 @@
#define __DRV_TYPES_SDIO_H__ #define __DRV_TYPES_SDIO_H__
/* SDIO Header Files */ /* SDIO Header Files */
#ifdef PLATFORM_LINUX
#include <linux/mmc/sdio_func.h> #include <linux/mmc/sdio_func.h>
#include <linux/mmc/sdio_ids.h> #include <linux/mmc/sdio_ids.h>
#include <linux/mmc/host.h> #include <linux/mmc/host.h>
@ -31,7 +30,6 @@
#include <linux/gpio.h> #include <linux/gpio.h>
#include <custom_gpio.h> #include <custom_gpio.h>
#endif /* CONFIG_PLATFORM_SPRD */ #endif /* CONFIG_PLATFORM_SPRD */
#endif
typedef struct sdio_data { typedef struct sdio_data {
u8 func_number; u8 func_number;
@ -40,12 +38,9 @@ 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;
unsigned int clock; unsigned int clock;
#endif
} SDIO_DATA, *PSDIO_DATA; } SDIO_DATA, *PSDIO_DATA;
#define dvobj_to_sdio_func(d) ((d)->intf_data.func) #define dvobj_to_sdio_func(d) ((d)->intf_data.func)

View File

@ -333,8 +333,6 @@ struct ieee_ibss_seq {
_list list; _list list;
}; };
#if defined(PLATFORM_LINUX) || defined(CONFIG_RTL8711FW)
struct rtw_ieee80211_hdr { struct rtw_ieee80211_hdr {
u16 frame_ctl; u16 frame_ctl;
u16 duration_id; u16 duration_id;
@ -384,8 +382,6 @@ struct eapol {
u16 length; u16 length;
} __attribute__((packed)); } __attribute__((packed));
#endif
enum eap_type { enum eap_type {
EAP_PACKET = 0, EAP_PACKET = 0,
EAPOL_START, EAPOL_START,
@ -494,8 +490,6 @@ enum eap_type {
#define P80211_OUI_LEN 3 #define P80211_OUI_LEN 3
#if defined(PLATFORM_LINUX) || defined(CONFIG_RTL8711FW)
struct ieee80211_snap_hdr { struct ieee80211_snap_hdr {
u8 dsap; /* always 0xAA */ u8 dsap; /* always 0xAA */
@ -505,8 +499,6 @@ struct ieee80211_snap_hdr {
} __attribute__((packed)); } __attribute__((packed));
#endif
#define SNAP_SIZE sizeof(struct ieee80211_snap_hdr) #define SNAP_SIZE sizeof(struct ieee80211_snap_hdr)
#define WLAN_FC_GET_TYPE(fc) ((fc) & RTW_IEEE80211_FCTL_FTYPE) #define WLAN_FC_GET_TYPE(fc) ((fc) & RTW_IEEE80211_FCTL_FTYPE)
@ -1033,8 +1025,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,
@ -1047,8 +1037,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
@ -1089,8 +1077,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;
@ -1101,7 +1087,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
@ -1123,10 +1108,6 @@ struct ieee80211_info_element {
#define IEEE80211_DEFAULT_TX_ESSID "Penguin" #define IEEE80211_DEFAULT_TX_ESSID "Penguin"
#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;
@ -1135,7 +1116,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];
@ -1164,7 +1144,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,8 +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

@ -90,8 +90,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;
@ -113,7 +111,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

@ -48,7 +48,6 @@ struct intf_priv {
_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;
@ -60,7 +59,6 @@ struct intf_priv {
u8 bio_irp_timeout; u8 bio_irp_timeout;
u8 bio_timer_cancel; u8 bio_timer_cancel;
#endif #endif
#endif
}; };
@ -86,7 +84,6 @@ void rtw_cancel_all_timer(_adapter *padapter);
uint loadparam(_adapter *adapter); uint loadparam(_adapter *adapter);
#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);
@ -113,8 +110,6 @@ void rtw_ndev_notifier_unregister(void);
#include "../os_dep/linux/ioctl_cfg80211.h" #include "../os_dep/linux/ioctl_cfg80211.h"
#endif /* CONFIG_IOCTL_CFG80211 */ #endif /* CONFIG_IOCTL_CFG80211 */
#endif /* PLATFORM_LINUX */
void rtw_ips_dev_unload(_adapter *padapter); void rtw_ips_dev_unload(_adapter *padapter);
#ifdef CONFIG_IPS #ifdef CONFIG_IPS

View File

@ -32,10 +32,7 @@
#undef _FALSE #undef _FALSE
#define _FALSE 0 #define _FALSE 0
#include <osdep_service_linux.h>
#ifdef PLATFORM_LINUX
#include <osdep_service_linux.h>
#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)
@ -328,49 +325,34 @@ extern void rtw_init_timer(_timer *ptimer, void *padapter, void *pfunc);
__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)
{ {
#if defined(PLATFORM_LINUX) || defined (PLATFORM_MPIXEL)
return res; return res;
#endif
} }
__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
__inline static int rtw_bug_check(void *parg1, void *parg2, void *parg3, void *parg4) __inline static int rtw_bug_check(void *parg1, void *parg2, void *parg3, void *parg4)
{ {
@ -630,10 +612,6 @@ char alpha_to_upper(char c);
/* /*
* Write formatted output to sized buffer * Write formatted output to sized buffer
*/ */
#ifdef PLATFORM_LINUX
#define rtw_sprintf(buf, size, format, arg...) snprintf(buf, size, format, ##arg) #define rtw_sprintf(buf, size, format, arg...) snprintf(buf, size, format, ##arg)
#else /* !PLATFORM_LINUX */
#error "NOT DEFINE \"rtw_sprintf\"!!"
#endif /* !PLATFORM_LINUX */
#endif #endif

View File

@ -57,12 +57,10 @@ void rtw_os_read_port(_adapter *padapter, struct recv_buf *precvbuf);
void rtw_init_recv_timer(struct recv_reorder_ctrl *preorder_ctrl); void rtw_init_recv_timer(struct recv_reorder_ctrl *preorder_ctrl);
#ifdef PLATFORM_LINUX
#ifdef CONFIG_RTW_NAPI #ifdef CONFIG_RTW_NAPI
#include <linux/netdevice.h> /* struct napi_struct */ #include <linux/netdevice.h> /* struct napi_struct */
int rtw_recv_napi_poll(struct napi_struct *, int budget); int rtw_recv_napi_poll(struct napi_struct *, int budget);
#endif /* CONFIG_RTW_NAPI */ #endif /* CONFIG_RTW_NAPI */
#endif /* PLATFORM_LINUX */
#endif /* */ #endif /* */

View File

@ -63,10 +63,8 @@ enum {
#undef _dbgdump #undef _dbgdump
#undef _seqdump #undef _seqdump
#if defined PLATFORM_LINUX #define _dbgdump printk
#define _dbgdump printk #define _seqdump seq_printf
#define _seqdump seq_printf
#endif
#ifdef CONFIG_RTW_DEBUG #ifdef CONFIG_RTW_DEBUG

View File

@ -110,12 +110,10 @@ 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, u8 *efuse_data); extern int storeAdaptorInfoFile(char *path, u8 *efuse_data);
extern int retriveAdaptorInfoFile(char *path, u8 *efuse_data); extern int retriveAdaptorInfoFile(char *path, u8 *efuse_data);
#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

@ -233,12 +233,10 @@ extern const u8 _mac_hidden_proto_to_hal_proto_cap[];
u8 mac_hidden_wl_func_to_hal_wl_func(u8 func); u8 mac_hidden_wl_func_to_hal_wl_func(u8 func);
#ifdef PLATFORM_LINUX
u8 rtw_efuse_file_read(PADAPTER padapter, u8 *filepatch, u8 *buf, u32 len); u8 rtw_efuse_file_read(PADAPTER padapter, u8 *filepatch, u8 *buf, u32 len);
#ifdef CONFIG_EFUSE_CONFIG_FILE #ifdef CONFIG_EFUSE_CONFIG_FILE
u32 rtw_read_efuse_from_file(const char *path, u8 *buf, int map_size); u32 rtw_read_efuse_from_file(const char *path, u8 *buf, int map_size);
u32 rtw_read_macaddr_from_file(const char *path, u8 *buf); u32 rtw_read_macaddr_from_file(const char *path, u8 *buf);
#endif /* CONFIG_EFUSE_CONFIG_FILE */ #endif /* CONFIG_EFUSE_CONFIG_FILE */
#endif /* PLATFORM_LINUX */
#endif #endif

View File

@ -23,9 +23,7 @@
#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

@ -157,7 +157,7 @@ static NDIS_STATUS oid_null_function(struct oid_par_priv *poid_par_priv)
} }
#endif #endif
#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

@ -44,9 +44,7 @@ struct mp_xmit_frame {
u8 *mem_addr; u8 *mem_addr;
u32 sz[8]; u32 sz[8];
#if defined(PLATFORM_LINUX)
PURB pxmit_urb[8]; PURB pxmit_urb[8];
#endif
u8 bpending[8]; u8 bpending[8];
sint ac_tag[8]; sint ac_tag[8];
sint last[8]; sint last[8];

View File

@ -390,15 +390,12 @@ struct recv_priv {
ATOMIC_T rx_pending_cnt; ATOMIC_T 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 */
#endif #endif
#if defined(PLATFORM_LINUX)
struct tasklet_struct irq_prepare_beacon_tasklet; struct tasklet_struct irq_prepare_beacon_tasklet;
struct tasklet_struct recv_tasklet; struct tasklet_struct recv_tasklet;
struct sk_buff_head free_recv_skb_queue; struct sk_buff_head free_recv_skb_queue;
@ -411,8 +408,6 @@ struct recv_priv {
struct ifqueue rx_indicate_queue; struct ifqueue rx_indicate_queue;
#endif /* CONFIG_RX_INDICATE_QUEUE */ #endif /* CONFIG_RX_INDICATE_QUEUE */
#endif /* defined(PLATFORM_LINUX) */
u8 *pallocated_recv_buf; u8 *pallocated_recv_buf;
u8 *precv_buf; /* 4 alignment */ u8 *precv_buf; /* 4 alignment */
_queue free_recv_buf_queue; _queue free_recv_buf_queue;
@ -500,20 +495,13 @@ struct recv_buf {
#ifdef CONFIG_USB_HCI #ifdef CONFIG_USB_HCI
#if defined(PLATFORM_LINUX)
PURB purb; PURB purb;
dma_addr_t dma_transfer_addr; /* (in) dma addr for transfer_buffer */ dma_addr_t dma_transfer_addr; /* (in) dma addr for transfer_buffer */
u32 alloc_sz; u32 alloc_sz;
#endif
u8 irp_pending; u8 irp_pending;
int transfer_len; int transfer_len;
#endif #endif
#ifdef PLATFORM_LINUX
_pkt *pskb; _pkt *pskb;
#endif
}; };

View File

@ -474,9 +474,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 {
@ -529,10 +527,8 @@ struct xmit_buf {
u8 bulkout_id; /* for halmac */ u8 bulkout_id; /* for halmac */
#endif /* RTW_HALMAC */ #endif /* RTW_HALMAC */
#if defined(PLATFORM_LINUX)
PURB pxmit_urb[8]; PURB pxmit_urb[8];
dma_addr_t dma_transfer_addr; /* (in) dma addr for transfer_buffer */ dma_addr_t dma_transfer_addr; /* (in) dma addr for transfer_buffer */
#endif
u8 bpending[8]; u8 bpending[8];
@ -715,9 +711,7 @@ struct xmit_priv {
_sema tx_retevt;/* all tx return event; */ _sema tx_retevt;/* all tx return event; */
u8 txirp_cnt; u8 txirp_cnt;
#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;
@ -731,16 +725,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
#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) #if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_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

@ -26,9 +26,7 @@
#define SDIO_ERR_VAL16 0xFFFF #define SDIO_ERR_VAL16 0xFFFF
#define SDIO_ERR_VAL32 0xFFFFFFFF #define SDIO_ERR_VAL32 0xFFFFFFFF
#ifdef PLATFORM_LINUX
#include <sdio_ops_linux.h> #include <sdio_ops_linux.h>
#endif
extern void sdio_set_intf_ops(_adapter *padapter, struct _io_ops *pops); extern void sdio_set_intf_ops(_adapter *padapter, struct _io_ops *pops);

View File

@ -35,9 +35,7 @@ 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
#include <usb_ops_linux.h> #include <usb_ops_linux.h>
#endif /* PLATFORM_LINUX */
#ifdef CONFIG_RTL8188E #ifdef CONFIG_RTL8188E
void rtl8188eu_set_hw_type(struct dvobj_priv *pdvobj); void rtl8188eu_set_hw_type(struct dvobj_priv *pdvobj);

View File

@ -769,7 +769,6 @@ typedef enum _ELEMENT_ID {
* 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;
@ -778,17 +777,11 @@ 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
#define IEEE80211_BAR_CTRL_CBMTID_COMPRESSED_BA 0x0004 #define IEEE80211_BAR_CTRL_CBMTID_COMPRESSED_BA 0x0004
#if defined(PLATFORM_LINUX) || defined(CONFIG_RTL8712FW)
/** /**
* struct rtw_ieee80211_ht_cap - HT capabilities * struct rtw_ieee80211_ht_cap - HT capabilities
* *
@ -859,8 +852,6 @@ struct ADDBA_request {
unsigned short BA_starting_seqctrl; unsigned short BA_starting_seqctrl;
} __attribute__((packed)); } __attribute__((packed));
#endif
typedef enum _HT_CAP_AMPDU_FACTOR { typedef enum _HT_CAP_AMPDU_FACTOR {
MAX_AMPDU_FACTOR_8K = 0, MAX_AMPDU_FACTOR_8K = 0,
MAX_AMPDU_FACTOR_16K = 1, MAX_AMPDU_FACTOR_16K = 1,

View File

@ -23,9 +23,6 @@
#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
@ -270,9 +267,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

@ -30,8 +30,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;
@ -43,8 +41,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 /* PLATFORM_LINUX */
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, u8 flag); int rtw_os_xmit_resource_alloc(_adapter *padapter, struct xmit_buf *pxmitbuf, u32 alloc_sz, u8 flag);

View File

@ -113,9 +113,7 @@ int rtw_os_alloc_recvframe(_adapter *padapter, union recv_frame *precvframe, u8
/* The case of can't allocate skb is serious and may never be recovered, /* The case of can't allocate 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 (!rtw_is_drv_stopped(secondary_padapter)) if (!rtw_is_drv_stopped(secondary_padapter))
#ifdef PLATFORM_LINUX
tasklet_schedule(&precvpriv->recv_tasklet); tasklet_schedule(&precvpriv->recv_tasklet);
#endif
return ret; return ret;
} }

View File

@ -26,14 +26,10 @@
#define RT_TAG '1178' #define RT_TAG '1178'
#ifdef DBG_MEMORY_LEAK #ifdef DBG_MEMORY_LEAK
#ifdef PLATFORM_LINUX
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
@ -50,12 +46,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)
{ {
@ -81,17 +71,13 @@ 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;
@ -100,24 +86,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 */
} }
@ -126,7 +106,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);
@ -134,14 +113,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;
@ -154,10 +130,7 @@ u8 *_rtw_zmalloc(u32 sz)
u8 *pbuf = _rtw_malloc(sz); u8 *pbuf = _rtw_malloc(sz);
if (pbuf != NULL) { if (pbuf != NULL) {
#ifdef PLATFORM_LINUX
memset(pbuf, 0, sz); memset(pbuf, 0, sz);
#endif
} }
return pbuf; return pbuf;
@ -166,7 +139,6 @@ 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);
@ -174,21 +146,16 @@ void _rtw_mfree(u8 *pbuf, u32 sz)
#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)
@ -198,57 +165,39 @@ 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 struct sk_buff *_rtw_pskb_copy(struct sk_buff *skb) inline struct sk_buff *_rtw_pskb_copy(struct sk_buff *skb)
{ {
#ifdef PLATFORM_LINUX
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36))
return pskb_copy(skb, in_interrupt() ? GFP_ATOMIC : GFP_KERNEL); return pskb_copy(skb, in_interrupt() ? GFP_ATOMIC : GFP_KERNEL);
#else #else
return skb_clone(skb, in_interrupt() ? GFP_ATOMIC : GFP_KERNEL); return skb_clone(skb, in_interrupt() ? GFP_ATOMIC : GFP_KERNEL);
#endif #endif
#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)
{ {
#if defined(PLATFORM_LINUX)
skb->dev = ndev; skb->dev = ndev;
return netif_rx(skb); return netif_rx(skb);
#endif
} }
#ifdef CONFIG_RTW_NAPI #ifdef CONFIG_RTW_NAPI
inline int _rtw_netif_receive_skb(_nic_hdl ndev, struct sk_buff *skb) inline int _rtw_netif_receive_skb(_nic_hdl ndev, struct sk_buff *skb)
{ {
#if defined(PLATFORM_LINUX)
skb->dev = ndev; skb->dev = ndev;
return netif_receive_skb(skb); return netif_receive_skb(skb);
#else
rtw_warn_on(1);
return -1;
#endif
} }
#ifdef CONFIG_RTW_GRO #ifdef CONFIG_RTW_GRO
inline gro_result_t _rtw_napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb) inline gro_result_t _rtw_napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb)
{ {
#if defined(PLATFORM_LINUX)
return napi_gro_receive(napi, skb); return napi_gro_receive(napi, skb);
#else
rtw_warn_on(1);
return -1;
#endif
} }
#endif /* CONFIG_RTW_GRO */ #endif /* CONFIG_RTW_GRO */
#endif /* CONFIG_RTW_NAPI */ #endif /* CONFIG_RTW_NAPI */
@ -264,23 +213,19 @@ 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 */
@ -760,54 +705,33 @@ void rtw_mfree2d(void *pbuf, int h, int w, int size)
void _rtw_memcpy(void *dst, const void *src, u32 sz) void _rtw_memcpy(void *dst, const void *src, u32 sz)
{ {
#if defined(PLATFORM_LINUX)
memcpy(dst, src, sz); memcpy(dst, src, sz);
#endif
} }
inline void _rtw_memmove(void *dst, const void *src, u32 sz) inline void _rtw_memmove(void *dst, const void *src, u32 sz)
{ {
#if defined(PLATFORM_LINUX)
memmove(dst, src, sz); memmove(dst, src, sz);
#else
#warning "no implementation\n"
#endif
} }
int _rtw_memcmp(const void *dst, const void *src, u32 sz) int _rtw_memcmp(const void *dst, const void *src, u32 sz)
{ {
#if defined(PLATFORM_LINUX)
/* under Linux/GNU/GLibc, the return value of memcmp for two same mem. chunk is 0 */ /* under Linux/GNU/GLibc, the return value of memcmp for two same mem. chunk is 0 */
if (!(memcmp(dst, src, sz))) if (!(memcmp(dst, src, sz)))
return _TRUE; return _TRUE;
else else
return _FALSE; return _FALSE;
#endif
} }
void _rtw_memset(void *pbuf, int c, u32 sz) void _rtw_memset(void *pbuf, int c, u32 sz)
{ {
#if defined(PLATFORM_LINUX)
memset(pbuf, c, sz); memset(pbuf, c, sz);
#endif
} }
void _rtw_init_listhead(_list *list) void _rtw_init_listhead(_list *list)
{ {
#ifdef PLATFORM_LINUX
INIT_LIST_HEAD(list); INIT_LIST_HEAD(list);
#endif
} }
/* /*
@ -817,42 +741,27 @@ 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
} }
void rtw_init_timer(_timer *ptimer, void *padapter, void *pfunc) void rtw_init_timer(_timer *ptimer, void *padapter, void *pfunc)
{ {
_adapter *adapter = (_adapter *)padapter; _adapter *adapter = (_adapter *)padapter;
#ifdef PLATFORM_LINUX
_init_timer(ptimer, adapter->pnetdev, pfunc, adapter); _init_timer(ptimer, adapter->pnetdev, pfunc, adapter);
#endif
} }
/* /*
@ -864,12 +773,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)
@ -878,62 +782,39 @@ 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);
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)
@ -942,42 +823,22 @@ 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)
@ -1008,46 +869,32 @@ 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) */
@ -1058,15 +905,11 @@ void rtw_sleep_schedulable(int ms)
if (schedule_timeout(delta) != 0) if (schedule_timeout(delta) != 0)
return ; return ;
return; return;
#endif
} }
void rtw_msleep_os(int ms) void rtw_msleep_os(int ms)
{ {
#ifdef PLATFORM_LINUX
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36))
if (ms < 20) { if (ms < 20) {
unsigned long us = ms * 1000UL; unsigned long us = ms * 1000UL;
@ -1074,13 +917,10 @@ void rtw_msleep_os(int ms)
} else } else
#endif #endif
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); */ /* msleep((unsigned int)us); */
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36))
usleep_range(us, us + 1); usleep_range(us, us + 1);
@ -1090,70 +930,35 @@ void rtw_usleep_os(int us)
else else
msleep((us / 1000) + 1); msleep((us / 1000) + 1);
#endif #endif
#endif
} }
#ifdef DBG_DELAY_OS #ifdef DBG_DELAY_OS
void _rtw_mdelay_os(int ms, const char *func, const int line) void _rtw_mdelay_os(int ms, const char *func, const int line)
{ {
RTW_INFO("%s:%d %s(%d)\n", func, line, __FUNCTION__, ms); RTW_INFO("%s:%d %s(%d)\n", func, line, __FUNCTION__, ms);
#if defined(PLATFORM_LINUX)
mdelay((unsigned long)ms); mdelay((unsigned long)ms);
#endif
} }
void _rtw_udelay_os(int us, const char *func, const int line) void _rtw_udelay_os(int us, const char *func, const int line)
{ {
#if 0
if (us > 1000) {
RTW_INFO("%s:%d %s(%d)\n", func, line, __FUNCTION__, us);
rtw_usleep_os(us);
return;
}
#endif
RTW_INFO("%s:%d %s(%d)\n", func, line, __FUNCTION__, us); RTW_INFO("%s:%d %s(%d)\n", func, line, __FUNCTION__, us);
#if defined(PLATFORM_LINUX)
udelay((unsigned long)us); udelay((unsigned long)us);
#endif
} }
#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) void rtw_yield_os(void)
{ {
#ifdef PLATFORM_LINUX
yield(); yield();
#endif
} }
#define RTW_SUSPEND_LOCK_NAME "rtw_wifi" #define RTW_SUSPEND_LOCK_NAME "rtw_wifi"
@ -1332,75 +1137,54 @@ inline void rtw_lock_resume_scan_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
@ -1592,7 +1376,6 @@ static int storeToFile(const 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
@ -1601,15 +1384,10 @@ static int storeToFile(const char *path, u8 *buf, u32 sz)
*/ */
int rtw_is_file_readable(const char *path) int rtw_is_file_readable(const char *path)
{ {
#ifdef PLATFORM_LINUX
if (isFileReadable(path, NULL) == 0) if (isFileReadable(path, NULL) == 0)
return _TRUE; return _TRUE;
else else
return _FALSE; return _FALSE;
#else
/* Todo... */
return _FALSE;
#endif
} }
/* /*
@ -1620,15 +1398,10 @@ int rtw_is_file_readable(const char *path)
*/ */
int rtw_is_file_readable_with_size(const char *path, u32 *sz) int rtw_is_file_readable_with_size(const char *path, u32 *sz)
{ {
#ifdef PLATFORM_LINUX
if (isFileReadable(path, sz) == 0) if (isFileReadable(path, sz) == 0)
return _TRUE; return _TRUE;
else else
return _FALSE; return _FALSE;
#else
/* Todo... */
return _FALSE;
#endif
} }
/* /*
@ -1640,13 +1413,8 @@ int rtw_is_file_readable_with_size(const char *path, u32 *sz)
*/ */
int rtw_retrieve_from_file(const char *path, u8 *buf, u32 sz) int rtw_retrieve_from_file(const 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
} }
/* /*
@ -1658,16 +1426,10 @@ int rtw_retrieve_from_file(const char *path, u8 *buf, u32 sz)
*/ */
int rtw_store_to_file(const char *path, u8 *buf, u32 sz) int rtw_store_to_file(const 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
} }
#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;
@ -1796,7 +1558,6 @@ error:
return -1; return -1;
} }
#endif
#ifdef CONFIG_PLATFORM_SPRD #ifdef CONFIG_PLATFORM_SPRD
#ifdef do_div #ifdef do_div
@ -1807,22 +1568,17 @@ 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
} }
inline u32 rtw_random32(void) inline u32 rtw_random32(void)
{ {
#ifdef PLATFORM_LINUX
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0))
return prandom_u32(); return prandom_u32();
#elif (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18)) #elif (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18))
@ -1832,7 +1588,6 @@ inline u32 rtw_random32(void)
#else #else
return random32(); return random32();
#endif #endif
#endif
} }
void rtw_buf_free(u8 **buf, u32 *buf_len) void rtw_buf_free(u8 **buf, u32 *buf_len)