Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 02 May 2008 13:34:13 -0400
From:      Steve Clark <sclark@netwolves.com>
To:        Hans Petter Selasky <hselasky@c2i.net>
Cc:        freebsd-usb@freebsd.org
Subject:   Re: Documentation
Message-ID:  <481B5095.8080400@netwolves.com>
In-Reply-To: <200805021534.13848.hselasky@c2i.net>
References:  <481B094F.1090408@netwolves.com> <200805021534.13848.hselasky@c2i.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Hans Petter Selasky wrote:
> On Friday 02 May 2008, Steve Clark wrote:
> 
>>Hello,
>>
>>Is there any detailed documentation on the FreeBSD usb device driver api?
>>
>>TIA,
>>Steve
>>_______________________________________________
>>freebsd-usb@freebsd.org mailing list
>>http://lists.freebsd.org/mailman/listinfo/freebsd-usb
>>To unsubscribe, send any mail to "freebsd-usb-unsubscribe@freebsd.org"
> 
> 
> Hi,
> 
> For the usb.p4 there is a README. Else you have to look at the existing USB 
> drivers.
> 
> --HPS
> 
> 
Well here is my problem. I am trying to get a sierra wireless 597 evdo 
usb modem to work with
freebsd 6.1. The usb device when it is first plugged in has a product 
id of 0xfff and looks like a
cdrom drive with software drivers on it for Windows. It has to have a 
control message sent to it
to put it in modem mode.

I sort of have it working by hacking ubsa.c to look for the sierra 
vendor id and product id of 0xfff in
the usb_match function and return match. Then in the usb_attach code I 
look again for the vendor and
product id of 0xfff and then send the control message to put it in 
modem mode.
	if ( uaa->vendor == USB_VENDOR_SIERRA && uaa->product == 0xfff )
	{
		ubsa_request_real( sc, 0x0b, 1, 0x40 );
		ucom->sc_dying = 1;
                 goto error;
	}

This puts in modem mode with product id of 0x0023 which i have plugged 
into usbdevs and also put in ubsa.c
so now I get a ucom device and can successfully run ppp. The problem I 
am running into now is sometime after
it remove the device I will get a page fault panic in the kernel. I 
think it is related to the sending the
control_message - something is not cleaned up when I "goto error" in 
the USB_ATTACH function.

I modified ubsa_reguest() to accept a request_type and called it 
ubsa_request_real() and then had
ubsa_request()  call ubsa_request_real as
	return (ubsa_request_real( sc, request, value, UT_WRITE_VENDOR_DEVICE ));

Now that I looked up what UT_WRITE_VENDOR_DEVICE is I guess this was 
an unnecessary step.

Any ideas how this should really be handled - That sending the control 
message to put the device in
modem mode?

Thanks,
Steve





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?481B5095.8080400>