diff options
author | Pekka Enberg <penberg@cs.helsinki.fi> | 2008-10-21 00:03:41 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-10-22 09:56:32 -0700 |
commit | 8b384e0c3f85065a4986013d74d5585ed595cfa0 (patch) | |
tree | 7674336584ed288af973b55ea684de4a2d53905e /drivers/staging/winbond/linux | |
parent | 58be3fb09b0a140e086475e8d34f72e366c6994b (diff) |
Staging: w35und: remove some typedefs
This patch removes some obfuscating typedefs from the driver code.
Cc: Pavel Machek <pavel@suse.cz>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/winbond/linux')
-rw-r--r-- | drivers/staging/winbond/linux/common.h | 10 | ||||
-rw-r--r-- | drivers/staging/winbond/linux/wb35reg.c | 26 | ||||
-rw-r--r-- | drivers/staging/winbond/linux/wb35reg_f.h | 12 | ||||
-rw-r--r-- | drivers/staging/winbond/linux/wb35reg_s.h | 2 | ||||
-rw-r--r-- | drivers/staging/winbond/linux/wb35rx.c | 16 | ||||
-rw-r--r-- | drivers/staging/winbond/linux/wb35rx_s.h | 2 | ||||
-rw-r--r-- | drivers/staging/winbond/linux/wb35tx.c | 8 | ||||
-rw-r--r-- | drivers/staging/winbond/linux/wb35tx_f.h | 2 | ||||
-rw-r--r-- | drivers/staging/winbond/linux/wbusb.c | 4 |
9 files changed, 37 insertions, 45 deletions
diff --git a/drivers/staging/winbond/linux/common.h b/drivers/staging/winbond/linux/common.h index 6b00bad74f7..c8f14b7b5b2 100644 --- a/drivers/staging/winbond/linux/common.h +++ b/drivers/staging/winbond/linux/common.h @@ -39,14 +39,6 @@ // Common type definition //=============================================================== -typedef u8* PUCHAR; -typedef s8* PCHAR; -typedef u8* PBOOLEAN; -typedef u16* PUSHORT; -typedef u32* PULONG; -typedef s16* PSHORT; - - //=========================================== #define IGNORE 2 #define SUCCESS 1 @@ -110,7 +102,7 @@ typedef struct urb * PURB; #define OS_ATOMIC_READ( _A, _V ) _V #define OS_ATOMIC_INC( _A, _V ) EncapAtomicInc( _A, (void*)_V ) #define OS_ATOMIC_DEC( _A, _V ) EncapAtomicDec( _A, (void*)_V ) -#define OS_MEMORY_CLEAR( _A, _S ) memset( (PUCHAR)_A,0,_S) +#define OS_MEMORY_CLEAR( _A, _S ) memset( (u8 *)_A,0,_S) #define OS_MEMORY_COMPARE( _A, _B, _S ) (memcmp(_A,_B,_S)? 0 : 1) // Definition is reverse with Ndis 1: the same 0: different diff --git a/drivers/staging/winbond/linux/wb35reg.c b/drivers/staging/winbond/linux/wb35reg.c index 2c0b454e8ca..5c28ec9643d 100644 --- a/drivers/staging/winbond/linux/wb35reg.c +++ b/drivers/staging/winbond/linux/wb35reg.c @@ -10,7 +10,7 @@ extern void phy_calibration_winbond(hw_data_t *phw_data, u32 frequency); // Flag : AUTO_INCREMENT - RegisterNo will auto increment 4 // NO_INCREMENT - Function will write data into the same register unsigned char -Wb35Reg_BurstWrite(phw_data_t pHwData, u16 RegisterNo, PULONG pRegisterData, u8 NumberOfData, u8 Flag) +Wb35Reg_BurstWrite(phw_data_t pHwData, u16 RegisterNo, u32 * pRegisterData, u8 NumberOfData, u8 Flag) { PWB35REG pWb35Reg = &pHwData->Wb35Reg; PURB pUrb = NULL; @@ -30,13 +30,13 @@ Wb35Reg_BurstWrite(phw_data_t pHwData, u16 RegisterNo, PULONG pRegisterData, u8 if( pUrb && pRegQueue ) { pRegQueue->DIRECT = 2;// burst write register pRegQueue->INDEX = RegisterNo; - pRegQueue->pBuffer = (PULONG)((PUCHAR)pRegQueue + sizeof(REG_QUEUE)); + pRegQueue->pBuffer = (u32 *)((u8 *)pRegQueue + sizeof(REG_QUEUE)); memcpy( pRegQueue->pBuffer, pRegisterData, DataSize ); //the function for reversing register data from little endian to big endian for( i=0; i<NumberOfData ; i++ ) pRegQueue->pBuffer[i] = cpu_to_le32( pRegQueue->pBuffer[i] ); - dr = (struct usb_ctrlrequest *)((PUCHAR)pRegQueue + sizeof(REG_QUEUE) + DataSize); + dr = (struct usb_ctrlrequest *)((u8 *)pRegQueue + sizeof(REG_QUEUE) + DataSize); dr->bRequestType = USB_TYPE_VENDOR | USB_DIR_OUT | USB_RECIP_DEVICE; dr->bRequest = 0x04; // USB or vendor-defined request code, burst mode dr->wValue = cpu_to_le16( Flag ); // 0: Register number auto-increment, 1: No auto increment @@ -181,7 +181,7 @@ Wb35Reg_Write( phw_data_t pHwData, u16 RegisterNo, u32 RegisterValue ) pRegQueue->INDEX = RegisterNo; pRegQueue->VALUE = cpu_to_le32(RegisterValue); pRegQueue->RESERVED_VALID = FALSE; - dr = (struct usb_ctrlrequest *)((PUCHAR)pRegQueue + sizeof(REG_QUEUE)); + dr = (struct usb_ctrlrequest *)((u8 *)pRegQueue + sizeof(REG_QUEUE)); dr->bRequestType = USB_TYPE_VENDOR|USB_DIR_OUT |USB_RECIP_DEVICE; dr->bRequest = 0x03; // USB or vendor-defined request code, burst mode dr->wValue = cpu_to_le16(0x0); @@ -220,7 +220,7 @@ Wb35Reg_Write( phw_data_t pHwData, u16 RegisterNo, u32 RegisterValue ) // FALSE : register not support unsigned char Wb35Reg_WriteWithCallbackValue( phw_data_t pHwData, u16 RegisterNo, u32 RegisterValue, - PCHAR pValue, s8 Len) + s8 *pValue, s8 Len) { PWB35REG pWb35Reg = &pHwData->Wb35Reg; struct usb_ctrlrequest *dr; @@ -243,7 +243,7 @@ Wb35Reg_WriteWithCallbackValue( phw_data_t pHwData, u16 RegisterNo, u32 Register //NOTE : Users must guarantee the size of value will not exceed the buffer size. memcpy(pRegQueue->RESERVED, pValue, Len); pRegQueue->RESERVED_VALID = TRUE; - dr = (struct usb_ctrlrequest *)((PUCHAR)pRegQueue + sizeof(REG_QUEUE)); + dr = (struct usb_ctrlrequest *)((u8 *)pRegQueue + sizeof(REG_QUEUE)); dr->bRequestType = USB_TYPE_VENDOR|USB_DIR_OUT |USB_RECIP_DEVICE; dr->bRequest = 0x03; // USB or vendor-defined request code, burst mode dr->wValue = cpu_to_le16(0x0); @@ -278,10 +278,10 @@ Wb35Reg_WriteWithCallbackValue( phw_data_t pHwData, u16 RegisterNo, u32 Register // FALSE : register not support // pRegisterValue : It must be a resident buffer due to asynchronous read register. unsigned char -Wb35Reg_ReadSync( phw_data_t pHwData, u16 RegisterNo, PULONG pRegisterValue ) +Wb35Reg_ReadSync( phw_data_t pHwData, u16 RegisterNo, u32 * pRegisterValue ) { PWB35REG pWb35Reg = &pHwData->Wb35Reg; - PULONG pltmp = pRegisterValue; + u32 * pltmp = pRegisterValue; int ret = -1; // Module shutdown @@ -327,7 +327,7 @@ Wb35Reg_ReadSync( phw_data_t pHwData, u16 RegisterNo, PULONG pRegisterValue // FALSE : register not support // pRegisterValue : It must be a resident buffer due to asynchronous read register. unsigned char -Wb35Reg_Read(phw_data_t pHwData, u16 RegisterNo, PULONG pRegisterValue ) +Wb35Reg_Read(phw_data_t pHwData, u16 RegisterNo, u32 * pRegisterValue ) { PWB35REG pWb35Reg = &pHwData->Wb35Reg; struct usb_ctrlrequest * dr; @@ -348,7 +348,7 @@ Wb35Reg_Read(phw_data_t pHwData, u16 RegisterNo, PULONG pRegisterValue ) pRegQueue->DIRECT = 0;// read register pRegQueue->INDEX = RegisterNo; pRegQueue->pBuffer = pRegisterValue; - dr = (struct usb_ctrlrequest *)((PUCHAR)pRegQueue + sizeof(REG_QUEUE)); + dr = (struct usb_ctrlrequest *)((u8 *)pRegQueue + sizeof(REG_QUEUE)); dr->bRequestType = USB_TYPE_VENDOR|USB_RECIP_DEVICE|USB_DIR_IN; dr->bRequest = 0x01; // USB or vendor-defined request code, burst mode dr->wValue = cpu_to_le16(0x0); @@ -399,7 +399,7 @@ Wb35Reg_EP0VM(phw_data_t pHwData ) PWB35REG pWb35Reg = &pHwData->Wb35Reg; PURB pUrb; struct usb_ctrlrequest *dr; - PULONG pBuffer; + u32 * pBuffer; int ret = -1; PREG_QUEUE pRegQueue; @@ -429,7 +429,7 @@ Wb35Reg_EP0VM(phw_data_t pHwData ) usb_fill_control_urb( pUrb, pHwData->WbUsb.udev, REG_DIRECTION(pHwData->WbUsb.udev,pRegQueue), - (PUCHAR)dr,pBuffer,cpu_to_le16(dr->wLength), + (u8 *)dr,pBuffer,cpu_to_le16(dr->wLength), Wb35Reg_EP0VM_complete, (void*)pHwData); pWb35Reg->EP0vm_state = VM_RUNNING; @@ -655,7 +655,7 @@ unsigned char Wb35Reg_initial(phw_data_t pHwData) // version in _GENREQ.ASM of the DWB NE1000/2000 driver. //================================================================================== u32 -CardComputeCrc(PUCHAR Buffer, u32 Length) +CardComputeCrc(u8 * Buffer, u32 Length) { u32 Crc, Carry; u32 i, j; diff --git a/drivers/staging/winbond/linux/wb35reg_f.h b/drivers/staging/winbond/linux/wb35reg_f.h index 38e2906b51a..3006cfe99cc 100644 --- a/drivers/staging/winbond/linux/wb35reg_f.h +++ b/drivers/staging/winbond/linux/wb35reg_f.h @@ -29,16 +29,16 @@ void EEPROMTxVgaAdjust( phw_data_t pHwData ); // 20060619.5 Add void Wb35Reg_destroy( phw_data_t pHwData ); -unsigned char Wb35Reg_Read( phw_data_t pHwData, u16 RegisterNo, PULONG pRegisterValue ); -unsigned char Wb35Reg_ReadSync( phw_data_t pHwData, u16 RegisterNo, PULONG pRegisterValue ); +unsigned char Wb35Reg_Read( phw_data_t pHwData, u16 RegisterNo, u32 * pRegisterValue ); +unsigned char Wb35Reg_ReadSync( phw_data_t pHwData, u16 RegisterNo, u32 * pRegisterValue ); unsigned char Wb35Reg_Write( phw_data_t pHwData, u16 RegisterNo, u32 RegisterValue ); unsigned char Wb35Reg_WriteSync( phw_data_t pHwData, u16 RegisterNo, u32 RegisterValue ); unsigned char Wb35Reg_WriteWithCallbackValue( phw_data_t pHwData, u16 RegisterNo, u32 RegisterValue, - PCHAR pValue, - s8 Len); -unsigned char Wb35Reg_BurstWrite( phw_data_t pHwData, u16 RegisterNo, PULONG pRegisterData, u8 NumberOfData, u8 Flag ); + s8 *pValue, + s8 Len); +unsigned char Wb35Reg_BurstWrite( phw_data_t pHwData, u16 RegisterNo, u32 * pRegisterData, u8 NumberOfData, u8 Flag ); void Wb35Reg_EP0VM( phw_data_t pHwData ); void Wb35Reg_EP0VM_start( phw_data_t pHwData ); @@ -47,7 +47,7 @@ void Wb35Reg_EP0VM_complete( PURB pUrb ); u32 BitReverse( u32 dwData, u32 DataLength); void CardGetMulticastBit( u8 Address[MAC_ADDR_LENGTH], u8 *Byte, u8 *Value ); -u32 CardComputeCrc( PUCHAR Buffer, u32 Length ); +u32 CardComputeCrc( u8 * Buffer, u32 Length ); void Wb35Reg_phy_calibration( phw_data_t pHwData ); void Wb35Reg_Update( phw_data_t pHwData, u16 RegisterNo, u32 RegisterValue ); diff --git a/drivers/staging/winbond/linux/wb35reg_s.h b/drivers/staging/winbond/linux/wb35reg_s.h index a7595b1e733..9b763012610 100644 --- a/drivers/staging/winbond/linux/wb35reg_s.h +++ b/drivers/staging/winbond/linux/wb35reg_s.h @@ -75,7 +75,7 @@ typedef struct _REG_QUEUE union { u32 VALUE; - PULONG pBuffer; + u32 * pBuffer; }; u8 RESERVED[4];// space reserved for communication diff --git a/drivers/staging/winbond/linux/wb35rx.c b/drivers/staging/winbond/linux/wb35rx.c index 26157eb3d5a..c5c331773db 100644 --- a/drivers/staging/winbond/linux/wb35rx.c +++ b/drivers/staging/winbond/linux/wb35rx.c @@ -27,7 +27,7 @@ void Wb35Rx_start(phw_data_t pHwData) void Wb35Rx( phw_data_t pHwData ) { PWB35RX pWb35Rx = &pHwData->Wb35Rx; - PUCHAR pRxBufferAddress; + u8 * pRxBufferAddress; PURB pUrb = (PURB)pWb35Rx->RxUrb; int retv; u32 RxBufferId; @@ -89,7 +89,7 @@ void Wb35Rx_Complete(PURB pUrb) { phw_data_t pHwData = pUrb->context; PWB35RX pWb35Rx = &pHwData->Wb35Rx; - PUCHAR pRxBufferAddress; + u8 * pRxBufferAddress; u32 SizeCheck; u16 BulkLength; u32 RxBufferId; @@ -116,7 +116,7 @@ void Wb35Rx_Complete(PURB pUrb) // Start to process the data only in successful condition pWb35Rx->RxOwner[ RxBufferId ] = 0; // Set the owner to driver - R00.value = le32_to_cpu(*(PULONG)pRxBufferAddress); + R00.value = le32_to_cpu(*(u32 *)pRxBufferAddress); // The URB is completed, check the result if (pWb35Rx->EP3VM_status != 0) { @@ -223,7 +223,7 @@ void Wb35Rx_reset_descriptor( phw_data_t pHwData ) void Wb35Rx_adjust(PDESCRIPTOR pRxDes) { - PULONG pRxBufferAddress; + u32 * pRxBufferAddress; u32 DecryptionMethod; u32 i; u16 BufferSize; @@ -264,7 +264,7 @@ u16 Wb35Rx_indicate(phw_data_t pHwData) { DESCRIPTOR RxDes; PWB35RX pWb35Rx = &pHwData->Wb35Rx; - PUCHAR pRxBufferAddress; + u8 * pRxBufferAddress; u16 PacketSize; u16 stmp, BufferSize, stmp2 = 0; u32 RxBufferId; @@ -283,13 +283,13 @@ u16 Wb35Rx_indicate(phw_data_t pHwData) // Parse the bulkin buffer while (BufferSize >= 4) { - if ((cpu_to_le32(*(PULONG)pRxBufferAddress) & 0x0fffffff) == RX_END_TAG) //Is ending? 921002.9.a + if ((cpu_to_le32(*(u32 *)pRxBufferAddress) & 0x0fffffff) == RX_END_TAG) //Is ending? 921002.9.a break; // Get the R00 R01 first - RxDes.R00.value = le32_to_cpu(*(PULONG)pRxBufferAddress); + RxDes.R00.value = le32_to_cpu(*(u32 *)pRxBufferAddress); PacketSize = (u16)RxDes.R00.R00_receive_byte_count; - RxDes.R01.value = le32_to_cpu(*((PULONG)(pRxBufferAddress+4))); + RxDes.R01.value = le32_to_cpu(*((u32 *)(pRxBufferAddress+4))); // For new DMA 4k if ((PacketSize & 0x03) > 0) PacketSize -= 4; diff --git a/drivers/staging/winbond/linux/wb35rx_s.h b/drivers/staging/winbond/linux/wb35rx_s.h index 53b831fdeb7..b90c269e6ad 100644 --- a/drivers/staging/winbond/linux/wb35rx_s.h +++ b/drivers/staging/winbond/linux/wb35rx_s.h @@ -41,7 +41,7 @@ typedef struct _WB35RX u32 Ep3ErrorCount2; // 20060625.1 Usbd for Rx DMA error count int EP3VM_status; - PUCHAR pDRx; + u8 * pDRx; } WB35RX, *PWB35RX; diff --git a/drivers/staging/winbond/linux/wb35tx.c b/drivers/staging/winbond/linux/wb35tx.c index cf19c3bc524..bcb014a073d 100644 --- a/drivers/staging/winbond/linux/wb35tx.c +++ b/drivers/staging/winbond/linux/wb35tx.c @@ -12,7 +12,7 @@ unsigned char -Wb35Tx_get_tx_buffer(phw_data_t pHwData, PUCHAR *pBuffer ) +Wb35Tx_get_tx_buffer(phw_data_t pHwData, u8 **pBuffer) { PWB35TX pWb35Tx = &pHwData->Wb35Tx; @@ -37,7 +37,7 @@ void Wb35Tx(phw_data_t pHwData) { PWB35TX pWb35Tx = &pHwData->Wb35Tx; PADAPTER Adapter = pHwData->Adapter; - PUCHAR pTxBufferAddress; + u8 *pTxBufferAddress; PMDS pMds = &Adapter->Mds; struct urb * pUrb = (struct urb *)pWb35Tx->Tx4Urb; int retv; @@ -225,7 +225,7 @@ void Wb35Tx_EP2VM(phw_data_t pHwData) { PWB35TX pWb35Tx = &pHwData->Wb35Tx; struct urb * pUrb = (struct urb *)pWb35Tx->Tx2Urb; - PULONG pltmp = (PULONG)pWb35Tx->EP2_buf; + u32 * pltmp = (u32 *)pWb35Tx->EP2_buf; int retv; do { @@ -266,7 +266,7 @@ void Wb35Tx_EP2VM_complete(struct urb * pUrb) T02_DESCRIPTOR T02, TSTATUS; PADAPTER Adapter = (PADAPTER)pHwData->Adapter; PWB35TX pWb35Tx = &pHwData->Wb35Tx; - PULONG pltmp = (PULONG)pWb35Tx->EP2_buf; + u32 * pltmp = (u32 *)pWb35Tx->EP2_buf; u32 i; u16 InterruptInLength; diff --git a/drivers/staging/winbond/linux/wb35tx_f.h b/drivers/staging/winbond/linux/wb35tx_f.h index 7705a8454dc..107b1291813 100644 --- a/drivers/staging/winbond/linux/wb35tx_f.h +++ b/drivers/staging/winbond/linux/wb35tx_f.h @@ -3,7 +3,7 @@ //==================================== unsigned char Wb35Tx_initial( phw_data_t pHwData ); void Wb35Tx_destroy( phw_data_t pHwData ); -unsigned char Wb35Tx_get_tx_buffer( phw_data_t pHwData, PUCHAR *pBuffer ); +unsigned char Wb35Tx_get_tx_buffer( phw_data_t pHwData, u8 **pBuffer ); void Wb35Tx_EP2VM( phw_data_t pHwData ); void Wb35Tx_EP2VM_start( phw_data_t pHwData ); diff --git a/drivers/staging/winbond/linux/wbusb.c b/drivers/staging/winbond/linux/wbusb.c index cbad5fb0595..ee9f4710316 100644 --- a/drivers/staging/winbond/linux/wbusb.c +++ b/drivers/staging/winbond/linux/wbusb.c @@ -136,7 +136,7 @@ static int wbsoft_config(struct ieee80211_hw *dev, struct ieee80211_conf *conf) hal_set_current_channel(&my_adapter->sHwData, ch); hal_set_beacon_period(&my_adapter->sHwData, conf->beacon_int); // hal_set_cap_info(&my_adapter->sHwData, ?? ); -// hal_set_ssid(phw_data_t pHwData, PUCHAR pssid, u8 ssid_len); ?? +// hal_set_ssid(phw_data_t pHwData, u8 * pssid, u8 ssid_len); ?? hal_set_accept_broadcast(&my_adapter->sHwData, 1); hal_set_accept_promiscuous(&my_adapter->sHwData, 1); hal_set_accept_multicast(&my_adapter->sHwData, 1); @@ -148,7 +148,7 @@ static int wbsoft_config(struct ieee80211_hw *dev, struct ieee80211_conf *conf) // hal_start_bss(&my_adapter->sHwData, WLAN_BSSTYPE_INFRASTRUCTURE); ?? -//void hal_set_rates(phw_data_t pHwData, PUCHAR pbss_rates, +//void hal_set_rates(phw_data_t pHwData, u8 * pbss_rates, // u8 length, unsigned char basic_rate_set) return 0; |