Hello,
I’m trying to write a driver for my USB Zip drive, but I’m missing
the function usbd_setup_control in the DDK included in the 6.2 PE …
Is that normal ?
I tried to replace it with a usbd_setup_bulk and then send the
data with usbd_io on the control pipe, but I always get the same
data back (device answer I suppose) on the BulkIn pipe :
(for a REQUEST SENS command)
10000000
00000000
00000000
00000000
10000000
00000000
00000000
00000000
10000000
00000000
00000000
00000000
10000000
00000000
00000000
00000000
10000000
00000000
Here is the function I use for this command:
int Mass_Device_Request_Sens(mass_t *mass,uint8_t *buffer,uint32_t length)
{
uint32_t status;
struct usbd_urb *urb;
// alocate an URB for this USB transaction
urb = usbd_alloc_urb(NULL);
if(urb)
{
// fill buffer
memset(buffer,0,12);
buffer[0] = 0x3; // Request SENS
buffer[1] = 32; // lun 1
buffer[4] = 18; // max lun buffer
// setup the URB for a specify command transaction
usbd_setup_bulk(urb,URB_DIR_IN,buffer,length);
// send data throught the control pipe
status = usbd_io(urb,mass->ep_cntl,NULL,mass,1000); //USBD
if(status == EOK)
status = Mass_Bulk_Wait(mass,urb,mass->ep_in);
// free the urb
usbd_free_urb(urb);
}
else
status = ENOMEM;
return status;
}
Thanks for any information
Regards,
jean-louis
Let me know when you get this working. If the price is reasonable I’ll buy
it from you.
“Jean-Louis Villecroze” <jlv@NOSPAMkirilla.com> wrote in message
news:3D3E4EAF.2010807@NOSPAMkirilla.com…
Hello,
I’m trying to write a driver for my USB Zip drive, but I’m missing
the function usbd_setup_control in the DDK included in the 6.2 PE …
Is that normal ?
I tried to replace it with a usbd_setup_bulk and then send the
data with usbd_io on the control pipe, but I always get the same
data back (device answer I suppose) on the BulkIn pipe :
(for a REQUEST SENS command)
10000000
00000000
00000000
00000000
10000000
00000000
00000000
00000000
10000000
00000000
00000000
00000000
10000000
00000000
00000000
00000000
10000000
00000000
Here is the function I use for this command:
int Mass_Device_Request_Sens(mass_t *mass,uint8_t *buffer,uint32_t length)
{
uint32_t status;
struct usbd_urb *urb;
// alocate an URB for this USB transaction
urb = usbd_alloc_urb(NULL);
if(urb)
{
// fill buffer
memset(buffer,0,12);
buffer[0] = 0x3; // Request SENS
buffer[1] = 32; // lun 1
buffer[4] = 18; // max lun buffer
// setup the URB for a specify command transaction
usbd_setup_bulk(urb,URB_DIR_IN,buffer,length);
// send data throught the control pipe
status = usbd_io(urb,mass->ep_cntl,NULL,mass,1000);
//USBD
if(status == EOK)
status = Mass_Bulk_Wait(mass,urb,mass->ep_in);
// free the urb
usbd_free_urb(urb);
}
else
status = ENOMEM;
return status;
}
Thanks for any information >
Regards,
jean-louis
Hi,
The reason why you wont find usbd_setup_control is that usbd_setup_vendor is
actually doing the same thing as control. That is why qnx decided not to
implement setup_control…
“Jean-Louis Villecroze” <jlv@NOSPAMkirilla.com> wrote in message
news:3D3E4EAF.2010807@NOSPAMkirilla.com…
Hello,
I’m trying to write a driver for my USB Zip drive, but I’m missing
the function usbd_setup_control in the DDK included in the 6.2 PE …
Is that normal ?
I tried to replace it with a usbd_setup_bulk and then send the
data with usbd_io on the control pipe, but I always get the same
data back (device answer I suppose) on the BulkIn pipe :
(for a REQUEST SENS command)
10000000
00000000
00000000
00000000
10000000
00000000
00000000
00000000
10000000
00000000
00000000
00000000
10000000
00000000
00000000
00000000
10000000
00000000
Here is the function I use for this command:
int Mass_Device_Request_Sens(mass_t *mass,uint8_t *buffer,uint32_t length)
{
uint32_t status;
struct usbd_urb *urb;
// alocate an URB for this USB transaction
urb = usbd_alloc_urb(NULL);
if(urb)
{
// fill buffer
memset(buffer,0,12);
buffer[0] = 0x3; // Request SENS
buffer[1] = 32; // lun 1
buffer[4] = 18; // max lun buffer
// setup the URB for a specify command transaction
usbd_setup_bulk(urb,URB_DIR_IN,buffer,length);
// send data throught the control pipe
status = usbd_io(urb,mass->ep_cntl,NULL,mass,1000);
//USBD
if(status == EOK)
status = Mass_Bulk_Wait(mass,urb,mass->ep_in);
// free the urb
usbd_free_urb(urb);
}
else
status = ENOMEM;
return status;
}
Thanks for any information >
Regards,
jean-louis