usbd_setup_control on 6.2 ?

bridged with qdn.public.ddk.usb
Post Reply
Jean-Louis Villecroze

usbd_setup_control on 6.2 ?

Post by Jean-Louis Villecroze » Wed Jul 24, 2002 6:52 am

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

Bill Caroselli (Q-TPS)

Re: usbd_setup_control on 6.2 ?

Post by Bill Caroselli (Q-TPS) » Wed Jul 24, 2002 5:31 pm

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

John Wilke

Re: usbd_setup_control on 6.2 ?

Post by John Wilke » Wed Oct 16, 2002 9:25 am

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

Post Reply

Return to “qdn.public.ddk.usb”