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;
// 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));
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)
return TRUE;
} else {
- if (pUrb)
- usb_free_urb(pUrb);
+ if (urb)
+ usb_free_urb(urb);
if (pRegQueue)
kfree(pRegQueue);
return FALSE;
{
PWB35REG pWb35Reg = &pHwData->Wb35Reg;
struct usb_ctrlrequest *dr;
- PURB pUrb = NULL;
+ struct urb *urb = NULL;
PREG_QUEUE pRegQueue = NULL;
u16 UrbSize;
// 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);
// 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)
return TRUE;
} else {
- if (pUrb)
- usb_free_urb(pUrb);
+ if (urb)
+ usb_free_urb(urb);
kfree(pRegQueue);
return FALSE;
}
{
PWB35REG pWb35Reg = &pHwData->Wb35Reg;
struct usb_ctrlrequest *dr;
- PURB pUrb = NULL;
+ struct urb *urb = NULL;
PREG_QUEUE pRegQueue = NULL;
u16 UrbSize;
// 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);
// 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;
Wb35Reg_EP0VM_start(pHwData);
return TRUE;
} else {
- if (pUrb)
- usb_free_urb(pUrb);
+ if (urb)
+ usb_free_urb(urb);
kfree(pRegQueue);
return FALSE;
}
{
PWB35REG pWb35Reg = &pHwData->Wb35Reg;
struct usb_ctrlrequest * dr;
- PURB pUrb;
+ struct urb *urb;
PREG_QUEUE pRegQueue;
u16 UrbSize;
// 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;
// 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;
return TRUE;
} else {
- if (pUrb)
- usb_free_urb( pUrb );
+ if (urb)
+ usb_free_urb( urb );
kfree(pRegQueue);
return FALSE;
}
Wb35Reg_EP0VM(phw_data_t pHwData )
{
PWB35REG pWb35Reg = &pHwData->Wb35Reg;
- PURB pUrb;
+ struct urb *urb;
struct usb_ctrlrequest *dr;
u32 * pBuffer;
int ret = -1;
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_
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;
kfree(pRegQueue);
}
- usb_free_urb(pUrb);
+ usb_free_urb(urb);
}
Wb35Reg_destroy(phw_data_t pHwData)
{
PWB35REG pWb35Reg = &pHwData->Wb35Reg;
- PURB pUrb;
+ struct urb *urb;
PREG_QUEUE pRegQueue;
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_
{
PWB35RX pWb35Rx = &pHwData->Wb35Rx;
u8 * pRxBufferAddress;
- PURB pUrb = (PURB)pWb35Rx->RxUrb;
+ struct urb *urb = pWb35Rx->RxUrb;
int retv;
u32 RxBufferId;
}
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");
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;
// 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;