]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
Staging: w35und: purb typedef removal
authorPekka Enberg <penberg@cs.helsinki.fi>
Wed, 22 Oct 2008 08:01:16 +0000 (11:01 +0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 6 Jan 2009 21:51:40 +0000 (13:51 -0800)
This patch removes the struct urb pointer typedef from the driver code and
fixes up variable names that use the typedef while we're at it.

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>
drivers/staging/winbond/linux/common.h
drivers/staging/winbond/linux/wb35reg.c
drivers/staging/winbond/linux/wb35reg_f.h
drivers/staging/winbond/linux/wb35reg_s.h
drivers/staging/winbond/linux/wb35rx.c
drivers/staging/winbond/linux/wb35rx_f.h
drivers/staging/winbond/linux/wb35tx_f.h
drivers/staging/winbond/linux/wbusb_s.h

index 712a86cfa68b5650c1c0396f7914e4a31ed8fa0a..64bd1c7dff659b3355b48540a1c033fa70af893b 100644 (file)
 #define BIT(x)                  (1 << (x))
 #endif
 
-typedef struct urb * PURB;
-
-
-
 //==================================================================================================
 // Common function definition
 //==================================================================================================
index de4040bb762ceaa9c17aec6af54ce779364993ec..b7560b5c556b38b58348ae1a4c47a2839f1dfc43 100644 (file)
@@ -13,7 +13,7 @@ unsigned char
 Wb35Reg_BurstWrite(phw_data_t pHwData, u16 RegisterNo, u32 * pRegisterData, u8 NumberOfData, u8 Flag)
 {
        PWB35REG pWb35Reg = &pHwData->Wb35Reg;
-       PURB            pUrb = NULL;
+       struct urb      *urb = NULL;
        PREG_QUEUE      pRegQueue = NULL;
        u16             UrbSize;
        struct      usb_ctrlrequest *dr;
@@ -26,8 +26,8 @@ Wb35Reg_BurstWrite(phw_data_t pHwData, u16 RegisterNo, u32 * pRegisterData, u8 N
        // Trying to use burst write function if use new hardware
        UrbSize = sizeof(REG_QUEUE) + DataSize + sizeof(struct usb_ctrlrequest);
        OS_MEMORY_ALLOC( (void* *)&pRegQueue, UrbSize );
-       pUrb = wb_usb_alloc_urb(0);
-       if( pUrb && pRegQueue ) {
+       urb = wb_usb_alloc_urb(0);
+       if( urb && pRegQueue ) {
                pRegQueue->DIRECT = 2;// burst write register
                pRegQueue->INDEX = RegisterNo;
                pRegQueue->pBuffer = (u32 *)((u8 *)pRegQueue + sizeof(REG_QUEUE));
@@ -44,7 +44,7 @@ Wb35Reg_BurstWrite(phw_data_t pHwData, u16 RegisterNo, u32 * pRegisterData, u8 N
                dr->wLength = cpu_to_le16( DataSize );
                pRegQueue->Next = NULL;
                pRegQueue->pUsbReq = dr;
-               pRegQueue->pUrb = pUrb;
+               pRegQueue->urb = urb;
 
                spin_lock_irq( &pWb35Reg->EP0VM_spin_lock );
                if (pWb35Reg->pRegFirst == NULL)
@@ -60,8 +60,8 @@ Wb35Reg_BurstWrite(phw_data_t pHwData, u16 RegisterNo, u32 * pRegisterData, u8 N
 
                return TRUE;
        } else {
-               if (pUrb)
-                       usb_free_urb(pUrb);
+               if (urb)
+                       usb_free_urb(urb);
                if (pRegQueue)
                        kfree(pRegQueue);
                return FALSE;
@@ -163,7 +163,7 @@ Wb35Reg_Write(  phw_data_t pHwData,  u16 RegisterNo,  u32 RegisterValue )
 {
        PWB35REG        pWb35Reg = &pHwData->Wb35Reg;
        struct usb_ctrlrequest *dr;
-       PURB            pUrb = NULL;
+       struct urb      *urb = NULL;
        PREG_QUEUE      pRegQueue = NULL;
        u16             UrbSize;
 
@@ -175,8 +175,8 @@ Wb35Reg_Write(  phw_data_t pHwData,  u16 RegisterNo,  u32 RegisterValue )
        // update the register by send urb request------------------------------------
        UrbSize = sizeof(REG_QUEUE) + sizeof(struct usb_ctrlrequest);
        OS_MEMORY_ALLOC( (void* *)&pRegQueue, UrbSize );
-       pUrb = wb_usb_alloc_urb(0);
-       if (pUrb && pRegQueue) {
+       urb = wb_usb_alloc_urb(0);
+       if (urb && pRegQueue) {
                pRegQueue->DIRECT = 1;// burst write register
                pRegQueue->INDEX = RegisterNo;
                pRegQueue->VALUE = cpu_to_le32(RegisterValue);
@@ -191,7 +191,7 @@ Wb35Reg_Write(  phw_data_t pHwData,  u16 RegisterNo,  u32 RegisterValue )
                // Enter the sending queue
                pRegQueue->Next = NULL;
                pRegQueue->pUsbReq = dr;
-               pRegQueue->pUrb = pUrb;
+               pRegQueue->urb = urb;
 
                spin_lock_irq(&pWb35Reg->EP0VM_spin_lock );
                if (pWb35Reg->pRegFirst == NULL)
@@ -207,8 +207,8 @@ Wb35Reg_Write(  phw_data_t pHwData,  u16 RegisterNo,  u32 RegisterValue )
 
                return TRUE;
        } else {
-               if (pUrb)
-                       usb_free_urb(pUrb);
+               if (urb)
+                       usb_free_urb(urb);
                kfree(pRegQueue);
                return FALSE;
        }
@@ -224,7 +224,7 @@ Wb35Reg_WriteWithCallbackValue( phw_data_t pHwData, u16 RegisterNo, u32 Register
 {
        PWB35REG        pWb35Reg = &pHwData->Wb35Reg;
        struct usb_ctrlrequest *dr;
-       PURB            pUrb = NULL;
+       struct urb      *urb = NULL;
        PREG_QUEUE      pRegQueue = NULL;
        u16             UrbSize;
 
@@ -235,8 +235,8 @@ Wb35Reg_WriteWithCallbackValue( phw_data_t pHwData, u16 RegisterNo, u32 Register
        // update the register by send urb request------------------------------------
        UrbSize = sizeof(REG_QUEUE) + sizeof(struct usb_ctrlrequest);
        OS_MEMORY_ALLOC((void* *) &pRegQueue, UrbSize );
-       pUrb = wb_usb_alloc_urb(0);
-       if (pUrb && pRegQueue) {
+       urb = wb_usb_alloc_urb(0);
+       if (urb && pRegQueue) {
                pRegQueue->DIRECT = 1;// burst write register
                pRegQueue->INDEX = RegisterNo;
                pRegQueue->VALUE = cpu_to_le32(RegisterValue);
@@ -253,7 +253,7 @@ Wb35Reg_WriteWithCallbackValue( phw_data_t pHwData, u16 RegisterNo, u32 Register
                // Enter the sending queue
                pRegQueue->Next = NULL;
                pRegQueue->pUsbReq = dr;
-               pRegQueue->pUrb = pUrb;
+               pRegQueue->urb = urb;
                spin_lock_irq (&pWb35Reg->EP0VM_spin_lock );
                if( pWb35Reg->pRegFirst == NULL )
                        pWb35Reg->pRegFirst = pRegQueue;
@@ -267,8 +267,8 @@ Wb35Reg_WriteWithCallbackValue( phw_data_t pHwData, u16 RegisterNo, u32 Register
                Wb35Reg_EP0VM_start(pHwData);
                return TRUE;
        } else {
-               if (pUrb)
-                       usb_free_urb(pUrb);
+               if (urb)
+                       usb_free_urb(urb);
                kfree(pRegQueue);
                return FALSE;
        }
@@ -331,7 +331,7 @@ Wb35Reg_Read(phw_data_t pHwData, u16 RegisterNo,  u32 * pRegisterValue )
 {
        PWB35REG        pWb35Reg = &pHwData->Wb35Reg;
        struct usb_ctrlrequest * dr;
-       PURB            pUrb;
+       struct urb      *urb;
        PREG_QUEUE      pRegQueue;
        u16             UrbSize;
 
@@ -342,8 +342,8 @@ Wb35Reg_Read(phw_data_t pHwData, u16 RegisterNo,  u32 * pRegisterValue )
        // update the variable by send Urb to read register ------------------------------------
        UrbSize = sizeof(REG_QUEUE) + sizeof(struct usb_ctrlrequest);
        OS_MEMORY_ALLOC( (void* *)&pRegQueue, UrbSize );
-       pUrb = wb_usb_alloc_urb(0);
-       if( pUrb && pRegQueue )
+       urb = wb_usb_alloc_urb(0);
+       if( urb && pRegQueue )
        {
                pRegQueue->DIRECT = 0;// read register
                pRegQueue->INDEX = RegisterNo;
@@ -358,7 +358,7 @@ Wb35Reg_Read(phw_data_t pHwData, u16 RegisterNo,  u32 * pRegisterValue )
                // Enter the sending queue
                pRegQueue->Next = NULL;
                pRegQueue->pUsbReq = dr;
-               pRegQueue->pUrb = pUrb;
+               pRegQueue->urb = urb;
                spin_lock_irq ( &pWb35Reg->EP0VM_spin_lock );
                if( pWb35Reg->pRegFirst == NULL )
                        pWb35Reg->pRegFirst = pRegQueue;
@@ -373,8 +373,8 @@ Wb35Reg_Read(phw_data_t pHwData, u16 RegisterNo,  u32 * pRegisterValue )
 
                return TRUE;
        } else {
-               if (pUrb)
-                       usb_free_urb( pUrb );
+               if (urb)
+                       usb_free_urb( urb );
                kfree(pRegQueue);
                return FALSE;
        }
@@ -397,7 +397,7 @@ void
 Wb35Reg_EP0VM(phw_data_t pHwData )
 {
        PWB35REG        pWb35Reg = &pHwData->Wb35Reg;
-       PURB            pUrb;
+       struct urb      *urb;
        struct usb_ctrlrequest *dr;
        u32 *           pBuffer;
        int                     ret = -1;
@@ -419,22 +419,22 @@ Wb35Reg_EP0VM(phw_data_t pHwData )
                goto cleanup;
 
        // Get an Urb, send it
-       pUrb = (PURB)pRegQueue->pUrb;
+       urb = (struct urb *)pRegQueue->urb;
 
        dr = pRegQueue->pUsbReq;
-       pUrb = pRegQueue->pUrb;
+       urb = pRegQueue->urb;
        pBuffer = pRegQueue->pBuffer;
        if (pRegQueue->DIRECT == 1) // output
                pBuffer = &pRegQueue->VALUE;
 
-       usb_fill_control_urb( pUrb, pHwData->WbUsb.udev,
+       usb_fill_control_urb( urb, pHwData->WbUsb.udev,
                              REG_DIRECTION(pHwData->WbUsb.udev,pRegQueue),
                              (u8 *)dr,pBuffer,cpu_to_le16(dr->wLength),
                              Wb35Reg_EP0VM_complete, (void*)pHwData);
 
        pWb35Reg->EP0vm_state = VM_RUNNING;
 
-       ret = wb_usb_submit_urb( pUrb );
+       ret = wb_usb_submit_urb( urb );
 
        if (ret < 0) {
 #ifdef _PE_REG_DUMP_
@@ -452,16 +452,16 @@ Wb35Reg_EP0VM(phw_data_t pHwData )
 
 
 void
-Wb35Reg_EP0VM_complete(PURB pUrb)
+Wb35Reg_EP0VM_complete(struct urb *urb)
 {
-       phw_data_t  pHwData = (phw_data_t)pUrb->context;
+       phw_data_t  pHwData = (phw_data_t)urb->context;
        PWB35REG        pWb35Reg = &pHwData->Wb35Reg;
        PREG_QUEUE      pRegQueue;
 
 
        // Variable setting
        pWb35Reg->EP0vm_state = VM_COMPLETED;
-       pWb35Reg->EP0VM_status = pUrb->status;
+       pWb35Reg->EP0VM_status = urb->status;
 
        if (pHwData->SurpriseRemove) { // Let WbWlanHalt to handle surprise remove
                pWb35Reg->EP0vm_state = VM_STOP;
@@ -492,7 +492,7 @@ Wb35Reg_EP0VM_complete(PURB pUrb)
                kfree(pRegQueue);
        }
 
-       usb_free_urb(pUrb);
+       usb_free_urb(urb);
 }
 
 
@@ -500,7 +500,7 @@ void
 Wb35Reg_destroy(phw_data_t pHwData)
 {
        PWB35REG        pWb35Reg = &pHwData->Wb35Reg;
-       PURB            pUrb;
+       struct urb      *urb;
        PREG_QUEUE      pRegQueue;
 
 
@@ -520,10 +520,10 @@ Wb35Reg_destroy(phw_data_t pHwData)
                        pWb35Reg->pRegLast = NULL;
                pWb35Reg->pRegFirst = pWb35Reg->pRegFirst->Next;
 
-               pUrb = pRegQueue->pUrb;
+               urb = pRegQueue->urb;
                spin_unlock_irq( &pWb35Reg->EP0VM_spin_lock );
-               if (pUrb) {
-                       usb_free_urb(pUrb);
+               if (urb) {
+                       usb_free_urb(urb);
                        kfree(pRegQueue);
                } else {
                        #ifdef _PE_REG_DUMP_
index 3006cfe99ccdd53447214ee89950dca4d893a24f..fc940914e34f3bf22a03c47e822cd7797b79a3f2 100644 (file)
@@ -42,7 +42,7 @@ unsigned char Wb35Reg_BurstWrite(  phw_data_t pHwData,  u16 RegisterNo,  u32 * p
 
 void Wb35Reg_EP0VM(  phw_data_t pHwData );
 void Wb35Reg_EP0VM_start(  phw_data_t pHwData );
-void Wb35Reg_EP0VM_complete(  PURB pUrb );
+void Wb35Reg_EP0VM_complete(struct urb *urb);
 
 u32 BitReverse( u32 dwData, u32 DataLength);
 
index 8b35b93f7f0256f5119fbb37a35ff0aeab25fb40..c633b92c380386d04703728b6529846f3b975103 100644 (file)
@@ -69,7 +69,7 @@
 
 typedef struct _REG_QUEUE
 {
-    struct  urb *pUrb;
+    struct  urb *urb;
        void*   pUsbReq;
        void*   Next;
        union
index 545c6107091121d8c1523419b34e82e7c3228b96..24ef23e2d711801e1c91130a4ca31d1b7577bb52 100644 (file)
@@ -28,7 +28,7 @@ void Wb35Rx(  phw_data_t pHwData )
 {
        PWB35RX pWb35Rx = &pHwData->Wb35Rx;
        u8 *    pRxBufferAddress;
-       PURB    pUrb = (PURB)pWb35Rx->RxUrb;
+       struct urb *urb = pWb35Rx->RxUrb;
        int     retv;
        u32     RxBufferId;
 
@@ -63,14 +63,14 @@ void Wb35Rx(  phw_data_t pHwData )
        }
        pRxBufferAddress = pWb35Rx->pDRx;
 
-       usb_fill_bulk_urb(pUrb, pHwData->WbUsb.udev,
+       usb_fill_bulk_urb(urb, pHwData->WbUsb.udev,
                          usb_rcvbulkpipe(pHwData->WbUsb.udev, 3),
                          pRxBufferAddress, MAX_USB_RX_BUFFER,
                          Wb35Rx_Complete, pHwData);
 
        pWb35Rx->EP3vm_state = VM_RUNNING;
 
-       retv = wb_usb_submit_urb(pUrb);
+       retv = wb_usb_submit_urb(urb);
 
        if (retv != 0) {
                printk("Rx URB sending error\n");
@@ -84,9 +84,9 @@ error:
        OS_ATOMIC_DEC( pHwData->Adapter, &pWb35Rx->RxFireCounter );
 }
 
-void Wb35Rx_Complete(PURB pUrb)
+void Wb35Rx_Complete(struct urb *urb)
 {
-       phw_data_t      pHwData = pUrb->context;
+       phw_data_t      pHwData = urb->context;
        PWB35RX         pWb35Rx = &pHwData->Wb35Rx;
        u8 *            pRxBufferAddress;
        u32             SizeCheck;
@@ -96,12 +96,12 @@ void Wb35Rx_Complete(PURB pUrb)
 
        // Variable setting
        pWb35Rx->EP3vm_state = VM_COMPLETED;
-       pWb35Rx->EP3VM_status = pUrb->status;//Store the last result of Irp
+       pWb35Rx->EP3VM_status = urb->status;//Store the last result of Irp
 
        RxBufferId = pWb35Rx->CurrentRxBufferId;
 
        pRxBufferAddress = pWb35Rx->pDRx;
-       BulkLength = (u16)pUrb->actual_length;
+       BulkLength = (u16)urb->actual_length;
 
        // The IRP is completed
        pWb35Rx->EP3vm_state = VM_COMPLETED;
index daa3e73042bd0f625f4353d213edaa34a97a9fc5..565280e890b727d82d1c0dd4cd009089d40c0506 100644 (file)
@@ -10,7 +10,7 @@ void          Wb35Rx_adjust(  PDESCRIPTOR pRxDes );
 void           Wb35Rx_start(  phw_data_t pHwData );
 
 void           Wb35Rx(  phw_data_t pHwData );
-void           Wb35Rx_Complete(  PURB pUrb );
+void           Wb35Rx_Complete(struct urb *urb);
 
 
 
index 107b12918137ad726e99be9ea06bab91d771aa3e..1815c10b08135dcffb42f40d1637aac7c9136268 100644 (file)
@@ -7,12 +7,12 @@ 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 );
-void Wb35Tx_EP2VM_complete(  PURB purb );
+void Wb35Tx_EP2VM_complete(struct urb *urb);
 
 void Wb35Tx_start(  phw_data_t pHwData );
 void Wb35Tx_stop(  phw_data_t pHwData );
 void Wb35Tx(  phw_data_t pHwData );
-void Wb35Tx_complete(  PURB purb );
+void Wb35Tx_complete(struct urb *urb);
 void Wb35Tx_reset_descriptor(  phw_data_t pHwData );
 
 void Wb35Tx_CurrentTime(  phw_data_t pHwData,  u32 TimeCount );
index b7fc7220ebd27b3ed03acf2e79a6ea97dbfe11be..45e41b37194b44aaaf05a0c808f4de40ba79017c 100644 (file)
@@ -19,7 +19,7 @@
 typedef struct _RW_CONTEXT
 {
        void*                   pHwData;
-       PURB                    pUrb;
+       struct urb              *urb;
        void*                   pCallBackFunctionParameter;
 } RW_CONTEXT, *PRW_CONTEXT;