How to use USB_IRP to transfer isochronous data? - VxWorks
This is a discussion on How to use USB_IRP to transfer isochronous data? - VxWorks ; Hi, all. I am porting usb ov511 camera driver from linux to vxworks,
using Tornado 2.2, vxworks version 5.5 and kernel WIND version 2.6. I
create isochronous pipe success, transfer an irp ok, but the callbask
shows that pIrp->result = ...
-
How to use USB_IRP to transfer isochronous data?
Hi, all. I am porting usb ov511 camera driver from linux to vxworks,
using Tornado 2.2, vxworks version 5.5 and kernel WIND version 2.6. I
create isochronous pipe success, transfer an irp ok, but the callbask
shows that pIrp->result = 0x830410, that is
S_usbHcdLib_STRUCT_SIZE_FAULT. Here is part of my code(I omit some
return status checks):
#define TEMP_BUF_SIZE 961*20
pUSB_IRP pTempIrp = OSS_MALLOC(sizeof(USB_IRP));
char pBuf[TEMP_BUF_SIZE];
memset(pTempIrp, 0, sizeof(USB_IRP));
memset(pBuf, 0, TEMP_BUF_SIZE);
pTempIrp->userPtr = pUsbOv511;
pTempIrp->irpLen = sizeof(USB_IRP);
pTempIrp->flags = USB_FLAG_ISO_ASAP;
pTempIrp->userCallback = ov511_isoc_irp;
pTempIrp->timeout = USB_TIMEOUT_NONE;
pTempIrp->transferLen = TEMP_BUF_SIZE;
pTempIrp->bfrCount = 1;
pTempIrp->bfrList[0].pid = USB_DIR_IN;
pTempIrp->bfrList[0].pBfr = pBuf;
pTempIrp->bfrList[0].bfrLen = TEMP_BUF_SIZE;
if (usbdTransfer(gOv511UsbdClientHandle, gOv511IsoPipe, pTempIrp) !=
OK) {
printf("usbdTransfer irp failed!\n");
return OV511_ERROR;
}
if ( OSS_SEM_TAKE (ov511WaitIsocSem, 10000) == ERROR ) {
printf("Wait ov511WaitIsocSem ok timeout. \n");
OSS_SEM_GIVE (ov511WaitIsocSem);
return OV511_ERROR;
}
Where does this problem come from? The result shows that size fault,
does I wrongly set irpLen and transferLen? Any word will be
appreciated. Much more thanks.
-
Re: How to use USB_IRP to transfer isochronous data?
On 8 31 , 11 46 , wuyaq...@gmail.com wrote:
> Hi, all. I am porting usb ov511 camera driver from linux to vxworks,
> using Tornado 2.2, vxworks version 5.5 and kernel WIND version 2.6. I
> create isochronous pipe success, transfer an irp ok, but the callbask
> shows that pIrp->result = 0x830410, that is
> S_usbHcdLib_STRUCT_SIZE_FAULT. Here is part of my code(I omit some
> return status checks):
>
> #define TEMP_BUF_SIZE 961*20
> pUSB_IRP pTempIrp = OSS_MALLOC(sizeof(USB_IRP));
> char pBuf[TEMP_BUF_SIZE];
> memset(pTempIrp, 0, sizeof(USB_IRP));
> memset(pBuf, 0, TEMP_BUF_SIZE);
>
> pTempIrp->userPtr = pUsbOv511;
> pTempIrp->irpLen = sizeof(USB_IRP);
> pTempIrp->flags = USB_FLAG_ISO_ASAP;
> pTempIrp->userCallback = ov511_isoc_irp;
> pTempIrp->timeout = USB_TIMEOUT_NONE;
>
> pTempIrp->transferLen = TEMP_BUF_SIZE;
> pTempIrp->bfrCount = 1;
> pTempIrp->bfrList[0].pid = USB_DIR_IN;
> pTempIrp->bfrList[0].pBfr = pBuf;
> pTempIrp->bfrList[0].bfrLen = TEMP_BUF_SIZE;
>
> if (usbdTransfer(gOv511UsbdClientHandle, gOv511IsoPipe, pTempIrp) !=
> OK) {
> printf("usbdTransfer irp failed!\n");
> return OV511_ERROR;
> }
>
> if ( OSS_SEM_TAKE (ov511WaitIsocSem, 10000) == ERROR ) {
> printf("Wait ov511WaitIsocSem ok timeout. \n");
> OSS_SEM_GIVE (ov511WaitIsocSem);
> return OV511_ERROR;
> }
>
> Where does this problem come from? The result shows that size fault,
> does I wrongly set irpLen and transferLen? Any word will be
> appreciated. Much more thanks.
problem solved! I make a mistake
pTempIrp->bfrList[0].pid = USB_DIR_IN;
should be
pTempIrp->bfrList[0].pid = USB_PID_IN;
This is really sutpid! I focused my attantion to different parameters
of createPipe, and thought that isochronous pipe was wrong.