Commit f37435ce authored by Pekka Enberg's avatar Pekka Enberg Committed by Greg Kroah-Hartman

Staging: w35und: reg queue struct typedef removal

This patch removes the struct typedefs for reg queues.
Signed-off-by: default avatarPekka Enberg <penberg@cs.helsinki.fi>
Acked-by: default avatarPavel Machek <pavel@suse.cz>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent a55a89b1
...@@ -14,7 +14,7 @@ Wb35Reg_BurstWrite(phw_data_t pHwData, u16 RegisterNo, u32 * pRegisterData, u8 N ...@@ -14,7 +14,7 @@ Wb35Reg_BurstWrite(phw_data_t pHwData, u16 RegisterNo, u32 * pRegisterData, u8 N
{ {
PWB35REG pWb35Reg = &pHwData->Wb35Reg; PWB35REG pWb35Reg = &pHwData->Wb35Reg;
struct urb *urb = NULL; struct urb *urb = NULL;
PREG_QUEUE pRegQueue = NULL; struct wb35_reg_queue *reg_queue = NULL;
u16 UrbSize; u16 UrbSize;
struct usb_ctrlrequest *dr; struct usb_ctrlrequest *dr;
u16 i, DataSize = NumberOfData*4; u16 i, DataSize = NumberOfData*4;
...@@ -24,34 +24,34 @@ Wb35Reg_BurstWrite(phw_data_t pHwData, u16 RegisterNo, u32 * pRegisterData, u8 N ...@@ -24,34 +24,34 @@ Wb35Reg_BurstWrite(phw_data_t pHwData, u16 RegisterNo, u32 * pRegisterData, u8 N
return FALSE; return FALSE;
// Trying to use burst write function if use new hardware // Trying to use burst write function if use new hardware
UrbSize = sizeof(REG_QUEUE) + DataSize + sizeof(struct usb_ctrlrequest); UrbSize = sizeof(struct wb35_reg_queue) + DataSize + sizeof(struct usb_ctrlrequest);
OS_MEMORY_ALLOC( (void* *)&pRegQueue, UrbSize ); OS_MEMORY_ALLOC( (void* *)&reg_queue, UrbSize );
urb = wb_usb_alloc_urb(0); urb = wb_usb_alloc_urb(0);
if( urb && pRegQueue ) { if( urb && reg_queue ) {
pRegQueue->DIRECT = 2;// burst write register reg_queue->DIRECT = 2;// burst write register
pRegQueue->INDEX = RegisterNo; reg_queue->INDEX = RegisterNo;
pRegQueue->pBuffer = (u32 *)((u8 *)pRegQueue + sizeof(REG_QUEUE)); reg_queue->pBuffer = (u32 *)((u8 *)reg_queue + sizeof(struct wb35_reg_queue));
memcpy( pRegQueue->pBuffer, pRegisterData, DataSize ); memcpy( reg_queue->pBuffer, pRegisterData, DataSize );
//the function for reversing register data from little endian to big endian //the function for reversing register data from little endian to big endian
for( i=0; i<NumberOfData ; i++ ) for( i=0; i<NumberOfData ; i++ )
pRegQueue->pBuffer[i] = cpu_to_le32( pRegQueue->pBuffer[i] ); reg_queue->pBuffer[i] = cpu_to_le32( reg_queue->pBuffer[i] );
dr = (struct usb_ctrlrequest *)((u8 *)pRegQueue + sizeof(REG_QUEUE) + DataSize); dr = (struct usb_ctrlrequest *)((u8 *)reg_queue + sizeof(struct wb35_reg_queue) + DataSize);
dr->bRequestType = USB_TYPE_VENDOR | USB_DIR_OUT | USB_RECIP_DEVICE; dr->bRequestType = USB_TYPE_VENDOR | USB_DIR_OUT | USB_RECIP_DEVICE;
dr->bRequest = 0x04; // USB or vendor-defined request code, burst mode 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 dr->wValue = cpu_to_le16( Flag ); // 0: Register number auto-increment, 1: No auto increment
dr->wIndex = cpu_to_le16( RegisterNo ); dr->wIndex = cpu_to_le16( RegisterNo );
dr->wLength = cpu_to_le16( DataSize ); dr->wLength = cpu_to_le16( DataSize );
pRegQueue->Next = NULL; reg_queue->Next = NULL;
pRegQueue->pUsbReq = dr; reg_queue->pUsbReq = dr;
pRegQueue->urb = urb; reg_queue->urb = urb;
spin_lock_irq( &pWb35Reg->EP0VM_spin_lock ); spin_lock_irq( &pWb35Reg->EP0VM_spin_lock );
if (pWb35Reg->pRegFirst == NULL) if (pWb35Reg->reg_first == NULL)
pWb35Reg->pRegFirst = pRegQueue; pWb35Reg->reg_first = reg_queue;
else else
pWb35Reg->pRegLast->Next = pRegQueue; pWb35Reg->reg_last->Next = reg_queue;
pWb35Reg->pRegLast = pRegQueue; pWb35Reg->reg_last = reg_queue;
spin_unlock_irq( &pWb35Reg->EP0VM_spin_lock ); spin_unlock_irq( &pWb35Reg->EP0VM_spin_lock );
...@@ -62,8 +62,8 @@ Wb35Reg_BurstWrite(phw_data_t pHwData, u16 RegisterNo, u32 * pRegisterData, u8 N ...@@ -62,8 +62,8 @@ Wb35Reg_BurstWrite(phw_data_t pHwData, u16 RegisterNo, u32 * pRegisterData, u8 N
} else { } else {
if (urb) if (urb)
usb_free_urb(urb); usb_free_urb(urb);
if (pRegQueue) if (reg_queue)
kfree(pRegQueue); kfree(reg_queue);
return FALSE; return FALSE;
} }
return FALSE; return FALSE;
...@@ -164,7 +164,7 @@ Wb35Reg_Write( phw_data_t pHwData, u16 RegisterNo, u32 RegisterValue ) ...@@ -164,7 +164,7 @@ Wb35Reg_Write( phw_data_t pHwData, u16 RegisterNo, u32 RegisterValue )
PWB35REG pWb35Reg = &pHwData->Wb35Reg; PWB35REG pWb35Reg = &pHwData->Wb35Reg;
struct usb_ctrlrequest *dr; struct usb_ctrlrequest *dr;
struct urb *urb = NULL; struct urb *urb = NULL;
PREG_QUEUE pRegQueue = NULL; struct wb35_reg_queue *reg_queue = NULL;
u16 UrbSize; u16 UrbSize;
...@@ -173,15 +173,15 @@ Wb35Reg_Write( phw_data_t pHwData, u16 RegisterNo, u32 RegisterValue ) ...@@ -173,15 +173,15 @@ Wb35Reg_Write( phw_data_t pHwData, u16 RegisterNo, u32 RegisterValue )
return FALSE; return FALSE;
// update the register by send urb request------------------------------------ // update the register by send urb request------------------------------------
UrbSize = sizeof(REG_QUEUE) + sizeof(struct usb_ctrlrequest); UrbSize = sizeof(struct wb35_reg_queue) + sizeof(struct usb_ctrlrequest);
OS_MEMORY_ALLOC( (void* *)&pRegQueue, UrbSize ); OS_MEMORY_ALLOC( (void* *)&reg_queue, UrbSize );
urb = wb_usb_alloc_urb(0); urb = wb_usb_alloc_urb(0);
if (urb && pRegQueue) { if (urb && reg_queue) {
pRegQueue->DIRECT = 1;// burst write register reg_queue->DIRECT = 1;// burst write register
pRegQueue->INDEX = RegisterNo; reg_queue->INDEX = RegisterNo;
pRegQueue->VALUE = cpu_to_le32(RegisterValue); reg_queue->VALUE = cpu_to_le32(RegisterValue);
pRegQueue->RESERVED_VALID = FALSE; reg_queue->RESERVED_VALID = FALSE;
dr = (struct usb_ctrlrequest *)((u8 *)pRegQueue + sizeof(REG_QUEUE)); dr = (struct usb_ctrlrequest *)((u8 *)reg_queue + sizeof(struct wb35_reg_queue));
dr->bRequestType = USB_TYPE_VENDOR|USB_DIR_OUT |USB_RECIP_DEVICE; dr->bRequestType = USB_TYPE_VENDOR|USB_DIR_OUT |USB_RECIP_DEVICE;
dr->bRequest = 0x03; // USB or vendor-defined request code, burst mode dr->bRequest = 0x03; // USB or vendor-defined request code, burst mode
dr->wValue = cpu_to_le16(0x0); dr->wValue = cpu_to_le16(0x0);
...@@ -189,16 +189,16 @@ Wb35Reg_Write( phw_data_t pHwData, u16 RegisterNo, u32 RegisterValue ) ...@@ -189,16 +189,16 @@ Wb35Reg_Write( phw_data_t pHwData, u16 RegisterNo, u32 RegisterValue )
dr->wLength = cpu_to_le16(4); dr->wLength = cpu_to_le16(4);
// Enter the sending queue // Enter the sending queue
pRegQueue->Next = NULL; reg_queue->Next = NULL;
pRegQueue->pUsbReq = dr; reg_queue->pUsbReq = dr;
pRegQueue->urb = urb; reg_queue->urb = urb;
spin_lock_irq(&pWb35Reg->EP0VM_spin_lock ); spin_lock_irq(&pWb35Reg->EP0VM_spin_lock );
if (pWb35Reg->pRegFirst == NULL) if (pWb35Reg->reg_first == NULL)
pWb35Reg->pRegFirst = pRegQueue; pWb35Reg->reg_first = reg_queue;
else else
pWb35Reg->pRegLast->Next = pRegQueue; pWb35Reg->reg_last->Next = reg_queue;
pWb35Reg->pRegLast = pRegQueue; pWb35Reg->reg_last = reg_queue;
spin_unlock_irq( &pWb35Reg->EP0VM_spin_lock ); spin_unlock_irq( &pWb35Reg->EP0VM_spin_lock );
...@@ -209,7 +209,7 @@ Wb35Reg_Write( phw_data_t pHwData, u16 RegisterNo, u32 RegisterValue ) ...@@ -209,7 +209,7 @@ Wb35Reg_Write( phw_data_t pHwData, u16 RegisterNo, u32 RegisterValue )
} else { } else {
if (urb) if (urb)
usb_free_urb(urb); usb_free_urb(urb);
kfree(pRegQueue); kfree(reg_queue);
return FALSE; return FALSE;
} }
} }
...@@ -225,7 +225,7 @@ Wb35Reg_WriteWithCallbackValue( phw_data_t pHwData, u16 RegisterNo, u32 Register ...@@ -225,7 +225,7 @@ Wb35Reg_WriteWithCallbackValue( phw_data_t pHwData, u16 RegisterNo, u32 Register
PWB35REG pWb35Reg = &pHwData->Wb35Reg; PWB35REG pWb35Reg = &pHwData->Wb35Reg;
struct usb_ctrlrequest *dr; struct usb_ctrlrequest *dr;
struct urb *urb = NULL; struct urb *urb = NULL;
PREG_QUEUE pRegQueue = NULL; struct wb35_reg_queue *reg_queue = NULL;
u16 UrbSize; u16 UrbSize;
// Module shutdown // Module shutdown
...@@ -233,17 +233,17 @@ Wb35Reg_WriteWithCallbackValue( phw_data_t pHwData, u16 RegisterNo, u32 Register ...@@ -233,17 +233,17 @@ Wb35Reg_WriteWithCallbackValue( phw_data_t pHwData, u16 RegisterNo, u32 Register
return FALSE; return FALSE;
// update the register by send urb request------------------------------------ // update the register by send urb request------------------------------------
UrbSize = sizeof(REG_QUEUE) + sizeof(struct usb_ctrlrequest); UrbSize = sizeof(struct wb35_reg_queue) + sizeof(struct usb_ctrlrequest);
OS_MEMORY_ALLOC((void* *) &pRegQueue, UrbSize ); OS_MEMORY_ALLOC((void* *) &reg_queue, UrbSize );
urb = wb_usb_alloc_urb(0); urb = wb_usb_alloc_urb(0);
if (urb && pRegQueue) { if (urb && reg_queue) {
pRegQueue->DIRECT = 1;// burst write register reg_queue->DIRECT = 1;// burst write register
pRegQueue->INDEX = RegisterNo; reg_queue->INDEX = RegisterNo;
pRegQueue->VALUE = cpu_to_le32(RegisterValue); reg_queue->VALUE = cpu_to_le32(RegisterValue);
//NOTE : Users must guarantee the size of value will not exceed the buffer size. //NOTE : Users must guarantee the size of value will not exceed the buffer size.
memcpy(pRegQueue->RESERVED, pValue, Len); memcpy(reg_queue->RESERVED, pValue, Len);
pRegQueue->RESERVED_VALID = TRUE; reg_queue->RESERVED_VALID = TRUE;
dr = (struct usb_ctrlrequest *)((u8 *)pRegQueue + sizeof(REG_QUEUE)); dr = (struct usb_ctrlrequest *)((u8 *)reg_queue + sizeof(struct wb35_reg_queue));
dr->bRequestType = USB_TYPE_VENDOR|USB_DIR_OUT |USB_RECIP_DEVICE; dr->bRequestType = USB_TYPE_VENDOR|USB_DIR_OUT |USB_RECIP_DEVICE;
dr->bRequest = 0x03; // USB or vendor-defined request code, burst mode dr->bRequest = 0x03; // USB or vendor-defined request code, burst mode
dr->wValue = cpu_to_le16(0x0); dr->wValue = cpu_to_le16(0x0);
...@@ -251,15 +251,15 @@ Wb35Reg_WriteWithCallbackValue( phw_data_t pHwData, u16 RegisterNo, u32 Register ...@@ -251,15 +251,15 @@ Wb35Reg_WriteWithCallbackValue( phw_data_t pHwData, u16 RegisterNo, u32 Register
dr->wLength = cpu_to_le16(4); dr->wLength = cpu_to_le16(4);
// Enter the sending queue // Enter the sending queue
pRegQueue->Next = NULL; reg_queue->Next = NULL;
pRegQueue->pUsbReq = dr; reg_queue->pUsbReq = dr;
pRegQueue->urb = urb; reg_queue->urb = urb;
spin_lock_irq (&pWb35Reg->EP0VM_spin_lock ); spin_lock_irq (&pWb35Reg->EP0VM_spin_lock );
if( pWb35Reg->pRegFirst == NULL ) if( pWb35Reg->reg_first == NULL )
pWb35Reg->pRegFirst = pRegQueue; pWb35Reg->reg_first = reg_queue;
else else
pWb35Reg->pRegLast->Next = pRegQueue; pWb35Reg->reg_last->Next = reg_queue;
pWb35Reg->pRegLast = pRegQueue; pWb35Reg->reg_last = reg_queue;
spin_unlock_irq ( &pWb35Reg->EP0VM_spin_lock ); spin_unlock_irq ( &pWb35Reg->EP0VM_spin_lock );
...@@ -269,7 +269,7 @@ Wb35Reg_WriteWithCallbackValue( phw_data_t pHwData, u16 RegisterNo, u32 Register ...@@ -269,7 +269,7 @@ Wb35Reg_WriteWithCallbackValue( phw_data_t pHwData, u16 RegisterNo, u32 Register
} else { } else {
if (urb) if (urb)
usb_free_urb(urb); usb_free_urb(urb);
kfree(pRegQueue); kfree(reg_queue);
return FALSE; return FALSE;
} }
} }
...@@ -332,7 +332,7 @@ Wb35Reg_Read(phw_data_t pHwData, u16 RegisterNo, u32 * pRegisterValue ) ...@@ -332,7 +332,7 @@ Wb35Reg_Read(phw_data_t pHwData, u16 RegisterNo, u32 * pRegisterValue )
PWB35REG pWb35Reg = &pHwData->Wb35Reg; PWB35REG pWb35Reg = &pHwData->Wb35Reg;
struct usb_ctrlrequest * dr; struct usb_ctrlrequest * dr;
struct urb *urb; struct urb *urb;
PREG_QUEUE pRegQueue; struct wb35_reg_queue *reg_queue;
u16 UrbSize; u16 UrbSize;
// Module shutdown // Module shutdown
...@@ -340,15 +340,15 @@ Wb35Reg_Read(phw_data_t pHwData, u16 RegisterNo, u32 * pRegisterValue ) ...@@ -340,15 +340,15 @@ Wb35Reg_Read(phw_data_t pHwData, u16 RegisterNo, u32 * pRegisterValue )
return FALSE; return FALSE;
// update the variable by send Urb to read register ------------------------------------ // update the variable by send Urb to read register ------------------------------------
UrbSize = sizeof(REG_QUEUE) + sizeof(struct usb_ctrlrequest); UrbSize = sizeof(struct wb35_reg_queue) + sizeof(struct usb_ctrlrequest);
OS_MEMORY_ALLOC( (void* *)&pRegQueue, UrbSize ); OS_MEMORY_ALLOC( (void* *)&reg_queue, UrbSize );
urb = wb_usb_alloc_urb(0); urb = wb_usb_alloc_urb(0);
if( urb && pRegQueue ) if( urb && reg_queue )
{ {
pRegQueue->DIRECT = 0;// read register reg_queue->DIRECT = 0;// read register
pRegQueue->INDEX = RegisterNo; reg_queue->INDEX = RegisterNo;
pRegQueue->pBuffer = pRegisterValue; reg_queue->pBuffer = pRegisterValue;
dr = (struct usb_ctrlrequest *)((u8 *)pRegQueue + sizeof(REG_QUEUE)); dr = (struct usb_ctrlrequest *)((u8 *)reg_queue + sizeof(struct wb35_reg_queue));
dr->bRequestType = USB_TYPE_VENDOR|USB_RECIP_DEVICE|USB_DIR_IN; dr->bRequestType = USB_TYPE_VENDOR|USB_RECIP_DEVICE|USB_DIR_IN;
dr->bRequest = 0x01; // USB or vendor-defined request code, burst mode dr->bRequest = 0x01; // USB or vendor-defined request code, burst mode
dr->wValue = cpu_to_le16(0x0); dr->wValue = cpu_to_le16(0x0);
...@@ -356,15 +356,15 @@ Wb35Reg_Read(phw_data_t pHwData, u16 RegisterNo, u32 * pRegisterValue ) ...@@ -356,15 +356,15 @@ Wb35Reg_Read(phw_data_t pHwData, u16 RegisterNo, u32 * pRegisterValue )
dr->wLength = cpu_to_le16 (4); dr->wLength = cpu_to_le16 (4);
// Enter the sending queue // Enter the sending queue
pRegQueue->Next = NULL; reg_queue->Next = NULL;
pRegQueue->pUsbReq = dr; reg_queue->pUsbReq = dr;
pRegQueue->urb = urb; reg_queue->urb = urb;
spin_lock_irq ( &pWb35Reg->EP0VM_spin_lock ); spin_lock_irq ( &pWb35Reg->EP0VM_spin_lock );
if( pWb35Reg->pRegFirst == NULL ) if( pWb35Reg->reg_first == NULL )
pWb35Reg->pRegFirst = pRegQueue; pWb35Reg->reg_first = reg_queue;
else else
pWb35Reg->pRegLast->Next = pRegQueue; pWb35Reg->reg_last->Next = reg_queue;
pWb35Reg->pRegLast = pRegQueue; pWb35Reg->reg_last = reg_queue;
spin_unlock_irq( &pWb35Reg->EP0VM_spin_lock ); spin_unlock_irq( &pWb35Reg->EP0VM_spin_lock );
...@@ -375,7 +375,7 @@ Wb35Reg_Read(phw_data_t pHwData, u16 RegisterNo, u32 * pRegisterValue ) ...@@ -375,7 +375,7 @@ Wb35Reg_Read(phw_data_t pHwData, u16 RegisterNo, u32 * pRegisterValue )
} else { } else {
if (urb) if (urb)
usb_free_urb( urb ); usb_free_urb( urb );
kfree(pRegQueue); kfree(reg_queue);
return FALSE; return FALSE;
} }
} }
...@@ -401,7 +401,7 @@ Wb35Reg_EP0VM(phw_data_t pHwData ) ...@@ -401,7 +401,7 @@ Wb35Reg_EP0VM(phw_data_t pHwData )
struct usb_ctrlrequest *dr; struct usb_ctrlrequest *dr;
u32 * pBuffer; u32 * pBuffer;
int ret = -1; int ret = -1;
PREG_QUEUE pRegQueue; struct wb35_reg_queue *reg_queue;
if (pWb35Reg->SyncIoPause) if (pWb35Reg->SyncIoPause)
...@@ -412,23 +412,23 @@ Wb35Reg_EP0VM(phw_data_t pHwData ) ...@@ -412,23 +412,23 @@ Wb35Reg_EP0VM(phw_data_t pHwData )
// Get the register data and send to USB through Irp // Get the register data and send to USB through Irp
spin_lock_irq( &pWb35Reg->EP0VM_spin_lock ); spin_lock_irq( &pWb35Reg->EP0VM_spin_lock );
pRegQueue = pWb35Reg->pRegFirst; reg_queue = pWb35Reg->reg_first;
spin_unlock_irq( &pWb35Reg->EP0VM_spin_lock ); spin_unlock_irq( &pWb35Reg->EP0VM_spin_lock );
if (!pRegQueue) if (!reg_queue)
goto cleanup; goto cleanup;
// Get an Urb, send it // Get an Urb, send it
urb = (struct urb *)pRegQueue->urb; urb = (struct urb *)reg_queue->urb;
dr = pRegQueue->pUsbReq; dr = reg_queue->pUsbReq;
urb = pRegQueue->urb; urb = reg_queue->urb;
pBuffer = pRegQueue->pBuffer; pBuffer = reg_queue->pBuffer;
if (pRegQueue->DIRECT == 1) // output if (reg_queue->DIRECT == 1) // output
pBuffer = &pRegQueue->VALUE; pBuffer = &reg_queue->VALUE;
usb_fill_control_urb( urb, pHwData->WbUsb.udev, usb_fill_control_urb( urb, pHwData->WbUsb.udev,
REG_DIRECTION(pHwData->WbUsb.udev,pRegQueue), REG_DIRECTION(pHwData->WbUsb.udev,reg_queue),
(u8 *)dr,pBuffer,cpu_to_le16(dr->wLength), (u8 *)dr,pBuffer,cpu_to_le16(dr->wLength),
Wb35Reg_EP0VM_complete, (void*)pHwData); Wb35Reg_EP0VM_complete, (void*)pHwData);
...@@ -456,7 +456,7 @@ Wb35Reg_EP0VM_complete(struct urb *urb) ...@@ -456,7 +456,7 @@ Wb35Reg_EP0VM_complete(struct urb *urb)
{ {
phw_data_t pHwData = (phw_data_t)urb->context; phw_data_t pHwData = (phw_data_t)urb->context;
PWB35REG pWb35Reg = &pHwData->Wb35Reg; PWB35REG pWb35Reg = &pHwData->Wb35Reg;
PREG_QUEUE pRegQueue; struct wb35_reg_queue *reg_queue;
// Variable setting // Variable setting
...@@ -469,10 +469,10 @@ Wb35Reg_EP0VM_complete(struct urb *urb) ...@@ -469,10 +469,10 @@ Wb35Reg_EP0VM_complete(struct urb *urb)
} else { } else {
// Complete to send, remove the URB from the first // Complete to send, remove the URB from the first
spin_lock_irq( &pWb35Reg->EP0VM_spin_lock ); spin_lock_irq( &pWb35Reg->EP0VM_spin_lock );
pRegQueue = pWb35Reg->pRegFirst; reg_queue = pWb35Reg->reg_first;
if (pRegQueue == pWb35Reg->pRegLast) if (reg_queue == pWb35Reg->reg_last)
pWb35Reg->pRegLast = NULL; pWb35Reg->reg_last = NULL;
pWb35Reg->pRegFirst = pWb35Reg->pRegFirst->Next; pWb35Reg->reg_first = pWb35Reg->reg_first->Next;
spin_unlock_irq( &pWb35Reg->EP0VM_spin_lock ); spin_unlock_irq( &pWb35Reg->EP0VM_spin_lock );
if (pWb35Reg->EP0VM_status) { if (pWb35Reg->EP0VM_status) {
...@@ -489,7 +489,7 @@ Wb35Reg_EP0VM_complete(struct urb *urb) ...@@ -489,7 +489,7 @@ Wb35Reg_EP0VM_complete(struct urb *urb)
Wb35Reg_EP0VM(pHwData); Wb35Reg_EP0VM(pHwData);
} }
kfree(pRegQueue); kfree(reg_queue);
} }
usb_free_urb(urb); usb_free_urb(urb);
...@@ -501,7 +501,7 @@ Wb35Reg_destroy(phw_data_t pHwData) ...@@ -501,7 +501,7 @@ Wb35Reg_destroy(phw_data_t pHwData)
{ {
PWB35REG pWb35Reg = &pHwData->Wb35Reg; PWB35REG pWb35Reg = &pHwData->Wb35Reg;
struct urb *urb; struct urb *urb;
PREG_QUEUE pRegQueue; struct wb35_reg_queue *reg_queue;
Uxx_power_off_procedure(pHwData); Uxx_power_off_procedure(pHwData);
...@@ -514,17 +514,17 @@ Wb35Reg_destroy(phw_data_t pHwData) ...@@ -514,17 +514,17 @@ Wb35Reg_destroy(phw_data_t pHwData)
// Release all the data in RegQueue // Release all the data in RegQueue
spin_lock_irq( &pWb35Reg->EP0VM_spin_lock ); spin_lock_irq( &pWb35Reg->EP0VM_spin_lock );
pRegQueue = pWb35Reg->pRegFirst; reg_queue = pWb35Reg->reg_first;
while (pRegQueue) { while (reg_queue) {
if (pRegQueue == pWb35Reg->pRegLast) if (reg_queue == pWb35Reg->reg_last)
pWb35Reg->pRegLast = NULL; pWb35Reg->reg_last = NULL;
pWb35Reg->pRegFirst = pWb35Reg->pRegFirst->Next; pWb35Reg->reg_first = pWb35Reg->reg_first->Next;
urb = pRegQueue->urb; urb = reg_queue->urb;
spin_unlock_irq( &pWb35Reg->EP0VM_spin_lock ); spin_unlock_irq( &pWb35Reg->EP0VM_spin_lock );
if (urb) { if (urb) {
usb_free_urb(urb); usb_free_urb(urb);
kfree(pRegQueue); kfree(reg_queue);
} else { } else {
#ifdef _PE_REG_DUMP_ #ifdef _PE_REG_DUMP_
WBDEBUG(("EP0 queue release error\n")); WBDEBUG(("EP0 queue release error\n"));
...@@ -532,7 +532,7 @@ Wb35Reg_destroy(phw_data_t pHwData) ...@@ -532,7 +532,7 @@ Wb35Reg_destroy(phw_data_t pHwData)
} }
spin_lock_irq( &pWb35Reg->EP0VM_spin_lock ); spin_lock_irq( &pWb35Reg->EP0VM_spin_lock );
pRegQueue = pWb35Reg->pRegFirst; reg_queue = pWb35Reg->reg_first;
} }
spin_unlock_irq( &pWb35Reg->EP0VM_spin_lock ); spin_unlock_irq( &pWb35Reg->EP0VM_spin_lock );
} }
......
...@@ -67,23 +67,19 @@ ...@@ -67,23 +67,19 @@
#define DEFAULT_DTIM_ALERT_TIME 0 #define DEFAULT_DTIM_ALERT_TIME 0
typedef struct _REG_QUEUE struct wb35_reg_queue {
{
struct urb *urb; struct urb *urb;
void* pUsbReq; void *pUsbReq;
void* Next; void *Next;
union union {
{
u32 VALUE; u32 VALUE;
u32 * pBuffer; u32 *pBuffer;
}; };
u8 RESERVED[4];// space reserved for communication u8 RESERVED[4]; // space reserved for communication
u16 INDEX; // For storing the register index u16 INDEX; // For storing the register index
u8 RESERVED_VALID; //Indicate whether the RESERVED space is valid at this command. u8 RESERVED_VALID; // Indicate whether the RESERVED space is valid at this command.
u8 DIRECT; // 0:In 1:Out u8 DIRECT; // 0:In 1:Out
};
} REG_QUEUE, *PREG_QUEUE;
//==================================== //====================================
// Internal variable for module // Internal variable for module
...@@ -145,8 +141,8 @@ typedef struct _WB35REG ...@@ -145,8 +141,8 @@ typedef struct _WB35REG
//------------------- //-------------------
spinlock_t EP0VM_spin_lock; // 4B spinlock_t EP0VM_spin_lock; // 4B
u32 EP0VM_status;//$$ u32 EP0VM_status;//$$
PREG_QUEUE pRegFirst; struct wb35_reg_queue *reg_first;
PREG_QUEUE pRegLast; struct wb35_reg_queue *reg_last;
OS_ATOMIC RegFireCount; OS_ATOMIC RegFireCount;
// Hardware status // Hardware status
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment