Skip to content

Commit

Permalink
Staging: w35und: typedef removal
Browse files Browse the repository at this point in the history
This patch removes some typedefs from the driver code. I also removed some
unused structs I spotted while removing the typedefs.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Pekka Enberg authored and Greg Kroah-Hartman committed Apr 3, 2009
1 parent 0c59dba commit eb62f3e
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 120 deletions.
6 changes: 0 additions & 6 deletions drivers/staging/winbond/mto.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@ static int retryrate_rec[MTO_MAX_DATA_RATE_LEVELS];//this record the retry rate
static int PeriodTotalTxPkt = 0;
static int PeriodTotalTxPktRetry = 0;

typedef struct
{
s32 RSSI;
u8 TxRate;
}RSSI2RATE;

static u8 boSparseTxTraffic = false;

void MTO_Init(MTO_FUNC_INPUT);
Expand Down
16 changes: 8 additions & 8 deletions drivers/staging/winbond/wb35rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ static u16 Wb35Rx_indicate(struct ieee80211_hw *hw)
struct wbsoft_priv *priv = hw->priv;
phw_data_t pHwData = &priv->sHwData;
DESCRIPTOR RxDes;
PWB35RX pWb35Rx = &pHwData->Wb35Rx;
struct wb35_rx *pWb35Rx = &pHwData->Wb35Rx;
u8 * pRxBufferAddress;
u16 PacketSize;
u16 stmp, BufferSize, stmp2 = 0;
Expand Down Expand Up @@ -162,7 +162,7 @@ static void Wb35Rx_Complete(struct urb *urb)
struct ieee80211_hw *hw = urb->context;
struct wbsoft_priv *priv = hw->priv;
phw_data_t pHwData = &priv->sHwData;
PWB35RX pWb35Rx = &pHwData->Wb35Rx;
struct wb35_rx *pWb35Rx = &pHwData->Wb35Rx;
u8 * pRxBufferAddress;
u32 SizeCheck;
u16 BulkLength;
Expand Down Expand Up @@ -239,7 +239,7 @@ static void Wb35Rx(struct ieee80211_hw *hw)
{
struct wbsoft_priv *priv = hw->priv;
phw_data_t pHwData = &priv->sHwData;
PWB35RX pWb35Rx = &pHwData->Wb35Rx;
struct wb35_rx *pWb35Rx = &pHwData->Wb35Rx;
u8 * pRxBufferAddress;
struct urb *urb = pWb35Rx->RxUrb;
int retv;
Expand Down Expand Up @@ -302,7 +302,7 @@ void Wb35Rx_start(struct ieee80211_hw *hw)
{
struct wbsoft_priv *priv = hw->priv;
phw_data_t pHwData = &priv->sHwData;
PWB35RX pWb35Rx = &pHwData->Wb35Rx;
struct wb35_rx *pWb35Rx = &pHwData->Wb35Rx;

// Allow only one thread to run into the Wb35Rx() function
if (atomic_inc_return(&pWb35Rx->RxFireCounter) == 1) {
Expand All @@ -315,7 +315,7 @@ void Wb35Rx_start(struct ieee80211_hw *hw)
//=====================================================================================
static void Wb35Rx_reset_descriptor( phw_data_t pHwData )
{
PWB35RX pWb35Rx = &pHwData->Wb35Rx;
struct wb35_rx *pWb35Rx = &pHwData->Wb35Rx;
u32 i;

pWb35Rx->ByteReceived = 0;
Expand All @@ -331,7 +331,7 @@ static void Wb35Rx_reset_descriptor( phw_data_t pHwData )

unsigned char Wb35Rx_initial(phw_data_t pHwData)
{
PWB35RX pWb35Rx = &pHwData->Wb35Rx;
struct wb35_rx *pWb35Rx = &pHwData->Wb35Rx;

// Initial the Buffer Queue
Wb35Rx_reset_descriptor( pHwData );
Expand All @@ -342,7 +342,7 @@ unsigned char Wb35Rx_initial(phw_data_t pHwData)

void Wb35Rx_stop(phw_data_t pHwData)
{
PWB35RX pWb35Rx = &pHwData->Wb35Rx;
struct wb35_rx *pWb35Rx = &pHwData->Wb35Rx;

// Canceling the Irp if already sends it out.
if (pWb35Rx->EP3vm_state == VM_RUNNING) {
Expand All @@ -356,7 +356,7 @@ void Wb35Rx_stop(phw_data_t pHwData)
// Needs process context
void Wb35Rx_destroy(phw_data_t pHwData)
{
PWB35RX pWb35Rx = &pHwData->Wb35Rx;
struct wb35_rx *pWb35Rx = &pHwData->Wb35Rx;

do {
msleep(10); // Delay for waiting function enter 940623.1.a
Expand Down
8 changes: 2 additions & 6 deletions drivers/staging/winbond/wb35rx_s.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
//====================================
// Internal variable for module
//====================================
typedef struct _WB35RX
{
struct wb35_rx {
u32 ByteReceived;// For calculating throughput of BulkIn
atomic_t RxFireCounter;// Does Wb35Rx module fire?

Expand All @@ -42,7 +41,4 @@ typedef struct _WB35RX

int EP3VM_status;
u8 * pDRx;

} WB35RX, *PWB35RX;


};
22 changes: 11 additions & 11 deletions drivers/staging/winbond/wb35tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
unsigned char
Wb35Tx_get_tx_buffer(phw_data_t pHwData, u8 **pBuffer)
{
PWB35TX pWb35Tx = &pHwData->Wb35Tx;
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;

*pBuffer = pWb35Tx->TxBuffer[0];
return true;
Expand All @@ -29,7 +29,7 @@ static void Wb35Tx_complete(struct urb * pUrb)
{
struct wbsoft_priv *adapter = pUrb->context;
phw_data_t pHwData = &adapter->sHwData;
PWB35TX pWb35Tx = &pHwData->Wb35Tx;
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
PMDS pMds = &adapter->Mds;

printk("wb35: tx complete\n");
Expand Down Expand Up @@ -65,7 +65,7 @@ static void Wb35Tx_complete(struct urb * pUrb)
static void Wb35Tx(struct wbsoft_priv *adapter)
{
phw_data_t pHwData = &adapter->sHwData;
PWB35TX pWb35Tx = &pHwData->Wb35Tx;
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
u8 *pTxBufferAddress;
PMDS pMds = &adapter->Mds;
struct urb * pUrb = (struct urb *)pWb35Tx->Tx4Urb;
Expand Down Expand Up @@ -116,7 +116,7 @@ static void Wb35Tx(struct wbsoft_priv *adapter)
void Wb35Tx_start(struct wbsoft_priv *adapter)
{
phw_data_t pHwData = &adapter->sHwData;
PWB35TX pWb35Tx = &pHwData->Wb35Tx;
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;

// Allow only one thread to run into function
if (atomic_inc_return(&pWb35Tx->TxFireCounter) == 1) {
Expand All @@ -128,7 +128,7 @@ void Wb35Tx_start(struct wbsoft_priv *adapter)

unsigned char Wb35Tx_initial(phw_data_t pHwData)
{
PWB35TX pWb35Tx = &pHwData->Wb35Tx;
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;

pWb35Tx->Tx4Urb = usb_alloc_urb(0, GFP_ATOMIC);
if (!pWb35Tx->Tx4Urb)
Expand All @@ -147,7 +147,7 @@ unsigned char Wb35Tx_initial(phw_data_t pHwData)
//======================================================
void Wb35Tx_stop(phw_data_t pHwData)
{
PWB35TX pWb35Tx = &pHwData->Wb35Tx;
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;

// Trying to canceling the Trp of EP2
if (pWb35Tx->EP2vm_state == VM_RUNNING)
Expand All @@ -167,7 +167,7 @@ void Wb35Tx_stop(phw_data_t pHwData)
//======================================================
void Wb35Tx_destroy(phw_data_t pHwData)
{
PWB35TX pWb35Tx = &pHwData->Wb35Tx;
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;

// Wait for VM stop
do {
Expand All @@ -189,7 +189,7 @@ void Wb35Tx_destroy(phw_data_t pHwData)
void Wb35Tx_CurrentTime(struct wbsoft_priv *adapter, u32 TimeCount)
{
phw_data_t pHwData = &adapter->sHwData;
PWB35TX pWb35Tx = &pHwData->Wb35Tx;
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
unsigned char Trigger = false;

if (pWb35Tx->TxTimer > TimeCount)
Expand All @@ -210,7 +210,7 @@ static void Wb35Tx_EP2VM_complete(struct urb * pUrb)
struct wbsoft_priv *adapter = pUrb->context;
phw_data_t pHwData = &adapter->sHwData;
T02_DESCRIPTOR T02, TSTATUS;
PWB35TX pWb35Tx = &pHwData->Wb35Tx;
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
u32 * pltmp = (u32 *)pWb35Tx->EP2_buf;
u32 i;
u16 InterruptInLength;
Expand Down Expand Up @@ -257,7 +257,7 @@ static void Wb35Tx_EP2VM_complete(struct urb * pUrb)
static void Wb35Tx_EP2VM(struct wbsoft_priv *adapter)
{
phw_data_t pHwData = &adapter->sHwData;
PWB35TX pWb35Tx = &pHwData->Wb35Tx;
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
struct urb * pUrb = (struct urb *)pWb35Tx->Tx2Urb;
u32 * pltmp = (u32 *)pWb35Tx->EP2_buf;
int retv;
Expand Down Expand Up @@ -293,7 +293,7 @@ static void Wb35Tx_EP2VM(struct wbsoft_priv *adapter)
void Wb35Tx_EP2VM_start(struct wbsoft_priv *adapter)
{
phw_data_t pHwData = &adapter->sHwData;
PWB35TX pWb35Tx = &pHwData->Wb35Tx;
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;

// Allow only one thread to run into function
if (atomic_inc_return(&pWb35Tx->TxResultCount) == 1) {
Expand Down
6 changes: 2 additions & 4 deletions drivers/staging/winbond/wb35tx_s.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
//====================================


typedef struct _WB35TX
{
struct wb35_tx {
// For Tx buffer
u8 TxBuffer[ MAX_USB_TX_BUFFER_NUMBER ][ MAX_USB_TX_BUFFER ];

Expand All @@ -43,7 +42,6 @@ typedef struct _WB35TX

u32 TxFillCount; // 20060928
u32 TxTimer; // 20060928 Add if sending packet not great than 13

} WB35TX, *PWB35TX;
};

#endif
2 changes: 1 addition & 1 deletion drivers/staging/winbond/wbhal.c
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ void hal_stop( phw_data_t pHwData )
unsigned char hal_idle(phw_data_t pHwData)
{
struct wb35_reg *reg = &pHwData->reg;
PWBUSB pWbUsb = &pHwData->WbUsb;
struct wb_usb *pWbUsb = &pHwData->WbUsb;

if( !pHwData->SurpriseRemove && ( pWbUsb->DetectCount || reg->EP0vm_state!=VM_STOP ) )
return false;
Expand Down
74 changes: 5 additions & 69 deletions drivers/staging/winbond/wbhal_s.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,48 +85,13 @@ enum {
VM_COMPLETED
};

// Be used for 802.11 mac header
typedef struct _MAC_FRAME_CONTROL {
u8 mac_frame_info; // this is a combination of the protovl version, type and subtype
u8 to_ds:1;
u8 from_ds:1;
u8 more_frag:1;
u8 retry:1;
u8 pwr_mgt:1;
u8 more_data:1;
u8 WEP:1;
u8 order:1;
} MAC_FRAME_CONTROL, *PMAC_FRAME_CONTROL;

//-----------------------------------------------------
// Normal Key table format
//-----------------------------------------------------
// The order of KEY index is MAPPING_KEY_START_INDEX > GROUP_KEY_START_INDEX
#define MAX_KEY_TABLE 24 // 24 entry for storing key data
#define GROUP_KEY_START_INDEX 4
#define MAPPING_KEY_START_INDEX 8
typedef struct _KEY_TABLE
{
u32 DW0_Valid:1;
u32 DW0_NullKey:1;
u32 DW0_Security_Mode:2;//0:WEP 40 bit 1:WEP 104 bit 2:TKIP 128 bit 3:CCMP 128 bit
u32 DW0_WEPON:1;
u32 DW0_RESERVED:11;
u32 DW0_Address1:16;

u32 DW1_Address2;

u32 DW2_RxSequenceCount1;

u32 DW3_RxSequenceCount2:16;
u32 DW3_RESERVED:16;

u32 DW4_TxSequenceCount1;

u32 DW5_TxSequenceCount2:16;
u32 DW5_RESERVED:16;

} KEY_TABLE, *PKEY_TABLE;

//--------------------------------------------------------
// Descriptor
Expand Down Expand Up @@ -412,8 +377,8 @@ typedef struct _DESCRIPTOR { // Skip length = 8 DWORD
#define MAX_RF_PARAMETER 32

typedef struct _TXVGA_FOR_50 {
u8 ChanNo;
u8 TxVgaValue;
u8 ChanNo;
u8 TxVgaValue;
} TXVGA_FOR_50;


Expand Down Expand Up @@ -500,10 +465,10 @@ typedef struct _HW_DATA_T
//========================================================================
// Variable for each module
//========================================================================
WBUSB WbUsb; // Need WbUsb.h
struct wb_usb WbUsb; // Need WbUsb.h
struct wb35_reg reg; // Need Wb35Reg.h
WB35TX Wb35Tx; // Need Wb35Tx.h
WB35RX Wb35Rx; // Need Wb35Rx.h
struct wb35_tx Wb35Tx; // Need Wb35Tx.h
struct wb35_rx Wb35Rx; // Need Wb35Rx.h

struct timer_list LEDTimer;// For LED

Expand Down Expand Up @@ -578,33 +543,4 @@ typedef struct _HW_DATA_T

} hw_data_t, *phw_data_t;

// The mapping of Rx and Tx descriptor field
typedef struct _HAL_RATE
{
// DSSS
u32 RESERVED_0;
u32 NumRate2MS;
u32 NumRate55MS;
u32 NumRate11MS;

u32 RESERVED_1[4];

u32 NumRate1M;
u32 NumRate2ML;
u32 NumRate55ML;
u32 NumRate11ML;

u32 RESERVED_2[4];

// OFDM
u32 NumRate6M;
u32 NumRate9M;
u32 NumRate12M;
u32 NumRate18M;
u32 NumRate24M;
u32 NumRate36M;
u32 NumRate48M;
u32 NumRate54M;
} HAL_RATE, *PHAL_RATE;

#endif
2 changes: 1 addition & 1 deletion drivers/staging/winbond/wbusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ static unsigned char wb35_hw_init(struct ieee80211_hw *hw)

static int wb35_probe(struct usb_interface *intf, const struct usb_device_id *id_table)
{
PWBUSB pWbUsb;
struct wb_usb *pWbUsb;
struct usb_host_interface *interface;
struct usb_endpoint_descriptor *endpoint;
u32 ltmp;
Expand Down
16 changes: 2 additions & 14 deletions drivers/staging/winbond/wbusb_s.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,10 @@

#include <linux/types.h>

//---------------------------------------------------------------------------
// RW_CONTEXT --
//
// Used to track driver-generated io irps
//---------------------------------------------------------------------------
typedef struct _RW_CONTEXT
{
void* pHwData;
struct urb *urb;
void* pCallBackFunctionParameter;
} RW_CONTEXT, *PRW_CONTEXT;

typedef struct _WBUSB {
struct wb_usb {
u32 IsUsb20;
struct usb_device *udev;
u32 DetectCount;
} WBUSB, *PWBUSB;
};

#endif

0 comments on commit eb62f3e

Please sign in to comment.