From owner-freebsd-hackers Fri Feb 8 22:12:32 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from rwcrmhc54.attbi.com (rwcrmhc54.attbi.com [216.148.227.87]) by hub.freebsd.org (Postfix) with ESMTP id 178D837B41C for ; Fri, 8 Feb 2002 22:12:26 -0800 (PST) Received: from grinch ([12.234.224.67]) by rwcrmhc54.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20020209061220.USXH1214.rwcrmhc54.attbi.com@grinch> for ; Sat, 9 Feb 2002 06:12:20 +0000 Date: Fri, 8 Feb 2002 22:12:20 -0800 Mime-Version: 1.0 (Apple Message framework v475) Content-Type: text/plain; charset=US-ASCII; format=flowed Subject: Fwd: USB device framework in FreeBSD 4.2 From: Justin C.Walker To: freebsd-hackers@FreeBSD.ORG Content-Transfer-Encoding: 7bit Message-Id: X-Mailer: Apple Mail (2.475) Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Forgive the inane chatter below. I have too many windows open, and my brain went to sleep before I did. Regards, Justin Begin forwarded message: > From: "Justin C.Walker" > Date: Fri Feb 08, 2002 10:10:48 PM US/Pacific > To: freebsd-hackers@FreeBSD.ORG > Subject: Re: USB device framework in FreeBSD 4.2 > > > On Friday, February 8, 2002, at 01:51 PM, Srinivas Dharmasanam wrote: > >> Nick, >> I'm trying to use a modified version of the ugen driver in FreeBSD 4.2 >> to control a USB device from the kernel space and am getting a kernel >> crash with a page fault trap (trap_fatal) when I try to do open on >> this device. >> >> From a user process, I am able to open this device with no problem but >> when I call the underlying open() function from an ISR (so that I get >> kernel mode), I get this fatal trap. >> >> The backtrace of the kernel core dump is pasted below. >> >> Note that the usbd_transfer() function in usbdi.c has the call >> tsleep() that is causing this trap. >> >> Can you please let me know how I would be able to access a USB device >> from the kernel space? Do I have to write another USB driver along >> with the usbdi.c interface or is there a way I can do this with the >> existing USB device framework? > > First, try usb@lists.apple.com, where the USB mavins tend to hang out. > > Next, be aware that the device driver model in Darwin and Mac OS X is > significantly different from that in FreeBSD, so it won't be a simple > matter to get this code working. > > Also, you don't want to call open() in the kernel, unless it is > *really* necessary; if you do need to do this, which is unlikely, you > should study the open() call in the kernel source to be sure you are > obeying all the rules. In particular, *don't* call open() from an ISR. > > Finally, don't call tsleep() from an ISR. > > Oh, and the backtrace seems to have disappeared between the time you > wrote the above and when you sent it. > > There are several USB components in the darwin repository; check them > out and look at the code. > > Regards, > > Justin > > -- > Justin C. Walker, Curmudgeon-At-Large * > Institute for General Semantics | It's not whether you win or > lose... > | It's whether *I* win or lose. > *--------------------------------------*-------------------------------* > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message > > -- Justin C. Walker, Curmudgeon-At-Large * Institute for General Semantics | Men are from Earth. | Women are from Earth. | Deal with it. *--------------------------------------*-------------------------------* To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message