#ifdef CONFIG_AUTOSUSPEND
if(Adapter->registrypriv.usbss_enable)
{
- #if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35))
+#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35))
usb_disable_autosuspend(adapter_to_dvobj(Adapter)->pusbdev);
- #elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,22) && LINUX_VERSION_CODE<=KERNEL_VERSION(2,6,34))
+#else
adapter_to_dvobj(Adapter)->pusbdev->autosuspend_disabled = Adapter->bDisableAutosuspend;/* autosuspend disabled by the user */
- #endif
+#endif
}
else
#endif
{
DBG_8723A( "can't get autopm: \n");
}
- #elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,20))
- usb_autopm_disable(adapter_to_dvobj(padapter)->pusbintf);
#else
- usb_autoresume_device(adapter_to_dvobj(padapter)->pusbdev, 1);
+ usb_autopm_disable(adapter_to_dvobj(padapter)->pusbintf);
#endif
pwrpriv->autopm_cnt++;
}
if (skb_is_nonlinear(skb))
DEBUG_ERR("%s(): skb_is_nonlinear!!\n", __FUNCTION__);
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18))
- res = skb_linearize(skb, GFP_ATOMIC);
-#else /* (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)) */
res = skb_linearize(skb);
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)) */
if (res < 0) {
DEBUG_ERR("TX DROP: skb_linearize fail!\n");
/* goto free_and_stop; */
if ((fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_MGMT)
goto _exit;
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)) // http://www.mail-archive.com/netdev@vger.kernel.org/msg17214.html
- pxmit_skb = dev_alloc_skb(len + TXDESC_SIZE);
-#else
pxmit_skb = netdev_alloc_skb(pnetdev, len + TXDESC_SIZE);
-#endif
if(!pxmit_skb)
goto _exit;
alloc_sz += 14;
}
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)) // http://www.mail-archive.com/netdev@vger.kernel.org/msg17214.html
- pkt_copy = dev_alloc_skb(alloc_sz);
-#else
pkt_copy = netdev_alloc_skb(padapter->pnetdev, alloc_sz);
-#endif
if(pkt_copy)
{
pkt_copy->dev = padapter->pnetdev;
alloc_sz += 14;
}
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)) // http://www.mail-archive.com/netdev@vger.kernel.org/msg17214.html
- pkt_copy = dev_alloc_skb(alloc_sz);
-#else
pkt_copy = netdev_alloc_skb(secondary_padapter->pnetdev, alloc_sz);
-#endif
if(pkt_copy)
{
pkt_copy->dev = secondary_padapter->pnetdev;
alloc_sz += 14;
}
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)) // http://www.mail-archive.com/netdev@vger.kernel.org/msg17214.html
- pkt_copy = dev_alloc_skb(alloc_sz);
-#else
pkt_copy = netdev_alloc_skb(padapter->pnetdev, alloc_sz);
-#endif
- if(pkt_copy)
+ if (pkt_copy)
{
pkt_copy->dev = padapter->pnetdev;
precvframe->u.hdr.pkt = pkt_copy;
//re-assign for linux based on skb
if((precvbuf->reuse == _FALSE) || (precvbuf->pskb == NULL)) {
//precvbuf->pskb = alloc_skb(MAX_RECVBUF_SZ, GFP_ATOMIC);//don't use this after v2.6.25
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)) // http://www.mail-archive.com/netdev@vger.kernel.org/msg17214.html
- precvbuf->pskb = dev_alloc_skb(MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ);
-#else
precvbuf->pskb = netdev_alloc_skb(adapter->pnetdev, MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ);
-#endif
- if(precvbuf->pskb == NULL) {
+ if (precvbuf->pskb == NULL) {
RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("init_recvbuf(): alloc_skb fail!\n"));
return _FAIL;
}
#include <asm/byteorder.h>
#include <asm/atomic.h>
#include <asm/io.h>
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26))
- #include <asm/semaphore.h>
-#else
- #include <linux/semaphore.h>
-#endif
+#include <linux/semaphore.h>
#include <linux/sem.h>
#include <linux/sched.h>
#include <linux/etherdevice.h>
#endif
#include <linux/usb.h>
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21))
-#include <linux/usb_ch9.h>
-#else
#include <linux/usb/ch9.h>
-#endif
typedef struct urb * PURB;
-#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,22))
#ifdef CONFIG_USB_SUSPEND
#define CONFIG_AUTOSUSPEND 1
#endif
-#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
typedef struct mutex _mutex;
typedef void* timer_hdl_context;
typedef struct work_struct _workitem;
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
-#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
-#endif
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22))
-// Porting from linux kernel, for compatible with old kernel.
-static inline unsigned char *skb_tail_pointer(const struct sk_buff *skb)
-{
- return skb->tail;
-}
-
-static inline void skb_reset_tail_pointer(struct sk_buff *skb)
-{
- skb->tail = skb->data;
-}
-
-static inline void skb_set_tail_pointer(struct sk_buff *skb, const int offset)
-{
- skb->tail = skb->data + offset;
-}
-
-static inline unsigned char *skb_end_pointer(const struct sk_buff *skb)
-{
- return skb->end;
-}
-#endif
__inline static struct list_head *get_next(struct list_head *list)
{
__inline static void _init_workitem(_workitem *pwork, void *pfunc, void *cntx)
{
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
INIT_WORK(pwork, pfunc);
-#else
- INIT_WORK(pwork, pfunc,pwork);
-#endif
}
__inline static void _set_workitem(_workitem *pwork)
__inline static void _cancel_workitem_sync(_workitem *pwork)
{
-#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,22))
cancel_work_sync(pwork);
-#else
- flush_scheduled_work();
-#endif
}
//
// Global Mutex: can only be used at PASSIVE level.
#define FUNC_ADPT_FMT "%s(%s)"
#define FUNC_ADPT_ARG(adapter) __func__, adapter->pnetdev->name
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27))
#define rtw_signal_process(pid, sig) kill_pid(find_vpid((pid)),(sig), 1)
-#else //(LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27))
-#define rtw_signal_process(pid, sig) kill_proc((pid), (sig), 1)
-#endif //(LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27))
extern u64 rtw_modular64(u64 x, u64 y);
extern u64 rtw_division64(u64 x, u64 y);
#ifndef CONFIG_RTL8711FW
#include <wlan_bssdef.h>
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26))
-#include <asm/semaphore.h>
-#else
#include <linux/semaphore.h>
-#endif
#include <linux/sem.h>
#else
#include <wlan_bssdef.h>
#include <osdep_intf.h>
#include <asm/byteorder.h>
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26))
-#include <asm/semaphore.h>
-#else
#include <linux/semaphore.h>
-#endif
#include <linux/list.h>
//#include <linux/smp_lock.h>
#include <linux/spinlock.h>
#include <asm/atomic.h>
#include <linux/usb.h>
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21))
-#include <linux/usb_ch9.h>
-#else
#include <linux/usb/ch9.h>
-#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
#define rtw_usb_buffer_alloc(dev, size, dma) usb_alloc_coherent((dev), (size), (in_interrupt() ? GFP_ATOMIC : GFP_KERNEL), (dma))
#define MAX_VENDOR_REQ_CMD_SIZE 254 //8188cu SIE Support
#define MAX_USB_IO_CTL_SIZE (MAX_VENDOR_REQ_CMD_SIZE +ALIGNMENT_UNIT)
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12))
#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))
#define rtw_usb_bulk_msg(usb_dev, pipe, data, len, actual_length, timeout_ms) \
usb_bulk_msg((usb_dev), (pipe), (data), (len), (actual_length), (timeout_ms))
-#else
-#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) == 0) ||((timeout_ms)*HZ/1000>0)?((timeout_ms)*HZ/1000):1)
-#define rtw_usb_bulk_msg(usb_dev, pipe, data, len, actual_length, timeout_ms) \
- usb_bulk_msg((usb_dev), (pipe), (data), (len), (actual_length), \
- ((timeout_ms) == 0) ||((timeout_ms)*HZ/1000>0)?((timeout_ms)*HZ/1000):1)
-#endif
#include <usb_ops_linux.h>
#ifdef CONFIG_RTL8192C
#define RTW_USB_BULKOUT_TIMEOUT 5000//ms
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) || (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,18))
#define _usbctrl_vendorreq_async_callback(urb, regs) _usbctrl_vendorreq_async_callback(urb)
#define usb_bulkout_zero_complete(purb, regs) usb_bulkout_zero_complete(purb)
#define usb_write_mem_complete(purb, regs) usb_write_mem_complete(purb)
#define usb_write_port_complete(purb, regs) usb_write_port_complete(purb)
#define usb_read_port_complete(purb, regs) usb_read_port_complete(purb)
#define usb_read_interrupt_complete(purb, regs) usb_read_interrupt_complete(purb)
-#endif
#ifdef CONFIG_USB_SUPPORT_ASYNC_VDN_REQ
int usb_async_write8(struct intf_hdl *pintfhdl, u32 addr, u8 val);
return ret;
}
-#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,29))
static const struct net_device_ops rtw_cfg80211_monitor_if_ops = {
.ndo_open = rtw_cfg80211_monitor_if_open,
.ndo_stop = rtw_cfg80211_monitor_if_close,
#endif
.ndo_set_mac_address = rtw_cfg80211_monitor_if_set_mac_address,
};
-#endif
static int rtw_cfg80211_add_monitor_if(_adapter *padapter, char *name, struct net_device **ndev)
{
mon_ndev->name[IFNAMSIZ - 1] = 0;
mon_ndev->destructor = rtw_ndev_destructor;
-#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,29))
mon_ndev->netdev_ops = &rtw_cfg80211_monitor_if_ops;
-#else
- mon_ndev->open = rtw_cfg80211_monitor_if_open;
- mon_ndev->stop = rtw_cfg80211_monitor_if_close;
- mon_ndev->hard_start_xmit = rtw_cfg80211_monitor_if_xmit_entry;
- mon_ndev->set_mac_address = rtw_cfg80211_monitor_if_set_mac_address;
-#endif
pnpi = netdev_priv(mon_ndev);
pnpi->priv = padapter;
#endif
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27))
-#define iwe_stream_add_event(a, b, c, d, e) iwe_stream_add_event(b, c, d, e)
-#define iwe_stream_add_point(a, b, c, d, e) iwe_stream_add_point(b, c, d, e)
-#endif
-
-
#define RTL_IOCTL_WPA_SUPPLICANT SIOCIWFIRSTPRIV+30
#define SCAN_ITEM_SIZE 768
piwstats->qual.qual = tmp_qual;
piwstats->qual.noise = tmp_noise;
}
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14))
piwstats->qual.updated = IW_QUAL_ALL_UPDATED ;//|IW_QUAL_DBM;
-#else
- piwstats->qual.updated = 0x0f;
-#endif
#ifdef CONFIG_SIGNAL_DISPLAY_DBM
piwstats->qual.updated = piwstats->qual.updated | IW_QUAL_DBM;
return 0;
}
-#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,29))
static const struct net_device_ops rtl871x_mgnt_netdev_ops = {
.ndo_open = mgnt_netdev_open,
.ndo_stop = mgnt_netdev_close,
//.ndo_get_stats = r871x_net_get_stats,
//.ndo_do_ioctl = r871x_mp_ioctl,
};
-#endif
int hostapd_mode_init(_adapter *padapter)
{
//pnetdev->init = NULL;
-#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,29))
-
DBG_8723A("register rtl871x_mgnt_netdev_ops to netdev_ops\n");
pnetdev->netdev_ops = &rtl871x_mgnt_netdev_ops;
-#else
-
- pnetdev->open = mgnt_netdev_open;
-
- pnetdev->stop = mgnt_netdev_close;
-
- pnetdev->hard_start_xmit = mgnt_xmit_entry;
-
- //pnetdev->set_mac_address = r871x_net_set_mac_address;
-
- //pnetdev->get_stats = r871x_net_get_stats;
-
- //pnetdev->do_ioctl = r871x_mp_ioctl;
-
-#endif
-
pnetdev->watchdog_timeo = HZ; /* 1 second timeout */
//pnetdev->wireless_handlers = NULL;
memcpy(rtw_proc_name, RTW_PROC_NAME, sizeof(RTW_PROC_NAME));
}
-#if(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
- rtw_proc=create_proc_entry(rtw_proc_name, S_IFDIR, proc_net);
-#else
rtw_proc=create_proc_entry(rtw_proc_name, S_IFDIR, init_net.proc_net);
-#endif
if (rtw_proc == NULL) {
DBG_8723A(KERN_ERR "Unable to create rtw_proc directory\n");
return;
if(rtw_proc_cnt == 0)
{
if(rtw_proc){
-#if(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
- remove_proc_entry(rtw_proc_name, proc_net);
-#else
- remove_proc_entry(rtw_proc_name, init_net.proc_net);
-#endif
+ remove_proc_entry(rtw_proc_name,
+ init_net.proc_net);
rtw_proc = NULL;
}
}
if(rtw_proc){
remove_proc_entry("ver_info", rtw_proc);
-#if(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
- remove_proc_entry(rtw_proc_name, proc_net);
-#else
remove_proc_entry(rtw_proc_name, init_net.proc_net);
-#endif
rtw_proc = NULL;
}
}
#endif
-#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,29))
static const struct net_device_ops rtw_netdev_ops = {
.ndo_open = netdev_open,
.ndo_stop = netdev_close,
.ndo_get_stats = rtw_net_get_stats,
.ndo_do_ioctl = rtw_ioctl,
};
-#endif
int rtw_init_netdev_name(struct net_device *pnetdev, const char *ifname)
{
if(padapter->bDongle == 1)
{
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
- TargetNetdev = dev_get_by_name("wlan0");
-#else
- #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26))
- devnet = pnetdev->nd_net;
- #else
devnet = dev_net(pnetdev);
- #endif
TargetNetdev = dev_get_by_name(devnet, "wlan0");
-#endif
if(TargetNetdev) {
DBG_8723A("Force onboard module driver disappear !!!\n");
TargetAdapter = rtw_netdev_priv(TargetNetdev);
padapter = rtw_netdev_priv(pnetdev);
padapter->pnetdev = pnetdev;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
- SET_MODULE_OWNER(pnetdev);
-#endif
-
//pnetdev->init = NULL;
-#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,29))
DBG_8723A("register rtw_netdev_ops to netdev_ops\n");
pnetdev->netdev_ops = &rtw_netdev_ops;
-#else
- pnetdev->open = netdev_open;
- pnetdev->stop = netdev_close;
- pnetdev->hard_start_xmit = rtw_xmit_entry;
- pnetdev->set_mac_address = rtw_net_set_mac_address;
- pnetdev->get_stats = rtw_net_get_stats;
- pnetdev->do_ioctl = rtw_ioctl;
-#endif
-
#ifdef CONFIG_TCP_CSUM_OFFLOAD_TX
pnetdev->features |= NETIF_F_IP_CSUM;
return 0;
}
-#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,29))
static const struct net_device_ops rtw_netdev_if2_ops = {
.ndo_open = netdev_if2_open,
.ndo_stop = netdev_if2_close,
.ndo_select_queue = rtw_select_queue,
#endif
};
-#endif
#include <usb_hal.h>
if (!pnetdev)
goto error_rtw_drv_if2_init;
-#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,29))
DBG_8723A("register rtw_netdev_if2_ops to netdev_ops\n");
pnetdev->netdev_ops = &rtw_netdev_if2_ops;
-#else
- pnetdev->open = netdev_if2_open;
- pnetdev->stop = netdev_if2_close;
-#endif
#ifdef CONFIG_NO_WIRELESS_HANDLERS
pnetdev->wireless_handlers = NULL;
#endif // (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35))
{
struct net_device *br_netdev;
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
- br_netdev = dev_get_by_name(CONFIG_BR_EXT_BRNAME);
-#else // (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
struct net *devnet = NULL;
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26))
- devnet = netdev->nd_net;
-#else // (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26))
devnet = dev_net(netdev);
-#endif // (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26))
br_netdev = dev_get_by_name(devnet, CONFIG_BR_EXT_BRNAME);
-#endif // (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
if (br_netdev) {
memcpy(adapter->br_mac, br_netdev->dev_addr, ETH_ALEN);
rereg_priv->old_pnetdev = NULL;
}
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26))
if(!rtnl_is_locked())
unregister_netdev(cur_pnetdev);
else
-#endif
unregister_netdevice(cur_pnetdev);
rtw_proc_remove_one(cur_pnetdev);
memcpy(pnetdev->dev_addr, padapter->eeprompriv.mac_addr, ETH_ALEN);
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26))
if(!rtnl_is_locked())
ret = register_netdev(pnetdev);
else
-#endif
ret = register_netdevice(pnetdev);
if ( ret != 0) {
static int rtw_drv_init(struct usb_interface *pusb_intf,const struct usb_device_id *pdid);
static void rtw_dev_remove(struct usb_interface *pusb_intf);
-#if (LINUX_VERSION_CODE<=KERNEL_VERSION(2,6,23))
-/* Some useful macros to use to create struct usb_device_id */
- #define USB_DEVICE_ID_MATCH_VENDOR 0x0001
- #define USB_DEVICE_ID_MATCH_PRODUCT 0x0002
- #define USB_DEVICE_ID_MATCH_DEV_LO 0x0004
- #define USB_DEVICE_ID_MATCH_DEV_HI 0x0008
- #define USB_DEVICE_ID_MATCH_DEV_CLASS 0x0010
- #define USB_DEVICE_ID_MATCH_DEV_SUBCLASS 0x0020
- #define USB_DEVICE_ID_MATCH_DEV_PROTOCOL 0x0040
- #define USB_DEVICE_ID_MATCH_INT_CLASS 0x0080
- #define USB_DEVICE_ID_MATCH_INT_SUBCLASS 0x0100
- #define USB_DEVICE_ID_MATCH_INT_PROTOCOL 0x0200
- #define USB_DEVICE_ID_MATCH_INT_NUMBER 0x0400
-
-
-#define USB_DEVICE_ID_MATCH_INT_INFO \
- (USB_DEVICE_ID_MATCH_INT_CLASS | \
- USB_DEVICE_ID_MATCH_INT_SUBCLASS | \
- USB_DEVICE_ID_MATCH_INT_PROTOCOL)
-
-
-#define USB_DEVICE_AND_INTERFACE_INFO(vend, prod, cl, sc, pr) \
- .match_flags = USB_DEVICE_ID_MATCH_INT_INFO \
- | USB_DEVICE_ID_MATCH_DEVICE, \
- .idVendor = (vend), \
- .idProduct = (prod), \
- .bInterfaceClass = (cl), \
- .bInterfaceSubClass = (sc), \
- .bInterfaceProtocol = (pr)
-
- /**
- * USB_VENDOR_AND_INTERFACE_INFO - describe a specific usb vendor with a class of usb interfaces
- * @vend: the 16 bit USB Vendor ID
- * @cl: bInterfaceClass value
- * @sc: bInterfaceSubClass value
- * @pr: bInterfaceProtocol value
- *
- * This macro is used to create a struct usb_device_id that matches a
- * specific vendor with a specific class of interfaces.
- *
- * This is especially useful when explicitly matching devices that have
- * vendor specific bDeviceClass values, but standards-compliant interfaces.
- */
-#define USB_VENDOR_AND_INTERFACE_INFO(vend, cl, sc, pr) \
- .match_flags = USB_DEVICE_ID_MATCH_INT_INFO \
- | USB_DEVICE_ID_MATCH_VENDOR, \
- .idVendor = (vend), \
- .bInterfaceClass = (cl), \
- .bInterfaceSubClass = (sc), \
- .bInterfaceProtocol = (pr)
-
-/* ----------------------------------------------------------------------- */
-#endif
#define USB_VENDER_ID_REALTEK 0x0BDA
.usbdrv.id_table = rtl8192c_usb_id_tbl,
.usbdrv.suspend = rtw_suspend,
.usbdrv.resume = rtw_resume,
- #if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 22))
.usbdrv.reset_resume = rtw_resume,
- #endif
#ifdef CONFIG_AUTOSUSPEND
.usbdrv.supports_autosuspend = 1,
#endif
.usbdrv.id_table = rtl8192d_usb_id_tbl,
.usbdrv.suspend = rtw_suspend,
.usbdrv.resume = rtw_resume,
- #if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 22))
.usbdrv.reset_resume = rtw_resume,
- #endif
#ifdef CONFIG_AUTOSUSPEND
.usbdrv.supports_autosuspend = 1,
#endif
.usbdrv.id_table = rtl8723a_usb_id_tbl,
.usbdrv.suspend = rtw_suspend,
.usbdrv.resume = rtw_resume,
- #if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 22))
.usbdrv.reset_resume = rtw_resume,
- #endif
#ifdef CONFIG_AUTOSUSPEND
.usbdrv.supports_autosuspend = 1,
#endif
.usbdrv.id_table = rtl8188e_usb_id_tbl,
.usbdrv.suspend = rtw_suspend,
.usbdrv.resume = rtw_resume,
- #if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 22))
.usbdrv.reset_resume = rtw_resume,
- #endif
#ifdef CONFIG_AUTOSUSPEND
.usbdrv.supports_autosuspend = 1,
#endif
down(&pwrpriv->lock);
#ifdef CONFIG_BT_COEXIST
#ifdef CONFIG_AUTOSUSPEND
- #if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,32))
DBG_8723A("%s...pm_usage_cnt(%d) pwrpriv->bAutoResume=%x. ....\n",__func__,atomic_read(&(adapter_to_dvobj(padapter)->pusbintf->pm_usage_cnt)),pwrpriv->bAutoResume);
pm_cnt=atomic_read(&(adapter_to_dvobj(padapter)->pusbintf->pm_usage_cnt));
- #else
- DBG_8723A("...pm_usage_cnt(%d).....\n", adapter_to_dvobj(padapter)->pusbintf->pm_usage_cnt);
- pm_cnt = adapter_to_dvobj(padapter)->pusbintf->pm_usage_cnt;
- #endif
DBG_8723A("pwrpriv->bAutoResume (%x)\n",pwrpriv->bAutoResume );
if( _TRUE == pwrpriv->bAutoResume ){
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,33))
usb_autopm_put_interface(dvobj->pusbintf);
- #elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,20))
- usb_autopm_enable(dvobj->pusbintf);
#else
- usb_autosuspend_device(dvobj->pusbdev, 1);
+ usb_autopm_enable(dvobj->pusbintf);
#endif
#else //#ifndef CONFIG_BT_COEXIST
if(1==pwrpriv->autopm_cnt){
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,33))
usb_autopm_put_interface(dvobj->pusbintf);
- #elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,20))
- usb_autopm_enable(dvobj->pusbintf);
#else
- usb_autosuspend_device(dvobj->pusbdev, 1);
+ usb_autopm_enable(dvobj->pusbintf);
#endif
pwrpriv->autopm_cnt --;
}
#endif //#ifndef CONFIG_BT_COEXIST
}
- #if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,32))
DBG_8723A("...pm_usage_cnt(%d).....\n", atomic_read(&(dvobj->pusbintf->pm_usage_cnt)));
- #else
- DBG_8723A("...pm_usage_cnt(%d).....\n", dvobj->pusbintf->pm_usage_cnt);
- #endif
-
}
int autoresume_enter(_adapter* padapter)
{
result = _FAIL;
goto error_exit;
}
- #elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,20))
- usb_autopm_disable(dvobj->pusbintf);
#else
- usb_autoresume_device(dvobj->pusbdev, 1);
+ usb_autopm_disable(dvobj->pusbintf);
#endif
- #if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,32))
DBG_8723A("...pm_usage_cnt(%d).....\n", atomic_read(&(dvobj->pusbintf->pm_usage_cnt)));
- #else
- DBG_8723A("...pm_usage_cnt(%d).....\n", dvobj->pusbintf->pm_usage_cnt);
- #endif
#else //#ifndef CONFIG_BT_COEXIST
pwrpriv->bAutoResume=_TRUE;
if(0==pwrpriv->autopm_cnt){
result = _FAIL;
goto error_exit;
}
- #elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,20))
- usb_autopm_disable(dvobj->pusbintf);
#else
- usb_autoresume_device(dvobj->pusbdev, 1);
+ usb_autopm_disable(dvobj->pusbintf);
#endif
- #if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,32))
DBG_8723A("...pm_usage_cnt(%d).....\n", atomic_read(&(dvobj->pusbintf->pm_usage_cnt)));
- #else
- DBG_8723A("...pm_usage_cnt(%d).....\n", dvobj->pusbintf->pm_usage_cnt);
- #endif
pwrpriv->autopm_cnt++;
}
else
}
#ifdef CONFIG_PM
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,18))
if(padapter->pwrctrlpriv.bSupportRemoteWakeup)
{
dvobj->pusbdev->do_remote_wakeup=1;
DBG_8723A("\n padapter->pwrctrlpriv.bSupportRemoteWakeup~~~[%d]~~~\n",device_may_wakeup(&pusb_intf->dev));
}
#endif
-#endif
#ifdef CONFIG_AUTOSUSPEND
if( padapter->registrypriv.power_mgnt != PS_MODE_ACTIVE )
{
if(padapter->registrypriv.usbss_enable ){ /* autosuspend (2s delay) */
- #if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,38))
+#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,38))
dvobj->pusbdev->dev.power.autosuspend_delay = 0 * HZ;//15 * HZ; idle-delay time
- #else
+#else
dvobj->pusbdev->autosuspend_delay = 0 * HZ;//15 * HZ; idle-delay time
- #endif
+#endif
- #if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35))
+#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35))
usb_enable_autosuspend(dvobj->pusbdev);
- #elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,22) && LINUX_VERSION_CODE<=KERNEL_VERSION(2,6,34))
+#elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,22) && LINUX_VERSION_CODE<=KERNEL_VERSION(2,6,34))
padapter->bDisableAutosuspend = dvobj->pusbdev->autosuspend_disabled ;
dvobj->pusbdev->autosuspend_disabled = 0;//autosuspend disabled by the user
- #endif
+#endif
//usb_autopm_get_interface(adapter_to_dvobj(padapter)->pusbintf );//init pm_usage_cnt ,let it start from 1
- #if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,32))
DBG_8723A("%s...pm_usage_cnt(%d).....\n",__FUNCTION__,atomic_read(&(dvobj->pusbintf ->pm_usage_cnt)));
- #else
- DBG_8723A("%s...pm_usage_cnt(%d).....\n",__FUNCTION__,dvobj->pusbintf ->pm_usage_cnt);
- #endif
}
}
#endif
//2012-07-11 Move here to prevent the 8723AS-VAU BT auto suspend influence
- #if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,33))
+#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,33))
if (usb_autopm_get_interface(pusb_intf) < 0)
{
DBG_8723A( "can't get autopm: \n");
}
- #endif
+#endif
#ifdef CONFIG_BT_COEXIST
padapter->pwrctrlpriv.autopm_cnt=1;
#endif
if(1 == if1->pwrctrlpriv.autopm_cnt){
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,33))
usb_autopm_put_interface(adapter_to_dvobj(if1)->pusbintf);
- #elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,20))
- usb_autopm_enable(adapter_to_dvobj(if1)->pusbintf);
#else
- usb_autosuspend_device(adapter_to_dvobj(if1)->pusbdev, 1);
+ usb_autopm_enable(adapter_to_dvobj(if1)->pusbintf);
#endif
if1->pwrctrlpriv.autopm_cnt --;
}
return;
}
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24))
extern int console_suspend_enabled;
-#endif
static int __init rtw_drv_entry(void)
{