|
|
#include <linux/pci_ids.h> | #include <linux/pci_ids.h> |
#define WLC_MAXBSSCFG 1 | #define WLC_MAXBSSCFG 1 |
| |
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29) |
|
#include <net/lib80211.h> |
|
#endif |
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 14) | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 14) |
#include <net/ieee80211.h> | #include <net/ieee80211.h> |
#endif | #endif |
|
|
bool resched; | bool resched; |
uint32 pci_psstate[16]; | uint32 pci_psstate[16]; |
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 14) | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 14) |
struct ieee80211_crypto_ops *tkipmodops; |
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29) |
|
struct lib80211_crypto_ops *tkipmodops; |
|
#else |
|
struct ieee80211_crypto_ops *tkipmodops; |
|
#endif |
struct ieee80211_tkip_data *tkip_ucast_data; | struct ieee80211_tkip_data *tkip_ucast_data; |
struct ieee80211_tkip_data *tkip_bcast_data; | struct ieee80211_tkip_data *tkip_bcast_data; |
#endif | #endif |
|
|
| |
static int wl_found = 0; | static int wl_found = 0; |
| |
#define WL_DEV_IF(dev) ((wl_if_t*)(dev)->priv) |
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29) |
|
#define WL_DEV_IF(dev) ((wl_if_t*)netdev_priv(dev)) |
|
#else |
|
#define WL_DEV_IF(dev) ((wl_if_t*)(dev)->priv) |
|
#endif |
#define WL_INFO(dev) ((wl_info_t*)(WL_DEV_IF(dev)->wl)) | #define WL_INFO(dev) ((wl_info_t*)(WL_DEV_IF(dev)->wl)) |
| |
#define WL_LOCK(wl) spin_lock_bh(&(wl)->lock) | #define WL_LOCK(wl) spin_lock_bh(&(wl)->lock) |
|
|
dev = wlif->dev; | dev = wlif->dev; |
wl->dev = dev; | wl->dev = dev; |
wl_if_setup(dev); | wl_if_setup(dev); |
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) |
|
wlif = netdev_priv(dev); |
|
#endif |
| |
dev->base_addr = regs; | dev->base_addr = regs; |
| |
|
|
| |
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 14) | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 14) |
| |
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29) |
|
wl->tkipmodops = lib80211_get_crypto_ops("TKIP"); |
|
#else |
wl->tkipmodops = ieee80211_get_crypto_ops("TKIP"); | wl->tkipmodops = ieee80211_get_crypto_ops("TKIP"); |
|
#endif |
if (wl->tkipmodops == NULL) { | if (wl->tkipmodops == NULL) { |
request_module("ieee80211_crypt_tkip"); | request_module("ieee80211_crypt_tkip"); |
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29) |
|
wl->tkipmodops = lib80211_get_crypto_ops("TKIP"); |
|
#else |
wl->tkipmodops = ieee80211_get_crypto_ops("TKIP"); | wl->tkipmodops = ieee80211_get_crypto_ops("TKIP"); |
|
#endif |
} | } |
#endif | #endif |
#ifdef CONFIG_WIRELESS_EXT | #ifdef CONFIG_WIRELESS_EXT |
|
|
} | } |
| |
if (wl->monitor) { | if (wl->monitor) { |
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29) |
|
wl_free_if(wl, netdev_priv(wl->monitor)); |
|
#else |
wl_free_if(wl, (wl_if_t *)(wl->monitor->priv)); | wl_free_if(wl, (wl_if_t *)(wl->monitor->priv)); |
|
#endif |
wl->monitor = NULL; | wl->monitor = NULL; |
} | } |
| |
|
|
wlif->wl = wl; | wlif->wl = wl; |
wlif->wlcif = wlcif; | wlif->wlcif = wlcif; |
wlif->subunit = subunit; | wlif->subunit = subunit; |
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) |
dev->priv = wlif; | dev->priv = wlif; |
|
#endif |
| |
if (iftype != WL_IFTYPE_MON && wl->dev && netif_queue_stopped(wl->dev)) | if (iftype != WL_IFTYPE_MON && wl->dev && netif_queue_stopped(wl->dev)) |
netif_stop_queue(dev); | netif_stop_queue(dev); |