4 #include <linux/slab.h>
31 UrbSize =
sizeof(
struct wb35_reg_queue) + DataSize + sizeof(struct usb_ctrlrequest);
34 if (urb && reg_queue) {
35 reg_queue->DIRECT = 2;
36 reg_queue->INDEX = RegisterNo;
38 memcpy(reg_queue->pBuffer, pRegisterData, DataSize);
40 for (i = 0; i < NumberOfData ; i++)
41 reg_queue->pBuffer[i] =
cpu_to_le32(reg_queue->pBuffer[i]);
43 dr = (
struct usb_ctrlrequest *)((
u8 *)reg_queue +
sizeof(
struct wb35_reg_queue) + DataSize);
49 reg_queue->Next =
NULL;
50 reg_queue->pUsbReq = dr;
79 case 0x3b0: reg->
U1B0 = RegisterValue;
break;
103 case 0x100c: reg->
BB0C = RegisterValue;
break;
104 case 0x102c: reg->
BB2C = RegisterValue;
break;
105 case 0x1030: reg->
BB30 = RegisterValue;
break;
106 case 0x103c: reg->
BB3C = RegisterValue;
break;
107 case 0x1048: reg->
BB48 = RegisterValue;
break;
108 case 0x104c: reg->
BB4C = RegisterValue;
break;
109 case 0x1050: reg->
BB50 = RegisterValue;
break;
110 case 0x1054: reg->
BB54 = RegisterValue;
break;
111 case 0x1058: reg->
BB58 = RegisterValue;
break;
112 case 0x105c: reg->
BB5C = RegisterValue;
break;
113 case 0x1060: reg->
BB60 = RegisterValue;
break;
142 usb_sndctrlpipe(pHwData->
udev, 0),
144 0x0, RegisterNo, &RegisterValue, 4,
HZ * 100);
151 pr_debug(
"EP0 Write register usb message sending error\n");
175 UrbSize =
sizeof(
struct wb35_reg_queue) + sizeof(struct usb_ctrlrequest);
178 if (urb && reg_queue) {
179 reg_queue->DIRECT = 1;
180 reg_queue->INDEX = RegisterNo;
182 reg_queue->RESERVED_VALID =
false;
183 dr = (
struct usb_ctrlrequest *)((
u8 *)reg_queue +
sizeof(
struct wb35_reg_queue));
191 reg_queue->Next =
NULL;
192 reg_queue->pUsbReq = dr;
193 reg_queue->urb =
urb;
239 UrbSize =
sizeof(
struct wb35_reg_queue) + sizeof(struct usb_ctrlrequest);
242 if (urb && reg_queue) {
243 reg_queue->DIRECT = 1;
244 reg_queue->INDEX = RegisterNo;
247 memcpy(reg_queue->RESERVED, pValue, Len);
248 reg_queue->RESERVED_VALID =
true;
249 dr = (
struct usb_ctrlrequest *)((
u8 *)reg_queue +
sizeof(
struct wb35_reg_queue));
257 reg_queue->Next =
NULL;
258 reg_queue->pUsbReq = dr;
259 reg_queue->urb =
urb;
289 u32 *pltmp = pRegisterValue;
305 usb_rcvctrlpipe(pHwData->
udev, 0),
307 0x0, RegisterNo, pltmp, 4,
HZ * 100);
319 pr_debug(
"EP0 Read register usb message sending error\n");
345 UrbSize =
sizeof(
struct wb35_reg_queue) + sizeof(struct usb_ctrlrequest);
348 if (urb && reg_queue) {
349 reg_queue->DIRECT = 0;
350 reg_queue->INDEX = RegisterNo;
351 reg_queue->pBuffer = pRegisterValue;
352 dr = (
struct usb_ctrlrequest *)((
u8 *)reg_queue +
sizeof(
struct wb35_reg_queue));
360 reg_queue->Next =
NULL;
361 reg_queue->pUsbReq = dr;
362 reg_queue->urb =
urb;
421 urb = (
struct urb *)reg_queue->
urb;
424 urb = reg_queue->
urb;
427 pBuffer = ®_queue->
VALUE;
429 usb_fill_control_urb(urb, pHwData->
udev,
439 pr_debug(
"EP0 Irp sending error\n");
459 reg->EP0VM_status = urb->status;
466 spin_lock_irq(&
reg->EP0VM_spin_lock);
467 reg_queue =
reg->reg_first;
468 if (reg_queue ==
reg->reg_last)
470 reg->reg_first =
reg->reg_first->Next;
471 spin_unlock_irq(&
reg->EP0VM_spin_lock);
473 if (
reg->EP0VM_status) {
474 pr_debug(
"EP0 IoCompleteRoutine return error\n");
513 urb = reg_queue->
urb;
519 pr_debug(
"EP0 queue release error\n");
537 u32 SoftwareSet, VCO_trim, TxVga, Region_ScanInterval;
652 for (i = 0; i <
Length; i++) {
654 for (j = 0; j < 8; j++) {
655 Carry = ((Crc & 0x80000000) ? 1 : 0) ^ (CurByte & 0x01);
659 Crc = (Crc ^ 0x04c11db6) | Carry;
682 u32 HalfLength,
i,
j;
687 dwData = dwData & (0xffffffff >> (32 -
DataLength));
689 HalfLength = DataLength / 2;
690 for (i = 0, j = DataLength - 1; i < HalfLength; i++, j--) {
695 dwData =
SetBit(dwData, j);
696 }
else if (!BitA && BitB) {
697 dwData =
SetBit(dwData, i);