From c2741d0becef4c883b8be501a97b194142f857bb Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Wed, 12 Feb 2014 11:05:30 -0600 Subject: [PATCH] rtl8188eu: Fix compilation for kernels older that 2.6.36 These changes will apply at least back to 2.6.32. From: Stas Sergeev Signed-off-by: Stas Sergeev Signed-off-by: Larry Finger --- core/rtw_mlme.c | 5 +++++ core/rtw_xmit.c | 8 ++++++++ include/osdep_service.h | 2 +- include/rtw_io.h | 2 +- os_dep/os_intfs.c | 5 +++++ os_dep/recv_linux.c | 4 ++++ 6 files changed, 24 insertions(+), 2 deletions(-) diff --git a/core/rtw_mlme.c b/core/rtw_mlme.c index 60b1544..27369e4 100644 --- a/core/rtw_mlme.c +++ b/core/rtw_mlme.c @@ -20,6 +20,7 @@ #define _RTW_MLME_C_ +#include #include #include #include @@ -1680,7 +1681,11 @@ void rtw_dynamic_check_timer_handlder(struct adapter *adapter) rcu_read_lock(); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) if (rcu_dereference(adapter->pnetdev->rx_handler_data) && +#else + if (rcu_dereference(adapter->pnetdev->br_port) && +#endif (check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) == true)) { /* expire NAT2.5 entry */ nat25_db_expire(adapter); diff --git a/core/rtw_xmit.c b/core/rtw_xmit.c index a594e51..e770a68 100644 --- a/core/rtw_xmit.c +++ b/core/rtw_xmit.c @@ -1760,7 +1760,11 @@ static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb) void *br_port = NULL; rcu_read_lock(); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) br_port = rcu_dereference(padapter->pnetdev->rx_handler_data); +#else + br_port = rcu_dereference(padapter->pnetdev->br_port); +#endif rcu_read_unlock(); _enter_critical_bh(&padapter->br_ext_lock, &irql); if (!(skb->data[0] & 1) && br_port && @@ -1947,7 +1951,11 @@ s32 rtw_xmit(struct adapter *padapter, struct sk_buff **ppkt) } rcu_read_lock(); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) br_port = rcu_dereference(padapter->pnetdev->rx_handler_data); +#else + br_port = rcu_dereference(padapter->pnetdev->br_port); +#endif rcu_read_unlock(); if (br_port && check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE)) { diff --git a/include/osdep_service.h b/include/osdep_service.h index 36523ed..dfa3a57 100644 --- a/include/osdep_service.h +++ b/include/osdep_service.h @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/include/rtw_io.h b/include/rtw_io.h index eb6f0e5..d7dee53 100644 --- a/include/rtw_io.h +++ b/include/rtw_io.h @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include diff --git a/os_dep/os_intfs.c b/os_dep/os_intfs.c index f7d4540..b0fb1dd 100644 --- a/os_dep/os_intfs.c +++ b/os_dep/os_intfs.c @@ -19,6 +19,7 @@ ******************************************************************************/ #define _OS_INTFS_C_ +#include #include #include #include @@ -1025,7 +1026,11 @@ void netdev_br_init(struct net_device *netdev) rcu_read_lock(); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) if (rcu_dereference(adapter->pnetdev->rx_handler_data)) { +#else + if (rcu_dereference(adapter->pnetdev->br_port)) { +#endif struct net_device *br_netdev; struct net *devnet = NULL; diff --git a/os_dep/recv_linux.c b/os_dep/recv_linux.c index abe5ede..e8ad0b0 100644 --- a/os_dep/recv_linux.c +++ b/os_dep/recv_linux.c @@ -197,7 +197,11 @@ _func_enter_; } rcu_read_lock(); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) rcu_dereference(padapter->pnetdev->rx_handler_data); +#else + rcu_dereference(padapter->pnetdev->br_port); +#endif rcu_read_unlock(); skb->ip_summed = CHECKSUM_NONE;