aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/winbond
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--drivers/staging/winbond/Makefile2
-rw-r--r--drivers/staging/winbond/TODO2
-rw-r--r--drivers/staging/winbond/core.h43
-rw-r--r--drivers/staging/winbond/mac_structures.h17
-rw-r--r--drivers/staging/winbond/mds.c207
-rw-r--r--drivers/staging/winbond/mds_f.h2
-rw-r--r--drivers/staging/winbond/mds_s.h1
-rw-r--r--drivers/staging/winbond/mlme_s.h188
-rw-r--r--drivers/staging/winbond/mlmetxrx.c31
-rw-r--r--drivers/staging/winbond/mlmetxrx_f.h2
-rw-r--r--drivers/staging/winbond/phy_calibration.c20
-rw-r--r--drivers/staging/winbond/scan_s.h110
-rw-r--r--drivers/staging/winbond/wb35rx.c2
-rw-r--r--drivers/staging/winbond/wb35tx.c2
-rw-r--r--drivers/staging/winbond/wbhal_f.h10
-rw-r--r--drivers/staging/winbond/wbhal_s.h37
-rw-r--r--drivers/staging/winbond/wbusb.c21
17 files changed, 172 insertions, 525 deletions
diff --git a/drivers/staging/winbond/Makefile b/drivers/staging/winbond/Makefile
index fb2b7d432b43..79fa2271a0c1 100644
--- a/drivers/staging/winbond/Makefile
+++ b/drivers/staging/winbond/Makefile
@@ -1,4 +1,4 @@
-w35und-objs := \
+w35und-y := \
mds.o \
mlmetxrx.o \
mto.o \
diff --git a/drivers/staging/winbond/TODO b/drivers/staging/winbond/TODO
index 8c1baaf6d8ad..b4c592a96844 100644
--- a/drivers/staging/winbond/TODO
+++ b/drivers/staging/winbond/TODO
@@ -3,10 +3,10 @@ TODO:
- checkpatch cleanups
- kerneldoc cleanups
- fix severeCamelCaseInfestation
- - remove typedefs
- 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
index b87d6c07600f..2b87a0007319 100644
--- a/drivers/staging/winbond/core.h
+++ b/drivers/staging/winbond/core.h
@@ -2,39 +2,60 @@
#define __WINBOND_CORE_H
#include <linux/wireless.h>
+#include <linux/types.h>
-#include "mlme_s.h"
#include "wbhal_s.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 DataType;
+ u8 IsInUsed;
+
+ 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 {
- u32 adapterIndex; /* 20060703.4 Add for using padapterContext
- global adapter point */
-
struct wb_local_para sLocalPara; /* Myself connected
parameters */
- MLME_FRAME sMlmeFrame; /* connect to peerSTA 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;
- spinlock_t SpinLock;
-
atomic_t ThreadCount;
u32 RxByteCount;
u32 TxByteCount;
- struct sk_buff *packet_return;
- s32 netif_state_stop; /* 1: stop 0: normal */
- struct iw_statistics iw_stats;
-
u8 LinkName[WB_MAX_LINK_NAME_LEN];
bool enabled;
diff --git a/drivers/staging/winbond/mac_structures.h b/drivers/staging/winbond/mac_structures.h
index 415256f69c32..ed3df2964065 100644
--- a/drivers/staging/winbond/mac_structures.h
+++ b/drivers/staging/winbond/mac_structures.h
@@ -177,23 +177,6 @@ enum enum_MMPDUResultCode
} WB_MMPDURESULTCODE, *PWB_MMPDURESULTCODE;
*/
-/*===========================================================
-// enum_TxRate --
-// Define the transmission constants based on W89C32 MAC
-// target specification.
-//===========================================================*/
-typedef enum enum_TxRate {
- TXRATE_1M = 0,
- TXRATE_2MLONG = 2,
- TXRATE_2MSHORT = 3,
- TXRATE_55MLONG = 4,
- TXRATE_55MSHORT = 5,
- TXRATE_11MLONG = 6,
- TXRATE_11MSHORT = 7,
- TXRATE_AUTO = 255 /* PD43 20021108 */
-} WB_TXRATE, *PWB_TXRATE;
-
-
#define RATE_BITMAP_1M 1
#define RATE_BITMAP_2M 2
#define RATE_BITMAP_5dot5M 5
diff --git a/drivers/staging/winbond/mds.c b/drivers/staging/winbond/mds.c
index e8320a6f59af..9217762b1814 100644
--- a/drivers/staging/winbond/mds.c
+++ b/drivers/staging/winbond/mds.c
@@ -14,7 +14,7 @@ Mds_initial(struct wbsoft_priv *adapter)
pMds->TxRTSThreshold = DEFAULT_RTSThreshold;
pMds->TxFragmentThreshold = DEFAULT_FRAGMENT_THRESHOLD;
- return hal_get_tx_buffer( &adapter->sHwData, &pMds->pTxBuffer );
+ return hal_get_tx_buffer(&adapter->sHwData, &pMds->pTxBuffer);
}
void
@@ -24,12 +24,12 @@ Mds_Destroy(struct wbsoft_priv *adapter)
static void Mds_DurationSet(struct wbsoft_priv *adapter, struct wb35_descriptor *pDes, u8 *buffer)
{
- PT00_DESCRIPTOR pT00;
- PT01_DESCRIPTOR pT01;
+ struct T00_descriptor *pT00;
+ struct T01_descriptor *pT01;
u16 Duration, NextBodyLen, OffsetSize;
u8 Rate, i;
unsigned char CTS_on = false, RTS_on = false;
- PT00_DESCRIPTOR pNextT00;
+ struct T00_descriptor *pNextT00;
u16 BodyLen = 0;
unsigned char boGroupAddr = false;
@@ -39,18 +39,17 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter, struct wb35_descriptor
if (!Rate)
Rate = 1;
- pT00 = (PT00_DESCRIPTOR)buffer;
- pT01 = (PT01_DESCRIPTOR)(buffer+4);
- pNextT00 = (PT00_DESCRIPTOR)(buffer+OffsetSize);
+ 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 */
+ if (buffer[DOT_11_DA_OFFSET+8] & 0x1) /* +8 for USB hdr */
boGroupAddr = true;
/******************************************
* Set RTS/CTS mechanism
******************************************/
- if (!boGroupAddr)
- {
+ 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
@@ -58,23 +57,19 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter, struct wb35_descriptor
BodyLen = (u16)pT00->T00_frame_length; /* include 802.11 header */
BodyLen += 4; /* CRC */
- if( BodyLen >= CURRENT_RTS_THRESHOLD )
+ if (BodyLen >= CURRENT_RTS_THRESHOLD)
RTS_on = true; /* Using RTS */
- else
- {
- if( pT01->T01_modulation_type ) /* Is using OFDM */
- {
- if( CURRENT_PROTECT_MECHANISM ) /* Is using protect */
+ else {
+ if (pT01->T01_modulation_type) { /* Is using OFDM */
+ if (CURRENT_PROTECT_MECHANISM) /* Is using protect */
CTS_on = true; /* Using CTS */
}
}
}
- if( RTS_on || CTS_on )
- {
- if( pT01->T01_modulation_type) /* Is using OFDM */
- {
- /* CTS duration
+ 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 */
@@ -82,44 +77,38 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter, struct wb35_descriptor
2*PREAMBLE_PLUS_SIGNAL_PLUS_SIGNALEXTENSION +
((BodyLen*8 + 22 + Rate*4 - 1)/(Rate*4))*Tsym +
((112 + 22 + 95)/96)*Tsym;
- }
- else /* DSSS */
- {
+ } 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 */
+ 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 );
+ Duration += (((BodyLen + 14)*8 + Rate-1) / Rate +
+ DEFAULT_SIFSTIME*2);
}
- if( RTS_on )
- {
- if( pT01->T01_modulation_type ) /* Is using OFDM */
- {
+ 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
- {
+ } else {
/* CTS + 1 SIFS + CTS duration
* CTS Rate : ?? Mega bps
* CTS frame length = 14 bytes */
- if( pT01->T01_plcp_header_length ) /* long preamble */
+ 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 );
+ Duration += (((112 + Rate-1) / Rate) + DEFAULT_SIFSTIME);
}
}
@@ -132,17 +121,14 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter, struct wb35_descriptor
/******************************************
* Fill the more fragment descriptor
******************************************/
- if( boGroupAddr )
+ if (boGroupAddr)
Duration = 0;
- else
- {
- for( i=pDes->FragmentCount-1; i>0; i-- )
- {
+ else {
+ for (i = pDes->FragmentCount-1; i > 0; i--) {
NextBodyLen = (u16)pNextT00->T00_frame_length;
NextBodyLen += 4; /* CRC */
- if( pT01->T01_modulation_type )
- {
+ if (pT01->T01_modulation_type) {
/* OFDM
* data transmit time + 3 SIFS + 2 ACK
* Rate : ??Mega bps
@@ -151,61 +137,56 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter, struct wb35_descriptor
Duration += (((NextBodyLen*8 + 22 + Rate*4 - 1)/(Rate*4)) * Tsym +
(((2*14)*8 + 22 + 95)/96)*Tsym +
DEFAULT_SIFSTIME*3);
- }
- else
- {
+ } 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 */
+ 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 );
+ Duration += (((NextBodyLen + (2*14))*8 + Rate-1) / Rate +
+ DEFAULT_SIFSTIME*3);
}
((u16 *)buffer)[5] = cpu_to_le16(Duration); /* 4 USHOR for skip 8B USB, 2USHORT=FC + Duration */
/* ----20061009 add by anson's endian */
pNextT00->value = cpu_to_le32(pNextT00->value);
- pT01->value = cpu_to_le32( pT01->value );
+ pT01->value = cpu_to_le32(pT01->value);
/* ----end 20061009 add by anson's endian */
buffer += OffsetSize;
- pT01 = (PT01_DESCRIPTOR)(buffer+4);
+ pT01 = (struct T01_descriptor *)(buffer+4);
if (i != 1) /* The last fragment will not have the next fragment */
- pNextT00 = (PT00_DESCRIPTOR)(buffer+OffsetSize);
+ pNextT00 = (struct T00_descriptor *)(buffer+OffsetSize);
}
/*******************************************
* Fill the last fragment descriptor
*******************************************/
- if( pT01->T01_modulation_type )
- {
+ 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
- {
+ 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 */
+ 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 );
+ Duration += ((112 + Rate-1)/Rate + DEFAULT_SIFSTIME);
}
}
@@ -219,7 +200,7 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter, struct wb35_descriptor
/* The function return the 4n size of usb pk */
static u16 Mds_BodyCopy(struct wbsoft_priv *adapter, struct wb35_descriptor *pDes, u8 *TargetBuffer)
{
- PT00_DESCRIPTOR pT00;
+ struct T00_descriptor *pT00;
struct wb35_mds *pMds = &adapter->Mds;
u8 *buffer;
u8 *src_buffer;
@@ -234,9 +215,9 @@ static u16 Mds_BodyCopy(struct wbsoft_priv *adapter, struct wb35_descriptor *pDe
SizeLeft = pDes->buffer_total_size;
buf_index = pDes->buffer_start_index;
- pT00 = (PT00_DESCRIPTOR)buffer;
+ pT00 = (struct T00_descriptor *)buffer;
while (SizeLeft) {
- pT00 = (PT00_DESCRIPTOR)buffer;
+ pT00 = (struct T00_descriptor *)buffer;
CopySize = SizeLeft;
if (SizeLeft > pDes->FragmentThreshold) {
CopySize = pDes->FragmentThreshold;
@@ -247,10 +228,10 @@ static u16 Mds_BodyCopy(struct wbsoft_priv *adapter, struct wb35_descriptor *pDe
SizeLeft -= CopySize;
/* 1 Byte operation */
- pctmp = (u8 *)( buffer + 8 + DOT_11_SEQUENCE_OFFSET );
+ pctmp = (u8 *)(buffer + 8 + DOT_11_SEQUENCE_OFFSET);
*pctmp &= 0xf0;
*pctmp |= FragmentCount; /* 931130.5.m */
- if( !FragmentCount )
+ if (!FragmentCount)
pT00->T00_first_mpdu = 1;
buffer += 32; /* 8B usb + 24B 802.11 header */
@@ -286,15 +267,13 @@ static u16 Mds_BodyCopy(struct wbsoft_priv *adapter, struct wb35_descriptor *pDe
/* 931130.5.n */
if (pMds->MicAdd) {
if (!SizeLeft) {
- pMds->MicWriteAddress[ pMds->MicWriteIndex ] = buffer - pMds->MicAdd;
- pMds->MicWriteSize[ pMds->MicWriteIndex ] = pMds->MicAdd;
+ pMds->MicWriteAddress[pMds->MicWriteIndex] = buffer - pMds->MicAdd;
+ pMds->MicWriteSize[pMds->MicWriteIndex] = pMds->MicAdd;
pMds->MicAdd = 0;
- }
- else if( SizeLeft < 8 ) /* 931130.5.p */
- {
+ } else if (SizeLeft < 8) { /* 931130.5.p */
pMds->MicAdd = SizeLeft;
- pMds->MicWriteAddress[ pMds->MicWriteIndex ] = buffer - ( 8 - SizeLeft );
- pMds->MicWriteSize[ pMds->MicWriteIndex ] = 8 - SizeLeft;
+ pMds->MicWriteAddress[pMds->MicWriteIndex] = buffer - (8 - SizeLeft);
+ pMds->MicWriteSize[pMds->MicWriteIndex] = 8 - SizeLeft;
pMds->MicWriteIndex++;
}
}
@@ -302,8 +281,8 @@ static u16 Mds_BodyCopy(struct wbsoft_priv *adapter, struct wb35_descriptor *pDe
/* Does it need to generate the new header for next mpdu? */
if (SizeLeft) {
buffer = TargetBuffer + Size; /* Get the next 4n start address */
- memcpy( buffer, TargetBuffer, 32 ); /* Copy 8B USB +24B 802.11 */
- pT00 = (PT00_DESCRIPTOR)buffer;
+ memcpy(buffer, TargetBuffer, 32); /* Copy 8B USB +24B 802.11 */
+ pT00 = (struct T00_descriptor *)buffer;
pT00->T00_first_mpdu = 0;
}
@@ -322,8 +301,8 @@ static void Mds_HeaderCopy(struct wbsoft_priv *adapter, struct wb35_descriptor *
{
struct wb35_mds *pMds = &adapter->Mds;
u8 *src_buffer = pDes->buffer_address[0]; /* 931130.5.g */
- PT00_DESCRIPTOR pT00;
- PT01_DESCRIPTOR pT01;
+ struct T00_descriptor *pT00;
+ struct T01_descriptor *pT01;
u16 stmp;
u8 i, ctmp1, ctmp2, ctmpf;
u16 FragmentThreshold = CURRENT_FRAGMENT_THRESHOLD;
@@ -333,9 +312,9 @@ static void Mds_HeaderCopy(struct wbsoft_priv *adapter, struct wb35_descriptor *
/*
* Set USB header 8 byte
*/
- pT00 = (PT00_DESCRIPTOR)TargetBuffer;
+ pT00 = (struct T00_descriptor *)TargetBuffer;
TargetBuffer += 4;
- pT01 = (PT01_DESCRIPTOR)TargetBuffer;
+ pT01 = (struct T01_descriptor *)TargetBuffer;
TargetBuffer += 4;
pT00->value = 0; /* Clear */
@@ -350,7 +329,7 @@ static void Mds_HeaderCopy(struct wbsoft_priv *adapter, struct wb35_descriptor *
FragmentThreshold = DEFAULT_FRAGMENT_THRESHOLD; /* Do not fragment */
/* Copy full data, the 1'st buffer contain all the data 931130.5.j */
- memcpy( TargetBuffer, src_buffer, DOT_11_MAC_HEADER_SIZE ); /* Copy header */
+ memcpy(TargetBuffer, src_buffer, DOT_11_MAC_HEADER_SIZE); /* Copy header */
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;
@@ -377,26 +356,38 @@ static void Mds_HeaderCopy(struct wbsoft_priv *adapter, struct wb35_descriptor *
pT01->T01_modulation_type = (ctmp1%3) ? 0 : 1;
- for( i=0; i<2; i++ ) {
- if( i == 1 )
+ for (i = 0; i < 2; i++) {
+ if (i == 1)
ctmp1 = ctmpf;
pMds->TxRate[pDes->Descriptor_ID][i] = ctmp1; /* backup the ta rate and fall back rate */
- if( ctmp1 == 108) ctmp2 = 7;
- else if( ctmp1 == 96 ) ctmp2 = 6; /* Rate convert for USB */
- else if( ctmp1 == 72 ) ctmp2 = 5;
- else if( ctmp1 == 48 ) ctmp2 = 4;
- else if( ctmp1 == 36 ) ctmp2 = 3;
- else if( ctmp1 == 24 ) ctmp2 = 2;
- else if( ctmp1 == 18 ) ctmp2 = 1;
- else if( ctmp1 == 12 ) ctmp2 = 0;
- else if( ctmp1 == 22 ) ctmp2 = 3;
- else if( ctmp1 == 11 ) ctmp2 = 2;
- else if( ctmp1 == 4 ) ctmp2 = 1;
- else ctmp2 = 0; /* if( ctmp1 == 2 ) or default */
-
- if( i == 0 )
+ if (ctmp1 == 108)
+ ctmp2 = 7;
+ else if (ctmp1 == 96)
+ ctmp2 = 6; /* Rate convert for USB */
+ else if (ctmp1 == 72)
+ ctmp2 = 5;
+ else if (ctmp1 == 48)
+ ctmp2 = 4;
+ else if (ctmp1 == 36)
+ ctmp2 = 3;
+ else if (ctmp1 == 24)
+ ctmp2 = 2;
+ else if (ctmp1 == 18)
+ ctmp2 = 1;
+ else if (ctmp1 == 12)
+ ctmp2 = 0;
+ else if (ctmp1 == 22)
+ ctmp2 = 3;
+ else if (ctmp1 == 11)
+ ctmp2 = 2;
+ else if (ctmp1 == 4)
+ ctmp2 = 1;
+ else
+ ctmp2 = 0; /* if( ctmp1 == 2 ) or default */
+
+ if (i == 0)
pT01->T01_transmit_rate = ctmp2;
else
pT01->T01_fall_back_rate = ctmp2;
@@ -474,14 +465,14 @@ Mds_Tx(struct wbsoft_priv *adapter)
TxDesIndex = pMds->TxDesIndex; /* Get the current ID */
pTxDes->Descriptor_ID = TxDesIndex;
- pMds->TxDesFrom[ TxDesIndex ] = 2; /* Storing the information of source comming from */
+ pMds->TxDesFrom[TxDesIndex] = 2; /* Storing the information of source comming from */
pMds->TxDesIndex++;
pMds->TxDesIndex %= MAX_USB_TX_DESCRIPTOR;
- MLME_GetNextPacket( adapter, pTxDes );
+ MLME_GetNextPacket(adapter, pTxDes);
/* Copy header. 8byte USB + 24byte 802.11Hdr. Set TxRate, Preamble type */
- Mds_HeaderCopy( adapter, pTxDes, XmitBufAddress );
+ Mds_HeaderCopy(adapter, pTxDes, XmitBufAddress);
/* For speed up Key setting */
if (pTxDes->EapFix) {
@@ -502,7 +493,7 @@ Mds_Tx(struct wbsoft_priv *adapter)
XmitBufAddress += CurrentSize;
#ifdef _IBSS_BEACON_SEQ_STICK_
- if ((XmitBufAddress[ DOT_11_DA_OFFSET+8 ] & 0xfc) != MAC_SUBTYPE_MNGMNT_PROBE_REQUEST) /* +8 for USB hdr */
+ if ((XmitBufAddress[DOT_11_DA_OFFSET+8] & 0xfc) != MAC_SUBTYPE_MNGMNT_PROBE_REQUEST) /* +8 for USB hdr */
#endif
pMds->TxToggle = true;
@@ -520,7 +511,7 @@ Mds_Tx(struct wbsoft_priv *adapter)
/* Move to the next one, if necessary */
if (BufferFilled) {
/* size setting */
- pMds->TxBufferSize[ FillIndex ] = XmitBufSize;
+ pMds->TxBufferSize[FillIndex] = XmitBufSize;
/* 20060928 set Tx count */
pMds->TxCountInBuffer[FillIndex] = FillCount;
@@ -537,7 +528,7 @@ Mds_Tx(struct wbsoft_priv *adapter)
if (!PacketSize) /* No more pk for transmitting */
break;
- } while(true);
+ } while (true);
/*
* Start to send by lower module
@@ -545,12 +536,12 @@ Mds_Tx(struct wbsoft_priv *adapter)
if (!pHwData->IsKeyPreSet)
Wb35Tx_start(adapter);
- cleanup:
- atomic_dec(&pMds->TxThreadCount);
+cleanup:
+ atomic_dec(&pMds->TxThreadCount);
}
void
-Mds_SendComplete(struct wbsoft_priv *adapter, PT02_DESCRIPTOR pT02)
+Mds_SendComplete(struct wbsoft_priv *adapter, struct T02_descriptor *pT02)
{
struct wb35_mds *pMds = &adapter->Mds;
struct hw_data *pHwData = &adapter->sHwData;
@@ -563,7 +554,7 @@ Mds_SendComplete(struct wbsoft_priv *adapter, PT02_DESCRIPTOR pT02)
if (pT02->T02_IsLastMpdu) {
/* TODO: DTO -- get the retry count and fragment count */
/* Tx rate */
- TxRate = pMds->TxRate[ PacketId ][ 0 ];
+ TxRate = pMds->TxRate[PacketId][0];
RetryCount = (u8)pT02->T02_MPDU_Cnt;
if (pT02->value & FLAG_ERROR_TX_MASK) {
SendOK = false;
@@ -572,7 +563,7 @@ Mds_SendComplete(struct wbsoft_priv *adapter, PT02_DESCRIPTOR pT02)
/* retry error */
pHwData->dto_tx_retry_count += (RetryCount+1);
/* [for tx debug] */
- if (RetryCount<7)
+ if (RetryCount < 7)
pHwData->tx_retry_count[RetryCount] += RetryCount;
else
pHwData->tx_retry_count[7] += RetryCount;
@@ -597,7 +588,7 @@ Mds_SendComplete(struct wbsoft_priv *adapter, PT02_DESCRIPTOR pT02)
}
/* Clear send result buffer */
- pMds->TxResult[ PacketId ] = 0;
+ pMds->TxResult[PacketId] = 0;
} else
- pMds->TxResult[ PacketId ] |= ((u16)(pT02->value & 0x0ffff));
+ pMds->TxResult[PacketId] |= ((u16)(pT02->value & 0x0ffff));
}
diff --git a/drivers/staging/winbond/mds_f.h b/drivers/staging/winbond/mds_f.h
index 20e97bfe01e9..7f68deae6d04 100644
--- a/drivers/staging/winbond/mds_f.h
+++ b/drivers/staging/winbond/mds_f.h
@@ -7,7 +7,7 @@
unsigned char Mds_initial(struct wbsoft_priv *adapter);
void Mds_Destroy(struct wbsoft_priv *adapter);
void Mds_Tx(struct wbsoft_priv *adapter);
-void Mds_SendComplete(struct wbsoft_priv *adapter, PT02_DESCRIPTOR pt02);
+void Mds_SendComplete(struct wbsoft_priv *adapter, struct T02_descriptor *pt02);
void Mds_MpduProcess(struct wbsoft_priv *adapter, struct wb35_descriptor *prxdes);
extern void DataDmp(u8 *pdata, u32 len, u32 offset);
diff --git a/drivers/staging/winbond/mds_s.h b/drivers/staging/winbond/mds_s.h
index 89328c5dbdad..e2de4bd23b4d 100644
--- a/drivers/staging/winbond/mds_s.h
+++ b/drivers/staging/winbond/mds_s.h
@@ -7,7 +7,6 @@
#include "localpara.h"
#include "mac_structures.h"
-#include "scan_s.h"
/* Preamble_Type, see <SFS-802.11G-MIB-203> */
enum {
diff --git a/drivers/staging/winbond/mlme_s.h b/drivers/staging/winbond/mlme_s.h
deleted file mode 100644
index a7ef3c78022e..000000000000
--- a/drivers/staging/winbond/mlme_s.h
+++ /dev/null
@@ -1,188 +0,0 @@
-#ifndef __WINBOND_MLME_H
-#define __WINBOND_MLME_H
-
-#include <linux/types.h>
-#include <linux/spinlock.h>
-
-#include "mac_structures.h"
-#include "mds_s.h"
-
-/*
- * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- * Mlme.h
- * Define the related definitions of MLME module
- *
- * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- */
-
-#define AUTH_REJECT_REASON_CHALLENGE_FAIL 1
-
-/* the state of MLME module */
-#define INACTIVE 0x0
-#define IDLE_SCAN 0x1
-
-/* the state of MLME/ESS module */
-#define STATE_1 0x2
-#define AUTH_REQ 0x3
-#define AUTH_WEP 0x4
-#define STATE_2 0x5
-#define ASSOC_REQ 0x6
-#define STATE_3 0x7
-
-/* the state of MLME/IBSS module */
-#define IBSS_JOIN_SYNC 0x8
-#define IBSS_AUTH_REQ 0x9
-#define IBSS_AUTH_CHANLGE 0xa
-#define IBSS_AUTH_WEP 0xb
-#define IBSS_AUTH_IND 0xc
-#define IBSS_STATE_2 0xd
-
-
-
-/*
- * =========================================
- * depend on D5C(MAC timing control 03 register):
- * MaxTxMSDULifeTime default 0x80000us
- */
-#define AUTH_FAIL_TIMEOUT 550
-#define ASSOC_FAIL_TIMEOUT 550
-#define REASSOC_FAIL_TIMEOUT 550
-
-/* MLME task global CONSTANTS, STRUCTURE, variables */
-
-/* =========================================
- * enum_ResultCode --
- * Result code returned from MLME to SME.
- * =========================================
- */
-#define MLME_SUCCESS 0 /* follow spec. */
-#define INVALID_PARAMETERS 1 /* Not following spec. */
-#define NOT_SUPPPORTED 2
-#define TIMEOUT 3
-#define TOO_MANY_SIMULTANEOUS_REQUESTS 4
-#define REFUSED 5
-#define BSS_ALREADY_STARTED_OR_JOINED 6
-#define TRANSMIT_FRAME_FAIL 7
-#define NO_BSS_FOUND 8
-#define RETRY 9
-#define GIVE_UP 10
-
-
-#define OPEN_AUTH 0
-#define SHARE_AUTH 1
-#define ANY_AUTH 2
-#define WPA_AUTH 3 /* for WPA */
-#define WPAPSK_AUTH 4
-#define WPANONE_AUTH 5
-#ifdef _WPA2_
-#define WPA2_AUTH 6 /* for WPA2 */
-#define WPA2PSK_AUTH 7
-#endif /* end def _WPA2_ */
-
-/*
- * =========================================
- * define the msg type of MLME module
- * =========================================
- */
-
-/* from SME */
-#define MLMEMSG_AUTH_REQ 0x0b
-#define MLMEMSG_DEAUTH_REQ 0x0c
-#define MLMEMSG_ASSOC_REQ 0x0d
-#define MLMEMSG_REASSOC_REQ 0x0e
-#define MLMEMSG_DISASSOC_REQ 0x0f
-#define MLMEMSG_START_IBSS_REQ 0x10
-#define MLMEMSG_IBSS_NET_CFM 0x11
-
-/* from RX */
-#define MLMEMSG_RCV_MLMEFRAME 0x20
-#define MLMEMSG_RCV_ASSOCRSP 0x22
-#define MLMEMSG_RCV_REASSOCRSP 0x24
-#define MLMEMSG_RCV_DISASSOC 0x2b
-#define MLMEMSG_RCV_AUTH 0x2c
-#define MLMEMSG_RCV_DEAUTH 0x2d
-
-
-/* from TX callback */
-#define MLMEMSG_TX_CALLBACK 0x40
-#define MLMEMSG_ASSOCREQ_CALLBACK 0x41
-#define MLMEMSG_REASSOCREQ_CALLBACK 0x43
-#define MLMEMSG_DISASSOC_CALLBACK 0x4a
-#define MLMEMSG_AUTH_CALLBACK 0x4c
-#define MLMEMSG_DEAUTH_CALLBACK 0x4d
-
-#define MLMEMSG_TIMEOUT 0x50
-
-/*
- * ==============================================
- * Global data structures
- * ==============================================
- */
-#define MAX_NUM_TX_MMPDU 2
-#define MAX_MMPDU_SIZE 1512
-#define MAX_NUM_RX_MMPDU 6
-
-
-/*
- * ==============================================
- * MACRO
- * ==============================================
- */
-#define boMLME_InactiveState(_AA_) (_AA_->wState == INACTIVE)
-#define boMLME_IdleScanState(_BB_) (_BB_->wState == IDLE_SCAN)
-#define boMLME_FoundSTAinfo(_CC_) (_CC_->wState >= IDLE_SCAN)
-
-typedef struct _MLME_FRAME {
- s8 *pMMPDU;
- u16 len;
- u8 DataType;
- u8 IsInUsed;
-
- spinlock_t MLMESpinLock;
-
- 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 */
-} MLME_FRAME, *psMLME_FRAME;
-
-typedef struct _AUTHREQ {
-
- u8 peerMACaddr[MAC_ADDR_LENGTH];
- u16 wAuthAlgorithm;
-} MLME_AUTHREQ_PARA, *psMLME_AUTHREQ_PARA;
-
-typedef struct _ASSOCREQ {
- u8 PeerSTAAddr[MAC_ADDR_LENGTH];
- u16 CapabilityInfo;
- u16 ListenInterval;
-} __attribute__ ((packed)) MLME_ASSOCREQ_PARA, *psMLME_ASSOCREQ_PARA;
-
-typedef struct _REASSOCREQ {
- u8 NewAPAddr[MAC_ADDR_LENGTH];
- u16 CapabilityInfo;
- u16 ListenInterval;
-} __attribute__ ((packed)) MLME_REASSOCREQ_PARA, *psMLME_REASSOCREQ_PARA;
-
-typedef struct _MLMECALLBACK {
- u8 *psFramePtr;
- u8 bResult;
-} MLME_TXCALLBACK, *psMLME_TXCALLBACK;
-
-typedef struct _RXDATA {
- s32 FrameLength;
- u8 __attribute__ ((packed)) *pbFramePtr;
-} __attribute__ ((packed)) RXDATA, *psRXDATA;
-
-#endif
diff --git a/drivers/staging/winbond/mlmetxrx.c b/drivers/staging/winbond/mlmetxrx.c
index dcd8a11b5d03..7425a23f12e8 100644
--- a/drivers/staging/winbond/mlmetxrx.c
+++ b/drivers/staging/winbond/mlmetxrx.c
@@ -19,32 +19,6 @@
#include "mds_f.h"
-/* ============================================================================= */
-u8 MLMESendFrame(struct wbsoft_priv *adapter, u8 *pMMPDU, u16 len, u8 DataType)
-/* DataType : FRAME_TYPE_802_11_MANAGEMENT, FRAME_TYPE_802_11_MANAGEMENT_CHALLENGE,
- FRAME_TYPE_802_11_DATA */
-{
- if (adapter->sMlmeFrame.IsInUsed != PACKET_FREE_TO_USE) {
- adapter->sMlmeFrame.wNumTxMMPDUDiscarded++;
- return false;
- }
- adapter->sMlmeFrame.IsInUsed = PACKET_COME_FROM_MLME;
-
- /* Keep information for sending */
- adapter->sMlmeFrame.pMMPDU = pMMPDU;
- adapter->sMlmeFrame.DataType = DataType;
- /* len must be the last setting due to QUERY_SIZE_SECOND of Mds */
- adapter->sMlmeFrame.len = len;
- adapter->sMlmeFrame.wNumTxMMPDU++;
-
- /* H/W will enter power save by set the register. S/W don't send null frame
- with PWRMgt bit enbled to enter power save now. */
-
- /* Transmit NDIS packet */
- Mds_Tx(adapter);
- return true;
-}
-
void MLME_GetNextPacket(struct wbsoft_priv *adapter, struct wb35_descriptor *desc)
{
desc->InternalUsed = desc->buffer_start_index + desc->buffer_number;
@@ -76,15 +50,10 @@ static void MLMEfreeMMPDUBuffer(struct wbsoft_priv *adapter, s8 *pData)
void
MLME_SendComplete(struct wbsoft_priv *adapter, u8 PacketID, unsigned char SendOK)
{
- MLME_TXCALLBACK TxCallback;
-
/* Reclaim the data buffer */
adapter->sMlmeFrame.len = 0;
MLMEfreeMMPDUBuffer(adapter, adapter->sMlmeFrame.pMMPDU);
-
- TxCallback.bResult = MLME_SUCCESS;
-
/* Return resource */
adapter->sMlmeFrame.IsInUsed = PACKET_FREE_TO_USE;
}
diff --git a/drivers/staging/winbond/mlmetxrx_f.h b/drivers/staging/winbond/mlmetxrx_f.h
index d1aa2617d24b..012507fc49e3 100644
--- a/drivers/staging/winbond/mlmetxrx_f.h
+++ b/drivers/staging/winbond/mlmetxrx_f.h
@@ -11,8 +11,6 @@
#include "core.h"
void MLME_GetNextPacket(struct wbsoft_priv *adapter, struct wb35_descriptor *pDes);
-u8 MLMESendFrame(struct wbsoft_priv *adapter,
- u8 *pMMPDU, u16 len, u8 DataType);
void
MLME_SendComplete(struct wbsoft_priv *adapter, u8 PacketID,
diff --git a/drivers/staging/winbond/phy_calibration.c b/drivers/staging/winbond/phy_calibration.c
index 5c1f05392db9..2b375ba3812a 100644
--- a/drivers/staging/winbond/phy_calibration.c
+++ b/drivers/staging/winbond/phy_calibration.c
@@ -1132,18 +1132,6 @@ u8 _rx_iq_calibration_loop_winbond(struct hw_data *phw_data, u16 factor, u32 fre
PHY_DEBUG(("[CAL] -> [5]_rx_iq_calibration_loop()\n"));
PHY_DEBUG(("[CAL] ** factor = %d\n", factor));
-
-/* RF Control Override */
- hw_get_cxx_reg(phw_data, 0x80, &val);
- val |= BIT(19);
- hw_set_cxx_reg(phw_data, 0x80, val);
-
-/* RF_Ctrl */
- hw_get_cxx_reg(phw_data, 0xE4, &val);
- val |= BIT(0);
- hw_set_cxx_reg(phw_data, 0xE4, val);
- PHY_DEBUG(("[CAL] ** RF_CTRL(0xE4) = 0x%08X", val));
-
hw_set_dxx_reg(phw_data, 0x58, 0x44444444); /* IQ_Alpha */
/* b. */
@@ -1461,13 +1449,8 @@ void phy_calibration_winbond(struct hw_data *phw_data, u32 frequency)
PHY_DEBUG(("[CAL] -> phy_calibration_winbond()\n"));
- /* 20040701 1.1.25.1000 kevin */
- hw_get_cxx_reg(phw_data, 0x80, &mac_ctrl);
- hw_get_cxx_reg(phw_data, 0xE4, &rf_ctrl);
hw_get_dxx_reg(phw_data, 0x58, &iq_alpha);
-
-
_rxadc_dc_offset_cancellation_winbond(phw_data, frequency);
/* _txidac_dc_offset_cancellation_winbond(phw_data); */
/* _txqdac_dc_offset_cacellation_winbond(phw_data); */
@@ -1482,11 +1465,8 @@ void phy_calibration_winbond(struct hw_data *phw_data, u32 frequency)
PHY_DEBUG(("[CAL] MODE_CTRL (write) = 0x%08X\n", reg_mode_ctrl));
/* i. Set RFIC to "Normal mode" */
- hw_set_cxx_reg(phw_data, 0x80, mac_ctrl);
- hw_set_cxx_reg(phw_data, 0xE4, rf_ctrl);
hw_set_dxx_reg(phw_data, 0x58, iq_alpha);
-
/*********************************************************************/
phy_init_rf(phw_data);
diff --git a/drivers/staging/winbond/scan_s.h b/drivers/staging/winbond/scan_s.h
deleted file mode 100644
index 85e7523196d0..000000000000
--- a/drivers/staging/winbond/scan_s.h
+++ /dev/null
@@ -1,110 +0,0 @@
-#ifndef __WINBOND_SCAN_S_H
-#define __WINBOND_SCAN_S_H
-
-#include <linux/types.h>
-#include "localpara.h"
-
-/*
- * SCAN task global CONSTANTS, STRUCTURES, variables
- */
-
-/* define the msg type of SCAN module */
-#define SCANMSG_SCAN_REQ 0x01
-#define SCANMSG_BEACON 0x02
-#define SCANMSG_PROBE_RESPONSE 0x03
-#define SCANMSG_TIMEOUT 0x04
-#define SCANMSG_TXPROBE_FAIL 0x05
-#define SCANMSG_ENABLE_BGSCAN 0x06
-#define SCANMSG_STOP_SCAN 0x07
-
-/*
- * BSS Type =>conform to
- * IBSS : ToDS/FromDS = 00
- * Infrastructure : ToDS/FromDS = 01
- */
-#define IBSS_NET 0
-#define ESS_NET 1
-#define ANYBSS_NET 2
-
-/* Scan Type */
-#define ACTIVE_SCAN 0
-#define PASSIVE_SCAN 1
-
-/* Global data structures, Initial Scan & Background Scan */
-typedef struct _SCAN_REQ_PARA { /* mandatory parameters for SCAN request */
-
- u32 ScanType; /* passive/active scan */
-
- u8 reserved_1[2];
-
- struct SSID_Element sSSID; /* 34B. scan only for this SSID */
- u8 reserved_2[2];
-
-} SCAN_REQ_PARA, *psSCAN_REQ_PARA;
-
-typedef struct _SCAN_PARAMETERS {
- u16 wState;
- u16 iCurrentChannelIndex;
-
- SCAN_REQ_PARA sScanReq;
-
- u8 BSSID[MAC_ADDR_LENGTH + 2]; /* scan only for this BSSID */
-
- u32 BssType; /* scan only for this BSS type */
-
- u16 ProbeDelay;
- u16 MinChannelTime;
-
- u16 MaxChannelTime;
- u16 reserved_1;
-
- s32 iBgScanPeriod; /* XP: 5 sec */
-
- u8 boBgScan; /* Wb: enable BG scan, For XP, this value must be FALSE */
- u8 boFastScan; /* Wb: reserved */
- u8 boCCAbusy; /* Wb: HWMAC CCA busy status */
- u8 reserved_2;
-
- struct timer_list timer;
-
- u32 ScanTimeStamp; /* Increase 1 per background scan(1 minute) */
- u32 BssTimeStamp; /* Increase 1 per connect status check */
- u32 RxNumPerAntenna[2];
-
- u8 AntennaToggle;
- u8 boInTimerHandler;
- u8 boTimerActive; /* Wb: reserved */
- u8 boSave;
-
- u32 BScanEnable; /* Background scan enable. Default is On */
-} SCAN_PARAMETERS, *psSCAN_PARAMETERS;
-
-/* Encapsulate 'adapter' data structure */
-#define psSCAN (&(adapter->sScanPara))
-#define psSCANREQ (&(adapter->sScanPara.sScanReq))
-
-/*
- * ===========================================================
- * scan.h
- * Define the related definitions of scan module
- *
- * ===========================================================
- */
-
-/* Define the state of scan module */
-#define SCAN_INACTIVE 0
-#define WAIT_PROBE_DELAY 1
-#define WAIT_RESPONSE_MIN 2
-#define WAIT_RESPONSE_MAX_ACTIVE 3
-#define WAIT_BEACON_MAX_PASSIVE 4
-#define SCAN_COMPLETE 5
-#define BG_SCAN 6
-#define BG_SCANNING 7
-
-
-/*
- * The value will load from EEPROM
- * If 0xff is set in EEPOM, the driver will use SCAN_MAX_CHNL_TIME instead.
- * The definition is in WbHal.h
- */
-#endif
diff --git a/drivers/staging/winbond/wb35rx.c b/drivers/staging/winbond/wb35rx.c
index efe82b141c10..448514aada44 100644
--- a/drivers/staging/winbond/wb35rx.c
+++ b/drivers/staging/winbond/wb35rx.c
@@ -160,7 +160,7 @@ static void Wb35Rx_Complete(struct urb *urb)
u32 SizeCheck;
u16 BulkLength;
u32 RxBufferId;
- R00_DESCRIPTOR R00;
+ struct R00_descriptor R00;
/* Variable setting */
pWb35Rx->EP3vm_state = VM_COMPLETED;
diff --git a/drivers/staging/winbond/wb35tx.c b/drivers/staging/winbond/wb35tx.c
index bda7a913edf8..2a9d05557678 100644
--- a/drivers/staging/winbond/wb35tx.c
+++ b/drivers/staging/winbond/wb35tx.c
@@ -210,7 +210,7 @@ static void Wb35Tx_EP2VM_complete(struct urb * pUrb)
{
struct wbsoft_priv *adapter = pUrb->context;
struct hw_data * pHwData = &adapter->sHwData;
- T02_DESCRIPTOR T02, TSTATUS;
+ struct T02_descriptor T02, TSTATUS;
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
u32 * pltmp = (u32 *)pWb35Tx->EP2_buf;
u32 i;
diff --git a/drivers/staging/winbond/wbhal_f.h b/drivers/staging/winbond/wbhal_f.h
index 401c024bead8..fc78c14ae583 100644
--- a/drivers/staging/winbond/wbhal_f.h
+++ b/drivers/staging/winbond/wbhal_f.h
@@ -78,14 +78,4 @@ u32 hal_get_bss_pk_cnt(struct hw_data *hw_data);
#define hal_get_time_count(_P) (_P->time_count / 10)
#define hal_detect_error(_P) (_P->WbUsb.DetectCount)
-/* The follow function is unused for IS89C35 */
-#define hal_disable_interrupt(_A)
-#define hal_enable_interrupt(_A)
-#define hal_get_interrupt_type(_A)
-#define hal_get_clear_interrupt(_A)
#define hal_ibss_disconnect(_A) (hal_stop_sync_bss(_A))
-#define hal_join_request_stop(_A)
-#define hw_get_cxx_reg(_A, _B, _C)
-#define hw_set_cxx_reg(_A, _B, _C)
-
-
diff --git a/drivers/staging/winbond/wbhal_s.h b/drivers/staging/winbond/wbhal_s.h
index 33457c2e39be..821a1b3f1301 100644
--- a/drivers/staging/winbond/wbhal_s.h
+++ b/drivers/staging/winbond/wbhal_s.h
@@ -105,7 +105,7 @@ enum {
#define FLAG_BAND_RX_MASK 0x10000000 /* Bit 28 */
-typedef struct _R00_DESCRIPTOR {
+struct R00_descriptor {
union {
u32 value;
#ifdef _BIG_ENDIAN_
@@ -126,9 +126,9 @@ typedef struct _R00_DESCRIPTOR {
};
#endif
};
-} R00_DESCRIPTOR, *PR00_DESCRIPTOR;
+};
-typedef struct _T00_DESCRIPTOR {
+struct T00_descriptor {
union {
u32 value;
#ifdef _BIG_ENDIAN_
@@ -157,9 +157,9 @@ typedef struct _T00_DESCRIPTOR {
};
#endif
};
-} T00_DESCRIPTOR, *PT00_DESCRIPTOR;
+};
-typedef struct _R01_DESCRIPTOR {
+struct R01_descriptor {
union {
u32 value;
#ifdef _BIG_ENDIAN_
@@ -208,9 +208,9 @@ typedef struct _R01_DESCRIPTOR {
};
#endif
};
-} R01_DESCRIPTOR, *PR01_DESCRIPTOR;
+};
-typedef struct _T01_DESCRIPTOR {
+struct T01_descriptor {
union {
u32 value;
#ifdef _BIG_ENDIAN_
@@ -245,9 +245,9 @@ typedef struct _T01_DESCRIPTOR {
};
#endif
};
-} T01_DESCRIPTOR, *PT01_DESCRIPTOR;
+};
-typedef struct _T02_DESCRIPTOR {
+struct T02_descriptor {
union {
u32 value;
#ifdef _BIG_ENDIAN_
@@ -290,7 +290,7 @@ typedef struct _T02_DESCRIPTOR {
};
#endif
};
-} T02_DESCRIPTOR, *PT02_DESCRIPTOR;
+};
struct wb35_descriptor { /* Skip length = 8 DWORD */
/* ID for descriptor ---, The field doesn't be cleard in the operation of Descriptor definition */
@@ -309,20 +309,20 @@ struct wb35_descriptor { /* Skip length = 8 DWORD */
/* For R00 and T00 ------------------------------ */
union {
- R00_DESCRIPTOR R00;
- T00_DESCRIPTOR T00;
+ struct R00_descriptor R00;
+ struct T00_descriptor T00;
};
/* For R01 and T01 ------------------------------ */
union {
- R01_DESCRIPTOR R01;
- T01_DESCRIPTOR T01;
+ struct R01_descriptor R01;
+ struct T01_descriptor T01;
};
/* For R02 and T02 ------------------------------ */
union {
u32 R02;
- T02_DESCRIPTOR T02;
+ struct T02_descriptor T02;
};
/* For R03 and T03 ------------------------------ */
@@ -348,11 +348,10 @@ struct wb35_descriptor { /* Skip length = 8 DWORD */
#define MAX_TXVGA_EEPROM 9 /* How many word(u16) of EEPROM will be used for TxVGA */
#define MAX_RF_PARAMETER 32
-typedef struct _TXVGA_FOR_50 {
+struct txvga_for_50 {
u8 ChanNo;
u8 TxVgaValue;
-} TXVGA_FOR_50;
-
+};
/*
* ==============================================
@@ -479,7 +478,7 @@ struct hw_data {
u8 TxVgaSettingInEEPROM[(((MAX_TXVGA_EEPROM * 2) + 3) & ~0x03)]; /* For EEPROM value */
u8 TxVgaFor24[16]; /* Max is 14, 2 for alignment */
- TXVGA_FOR_50 TxVgaFor50[36]; /* 35 channels in 5G. 35x2 = 70 byte. 2 for alignments */
+ struct txvga_for_50 TxVgaFor50[36]; /* 35 channels in 5G. 35x2 = 70 byte. 2 for alignments */
u16 Scan_Interval;
u16 RESERVED6;
diff --git a/drivers/staging/winbond/wbusb.c b/drivers/staging/winbond/wbusb.c
index abaa05a630f0..3f60cf7e6ec1 100644
--- a/drivers/staging/winbond/wbusb.c
+++ b/drivers/staging/winbond/wbusb.c
@@ -121,7 +121,24 @@ static int wbsoft_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
{
struct wbsoft_priv *priv = dev->priv;
- MLMESendFrame(priv, skb->data, skb->len, FRAME_TYPE_802_11_MANAGEMENT);
+ if (priv->sMlmeFrame.IsInUsed != PACKET_FREE_TO_USE) {
+ priv->sMlmeFrame.wNumTxMMPDUDiscarded++;
+ return NETDEV_TX_BUSY;
+ }
+
+ priv->sMlmeFrame.IsInUsed = PACKET_COME_FROM_MLME;
+
+ priv->sMlmeFrame.pMMPDU = skb->data;
+ priv->sMlmeFrame.DataType = FRAME_TYPE_802_11_MANAGEMENT;
+ priv->sMlmeFrame.len = skb->len;
+ priv->sMlmeFrame.wNumTxMMPDU++;
+
+ /*
+ * H/W will enter power save by set the register. S/W don't send null
+ * frame with PWRMgt bit enbled to enter power save now.
+ */
+
+ Mds_Tx(priv);
return NETDEV_TX_OK;
}
@@ -783,8 +800,6 @@ static int wb35_probe(struct usb_interface *intf,
priv = dev->priv;
- spin_lock_init(&priv->SpinLock);
-
pWbUsb = &priv->sHwData.WbUsb;
pWbUsb->udev = udev;