Re: Problem adding a new device using an initializer

Alan Stern <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
On Fri, 14 Dec 2007, Rui Santos wrote:

> Hi all,
> 
> I currently own a USB 3G mobile device manufactured under the name ZTE
> MF620.
> At the same time I also own a Huawei USB E220 device.
> 
> On 2.6.24-rc5, the Huawei device uses an initializer to switch the
> device from a usb-storage to a multi-port mode, that was previously
> being done by a userspace application.
> I was trying to do the same with the ZTE device, but I'm getting
> frustrated. This same ZTE device has a userspace application that also
> switches it to a multi-port mode.
> Can anyone tell me what I'm doing wrong ?
> 
> This is the userspace program ( includes libusb ):
...
> ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE +
> USB_ENDPOINT_IN, 0x00000fe, 0x0000000, 0x0000000, buf, 0x0000001, 1000);
...
> This is the Kernel initializer I'm trying to add at
> drivers/usb/storage/initializers.c that is not working:
> 
> int usb_stor_zte_mf620_init(struct us_data *us)
> {
>     int result;
> 
>     us->iobuf[0] = 0x1;
>     result = usb_stor_control_msg(us, us->send_ctrl_pipe,
>                       0xFE,
>                       USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_DIR_IN,
>                       0x0, 0x0, us->iobuf, 0x1, 1000);

If this is supposed to be an IN transfer (judging by the
USB_ENDPOINT_IN and USB_DIR_IN constants) then you should use 
us->recv_ctrl_pipe instead of us->send_ctrl_pipe.

Alan Stern


-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.