rtl8192e: Remove extra ifdefs

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Mike McCormack <mikem@ring3k.org>
This commit is contained in:
Mike McCormack
2011-07-11 08:56:20 +09:00
committed by Larry Finger
parent 1ec3e2f255
commit cb76215448
26 changed files with 39 additions and 1872 deletions
-21
View File
@@ -19,12 +19,8 @@
#include <linux/highmem.h>
#include <linux/init.h>
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12))
#include <asm/hardirq.h>
#else
#include <linux/hardirq.h>
#include <linux/sched.h>
#endif
#include <asm/kmap_types.h>
#ifdef BUILT_IN_CRYPTO
@@ -37,23 +33,6 @@
#endif
#endif /* BUILT_IN_CRYPTO */
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,20))
#define list_for_each_entry(pos, head, member) \
for (pos = list_entry((head)->next, typeof(*pos), member), \
prefetch(pos->member.next); \
&pos->member != (head); \
pos = list_entry(pos->member.next, typeof(*pos), member), \
prefetch(pos->member.next))
static inline void cond_resched(void)
{
if (need_resched()) {
set_current_state(TASK_RUNNING);
schedule();
}
}
#endif
extern enum km_type crypto_km_types[];
static inline enum km_type crypto_kmap_type(int out)
+5 -25
View File
@@ -114,56 +114,36 @@ cmpk_count_txstatistic(
pAdapter->HalFunc.GetHwRegHandler(pAdapter, HW_VAR_RF_STATE, (pu1Byte)(&rtState));
if (rtState == eRfOff)
{
return;
}
#endif
#ifdef TODO
if (pAdapter->bInHctTest)
return;
#endif
if (pstx_fb->tok)
{
if (pstx_fb->tok) {
priv->stats.txfeedbackok++;
priv->stats.txoktotal++;
priv->stats.txokbytestotal += pstx_fb->pkt_length;
priv->stats.txokinperiod++;
if (pstx_fb->pkt_type == PACKET_MULTICAST)
{
if (pstx_fb->pkt_type == PACKET_MULTICAST) {
priv->stats.txmulticast++;
priv->stats.txbytesmulticast += pstx_fb->pkt_length;
}
else if (pstx_fb->pkt_type == PACKET_BROADCAST)
{
} else if (pstx_fb->pkt_type == PACKET_BROADCAST) {
priv->stats.txbroadcast++;
priv->stats.txbytesbroadcast += pstx_fb->pkt_length;
}
else
{
} else {
priv->stats.txunicast++;
priv->stats.txbytesunicast += pstx_fb->pkt_length;
}
}
else
{
} else {
priv->stats.txfeedbackfail++;
priv->stats.txerrtotal++;
priv->stats.txerrbytestotal += pstx_fb->pkt_length;
if (pstx_fb->pkt_type == PACKET_MULTICAST)
{
priv->stats.txerrmulticast++;
}
else if (pstx_fb->pkt_type == PACKET_BROADCAST)
{
priv->stats.txerrbroadcast++;
}
else
{
priv->stats.txerrunicast++;
}
}
priv->stats.txretrycount += pstx_fb->retry_cnt;
@@ -17,19 +17,11 @@
* wlanfae <wlanfae@realtek.com>
******************************************************************************/
#if (defined(RTL8192E) || defined(RTL8190P))
#include "rtl_core.h"
#include "r8192E_hw.h"
#ifdef RTL8190P
#include "r8190P_hwimg.h"
#elif defined RTL8192E
#include "r8192E_hwimg.h"
#endif
#include "r8192E_firmware.h"
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
#include <linux/firmware.h>
#endif
extern void firmware_init_param(struct net_device *dev)
{
@@ -308,17 +300,12 @@ bool init_firmware(struct net_device *dev)
RT_TRACE(COMP_FIRMWARE, "PlatformInitFirmware: undefined firmware state\n");
}
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) && defined(USE_FW_SOURCE_IMG_FILE)
priv->firmware_source = FW_SOURCE_IMG_FILE;
#else
priv->firmware_source = FW_SOURCE_HEADER_FILE;
#endif
for (init_step = starting_state; init_step <= FW_INIT_STEP2_DATA; init_step++) {
if (rst_opt == OPT_SYSTEM_RESET) {
switch (priv->firmware_source) {
case FW_SOURCE_IMG_FILE:
{
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) && defined(USE_FW_SOURCE_IMG_FILE)
if (pfirmware->firmware_buf_size[init_step] == 0) {
const char *fw_name[3] = { "RTL8192E/boot.img",
"RTL8192E/main.img",
@@ -352,7 +339,6 @@ bool init_firmware(struct net_device *dev)
}
mapped_file = pfirmware->firmware_buf[init_step];
file_length = pfirmware->firmware_buf_size[init_step];
#endif
break;
}
case FW_SOURCE_HEADER_FILE:
@@ -393,4 +379,3 @@ download_firmware_fail:
return rt_status;
}
#endif
+1 -77
View File
@@ -815,83 +815,7 @@ void rtl8192_phy_setTxPower(struct net_device* dev, u8 channel)
(bXBTxAGC|bXCTxAGC|bXDTxAGC), u4RegValue);
}
}
#ifdef TODO
if ( pMgntInfo->OpMode == RT_OP_MODE_INFRASTRUCTURE &&
pMgntInfo->bWithCcxCellPwr &&
channel == pMgntInfo->dot11CurrentChannelNumber)
{
u8 CckCellPwrIdx = DbmToTxPwrIdx(dev, WIRELESS_MODE_B, pMgntInfo->CcxCellPwr);
u8 LegacyOfdmCellPwrIdx = DbmToTxPwrIdx(dev, WIRELESS_MODE_G, pMgntInfo->CcxCellPwr);
u8 OfdmCellPwrIdx = DbmToTxPwrIdx(dev, WIRELESS_MODE_N_24G, pMgntInfo->CcxCellPwr);
RT_TRACE(COMP_TXAGC, DBG_LOUD,
("CCX Cell Limit: %d dbm => CCK Tx power index : %d, Legacy OFDM Tx power index : %d, OFDM Tx power index: %d\n",
pMgntInfo->CcxCellPwr, CckCellPwrIdx, LegacyOfdmCellPwrIdx, OfdmCellPwrIdx));
RT_TRACE(COMP_TXAGC, DBG_LOUD,
("EEPROM channel(%d) => CCK Tx power index: %d, Legacy OFDM Tx power index : %d, OFDM Tx power index: %d\n",
channel, powerlevel, powerlevelOFDM24G + pHalData->LegacyHTTxPowerDiff, powerlevelOFDM24G));
if (powerlevel > CckCellPwrIdx)
powerlevel = CckCellPwrIdx;
if (powerlevelOFDM24G + pHalData->LegacyHTTxPowerDiff > OfdmCellPwrIdx)
{
if ((OfdmCellPwrIdx - pHalData->LegacyHTTxPowerDiff) > 0)
{
powerlevelOFDM24G = OfdmCellPwrIdx - pHalData->LegacyHTTxPowerDiff;
}
else
{
LegacyOfdmCellPwrIdx = 0;
}
}
RT_TRACE(COMP_TXAGC, DBG_LOUD,
("Altered CCK Tx power index : %d, Legacy OFDM Tx power index: %d, OFDM Tx power index: %d\n",
powerlevel, powerlevelOFDM24G + pHalData->LegacyHTTxPowerDiff, powerlevelOFDM24G));
}
pHalData->CurrentCckTxPwrIdx = powerlevel;
pHalData->CurrentOfdm24GTxPwrIdx = powerlevelOFDM24G;
RtActChannelList(Adapter, RT_CHNL_LIST_ACTION_GET_CHANNEL, &channel, &pChannelInfo);
if (pChannelInfo)
{
if (pChannelInfo->MaxTxPwrDbm != UNSPECIFIED_PWR_DBM)
{
u1Byte CckMaxPwrIdx = DbmToTxPwrIdx(Adapter, WIRELESS_MODE_B, pChannelInfo->MaxTxPwrDbm);
u1Byte LegacyOfdmMaxPwrIdx = DbmToTxPwrIdx(Adapter, WIRELESS_MODE_G, pChannelInfo->MaxTxPwrDbm);
u1Byte OfdmMaxPwrIdx = DbmToTxPwrIdx(Adapter, WIRELESS_MODE_N_24G, pChannelInfo->MaxTxPwrDbm);
RT_TRACE(COMP_TXAGC, DBG_LOUD,
("CCX Cell Limit: %ld dbm => CCK Tx power index : %d, Legacy OFDM Tx power index : %d, OFDM Tx power index: %d\n",
pChannelInfo->MaxTxPwrDbm, CckMaxPwrIdx, LegacyOfdmMaxPwrIdx, OfdmMaxPwrIdx));
RT_TRACE(COMP_TXAGC, DBG_LOUD,
("EEPROM channel(%d) => CCK Tx power index: %d, Legacy OFDM Tx power index : %d, OFDM Tx power index: %d\n",
channel, powerlevel, powerlevelOFDM24G + pHalData->LegacyHTTxPowerDiff, powerlevelOFDM24G));
if (powerlevel > CckMaxPwrIdx)
powerlevel = CckMaxPwrIdx;
if (powerlevelOFDM24G + pHalData->LegacyHTTxPowerDiff > OfdmMaxPwrIdx)
{
if ((OfdmMaxPwrIdx - pHalData->LegacyHTTxPowerDiff) > 0)
{
powerlevelOFDM24G = OfdmMaxPwrIdx - pHalData->LegacyHTTxPowerDiff;
}
else
{
LegacyOfdmMaxPwrIdx = 0;
}
}
RT_TRACE(COMP_TXAGC, DBG_LOUD,
("Altered CCK Tx power index : %d, Legacy OFDM Tx power index: %d, OFDM Tx power index: %d\n",
powerlevel, powerlevelOFDM24G + pHalData->LegacyHTTxPowerDiff, powerlevelOFDM24G));
}
}
#endif
switch (priv->rf_chip)
{
switch (priv->rf_chip) {
case RF_8225:
break;
case RF_8256:
+3 -24
View File
@@ -958,14 +958,6 @@ void HTConstructRT2RTAggElement(struct rtllib_device* ieee, u8* posRT2RTAgg, u8*
*len = 6 + 2;
return;
#ifdef TODO
posRT2RTAgg->Length = 6;
#endif
}
u8 HT_PickMCSRate(struct rtllib_device* ieee, u8* pOperateMCS)
@@ -1410,8 +1402,7 @@ void HTUseDefaultSetting(struct rtllib_device* ieee)
{
PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo;
if (pHTInfo->bEnableHT)
{
if (pHTInfo->bEnableHT) {
pHTInfo->bCurrentHTSupport = true;
pHTInfo->bCurSuppCCK = pHTInfo->bRegSuppCCK;
@@ -1434,27 +1425,15 @@ void HTUseDefaultSetting(struct rtllib_device* ieee)
HTFilterMCSRate(ieee, ieee->Regdot11TxHTOperationalRateSet, ieee->dot11HTOperationalRateSet);
#ifdef TODO
Adapter->HalFunc.InitHalRATRTableHandler( Adapter, &pMgntInfo->dot11OperationalRateSet, pMgntInfo->dot11HTOperationalRateSet);
#endif
ieee->HTHighestOperaRate = HTGetHighestMCSRate(ieee, ieee->dot11HTOperationalRateSet, MCS_FILTER_ALL);
ieee->HTCurrentOperaRate = ieee->HTHighestOperaRate;
#if (defined RTL8192SE || defined RTL8192SU || defined RTL8192CE)
if (ieee->SetHwRegHandler != NULL) {
ieee->SetHwRegHandler( ieee->dev, HW_VAR_SHORTGI_DENSITY, (u8*)(&ieee->MaxMssDensity));
ieee->SetHwRegHandler(ieee->dev, HW_VAR_AMPDU_FACTOR, &pHTInfo->CurrentAMPDUFactor);
ieee->SetHwRegHandler(ieee->dev, HW_VAR_AMPDU_MIN_SPACE, &pHTInfo->CurrentMPDUDensity);
}
#endif
}
else
{
} else {
pHTInfo->bCurrentHTSupport = false;
}
return;
}
u8 HTCCheck(struct rtllib_device* ieee, u8* pFrame)
{
if (ieee->pHTInfo->bCurrentHTSupport)
-8
View File
@@ -54,14 +54,6 @@
#define BIT30 0x40000000
#define BIT31 0x80000000
#ifndef RTK_DMP_PLATFORM
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20))
#ifndef bool
typedef enum{false = 0, true} bool;
#endif
#endif
#endif
typedef union _QOS_TSINFO{
u8 charData[3];
struct {
+1 -7
View File
@@ -20,13 +20,7 @@
#include <linux/etherdevice.h>
#include "rtl819x_TS.h"
extern void _setup_timer( struct timer_list*, void*, unsigned long);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
#define list_for_each_entry_safe(pos, n, head, member) \
for (pos = list_entry((head)->next, typeof(*pos), member), \
n = list_entry(pos->member.next, typeof(*pos), member); \
&pos->member != (head); \
pos = n, n = list_entry(n->member.next, typeof(*n), member))
#endif
void TsSetupTimeOut(unsigned long data)
{
}
-2
View File
@@ -170,9 +170,7 @@ void setKey(struct net_device *dev,
if (KeyContent != NULL) {
write_nic_dword(dev, WCAMI, (u32)(*(KeyContent+i-2)) );
write_nic_dword(dev, RWCAM, TargetCommand);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31))
udelay(100);
#endif
}
}
}
+5 -124
View File
@@ -570,11 +570,7 @@ void rtl8192_tx_timeout(struct net_device *dev)
{
struct r8192_priv *priv = rtllib_priv(dev);
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
schedule_work(&priv->reset_wq);
#else
schedule_task(&priv->reset_wq);
#endif
printk("TXTIMEOUT");
}
@@ -700,13 +696,8 @@ static struct rtllib_qos_parameters def_qos_parameters = {
void rtl8192_update_beacon(void *data)
{
#if LINUX_VERSION_CODE >=KERNEL_VERSION(2,6,20)
struct r8192_priv *priv = container_of_work_rsl(data, struct r8192_priv, update_beacon_wq.work);
struct net_device *dev = priv->rtllib->dev;
#else
struct net_device *dev = (struct net_device *)data;
struct r8192_priv *priv = rtllib_priv(dev);
#endif
struct rtllib_device* ieee = priv->rtllib;
struct rtllib_network* net = &ieee->current_network;
@@ -718,20 +709,12 @@ void rtl8192_update_beacon(void *data)
}
#define MOVE_INTO_HANDLER
#ifdef RTL8192CE
int WDCAPARA_ADD[] = {REG_EDCA_BE_PARAM,REG_EDCA_BK_PARAM,REG_EDCA_VI_PARAM,REG_EDCA_VO_PARAM};
#else
int WDCAPARA_ADD[] = {EDCAPARA_BE,EDCAPARA_BK,EDCAPARA_VI,EDCAPARA_VO};
#endif
void rtl8192_qos_activate(void *data)
{
#if LINUX_VERSION_CODE >=KERNEL_VERSION(2,6,20)
struct r8192_priv *priv = container_of_work_rsl(data, struct r8192_priv, qos_activate);
struct net_device *dev = priv->rtllib->dev;
#else
struct net_device *dev = (struct net_device *)data;
struct r8192_priv *priv = rtllib_priv(dev);
#endif
#ifndef MOVE_INTO_HANDLER
struct rtllib_qos_parameters *qos_parameters = &priv->rtllib->current_network.qos_data.parameters;
u8 mode = priv->rtllib->current_network.mode;
@@ -743,11 +726,7 @@ void rtl8192_qos_activate(void *data)
if (priv == NULL)
return;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16))
down(&priv->mutex);
#else
mutex_lock(&priv->mutex);
#endif
if (priv->rtllib->state != RTLLIB_LINKED)
goto success;
RT_TRACE(COMP_QOS,"qos active process with associate response received\n");
@@ -767,11 +746,7 @@ void rtl8192_qos_activate(void *data)
}
success:
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16))
up(&priv->mutex);
#else
mutex_unlock(&priv->mutex);
#endif
}
static int rtl8192_qos_handle_probe_response(struct r8192_priv *priv,
@@ -1199,11 +1174,7 @@ int rtl8192_sta_down(struct net_device *dev, bool shutdownrf)
del_timer_sync(&priv->watch_dog_timer);
rtl8192_cancel_deferred_work(priv);
#ifndef RTL8190P
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
cancel_delayed_work(&priv->rtllib->hw_wakeup_wq);
#endif
#endif
rtllib_softmac_stop_protocol(priv->rtllib, 0, true);
spin_lock_irqsave(&priv->rf_ps_lock,flags);
@@ -1481,11 +1452,7 @@ static void rtl8192_init_priv_lock(struct r8192_priv* priv)
#endif
sema_init(&priv->wx_sem,1);
sema_init(&priv->rf_sem,1);
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16))
sema_init(&priv->mutex, 1);
#else
mutex_init(&priv->mutex);
#endif
}
static void rtl8192_init_priv_task(struct net_device* dev)
@@ -2032,13 +1999,8 @@ void rtl819x_update_rxcounts(struct r8192_priv *priv,
void rtl819x_watchdog_wqcallback(void *data)
{
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
struct r8192_priv *priv = container_of_dwork_rsl(data,struct r8192_priv,watch_dog_wq);
struct net_device *dev = priv->rtllib->dev;
#else
struct net_device *dev = (struct net_device *)data;
struct r8192_priv *priv = rtllib_priv(dev);
#endif
struct rtllib_device* ieee = priv->rtllib;
RESET_TYPE ResetType = RESET_TYPE_NORESET;
static u8 check_reset_cnt = 0;
@@ -3005,33 +2967,11 @@ void rtl8192_irq_rx_tasklet(struct r8192_priv *priv)
*****************************************************************************/
void rtl8192_cancel_deferred_work(struct r8192_priv* priv)
{
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
cancel_delayed_work(&priv->watch_dog_wq);
cancel_delayed_work(&priv->update_beacon_wq);
#ifndef RTL8190P
cancel_delayed_work(&priv->rtllib->hw_sleep_wq);
#endif
#if defined RTL8192SE
cancel_delayed_work(&priv->check_hw_scan_wq);
cancel_delayed_work(&priv->hw_scan_simu_wq);
cancel_delayed_work(&priv->start_hw_scan_wq);
cancel_delayed_work(&priv->rtllib->update_assoc_sta_info_wq);
cancel_delayed_work(&priv->rtllib->check_tsf_wq);
#endif
#endif
#if LINUX_VERSION_CODE >=KERNEL_VERSION(2,6,22)
cancel_work_sync(&priv->reset_wq);
cancel_work_sync(&priv->qos_activate);
#elif ((LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)))
cancel_delayed_work(&priv->reset_wq);
cancel_delayed_work(&priv->qos_activate);
#if defined RTL8192SE
cancel_delayed_work(&priv->rtllib->update_assoc_sta_info_wq);
cancel_delayed_work(&priv->rtllib->check_tsf_wq);
#endif
#endif
}
int _rtl8192_up(struct net_device *dev,bool is_silent_reset)
@@ -3123,13 +3063,8 @@ void rtl8192_commit(struct net_device *dev)
void rtl8192_restart(void *data)
{
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
struct r8192_priv *priv = container_of_work_rsl(data, struct r8192_priv, reset_wq);
struct net_device *dev = priv->rtllib->dev;
#else
struct net_device *dev = (struct net_device *)data;
struct r8192_priv *priv = rtllib_priv(dev);
#endif
down(&priv->wx_sem);
@@ -3165,11 +3100,7 @@ int r8192_set_mac_adr(struct net_device *dev, void *mac)
memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
schedule_work(&priv->reset_wq);
#else
schedule_task(&priv->reset_wq);
#endif
up(&priv->wx_sem);
return 0;
@@ -3515,11 +3446,7 @@ irqreturn_type rtl8192_interrupt(int irq, void *netdev, struct pt_regs *regs)
done:
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
return;
#else
return IRQ_HANDLED;
#endif
}
@@ -3547,9 +3474,7 @@ static int __devinit rtl8192_pci_probe(struct pci_dev *pdev,
unsigned long ioaddr = 0;
struct net_device *dev = NULL;
struct r8192_priv *priv= NULL;
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
struct rtl819x_ops *ops = (struct rtl819x_ops *)(id->driver_data);
#endif
#ifdef CONFIG_RTL8192_IO_MAP
unsigned long pio_start, pio_len, pio_flags;
@@ -3569,10 +3494,6 @@ static int __devinit rtl8192_pci_probe(struct pci_dev *pdev,
pci_set_master(pdev);
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10))
#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL < (n)) -1))
#endif
#ifdef CONFIG_64BIT_DMA
if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) {
printk("RTL819xCE: Using 64bit DMA\n");
@@ -3586,13 +3507,11 @@ static int __devinit rtl8192_pci_probe(struct pci_dev *pdev,
#endif
{
if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) {
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
if (pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32))) {
printk( "Unable to obtain 32bit DMA for consistent allocations\n");
pci_disable_device(pdev);
return -ENOMEM;
}
#endif
}
}
dev = alloc_rtllib(sizeof(struct r8192_priv));
@@ -3603,26 +3522,16 @@ static int __devinit rtl8192_pci_probe(struct pci_dev *pdev,
dev->features |= NETIF_F_HIGHDMA;
}
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
SET_MODULE_OWNER(dev);
#endif
pci_set_drvdata(pdev, dev);
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
SET_NETDEV_DEV(dev, &pdev->dev);
#endif
priv = rtllib_priv(dev);
priv->rtllib = (struct rtllib_device *)netdev_priv_rsl(dev);
priv->pdev=pdev;
priv->rtllib->pdev=pdev;
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
if ((pdev->subsystem_vendor == PCI_VENDOR_ID_DLINK)&&(pdev->subsystem_device == 0x3304)){
if ((pdev->subsystem_vendor == PCI_VENDOR_ID_DLINK)&&(pdev->subsystem_device == 0x3304))
priv->rtllib->bSupportRemoteWakeUp = 1;
} else
#endif
{
else
priv->rtllib->bSupportRemoteWakeUp = 0;
}
#ifdef CONFIG_RTL8192_IO_MAP
pio_start = (unsigned long)pci_resource_start (pdev, 0);
@@ -3687,15 +3596,7 @@ static int __devinit rtl8192_pci_probe(struct pci_dev *pdev,
if (pdev->device == 0x8192 && revision_id == 0x10)
goto fail1;
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
priv->ops = ops;
#else
#if defined RTL8190P || defined RTL8192E
priv->ops = &rtl819xp_ops;
#else
priv->ops = &rtl8192se_ops;
#endif
#endif
if (rtl8192_pci_findadapter(pdev, dev) == false)
goto fail1;
@@ -3721,9 +3622,7 @@ static int __devinit rtl8192_pci_probe(struct pci_dev *pdev,
#endif
dev->wireless_handlers = (struct iw_handler_def *) &r8192_wx_handlers_def;
#endif
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
dev->ethtool_ops = &rtl819x_ethtool_ops;
#endif
dev->type = ARPHRD_ETHER;
dev->watchdog_timeo = HZ*3;
@@ -3825,9 +3724,7 @@ static void __devexit rtl8192_pci_disconnect(struct pci_dev *pdev)
#ifdef ENABLE_GPIO_RADIO_CTL
del_timer_sync(&priv->gpio_polling_timer);
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
cancel_delayed_work(&priv->gpio_change_rf_wq);
#endif
priv->polling_timer_on = 0;
#endif
rtl_debug_module_remove(priv);
@@ -3837,14 +3734,11 @@ static void __devexit rtl8192_pci_disconnect(struct pci_dev *pdev)
#ifdef CONFIG_ASPM_OR_D3
;
#endif
if (priv->pFirmware)
{
if (priv->pFirmware) {
vfree(priv->pFirmware);
priv->pFirmware = NULL;
}
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
destroy_workqueue(priv->priv_wq);
#endif
{
u32 i;
rtl8192_free_rx_ring(dev);
@@ -4012,12 +3906,7 @@ static int __init rtl8192_pci_module_init(void)
}
rtl8192_proc_module_init();
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22))
if (0!=pci_module_init(&rtl8192_pci_driver))
#else
if (0!=pci_register_driver(&rtl8192_pci_driver))
#endif
{
if (0!=pci_register_driver(&rtl8192_pci_driver)) {
DMESG("No device found");
/*pci_unregister_driver (&rtl8192_pci_driver);*/
return -ENODEV;
@@ -4070,20 +3959,12 @@ module_exit(rtl8192_pci_module_exit);
MODULE_DESCRIPTION("Linux driver for Realtek RTL819x WiFi cards");
MODULE_AUTHOR(DRV_COPYRIGHT " " DRV_AUTHOR);
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
MODULE_VERSION(DRV_VERSION);
#endif
MODULE_LICENSE("GPL");
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 9)
module_param(ifname, charp, S_IRUGO|S_IWUSR );
module_param(hwwep,int, S_IRUGO|S_IWUSR);
module_param(channels,int, S_IRUGO|S_IWUSR);
#else
MODULE_PARM(ifname, "s");
MODULE_PARM(hwwep,"i");
MODULE_PARM(channels,"i");
#endif
MODULE_PARM_DESC(ifname," Net interface name, wlan%d=default");
MODULE_PARM_DESC(hwwep," Try to use hardware WEP support(default use hw. set 0 to use software security)");
+1 -35
View File
@@ -46,9 +46,6 @@
#include <linux/random.h>
#include <linux/version.h>
#include <asm/io.h>
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27))
#include <asm/semaphore.h>
#endif
#include "rtllib.h"
#ifdef ENABLE_DOT11D
@@ -95,31 +92,8 @@
.driver_data = (kernel_ulong_t)&(cfg)
typedef irqreturn_t irqreturn_type;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10))
#if !defined(PCI_CAP_ID_EXP)
#define PCI_CAP_ID_EXP 0x10
#endif
#if !defined(PCI_EXP_LNKCTL)
#define PCI_EXP_LNKCTL 0x10
#endif
typedef int __bitwise pci_power_t;
#define PCI_D0 ((pci_power_t __force) 0)
#define PCI_D1 ((pci_power_t __force) 1)
#define PCI_D2 ((pci_power_t __force) 2)
#define PCI_D3hot ((pci_power_t __force) 3)
#define PCI_D3cold ((pci_power_t __force) 4)
#define PCI_UNKNOWN ((pci_power_t __force) 5)
#define PCI_POWER_ERROR ((pci_power_t __force) -1)
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
#define rtl8192_interrupt(x,y,z) rtl8192_interrupt_rsl(x,y,z)
#else
#define rtl8192_interrupt(x,y,z) rtl8192_interrupt_rsl(x,y)
#endif
#define rtl8192_interrupt(x,y,z) rtl8192_interrupt_rsl(x,y)
#define RTL_MAX_SCAN_SIZE 128
@@ -592,10 +566,6 @@ typedef struct r8192_priv
struct pci_dev *pdev;
struct pci_dev *bridge_pdev;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10))
u32 pci_state;
#endif
bool bfirst_init;
bool bfirst_after_down;
bool initialized_at_probe;
@@ -684,11 +654,7 @@ typedef struct r8192_priv
struct semaphore wx_sem;
struct semaphore rf_sem;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16))
struct semaphore mutex;
#else
struct mutex mutex;
#endif
struct Stats stats;
struct iw_statistics wstats;
-13
View File
@@ -243,12 +243,7 @@ int rtl_debug_module_init(struct r8192_priv *priv, const char *name)
if (!rtl_debugfs_root)
return -ENOENT;
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13))
debug = kzalloc(sizeof(rtl_fs_debug), GFP_KERNEL);
#else
rtl_fs_debug = kmalloc(sizeof(*rtl_fs_debug), GFP_KERNEL);
memset(rtl_fs_debug,0,sizeof(*rtl_fs_debug));
#endif
if (!debug) {
ret = -ENOMEM;
goto err;
@@ -1086,21 +1081,13 @@ static int proc_get_stats_rx(char *page, char **start,
void rtl8192_proc_module_init(void)
{
RT_TRACE(COMP_INIT, "Initializing proc filesystem");
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
rtl8192_proc=create_proc_entry(DRV_NAME, S_IFDIR, proc_net);
#else
rtl8192_proc=create_proc_entry(DRV_NAME, S_IFDIR, init_net.proc_net);
#endif
}
void rtl8192_proc_module_remove(void)
{
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
remove_proc_entry(DRV_NAME, proc_net);
#else
remove_proc_entry(DRV_NAME, init_net.proc_net);
#endif
}
-6
View File
@@ -27,9 +27,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/version.h>
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,9))
#include <linux/debugfs.h>
#endif
struct r8192_priv;
struct _tx_desc_8192se;
@@ -272,11 +270,7 @@ typedef struct _rtl_fs_debug
struct dentry *debug_register;
u32 hw_type;
u32 hw_offset;
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,20))
bool hw_holding;
#else
u8 hw_holding;
#endif
} rtl_fs_debug;
void print_buffer(u32 *buffer, int len);
File diff suppressed because it is too large Load Diff
-6
View File
@@ -29,7 +29,6 @@
#include "rtl_core.h"
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
static void rtl819x_ethtool_get_drvinfo(struct net_device *dev,
struct ethtool_drvinfo *info)
{
@@ -37,10 +36,6 @@ static void rtl819x_ethtool_get_drvinfo(struct net_device *dev,
strcpy(info->driver, DRV_NAME);
strcpy(info->version, DRV_VERSION);
#if defined RTL8192SE
snprintf(info->fw_version, sizeof(info->fw_version), "%d",
priv->pFirmware->FirmwareVersion);
#endif
strcpy(info->bus_info, pci_name(priv->pdev));
}
@@ -56,4 +51,3 @@ const struct ethtool_ops rtl819x_ethtool_ops = {
.get_drvinfo = rtl819x_ethtool_get_drvinfo,
.get_link = rtl819x_ethtool_get_link,
};
#endif
-352
View File
@@ -25,337 +25,6 @@
#include "rtl_pci.h"
#include "rtl_core.h"
#if defined RTL8192CE || defined RTL8192SE
bool
rtl8192_get_LinkControl_field(
struct net_device *dev,
u8 BusNum,
u8 DevNum,
u8 FuncNum
)
{
struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev);
RT_PCI_CAPABILITIES_HEADER CapabilityHdr;
unsigned char CapabilityOffset, Num4Bytes;
u32 PciCfgAddrPort=0;
u8 LinkCtrlReg;
bool Status = false;
if ( BusNum == 0xff && DevNum == 0xff && FuncNum == 0xff ){
printk("GetLinkControlField(): Fail to find PCIe Capability\n");
return false;
}
PciCfgAddrPort= (BusNum<< 16)|(DevNum << 11)|(FuncNum << 8)|(1 << 31);
Num4Bytes = 0x34/4;
NdisRawWritePortUlong(PCI_CONF_ADDRESS , PciCfgAddrPort+( Num4Bytes<< 2));
NdisRawReadPortUchar(PCI_CONF_DATA, &CapabilityOffset);
while (CapabilityOffset != 0)
{
Num4Bytes = CapabilityOffset/4;
NdisRawWritePortUlong(PCI_CONF_ADDRESS , PciCfgAddrPort+( Num4Bytes<< 2));
NdisRawReadPortUshort(PCI_CONF_DATA, (u16*)&CapabilityHdr);
if (CapabilityHdr.CapabilityID == PCI_CAPABILITY_ID_PCI_EXPRESS)
{
break;
}
else
{
CapabilityOffset = CapabilityHdr.Next;
}
}
if (CapabilityHdr.CapabilityID == PCI_CAPABILITY_ID_PCI_EXPRESS)
{
Num4Bytes = (CapabilityOffset+0x10)/4;
NdisRawWritePortUlong(PCI_CONF_ADDRESS , PciCfgAddrPort+(Num4Bytes << 2));
NdisRawReadPortUchar(PCI_CONF_DATA, &LinkCtrlReg);
priv->NdisAdapter.PciBridgePCIeHdrOffset = CapabilityOffset;
priv->NdisAdapter.PciBridgeLinkCtrlReg = LinkCtrlReg;
Status = true;
}
else
{
printk("GetLinkControlField(): Cannot Find PCIe Capability\n");
}
return Status;
}
bool
rtl8192_get_pci_BusInfo(
struct net_device *dev,
u16 VendorId,
u16 DeviceId,
u8 IRQL,
u8 BaseCode,
u8 SubClass,
u8 filed19val,
u8* BusNum,
u8* DevNum,
u8* FuncNum
)
{
u8 busNumIdx, deviceNumIdx, functionNumIdx;
u32 PciCfgAddrPort=0;
u32 devVenID = 0, classCode, field19, headertype;
u16 venId, devId;
u8 basec, subc, irqLine;
u16 RegOffset;
bool bSingleFunc = false;
bool bBridgeChk = false;
*BusNum = 0xFF;
*DevNum = 0xFF;
*FuncNum = 0xFF;
if ((BaseCode == PCI_CLASS_BRIDGE_DEV) && (SubClass==PCI_SUBCLASS_BR_PCI_TO_PCI) && (filed19val==U1DONTCARE))
bBridgeChk = true;
for (busNumIdx = 0; busNumIdx < PCI_MAX_BRIDGE_NUMBER ; busNumIdx++)
{
for (deviceNumIdx = 0; deviceNumIdx < PCI_MAX_DEVICES; deviceNumIdx ++)
{
bSingleFunc = false;
for (functionNumIdx = 0; functionNumIdx < PCI_MAX_FUNCTION; functionNumIdx++)
{
if (functionNumIdx == 0)
{
PciCfgAddrPort= (busNumIdx << 16)|(deviceNumIdx << 11)|(functionNumIdx << 8)|(1 << 31);
NdisRawWritePortUlong(PCI_CONF_ADDRESS , PciCfgAddrPort + (3 << 2));
NdisRawReadPortUlong(PCI_CONF_DATA, &headertype);
headertype = ((headertype >> 16) & 0x0080) >> 7;
if ( headertype == 0)
bSingleFunc = true;
}
else
{
if (bSingleFunc == true) break;
}
PciCfgAddrPort= (busNumIdx << 16)|(deviceNumIdx << 11)|(functionNumIdx << 8)|(1 << 31);
NdisRawWritePortUlong(PCI_CONF_ADDRESS , PciCfgAddrPort);
NdisRawReadPortUlong(PCI_CONF_DATA, &devVenID);
if ( devVenID == 0xFFFFFFFF||devVenID == 0 ) continue;
RegOffset = 0x3C;
PciCfgAddrPort= (busNumIdx << 16)|(deviceNumIdx << 11)|(functionNumIdx << 8)|(1 << 31)|(RegOffset & 0xFFFFFFFC);
NdisRawWritePortUlong(PCI_CONF_ADDRESS , PciCfgAddrPort);
NdisRawReadPortUchar((PCI_CONF_DATA+ (RegOffset & 0x3)), &irqLine);
venId = (u16)(devVenID >> 0)& 0xFFFF;
devId = (u16)(devVenID >> 16)& 0xFFFF;
if (!bBridgeChk && (venId != VendorId) && (VendorId != U2DONTCARE))
continue;
if (!bBridgeChk && (devId != DeviceId) && (DeviceId != U2DONTCARE))
continue;
if (!bBridgeChk && (irqLine != IRQL) && (IRQL != U1DONTCARE))
continue;
PciCfgAddrPort= (busNumIdx << 16)|(deviceNumIdx << 11)|(functionNumIdx << 8)|(1 << 31);
NdisRawWritePortUlong(PCI_CONF_ADDRESS , PciCfgAddrPort + (2 << 2));
NdisRawReadPortUlong(PCI_CONF_DATA, &classCode);
classCode = classCode >> 8;
basec = (u8)(classCode >>16 ) & 0xFF;
subc = (u8)(classCode >>8 ) & 0xFF;
if (bBridgeChk && (venId != VendorId) &&(basec == BaseCode) && (subc== SubClass ) )
return true;
if (bBridgeChk && (venId != VendorId) && (VendorId != U2DONTCARE))
continue;
if (bBridgeChk && (devId != DeviceId) && (DeviceId != U2DONTCARE))
continue;
if (bBridgeChk && (irqLine != IRQL) && (IRQL != U1DONTCARE))
continue;
NdisRawWritePortUlong(PCI_CONF_ADDRESS , PciCfgAddrPort + (6 << 2));
NdisRawReadPortUlong(PCI_CONF_DATA, &field19);
field19 = (field19 >> 8)& 0xFF;
if ((basec == BaseCode) && (subc== SubClass ) && ((field19 == filed19val) ||(filed19val==U1DONTCARE) ))
{
*BusNum = busNumIdx;
*DevNum = deviceNumIdx;
*FuncNum = functionNumIdx;
printk( "GetPciBusInfo(): Find Device(%X:%X) bus=%d dev=%d, func=%d\n",VendorId, DeviceId, busNumIdx, deviceNumIdx, functionNumIdx);
return true;
}
}
}
}
printk( "GetPciBusInfo(): Cannot Find Device(%X:%X:%X)\n",VendorId, DeviceId, devVenID);
return false;
}
bool rtl8192_get_pci_BridegInfo(
struct net_device *dev,
u8 BaseCode,
u8 SubClass,
u8 filed19val,
u8* BusNum,
u8* DevNum,
u8* FuncNum,
u16* VendorId,
u16* DeviceId
)
{
u8 busNumIdx, deviceNumIdx, functionNumIdx;
u32 PciCfgAddrPort=0;
u32 devVenID, classCode, field19, headertype;
u16 venId, devId;
u8 basec, subc, irqLine;
u16 RegOffset;
bool bSingleFunc = false;
*BusNum = 0xFF;
*DevNum = 0xFF;
*FuncNum = 0xFF;
for (busNumIdx = 0; busNumIdx < PCI_MAX_BRIDGE_NUMBER ; busNumIdx++)
{
for (deviceNumIdx = 0; deviceNumIdx < PCI_MAX_DEVICES; deviceNumIdx ++)
{
bSingleFunc = false;
for (functionNumIdx = 0; functionNumIdx < PCI_MAX_FUNCTION; functionNumIdx++)
{
if (functionNumIdx == 0)
{
PciCfgAddrPort= (busNumIdx << 16)|(deviceNumIdx << 11)|(functionNumIdx << 8)|(1 << 31);
NdisRawWritePortUlong(PCI_CONF_ADDRESS , PciCfgAddrPort + (3 << 2));
NdisRawReadPortUlong(PCI_CONF_DATA, &headertype);
headertype = ((headertype >> 16) & 0x0080) >> 7;
if ( headertype == 0)
bSingleFunc = true;
}
else
{
if ( bSingleFunc ==true ) break;
}
PciCfgAddrPort= (busNumIdx << 16)|(deviceNumIdx << 11)|(functionNumIdx << 8)|(1 << 31);
NdisRawWritePortUlong(PCI_CONF_ADDRESS , PciCfgAddrPort);
NdisRawReadPortUlong(PCI_CONF_DATA, &devVenID);
RegOffset = 0x3C;
PciCfgAddrPort= (busNumIdx << 16)|(deviceNumIdx << 11)|(functionNumIdx << 8)|(1 << 31)|(RegOffset & 0xFFFFFFFC);
NdisRawWritePortUlong(PCI_CONF_ADDRESS , PciCfgAddrPort);
NdisRawReadPortUchar((PCI_CONF_DATA+ (RegOffset & 0x3)), &irqLine);
venId = (u16)(devVenID >> 0)& 0xFFFF;
devId = (u16)(devVenID >> 16)& 0xFFFF;
PciCfgAddrPort= (busNumIdx << 16)|(deviceNumIdx << 11)|(functionNumIdx << 8)|(1 << 31);
NdisRawWritePortUlong(PCI_CONF_ADDRESS , PciCfgAddrPort + (2 << 2));
NdisRawReadPortUlong(PCI_CONF_DATA, &classCode);
classCode = classCode >> 8;
basec = (u8)(classCode >>16 ) & 0xFF;
subc = (u8)(classCode >>8 ) & 0xFF;
NdisRawWritePortUlong(PCI_CONF_ADDRESS , PciCfgAddrPort + (6 << 2));
NdisRawReadPortUlong(PCI_CONF_DATA, &field19);
field19 = (field19 >> 8)& 0xFF;
if ((basec == BaseCode) && (subc== SubClass ) && ((field19 == filed19val) ||(filed19val==U1DONTCARE) ))
{
*BusNum = busNumIdx;
*DevNum = deviceNumIdx;
*FuncNum = functionNumIdx;
*VendorId = venId;
*DeviceId = devId;
printk("GetPciBridegInfo : Find Device(%X:%X) bus=%d dev=%d, func=%d\n",
venId, devId, busNumIdx, deviceNumIdx, functionNumIdx);
return true;
}
}
}
}
printk( "GetPciBridegInfo(): Cannot Find PciBridge for Device\n");
return false;
}
static u16 PciBridgeVendorArray[PCI_BRIDGE_VENDOR_MAX]
= {INTEL_VENDOR_ID,ATI_VENDOR_ID,AMD_VENDOR_ID,SIS_VENDOR_ID};
void
rtl8192_pci_find_BridgeInfo(struct net_device *dev)
{
struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev);
u8 PciBridgeBusNum = 0xff;
u8 PciBridgeDevNum = 0xff;
u8 PciBridgeFuncNum = 0xff;
u16 PciBridgeVendorId= 0xff;
u16 PciBridgeDeviceId = 0xff;
u8 tmp = 0;
rtl8192_get_pci_BridegInfo(dev,
PCI_CLASS_BRIDGE_DEV,
PCI_SUBCLASS_BR_PCI_TO_PCI ,
priv->NdisAdapter.BusNumber,
&PciBridgeBusNum,
&PciBridgeDevNum,
&PciBridgeFuncNum,
&PciBridgeVendorId,
&PciBridgeDeviceId);
priv->NdisAdapter.PciBridgeVendor = PCI_BRIDGE_VENDOR_UNKNOWN;
for (tmp = 0; tmp < PCI_BRIDGE_VENDOR_MAX; tmp++) {
if (PciBridgeVendorId == PciBridgeVendorArray[tmp]) {
priv->NdisAdapter.PciBridgeVendor = tmp;
printk("Pci Bridge Vendor is found index: %d\n",tmp);
break;
}
}
printk("Pci Bridge Vendor is %x\n",PciBridgeVendorArray[tmp]);
priv->NdisAdapter.PciBridgeBusNum = PciBridgeBusNum;
priv->NdisAdapter.PciBridgeDevNum = PciBridgeDevNum;
priv->NdisAdapter.PciBridgeFuncNum = PciBridgeFuncNum;
priv->NdisAdapter.PciBridgeVendorId = PciBridgeVendorId;
priv->NdisAdapter.PciBridgeDeviceId = PciBridgeDeviceId;
}
#endif
static void rtl8192_parse_pci_configuration(struct pci_dev *pdev, struct net_device *dev)
{
struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev);
@@ -417,27 +86,6 @@ bool rtl8192_pci_findadapter(struct pci_dev *pdev, struct net_device *dev)
return false;
}
#if defined RTL8192CE || defined RTL8192SE
rtl8192_get_pci_BusInfo(dev,
VenderID,
DeviceID,
(u8)IrqLine,
0x02,0x80, U1DONTCARE,
&priv->NdisAdapter.BusNumber,
&priv->NdisAdapter.DevNumber,
&priv->NdisAdapter.FuncNumber);
rtl8192_pci_find_BridgeInfo(dev);
#ifdef RTL8192SE
if (priv->NdisAdapter.PciBridgeVendor != PCI_BRIDGE_VENDOR_UNKNOWN)
#endif
{
rtl8192_get_LinkControl_field(dev, priv->NdisAdapter.PciBridgeBusNum,
priv->NdisAdapter.PciBridgeDevNum, priv->NdisAdapter.PciBridgeFuncNum);
}
#endif
rtl8192_parse_pci_configuration(pdev, dev);
return true;
-16
View File
@@ -34,9 +34,7 @@ int rtl8192E_suspend (struct pci_dev *pdev, pm_message_t state)
{
struct net_device *dev = pci_get_drvdata(pdev);
struct r8192_priv *priv = rtllib_priv(dev);
#if !(defined RTL8192SE || defined RTL8192CE)
u32 ulRegRead;
#endif
RT_TRACE(COMP_POWER, "============> r8192E suspend call.\n");
printk("============> r8192E suspend call.\n");
@@ -59,7 +57,6 @@ int rtl8192E_suspend (struct pci_dev *pdev, pm_message_t state)
#endif
netif_device_detach(dev);
#if !(defined RTL8192SE || defined RTL8192CE)
if (!priv->rtllib->bSupportRemoteWakeUp) {
MgntActSet_RF_State(dev, eRfOff, RF_CHANGE_BY_INIT,true);
ulRegRead = read_nic_dword(dev, CPU_GEN);
@@ -69,18 +66,9 @@ int rtl8192E_suspend (struct pci_dev *pdev, pm_message_t state)
write_nic_dword(dev, WFCRC0, 0xffffffff);
write_nic_dword(dev, WFCRC1, 0xffffffff);
write_nic_dword(dev, WFCRC2, 0xffffffff);
#ifdef RTL8190P
{
u8 ucRegRead;
ucRegRead = read_nic_byte(dev, GPO);
ucRegRead |= BIT0;
write_nic_byte(dev, GPO, ucRegRead);
}
#endif
write_nic_byte(dev, PMR, 0x5);
write_nic_byte(dev, MacBlkCtrl, 0xa);
}
#endif
out_pci_suspend:
RT_TRACE(COMP_POWER, "r8192E support WOL call??????????????????????\n");
printk("r8192E support WOL call??????????????????????\n");
@@ -101,9 +89,7 @@ out_pci_suspend:
int rtl8192E_resume (struct pci_dev *pdev)
{
struct net_device *dev = pci_get_drvdata(pdev);
#if defined ENABLE_GPIO_RADIO_CTL || !(defined RTL8192SE || defined RTL8192CE)
struct r8192_priv *priv = rtllib_priv(dev);
#endif
int err;
u32 val;
@@ -146,11 +132,9 @@ int rtl8192E_resume (struct pci_dev *pdev)
dev->open(dev);
#endif
#if !(defined RTL8192SE || defined RTL8192CE)
if (!priv->rtllib->bSupportRemoteWakeUp) {
MgntActSet_RF_State(dev, eRfOn, RF_CHANGE_BY_INIT,true);
}
#endif
out:
RT_TRACE(COMP_POWER, "<================r8192E resume call.\n");
-4
View File
@@ -25,10 +25,6 @@
#include <linux/types.h>
#include <linux/pci.h>
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10))
#define pm_message_t u32
#endif
int rtl8192E_save_state (struct pci_dev *dev, pm_message_t state);
int rtl8192E_suspend (struct pci_dev *dev, pm_message_t state);
int rtl8192E_resume (struct pci_dev *dev);
-63
View File
@@ -156,13 +156,6 @@ void InactivePsWorkItemCallback(struct net_device *dev)
RT_DISABLE_ASPM(dev);
RT_CLEAR_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_ASPM);
}
#ifdef TODO
else if ((pPSC->RegRfPsLevel & RT_RF_OFF_LEVL_PCI_D3) && RT_IN_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_PCI_D3))
{
RT_LEAVE_D3(dev, false);
RT_CLEAR_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_PCI_D3);
}
#endif
}
#endif
MgntActSet_RF_State(dev, pPSC->eInactivePowerState, RF_CHANGE_BY_IPS,false);
@@ -175,13 +168,6 @@ void InactivePsWorkItemCallback(struct net_device *dev)
RT_ENABLE_ASPM(dev);
RT_SET_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_ASPM);
}
#ifdef TODO
else if (pPSC->RegRfPsLevel & RT_RF_OFF_LEVL_PCI_D3)
{
RT_ENTER_D3(dev, false);
RT_SET_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_PCI_D3);
}
#endif
}
#endif
@@ -466,18 +452,6 @@ bool PlatformSwitchClkReq(struct net_device *dev, u8 value)
pci_write_config_byte(priv->pdev,0x81,value);
bResult = true;
#ifdef TODO
if (Buffer) {
priv->ClkReqState = true;
} else {
priv->ClkReqState = false;
}
#endif
#ifdef RTL8192SE
udelay(100);
#endif
return bResult;
}
@@ -542,15 +516,6 @@ void PlatformEnableASPM(struct net_device *dev)
return;
}
#ifdef RTL8192SE
if (priv->NdisAdapter.PciBridgeVendor != PCI_BRIDGE_VENDOR_INTEL )
{
RT_TRACE(COMP_POWER, "%s(): Dont modify ASPM for non intel chipset. For Bridge Vendor %d.\n"
,__func__,priv->NdisAdapter.PciBridgeVendor);
return;
}
#endif
ASPMLevel |= priv->RegDevicePciASPMSetting;
uDeviceASPMSetting = priv->NdisAdapter.LinkCtrlReg;
@@ -586,34 +551,6 @@ bool PlatformSetPMCSR(struct net_device *dev,u8 value,bool bTempSetting)
Buffer= value;
spin_lock_irqsave(&priv->D3_lock,flag);
#ifdef TODO
if (bTempSetting)
{
if (Buffer==0x00)
{
priv->LeaveD3Cnt++;
{
bActuallySet =true;
}
}
else
{
priv->LeaveD3Cnt--;
if (priv->LeaveD3Cnt == 0)
{
bActuallySet=true;
}
}
}
else
{
priv->LeaveD3Cnt=0;
bActuallySet=true;
bSetFunc=true;
}
#endif
if (bActuallySet) {
if (Buffer) {
PlatformSwitchClkReq(dev, 0x01);
+1 -166
View File
@@ -28,12 +28,7 @@
#include <linux/version.h>
#include <linux/module.h>
#include <linux/interrupt.h>
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
#include <linux/jiffies.h>
#else
#include <linux/jffs.h>
#include <linux/tqueue.h>
#endif
#include <linux/timer.h>
#include <linux/sched.h>
@@ -73,27 +68,6 @@
#define IW_CUSTOM_MAX 256 /* In bytes */
#endif
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
#define jiffies_to_msecs(t) ((t) * 1000 / HZ)
#ifndef __bitwise
#define __bitwise __attribute__((bitwise))
#endif
typedef __u16 __le16;
#if (WIRELESS_EXT < 16)
struct iw_spy_data{
/* --- Standard spy support --- */
int spy_number;
u_char spy_address[IW_MAX_SPY][ETH_ALEN];
struct iw_quality spy_stat[IW_MAX_SPY];
/* --- Enhanced spy support (event) */
struct iw_quality spy_thr_low; /* Low threshold */
struct iw_quality spy_thr_high; /* High threshold */
u_char spy_thr_under[IW_MAX_SPY];
};
#endif
#endif
#ifndef container_of
/**
* container_of - cast a member of a structure out to the containing structure
@@ -108,115 +82,32 @@ struct iw_spy_data{
(type *)( (char *)__mptr - offsetof(type,member) );})
#endif
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,18))
#define skb_tail_pointer_rsl(skb) skb_tail_pointer(skb)
#else
#define skb_tail_pointer_rsl(skb) skb->tail
#endif
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
#define EXPORT_SYMBOL_RSL(x) EXPORT_SYMBOL(x)
#else
#define EXPORT_SYMBOL_RSL(x) EXPORT_SYMBOL_NOVERS(x)
#endif
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
static inline void tq_init(struct tq_struct * task, void(*func)(void *), void *data)
{
task->routine = func;
task->data = data;
INIT_LIST_HEAD(&task->list);
task->sync = 0;
}
#endif
#define EXPORT_SYMBOL_RSL(x) EXPORT_SYMBOL(x)
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10))
static inline void setup_timer(struct timer_list * timer, void(*function)(unsigned long), unsigned long data)
{
timer->function = function;
timer->data = data;
}
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
typedef struct delayed_work delayed_work_struct_rsl;
#define queue_delayed_work_rsl(x,y,z) queue_delayed_work(x,y,z)
#define INIT_DELAYED_WORK_RSL(x,y,z) INIT_DELAYED_WORK(x,y)
#elif LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,40)
typedef struct tq_struct delayed_work_struct_rsl;
#define queue_delayed_work_rsl(x,y,z) schedule_task(y)
#define INIT_DELAYED_WORK_RSL(x,y,z) tq_init(x,y,z)
#else
typedef struct work_struct delayed_work_struct_rsl;
#define queue_delayed_work_rsl(x,y,z) queue_delayed_work(x,y,z)
#define INIT_DELAYED_WORK_RSL(x,y,z) INIT_WORK(x,y,z)
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
typedef struct work_struct work_struct_rsl;
#define queue_work_rsl(x,y) queue_work(x,y)
#define INIT_WORK_RSL(x,y,z) INIT_WORK(x,y)
#elif LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,40)
typedef struct tq_struct work_struct_rsl;
#define queue_work_rsl(x,y) schedule_task(y)
#define INIT_WORK_RSL(x,y,z) tq_init(x,y,z)
#else
typedef struct work_struct work_struct_rsl;
#define queue_work_rsl(x,y) queue_work(x,y)
#define INIT_WORK_RSL(x,y,z) INIT_WORK(x,y,z)
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
#define container_of_work_rsl(x,y,z) container_of(x,y,z)
#define container_of_dwork_rsl(x,y,z) container_of(container_of(x, struct delayed_work, work), y, z)
#else
#define container_of_work_rsl(x,y,z) (x)
#define container_of_dwork_rsl(x,y,z) (x)
#endif
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,4,20)) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
static inline char *
iwe_stream_add_event_rsl(struct iw_request_info *info,
char * stream, /* Stream of events */
char * ends, /* End of stream */
struct iw_event *iwe, /* Payload */
int event_len) /* Real size of payload */
{
/* Check if it's possible */
if ((stream + event_len) < ends) {
iwe->len = event_len;
ndelay(1);
memcpy(stream, (char *) iwe, event_len);
stream += event_len;
}
return stream;
}
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
#define iwe_stream_add_event_rsl(info,start,stop,iwe,len) iwe_stream_add_event(info,start,stop,iwe,len)
#else
#define iwe_stream_add_event_rsl(info,start,stop,iwe,len) iwe_stream_add_event(start,stop,iwe,len)
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
#define iwe_stream_add_point_rsl(info,start,stop,iwe,p) iwe_stream_add_point(info,start,stop,iwe,p)
#else
#define iwe_stream_add_point_rsl(info,start,stop,iwe,p) iwe_stream_add_point(start,stop,iwe,p)
#endif
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
#define usb_alloc_urb_rsl(x,y) usb_alloc_urb(x,y)
#define usb_submit_urb_rsl(x,y) usb_submit_urb(x,y)
#else
#define usb_alloc_urb_rsl(x,y) usb_alloc_urb(x)
#define usb_submit_urb_rsl(x,y) usb_submit_urb(x)
#endif
static inline void *netdev_priv_rsl(struct net_device *dev)
{
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
return netdev_priv(dev);
#else
return dev->priv;
#endif
}
#define KEY_TYPE_NA 0x0
@@ -645,34 +536,8 @@ typedef struct ieee_param {
#define IW_QUAL_NOISE_UPDATED 0x4
#endif
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9))
#define MSECS(t) (HZ * ((t) / 1000) + (HZ * ((t) % 1000)) / 1000)
static inline unsigned long msleep_interruptible_rsl(unsigned int msecs)
{
unsigned long timeout = MSECS(msecs) + 1;
while (timeout) {
set_current_state(TASK_INTERRUPTIBLE);
timeout = schedule_timeout(timeout);
}
return timeout;
}
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,31))
static inline void msleep(unsigned int msecs)
{
unsigned long timeout = MSECS(msecs) + 1;
while (timeout) {
set_current_state(TASK_UNINTERRUPTIBLE);
timeout = schedule_timeout(timeout);
}
}
#endif
#else
#define MSECS(t) msecs_to_jiffies(t)
#define msleep_interruptible_rsl msleep_interruptible
#endif
#define RTLLIB_DATA_LEN 2304
/* Maximum size for the MA-UNITDATA primitive, 802.11 standard section
@@ -1572,11 +1437,7 @@ typedef union _frameqos {
* main rates information element... */
#define MAX_RATES_LENGTH ((u8)12)
#define MAX_RATES_EX_LENGTH ((u8)16)
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
#define MAX_NETWORK_COUNT 16
#else
#define MAX_NETWORK_COUNT 96
#endif
#define MAX_CHANNEL_NUMBER 161
#define RTLLIB_SOFTMAC_SCAN_TIME 100
@@ -1980,21 +1841,6 @@ enum rtllib_state {
#define RTLLIB_52GHZ_MAX_CHANNEL 165
#define RTLLIB_52GHZ_CHANNELS (RTLLIB_52GHZ_MAX_CHANNEL - \
RTLLIB_52GHZ_MIN_CHANNEL + 1)
#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,11))
extern inline int is_multicast_ether_addr(const u8 *addr)
{
return ((addr[0] != 0xff) && (0x01 & addr[0]));
}
#endif
#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,13))
extern inline int is_broadcast_ether_addr(const u8 *addr)
{
return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && \
(addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff));
}
#endif
#ifndef eqMacAddr
#define eqMacAddr(a,b) ( ((a)[0]==(b)[0] && (a)[1]==(b)[1] && (a)[2]==(b)[2] && (a)[3]==(b)[3] && (a)[4]==(b)[4] && (a)[5]==(b)[5]) ? 1:0 )
#endif
@@ -3080,17 +2926,6 @@ static inline int rtllib_is_cck_rate(u8 rate)
}
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10))
static inline unsigned compare_ether_addr(const u8 *addr1, const u8 *addr2)
{
const u16 *a = (const u16 *) addr1;
const u16 *b = (const u16 *) addr2;
BUILD_BUG_ON(ETH_ALEN != 6);
return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | (a[2] ^ b[2])) != 0;
}
#endif
/* rtllib.c */
extern void free_rtllib(struct net_device *dev);
extern struct net_device *alloc_rtllib(int sizeof_priv);
-8
View File
@@ -82,12 +82,4 @@ void rtllib_crypt_deinit_entries(struct rtllib_device *, int);
void rtllib_crypt_deinit_handler(unsigned long);
void rtllib_crypt_delayed_deinit(struct rtllib_device *ieee,
struct rtllib_crypt_data **crypt);
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
#define offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK)
#endif
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,31))
#define crypto_alloc_tfm crypto_alloc_tfm_rsl
#define crypto_free_tfm crypto_free_tfm_rsl
#endif
#endif

Some files were not shown because too many files have changed in this diff Show More