rendered paste bodyint USB_ControlVendorCommand(void * handle,void * ioBuffer,unsigned long inputBu
fferLength,unsigned long outputBufferLength)
{
UsbDevice * usbdev=handle;
struct usb_device *dev=usbdev->dev;
u16 *pwIoBuf = NULL;
int i;
int rc;
int pipe;
u8 *temppcIoBuf;
u8 *pdwIoBuf = NULL;
u8 *pcIoBuf = NULL;
u8 reqType = 0;
u8 req = 0;
u16 value = 0;
u16 index = 0;
u16 wlen = 8;
pcIoBuf = (u8 *)ioBuffer;
reqType = *pcIoBuf;
req = *(pcIoBuf+1);
pwIoBuf = (u16 *) (pcIoBuf+2);
value = *pwIoBuf;
index = *(pwIoBuf+1);
wlen = *(pwIoBuf+2);
if(wlen)
{
pdwIoBuf = pcIoBuf+8;
temppcIoBuf = pcIoBuf;
for (i=0; i < wlen; i++)
*temppcIoBuf++ = *pdwIoBuf++;
}
if(reqType&0x80)
pipe=usb_rcvctrlpipe(dev, 0);
else
pipe=usb_sndctrlpipe(dev, 0);
if(wlen){
rc=my_usb_control_msg(dev,pipe,req,reqType,value,index,ioBuffer,
wlen,5*HZ);
return rc;
}
rc=my_usb_control_msg(dev,pipe,req,reqType,value,index,NULL,wlen,5*HZ);
return rc;
}
void LoadTable_1(void* handle)
{
int i;
char tunerBuff[20];
unsigned long uloutlen = 8;
unsigned long ulvallen = 16;
unsigned char FirstByte = FWData[0];
unsigned char tunerBuff19[20]={0x40,16,XC3028_I2C_ADDR,FirstByte,0x00,0x
00,0x02,0x00};
for (i=0;i*8<FWLength-4;i++)
{
ulvallen = 16;
tunerBuff[0] = 0x40;
tunerBuff[1] = 16;
tunerBuff[2] = XC3028_I2C_ADDR;
tunerBuff[3] = FirstByte;
tunerBuff[4] = 0;
tunerBuff[5] = 0;
tunerBuff[6] = 8;
tunerBuff[7] = 0;
tunerBuff[8] = FWData[i*8+1];
tunerBuff[9] = FWData[i*8+2];
tunerBuff[10] = FWData[i*8+3];
tunerBuff[11] = FWData[i*8+4];
tunerBuff[12] = FWData[i*8+5];
tunerBuff[13] = FWData[i*8+6];
tunerBuff[14] = FWData[i*8+7];
tunerBuff[15] = FWData[i*8+8];
USB_ControlVendorCommand(handle, tunerBuff,ulvallen,uloutlen);
msleep(10);
}
msleep(20);
ulvallen = 9;
// tunerBuff[6] = 2;
tunerBuff19[8] = FWData[4097];
tunerBuff19[9] = FWData[4098];
USB_ControlVendorCommand(handle, tunerBuff19,ulvallen,uloutlen);