diff options
Diffstat (limited to 'drivers/staging/rt2870')
73 files changed, 0 insertions, 3746 deletions
diff --git a/drivers/staging/rt2870/Kconfig b/drivers/staging/rt2870/Kconfig deleted file mode 100644 index e988680b5be4..000000000000 --- a/drivers/staging/rt2870/Kconfig +++ /dev/null @@ -1,9 +0,0 @@ -config RT2870 - tristate "Ralink 2870/3070 wireless support" - depends on USB && (X86 || ARM) && WLAN - select WIRELESS_EXT - select WEXT_PRIV - select CRC_CCITT - select FW_LOADER - ---help--- - This is an experimental driver for the Ralink xx70 wireless chips. diff --git a/drivers/staging/rt2870/Makefile b/drivers/staging/rt2870/Makefile deleted file mode 100644 index b499910ed738..000000000000 --- a/drivers/staging/rt2870/Makefile +++ /dev/null @@ -1,55 +0,0 @@ -# -obj-$(CONFIG_RT2870) += rt2870sta.o - -# TODO: all of these should be removed -ccflags-y := -DLINUX -DAGGREGATION_SUPPORT -DPIGGYBACK_SUPPORT -DWMM_SUPPORT -ccflags-y += -DRTMP_MAC_USB -DRTMP_USB_SUPPORT -DRT2870 -DRTMP_TIMER_TASK_SUPPORT -ccflags-y += -DRTMP_RF_RW_SUPPORT -DRTMP_EFUSE_SUPPORT -DRT30xx -DRT3070 -ccflags-y += -DDBG - -rt2870sta-y := \ - common/crypt_md5.o \ - common/crypt_sha2.o \ - common/crypt_hmac.o \ - common/mlme.o \ - common/cmm_wep.o \ - common/action.o \ - common/cmm_data.o \ - common/rtmp_init.o \ - common/cmm_tkip.o \ - common/cmm_aes.o \ - common/cmm_sync.o \ - common/eeprom.o \ - common/cmm_sanity.o \ - common/cmm_info.o \ - common/cmm_cfg.o \ - common/cmm_wpa.o \ - common/dfs.o \ - common/spectrum.o \ - common/rtmp_timer.o \ - common/rt_channel.o \ - common/cmm_asic.o \ - sta/assoc.o \ - sta/auth.o \ - sta/auth_rsp.o \ - sta/sync.o \ - sta/sanity.o \ - sta/rtmp_data.o \ - sta/connect.o \ - sta/wpa.o \ - rt_linux.o \ - rt_main_dev.o \ - sta_ioctl.o \ - common/ba_action.o \ - usb_main_dev.o \ - rt_usb.o \ - common/cmm_mac_usb.o \ - common/rtusb_io.o \ - common/rtusb_bulk.o \ - common/rtusb_data.o \ - common/cmm_data_usb.o \ - common/rtmp_mcu.o \ - common/ee_efuse.o \ - chips/rt30xx.o \ - common/rt_rf.o \ - chips/rt3070.o diff --git a/drivers/staging/rt2870/TODO b/drivers/staging/rt2870/TODO deleted file mode 100644 index 2df1bfed9a58..000000000000 --- a/drivers/staging/rt2870/TODO +++ /dev/null @@ -1,17 +0,0 @@ -I'm hesitant to add a TODO file here, as the wireless developers would -really have people help them out on the "clean" rt2870 driver that can -be found at the http://rt2x00.serialmonkey.com/ site. - -But, if you wish to clean up this driver instead, here's a short list of -things that need to be done to get it into a more mergable shape: - -TODO: - - checkpatch.pl clean - - sparse clean - - port to in-kernel 80211 stack and common rt2x00 infrastructure - - remove reading from /etc/ config files - - review by the wireless developer community - -Please send any patches or complaints about this driver to Greg -Kroah-Hartman <greg@kroah.com> and don't bother the upstream wireless -kernel developers about it, they want nothing to do with it. diff --git a/drivers/staging/rt2870/aironet.h b/drivers/staging/rt2870/aironet.h deleted file mode 100644 index ae6259710a4f..000000000000 --- a/drivers/staging/rt2870/aironet.h +++ /dev/null @@ -1 +0,0 @@ -#include "../rt2860/aironet.h" diff --git a/drivers/staging/rt2870/ap.h b/drivers/staging/rt2870/ap.h deleted file mode 100644 index fe04b5f45f20..000000000000 --- a/drivers/staging/rt2870/ap.h +++ /dev/null @@ -1 +0,0 @@ -#include "../rt2860/ap.h" diff --git a/drivers/staging/rt2870/chips/rt3070.c b/drivers/staging/rt2870/chips/rt3070.c deleted file mode 100644 index 3a6db5ea89ab..000000000000 --- a/drivers/staging/rt2870/chips/rt3070.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../rt2860/chips/rt3070.c" diff --git a/drivers/staging/rt2870/chips/rt30xx.c b/drivers/staging/rt2870/chips/rt30xx.c deleted file mode 100644 index 6c56b84c75d9..000000000000 --- a/drivers/staging/rt2870/chips/rt30xx.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../rt2860/chips/rt30xx.c" diff --git a/drivers/staging/rt2870/chlist.h b/drivers/staging/rt2870/chlist.h deleted file mode 100644 index 31999583b379..000000000000 --- a/drivers/staging/rt2870/chlist.h +++ /dev/null @@ -1 +0,0 @@ -#include "../rt2860/chlist.h" diff --git a/drivers/staging/rt2870/common/acction.c b/drivers/staging/rt2870/common/acction.c deleted file mode 100644 index fd806c3871aa..000000000000 --- a/drivers/staging/rt2870/common/acction.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../rt2860/common/action.c" diff --git a/drivers/staging/rt2870/common/action.c b/drivers/staging/rt2870/common/action.c deleted file mode 100644 index fd806c3871aa..000000000000 --- a/drivers/staging/rt2870/common/action.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../rt2860/common/action.c" diff --git a/drivers/staging/rt2870/common/action.h b/drivers/staging/rt2870/common/action.h deleted file mode 100644 index 9a1895525f30..000000000000 --- a/drivers/staging/rt2870/common/action.h +++ /dev/null @@ -1 +0,0 @@ -#include "../../rt2860/common/action.h" diff --git a/drivers/staging/rt2870/common/ba_action.c b/drivers/staging/rt2870/common/ba_action.c deleted file mode 100644 index a9e6a09d994f..000000000000 --- a/drivers/staging/rt2870/common/ba_action.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../rt2860/common/ba_action.c" diff --git a/drivers/staging/rt2870/common/cmm_aes.c b/drivers/staging/rt2870/common/cmm_aes.c deleted file mode 100644 index 15d6a14d2d9c..000000000000 --- a/drivers/staging/rt2870/common/cmm_aes.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../rt2860/common/cmm_aes.c" diff --git a/drivers/staging/rt2870/common/cmm_asic.c b/drivers/staging/rt2870/common/cmm_asic.c deleted file mode 100644 index 38de817991ff..000000000000 --- a/drivers/staging/rt2870/common/cmm_asic.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../rt2860/common/cmm_asic.c" diff --git a/drivers/staging/rt2870/common/cmm_cfg.c b/drivers/staging/rt2870/common/cmm_cfg.c deleted file mode 100644 index 6b2bdd7d44ec..000000000000 --- a/drivers/staging/rt2870/common/cmm_cfg.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../rt2860/common/cmm_cfg.c" diff --git a/drivers/staging/rt2870/common/cmm_data.c b/drivers/staging/rt2870/common/cmm_data.c deleted file mode 100644 index df775c3cf691..000000000000 --- a/drivers/staging/rt2870/common/cmm_data.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../rt2860/common/cmm_data.c" diff --git a/drivers/staging/rt2870/common/cmm_data_usb.c b/drivers/staging/rt2870/common/cmm_data_usb.c deleted file mode 100644 index 704675fccb7d..000000000000 --- a/drivers/staging/rt2870/common/cmm_data_usb.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../rt2860/common/cmm_data_usb.c" diff --git a/drivers/staging/rt2870/common/cmm_info.c b/drivers/staging/rt2870/common/cmm_info.c deleted file mode 100644 index 226187ee5561..000000000000 --- a/drivers/staging/rt2870/common/cmm_info.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../rt2860/common/cmm_info.c" diff --git a/drivers/staging/rt2870/common/cmm_mac_usb.c b/drivers/staging/rt2870/common/cmm_mac_usb.c deleted file mode 100644 index b26af4af890b..000000000000 --- a/drivers/staging/rt2870/common/cmm_mac_usb.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../rt2860/common/cmm_mac_usb.c" diff --git a/drivers/staging/rt2870/common/cmm_profile.c b/drivers/staging/rt2870/common/cmm_profile.c deleted file mode 100644 index 9926e45aba3c..000000000000 --- a/drivers/staging/rt2870/common/cmm_profile.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../rt2860/common/cmm_profile.c" diff --git a/drivers/staging/rt2870/common/cmm_sanity.c b/drivers/staging/rt2870/common/cmm_sanity.c deleted file mode 100644 index cb3352118c57..000000000000 --- a/drivers/staging/rt2870/common/cmm_sanity.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../rt2860/common/cmm_sanity.c" diff --git a/drivers/staging/rt2870/common/cmm_sync.c b/drivers/staging/rt2870/common/cmm_sync.c deleted file mode 100644 index 5e7221d7cb27..000000000000 --- a/drivers/staging/rt2870/common/cmm_sync.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../rt2860/common/cmm_sync.c" diff --git a/drivers/staging/rt2870/common/cmm_tkip.c b/drivers/staging/rt2870/common/cmm_tkip.c deleted file mode 100644 index f73c71bafe86..000000000000 --- a/drivers/staging/rt2870/common/cmm_tkip.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../rt2860/common/cmm_tkip.c" diff --git a/drivers/staging/rt2870/common/cmm_wep.c b/drivers/staging/rt2870/common/cmm_wep.c deleted file mode 100644 index 5f681078387f..000000000000 --- a/drivers/staging/rt2870/common/cmm_wep.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../rt2860/common/cmm_wep.c" diff --git a/drivers/staging/rt2870/common/cmm_wpa.c b/drivers/staging/rt2870/common/cmm_wpa.c deleted file mode 100644 index 04a54bb21853..000000000000 --- a/drivers/staging/rt2870/common/cmm_wpa.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../rt2860/common/cmm_wpa.c" diff --git a/drivers/staging/rt2870/common/crypt_hmac.c b/drivers/staging/rt2870/common/crypt_hmac.c deleted file mode 100644 index 24d84e7724fb..000000000000 --- a/drivers/staging/rt2870/common/crypt_hmac.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../rt2860/common/crypt_hmac.c" diff --git a/drivers/staging/rt2870/common/crypt_md5.c b/drivers/staging/rt2870/common/crypt_md5.c deleted file mode 100644 index 457a2caca1e3..000000000000 --- a/drivers/staging/rt2870/common/crypt_md5.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../rt2860/common/crypt_md5.c" diff --git a/drivers/staging/rt2870/common/crypt_sha2.c b/drivers/staging/rt2870/common/crypt_sha2.c deleted file mode 100644 index 07ffb300c193..000000000000 --- a/drivers/staging/rt2870/common/crypt_sha2.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../rt2860/common/crypt_sha2.c" diff --git a/drivers/staging/rt2870/common/dfs.c b/drivers/staging/rt2870/common/dfs.c deleted file mode 100644 index ac2da4c0e2ca..000000000000 --- a/drivers/staging/rt2870/common/dfs.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../rt2860/common/dfs.c" diff --git a/drivers/staging/rt2870/common/ee_efuse.c b/drivers/staging/rt2870/common/ee_efuse.c deleted file mode 100644 index 0e34e65e5f28..000000000000 --- a/drivers/staging/rt2870/common/ee_efuse.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../rt2860/common/ee_efuse.c" diff --git a/drivers/staging/rt2870/common/eeprom.c b/drivers/staging/rt2870/common/eeprom.c deleted file mode 100644 index def09658fd81..000000000000 --- a/drivers/staging/rt2870/common/eeprom.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../rt2860/common/eeprom.c" diff --git a/drivers/staging/rt2870/common/md5.c b/drivers/staging/rt2870/common/md5.c deleted file mode 100644 index 195645c0e1a8..000000000000 --- a/drivers/staging/rt2870/common/md5.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../rt2860/common/md5.c" diff --git a/drivers/staging/rt2870/common/mlme.c b/drivers/staging/rt2870/common/mlme.c deleted file mode 100644 index f88040abd26b..000000000000 --- a/drivers/staging/rt2870/common/mlme.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../rt2860/common/mlme.c" diff --git a/drivers/staging/rt2870/common/rt_channel.c b/drivers/staging/rt2870/common/rt_channel.c deleted file mode 100644 index c8ceb4c177d9..000000000000 --- a/drivers/staging/rt2870/common/rt_channel.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../rt2860/common/rt_channel.c" diff --git a/drivers/staging/rt2870/common/rt_rf.c b/drivers/staging/rt2870/common/rt_rf.c deleted file mode 100644 index b81cff34969b..000000000000 --- a/drivers/staging/rt2870/common/rt_rf.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../rt2860/common/rt_rf.c" diff --git a/drivers/staging/rt2870/common/rtmp_init.c b/drivers/staging/rt2870/common/rtmp_init.c deleted file mode 100644 index eef10efda196..000000000000 --- a/drivers/staging/rt2870/common/rtmp_init.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../rt2860/common/rtmp_init.c" diff --git a/drivers/staging/rt2870/common/rtmp_mcu.c b/drivers/staging/rt2870/common/rtmp_mcu.c deleted file mode 100644 index 20b7f13d60f8..000000000000 --- a/drivers/staging/rt2870/common/rtmp_mcu.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../rt2860/common/rtmp_mcu.c" diff --git a/drivers/staging/rt2870/common/rtmp_timer.c b/drivers/staging/rt2870/common/rtmp_timer.c deleted file mode 100644 index fd4aedcd5e8b..000000000000 --- a/drivers/staging/rt2870/common/rtmp_timer.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../rt2860/common/rtmp_timer.c" diff --git a/drivers/staging/rt2870/common/rtmp_tkip.c b/drivers/staging/rt2870/common/rtmp_tkip.c deleted file mode 100644 index 240bf67f521f..000000000000 --- a/drivers/staging/rt2870/common/rtmp_tkip.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../rt2860/common/rtmp_tkip.c" diff --git a/drivers/staging/rt2870/common/rtmp_wep.c b/drivers/staging/rt2870/common/rtmp_wep.c deleted file mode 100644 index ae255adc9f7f..000000000000 --- a/drivers/staging/rt2870/common/rtmp_wep.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../rt2860/common/rtmp_wep.c" diff --git a/drivers/staging/rt2870/common/rtusb_bulk.c b/drivers/staging/rt2870/common/rtusb_bulk.c deleted file mode 100644 index 679b802d2169..000000000000 --- a/drivers/staging/rt2870/common/rtusb_bulk.c +++ /dev/null @@ -1,1232 +0,0 @@ -/* - ************************************************************************* - * Ralink Tech Inc. - * 5F., No.36, Taiyuan St., Jhubei City, - * Hsinchu County 302, - * Taiwan, R.O.C. - * - * (c) Copyright 2002-2007, Ralink Technology, Inc. - * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * * - ************************************************************************* - - Module Name: - rtusb_bulk.c - - Abstract: - - Revision History: - Who When What - -------- ---------- ---------------------------------------------- - Name Date Modification logs - Paul Lin 06-25-2004 created - -*/ - -#ifdef RTMP_MAC_USB - -#include "../rt_config.h" -/* Match total 6 bulkout endpoint to corresponding queue. */ -u8 EpToQueue[6] = - { FIFO_EDCA, FIFO_EDCA, FIFO_EDCA, FIFO_EDCA, FIFO_EDCA, FIFO_MGMT }; - -/*static BOOLEAN SingleBulkOut = FALSE; */ - -void RTUSB_FILL_BULK_URB(struct urb *pUrb, - struct usb_device *pUsb_Dev, - unsigned int bulkpipe, - void *pTransferBuf, - int BufSize, usb_complete_t Complete, void *pContext) -{ - - usb_fill_bulk_urb(pUrb, pUsb_Dev, bulkpipe, pTransferBuf, BufSize, - (usb_complete_t) Complete, pContext); - -} - -void RTUSBInitTxDesc(struct rt_rtmp_adapter *pAd, - struct rt_tx_context *pTxContext, - u8 BulkOutPipeId, IN usb_complete_t Func) -{ - PURB pUrb; - u8 *pSrc = NULL; - struct os_cookie *pObj = (struct os_cookie *)pAd->OS_Cookie; - - pUrb = pTxContext->pUrb; - ASSERT(pUrb); - - /* Store BulkOut PipeId */ - pTxContext->BulkOutPipeId = BulkOutPipeId; - - if (pTxContext->bAggregatible) { - pSrc = &pTxContext->TransferBuffer->Aggregation[2]; - } else { - pSrc = - (u8 *)pTxContext->TransferBuffer->field.WirelessPacket; - } - - /*Initialize a tx bulk urb */ - RTUSB_FILL_BULK_URB(pUrb, - pObj->pUsb_Dev, - usb_sndbulkpipe(pObj->pUsb_Dev, - pAd->BulkOutEpAddr[BulkOutPipeId]), - pSrc, pTxContext->BulkOutSize, Func, pTxContext); - - if (pTxContext->bAggregatible) - pUrb->transfer_dma = - (pTxContext->data_dma + TX_BUFFER_NORMSIZE + 2); - else - pUrb->transfer_dma = pTxContext->data_dma; - - pUrb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; - -} - -void RTUSBInitHTTxDesc(struct rt_rtmp_adapter *pAd, - struct rt_ht_tx_context *pTxContext, - u8 BulkOutPipeId, - unsigned long BulkOutSize, IN usb_complete_t Func) -{ - PURB pUrb; - u8 *pSrc = NULL; - struct os_cookie *pObj = (struct os_cookie *)pAd->OS_Cookie; - - pUrb = pTxContext->pUrb; - ASSERT(pUrb); - - /* Store BulkOut PipeId */ - pTxContext->BulkOutPipeId = BulkOutPipeId; - - pSrc = - &pTxContext->TransferBuffer->field.WirelessPacket[pTxContext-> - NextBulkOutPosition]; - - /*Initialize a tx bulk urb */ - RTUSB_FILL_BULK_URB(pUrb, - pObj->pUsb_Dev, - usb_sndbulkpipe(pObj->pUsb_Dev, - pAd->BulkOutEpAddr[BulkOutPipeId]), - pSrc, BulkOutSize, Func, pTxContext); - - pUrb->transfer_dma = - (pTxContext->data_dma + pTxContext->NextBulkOutPosition); - pUrb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; - -} - -void RTUSBInitRxDesc(struct rt_rtmp_adapter *pAd, struct rt_rx_context *pRxContext) -{ - PURB pUrb; - struct os_cookie *pObj = (struct os_cookie *)pAd->OS_Cookie; - unsigned long RX_bulk_size; - - pUrb = pRxContext->pUrb; - ASSERT(pUrb); - - if (pAd->BulkInMaxPacketSize == 64) - RX_bulk_size = 4096; - else - RX_bulk_size = MAX_RXBULK_SIZE; - - /*Initialize a rx bulk urb */ - RTUSB_FILL_BULK_URB(pUrb, - pObj->pUsb_Dev, - usb_rcvbulkpipe(pObj->pUsb_Dev, pAd->BulkInEpAddr), - &(pRxContext-> - TransferBuffer[pAd->NextRxBulkInPosition]), - RX_bulk_size - (pAd->NextRxBulkInPosition), - (usb_complete_t) RTUSBBulkRxComplete, - (void *)pRxContext); - - pUrb->transfer_dma = pRxContext->data_dma + pAd->NextRxBulkInPosition; - pUrb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; - -} - -/* - ======================================================================== - - Routine Description: - - Arguments: - - Return Value: - - Note: - - ======================================================================== -*/ - -#define BULK_OUT_LOCK(pLock, IrqFlags) \ - if (1 /*!(in_interrupt() & 0xffff0000)*/) \ - RTMP_IRQ_LOCK((pLock), IrqFlags); - -#define BULK_OUT_UNLOCK(pLock, IrqFlags) \ - if (1 /*!(in_interrupt() & 0xffff0000)*/) \ - RTMP_IRQ_UNLOCK((pLock), IrqFlags); - -void RTUSBBulkOutDataPacket(struct rt_rtmp_adapter *pAd, - u8 BulkOutPipeId, u8 Index) -{ - - struct rt_ht_tx_context *pHTTXContext; - PURB pUrb; - int ret = 0; - struct rt_txinfo *pTxInfo, *pLastTxInfo = NULL; - struct rt_txwi *pTxWI; - unsigned long TmpBulkEndPos, ThisBulkSize; - unsigned long IrqFlags = 0, IrqFlags2 = 0; - u8 *pWirelessPkt, *pAppendant; - BOOLEAN bTxQLastRound = FALSE; - u8 allzero[4] = { 0x0, 0x0, 0x0, 0x0 }; - - BULK_OUT_LOCK(&pAd->BulkOutLock[BulkOutPipeId], IrqFlags); - if ((pAd->BulkOutPending[BulkOutPipeId] == TRUE) - || RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NEED_STOP_TX)) { - BULK_OUT_UNLOCK(&pAd->BulkOutLock[BulkOutPipeId], IrqFlags); - return; - } - pAd->BulkOutPending[BulkOutPipeId] = TRUE; - - if (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED) - ) { - pAd->BulkOutPending[BulkOutPipeId] = FALSE; - BULK_OUT_UNLOCK(&pAd->BulkOutLock[BulkOutPipeId], IrqFlags); - return; - } - BULK_OUT_UNLOCK(&pAd->BulkOutLock[BulkOutPipeId], IrqFlags); - - pHTTXContext = &(pAd->TxContext[BulkOutPipeId]); - - BULK_OUT_LOCK(&pAd->TxContextQueueLock[BulkOutPipeId], IrqFlags2); - if ((pHTTXContext->ENextBulkOutPosition == - pHTTXContext->CurWritePosition) - || ((pHTTXContext->ENextBulkOutPosition - 8) == - pHTTXContext->CurWritePosition)) { - BULK_OUT_UNLOCK(&pAd->TxContextQueueLock[BulkOutPipeId], - IrqFlags2); - - BULK_OUT_LOCK(&pAd->BulkOutLock[BulkOutPipeId], IrqFlags); - pAd->BulkOutPending[BulkOutPipeId] = FALSE; - - /* Clear Data flag */ - RTUSB_CLEAR_BULK_FLAG(pAd, - (fRTUSB_BULK_OUT_DATA_FRAG << - BulkOutPipeId)); - RTUSB_CLEAR_BULK_FLAG(pAd, - (fRTUSB_BULK_OUT_DATA_NORMAL << - BulkOutPipeId)); - - BULK_OUT_UNLOCK(&pAd->BulkOutLock[BulkOutPipeId], IrqFlags); - return; - } - /* Clear Data flag */ - RTUSB_CLEAR_BULK_FLAG(pAd, - (fRTUSB_BULK_OUT_DATA_FRAG << BulkOutPipeId)); - RTUSB_CLEAR_BULK_FLAG(pAd, - (fRTUSB_BULK_OUT_DATA_NORMAL << BulkOutPipeId)); - - /*DBGPRINT(RT_DEBUG_TRACE,("BulkOut-B:I=0x%lx, CWPos=%ld, CWRPos=%ld, NBPos=%ld, ENBPos=%ld, bCopy=%d!\n", in_interrupt(), */ - /* pHTTXContext->CurWritePosition, pHTTXContext->CurWriteRealPos, pHTTXContext->NextBulkOutPosition, */ - /* pHTTXContext->ENextBulkOutPosition, pHTTXContext->bCopySavePad)); */ - pHTTXContext->NextBulkOutPosition = pHTTXContext->ENextBulkOutPosition; - ThisBulkSize = 0; - TmpBulkEndPos = pHTTXContext->NextBulkOutPosition; - pWirelessPkt = &pHTTXContext->TransferBuffer->field.WirelessPacket[0]; - - if ((pHTTXContext->bCopySavePad == TRUE)) { - if (RTMPEqualMemory(pHTTXContext->SavedPad, allzero, 4)) { - DBGPRINT_RAW(RT_DEBUG_ERROR, - ("e1, allzero : %x %x %x %x %x %x %x %x \n", - pHTTXContext->SavedPad[0], - pHTTXContext->SavedPad[1], - pHTTXContext->SavedPad[2], - pHTTXContext->SavedPad[3] - , pHTTXContext->SavedPad[4], - pHTTXContext->SavedPad[5], - pHTTXContext->SavedPad[6], - pHTTXContext->SavedPad[7])); - } - NdisMoveMemory(&pWirelessPkt[TmpBulkEndPos], - pHTTXContext->SavedPad, 8); - pHTTXContext->bCopySavePad = FALSE; - if (pAd->bForcePrintTX == TRUE) - DBGPRINT(RT_DEBUG_TRACE, - ("RTUSBBulkOutDataPacket --> COPY PAD. CurWrite = %ld, NextBulk = %ld. ENextBulk = %ld.\n", - pHTTXContext->CurWritePosition, - pHTTXContext->NextBulkOutPosition, - pHTTXContext->ENextBulkOutPosition)); - } - - do { - pTxInfo = (struct rt_txinfo *)&pWirelessPkt[TmpBulkEndPos]; - pTxWI = - (struct rt_txwi *)&pWirelessPkt[TmpBulkEndPos + TXINFO_SIZE]; - - if (pAd->bForcePrintTX == TRUE) - DBGPRINT(RT_DEBUG_TRACE, - ("RTUSBBulkOutDataPacket AMPDU = %d.\n", - pTxWI->AMPDU)); - - /* add by Iverson, limit BulkOut size to 4k to pass WMM b mode 2T1R test items */ - /*if ((ThisBulkSize != 0) && (pTxWI->AMPDU == 0)) */ - if ((ThisBulkSize != 0) && (pTxWI->PHYMODE == MODE_CCK)) { - if (((ThisBulkSize & 0xffff8000) != 0) - || ((ThisBulkSize & 0x1000) == 0x1000)) { - /* Limit BulkOut size to about 4k bytes. */ - pHTTXContext->ENextBulkOutPosition = - TmpBulkEndPos; - break; - } else - if (((pAd->BulkOutMaxPacketSize < 512) - && ((ThisBulkSize & 0xfffff800) != - 0)) - /*|| ( (ThisBulkSize != 0) && (pTxWI->AMPDU == 0)) */ - ) { - /* For USB 1.1 or peer which didn't support AMPDU, limit the BulkOut size. */ - /* For performance in b/g mode, now just check for USB 1.1 and didn't care about the APMDU or not! 2008/06/04. */ - pHTTXContext->ENextBulkOutPosition = - TmpBulkEndPos; - break; - } - } - /* end Iverson */ - else { - if (((ThisBulkSize & 0xffff8000) != 0) || ((ThisBulkSize & 0x6000) == 0x6000)) { /* Limit BulkOut size to about 24k bytes. */ - pHTTXContext->ENextBulkOutPosition = - TmpBulkEndPos; - break; - } else if (((pAd->BulkOutMaxPacketSize < 512) && ((ThisBulkSize & 0xfffff800) != 0)) /*|| ( (ThisBulkSize != 0) && (pTxWI->AMPDU == 0)) */) { /* For USB 1.1 or peer which didn't support AMPDU, limit the BulkOut size. */ - /* For performance in b/g mode, now just check for USB 1.1 and didn't care about the APMDU or not! 2008/06/04. */ - pHTTXContext->ENextBulkOutPosition = - TmpBulkEndPos; - break; - } - } - - if (TmpBulkEndPos == pHTTXContext->CurWritePosition) { - pHTTXContext->ENextBulkOutPosition = TmpBulkEndPos; - break; - } - - if (pTxInfo->QSEL != FIFO_EDCA) { - DBGPRINT(RT_DEBUG_ERROR, - ("%s(): ====> pTxInfo->QueueSel(%d)!= FIFO_EDCA!!!!\n", - __func__, pTxInfo->QSEL)); - DBGPRINT(RT_DEBUG_ERROR, - ("\tCWPos=%ld, NBPos=%ld, ENBPos=%ld, bCopy=%d!\n", - pHTTXContext->CurWritePosition, - pHTTXContext->NextBulkOutPosition, - pHTTXContext->ENextBulkOutPosition, - pHTTXContext->bCopySavePad)); - hex_dump("Wrong QSel Pkt:", - (u8 *)&pWirelessPkt[TmpBulkEndPos], - (pHTTXContext->CurWritePosition - - pHTTXContext->NextBulkOutPosition)); - } - - if (pTxInfo->USBDMATxPktLen <= 8) { - BULK_OUT_UNLOCK(&pAd->TxContextQueueLock[BulkOutPipeId], - IrqFlags2); - DBGPRINT(RT_DEBUG_ERROR /*RT_DEBUG_TRACE */ , - ("e2, USBDMATxPktLen==0, Size=%ld, bCSPad=%d, CWPos=%ld, NBPos=%ld, CWRPos=%ld!\n", - pHTTXContext->BulkOutSize, - pHTTXContext->bCopySavePad, - pHTTXContext->CurWritePosition, - pHTTXContext->NextBulkOutPosition, - pHTTXContext->CurWriteRealPos)); - { - DBGPRINT_RAW(RT_DEBUG_ERROR /*RT_DEBUG_TRACE */ - , - ("%x %x %x %x %x %x %x %x \n", - pHTTXContext->SavedPad[0], - pHTTXContext->SavedPad[1], - pHTTXContext->SavedPad[2], - pHTTXContext->SavedPad[3] - , pHTTXContext->SavedPad[4], - pHTTXContext->SavedPad[5], - pHTTXContext->SavedPad[6], - pHTTXContext->SavedPad[7])); - } - pAd->bForcePrintTX = TRUE; - BULK_OUT_LOCK(&pAd->BulkOutLock[BulkOutPipeId], - IrqFlags); - pAd->BulkOutPending[BulkOutPipeId] = FALSE; - BULK_OUT_UNLOCK(&pAd->BulkOutLock[BulkOutPipeId], - IrqFlags); - /*DBGPRINT(RT_DEBUG_LOUD,("Out:pTxInfo->USBDMATxPktLen=%d!\n", pTxInfo->USBDMATxPktLen)); */ - return; - } - /* Increase Total transmit byte counter */ - pAd->RalinkCounters.OneSecTransmittedByteCount += - pTxWI->MPDUtotalByteCount; - pAd->RalinkCounters.TransmittedByteCount += - pTxWI->MPDUtotalByteCount; - - pLastTxInfo = pTxInfo; - - /* Make sure we use EDCA QUEUE. */ - pTxInfo->QSEL = FIFO_EDCA; - ThisBulkSize += (pTxInfo->USBDMATxPktLen + 4); - TmpBulkEndPos += (pTxInfo->USBDMATxPktLen + 4); - - if (TmpBulkEndPos != pHTTXContext->CurWritePosition) - pTxInfo->USBDMANextVLD = 1; - - if (pTxInfo->SwUseLastRound == 1) { - if (pHTTXContext->CurWritePosition == 8) - pTxInfo->USBDMANextVLD = 0; - pTxInfo->SwUseLastRound = 0; - - bTxQLastRound = TRUE; - pHTTXContext->ENextBulkOutPosition = 8; - - break; - } - - } while (TRUE); - - /* adjust the pTxInfo->USBDMANextVLD value of last pTxInfo. */ - if (pLastTxInfo) - pLastTxInfo->USBDMANextVLD = 0; - - /* - We need to copy SavedPad when following condition matched! - 1. Not the last round of the TxQueue and - 2. any match of following cases: - (1). The End Position of this bulk out is reach to the Currenct Write position and - the TxInfo and related header already write to the CurWritePosition. - =>(ENextBulkOutPosition == CurWritePosition) && (CurWriteRealPos > CurWritePosition) - - (2). The EndPosition of the bulk out is not reach to the Current Write Position. - =>(ENextBulkOutPosition != CurWritePosition) - */ - if ((bTxQLastRound == FALSE) && - (((pHTTXContext->ENextBulkOutPosition == - pHTTXContext->CurWritePosition) - && (pHTTXContext->CurWriteRealPos > - pHTTXContext->CurWritePosition)) - || (pHTTXContext->ENextBulkOutPosition != - pHTTXContext->CurWritePosition)) - ) { - NdisMoveMemory(pHTTXContext->SavedPad, - &pWirelessPkt[pHTTXContext-> - ENextBulkOutPosition], 8); - pHTTXContext->bCopySavePad = TRUE; - if (RTMPEqualMemory(pHTTXContext->SavedPad, allzero, 4)) { - u8 *pBuf = &pHTTXContext->SavedPad[0]; - DBGPRINT_RAW(RT_DEBUG_ERROR, - ("WARNING-Zero-3:%02x%02x%02x%02x%02x%02x%02x%02x,CWPos=%ld, CWRPos=%ld, bCW=%d, NBPos=%ld, TBPos=%ld, TBSize=%ld\n", - pBuf[0], pBuf[1], pBuf[2], pBuf[3], - pBuf[4], pBuf[5], pBuf[6], pBuf[7], - pHTTXContext->CurWritePosition, - pHTTXContext->CurWriteRealPos, - pHTTXContext->bCurWriting, - pHTTXContext->NextBulkOutPosition, - TmpBulkEndPos, ThisBulkSize)); - - pBuf = &pWirelessPkt[pHTTXContext->CurWritePosition]; - DBGPRINT_RAW(RT_DEBUG_ERROR, - ("\tCWPos=%02x%02x%02x%02x%02x%02x%02x%02x\n", - pBuf[0], pBuf[1], pBuf[2], pBuf[3], - pBuf[4], pBuf[5], pBuf[6], pBuf[7])); - } - /*DBGPRINT(RT_DEBUG_LOUD,("ENPos==CWPos=%ld, CWRPos=%ld, bCSPad=%d!\n", pHTTXContext->CurWritePosition, pHTTXContext->CurWriteRealPos, pHTTXContext->bCopySavePad)); */ - } - - if (pAd->bForcePrintTX == TRUE) - DBGPRINT(RT_DEBUG_TRACE, - ("BulkOut-A:Size=%ld, CWPos=%ld, NBPos=%ld, ENBPos=%ld, bCopy=%d!\n", - ThisBulkSize, pHTTXContext->CurWritePosition, - pHTTXContext->NextBulkOutPosition, - pHTTXContext->ENextBulkOutPosition, - pHTTXContext->bCopySavePad)); - /*DBGPRINT(RT_DEBUG_LOUD,("BulkOut-A:Size=%ld, CWPos=%ld, CWRPos=%ld, NBPos=%ld, ENBPos=%ld, bCopy=%d, bLRound=%d!\n", ThisBulkSize, pHTTXContext->CurWritePosition, pHTTXContext->CurWriteRealPos, pHTTXContext->NextBulkOutPosition, pHTTXContext->ENextBulkOutPosition, pHTTXContext->bCopySavePad, bTxQLastRound)); */ - - /* USB DMA engine requires to pad extra 4 bytes. This pad doesn't count into real bulkoutsize. */ - pAppendant = &pWirelessPkt[TmpBulkEndPos]; - NdisZeroMemory(pAppendant, 8); - ThisBulkSize += 4; - pHTTXContext->LastOne = TRUE; - if ((ThisBulkSize % pAd->BulkOutMaxPacketSize) == 0) - ThisBulkSize += 4; - pHTTXContext->BulkOutSize = ThisBulkSize; - - pAd->watchDogTxPendingCnt[BulkOutPipeId] = 1; - BULK_OUT_UNLOCK(&pAd->TxContextQueueLock[BulkOutPipeId], IrqFlags2); - - /* Init Tx context descriptor */ - RTUSBInitHTTxDesc(pAd, pHTTXContext, BulkOutPipeId, ThisBulkSize, - (usb_complete_t) RTUSBBulkOutDataPacketComplete); - - pUrb = pHTTXContext->pUrb; - ret = RTUSB_SUBMIT_URB(pUrb); - if (ret != 0) { - DBGPRINT(RT_DEBUG_ERROR, - ("RTUSBBulkOutDataPacket: Submit Tx URB failed %d\n", - ret)); - - BULK_OUT_LOCK(&pAd->BulkOutLock[BulkOutPipeId], IrqFlags); - pAd->BulkOutPending[BulkOutPipeId] = FALSE; - pAd->watchDogTxPendingCnt[BulkOutPipeId] = 0; - BULK_OUT_UNLOCK(&pAd->BulkOutLock[BulkOutPipeId], IrqFlags); - - return; - } - - BULK_OUT_LOCK(&pAd->BulkOutLock[BulkOutPipeId], IrqFlags); - pHTTXContext->IRPPending = TRUE; - BULK_OUT_UNLOCK(&pAd->BulkOutLock[BulkOutPipeId], IrqFlags); - pAd->BulkOutReq++; - -} - -void RTUSBBulkOutDataPacketComplete(struct urb *pUrb, struct pt_regs * pt_regs) -{ - struct rt_ht_tx_context *pHTTXContext; - struct rt_rtmp_adapter *pAd; - struct os_cookie *pObj; - u8 BulkOutPipeId; - - pHTTXContext = (struct rt_ht_tx_context *)pUrb->context; - pAd = pHTTXContext->pAd; - pObj = (struct os_cookie *)pAd->OS_Cookie; - - /* Store BulkOut PipeId */ - BulkOutPipeId = pHTTXContext->BulkOutPipeId; - pAd->BulkOutDataOneSecCount++; - - switch (BulkOutPipeId) { - case 0: - pObj->ac0_dma_done_task.data = (unsigned long)pUrb; - tasklet_hi_schedule(&pObj->ac0_dma_done_task); - break; - case 1: - pObj->ac1_dma_done_task.data = (unsigned long)pUrb; - tasklet_hi_schedule(&pObj->ac1_dma_done_task); - break; - case 2: - pObj->ac2_dma_done_task.data = (unsigned long)pUrb; - tasklet_hi_schedule(&pObj->ac2_dma_done_task); - break; - case 3: - pObj->ac3_dma_done_task.data = (unsigned long)pUrb; - tasklet_hi_schedule(&pObj->ac3_dma_done_task); - break; - } - -} - -/* - ======================================================================== - - Routine Description: - - Arguments: - - Return Value: - - Note: NULL frame use BulkOutPipeId = 0 - - ======================================================================== -*/ -void RTUSBBulkOutNullFrame(struct rt_rtmp_adapter *pAd) -{ - struct rt_tx_context *pNullContext = &(pAd->NullContext); - PURB pUrb; - int ret = 0; - unsigned long IrqFlags; - - RTMP_IRQ_LOCK(&pAd->BulkOutLock[0], IrqFlags); - if ((pAd->BulkOutPending[0] == TRUE) - || RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NEED_STOP_TX)) { - RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[0], IrqFlags); - return; - } - pAd->BulkOutPending[0] = TRUE; - pAd->watchDogTxPendingCnt[0] = 1; - pNullContext->IRPPending = TRUE; - RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[0], IrqFlags); - - /* Increase Total transmit byte counter */ - pAd->RalinkCounters.TransmittedByteCount += pNullContext->BulkOutSize; - - /* Clear Null frame bulk flag */ - RTUSB_CLEAR_BULK_FLAG(pAd, fRTUSB_BULK_OUT_DATA_NULL); - - /* Init Tx context descriptor */ - RTUSBInitTxDesc(pAd, pNullContext, 0, - (usb_complete_t) RTUSBBulkOutNullFrameComplete); - - pUrb = pNullContext->pUrb; - ret = RTUSB_SUBMIT_URB(pUrb); - if (ret != 0) { - RTMP_IRQ_LOCK(&pAd->BulkOutLock[0], IrqFlags); - pAd->BulkOutPending[0] = FALSE; - pAd->watchDogTxPendingCnt[0] = 0; - pNullContext->IRPPending = FALSE; - RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[0], IrqFlags); - - DBGPRINT(RT_DEBUG_ERROR, - ("RTUSBBulkOutNullFrame: Submit Tx URB failed %d\n", - ret)); - return; - } - -} - -/* NULL frame use BulkOutPipeId = 0 */ -void RTUSBBulkOutNullFrameComplete(struct urb *pUrb, struct pt_regs * pt_regs) -{ - struct rt_rtmp_adapter *pAd; - struct rt_tx_context *pNullContext; - int Status; - struct os_cookie *pObj; - - pNullContext = (struct rt_tx_context *)pUrb->context; - pAd = pNullContext->pAd; - Status = pUrb->status; - - pObj = (struct os_cookie *)pAd->OS_Cookie; - pObj->null_frame_complete_task.data = (unsigned long)pUrb; - tasklet_hi_schedule(&pObj->null_frame_complete_task); -} - -/* - ======================================================================== - - Routine Description: - - Arguments: - - Return Value: - - Note: MLME use BulkOutPipeId = 0 - - ======================================================================== -*/ -void RTUSBBulkOutMLMEPacket(struct rt_rtmp_adapter *pAd, u8 Index) -{ - struct rt_tx_context *pMLMEContext; - PURB pUrb; - int ret = 0; - unsigned long IrqFlags; - - pMLMEContext = - (struct rt_tx_context *)pAd->MgmtRing.Cell[pAd->MgmtRing.TxDmaIdx].AllocVa; - pUrb = pMLMEContext->pUrb; - - if ((pAd->MgmtRing.TxSwFreeIdx >= MGMT_RING_SIZE) || - (pMLMEContext->InUse == FALSE) || - (pMLMEContext->bWaitingBulkOut == FALSE)) { - - /* Clear MLME bulk flag */ - RTUSB_CLEAR_BULK_FLAG(pAd, fRTUSB_BULK_OUT_MLME); - - return; - } - - RTMP_IRQ_LOCK(&pAd->BulkOutLock[MGMTPIPEIDX], IrqFlags); - if ((pAd->BulkOutPending[MGMTPIPEIDX] == TRUE) - || RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NEED_STOP_TX)) { - RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[MGMTPIPEIDX], IrqFlags); - return; - } - - pAd->BulkOutPending[MGMTPIPEIDX] = TRUE; - pAd->watchDogTxPendingCnt[MGMTPIPEIDX] = 1; - pMLMEContext->IRPPending = TRUE; - pMLMEContext->bWaitingBulkOut = FALSE; - RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[MGMTPIPEIDX], IrqFlags); - - /* Increase Total transmit byte counter */ - pAd->RalinkCounters.TransmittedByteCount += pMLMEContext->BulkOutSize; - - /* Clear MLME bulk flag */ - RTUSB_CLEAR_BULK_FLAG(pAd, fRTUSB_BULK_OUT_MLME); - - /* Init Tx context descriptor */ - RTUSBInitTxDesc(pAd, pMLMEContext, MGMTPIPEIDX, - (usb_complete_t) RTUSBBulkOutMLMEPacketComplete); - - /*For mgmt urb buffer, because we use sk_buff, so we need to notify the USB controller do dma mapping. */ - pUrb->transfer_dma = 0; - pUrb->transfer_flags &= (~URB_NO_TRANSFER_DMA_MAP); - - pUrb = pMLMEContext->pUrb; - ret = RTUSB_SUBMIT_URB(pUrb); - if (ret != 0) { - DBGPRINT(RT_DEBUG_ERROR, - ("RTUSBBulkOutMLMEPacket: Submit MLME URB failed %d\n", - ret)); - RTMP_IRQ_LOCK(&pAd->BulkOutLock[MGMTPIPEIDX], IrqFlags); - pAd->BulkOutPending[MGMTPIPEIDX] = FALSE; - pAd->watchDogTxPendingCnt[MGMTPIPEIDX] = 0; - pMLMEContext->IRPPending = FALSE; - pMLMEContext->bWaitingBulkOut = TRUE; - RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[MGMTPIPEIDX], IrqFlags); - - return; - } - /*DBGPRINT_RAW(RT_DEBUG_INFO, ("<---RTUSBBulkOutMLMEPacket \n")); */ -/* printk("<---RTUSBBulkOutMLMEPacket,Cpu=%d!, Dma=%d, SwIdx=%d!\n", pAd->MgmtRing.TxCpuIdx, pAd->MgmtRing.TxDmaIdx, pAd->MgmtRing.TxSwFreeIdx); */ -} - -void RTUSBBulkOutMLMEPacketComplete(struct urb *pUrb, struct pt_regs * pt_regs) -{ - struct rt_tx_context *pMLMEContext; - struct rt_rtmp_adapter *pAd; - int Status; - struct os_cookie *pObj; - int index; - - /*DBGPRINT_RAW(RT_DEBUG_INFO, ("--->RTUSBBulkOutMLMEPacketComplete\n")); */ - pMLMEContext = (struct rt_tx_context *)pUrb->context; - pAd = pMLMEContext->pAd; - pObj = (struct os_cookie *)pAd->OS_Cookie; - Status = pUrb->status; - index = pMLMEContext->SelfIdx; - - pObj->mgmt_dma_done_task.data = (unsigned long)pUrb; - tasklet_hi_schedule(&pObj->mgmt_dma_done_task); -} - -/* - ======================================================================== - - Routine Description: - - Arguments: - - Return Value: - - Note: PsPoll use BulkOutPipeId = 0 - - ======================================================================== -*/ -void RTUSBBulkOutPsPoll(struct rt_rtmp_adapter *pAd) -{ - struct rt_tx_context *pPsPollContext = &(pAd->PsPollContext); - PURB pUrb; - int ret = 0; - unsigned long IrqFlags; - - RTMP_IRQ_LOCK(&pAd->BulkOutLock[0], IrqFlags); - if ((pAd->BulkOutPending[0] == TRUE) - || RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NEED_STOP_TX)) { - RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[0], IrqFlags); - return; - } - pAd->BulkOutPending[0] = TRUE; - pAd->watchDogTxPendingCnt[0] = 1; - pPsPollContext->IRPPending = TRUE; - RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[0], IrqFlags); - - /* Clear PS-Poll bulk flag */ - RTUSB_CLEAR_BULK_FLAG(pAd, fRTUSB_BULK_OUT_PSPOLL); - - /* Init Tx context descriptor */ - RTUSBInitTxDesc(pAd, pPsPollContext, MGMTPIPEIDX, - (usb_complete_t) RTUSBBulkOutPsPollComplete); - - pUrb = pPsPollContext->pUrb; - ret = RTUSB_SUBMIT_URB(pUrb); - if (ret != 0) { - RTMP_IRQ_LOCK(&pAd->BulkOutLock[0], IrqFlags); - pAd->BulkOutPending[0] = FALSE; - pAd->watchDogTxPendingCnt[0] = 0; - pPsPollContext->IRPPending = FALSE; - RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[0], IrqFlags); - - DBGPRINT(RT_DEBUG_ERROR, - ("RTUSBBulkOutPsPoll: Submit Tx URB failed %d\n", - ret)); - return; - } - -} - -/* PS-Poll frame use BulkOutPipeId = 0 */ -void RTUSBBulkOutPsPollComplete(struct urb *pUrb, struct pt_regs * pt_regs) -{ - struct rt_rtmp_adapter *pAd; - struct rt_tx_context *pPsPollContext; - int Status; - struct os_cookie *pObj; - - pPsPollContext = (struct rt_tx_context *)pUrb->context; - pAd = pPsPollContext->pAd; - Status = pUrb->status; - - pObj = (struct os_cookie *)pAd->OS_Cookie; - pObj->pspoll_frame_complete_task.data = (unsigned long)pUrb; - tasklet_hi_schedule(&pObj->pspoll_frame_complete_task); -} - -void DoBulkIn(struct rt_rtmp_adapter *pAd) -{ - struct rt_rx_context *pRxContext; - PURB pUrb; - int ret = 0; - unsigned long IrqFlags; - - RTMP_IRQ_LOCK(&pAd->BulkInLock, IrqFlags); - pRxContext = &(pAd->RxContext[pAd->NextRxBulkInIndex]); - if ((pAd->PendingRx > 0) || (pRxContext->Readable == TRUE) - || (pRxContext->InUse == TRUE)) { - RTMP_IRQ_UNLOCK(&pAd->BulkInLock, IrqFlags); - return; - } - pRxContext->InUse = TRUE; - pRxContext->IRPPending = TRUE; - pAd->PendingRx++; - pAd->BulkInReq++; - RTMP_IRQ_UNLOCK(&pAd->BulkInLock, IrqFlags); - - /* Init Rx context descriptor */ - NdisZeroMemory(pRxContext->TransferBuffer, pRxContext->BulkInOffset); - RTUSBInitRxDesc(pAd, pRxContext); - - pUrb = pRxContext->pUrb; - ret = RTUSB_SUBMIT_URB(pUrb); - if (ret != 0) { /* fail */ - - RTMP_IRQ_LOCK(&pAd->BulkInLock, IrqFlags); - pRxContext->InUse = FALSE; - pRxContext->IRPPending = FALSE; - pAd->PendingRx--; - pAd->BulkInReq--; - RTMP_IRQ_UNLOCK(&pAd->BulkInLock, IrqFlags); - DBGPRINT(RT_DEBUG_ERROR, - ("RTUSBBulkReceive: Submit Rx URB failed %d\n", ret)); - } else { /* success */ - ASSERT((pRxContext->InUse == pRxContext->IRPPending)); - /*printk("BIDone, Pend=%d,BIIdx=%d,BIRIdx=%d!\n", pAd->PendingRx, pAd->NextRxBulkInIndex, pAd->NextRxBulkInReadIndex); */ - } -} - -/* - ======================================================================== - - Routine Description: - USB_RxPacket initializes a URB and uses the Rx IRP to submit it - to USB. It checks if an Rx Descriptor is available and passes the - the coresponding buffer to be filled. If no descriptor is available - fails the request. When setting the completion routine we pass our - Adapter Object as Context. - - Arguments: - - Return Value: - TRUE found matched tuple cache - FALSE no matched found - - Note: - - ======================================================================== -*/ -#define fRTMP_ADAPTER_NEED_STOP_RX \ - (fRTMP_ADAPTER_NIC_NOT_EXIST | fRTMP_ADAPTER_HALT_IN_PROGRESS | \ - fRTMP_ADAPTER_RADIO_OFF | fRTMP_ADAPTER_RESET_IN_PROGRESS | \ - fRTMP_ADAPTER_REMOVE_IN_PROGRESS | fRTMP_ADAPTER_BULKIN_RESET) - -#define fRTMP_ADAPTER_NEED_STOP_HANDLE_RX \ - (fRTMP_ADAPTER_NIC_NOT_EXIST | fRTMP_ADAPTER_HALT_IN_PROGRESS | \ - fRTMP_ADAPTER_RADIO_OFF | fRTMP_ADAPTER_RESET_IN_PROGRESS | \ - fRTMP_ADAPTER_REMOVE_IN_PROGRESS) - -void RTUSBBulkReceive(struct rt_rtmp_adapter *pAd) -{ - struct rt_rx_context *pRxContext; - unsigned long IrqFlags; - - /* sanity check */ - if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NEED_STOP_HANDLE_RX)) - return; - - while (1) { - - RTMP_IRQ_LOCK(&pAd->BulkInLock, IrqFlags); - pRxContext = &(pAd->RxContext[pAd->NextRxBulkInReadIndex]); - if (((pRxContext->InUse == FALSE) - && (pRxContext->Readable == TRUE)) - && (pRxContext->bRxHandling == FALSE)) { - pRxContext->bRxHandling = TRUE; - RTMP_IRQ_UNLOCK(&pAd->BulkInLock, IrqFlags); - - /* read RxContext, Since not */ - STARxDoneInterruptHandle(pAd, TRUE); - - /* Finish to handle this bulkIn buffer. */ - RTMP_IRQ_LOCK(&pAd->BulkInLock, IrqFlags); - pRxContext->BulkInOffset = 0; - pRxContext->Readable = FALSE; - pRxContext->bRxHandling = FALSE; - pAd->ReadPosition = 0; - pAd->TransferBufferLength = 0; - INC_RING_INDEX(pAd->NextRxBulkInReadIndex, - RX_RING_SIZE); - RTMP_IRQ_UNLOCK(&pAd->BulkInLock, IrqFlags); - - } else { - RTMP_IRQ_UNLOCK(&pAd->BulkInLock, IrqFlags); - break; - } - } - - if (!(RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NEED_STOP_RX))) - DoBulkIn(pAd); - -} - -/* - ======================================================================== - - Routine Description: - This routine process Rx Irp and call rx complete function. - - Arguments: - DeviceObject Pointer to the device object for next lower - device. DeviceObject passed in here belongs to - the next lower driver in the stack because we - were invoked via IoCallDriver in USB_RxPacket - AND it is not OUR device object - Irp Ptr to completed IRP - Context Ptr to our Adapter object (context specified - in IoSetCompletionRoutine - - Return Value: - Always returns STATUS_MORE_PROCESSING_REQUIRED - - Note: - Always returns STATUS_MORE_PROCESSING_REQUIRED - ======================================================================== -*/ -void RTUSBBulkRxComplete(struct urb *pUrb, struct pt_regs *pt_regs) -{ - /* use a receive tasklet to handle received packets; */ - /* or sometimes hardware IRQ will be disabled here, so we can not */ - /* use spin_lock_bh()/spin_unlock_bh() after IRQ is disabled. :< */ - struct rt_rx_context *pRxContext; - struct rt_rtmp_adapter *pAd; - struct os_cookie *pObj; - - pRxContext = (struct rt_rx_context *)pUrb->context; - pAd = pRxContext->pAd; - pObj = (struct os_cookie *)pAd->OS_Cookie; - - pObj->rx_done_task.data = (unsigned long)pUrb; - tasklet_hi_schedule(&pObj->rx_done_task); - -} - -/* - ======================================================================== - - Routine Description: - - Arguments: - - Return Value: - - Note: - - ======================================================================== -*/ -void RTUSBKickBulkOut(struct rt_rtmp_adapter *pAd) -{ - /* BulkIn Reset will reset whole USB PHY. So we need to make sure fRTMP_ADAPTER_BULKIN_RESET not flaged. */ - if (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NEED_STOP_TX) - ) { - /* 2. PS-Poll frame is next */ - if (RTUSB_TEST_BULK_FLAG(pAd, fRTUSB_BULK_OUT_PSPOLL)) - RTUSBBulkOutPsPoll(pAd); - /* 5. Mlme frame is next */ - else if ((RTUSB_TEST_BULK_FLAG(pAd, fRTUSB_BULK_OUT_MLME)) || - (pAd->MgmtRing.TxSwFreeIdx < MGMT_RING_SIZE)) { - RTUSBBulkOutMLMEPacket(pAd, pAd->MgmtRing.TxDmaIdx); - } - /* 6. Data frame normal is next */ - if (RTUSB_TEST_BULK_FLAG(pAd, fRTUSB_BULK_OUT_DATA_NORMAL)) { - if (((!RTMP_TEST_FLAG - (pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS)) - || - (!OPSTATUS_TEST_FLAG - (pAd, fOP_STATUS_MEDIA_STATE_CONNECTED)) - )) { - RTUSBBulkOutDataPacket(pAd, 0, - pAd-> - NextBulkOutIndex[0]); - } - } - if (RTUSB_TEST_BULK_FLAG(pAd, fRTUSB_BULK_OUT_DATA_NORMAL_2)) { - if (((!RTMP_TEST_FLAG - (pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS)) - || - (!OPSTATUS_TEST_FLAG - (pAd, fOP_STATUS_MEDIA_STATE_CONNECTED)) - )) { - RTUSBBulkOutDataPacket(pAd, 1, - pAd-> - NextBulkOutIndex[1]); - } - } - if (RTUSB_TEST_BULK_FLAG(pAd, fRTUSB_BULK_OUT_DATA_NORMAL_3)) { - if (((!RTMP_TEST_FLAG - (pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS)) - || - (!OPSTATUS_TEST_FLAG - (pAd, fOP_STATUS_MEDIA_STATE_CONNECTED)) - )) { - RTUSBBulkOutDataPacket(pAd, 2, - pAd-> - NextBulkOutIndex[2]); - } - } - if (RTUSB_TEST_BULK_FLAG(pAd, fRTUSB_BULK_OUT_DATA_NORMAL_4)) { - if (((!RTMP_TEST_FLAG - (pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS)) - || - (!OPSTATUS_TEST_FLAG - (pAd, fOP_STATUS_MEDIA_STATE_CONNECTED)) - )) { - RTUSBBulkOutDataPacket(pAd, 3, - pAd-> - NextBulkOutIndex[3]); - } - } - /* 7. Null frame is the last */ - else if (RTUSB_TEST_BULK_FLAG(pAd, fRTUSB_BULK_OUT_DATA_NULL)) { - if (!RTMP_TEST_FLAG - (pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS)) { - RTUSBBulkOutNullFrame(pAd); - } - } - /* 8. No data available */ - else - ; - } -} - -/* - ======================================================================== - - Routine Description: - Call from Reset action after BulkOut failed. - Arguments: - - Return Value: - - Note: - - ======================================================================== -*/ -void RTUSBCleanUpDataBulkOutQueue(struct rt_rtmp_adapter *pAd) -{ - u8 Idx; - struct rt_ht_tx_context *pTxContext; - - DBGPRINT(RT_DEBUG_TRACE, ("--->CleanUpDataBulkOutQueue\n")); - - for (Idx = 0; Idx < 4; Idx++) { - pTxContext = &pAd->TxContext[Idx]; - - pTxContext->CurWritePosition = pTxContext->NextBulkOutPosition; - pTxContext->LastOne = FALSE; - NdisAcquireSpinLock(&pAd->BulkOutLock[Idx]); - pAd->BulkOutPending[Idx] = FALSE; - NdisReleaseSpinLock(&pAd->BulkOutLock[Idx]); - } - - DBGPRINT(RT_DEBUG_TRACE, ("<---CleanUpDataBulkOutQueue\n")); -} - -/* - ======================================================================== - - Routine Description: - - Arguments: - - Return Value: - - Note: - - ======================================================================== -*/ -void RTUSBCleanUpMLMEBulkOutQueue(struct rt_rtmp_adapter *pAd) -{ - DBGPRINT(RT_DEBUG_TRACE, ("--->CleanUpMLMEBulkOutQueue\n")); - DBGPRINT(RT_DEBUG_TRACE, ("<---CleanUpMLMEBulkOutQueue\n")); -} - -/* - ======================================================================== - - Routine Description: - - Arguments: - - Return Value: - - Note: - - ======================================================================== -*/ -void RTUSBCancelPendingIRPs(struct rt_rtmp_adapter *pAd) -{ - RTUSBCancelPendingBulkInIRP(pAd); - RTUSBCancelPendingBulkOutIRP(pAd); -} - -/* - ======================================================================== - - Routine Description: - - Arguments: - - Return Value: - - Note: - - ======================================================================== -*/ -void RTUSBCancelPendingBulkInIRP(struct rt_rtmp_adapter *pAd) -{ - struct rt_rx_context *pRxContext; - u32 i; - - DBGPRINT_RAW(RT_DEBUG_TRACE, ("--->RTUSBCancelPendingBulkInIRP\n")); - for (i = 0; i < (RX_RING_SIZE); i++) { - pRxContext = &(pAd->RxContext[i]); - if (pRxContext->IRPPending == TRUE) { - RTUSB_UNLINK_URB(pRxContext->pUrb); - pRxContext->IRPPending = FALSE; - pRxContext->InUse = FALSE; - /*NdisInterlockedDecrement(&pAd->PendingRx); */ - /*pAd->PendingRx--; */ - } - } - DBGPRINT_RAW(RT_DEBUG_TRACE, ("<---RTUSBCancelPendingBulkInIRP\n")); -} - -/* - ======================================================================== - - Routine Description: - - Arguments: - - Return Value: - - Note: - - ======================================================================== -*/ -void RTUSBCancelPendingBulkOutIRP(struct rt_rtmp_adapter *pAd) -{ - struct rt_ht_tx_context *pHTTXContext; - struct rt_tx_context *pMLMEContext; - struct rt_tx_context *pBeaconContext; - struct rt_tx_context *pNullContext; - struct rt_tx_context *pPsPollContext; - struct rt_tx_context *pRTSContext; - u32 i, Idx; -/* unsigned int IrqFlags; */ -/* spinlock_t *pLock; */ -/* BOOLEAN *pPending; */ - -/* pLock = &pAd->BulkOutLock[MGMTPIPEIDX]; */ -/* pPending = &pAd->BulkOutPending[MGMTPIPEIDX]; */ - - for (Idx = 0; Idx < 4; Idx++) { - pHTTXContext = &(pAd->TxContext[Idx]); - - if (pHTTXContext->IRPPending == TRUE) { - - /* Get the USB_CONTEXT and cancel it's IRP; the completion routine will itself */ - /* remove it from the HeadPendingSendList and NULL out HeadPendingSendList */ - /* when the last IRP on the list has been cancelled; that's how we exit this loop */ - /* */ - - RTUSB_UNLINK_URB(pHTTXContext->pUrb); - - /* Sleep 200 microseconds to give cancellation time to work */ - RTMPusecDelay(200); - } - - pAd->BulkOutPending[Idx] = FALSE; - } - - /*RTMP_IRQ_LOCK(pLock, IrqFlags); */ - for (i = 0; i < MGMT_RING_SIZE; i++) { - pMLMEContext = (struct rt_tx_context *)pAd->MgmtRing.Cell[i].AllocVa; - if (pMLMEContext && (pMLMEContext->IRPPending == TRUE)) { - - /* Get the USB_CONTEXT and cancel it's IRP; the completion routine will itself */ - /* remove it from the HeadPendingSendList and NULL out HeadPendingSendList */ - /* when the last IRP on the list has been cancelled; that's how we exit this loop */ - /* */ - - RTUSB_UNLINK_URB(pMLMEContext->pUrb); - pMLMEContext->IRPPending = FALSE; - - /* Sleep 200 microsecs to give cancellation time to work */ - RTMPusecDelay(200); - } - } - pAd->BulkOutPending[MGMTPIPEIDX] = FALSE; - /*RTMP_IRQ_UNLOCK(pLock, IrqFlags); */ - - for (i = 0; i < BEACON_RING_SIZE; i++) { - pBeaconContext = &(pAd->BeaconContext[i]); - - if (pBeaconContext->IRPPending == TRUE) { - - /* Get the USB_CONTEXT and cancel it's IRP; the completion routine will itself */ - /* remove it from the HeadPendingSendList and NULL out HeadPendingSendList */ - /* when the last IRP on the list has been cancelled; that's how we exit this loop */ - /* */ - - RTUSB_UNLINK_URB(pBeaconContext->pUrb); - - /* Sleep 200 microsecs to give cancellation time to work */ - RTMPusecDelay(200); - } - } - - pNullContext = &(pAd->NullContext); - if (pNullContext->IRPPending == TRUE) - RTUSB_UNLINK_URB(pNullContext->pUrb); - - pRTSContext = &(pAd->RTSContext); - if (pRTSContext->IRPPending == TRUE) - RTUSB_UNLINK_URB(pRTSContext->pUrb); - - pPsPollContext = &(pAd->PsPollContext); - if (pPsPollContext->IRPPending == TRUE) - RTUSB_UNLINK_URB(pPsPollContext->pUrb); - - for (Idx = 0; Idx < 4; Idx++) { - NdisAcquireSpinLock(&pAd->BulkOutLock[Idx]); - pAd->BulkOutPending[Idx] = FALSE; - NdisReleaseSpinLock(&pAd->BulkOutLock[Idx]); - } -} - -#endif /* RTMP_MAC_USB // */ diff --git a/drivers/staging/rt2870/common/rtusb_data.c b/drivers/staging/rt2870/common/rtusb_data.c deleted file mode 100644 index 5b72bcdaa78f..000000000000 --- a/drivers/staging/rt2870/common/rtusb_data.c +++ /dev/null @@ -1,262 +0,0 @@ -/* - ************************************************************************* - * Ralink Tech Inc. - * 5F., No.36, Taiyuan St., Jhubei City, - * Hsinchu County 302, - * Taiwan, R.O.C. - * - * (c) Copyright 2002-2007, Ralink Technology, Inc. - * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * * - ************************************************************************* - - Module Name: - rtusb_data.c - - Abstract: - Ralink USB driver Tx/Rx functions. - - Revision History: - Who When What - -------- ---------- ---------------------------------------------- - Jan 03-25-2006 created - -*/ - -#ifdef RTMP_MAC_USB - -#include "../rt_config.h" - -extern u8 Phy11BGNextRateUpward[]; /* defined in mlme.c */ -extern u8 EpToQueue[]; - -void REPORT_AMSDU_FRAMES_TO_LLC(struct rt_rtmp_adapter *pAd, - u8 *pData, unsigned long DataSize) -{ - void *pPacket; - u32 nMSDU; - struct sk_buff *pSkb; - - nMSDU = 0; - /* allocate a rx packet */ - pSkb = dev_alloc_skb(RX_BUFFER_AGGRESIZE); - pPacket = (void *)OSPKT_TO_RTPKT(pSkb); - if (pSkb) { - - /* convert 802.11 to 802.3 packet */ - pSkb->dev = get_netdev_from_bssid(pAd, BSS0); - RTMP_SET_PACKET_SOURCE(pPacket, PKTSRC_NDIS); - deaggregate_AMSDU_announce(pAd, pPacket, pData, DataSize); - } else { - DBGPRINT(RT_DEBUG_ERROR, ("Can't allocate skb\n")); - } -} - -/* - ======================================================================== - - Routine Description: - This subroutine will scan through releative ring descriptor to find - out available free ring descriptor and compare with request size. - - Arguments: - pAd Pointer to our adapter - RingType Selected Ring - - Return Value: - NDIS_STATUS_FAILURE Not enough free descriptor - NDIS_STATUS_SUCCESS Enough free descriptor - - Note: - - ======================================================================== -*/ -int RTUSBFreeDescriptorRequest(struct rt_rtmp_adapter *pAd, - u8 BulkOutPipeId, - u32 NumberRequired) -{ -/* u8 FreeNumber = 0; */ -/* u32 Index; */ - int Status = NDIS_STATUS_FAILURE; - unsigned long IrqFlags; - struct rt_ht_tx_context *pHTTXContext; - - pHTTXContext = &pAd->TxContext[BulkOutPipeId]; - RTMP_IRQ_LOCK(&pAd->TxContextQueueLock[BulkOutPipeId], IrqFlags); - if ((pHTTXContext->CurWritePosition < pHTTXContext->NextBulkOutPosition) - && - ((pHTTXContext->CurWritePosition + NumberRequired + - LOCAL_TXBUF_SIZE) > pHTTXContext->NextBulkOutPosition)) { - - RTUSB_SET_BULK_FLAG(pAd, - (fRTUSB_BULK_OUT_DATA_NORMAL << - BulkOutPipeId)); - } else if ((pHTTXContext->CurWritePosition == 8) - && (pHTTXContext->NextBulkOutPosition < - (NumberRequired + LOCAL_TXBUF_SIZE))) { - RTUSB_SET_BULK_FLAG(pAd, - (fRTUSB_BULK_OUT_DATA_NORMAL << - BulkOutPipeId)); - } else if (pHTTXContext->bCurWriting == TRUE) { - DBGPRINT(RT_DEBUG_TRACE, - ("RTUSBFreeD c3 --> QueIdx=%d, CWPos=%ld, NBOutPos=%ld!\n", - BulkOutPipeId, pHTTXContext->CurWritePosition, - pHTTXContext->NextBulkOutPosition)); - RTUSB_SET_BULK_FLAG(pAd, - (fRTUSB_BULK_OUT_DATA_NORMAL << - BulkOutPipeId)); - } else { - Status = NDIS_STATUS_SUCCESS; - } - RTMP_IRQ_UNLOCK(&pAd->TxContextQueueLock[BulkOutPipeId], IrqFlags); - - return Status; -} - -int RTUSBFreeDescriptorRelease(struct rt_rtmp_adapter *pAd, - u8 BulkOutPipeId) -{ - unsigned long IrqFlags; - struct rt_ht_tx_context *pHTTXContext; - - pHTTXContext = &pAd->TxContext[BulkOutPipeId]; - RTMP_IRQ_LOCK(&pAd->TxContextQueueLock[BulkOutPipeId], IrqFlags); - pHTTXContext->bCurWriting = FALSE; - RTMP_IRQ_UNLOCK(&pAd->TxContextQueueLock[BulkOutPipeId], IrqFlags); - - return NDIS_STATUS_SUCCESS; -} - -BOOLEAN RTUSBNeedQueueBackForAgg(struct rt_rtmp_adapter *pAd, u8 BulkOutPipeId) -{ - unsigned long IrqFlags; - struct rt_ht_tx_context *pHTTXContext; - BOOLEAN needQueBack = FALSE; - - pHTTXContext = &pAd->TxContext[BulkOutPipeId]; - - RTMP_IRQ_LOCK(&pAd->TxContextQueueLock[BulkOutPipeId], IrqFlags); - if ((pHTTXContext->IRPPending == - TRUE) /*&& (pAd->TxSwQueue[BulkOutPipeId].Number == 0) */) { - if ((pHTTXContext->CurWritePosition < - pHTTXContext->ENextBulkOutPosition) - && - (((pHTTXContext->ENextBulkOutPosition + - MAX_AGGREGATION_SIZE) < MAX_TXBULK_LIMIT) - || (pHTTXContext->CurWritePosition > - MAX_AGGREGATION_SIZE))) { - needQueBack = TRUE; - } else - if ((pHTTXContext->CurWritePosition > - pHTTXContext->ENextBulkOutPosition) - && - ((pHTTXContext->ENextBulkOutPosition + - MAX_AGGREGATION_SIZE) < - pHTTXContext->CurWritePosition)) { - needQueBack = TRUE; - } - } - RTMP_IRQ_UNLOCK(&pAd->TxContextQueueLock[BulkOutPipeId], IrqFlags); - - return needQueBack; - -} - -/* - ======================================================================== - - Routine Description: - - Arguments: - - Return Value: - - IRQL = - - Note: - - ======================================================================== -*/ -void RTUSBRejectPendingPackets(struct rt_rtmp_adapter *pAd) -{ - u8 Index; - struct rt_queue_entry *pEntry; - void *pPacket; - struct rt_queue_header *pQueue; - - for (Index = 0; Index < 4; Index++) { - NdisAcquireSpinLock(&pAd->TxSwQueueLock[Index]); - while (pAd->TxSwQueue[Index].Head != NULL) { - pQueue = (struct rt_queue_header *)&(pAd->TxSwQueue[Index]); - pEntry = RemoveHeadQueue(pQueue); - pPacket = QUEUE_ENTRY_TO_PACKET(pEntry); - RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_FAILURE); - } - NdisReleaseSpinLock(&pAd->TxSwQueueLock[Index]); - - } - -} - -/* - ======================================================================== - - Routine Description: - Calculates the duration which is required to transmit out frames - with given size and specified rate. - - Arguments: - pTxD Pointer to transmit descriptor - Ack Setting for Ack requirement bit - Fragment Setting for Fragment bit - RetryMode Setting for retry mode - Ifs Setting for IFS gap - Rate Setting for transmit rate - Service Setting for service - Length Frame length - TxPreamble Short or Long preamble when using CCK rates - QueIdx - 0-3, according to 802.11e/d4.4 June/2003 - - Return Value: - None - - IRQL = PASSIVE_LEVEL - IRQL = DISPATCH_LEVEL - - ======================================================================== -*/ - -void RTMPWriteTxInfo(struct rt_rtmp_adapter *pAd, - struct rt_txinfo *pTxInfo, - u16 USBDMApktLen, - IN BOOLEAN bWiv, - u8 QueueSel, u8 NextValid, u8 TxBurst) -{ - pTxInfo->USBDMATxPktLen = USBDMApktLen; - pTxInfo->QSEL = QueueSel; - if (QueueSel != FIFO_EDCA) - DBGPRINT(RT_DEBUG_TRACE, - ("====> QueueSel != FIFO_EDCA<============\n")); - pTxInfo->USBDMANextVLD = FALSE; /*NextValid; // Need to check with Jan about this. */ - pTxInfo->USBDMATxburst = TxBurst; - pTxInfo->WIV = bWiv; - pTxInfo->SwUseLastRound = 0; - pTxInfo->rsv = 0; - pTxInfo->rsv2 = 0; -} - -#endif /* RTMP_MAC_USB // */ diff --git a/drivers/staging/rt2870/common/rtusb_io.c b/drivers/staging/rt2870/common/rtusb_io.c deleted file mode 100644 index 7d2f7e05814d..000000000000 --- a/drivers/staging/rt2870/common/rtusb_io.c +++ /dev/null @@ -1,2104 +0,0 @@ -/* - ************************************************************************* - * Ralink Tech Inc. - * 5F., No.36, Taiyuan St., Jhubei City, - * Hsinchu County 302, - * Taiwan, R.O.C. - * - * (c) Copyright 2002-2007, Ralink Technology, Inc. - * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * * - ************************************************************************* - - Module Name: - rtusb_io.c - - Abstract: - - Revision History: - Who When What - -------- ---------- ---------------------------------------------- - Name Date Modification logs - Paul Lin 06-25-2004 created -*/ - -#ifdef RTMP_MAC_USB - -#include "../rt_config.h" - -/* - ======================================================================== - - Routine Description: NIC initialization complete - - Arguments: - - Return Value: - - IRQL = - - Note: - - ======================================================================== -*/ - -static int RTUSBFirmwareRun(struct rt_rtmp_adapter *pAd) -{ - int Status; - - Status = RTUSB_VendorRequest(pAd, - USBD_TRANSFER_DIRECTION_OUT, - DEVICE_VENDOR_REQUEST_OUT, - 0x01, 0x8, 0, NULL, 0); - - return Status; -} - -/* - ======================================================================== - - Routine Description: Write Firmware to NIC. - - Arguments: - - Return Value: - - IRQL = - - Note: - - ======================================================================== -*/ -int RTUSBFirmwareWrite(struct rt_rtmp_adapter *pAd, - const u8 *pFwImage, unsigned long FwLen) -{ - u32 MacReg; - int Status; -/* unsigned long i; */ - u16 writeLen; - - Status = RTUSBReadMACRegister(pAd, MAC_CSR0, &MacReg); - - writeLen = FwLen; - RTUSBMultiWrite(pAd, FIRMWARE_IMAGE_BASE, pFwImage, writeLen); - - Status = RTUSBWriteMACRegister(pAd, 0x7014, 0xffffffff); - Status = RTUSBWriteMACRegister(pAd, 0x701c, 0xffffffff); - Status = RTUSBFirmwareRun(pAd); - - /*2008/11/28:KH add to fix the dead rf frequency offset bug<-- */ - RTMPusecDelay(10000); - RTUSBWriteMACRegister(pAd, H2M_MAILBOX_CSR, 0); - AsicSendCommandToMcu(pAd, 0x72, 0x00, 0x00, 0x00); /*reset rf by MCU supported by new firmware */ - /*2008/11/28:KH add to fix the dead rf frequency offset bug--> */ - - return Status; -} - -int RTUSBVenderReset(struct rt_rtmp_adapter *pAd) -{ - int Status; - DBGPRINT_RAW(RT_DEBUG_ERROR, ("-->RTUSBVenderReset\n")); - Status = RTUSB_VendorRequest(pAd, - USBD_TRANSFER_DIRECTION_OUT, - DEVICE_VENDOR_REQUEST_OUT, - 0x01, 0x1, 0, NULL, 0); - - DBGPRINT_RAW(RT_DEBUG_ERROR, ("<--RTUSBVenderReset\n")); - return Status; -} - -/* - ======================================================================== - - Routine Description: Read various length data from RT2573 - - Arguments: - - Return Value: - - IRQL = - - Note: - - ======================================================================== -*/ -int RTUSBMultiRead(struct rt_rtmp_adapter *pAd, - u16 Offset, u8 *pData, u16 length) -{ - int Status; - - Status = RTUSB_VendorRequest(pAd, - (USBD_TRANSFER_DIRECTION_IN | - USBD_SHORT_TRANSFER_OK), - DEVICE_VENDOR_REQUEST_IN, 0x7, 0, Offset, - pData, length); - - return Status; -} - -/* - ======================================================================== - - Routine Description: Write various length data to RT2573 - - Arguments: - - Return Value: - - IRQL = - - Note: - - ======================================================================== -*/ -int RTUSBMultiWrite_OneByte(struct rt_rtmp_adapter *pAd, - u16 Offset, const u8 *pData) -{ - int Status; - - /* TODO: In 2870, use this funciton carefully cause it's not stable. */ - Status = RTUSB_VendorRequest(pAd, - USBD_TRANSFER_DIRECTION_OUT, - DEVICE_VENDOR_REQUEST_OUT, - 0x6, 0, Offset, (u8 *)pData, 1); - - return Status; -} - -int RTUSBMultiWrite(struct rt_rtmp_adapter *pAd, - u16 Offset, const u8 *pData, u16 length) -{ - int Status; - - u16 index = 0, Value; - const u8 *pSrc = pData; - u16 resude = 0; - - resude = length % 2; - length += resude; - do { - Value = (u16)(*pSrc | (*(pSrc + 1) << 8)); - Status = RTUSBSingleWrite(pAd, Offset + index, Value); - index += 2; - length -= 2; - pSrc = pSrc + 2; - } while (length > 0); - - return Status; -} - -int RTUSBSingleWrite(struct rt_rtmp_adapter *pAd, - u16 Offset, u16 Value) -{ - int Status; - - Status = RTUSB_VendorRequest(pAd, - USBD_TRANSFER_DIRECTION_OUT, - DEVICE_VENDOR_REQUEST_OUT, - 0x2, Value, Offset, NULL, 0); - - return Status; - -} - -/* - ======================================================================== - - Routine Description: Read 32-bit MAC register - - Arguments: - - Return Value: - - IRQL = - - Note: - - ======================================================================== -*/ -int RTUSBReadMACRegister(struct rt_rtmp_adapter *pAd, - u16 Offset, u32 *pValue) -{ - int Status = 0; - u32 localVal; - - Status = RTUSB_VendorRequest(pAd, - (USBD_TRANSFER_DIRECTION_IN | - USBD_SHORT_TRANSFER_OK), - DEVICE_VENDOR_REQUEST_IN, 0x7, 0, Offset, - &localVal, 4); - - *pValue = le2cpu32(localVal); - - if (Status < 0) - *pValue = 0xffffffff; - - return Status; -} - -/* - ======================================================================== - - Routine Description: Write 32-bit MAC register - - Arguments: - - Return Value: - - IRQL = - - Note: - - ======================================================================== -*/ -int RTUSBWriteMACRegister(struct rt_rtmp_adapter *pAd, - u16 Offset, u32 Value) -{ - int Status; - u32 localVal; - - localVal = Value; - - Status = RTUSBSingleWrite(pAd, Offset, (u16)(localVal & 0xffff)); - Status = - RTUSBSingleWrite(pAd, Offset + 2, - (u16)((localVal & 0xffff0000) >> 16)); - - return Status; -} - -/* - ======================================================================== - - Routine Description: Read 8-bit BBP register - - Arguments: - - Return Value: - - IRQL = - - Note: - - ======================================================================== -*/ -int RTUSBReadBBPRegister(struct rt_rtmp_adapter *pAd, - u8 Id, u8 *pValue) -{ - BBP_CSR_CFG_STRUC BbpCsr; - u32 i = 0; - int status; - - /* Verify the busy condition */ - do { - status = RTUSBReadMACRegister(pAd, BBP_CSR_CFG, &BbpCsr.word); - if (status >= 0) { - if (!(BbpCsr.field.Busy == BUSY)) - break; - } - DBGPRINT(RT_DEBUG_TRACE, - ("RTUSBReadBBPRegister(BBP_CSR_CFG_1):retry count=%d!\n", - i)); - i++; - } while ((i < RETRY_LIMIT) - && (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST))); - - if ((i == RETRY_LIMIT) - || (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST))) { - /* */ - /* Read failed then Return Default value. */ - /* */ - *pValue = pAd->BbpWriteLatch[Id]; - - DBGPRINT_RAW(RT_DEBUG_ERROR, - ("Retry count exhausted or device removed!!!\n")); - return STATUS_UNSUCCESSFUL; - } - /* Prepare for write material */ - BbpCsr.word = 0; - BbpCsr.field.fRead = 1; - BbpCsr.field.Busy = 1; - BbpCsr.field.RegNum = Id; - RTUSBWriteMACRegister(pAd, BBP_CSR_CFG, BbpCsr.word); - - i = 0; - /* Verify the busy condition */ - do { - status = RTUSBReadMACRegister(pAd, BBP_CSR_CFG, &BbpCsr.word); - if (status >= 0) { - if (!(BbpCsr.field.Busy == BUSY)) { - *pValue = (u8)BbpCsr.field.Value; - break; - } - } - DBGPRINT(RT_DEBUG_TRACE, - ("RTUSBReadBBPRegister(BBP_CSR_CFG_2):retry count=%d!\n", - i)); - i++; - } while ((i < RETRY_LIMIT) - && (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST))); - - if ((i == RETRY_LIMIT) - || (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST))) { - /* */ - /* Read failed then Return Default value. */ - /* */ - *pValue = pAd->BbpWriteLatch[Id]; - - DBGPRINT_RAW(RT_DEBUG_ERROR, - ("Retry count exhausted or device removed!!!\n")); - return STATUS_UNSUCCESSFUL; - } - - return STATUS_SUCCESS; -} - -/* - ======================================================================== - - Routine Description: Write 8-bit BBP register - - Arguments: - - Return Value: - - IRQL = - - Note: - - ======================================================================== -*/ -int RTUSBWriteBBPRegister(struct rt_rtmp_adapter *pAd, - u8 Id, u8 Value) -{ - BBP_CSR_CFG_STRUC BbpCsr; - u32 i = 0; - int status; - /* Verify the busy condition */ - do { - status = RTUSBReadMACRegister(pAd, BBP_CSR_CFG, &BbpCsr.word); - if (status >= 0) { - if (!(BbpCsr.field.Busy == BUSY)) - break; - } - DBGPRINT(RT_DEBUG_TRACE, - ("RTUSBWriteBBPRegister(BBP_CSR_CFG):retry count=%d!\n", - i)); - i++; - } while ((i < RETRY_LIMIT) - && (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST))); - - if ((i == RETRY_LIMIT) - || (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST))) { - DBGPRINT_RAW(RT_DEBUG_ERROR, - ("Retry count exhausted or device removed!!!\n")); - return STATUS_UNSUCCESSFUL; - } - /* Prepare for write material */ - BbpCsr.word = 0; - BbpCsr.field.fRead = 0; - BbpCsr.field.Value = Value; - BbpCsr.field.Busy = 1; - BbpCsr.field.RegNum = Id; - RTUSBWriteMACRegister(pAd, BBP_CSR_CFG, BbpCsr.word); - - pAd->BbpWriteLatch[Id] = Value; - - return STATUS_SUCCESS; -} - -/* - ======================================================================== - - Routine Description: Write RF register through MAC - - Arguments: - - Return Value: - - IRQL = - - Note: - - ======================================================================== -*/ -int RTUSBWriteRFRegister(struct rt_rtmp_adapter *pAd, u32 Value) -{ - PHY_CSR4_STRUC PhyCsr4; - u32 i = 0; - int status; - - NdisZeroMemory(&PhyCsr4, sizeof(PHY_CSR4_STRUC)); - do { - status = RTUSBReadMACRegister(pAd, RF_CSR_CFG0, &PhyCsr4.word); - if (status >= 0) { - if (!(PhyCsr4.field.Busy)) - break; - } - DBGPRINT(RT_DEBUG_TRACE, - ("RTUSBWriteRFRegister(RF_CSR_CFG0):retry count=%d!\n", - i)); - i++; - } while ((i < RETRY_LIMIT) - && (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST))); - - if ((i == RETRY_LIMIT) - || (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST))) { - DBGPRINT_RAW(RT_DEBUG_ERROR, - ("Retry count exhausted or device removed!!!\n")); - return STATUS_UNSUCCESSFUL; - } - - RTUSBWriteMACRegister(pAd, RF_CSR_CFG0, Value); - - return STATUS_SUCCESS; -} - -/* - ======================================================================== - - Routine Description: - - Arguments: - - Return Value: - - IRQL = - - Note: - - ======================================================================== -*/ -int RTUSBReadEEPROM(struct rt_rtmp_adapter *pAd, - u16 Offset, u8 *pData, u16 length) -{ - int Status = STATUS_SUCCESS; - - Status = RTUSB_VendorRequest(pAd, - (USBD_TRANSFER_DIRECTION_IN | - USBD_SHORT_TRANSFER_OK), - DEVICE_VENDOR_REQUEST_IN, 0x9, 0, Offset, - pData, length); - - return Status; -} - -/* - ======================================================================== - - Routine Description: - - Arguments: - - Return Value: - - IRQL = - - Note: - - ======================================================================== -*/ -int RTUSBWriteEEPROM(struct rt_rtmp_adapter *pAd, - u16 Offset, u8 *pData, u16 length) -{ - int Status = STATUS_SUCCESS; - - Status = RTUSB_VendorRequest(pAd, - USBD_TRANSFER_DIRECTION_OUT, - DEVICE_VENDOR_REQUEST_OUT, - 0x8, 0, Offset, pData, length); - - return Status; -} - -int RTUSBReadEEPROM16(struct rt_rtmp_adapter *pAd, - u16 offset, u16 *pData) -{ - int status; - u16 localData; - - status = RTUSBReadEEPROM(pAd, offset, (u8 *)(&localData), 2); - if (status == STATUS_SUCCESS) - *pData = le2cpu16(localData); - - return status; - -} - -/* - ======================================================================== - - Routine Description: - - Arguments: - - Return Value: - - IRQL = - - Note: - - ======================================================================== -*/ -void RTUSBPutToSleep(struct rt_rtmp_adapter *pAd) -{ - u32 value; - - /* Timeout 0x40 x 50us */ - value = (SLEEPCID << 16) + (OWNERMCU << 24) + (0x40 << 8) + 1; - RTUSBWriteMACRegister(pAd, 0x7010, value); - RTUSBWriteMACRegister(pAd, 0x404, 0x30); - /*RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS); */ - DBGPRINT_RAW(RT_DEBUG_ERROR, ("Sleep Mailbox testvalue %x\n", value)); - -} - -/* - ======================================================================== - - Routine Description: - - Arguments: - - Return Value: - - IRQL = - - Note: - - ======================================================================== -*/ -int RTUSBWakeUp(struct rt_rtmp_adapter *pAd) -{ - int Status; - - Status = RTUSB_VendorRequest(pAd, - USBD_TRANSFER_DIRECTION_OUT, - DEVICE_VENDOR_REQUEST_OUT, - 0x01, 0x09, 0, NULL, 0); - - return Status; -} - -/* - ======================================================================== - - Routine Description: - - Arguments: - - Return Value: - - IRQL = - - Note: - - ======================================================================== -*/ -void RTUSBInitializeCmdQ(struct rt_cmdq *cmdq) -{ - cmdq->head = NULL; - cmdq->tail = NULL; - cmdq->size = 0; - cmdq->CmdQState = RTMP_TASK_STAT_INITED; -} - -/* - ======================================================================== - - Routine Description: - - Arguments: - - Return Value: - - IRQL = - - Note: - - ======================================================================== -*/ -int RTUSBEnqueueCmdFromNdis(struct rt_rtmp_adapter *pAd, - IN NDIS_OID Oid, - IN BOOLEAN SetInformation, - void *pInformationBuffer, - u32 InformationBufferLength) -{ - int status; - struct rt_cmdqelmt *cmdqelmt = NULL; - struct rt_rtmp_os_task *pTask = &pAd->cmdQTask; - -#ifdef KTHREAD_SUPPORT - if (pTask->kthread_task == NULL) -#else - CHECK_PID_LEGALITY(pTask->taskPID) { - } - else -#endif - return NDIS_STATUS_RESOURCES; - - status = os_alloc_mem(pAd, (u8 **) (&cmdqelmt), sizeof(struct rt_cmdqelmt)); - if ((status != NDIS_STATUS_SUCCESS) || (cmdqelmt == NULL)) - return NDIS_STATUS_RESOURCES; - - cmdqelmt->buffer = NULL; - if (pInformationBuffer != NULL) { - status = - os_alloc_mem(pAd, (u8 **) & cmdqelmt->buffer, - InformationBufferLength); - if ((status != NDIS_STATUS_SUCCESS) - || (cmdqelmt->buffer == NULL)) { - kfree(cmdqelmt); - return NDIS_STATUS_RESOURCES; - } else { - NdisMoveMemory(cmdqelmt->buffer, pInformationBuffer, - InformationBufferLength); - cmdqelmt->bufferlength = InformationBufferLength; - } - } else - cmdqelmt->bufferlength = 0; - - cmdqelmt->command = Oid; - cmdqelmt->CmdFromNdis = TRUE; - if (SetInformation == TRUE) - cmdqelmt->SetOperation = TRUE; - else - cmdqelmt->SetOperation = FALSE; - - NdisAcquireSpinLock(&pAd->CmdQLock); - if (pAd->CmdQ.CmdQState & RTMP_TASK_CAN_DO_INSERT) { - EnqueueCmd((&pAd->CmdQ), cmdqelmt); - status = NDIS_STATUS_SUCCESS; - } else { - status = NDIS_STATUS_FAILURE; - } - NdisReleaseSpinLock(&pAd->CmdQLock); - - if (status == NDIS_STATUS_FAILURE) { - if (cmdqelmt->buffer) - os_free_mem(pAd, cmdqelmt->buffer); - os_free_mem(pAd, cmdqelmt); - } else - RTUSBCMDUp(pAd); - - return NDIS_STATUS_SUCCESS; -} - -/* - ======================================================================== - - Routine Description: - - Arguments: - - Return Value: - - IRQL = - - Note: - - ======================================================================== -*/ -int RTUSBEnqueueInternalCmd(struct rt_rtmp_adapter *pAd, - IN NDIS_OID Oid, - void *pInformationBuffer, - u32 InformationBufferLength) -{ - int status; - struct rt_cmdqelmt *cmdqelmt = NULL; - - status = os_alloc_mem(pAd, (u8 **) & cmdqelmt, sizeof(struct rt_cmdqelmt)); - if ((status != NDIS_STATUS_SUCCESS) || (cmdqelmt == NULL)) - return NDIS_STATUS_RESOURCES; - NdisZeroMemory(cmdqelmt, sizeof(struct rt_cmdqelmt)); - - if (InformationBufferLength > 0) { - status = - os_alloc_mem(pAd, (u8 **) & cmdqelmt->buffer, - InformationBufferLength); - if ((status != NDIS_STATUS_SUCCESS) - || (cmdqelmt->buffer == NULL)) { - os_free_mem(pAd, cmdqelmt); - return NDIS_STATUS_RESOURCES; - } else { - NdisMoveMemory(cmdqelmt->buffer, pInformationBuffer, - InformationBufferLength); - cmdqelmt->bufferlength = InformationBufferLength; - } - } else { - cmdqelmt->buffer = NULL; - cmdqelmt->bufferlength = 0; - } - - cmdqelmt->command = Oid; - cmdqelmt->CmdFromNdis = FALSE; - - if (cmdqelmt != NULL) { - NdisAcquireSpinLock(&pAd->CmdQLock); - if (pAd->CmdQ.CmdQState & RTMP_TASK_CAN_DO_INSERT) { - EnqueueCmd((&pAd->CmdQ), cmdqelmt); - status = NDIS_STATUS_SUCCESS; - } else { - status = NDIS_STATUS_FAILURE; - } - NdisReleaseSpinLock(&pAd->CmdQLock); - - if (status == NDIS_STATUS_FAILURE) { - if (cmdqelmt->buffer) - os_free_mem(pAd, cmdqelmt->buffer); - os_free_mem(pAd, cmdqelmt); - } else - RTUSBCMDUp(pAd); - } - return NDIS_STATUS_SUCCESS; -} - -/* - ======================================================================== - - Routine Description: - - Arguments: - - Return Value: - - IRQL = - - Note: - - ======================================================================== -*/ -void RTUSBDequeueCmd(struct rt_cmdq *cmdq, struct rt_cmdqelmt * * pcmdqelmt) -{ - *pcmdqelmt = cmdq->head; - - if (*pcmdqelmt != NULL) { - cmdq->head = cmdq->head->next; - cmdq->size--; - if (cmdq->size == 0) - cmdq->tail = NULL; - } -} - -/* - ======================================================================== - usb_control_msg - Builds a control urb, sends it off and waits for completion - @dev: pointer to the usb device to send the message to - @pipe: endpoint "pipe" to send the message to - @request: USB message request value - @requesttype: USB message request type value - @value: USB message value - @index: USB message index value - @data: pointer to the data to send - @size: length in bytes of the data to send - @timeout: time in jiffies to wait for the message to complete before - timing out (if 0 the wait is forever) - Context: !in_interrupt () - - This function sends a simple control message to a specified endpoint - and waits for the message to complete, or timeout. - If successful, it returns the number of bytes transferred, otherwise a negative error number. - - Don't use this function from within an interrupt context, like a - bottom half handler. If you need an asynchronous message, or need to send - a message from within interrupt context, use usb_submit_urb() - If a thread in your driver uses this call, make sure your disconnect() - method can wait for it to complete. Since you don't have a handle on - the URB used, you can't cancel the request. - - Routine Description: - - Arguments: - - Return Value: - - Note: - - ======================================================================== -*/ -int RTUSB_VendorRequest(struct rt_rtmp_adapter *pAd, - u32 TransferFlags, - u8 RequestType, - u8 Request, - u16 Value, - u16 Index, - void *TransferBuffer, - u32 TransferBufferLength) -{ - int ret = 0; - struct os_cookie *pObj = (struct os_cookie *)pAd->OS_Cookie; - - if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)) { - DBGPRINT(RT_DEBUG_ERROR, ("device disconnected\n")); - return -1; - } else if (in_interrupt()) { - DBGPRINT(RT_DEBUG_ERROR, - ("in_interrupt, RTUSB_VendorRequest Request%02x Value%04x Offset%04x\n", - Request, Value, Index)); - - return -1; - } else { -#define MAX_RETRY_COUNT 10 - - int retryCount = 0; - void *tmpBuf = TransferBuffer; - - ret = down_interruptible(&(pAd->UsbVendorReq_semaphore)); - if (pAd->UsbVendorReqBuf) { - ASSERT(TransferBufferLength < MAX_PARAM_BUFFER_SIZE); - - tmpBuf = (void *)pAd->UsbVendorReqBuf; - NdisZeroMemory(pAd->UsbVendorReqBuf, - TransferBufferLength); - - if (RequestType == DEVICE_VENDOR_REQUEST_OUT) - NdisMoveMemory(tmpBuf, TransferBuffer, - TransferBufferLength); - } - - do { - if (RequestType == DEVICE_VENDOR_REQUEST_OUT) - ret = - usb_control_msg(pObj->pUsb_Dev, - usb_sndctrlpipe(pObj-> - pUsb_Dev, - 0), Request, - RequestType, Value, Index, - tmpBuf, - TransferBufferLength, - CONTROL_TIMEOUT_JIFFIES); - else if (RequestType == DEVICE_VENDOR_REQUEST_IN) - ret = - usb_control_msg(pObj->pUsb_Dev, - usb_rcvctrlpipe(pObj-> - pUsb_Dev, - 0), Request, - RequestType, Value, Index, - tmpBuf, - TransferBufferLength, - CONTROL_TIMEOUT_JIFFIES); - else { - DBGPRINT(RT_DEBUG_ERROR, - ("vendor request direction is failed\n")); - ret = -1; - } - - retryCount++; - if (ret < 0) { - DBGPRINT(RT_DEBUG_OFF, ("#\n")); - RTMPusecDelay(5000); - } - } while ((ret < 0) && (retryCount < MAX_RETRY_COUNT)); - - if ((pAd->UsbVendorReqBuf) - && (RequestType == DEVICE_VENDOR_REQUEST_IN)) - NdisMoveMemory(TransferBuffer, tmpBuf, - TransferBufferLength); - up(&(pAd->UsbVendorReq_semaphore)); - - if (ret < 0) { - DBGPRINT(RT_DEBUG_ERROR, - ("RTUSB_VendorRequest failed(%d),TxFlags=0x%x, ReqType=%s, Req=0x%x, Index=0x%x\n", - ret, TransferFlags, - (RequestType == - DEVICE_VENDOR_REQUEST_OUT ? "OUT" : "IN"), - Request, Index)); - if (Request == 0x2) - DBGPRINT(RT_DEBUG_ERROR, - ("\tRequest Value=0x%04x!\n", Value)); - - if ((TransferBuffer != NULL) - && (TransferBufferLength > 0)) - hex_dump("Failed TransferBuffer value", - TransferBuffer, TransferBufferLength); - } - - } - - if (ret != -1) - return STATUS_SUCCESS; - else - return STATUS_UNSUCCESSFUL; -} - -/* - ======================================================================== - - Routine Description: - Creates an IRP to submite an IOCTL_INTERNAL_USB_RESET_PORT - synchronously. Callers of this function must be running at - PASSIVE LEVEL. - - Arguments: - - Return Value: - - Note: - - ======================================================================== -*/ -int RTUSB_ResetDevice(struct rt_rtmp_adapter *pAd) -{ - int Status = TRUE; - - DBGPRINT_RAW(RT_DEBUG_TRACE, ("--->USB_ResetDevice\n")); - /*RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS); */ - return Status; -} - -void CMDHandler(struct rt_rtmp_adapter *pAd) -{ - struct rt_cmdqelmt *cmdqelmt; - u8 *pData; - int NdisStatus = NDIS_STATUS_SUCCESS; -/* unsigned long Now = 0; */ - int ntStatus; -/* unsigned long IrqFlags; */ - - while (pAd && pAd->CmdQ.size > 0) { - NdisStatus = NDIS_STATUS_SUCCESS; - - NdisAcquireSpinLock(&pAd->CmdQLock); - RTUSBDequeueCmd(&pAd->CmdQ, &cmdqelmt); - NdisReleaseSpinLock(&pAd->CmdQLock); - - if (cmdqelmt == NULL) - break; - - pData = cmdqelmt->buffer; - - if (! - (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST) - || RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS))) { - switch (cmdqelmt->command) { - case CMDTHREAD_CHECK_GPIO: - { - u32 data; - - { - /* Read GPIO pin2 as Hardware controlled radio state */ - - RTUSBReadMACRegister(pAd, - GPIO_CTRL_CFG, - &data); - - if (data & 0x04) { - pAd->StaCfg.bHwRadio = - TRUE; - } else { - pAd->StaCfg.bHwRadio = - FALSE; - } - - if (pAd->StaCfg.bRadio != - (pAd->StaCfg.bHwRadio - && pAd->StaCfg.bSwRadio)) { - pAd->StaCfg.bRadio = - (pAd->StaCfg. - bHwRadio - && pAd->StaCfg. - bSwRadio); - if (pAd->StaCfg. - bRadio == TRUE) { - DBGPRINT_RAW - (RT_DEBUG_ERROR, - ("!!! Radio On !!!\n")); - - MlmeRadioOn - (pAd); - /* Update extra information */ - pAd->ExtraInfo = - EXTRA_INFO_CLEAR; - } else { - DBGPRINT_RAW - (RT_DEBUG_ERROR, - ("!!! Radio Off !!!\n")); - - MlmeRadioOff - (pAd); - /* Update extra information */ - pAd->ExtraInfo = - HW_RADIO_OFF; - } - } - } - } - break; - - case CMDTHREAD_QKERIODIC_EXECUT: - { - StaQuickResponeForRateUpExec(NULL, pAd, - NULL, - NULL); - } - break; - - case CMDTHREAD_RESET_BULK_OUT: - { - u32 MACValue; - u8 Index; - int ret = 0; - struct rt_ht_tx_context *pHTTXContext; -/* struct rt_rtmp_tx_ring *pTxRing; */ - unsigned long IrqFlags; - - DBGPRINT_RAW(RT_DEBUG_TRACE, - ("CmdThread : CMDTHREAD_RESET_BULK_OUT(ResetPipeid=0x%0x)===>\n", - pAd->bulkResetPipeid)); - /* All transfers must be aborted or cancelled before attempting to reset the pipe. */ - /*RTUSBCancelPendingBulkOutIRP(pAd); */ - /* Wait 10ms to let previous packet that are already in HW FIFO to clear. by MAXLEE 12-25-2007 */ - Index = 0; - do { - RTUSBReadMACRegister(pAd, - TXRXQ_PCNT, - &MACValue); - if ((MACValue & 0xf00000 - /*0x800000 */) == 0) - break; - Index++; - RTMPusecDelay(10000); - } while (Index < 100); - MACValue = 0; - RTUSBReadMACRegister(pAd, USB_DMA_CFG, - &MACValue); - /* To prevent Read Register error, we 2nd check the validity. */ - if ((MACValue & 0xc00000) == 0) - RTUSBReadMACRegister(pAd, - USB_DMA_CFG, - &MACValue); - /* To prevent Read Register error, we 3rd check the validity. */ - if ((MACValue & 0xc00000) == 0) - RTUSBReadMACRegister(pAd, - USB_DMA_CFG, - &MACValue); - MACValue |= 0x80000; - RTUSBWriteMACRegister(pAd, USB_DMA_CFG, - MACValue); - - /* Wait 1ms to prevent next URB to bulkout before HW reset. by MAXLEE 12-25-2007 */ - RTMPusecDelay(1000); - - MACValue &= (~0x80000); - RTUSBWriteMACRegister(pAd, USB_DMA_CFG, - MACValue); - DBGPRINT_RAW(RT_DEBUG_TRACE, - ("\tSet 0x2a0 bit19. Clear USB DMA TX path\n")); - - /* Wait 5ms to prevent next URB to bulkout before HW reset. by MAXLEE 12-25-2007 */ - /*RTMPusecDelay(5000); */ - - if ((pAd-> - bulkResetPipeid & - BULKOUT_MGMT_RESET_FLAG) == - BULKOUT_MGMT_RESET_FLAG) { - RTMP_CLEAR_FLAG(pAd, - fRTMP_ADAPTER_BULKOUT_RESET); - if (pAd->MgmtRing.TxSwFreeIdx < - MGMT_RING_SIZE - /* pMLMEContext->bWaitingBulkOut == TRUE */ - ) { - RTUSB_SET_BULK_FLAG(pAd, - fRTUSB_BULK_OUT_MLME); - } - RTUSBKickBulkOut(pAd); - - DBGPRINT_RAW(RT_DEBUG_TRACE, - ("\tTX MGMT RECOVER Done!\n")); - } else { - pHTTXContext = - &(pAd-> - TxContext[pAd-> - bulkResetPipeid]); - /*NdisAcquireSpinLock(&pAd->BulkOutLock[pAd->bulkResetPipeid]); */ - RTMP_INT_LOCK(&pAd-> - BulkOutLock[pAd-> - bulkResetPipeid], - IrqFlags); - if (pAd-> - BulkOutPending[pAd-> - bulkResetPipeid] - == FALSE) { - pAd-> - BulkOutPending[pAd-> - bulkResetPipeid] - = TRUE; - pHTTXContext-> - IRPPending = TRUE; - pAd-> - watchDogTxPendingCnt - [pAd-> - bulkResetPipeid] = - 1; - - /* no matter what, clean the flag */ - RTMP_CLEAR_FLAG(pAd, - fRTMP_ADAPTER_BULKOUT_RESET); - - /*NdisReleaseSpinLock(&pAd->BulkOutLock[pAd->bulkResetPipeid]); */ - RTMP_INT_UNLOCK(&pAd-> - BulkOutLock - [pAd-> - bulkResetPipeid], - IrqFlags); - { - RTUSBInitHTTxDesc - (pAd, - pHTTXContext, - pAd-> - bulkResetPipeid, - pHTTXContext-> - BulkOutSize, - (usb_complete_t) - RTUSBBulkOutDataPacketComplete); - - ret = RTUSB_SUBMIT_URB - (pHTTXContext-> - pUrb); - if (ret != 0) { - RTMP_INT_LOCK - (&pAd-> - BulkOutLock - [pAd-> - bulkResetPipeid], - IrqFlags); - pAd-> - BulkOutPending - [pAd-> - bulkResetPipeid] - = - FALSE; - pHTTXContext-> - IRPPending - = - FALSE; - pAd-> - watchDogTxPendingCnt - [pAd-> - bulkResetPipeid] - = 0; - RTMP_INT_UNLOCK - (&pAd-> - BulkOutLock - [pAd-> - bulkResetPipeid], - IrqFlags); - - DBGPRINT - (RT_DEBUG_ERROR, - ("CmdThread : CMDTHREAD_RESET_BULK_OUT: Submit Tx URB failed %d\n", - ret)); - } else { - RTMP_IRQ_LOCK - (&pAd-> - BulkOutLock - [pAd-> - bulkResetPipeid], - IrqFlags); - DBGPRINT_RAW - (RT_DEBUG_TRACE, - ("\tCMDTHREAD_RESET_BULK_OUT: TxContext[%d]:CWPos=%ld, NBPos=%ld, ENBPos=%ld, bCopy=%d, pending=%d!\n", - pAd-> - bulkResetPipeid, - pHTTXContext-> - CurWritePosition, - pHTTXContext-> - NextBulkOutPosition, - pHTTXContext-> - ENextBulkOutPosition, - pHTTXContext-> - bCopySavePad, - pAd-> - BulkOutPending - [pAd-> - bulkResetPipeid])); - DBGPRINT_RAW - (RT_DEBUG_TRACE, - ("\t\tBulkOut Req=0x%lx, Complete=0x%lx, Other=0x%lx\n", - pAd-> - BulkOutReq, - pAd-> - BulkOutComplete, - pAd-> - BulkOutCompleteOther)); - RTMP_IRQ_UNLOCK - (&pAd-> - BulkOutLock - [pAd-> - bulkResetPipeid], - IrqFlags); - DBGPRINT_RAW - (RT_DEBUG_TRACE, - ("\tCMDTHREAD_RESET_BULK_OUT: Submit Tx DATA URB for failed BulkReq(0x%lx) Done, status=%d!\n", - pAd-> - bulkResetReq - [pAd-> - bulkResetPipeid], - pHTTXContext-> - pUrb-> - status)); - - } - } - } else { - /*NdisReleaseSpinLock(&pAd->BulkOutLock[pAd->bulkResetPipeid]); */ - /*RTMP_INT_UNLOCK(&pAd->BulkOutLock[pAd->bulkResetPipeid], IrqFlags); */ - - DBGPRINT_RAW - (RT_DEBUG_ERROR, - ("CmdThread : TX DATA RECOVER FAIL for BulkReq(0x%lx) because BulkOutPending[%d] is TRUE!\n", - pAd-> - bulkResetReq[pAd-> - bulkResetPipeid], - pAd-> - bulkResetPipeid)); - if (pAd-> - bulkResetPipeid == - 0) { - u8 - pendingContext - = 0; - struct rt_ht_tx_context * - pHTTXContext - = - (struct rt_ht_tx_context *) - (&pAd-> - TxContext - [pAd-> - bulkResetPipeid]); - struct rt_tx_context * - pMLMEContext - = - (struct rt_tx_context *) - (pAd-> - MgmtRing. - Cell[pAd-> - MgmtRing. - TxDmaIdx]. - AllocVa); - struct rt_tx_context * - pNULLContext - = - (struct rt_tx_context *) - (&pAd-> - PsPollContext); - struct rt_tx_context * - pPsPollContext - = - (struct rt_tx_context *) - (&pAd-> - NullContext); - - if (pHTTXContext->IRPPending) - pendingContext - |= - 1; - else if - (pMLMEContext-> - IRPPending) - pendingContext - |= - 2; - else if - (pNULLContext-> - IRPPending) - pendingContext - |= - 4; - else if - (pPsPollContext-> - IRPPending) - pendingContext - |= - 8; - else - pendingContext - = 0; - - DBGPRINT_RAW - (RT_DEBUG_ERROR, - ("\tTX Occupied by %d!\n", - pendingContext)); - } - /* no matter what, clean the flag */ - RTMP_CLEAR_FLAG(pAd, - fRTMP_ADAPTER_BULKOUT_RESET); - - RTMP_INT_UNLOCK(&pAd-> - BulkOutLock - [pAd-> - bulkResetPipeid], - IrqFlags); - - RTUSB_SET_BULK_FLAG(pAd, - (fRTUSB_BULK_OUT_DATA_NORMAL - << - pAd-> - bulkResetPipeid)); - } - - RTMPDeQueuePacket(pAd, FALSE, - NUM_OF_TX_RING, - MAX_TX_PROCESS); - /*RTUSBKickBulkOut(pAd); */ - } - - } - /* - // Don't cancel BULKIN. - while ((atomic_read(&pAd->PendingRx) > 0) && - (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST))) - { - if (atomic_read(&pAd->PendingRx) > 0) - { - DBGPRINT_RAW(RT_DEBUG_ERROR, ("BulkIn IRP Pending!!cancel it!\n")); - RTUSBCancelPendingBulkInIRP(pAd); - } - RTMPusecDelay(100000); - } - - if ((atomic_read(&pAd->PendingRx) == 0) && (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS))) - { - u8 i; - RTUSBRxPacket(pAd); - pAd->NextRxBulkInReadIndex = 0; // Next Rx Read index - pAd->NextRxBulkInIndex = 0; // Rx Bulk pointer - for (i = 0; i < (RX_RING_SIZE); i++) - { - struct rt_rx_context *pRxContext = &(pAd->RxContext[i]); - - pRxContext->pAd = pAd; - pRxContext->InUse = FALSE; - pRxContext->IRPPending = FALSE; - pRxContext->Readable = FALSE; - pRxContext->ReorderInUse = FALSE; - - } - RTUSBBulkReceive(pAd); - DBGPRINT_RAW(RT_DEBUG_ERROR, ("RTUSBBulkReceive\n")); - } */ - DBGPRINT_RAW(RT_DEBUG_TRACE, - ("CmdThread : CMDTHREAD_RESET_BULK_OUT<===\n")); - break; - - case CMDTHREAD_RESET_BULK_IN: - DBGPRINT_RAW(RT_DEBUG_TRACE, - ("CmdThread : CMDTHREAD_RESET_BULK_IN === >\n")); - - /* All transfers must be aborted or cancelled before attempting to reset the pipe. */ - { - u32 MACValue; - { - /*while ((atomic_read(&pAd->PendingRx) > 0) && (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST))) */ - if ((pAd->PendingRx > 0) - && - (!RTMP_TEST_FLAG - (pAd, - fRTMP_ADAPTER_NIC_NOT_EXIST))) { - DBGPRINT_RAW - (RT_DEBUG_ERROR, - ("BulkIn IRP Pending!!!\n")); - RTUSBCancelPendingBulkInIRP - (pAd); - RTMPusecDelay(100000); - pAd->PendingRx = 0; - } - } - /* Wait 10ms before reading register. */ - RTMPusecDelay(10000); - ntStatus = - RTUSBReadMACRegister(pAd, MAC_CSR0, - &MACValue); - - if ((NT_SUCCESS(ntStatus) == TRUE) && - (!(RTMP_TEST_FLAG - (pAd, - (fRTMP_ADAPTER_RESET_IN_PROGRESS - | fRTMP_ADAPTER_RADIO_OFF | - fRTMP_ADAPTER_HALT_IN_PROGRESS - | - fRTMP_ADAPTER_NIC_NOT_EXIST))))) - { - u8 i; - - if (RTMP_TEST_FLAG - (pAd, - (fRTMP_ADAPTER_RESET_IN_PROGRESS - | fRTMP_ADAPTER_RADIO_OFF - | - fRTMP_ADAPTER_HALT_IN_PROGRESS - | - fRTMP_ADAPTER_NIC_NOT_EXIST))) - break; - pAd->NextRxBulkInPosition = - pAd->RxContext[pAd-> - NextRxBulkInIndex]. - BulkInOffset; - DBGPRINT(RT_DEBUG_TRACE, - ("BULK_IN_RESET: NBIIdx=0x%x,NBIRIdx=0x%x, BIRPos=0x%lx. BIReq=x%lx, BIComplete=0x%lx, BICFail0x%lx\n", - pAd-> - NextRxBulkInIndex, - pAd-> - NextRxBulkInReadIndex, - pAd-> - NextRxBulkInPosition, - pAd->BulkInReq, - pAd->BulkInComplete, - pAd-> - BulkInCompleteFail)); - for (i = 0; i < RX_RING_SIZE; - i++) { - DBGPRINT(RT_DEBUG_TRACE, - ("\tRxContext[%d]: IRPPending=%d, InUse=%d, Readable=%d!\n", - i, - pAd-> - RxContext[i]. - IRPPending, - pAd-> - RxContext[i]. - InUse, - pAd-> - RxContext[i]. - Readable)); - } - /* - - DBGPRINT_RAW(RT_DEBUG_ERROR, ("==========================================\n")); - - pAd->NextRxBulkInReadIndex = 0; // Next Rx Read index - pAd->NextRxBulkInIndex = 0; // Rx Bulk pointer - for (i = 0; i < (RX_RING_SIZE); i++) - { - struct rt_rx_context *pRxContext = &(pAd->RxContext[i]); - - pRxContext->pAd = pAd; - pRxContext->InUse = FALSE; - pRxContext->IRPPending = FALSE; - pRxContext->Readable = FALSE; - pRxContext->ReorderInUse = FALSE; - - } */ - RTMP_CLEAR_FLAG(pAd, - fRTMP_ADAPTER_BULKIN_RESET); - for (i = 0; - i < - pAd->CommonCfg. - NumOfBulkInIRP; i++) { - /*RTUSBBulkReceive(pAd); */ - struct rt_rx_context *pRxContext; - PURB pUrb; - int ret = 0; - unsigned long IrqFlags; - - RTMP_IRQ_LOCK(&pAd-> - BulkInLock, - IrqFlags); - pRxContext = - &(pAd-> - RxContext[pAd-> - NextRxBulkInIndex]); - if ((pAd->PendingRx > 0) - || (pRxContext-> - Readable == - TRUE) - || (pRxContext-> - InUse == - TRUE)) { - RTMP_IRQ_UNLOCK - (&pAd-> - BulkInLock, - IrqFlags); - break; - } - pRxContext->InUse = - TRUE; - pRxContext->IRPPending = - TRUE; - pAd->PendingRx++; - pAd->BulkInReq++; - RTMP_IRQ_UNLOCK(&pAd-> - BulkInLock, - IrqFlags); - - /* Init Rx context descriptor */ - RTUSBInitRxDesc(pAd, - pRxContext); - pUrb = pRxContext->pUrb; - ret = RTUSB_SUBMIT_URB(pUrb); - if (ret != 0) { /* fail */ - - RTMP_IRQ_LOCK - (&pAd-> - BulkInLock, - IrqFlags); - pRxContext-> - InUse = - FALSE; - pRxContext-> - IRPPending = - FALSE; - pAd-> - PendingRx--; - pAd-> - BulkInReq--; - RTMP_IRQ_UNLOCK - (&pAd-> - BulkInLock, - IrqFlags); - DBGPRINT - (RT_DEBUG_ERROR, - ("CMDTHREAD_RESET_BULK_IN: Submit Rx URB failed(%d), status=%d\n", - ret, - pUrb-> - status)); - } else { /* success */ - /*DBGPRINT(RT_DEBUG_TRACE, ("BIDone, Pend=%d,BIIdx=%d,BIRIdx=%d!\n", */ - /* pAd->PendingRx, pAd->NextRxBulkInIndex, pAd->NextRxBulkInReadIndex)); */ - DBGPRINT_RAW - (RT_DEBUG_TRACE, - ("CMDTHREAD_RESET_BULK_IN: Submit Rx URB Done, status=%d!\n", - pUrb-> - status)); - ASSERT((pRxContext->InUse == pRxContext->IRPPending)); - } - } - - } else { - /* Card must be removed */ - if (NT_SUCCESS(ntStatus) != - TRUE) { - RTMP_SET_FLAG(pAd, - fRTMP_ADAPTER_NIC_NOT_EXIST); - DBGPRINT_RAW - (RT_DEBUG_ERROR, - ("CMDTHREAD_RESET_BULK_IN: Read Register Failed!Card must be removed!!\n\n")); - } else { - DBGPRINT_RAW - (RT_DEBUG_ERROR, - ("CMDTHREAD_RESET_BULK_IN: Cannot do bulk in because flags(0x%lx) on !\n", - pAd->Flags)); - } - } - } - DBGPRINT_RAW(RT_DEBUG_TRACE, - ("CmdThread : CMDTHREAD_RESET_BULK_IN <===\n")); - break; - - case CMDTHREAD_SET_ASIC_WCID: - { - struct rt_set_asic_wcid SetAsicWcid; - u16 offset; - u32 MACValue, MACRValue = 0; - SetAsicWcid = - *((struct rt_set_asic_wcid *)(pData)); - - if (SetAsicWcid.WCID >= - MAX_LEN_OF_MAC_TABLE) - return; - - offset = - MAC_WCID_BASE + - ((u8)SetAsicWcid.WCID) * - HW_WCID_ENTRY_SIZE; - - DBGPRINT_RAW(RT_DEBUG_TRACE, - ("CmdThread : CMDTHREAD_SET_ASIC_WCID : WCID = %ld, SetTid = %lx, DeleteTid = %lx.\n", - SetAsicWcid.WCID, - SetAsicWcid.SetTid, - SetAsicWcid.DeleteTid)); - MACValue = - (pAd->MacTab. - Content[SetAsicWcid.WCID]. - Addr[3] << 24) + - (pAd->MacTab. - Content[SetAsicWcid.WCID]. - Addr[2] << 16) + - (pAd->MacTab. - Content[SetAsicWcid.WCID]. - Addr[1] << 8) + - (pAd->MacTab. - Content[SetAsicWcid.WCID].Addr[0]); - DBGPRINT_RAW(RT_DEBUG_TRACE, - ("1-MACValue= %x,\n", - MACValue)); - RTUSBWriteMACRegister(pAd, offset, - MACValue); - /* Read bitmask */ - RTUSBReadMACRegister(pAd, offset + 4, - &MACRValue); - if (SetAsicWcid.DeleteTid != 0xffffffff) - MACRValue &= - (~SetAsicWcid.DeleteTid); - if (SetAsicWcid.SetTid != 0xffffffff) - MACRValue |= - (SetAsicWcid.SetTid); - MACRValue &= 0xffff0000; - - MACValue = - (pAd->MacTab. - Content[SetAsicWcid.WCID]. - Addr[5] << 8) + - pAd->MacTab.Content[SetAsicWcid. - WCID].Addr[4]; - MACValue |= MACRValue; - RTUSBWriteMACRegister(pAd, offset + 4, - MACValue); - - DBGPRINT_RAW(RT_DEBUG_TRACE, - ("2-MACValue= %x,\n", - MACValue)); - } - break; - - case CMDTHREAD_SET_ASIC_WCID_CIPHER: - { - struct rt_set_asic_wcid_attri SetAsicWcidAttri; - u16 offset; - u32 MACRValue = 0; - SHAREDKEY_MODE_STRUC csr1; - SetAsicWcidAttri = - *((struct rt_set_asic_wcid_attri *) - (pData)); - - if (SetAsicWcidAttri.WCID >= - MAX_LEN_OF_MAC_TABLE) - return; - - offset = - MAC_WCID_ATTRIBUTE_BASE + - ((u8)SetAsicWcidAttri.WCID) * - HW_WCID_ATTRI_SIZE; - - DBGPRINT_RAW(RT_DEBUG_TRACE, - ("Cmd : CMDTHREAD_SET_ASIC_WCID_CIPHER : WCID = %ld, Cipher = %lx.\n", - SetAsicWcidAttri.WCID, - SetAsicWcidAttri.Cipher)); - /* Read bitmask */ - RTUSBReadMACRegister(pAd, offset, - &MACRValue); - MACRValue = 0; - MACRValue |= - (((u8)SetAsicWcidAttri. - Cipher) << 1); - - RTUSBWriteMACRegister(pAd, offset, - MACRValue); - DBGPRINT_RAW(RT_DEBUG_TRACE, - ("2-offset = %x , MACValue= %x,\n", - offset, MACRValue)); - - offset = - PAIRWISE_IVEIV_TABLE_BASE + - ((u8)SetAsicWcidAttri.WCID) * - HW_IVEIV_ENTRY_SIZE; - MACRValue = 0; - if ((SetAsicWcidAttri.Cipher <= - CIPHER_WEP128)) - MACRValue |= - (pAd->StaCfg. - DefaultKeyId << 30); - else - MACRValue |= (0x20000000); - RTUSBWriteMACRegister(pAd, offset, - MACRValue); - DBGPRINT_RAW(RT_DEBUG_TRACE, - ("2-offset = %x , MACValue= %x,\n", - offset, MACRValue)); - - /* */ - /* Update cipher algorithm. WSTA always use BSS0 */ - /* */ - /* for adhoc mode only ,because wep status slow than add key, when use zero config */ - if (pAd->StaCfg.BssType == BSS_ADHOC) { - offset = - MAC_WCID_ATTRIBUTE_BASE; - - RTUSBReadMACRegister(pAd, - offset, - &MACRValue); - MACRValue &= (~0xe); - MACRValue |= - (((u8)SetAsicWcidAttri. - Cipher) << 1); - - RTUSBWriteMACRegister(pAd, - offset, - MACRValue); - - /*Update group key cipher,,because wep status slow than add key, when use zero config */ - RTUSBReadMACRegister(pAd, - SHARED_KEY_MODE_BASE - + - 4 * (0 / - 2), - &csr1. - word); - - csr1.field.Bss0Key0CipherAlg = - SetAsicWcidAttri.Cipher; - csr1.field.Bss0Key1CipherAlg = - SetAsicWcidAttri.Cipher; - - RTUSBWriteMACRegister(pAd, - SHARED_KEY_MODE_BASE - + - 4 * (0 / - 2), - csr1. - word); - } - } - break; - -/*Benson modified for USB interface, avoid in interrupt when write key, 20080724 --> */ - case RT_CMD_SET_KEY_TABLE: /*General call for AsicAddPairwiseKeyEntry() */ - { - struct rt_add_pairwise_key_entry KeyInfo; - KeyInfo = - *((struct rt_add_pairwise_key_entry *) - (pData)); - AsicAddPairwiseKeyEntry(pAd, - KeyInfo.MacAddr, - (u8)KeyInfo. - MacTabMatchWCID, - &KeyInfo. - CipherKey); - } - break; - - case RT_CMD_SET_RX_WCID_TABLE: /*General call for RTMPAddWcidAttributeEntry() */ - { - struct rt_mac_table_entry *pEntry; - u8 KeyIdx = 0; - u8 CipherAlg = CIPHER_NONE; - u8 ApIdx = BSS0; - - pEntry = (struct rt_mac_table_entry *)(pData); - - RTMPAddWcidAttributeEntry(pAd, - ApIdx, - KeyIdx, - CipherAlg, - pEntry); - } - break; -/*Benson modified for USB interface, avoid in interrupt when write key, 20080724 <-- */ - - case CMDTHREAD_SET_CLIENT_MAC_ENTRY: - { - struct rt_mac_table_entry *pEntry; - pEntry = (struct rt_mac_table_entry *)pData; - - { - AsicRemovePairwiseKeyEntry(pAd, - pEntry-> - apidx, - (u8) - pEntry-> - Aid); - if ((pEntry->AuthMode <= - Ndis802_11AuthModeAutoSwitch) - && (pEntry->WepStatus == - Ndis802_11Encryption1Enabled)) - { - u32 uIV = 1; - u8 *ptr; - - ptr = (u8 *)& uIV; - *(ptr + 3) = - (pAd->StaCfg. - DefaultKeyId << 6); - AsicUpdateWCIDIVEIV(pAd, - pEntry-> - Aid, - uIV, - 0); - AsicUpdateWCIDAttribute - (pAd, pEntry->Aid, - BSS0, - pAd-> - SharedKey[BSS0] - [pAd->StaCfg. - DefaultKeyId]. - CipherAlg, FALSE); - } else if (pEntry->AuthMode == - Ndis802_11AuthModeWPANone) - { - u32 uIV = 1; - u8 *ptr; - - ptr = (u8 *)& uIV; - *(ptr + 3) = - (pAd->StaCfg. - DefaultKeyId << 6); - AsicUpdateWCIDIVEIV(pAd, - pEntry-> - Aid, - uIV, - 0); - AsicUpdateWCIDAttribute - (pAd, pEntry->Aid, - BSS0, - pAd-> - SharedKey[BSS0] - [pAd->StaCfg. - DefaultKeyId]. - CipherAlg, FALSE); - } else { - /* */ - /* Other case, disable engine. */ - /* Don't worry WPA key, we will add WPA Key after 4-Way handshaking. */ - /* */ - u16 offset; - offset = - MAC_WCID_ATTRIBUTE_BASE - + - (pEntry->Aid * - HW_WCID_ATTRI_SIZE); - /* RX_PKEY_MODE:0 for no security; RX_KEY_TAB:0 for shared key table; BSS_IDX:0 */ - RTUSBWriteMACRegister - (pAd, offset, 0); - } - } - - AsicUpdateRxWCIDTable(pAd, pEntry->Aid, - pEntry->Addr); - DBGPRINT(RT_DEBUG_TRACE, - ("UpdateRxWCIDTable(): Aid=%d, " - "Addr=%pM!\n", - pEntry->Aid, - pEntry->Addr)); - } - break; - -/* add by johnli, fix "in_interrupt" error when call "MacTableDeleteEntry" in Rx tasklet */ - case CMDTHREAD_UPDATE_PROTECT: - { - AsicUpdateProtect(pAd, 0, - (ALLN_SETPROTECT), - TRUE, 0); - } - break; -/* end johnli */ - - case OID_802_11_ADD_WEP: - { - u32 i; - u32 KeyIdx; - struct rt_ndis_802_11_wep *pWepKey; - - DBGPRINT(RT_DEBUG_TRACE, - ("CmdThread::OID_802_11_ADD_WEP \n")); - - pWepKey = (struct rt_ndis_802_11_wep *)pData; - KeyIdx = pWepKey->KeyIndex & 0x0fffffff; - - /* it is a shared key */ - if ((KeyIdx >= 4) - || ((pWepKey->KeyLength != 5) - && (pWepKey->KeyLength != - 13))) { - NdisStatus = - NDIS_STATUS_INVALID_DATA; - DBGPRINT(RT_DEBUG_ERROR, - ("CmdThread::OID_802_11_ADD_WEP, INVALID_DATA!!\n")); - } else { - u8 CipherAlg; - pAd->SharedKey[BSS0][KeyIdx]. - KeyLen = - (u8)pWepKey->KeyLength; - NdisMoveMemory(pAd-> - SharedKey[BSS0] - [KeyIdx].Key, - &pWepKey-> - KeyMaterial, - pWepKey-> - KeyLength); - CipherAlg = - (pAd-> - SharedKey[BSS0][KeyIdx]. - KeyLen == - 5) ? CIPHER_WEP64 : - CIPHER_WEP128; - - /* */ - /* Change the WEP cipher to CKIP cipher if CKIP KP on. */ - /* Funk UI or Meetinghouse UI will add ckip key from this path. */ - /* */ - - if (pAd->OpMode == OPMODE_STA) { - pAd->MacTab. - Content[BSSID_WCID]. - PairwiseKey. - CipherAlg = - pAd-> - SharedKey[BSS0] - [KeyIdx].CipherAlg; - pAd->MacTab. - Content[BSSID_WCID]. - PairwiseKey.KeyLen = - pAd-> - SharedKey[BSS0] - [KeyIdx].KeyLen; - } - pAd->SharedKey[BSS0][KeyIdx]. - CipherAlg = CipherAlg; - if (pWepKey-> - KeyIndex & 0x80000000) { - /* Default key for tx (shared key) */ - u8 IVEIV[8]; - u32 WCIDAttri, Value; - u16 offset, offset2; - NdisZeroMemory(IVEIV, - 8); - pAd->StaCfg. - DefaultKeyId = - (u8)KeyIdx; - /* Add BSSID to WCTable. because this is Tx wep key. */ - /* WCID Attribute UDF:3, BSSIdx:3, Alg:3, Keytable:1=PAIRWISE KEY, BSSIdx is 0 */ - WCIDAttri = - (CipherAlg << 1) | - SHAREDKEYTABLE; - - offset = - MAC_WCID_ATTRIBUTE_BASE - + - (BSSID_WCID * - HW_WCID_ATTRI_SIZE); - RTUSBWriteMACRegister - (pAd, offset, - WCIDAttri); - /* 1. IV/EIV */ - /* Specify key index to find shared key. */ - IVEIV[3] = (u8)(KeyIdx << 6); /*WEP Eiv bit off. groupkey index is not 0 */ - offset = - PAIRWISE_IVEIV_TABLE_BASE - + - (BSS0Mcast_WCID * - HW_IVEIV_ENTRY_SIZE); - offset2 = - PAIRWISE_IVEIV_TABLE_BASE - + - (BSSID_WCID * - HW_IVEIV_ENTRY_SIZE); - for (i = 0; i < 8;) { - Value = - IVEIV[i]; - Value += - (IVEIV - [i + - 1] << 8); - Value += - (IVEIV - [i + - 2] << 16); - Value += - (IVEIV - [i + - 3] << 24); - RTUSBWriteMACRegister - (pAd, - offset + i, - Value); - RTUSBWriteMACRegister - (pAd, - offset2 + - i, Value); - i += 4; - } - - /* 2. WCID Attribute UDF:3, BSSIdx:3, Alg:3, Keytable:use share key, BSSIdx is 0 */ - WCIDAttri = - (pAd-> - SharedKey[BSS0] - [KeyIdx]. - CipherAlg << 1) | - SHAREDKEYTABLE; - offset = - MAC_WCID_ATTRIBUTE_BASE - + - (BSS0Mcast_WCID * - HW_WCID_ATTRI_SIZE); - DBGPRINT(RT_DEBUG_TRACE, - ("BSS0Mcast_WCID : offset = %x, WCIDAttri = %x\n", - offset, - WCIDAttri)); - RTUSBWriteMACRegister - (pAd, offset, - WCIDAttri); - - } - AsicAddSharedKeyEntry(pAd, BSS0, - (u8) - KeyIdx, - CipherAlg, - pWepKey-> - KeyMaterial, - NULL, - NULL); - DBGPRINT(RT_DEBUG_TRACE, - ("CmdThread::OID_802_11_ADD_WEP (KeyIdx=%d, Len=%d-byte)\n", - KeyIdx, - pWepKey->KeyLength)); - } - } - break; - - case CMDTHREAD_802_11_COUNTER_MEASURE: - break; - - case CMDTHREAD_SET_GROUP_KEY: - WpaStaGroupKeySetting(pAd); - break; - - case CMDTHREAD_SET_PAIRWISE_KEY: - WpaStaPairwiseKeySetting(pAd); - break; - - case CMDTHREAD_SET_PSM_BIT: - { - u16 *pPsm = (u16 *) pData; - MlmeSetPsmBit(pAd, *pPsm); - } - break; - case CMDTHREAD_FORCE_WAKE_UP: - AsicForceWakeup(pAd, TRUE); - break; - - default: - DBGPRINT(RT_DEBUG_ERROR, - ("--> Control Thread !! ERROR !! Unknown(cmdqelmt->command=0x%x) !! \n", - cmdqelmt->command)); - break; - } - } - - if (cmdqelmt->CmdFromNdis == TRUE) { - if (cmdqelmt->buffer != NULL) - os_free_mem(pAd, cmdqelmt->buffer); - os_free_mem(pAd, cmdqelmt); - } else { - if ((cmdqelmt->buffer != NULL) - && (cmdqelmt->bufferlength != 0)) - os_free_mem(pAd, cmdqelmt->buffer); - os_free_mem(pAd, cmdqelmt); - } - } /* end of while */ -} - -#endif /* RTMP_MAC_USB // */ diff --git a/drivers/staging/rt2870/common/spectrum.c b/drivers/staging/rt2870/common/spectrum.c deleted file mode 100644 index 1cf2c263f452..000000000000 --- a/drivers/staging/rt2870/common/spectrum.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../rt2860/common/spectrum.c" diff --git a/drivers/staging/rt2870/dfs.h b/drivers/staging/rt2870/dfs.h deleted file mode 100644 index 1fdbd7bc5de5..000000000000 --- a/drivers/staging/rt2870/dfs.h +++ /dev/null @@ -1 +0,0 @@ -#include "../rt2860/dfs.h" diff --git a/drivers/staging/rt2870/md5.h b/drivers/staging/rt2870/md5.h deleted file mode 100644 index d60cd05b54f7..000000000000 --- a/drivers/staging/rt2870/md5.h +++ /dev/null @@ -1 +0,0 @@ -#include "../rt2860/md5.h" diff --git a/drivers/staging/rt2870/mlme.h b/drivers/staging/rt2870/mlme.h deleted file mode 100644 index 58753ac441de..000000000000 --- a/drivers/staging/rt2870/mlme.h +++ /dev/null @@ -1 +0,0 @@ -#include "../rt2860/mlme.h" diff --git a/drivers/staging/rt2870/oid.h b/drivers/staging/rt2870/oid.h deleted file mode 100644 index 1223d81bfc62..000000000000 --- a/drivers/staging/rt2870/oid.h +++ /dev/null @@ -1 +0,0 @@ -#include "../rt2860/oid.h" diff --git a/drivers/staging/rt2870/rt28xx.h b/drivers/staging/rt2870/rt28xx.h deleted file mode 100644 index 29bad957de48..000000000000 --- a/drivers/staging/rt2870/rt28xx.h +++ /dev/null @@ -1 +0,0 @@ -#include "../rt2860/rt28xx.h" diff --git a/drivers/staging/rt2870/rt_config.h b/drivers/staging/rt2870/rt_config.h deleted file mode 100644 index 1f6d6ed5630c..000000000000 --- a/drivers/staging/rt2870/rt_config.h +++ /dev/null @@ -1 +0,0 @@ -#include "../rt2860/rt_config.h" diff --git a/drivers/staging/rt2870/rt_linux.c b/drivers/staging/rt2870/rt_linux.c deleted file mode 100644 index 88c697bf90eb..000000000000 --- a/drivers/staging/rt2870/rt_linux.c +++ /dev/null @@ -1 +0,0 @@ -#include "../rt2860/rt_linux.c" diff --git a/drivers/staging/rt2870/rt_linux.h b/drivers/staging/rt2870/rt_linux.h deleted file mode 100644 index b2aeafbd5189..000000000000 --- a/drivers/staging/rt2870/rt_linux.h +++ /dev/null @@ -1 +0,0 @@ -#include "../rt2860/rt_linux.h" diff --git a/drivers/staging/rt2870/rt_main_dev.c b/drivers/staging/rt2870/rt_main_dev.c deleted file mode 100644 index 121e1636017a..000000000000 --- a/drivers/staging/rt2870/rt_main_dev.c +++ /dev/null @@ -1 +0,0 @@ -#include "../rt2860/rt_main_dev.c" diff --git a/drivers/staging/rt2870/rt_profile.c b/drivers/staging/rt2870/rt_profile.c deleted file mode 100644 index 15988c5d9df7..000000000000 --- a/drivers/staging/rt2870/rt_profile.c +++ /dev/null @@ -1 +0,0 @@ -#include "../rt2860/rt_profile.c" diff --git a/drivers/staging/rt2870/rt_usb.c b/drivers/staging/rt2870/rt_usb.c deleted file mode 100644 index 5e02d4c88d73..000000000000 --- a/drivers/staging/rt2870/rt_usb.c +++ /dev/null @@ -1 +0,0 @@ -#include "../rt2860/rt_usb.c" diff --git a/drivers/staging/rt2870/rtmp.h b/drivers/staging/rt2870/rtmp.h deleted file mode 100644 index e5ef89f8bef1..000000000000 --- a/drivers/staging/rt2870/rtmp.h +++ /dev/null @@ -1 +0,0 @@ -#include "../rt2860/rtmp.h" diff --git a/drivers/staging/rt2870/rtmp_ckipmic.h b/drivers/staging/rt2870/rtmp_ckipmic.h deleted file mode 100644 index 0e7f1dfd4547..000000000000 --- a/drivers/staging/rt2870/rtmp_ckipmic.h +++ /dev/null @@ -1 +0,0 @@ -#include "../rt2860/rtmp_ckipmic.h" diff --git a/drivers/staging/rt2870/rtmp_def.h b/drivers/staging/rt2870/rtmp_def.h deleted file mode 100644 index 839d791b4f62..000000000000 --- a/drivers/staging/rt2870/rtmp_def.h +++ /dev/null @@ -1 +0,0 @@ -#include "../rt2860/rtmp_def.h" diff --git a/drivers/staging/rt2870/rtmp_type.h b/drivers/staging/rt2870/rtmp_type.h deleted file mode 100644 index fbf97d0fa5d3..000000000000 --- a/drivers/staging/rt2870/rtmp_type.h +++ /dev/null @@ -1 +0,0 @@ -#include "../rt2860/rtmp_type.h" diff --git a/drivers/staging/rt2870/spectrum.h b/drivers/staging/rt2870/spectrum.h deleted file mode 100644 index 8aa23a1833b1..000000000000 --- a/drivers/staging/rt2870/spectrum.h +++ /dev/null @@ -1 +0,0 @@ -#include "../rt2860/spectrum.h" diff --git a/drivers/staging/rt2870/spectrum_def.h b/drivers/staging/rt2870/spectrum_def.h deleted file mode 100644 index a65f551e3918..000000000000 --- a/drivers/staging/rt2870/spectrum_def.h +++ /dev/null @@ -1 +0,0 @@ -#include "../rt2860/spectrum_def.h" diff --git a/drivers/staging/rt2870/sta/aironet.c b/drivers/staging/rt2870/sta/aironet.c deleted file mode 100644 index 72b7f2e6bf7f..000000000000 --- a/drivers/staging/rt2870/sta/aironet.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../rt2860/sta/aironet.c" diff --git a/drivers/staging/rt2870/sta/assoc.c b/drivers/staging/rt2870/sta/assoc.c deleted file mode 100644 index 46564d7a01a9..000000000000 --- a/drivers/staging/rt2870/sta/assoc.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../rt2860/sta/assoc.c" diff --git a/drivers/staging/rt2870/sta/auth.c b/drivers/staging/rt2870/sta/auth.c deleted file mode 100644 index 57632f9ec784..000000000000 --- a/drivers/staging/rt2870/sta/auth.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../rt2860/sta/auth.c" diff --git a/drivers/staging/rt2870/sta/auth_rsp.c b/drivers/staging/rt2870/sta/auth_rsp.c deleted file mode 100644 index 783e266d3e8f..000000000000 --- a/drivers/staging/rt2870/sta/auth_rsp.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../rt2860/sta/auth_rsp.c" diff --git a/drivers/staging/rt2870/sta/connect.c b/drivers/staging/rt2870/sta/connect.c deleted file mode 100644 index f6c7bbf542dc..000000000000 --- a/drivers/staging/rt2870/sta/connect.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../rt2860/sta/connect.c" diff --git a/drivers/staging/rt2870/sta/rtmp_data.c b/drivers/staging/rt2870/sta/rtmp_data.c deleted file mode 100644 index b67e06952bcf..000000000000 --- a/drivers/staging/rt2870/sta/rtmp_data.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../rt2860/sta/rtmp_data.c" diff --git a/drivers/staging/rt2870/sta/sanity.c b/drivers/staging/rt2870/sta/sanity.c deleted file mode 100644 index f1f2333bb993..000000000000 --- a/drivers/staging/rt2870/sta/sanity.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../rt2860/sta/sanity.c" diff --git a/drivers/staging/rt2870/sta/sync.c b/drivers/staging/rt2870/sta/sync.c deleted file mode 100644 index 66c8772ad346..000000000000 --- a/drivers/staging/rt2870/sta/sync.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../rt2860/sta/sync.c" diff --git a/drivers/staging/rt2870/sta/wpa.c b/drivers/staging/rt2870/sta/wpa.c deleted file mode 100644 index 57a2eb2d0896..000000000000 --- a/drivers/staging/rt2870/sta/wpa.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../rt2860/sta/wpa.c" diff --git a/drivers/staging/rt2870/sta_ioctl.c b/drivers/staging/rt2870/sta_ioctl.c deleted file mode 100644 index 3553a6c898b9..000000000000 --- a/drivers/staging/rt2870/sta_ioctl.c +++ /dev/null @@ -1 +0,0 @@ -#include "../rt2860/sta_ioctl.c" diff --git a/drivers/staging/rt2870/usb_main_dev.c b/drivers/staging/rt2870/usb_main_dev.c deleted file mode 100644 index 6e63bc50047a..000000000000 --- a/drivers/staging/rt2870/usb_main_dev.c +++ /dev/null @@ -1 +0,0 @@ -#include "../rt2860/usb_main_dev.c" diff --git a/drivers/staging/rt2870/wpa.h b/drivers/staging/rt2870/wpa.h deleted file mode 100644 index 712507224146..000000000000 --- a/drivers/staging/rt2870/wpa.h +++ /dev/null @@ -1 +0,0 @@ -#include "../rt2860/wpa.h" |