From owner-freebsd-usb@FreeBSD.ORG Fri May 2 17:34:15 2008 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0B24106566B for ; Fri, 2 May 2008 17:34:15 +0000 (UTC) (envelope-from sclark@netwolves.com) Received: from elasmtp-banded.atl.sa.earthlink.net (elasmtp-banded.atl.sa.earthlink.net [209.86.89.70]) by mx1.freebsd.org (Postfix) with ESMTP id 613D28FC1F for ; Fri, 2 May 2008 17:34:15 +0000 (UTC) (envelope-from sclark@netwolves.com) Received: from [205.201.149.100] (helo=[10.0.129.1]) by elasmtp-banded.atl.sa.earthlink.net with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1Jrz9C-00043p-Gc; Fri, 02 May 2008 13:34:14 -0400 Message-ID: <481B5095.8080400@netwolves.com> Date: Fri, 02 May 2008 13:34:13 -0400 From: Steve Clark User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.13) Gecko/20080425 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Hans Petter Selasky References: <481B094F.1090408@netwolves.com> <200805021534.13848.hselasky@c2i.net> In-Reply-To: <200805021534.13848.hselasky@c2i.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-ELNK-Trace: a437fbc6971e80f61aa676d7e74259b7b3291a7d08dfec7931ff808d1343c74764908937341ac9ef350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c X-Originating-IP: 205.201.149.100 Cc: freebsd-usb@freebsd.org Subject: Re: Documentation X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2008 17:34:15 -0000 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