diff options
29 files changed, 0 insertions, 8758 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index 1a3564dddcb7..4c7cff443a5e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8631,11 +8631,6 @@ M: Forest Bond <forest@alittletooquiet.net> S: Odd Fixes F: drivers/staging/vt665?/ -STAGING - WINBOND IS89C35 WLAN USB DRIVER -M: Pavel Machek <pavel@ucw.cz> -S: Odd Fixes -F: drivers/staging/winbond/ - STAGING - XGI Z7,Z9,Z11 PCI DISPLAY DRIVER M: Arnaud Patard <arnaud.patard@rtp-net.org> S: Odd Fixes diff --git a/drivers/staging/Kconfig b/drivers/staging/Kconfig index 52d7e8b63347..c7e34a28c6f1 100644 --- a/drivers/staging/Kconfig +++ b/drivers/staging/Kconfig @@ -30,8 +30,6 @@ source "drivers/staging/slicoss/Kconfig" source "drivers/staging/usbip/Kconfig" -source "drivers/staging/winbond/Kconfig" - source "drivers/staging/wlan-ng/Kconfig" source "drivers/staging/comedi/Kconfig" diff --git a/drivers/staging/Makefile b/drivers/staging/Makefile index 1b9e10c639e3..8ad1689da19d 100644 --- a/drivers/staging/Makefile +++ b/drivers/staging/Makefile @@ -7,7 +7,6 @@ obj-y += media/ obj-$(CONFIG_ET131X) += et131x/ obj-$(CONFIG_SLICOSS) += slicoss/ obj-$(CONFIG_USBIP_CORE) += usbip/ -obj-$(CONFIG_W35UND) += winbond/ obj-$(CONFIG_PRISM2_USB) += wlan-ng/ obj-$(CONFIG_COMEDI) += comedi/ obj-$(CONFIG_FB_OLPC_DCON) += olpc_dcon/ diff --git a/drivers/staging/winbond/Kconfig b/drivers/staging/winbond/Kconfig deleted file mode 100644 index db5b053d9bc2..000000000000 --- a/drivers/staging/winbond/Kconfig +++ /dev/null @@ -1,11 +0,0 @@ -config W35UND - tristate "IS89C35 WLAN USB driver" - depends on MAC80211 && WLAN && USB - default n - ---help--- - This is highly experimental driver for Winbond WIFI card. - - Hardware is present in some Kohjinsha subnotebooks, and in some - stand-alone USB modules. Chipset name seems to be w89c35d. - - Check <http://code.google.com/p/winbondport/> for new version. diff --git a/drivers/staging/winbond/Makefile b/drivers/staging/winbond/Makefile deleted file mode 100644 index 081d48db04cb..000000000000 --- a/drivers/staging/winbond/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -w35und-y := \ - mds.o \ - mto.o \ - phy_calibration.o \ - reg.o \ - wb35reg.o \ - wb35rx.o \ - wb35tx.o \ - wbusb.o \ - - -obj-$(CONFIG_W35UND) += w35und.o - - - diff --git a/drivers/staging/winbond/TODO b/drivers/staging/winbond/TODO deleted file mode 100644 index b4c592a96844..000000000000 --- a/drivers/staging/winbond/TODO +++ /dev/null @@ -1,12 +0,0 @@ -TODO: - - sparse cleanups - - checkpatch cleanups - - kerneldoc cleanups - - fix severeCamelCaseInfestation - - remove unused ioctls - - use cfg80211 for regulatory stuff - - fix 4k stack problems - - fix locking problems (it's done using atomics...) - -Please send patches to Greg Kroah-Hartman <greg@kroah.com> and -Pavel Machek <pavel@ucw.cz> diff --git a/drivers/staging/winbond/core.h b/drivers/staging/winbond/core.h deleted file mode 100644 index fc0ef24fad3b..000000000000 --- a/drivers/staging/winbond/core.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef __WINBOND_CORE_H -#define __WINBOND_CORE_H - -#include <linux/wireless.h> -#include <linux/types.h> -#include <linux/delay.h> - -#include "wbhal.h" -#include "mto.h" - -#include "mac_structures.h" -#include "mds_s.h" - -#define MAX_NUM_TX_MMPDU 2 -#define MAX_MMPDU_SIZE 1512 -#define MAX_NUM_RX_MMPDU 6 - -struct mlme_frame { - s8 *pMMPDU; - u16 len; - u8 data_type; - u8 is_in_used; - - u8 TxMMPDU[MAX_NUM_TX_MMPDU][MAX_MMPDU_SIZE]; - u8 TxMMPDUInUse[(MAX_NUM_TX_MMPDU + 3) & ~0x03]; - - u16 wNumTxMMPDU; - u16 wNumTxMMPDUDiscarded; - - u8 RxMMPDU[MAX_NUM_RX_MMPDU][MAX_MMPDU_SIZE]; - u8 SaveRxBufSlotInUse[(MAX_NUM_RX_MMPDU + 3) & ~0x03]; - - u16 wNumRxMMPDU; - u16 wNumRxMMPDUDiscarded; - - u16 wNumRxMMPDUInMLME; /* Number of the Rx MMPDU */ - u16 reserved_1; /* in MLME. */ - /* excluding the discarded */ -}; - -#define WBLINUX_PACKET_ARRAY_SIZE (ETHERNET_TX_DESCRIPTORS*4) - -#define WB_MAX_LINK_NAME_LEN 40 - -struct wbsoft_priv { - struct wb_local_para sLocalPara; /* Myself connected - parameters */ - - struct mlme_frame sMlmeFrame; /* connect to peerSTA parameters */ - - struct wb35_mto_params sMtoPara; /* MTO_struct ... */ - struct hw_data sHwData; /*For HAL */ - struct wb35_mds Mds; - - u32 RxByteCount; - u32 TxByteCount; - - bool enabled; -}; - -#endif /* __WINBOND_CORE_H */ diff --git a/drivers/staging/winbond/localpara.h b/drivers/staging/winbond/localpara.h deleted file mode 100644 index 8ca80ddda59a..000000000000 --- a/drivers/staging/winbond/localpara.h +++ /dev/null @@ -1,311 +0,0 @@ -#ifndef __WINBOND_LOCALPARA_H -#define __WINBOND_LOCALPARA_H - -/* - * ============================================================= - * LocalPara.h - - * ============================================================= - */ - -#include "mac_structures.h" - -/* Define the local ability */ - -#define LOCAL_DEFAULT_BEACON_PERIOD 100 /* ms */ -#define LOCAL_DEFAULT_ATIM_WINDOW 0 -#define LOCAL_DEFAULT_ERP_CAPABILITY 0x0431 /* - * 0x0001: ESS - * 0x0010: Privacy - * 0x0020: short preamble - * 0x0400: short slot time - */ -#define LOCAL_DEFAULT_LISTEN_INTERVAL 5 - -#define LOCAL_DEFAULT_24_CHANNEL_NUM 13 /* channel 1..13 */ -#define LOCAL_DEFAULT_5_CHANNEL_NUM 8 /* channel 36..64 */ - -#define LOCAL_USA_24_CHANNEL_NUM 11 -#define LOCAL_USA_5_CHANNEL_NUM 12 -#define LOCAL_EUROPE_24_CHANNEL_NUM 13 -#define LOCAL_EUROPE_5_CHANNEL_NUM 19 -#define LOCAL_JAPAN_24_CHANNEL_NUM 14 -#define LOCAL_JAPAN_5_CHANNEL_NUM 11 -#define LOCAL_UNKNOWN_24_CHANNEL_NUM 14 -#define LOCAL_UNKNOWN_5_CHANNEL_NUM 34 /* not include 165 */ - -#define psLOCAL (&(adapter->sLocalPara)) - -#define MODE_802_11_BG 0 -#define MODE_802_11_A 1 -#define MODE_802_11_ABG 2 -#define MODE_802_11_BG_IBSS 3 -#define MODE_802_11_B 4 -#define MODE_AUTO 255 - -#define BAND_TYPE_DSSS 0 -#define BAND_TYPE_OFDM_24 1 -#define BAND_TYPE_OFDM_5 2 - -/* refer Bitmap2RateValue table */ - -/* the bitmap value of all the H/W supported rates: */ -/* 1, 2, 5.5, 11, 6, 9, 12, 18, 24, 36, 48, 54 */ -#define LOCAL_ALL_SUPPORTED_RATES_BITMAP 0x130c1a66 -/* the bitmap value of all the H/W supported rates except to non-OFDM rates: */ -/* 6, 9, 12, 18, 24, 36, 48, 54 */ -#define LOCAL_OFDM_SUPPORTED_RATES_BITMAP 0x130c1240 -#define LOCAL_11B_SUPPORTED_RATE_BITMAP 0x826 -#define LOCAL_11B_BASIC_RATE_BITMAP 0x826 -#define LOCAL_11B_OPERATION_RATE_BITMAP 0x826 -#define LOCAL_11G_BASIC_RATE_BITMAP 0x826 /* 1, 2, 5.5, 11 */ -#define LOCAL_11G_OPERATION_RATE_BITMAP 0x130c1240 /* 6, 9, 12, 18, - * 24, 36, 48, 54 - */ -#define LOCAL_11A_BASIC_RATE_BITMAP 0x01001040 /* 6, 12, 24 */ -#define LOCAL_11A_OPERATION_RATE_BITMAP 0x120c0200 /* 9, 18, 36, - * 48, 54 - */ - - -#define PWR_ACTIVE 0 -#define PWR_SAVE 1 -#define PWR_TX_IDLE_CYCLE 6 - -/* bPreambleMode and bSlotTimeMode */ -#define AUTO_MODE 0 -#define LONG_MODE 1 - -/* Region definition */ -#define REGION_AUTO 0xff -#define REGION_UNKNOWN 0 -#define REGION_EUROPE 1 /* ETSI */ -#define REGION_JAPAN 2 /* MKK */ -#define REGION_USA 3 /* FCC */ -#define REGION_FRANCE 4 /* FRANCE */ -#define REGION_SPAIN 5 /* SPAIN */ -#define REGION_ISRAEL 6 /* ISRAEL */ - -#define MAX_BSS_DESCRIPT_ELEMENT 32 -#define MAX_PMKID_CandidateList 16 - -/* - * High byte : Event number, low byte : reason - * Event definition - * -- SME/MLME event - */ -#define EVENT_RCV_DEAUTH 0x0100 -#define EVENT_JOIN_FAIL 0x0200 -#define EVENT_AUTH_FAIL 0x0300 -#define EVENT_ASSOC_FAIL 0x0400 -#define EVENT_LOST_SIGNAL 0x0500 -#define EVENT_BSS_DESCRIPT_LACK 0x0600 -#define EVENT_COUNTERMEASURE 0x0700 -#define EVENT_JOIN_FILTER 0x0800 -/* -- TX/RX event */ -#define EVENT_RX_BUFF_UNAVAILABLE 0x4100 - -#define EVENT_CONNECT 0x8100 -#define EVENT_DISCONNECT 0x8200 -#define EVENT_SCAN_REQ 0x8300 - -/* Reason of Event */ -#define EVENT_REASON_FILTER_BASIC_RATE 0x0001 -#define EVENT_REASON_FILTER_PRIVACY 0x0002 -#define EVENT_REASON_FILTER_AUTH_MODE 0x0003 -#define EVENT_REASON_TIMEOUT 0x00ff - -/* Due to[E id][Length][OUI][Data] may be 257 bytes */ -#define MAX_IE_APPEND_SIZE (256 + 4) - -struct chan_info { - u8 band; - u8 ChanNo; -}; - -struct radio_off { - u8 boHwRadioOff; - u8 boSwRadioOff; -}; - -struct wb_local_para { - /* read from EPROM, manufacture set for each NetCard */ - u8 PermanentAddress[MAC_ADDR_LENGTH + 2]; - /* the driver will use this one actually. */ - u8 ThisMacAddress[MAC_ADDR_LENGTH + 2]; - u32 MTUsize; /* Ind to Uplayer, Max transmission unit size */ - u8 region_INF; /* region setting from INF */ - u8 region; /* real region setting of the device */ - u8 Reserved_1[2]; - - /* power-save variables */ - u8 iPowerSaveMode; /* 0 indicates on, 1 indicates off */ - u8 ATIMmode; - u8 ExcludeUnencrypted; - /* Unit time count for the decision to enter PS mode */ - u16 CheckCountForPS; - u8 boHasTxActivity;/* tx activity has occurred */ - u8 boMacPsValid; /* Power save mode obtained - * from H/W is valid or not - */ - - /* Rate */ - u8 TxRateMode; /* - * Initial, input from Registry, - * may be updated by GUI - * Tx Rate Mode: auto(DTO on), max, 1M, 2M, .. - */ - u8 CurrentTxRate; /* The current Tx rate */ - u8 CurrentTxRateForMng; /* - * The current Tx rate for management - * frames. It will be decided before - * connection succeeds. - */ - u8 CurrentTxFallbackRate; - - /* for Rate handler */ - u8 BRateSet[32]; /* basic rate set */ - u8 SRateSet[32]; /* support rate set */ - - u8 NumOfBRate; - u8 NumOfSRate; - u8 NumOfDsssRateInSRate; /* number of DSSS rates in - * supported rate set - */ - u8 reserved1; - - u32 dwBasicRateBitmap; /* bit map of basic rates */ - - u32 dwSupportRateBitmap; /* bit map of all support rates - * including basic and operational - * rates - */ - - - /* For SME/MLME handler */ - - u16 wOldSTAindex; /* valid when boHandover=TRUE, - * store old connected STA index - */ - u16 wConnectedSTAindex; /* Index of peerly connected AP or - * IBSS in the descriptionset. - */ - u16 Association_ID; /* The Association ID in the - * (Re)Association Response frame. - */ - u16 ListenInterval; /* The listen interval when SME invoking - * MLME_ (Re)Associate_Request(). - */ - - struct radio_off RadioOffStatus; - u8 Reserved0[2]; - u8 boMsRadioOff; /* Ndis demands to be true when set - * Disassoc. OID and be false when - * set SSID OID. - */ - u8 bAntennaNo; /* which antenna */ - u8 bConnectFlag; /* the connect status flag for - * roaming task - */ - - u8 RoamStatus; - u8 reserved7[3]; - - struct chan_info CurrentChan; /* Current channel no. and channel band. - * It may be changed by scanning. - */ - u8 boHandover; /* Roaming, Handover to other AP. */ - u8 boCCAbusy; - - u16 CWMax; /* It may not be the real value - * that H/W used - */ - u8 CWMin; /* 255: set according to 802.11 spec. */ - u8 reserved2; - - /* 11G: */ - u8 bMacOperationMode; /* operation in 802.11b or 802.11g */ - u8 bSlotTimeMode; /* AUTO, s32 */ - u8 bPreambleMode; /* AUTO, s32 */ - u8 boNonERPpresent; - - u8 boProtectMechanism; /* H/W will take the necessary action - * based on this variable - */ - u8 boShortPreamble; /* Same here */ - u8 boShortSlotTime; /* Same here */ - u8 reserved_3; - - u32 RSN_IE_Bitmap; - u32 RSN_OUI_Type; - - /* For the BSSID */ - u8 HwBssid[MAC_ADDR_LENGTH + 2]; - u32 HwBssidValid; - - /* For scan list */ - u8 BssListCount; /* Total count of valid - * descriptor indexes - */ - u8 boReceiveUncorrectInfo; /* important settings in beacon/probe - * resp. have been changed - */ - u8 NoOfJoinerInIbss; - u8 reserved_4; - - /* Store the valid descriptor indexes obtained from scannings */ - u8 BssListIndex[(MAX_BSS_DESCRIPT_ELEMENT + 3) & ~0x03]; - /* - * Save the BssDescriptor index in this IBSS. - * The index 0 is local descriptor (psLOCAL->wConnectedSTAindex). - * If CONNECTED : NoOfJoinerInIbss >= 2 - * else : NoOfJoinerInIbss <= 1 - */ - u8 JoinerInIbss[(MAX_BSS_DESCRIPT_ELEMENT + 3) & ~0x03]; - - /* General Statistics, count at Rx_handler or - * Tx_callback interrupt handler - */ - u64 GS_XMIT_OK; /* Good Frames Transmitted */ - u64 GS_RCV_OK; /* Good Frames Received */ - u32 GS_RCV_ERROR; /* Frames received with crc error */ - u32 GS_XMIT_ERROR; /* Bad Frames Transmitted */ - u32 GS_RCV_NO_BUFFER; /* Receive Buffer underrun */ - u32 GS_XMIT_ONE_COLLISION; /* one collision */ - u32 GS_XMIT_MORE_COLLISIONS;/* more collisions */ - - /* - * ================================================================ - * Statistics (no matter whether it had done successfully) -wkchen - * ================================================================ - */ - u32 _NumRxMSDU; - u32 _NumTxMSDU; - u32 _dot11WEPExcludedCount; - u32 _dot11WEPUndecryptableCount; - u32 _dot11FrameDuplicateCount; - - struct chan_info IbssChanSetting; /* 2B. Start IBSS Channel - * setting by registry or - * WWU. - */ - u8 reserved_5[2]; /* It may not be used after - * considering RF type, region - * and modulation type. - */ - - u8 reserved_6[2]; /* two variables are for wep - * key error detection - */ - u32 bWepKeyError; - u32 bToSelfPacketReceived; - u32 WepKeyDetectTimerCount; - - u16 SignalLostTh; - u16 SignalRoamTh; - - u8 IE_Append_data[MAX_IE_APPEND_SIZE]; - u16 IE_Append_size; - u16 reserved_7; -}; - -#endif diff --git a/drivers/staging/winbond/mac_structures.h b/drivers/staging/winbond/mac_structures.h deleted file mode 100644 index 76c63c74d50c..000000000000 --- a/drivers/staging/winbond/mac_structures.h +++ /dev/null @@ -1,71 +0,0 @@ -/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -// MAC_Structures.h -// -// This file contains the definitions and data structures used by SW-MAC. -// -// Revision Histoy -//================= -// 0.1 2002 UN00 -// 0.2 20021004 PD43 CCLiu6 -// 20021018 PD43 CCLiu6 -// Add enum_TxRate type -// Modify enum_STAState type -// 0.3 20021023 PE23 CYLiu update MAC session struct -// 20021108 -// 20021122 PD43 Austin -// Deleted some unused. -// 20021129 PD43 Austin -// 20030617 increase the 802.11g definition -//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - -#ifndef _MAC_Structures_H_ -#define _MAC_Structures_H_ - -#define MAC_ADDR_LENGTH 6 - -/* ======================================================== -// 802.11 Frame define -//----- */ -#define DOT_11_MAC_HEADER_SIZE 24 -#define DOT_11_SNAP_SIZE 6 -#define DOT_11_DURATION_OFFSET 2 -/* Sequence control offset */ -#define DOT_11_SEQUENCE_OFFSET 22 -/* The start offset of 802.11 Frame// */ -#define DOT_11_TYPE_OFFSET 30 -#define DOT_11_DATA_OFFSET 24 -#define DOT_11_DA_OFFSET 4 - -#define MAX_ETHERNET_PACKET_SIZE 1514 - -/* ----- management : Type of Bits (2, 3) and Subtype of Bits (4, 5, 6, 7) */ -#define MAC_SUBTYPE_MNGMNT_ASSOC_REQUEST 0x00 -#define MAC_SUBTYPE_MNGMNT_ASSOC_RESPONSE 0x10 -#define MAC_SUBTYPE_MNGMNT_REASSOC_REQUEST 0x20 -#define MAC_SUBTYPE_MNGMNT_REASSOC_RESPONSE 0x30 -#define MAC_SUBTYPE_MNGMNT_PROBE_REQUEST 0x40 -#define MAC_SUBTYPE_MNGMNT_PROBE_RESPONSE 0x50 -#define MAC_SUBTYPE_MNGMNT_BEACON 0x80 -#define MAC_SUBTYPE_MNGMNT_ATIM 0x90 -#define MAC_SUBTYPE_MNGMNT_DISASSOCIATION 0xA0 -#define MAC_SUBTYPE_MNGMNT_AUTHENTICATION 0xB0 -#define MAC_SUBTYPE_MNGMNT_DEAUTHENTICATION 0xC0 - -#define RATE_AUTO 0 -#define RATE_1M 2 -#define RATE_2M 4 -#define RATE_5dot5M 11 -#define RATE_6M 12 -#define RATE_9M 18 -#define RATE_11M 22 -#define RATE_12M 24 -#define RATE_18M 36 -#define RATE_22M 44 -#define RATE_24M 48 -#define RATE_33M 66 -#define RATE_36M 72 -#define RATE_48M 96 -#define RATE_54M 108 -#define RATE_MAX 255 - -#endif /* _MAC_Structure_H_ */ diff --git a/drivers/staging/winbond/mds.c b/drivers/staging/winbond/mds.c deleted file mode 100644 index aef0855f4c68..000000000000 --- a/drivers/staging/winbond/mds.c +++ /dev/null @@ -1,650 +0,0 @@ -#include "mds_f.h" -#include "mto.h" -#include "wbhal.h" -#include "wb35tx_f.h" - -unsigned char -Mds_initial(struct wbsoft_priv *adapter) -{ - struct wb35_mds *pMds = &adapter->Mds; - - pMds->TxPause = false; - pMds->TxRTSThreshold = DEFAULT_RTSThreshold; - pMds->TxFragmentThreshold = DEFAULT_FRAGMENT_THRESHOLD; - - return hal_get_tx_buffer(&adapter->sHwData, &pMds->pTxBuffer); -} - -static void Mds_DurationSet(struct wbsoft_priv *adapter, - struct wb35_descriptor *pDes, u8 *buffer) -{ - struct T00_descriptor *pT00; - struct T01_descriptor *pT01; - u16 Duration, NextBodyLen, OffsetSize; - u8 Rate, i; - unsigned char CTS_on = false, RTS_on = false; - struct T00_descriptor *pNextT00; - u16 BodyLen = 0; - unsigned char boGroupAddr = false; - - OffsetSize = pDes->FragmentThreshold + 32 + 3; - OffsetSize &= ~0x03; - Rate = pDes->TxRate >> 1; - if (!Rate) - Rate = 1; - - pT00 = (struct T00_descriptor *)buffer; - pT01 = (struct T01_descriptor *)(buffer+4); - pNextT00 = (struct T00_descriptor *)(buffer+OffsetSize); - - if (buffer[DOT_11_DA_OFFSET+8] & 0x1) /* +8 for USB hdr */ - boGroupAddr = true; - - /****************************************** - * Set RTS/CTS mechanism - ******************************************/ - if (!boGroupAddr) { - /* NOTE : If the protection mode is enabled and the MSDU will - * be fragmented, the tx rates of MPDUs will all be DSSS - * rates. So it will not use CTS-to-self in this case. - * CTS-To-self will only be used when without - * fragmentation. -- 20050112 */ - BodyLen = (u16)pT00->T00_frame_length; /* include 802.11 header */ - BodyLen += 4; /* CRC */ - - if (BodyLen >= CURRENT_RTS_THRESHOLD) - RTS_on = true; /* Using RTS */ - else { - if (pT01->T01_modulation_type) { /* Is using OFDM */ - /* Is using protect */ - if (CURRENT_PROTECT_MECHANISM) - CTS_on = true; /* Using CTS */ - } - } - } - - if (RTS_on || CTS_on) { - if (pT01->T01_modulation_type) { /* Is using OFDM */ - /* CTS duration - * 2 SIFS + DATA transmit time + 1 ACK - * ACK Rate : 24 Mega bps - * ACK frame length = 14 bytes */ - Duration = 2*DEFAULT_SIFSTIME + - 2*PREAMBLE_PLUS_SIGNAL_PLUS_SIGNALEXTENSION + - ((BodyLen*8 + 22 + Rate*4 - 1)/(Rate*4))*Tsym + - ((112 + 22 + 95)/96)*Tsym; - } else { /* DSSS */ - /* CTS duration - * 2 SIFS + DATA transmit time + 1 ACK - * Rate : ?? Mega bps - * ACK frame length = 14 bytes */ - if (pT01->T01_plcp_header_length) /* long preamble */ - Duration = LONG_PREAMBLE_PLUS_PLCPHEADER_TIME*2; - else - Duration = SHORT_PREAMBLE_PLUS_PLCPHEADER_TIME*2; - - Duration += (((BodyLen + 14)*8 + Rate-1) / Rate + - DEFAULT_SIFSTIME*2); - } - - if (RTS_on) { - if (pT01->T01_modulation_type) { /* Is using OFDM */ - /* CTS + 1 SIFS + CTS duration - * CTS Rate : 24 Mega bps - * CTS frame length = 14 bytes */ - Duration += (DEFAULT_SIFSTIME + - PREAMBLE_PLUS_SIGNAL_PLUS_SIGNALEXTENSION + - ((112 + 22 + 95)/96)*Tsym); - } else { - /* CTS + 1 SIFS + CTS duration - * CTS Rate : ?? Mega bps - * CTS frame length = 14 bytes - */ - /* long preamble */ - if (pT01->T01_plcp_header_length) - Duration += LONG_PREAMBLE_PLUS_PLCPHEADER_TIME; - else - Duration += SHORT_PREAMBLE_PLUS_PLCPHEADER_TIME; - - Duration += (((112 + Rate-1) / Rate) + - DEFAULT_SIFSTIME); - } - } - - /* Set the value into USB descriptor */ - pT01->T01_add_rts = RTS_on ? 1 : 0; - pT01->T01_add_cts = CTS_on ? 1 : 0; - pT01->T01_rts_cts_duration = Duration; - } - - /****************************************** - * Fill the more fragment descriptor - ******************************************/ - if (boGroupAddr) - Duration = 0; - else { - for (i = pDes->FragmentCount-1; i > 0; i--) { - NextBodyLen = (u16)pNextT00->T00_frame_length; - NextBodyLen += 4; /* CRC */ - - if (pT01->T01_modulation_type) { - /* OFDM - * data transmit time + 3 SIFS + 2 ACK - * Rate : ??Mega bps - * ACK frame length = 14 bytes, tx rate = 24M */ - Duration = PREAMBLE_PLUS_SIGNAL_PLUS_SIGNALEXTENSION * 3; - Duration += (((NextBodyLen*8 + 22 + Rate*4 - 1) - /(Rate*4)) * Tsym + - (((2*14)*8 + 22 + 95)/96)*Tsym + - DEFAULT_SIFSTIME*3); - } else { - /* DSSS - * data transmit time + 2 ACK + 3 SIFS - * Rate : ??Mega bps - * ACK frame length = 14 bytes - * TODO : */ - if (pT01->T01_plcp_header_length) /* long preamble */ - Duration = LONG_PREAMBLE_PLUS_PLCPHEADER_TIME*3; - else - Duration = SHORT_PREAMBLE_PLUS_PLCPHEADER_TIME*3; - - Duration += (((NextBodyLen + (2*14))*8 - + Rate-1) / Rate + - DEFAULT_SIFSTIME*3); - } - /* 4 USHOR for skip 8B USB, 2USHORT=FC + Duration */ - ((u16 *)buffer)[5] = cpu_to_le16(Duration); - - /* ----20061009 add by anson's endian */ - pNextT00->value = cpu_to_le32(pNextT00->value); - pT01->value = cpu_to_le32(pT01->value); - /* ----end 20061009 add by anson's endian */ - - buffer += OffsetSize; - pT01 = (struct T01_descriptor *)(buffer+4); - /* The last fragment will not have the next fragment */ - if (i != 1) - pNextT00 = (struct T00_descriptor *)(buffer+OffsetSize); - } - - /******************************************* - * Fill the last fragment descriptor - *******************************************/ - if (pT01->T01_modulation_type) { - /* OFDM - * 1 SIFS + 1 ACK - * Rate : 24 Mega bps - * ACK frame length = 14 bytes */ - Duration = PREAMBLE_PLUS_SIGNAL_PLUS_SIGNALEXTENSION; - /* The Tx rate of ACK use 24M */ - Duration += (((112 + 22 + 95)/96)*Tsym + - DEFAULT_SIFSTIME); - } else { - /* DSSS - * 1 ACK + 1 SIFS - * Rate : ?? Mega bps - * ACK frame length = 14 bytes(112 bits) */ - if (pT01->T01_plcp_header_length) /* long preamble */ - Duration = LONG_PREAMBLE_PLUS_PLCPHEADER_TIME; - else - Duration = SHORT_PREAMBLE_PLUS_PLCPHEADER_TIME; - - Duration += ((112 + Rate-1)/Rate + DEFAULT_SIFSTIME); - } - } - - /* 4 USHOR for skip 8B USB, 2USHORT=FC + Duration */ - ((u16 *)buffer)[5] = cpu_to_le16(Duration); - pT00->value = cpu_to_le32(pT00->value); - pT01->value = cpu_to_le32(pT01->value); - /* --end 20061009 add */ - -} - -/* The function return the 4n size of usb pk */ -static u16 Mds_BodyCopy(struct wbsoft_priv *adapter, - struct wb35_descriptor *pDes, u8 *TargetBuffer) -{ - struct T00_descriptor *pT00; - struct wb35_mds *pMds = &adapter->Mds; - u8 *buffer; - u8 *src_buffer; - u8 *pctmp; - u16 Size = 0; - u16 SizeLeft, CopySize, CopyLeft, stmp; - u8 buf_index, FragmentCount = 0; - - - /* Copy fragment body */ - buffer = TargetBuffer; /* shift 8B usb + 24B 802.11 */ - SizeLeft = pDes->buffer_total_size; - buf_index = pDes->buffer_start_index; - - pT00 = (struct T00_descriptor *)buffer; - while (SizeLeft) { - pT00 = (struct T00_descriptor *)buffer; - CopySize = SizeLeft; - if (SizeLeft > pDes->FragmentThreshold) { - CopySize = pDes->FragmentThreshold; - /* Set USB length */ - pT00->T00_frame_length = 24 + CopySize; - } else /* Set USB length */ - pT00->T00_frame_length = 24 + SizeLeft; - - SizeLeft -= CopySize; - - /* 1 Byte operation */ - pctmp = (u8 *)(buffer + 8 + DOT_11_SEQUENCE_OFFSET); - *pctmp &= 0xf0; - *pctmp |= FragmentCount; /* 931130.5.m */ - if (!FragmentCount) - pT00->T00_first_mpdu = 1; - - buffer += 32; /* 8B usb + 24B 802.11 header */ - Size += 32; - - /* Copy into buffer */ - stmp = CopySize + 3; - stmp &= ~0x03; /* 4n Alignment */ - Size += stmp; /* Current 4n offset of mpdu */ - - while (CopySize) { - /* Copy body */ - src_buffer = pDes->buffer_address[buf_index]; - CopyLeft = CopySize; - if (CopySize >= pDes->buffer_size[buf_index]) { - CopyLeft = pDes->buffer_size[buf_index]; - - /* Get the next buffer of descriptor */ - buf_index++; - buf_index %= MAX_DESCRIPTOR_BUFFER_INDEX; - } else { - u8 *pctmp = pDes->buffer_address[buf_index]; - pctmp += CopySize; - pDes->buffer_address[buf_index] = pctmp; - pDes->buffer_size[buf_index] -= CopySize; - } - - memcpy(buffer, src_buffer, CopyLeft); - buffer += CopyLeft; - CopySize -= CopyLeft; - } - - /* 931130.5.n */ - if (pMds->MicAdd) { - if (!SizeLeft) { - pMds->MicWriteAddress[pMds->MicWriteIndex] = - buffer - pMds->MicAdd; - pMds->MicWriteSize[pMds->MicWriteIndex] = - pMds->MicAdd; - pMds->MicAdd = 0; - } else if (SizeLeft < 8) { /* 931130.5.p */ - pMds->MicAdd = SizeLeft; - pMds->MicWriteAddress[pMds->MicWriteIndex] = - buffer - (8 - SizeLeft); - pMds->MicWriteSize[pMds->MicWriteIndex] = - 8 - SizeLeft; - pMds->MicWriteIndex++; - } - } - - /* Does it need to generate the new header for next mpdu? */ - if (SizeLeft) { - /* Get the next 4n start address */ - buffer = TargetBuffer + Size; - /* Copy 8B USB +24B 802.11 */ - memcpy(buffer, TargetBuffer, 32); - pT00 = (struct T00_descriptor *)buffer; - pT00->T00_first_mpdu = 0; - } - - FragmentCount++; - } - - pT00->T00_last_mpdu = 1; - pT00->T00_IsLastMpdu = 1; - buffer = (u8 *)pT00 + 8; /* +8 for USB hdr */ - buffer[1] &= ~0x04; /* Clear more frag bit of 802.11 frame control */ - /* Update the correct fragment number */ - pDes->FragmentCount = FragmentCount; - return Size; -} - -static void Mds_HeaderCopy(struct wbsoft_priv *adapter, - struct wb35_descriptor *pDes, u8 *TargetBuffer) -{ - struct wb35_mds *pMds = &adapter->Mds; - u8 *src_buffer = pDes->buffer_address[0]; /* 931130.5.g */ - struct T00_descriptor *pT00; - struct T01_descriptor *pT01; - u16 stmp; - u8 i, ctmp1, ctmp2, ctmpf; - u16 FragmentThreshold = CURRENT_FRAGMENT_THRESHOLD; - - - stmp = pDes->buffer_total_size; - /* - * Set USB header 8 byte - */ - pT00 = (struct T00_descriptor *)TargetBuffer; - TargetBuffer += 4; - pT01 = (struct T01_descriptor *)TargetBuffer; - TargetBuffer += 4; - - pT00->value = 0; /* Clear */ - pT01->value = 0; /* Clear */ - - pT00->T00_tx_packet_id = pDes->Descriptor_ID; /* Set packet ID */ - pT00->T00_header_length = 24; /* Set header length */ - pT01->T01_retry_abort_enable = 1; /* 921013 931130.5.h */ - - /* Key ID setup */ - pT01->T01_wep_id = 0; - - FragmentThreshold = DEFAULT_FRAGMENT_THRESHOLD; /* Do not fragment */ - /* Copy full data, the 1'st buffer contain all the data 931130.5.j */ - /* Copy header */ - memcpy(TargetBuffer, src_buffer, DOT_11_MAC_HEADER_SIZE); - pDes->buffer_address[0] = src_buffer + DOT_11_MAC_HEADER_SIZE; - pDes->buffer_total_size -= DOT_11_MAC_HEADER_SIZE; - pDes->buffer_size[0] = pDes->buffer_total_size; - - /* Set fragment threshold */ - FragmentThreshold -= (DOT_11_MAC_HEADER_SIZE + 4); - pDes->FragmentThreshold = FragmentThreshold; - - /* Set more frag bit */ - TargetBuffer[1] |= 0x04; /* Set more frag bit */ - - /* - * Set tx rate - */ - stmp = *(u16 *)(TargetBuffer+30); /* 2n alignment address */ - - /* Use basic rate */ - ctmp1 = ctmpf = CURRENT_TX_RATE_FOR_MNG; - - pDes->TxRate = ctmp1; - pr_debug("Tx rate =%x\n", ctmp1); - - pT01->T01_modulation_type = (ctmp1%3) ? 0 : |