Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Staging: w35und: typedef removal

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>

authored by

Pekka Enberg and committed by
Greg Kroah-Hartman
eb62f3ea 0c59dbaa

+32 -120
-6
drivers/staging/winbond/mto.c
··· 51 51 static int PeriodTotalTxPkt = 0; 52 52 static int PeriodTotalTxPktRetry = 0; 53 53 54 - typedef struct 55 - { 56 - s32 RSSI; 57 - u8 TxRate; 58 - }RSSI2RATE; 59 - 60 54 static u8 boSparseTxTraffic = false; 61 55 62 56 void MTO_Init(MTO_FUNC_INPUT);
+8 -8
drivers/staging/winbond/wb35rx.c
··· 84 84 struct wbsoft_priv *priv = hw->priv; 85 85 phw_data_t pHwData = &priv->sHwData; 86 86 DESCRIPTOR RxDes; 87 - PWB35RX pWb35Rx = &pHwData->Wb35Rx; 87 + struct wb35_rx *pWb35Rx = &pHwData->Wb35Rx; 88 88 u8 * pRxBufferAddress; 89 89 u16 PacketSize; 90 90 u16 stmp, BufferSize, stmp2 = 0; ··· 162 162 struct ieee80211_hw *hw = urb->context; 163 163 struct wbsoft_priv *priv = hw->priv; 164 164 phw_data_t pHwData = &priv->sHwData; 165 - PWB35RX pWb35Rx = &pHwData->Wb35Rx; 165 + struct wb35_rx *pWb35Rx = &pHwData->Wb35Rx; 166 166 u8 * pRxBufferAddress; 167 167 u32 SizeCheck; 168 168 u16 BulkLength; ··· 239 239 { 240 240 struct wbsoft_priv *priv = hw->priv; 241 241 phw_data_t pHwData = &priv->sHwData; 242 - PWB35RX pWb35Rx = &pHwData->Wb35Rx; 242 + struct wb35_rx *pWb35Rx = &pHwData->Wb35Rx; 243 243 u8 * pRxBufferAddress; 244 244 struct urb *urb = pWb35Rx->RxUrb; 245 245 int retv; ··· 302 302 { 303 303 struct wbsoft_priv *priv = hw->priv; 304 304 phw_data_t pHwData = &priv->sHwData; 305 - PWB35RX pWb35Rx = &pHwData->Wb35Rx; 305 + struct wb35_rx *pWb35Rx = &pHwData->Wb35Rx; 306 306 307 307 // Allow only one thread to run into the Wb35Rx() function 308 308 if (atomic_inc_return(&pWb35Rx->RxFireCounter) == 1) { ··· 315 315 //===================================================================================== 316 316 static void Wb35Rx_reset_descriptor( phw_data_t pHwData ) 317 317 { 318 - PWB35RX pWb35Rx = &pHwData->Wb35Rx; 318 + struct wb35_rx *pWb35Rx = &pHwData->Wb35Rx; 319 319 u32 i; 320 320 321 321 pWb35Rx->ByteReceived = 0; ··· 331 331 332 332 unsigned char Wb35Rx_initial(phw_data_t pHwData) 333 333 { 334 - PWB35RX pWb35Rx = &pHwData->Wb35Rx; 334 + struct wb35_rx *pWb35Rx = &pHwData->Wb35Rx; 335 335 336 336 // Initial the Buffer Queue 337 337 Wb35Rx_reset_descriptor( pHwData ); ··· 342 342 343 343 void Wb35Rx_stop(phw_data_t pHwData) 344 344 { 345 - PWB35RX pWb35Rx = &pHwData->Wb35Rx; 345 + struct wb35_rx *pWb35Rx = &pHwData->Wb35Rx; 346 346 347 347 // Canceling the Irp if already sends it out. 348 348 if (pWb35Rx->EP3vm_state == VM_RUNNING) { ··· 356 356 // Needs process context 357 357 void Wb35Rx_destroy(phw_data_t pHwData) 358 358 { 359 - PWB35RX pWb35Rx = &pHwData->Wb35Rx; 359 + struct wb35_rx *pWb35Rx = &pHwData->Wb35Rx; 360 360 361 361 do { 362 362 msleep(10); // Delay for waiting function enter 940623.1.a
+2 -6
drivers/staging/winbond/wb35rx_s.h
··· 15 15 //==================================== 16 16 // Internal variable for module 17 17 //==================================== 18 - typedef struct _WB35RX 19 - { 18 + struct wb35_rx { 20 19 u32 ByteReceived;// For calculating throughput of BulkIn 21 20 atomic_t RxFireCounter;// Does Wb35Rx module fire? 22 21 ··· 41 42 42 43 int EP3VM_status; 43 44 u8 * pDRx; 44 - 45 - } WB35RX, *PWB35RX; 46 - 47 - 45 + };
+11 -11
drivers/staging/winbond/wb35tx.c
··· 17 17 unsigned char 18 18 Wb35Tx_get_tx_buffer(phw_data_t pHwData, u8 **pBuffer) 19 19 { 20 - PWB35TX pWb35Tx = &pHwData->Wb35Tx; 20 + struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx; 21 21 22 22 *pBuffer = pWb35Tx->TxBuffer[0]; 23 23 return true; ··· 29 29 { 30 30 struct wbsoft_priv *adapter = pUrb->context; 31 31 phw_data_t pHwData = &adapter->sHwData; 32 - PWB35TX pWb35Tx = &pHwData->Wb35Tx; 32 + struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx; 33 33 PMDS pMds = &adapter->Mds; 34 34 35 35 printk("wb35: tx complete\n"); ··· 65 65 static void Wb35Tx(struct wbsoft_priv *adapter) 66 66 { 67 67 phw_data_t pHwData = &adapter->sHwData; 68 - PWB35TX pWb35Tx = &pHwData->Wb35Tx; 68 + struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx; 69 69 u8 *pTxBufferAddress; 70 70 PMDS pMds = &adapter->Mds; 71 71 struct urb * pUrb = (struct urb *)pWb35Tx->Tx4Urb; ··· 116 116 void Wb35Tx_start(struct wbsoft_priv *adapter) 117 117 { 118 118 phw_data_t pHwData = &adapter->sHwData; 119 - PWB35TX pWb35Tx = &pHwData->Wb35Tx; 119 + struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx; 120 120 121 121 // Allow only one thread to run into function 122 122 if (atomic_inc_return(&pWb35Tx->TxFireCounter) == 1) { ··· 128 128 129 129 unsigned char Wb35Tx_initial(phw_data_t pHwData) 130 130 { 131 - PWB35TX pWb35Tx = &pHwData->Wb35Tx; 131 + struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx; 132 132 133 133 pWb35Tx->Tx4Urb = usb_alloc_urb(0, GFP_ATOMIC); 134 134 if (!pWb35Tx->Tx4Urb) ··· 147 147 //====================================================== 148 148 void Wb35Tx_stop(phw_data_t pHwData) 149 149 { 150 - PWB35TX pWb35Tx = &pHwData->Wb35Tx; 150 + struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx; 151 151 152 152 // Trying to canceling the Trp of EP2 153 153 if (pWb35Tx->EP2vm_state == VM_RUNNING) ··· 167 167 //====================================================== 168 168 void Wb35Tx_destroy(phw_data_t pHwData) 169 169 { 170 - PWB35TX pWb35Tx = &pHwData->Wb35Tx; 170 + struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx; 171 171 172 172 // Wait for VM stop 173 173 do { ··· 189 189 void Wb35Tx_CurrentTime(struct wbsoft_priv *adapter, u32 TimeCount) 190 190 { 191 191 phw_data_t pHwData = &adapter->sHwData; 192 - PWB35TX pWb35Tx = &pHwData->Wb35Tx; 192 + struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx; 193 193 unsigned char Trigger = false; 194 194 195 195 if (pWb35Tx->TxTimer > TimeCount) ··· 210 210 struct wbsoft_priv *adapter = pUrb->context; 211 211 phw_data_t pHwData = &adapter->sHwData; 212 212 T02_DESCRIPTOR T02, TSTATUS; 213 - PWB35TX pWb35Tx = &pHwData->Wb35Tx; 213 + struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx; 214 214 u32 * pltmp = (u32 *)pWb35Tx->EP2_buf; 215 215 u32 i; 216 216 u16 InterruptInLength; ··· 257 257 static void Wb35Tx_EP2VM(struct wbsoft_priv *adapter) 258 258 { 259 259 phw_data_t pHwData = &adapter->sHwData; 260 - PWB35TX pWb35Tx = &pHwData->Wb35Tx; 260 + struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx; 261 261 struct urb * pUrb = (struct urb *)pWb35Tx->Tx2Urb; 262 262 u32 * pltmp = (u32 *)pWb35Tx->EP2_buf; 263 263 int retv; ··· 293 293 void Wb35Tx_EP2VM_start(struct wbsoft_priv *adapter) 294 294 { 295 295 phw_data_t pHwData = &adapter->sHwData; 296 - PWB35TX pWb35Tx = &pHwData->Wb35Tx; 296 + struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx; 297 297 298 298 // Allow only one thread to run into function 299 299 if (atomic_inc_return(&pWb35Tx->TxResultCount) == 1) {
+2 -4
drivers/staging/winbond/wb35tx_s.h
··· 18 18 //==================================== 19 19 20 20 21 - typedef struct _WB35TX 22 - { 21 + struct wb35_tx { 23 22 // For Tx buffer 24 23 u8 TxBuffer[ MAX_USB_TX_BUFFER_NUMBER ][ MAX_USB_TX_BUFFER ]; 25 24 ··· 42 43 43 44 u32 TxFillCount; // 20060928 44 45 u32 TxTimer; // 20060928 Add if sending packet not great than 13 45 - 46 - } WB35TX, *PWB35TX; 46 + }; 47 47 48 48 #endif
+1 -1
drivers/staging/winbond/wbhal.c
··· 484 484 unsigned char hal_idle(phw_data_t pHwData) 485 485 { 486 486 struct wb35_reg *reg = &pHwData->reg; 487 - PWBUSB pWbUsb = &pHwData->WbUsb; 487 + struct wb_usb *pWbUsb = &pHwData->WbUsb; 488 488 489 489 if( !pHwData->SurpriseRemove && ( pWbUsb->DetectCount || reg->EP0vm_state!=VM_STOP ) ) 490 490 return false;
+5 -69
drivers/staging/winbond/wbhal_s.h
··· 85 85 VM_COMPLETED 86 86 }; 87 87 88 - // Be used for 802.11 mac header 89 - typedef struct _MAC_FRAME_CONTROL { 90 - u8 mac_frame_info; // this is a combination of the protovl version, type and subtype 91 - u8 to_ds:1; 92 - u8 from_ds:1; 93 - u8 more_frag:1; 94 - u8 retry:1; 95 - u8 pwr_mgt:1; 96 - u8 more_data:1; 97 - u8 WEP:1; 98 - u8 order:1; 99 - } MAC_FRAME_CONTROL, *PMAC_FRAME_CONTROL; 100 - 101 88 //----------------------------------------------------- 102 89 // Normal Key table format 103 90 //----------------------------------------------------- ··· 92 105 #define MAX_KEY_TABLE 24 // 24 entry for storing key data 93 106 #define GROUP_KEY_START_INDEX 4 94 107 #define MAPPING_KEY_START_INDEX 8 95 - typedef struct _KEY_TABLE 96 - { 97 - u32 DW0_Valid:1; 98 - u32 DW0_NullKey:1; 99 - u32 DW0_Security_Mode:2;//0:WEP 40 bit 1:WEP 104 bit 2:TKIP 128 bit 3:CCMP 128 bit 100 - u32 DW0_WEPON:1; 101 - u32 DW0_RESERVED:11; 102 - u32 DW0_Address1:16; 103 - 104 - u32 DW1_Address2; 105 - 106 - u32 DW2_RxSequenceCount1; 107 - 108 - u32 DW3_RxSequenceCount2:16; 109 - u32 DW3_RESERVED:16; 110 - 111 - u32 DW4_TxSequenceCount1; 112 - 113 - u32 DW5_TxSequenceCount2:16; 114 - u32 DW5_RESERVED:16; 115 - 116 - } KEY_TABLE, *PKEY_TABLE; 117 108 118 109 //-------------------------------------------------------- 119 110 // Descriptor ··· 377 412 #define MAX_RF_PARAMETER 32 378 413 379 414 typedef struct _TXVGA_FOR_50 { 380 - u8 ChanNo; 381 - u8 TxVgaValue; 415 + u8 ChanNo; 416 + u8 TxVgaValue; 382 417 } TXVGA_FOR_50; 383 418 384 419 ··· 465 500 //======================================================================== 466 501 // Variable for each module 467 502 //======================================================================== 468 - WBUSB WbUsb; // Need WbUsb.h 503 + struct wb_usb WbUsb; // Need WbUsb.h 469 504 struct wb35_reg reg; // Need Wb35Reg.h 470 - WB35TX Wb35Tx; // Need Wb35Tx.h 471 - WB35RX Wb35Rx; // Need Wb35Rx.h 505 + struct wb35_tx Wb35Tx; // Need Wb35Tx.h 506 + struct wb35_rx Wb35Rx; // Need Wb35Rx.h 472 507 473 508 struct timer_list LEDTimer;// For LED 474 509 ··· 542 577 u32 NullPacketCount; 543 578 544 579 } hw_data_t, *phw_data_t; 545 - 546 - // The mapping of Rx and Tx descriptor field 547 - typedef struct _HAL_RATE 548 - { 549 - // DSSS 550 - u32 RESERVED_0; 551 - u32 NumRate2MS; 552 - u32 NumRate55MS; 553 - u32 NumRate11MS; 554 - 555 - u32 RESERVED_1[4]; 556 - 557 - u32 NumRate1M; 558 - u32 NumRate2ML; 559 - u32 NumRate55ML; 560 - u32 NumRate11ML; 561 - 562 - u32 RESERVED_2[4]; 563 - 564 - // OFDM 565 - u32 NumRate6M; 566 - u32 NumRate9M; 567 - u32 NumRate12M; 568 - u32 NumRate18M; 569 - u32 NumRate24M; 570 - u32 NumRate36M; 571 - u32 NumRate48M; 572 - u32 NumRate54M; 573 - } HAL_RATE, *PHAL_RATE; 574 580 575 581 #endif
+1 -1
drivers/staging/winbond/wbusb.c
··· 312 312 313 313 static int wb35_probe(struct usb_interface *intf, const struct usb_device_id *id_table) 314 314 { 315 - PWBUSB pWbUsb; 315 + struct wb_usb *pWbUsb; 316 316 struct usb_host_interface *interface; 317 317 struct usb_endpoint_descriptor *endpoint; 318 318 u32 ltmp;
+2 -14
drivers/staging/winbond/wbusb_s.h
··· 16 16 17 17 #include <linux/types.h> 18 18 19 - //--------------------------------------------------------------------------- 20 - // RW_CONTEXT -- 21 - // 22 - // Used to track driver-generated io irps 23 - //--------------------------------------------------------------------------- 24 - typedef struct _RW_CONTEXT 25 - { 26 - void* pHwData; 27 - struct urb *urb; 28 - void* pCallBackFunctionParameter; 29 - } RW_CONTEXT, *PRW_CONTEXT; 30 - 31 - typedef struct _WBUSB { 19 + struct wb_usb { 32 20 u32 IsUsb20; 33 21 struct usb_device *udev; 34 22 u32 DetectCount; 35 - } WBUSB, *PWBUSB; 23 + }; 36 24 37 25 #endif