From owner-freebsd-drivers@FreeBSD.ORG Tue Jan 24 19:16:31 2006 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 785FD16A41F for ; Tue, 24 Jan 2006 19:16:31 +0000 (GMT) (envelope-from kimblydavis@yahoo.com) Received: from web30008.mail.mud.yahoo.com (web30008.mail.mud.yahoo.com [68.142.200.71]) by mx1.FreeBSD.org (Postfix) with SMTP id CCB8F43D48 for ; Tue, 24 Jan 2006 19:16:30 +0000 (GMT) (envelope-from kimblydavis@yahoo.com) Received: (qmail 54653 invoked by uid 60001); 24 Jan 2006 19:16:30 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=uT8MvDSwzYdewPc1zkQe+r+DCdEZTQWV3Rd1UiuU1qKhBmu7FyVvFRciQtu1Pp5jKuH5jbjS/KG240UQ561c5JRfx/AzCSLOH3fzyWCm1QALLRVVMTfCrmZBlHCHXB4IKeLTzbrv2L1Hru7zMz5vdGoXgVSSuSYswtwq1w+NMvs= ; Message-ID: <20060124191630.54651.qmail@web30008.mail.mud.yahoo.com> Date: Tue, 24 Jan 2006 11:16:30 -0800 (PST) From: Kimberly Davis To: Norbert Koch , freebsd-drivers@freebsd.org, John Baldwin In-Reply-To: <000001c61ffd$bf7c0200$4801a8c0@ws-ew-3.demig.intra> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Subject: Re: Interrupt Handlers and Driver to Driver Communication X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Kimberly Davis List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2006 19:16:31 -0000 Over the past few days, I've done more investigation and found out more about the driver's behavior. By the way, driver one is an edma driver, and driver two is just a simple client driver trying to use the edma. I didn't mention that before because I was trying to remove extraneous detail from the discussion of the problem. I don't think it is really that important in understanding the problem. The client driver does nothing really but exercise the edma driver. It's a nothing driver. It's just there as a test of my edma driver's functionality. If you remember correctly, the problem is that the edma driver has an api that it makes visible to other drivers who want to call into it. The function "edma_is_complete" returns a status variable to a calling driver. When I call this function from my client driver, I never get the correct status. The problem is the order of events. Before the edma interrupt can complete and set the variable in question, the system seems to halt the interrupt execution, finish the edma_is_complete call, then it finishes the interrupt. This is the reason I get the wrong answer from edma_is_complete every time. I've verified that this is happening by using post codes. Another interesting development occurred this week. I started calling edma_is_complete from an ioctl in my client driver. This way, it works. I get correct status. I don't understand this. Some sort of weird execution is going on here. By the way, does FreeBSD have a concept of a bottom half, analogous to generic Linux bottom halves? If so, how do I code it? I can't seem to find information about it or examples. Thanks, KD ----- Original Message ---- From: Norbert Koch To: Kimberly Davis Sent: Monday, January 23, 2006 2:16:52 AM Subject: RE: Interrupt Handlers and Driver to Driver Communication > > Yes, tried all that... > > nm driver1.ko | grep driver_one_is_complete > 00003274 T driver_one_is_complete > > nm driver2.ko | grep driver_one_is_complete > U driver_one_is_complete > > Undefined makes sense because it's not defined in the driver2 > code. It's merely being called. > > A more interesting development occurred yesterday when a > colleague suggested that I write post codes to the LED on the > board at different times in the driver so that we could tell how > long it was lingering over certain executions and see where the > driver was in its execution of the interrupt handler. > > What I found during that exercise was that the driver interrupt > handler gets stuck, unable to complete the interrupt handler call > until driver2's call of the function driver_one_is_complete has > finished executing. In other words, driver2's activities are > preventing driver1's activities from finishing. This explains the > erronenous value that I keep getting with driver_one_is_complete. > > I don't understand this at all. Have you ever encountered this problem? > > KD Not yet. But I only wrote interrupt handlers for FreeBSD 4, where they don't have some kind of thread context. So I fear, without knowing more about "driver2's activities", which obviously are a bit more than just calling driver_one_is_complete(), nobody will be able to help here. From owner-freebsd-drivers@FreeBSD.ORG Tue Jan 24 20:25:15 2006 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C3AFA16A422 for ; Tue, 24 Jan 2006 20:25:15 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail6.speedfactory.net [66.23.216.219]) by mx1.FreeBSD.org (Postfix) with ESMTP id 731C743D5A for ; Tue, 24 Jan 2006 20:25:14 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.5b3) with ESMTP id 6874900 for multiple; Tue, 24 Jan 2006 15:25:02 -0500 Received: from localhost (john@localhost [127.0.0.1]) by server.baldwin.cx (8.13.4/8.13.4) with ESMTP id k0OKOw3p014580; Tue, 24 Jan 2006 15:25:01 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Kimberly Davis Date: Tue, 24 Jan 2006 15:15:49 -0500 User-Agent: KMail/1.9.1 References: <20060124191630.54651.qmail@web30008.mail.mud.yahoo.com> In-Reply-To: <20060124191630.54651.qmail@web30008.mail.mud.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200601241515.51773.jhb@freebsd.org> X-Virus-Scanned: ClamAV 0.87.1/1248/Tue Jan 24 05:54:38 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.4 required=4.2 tests=ALL_TRUSTED autolearn=failed version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on server.baldwin.cx X-Server: High Performance Mail Server - http://surgemail.com r=1653887525 Cc: Norbert Koch , freebsd-drivers@freebsd.org Subject: Re: Interrupt Handlers and Driver to Driver Communication X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2006 20:25:15 -0000 On Tuesday 24 January 2006 14:16, Kimberly Davis wrote: > Over the past few days, I've done more investigation and found out more > about the driver's behavior. > > By the way, driver one is an edma driver, and driver two is just a simple > client driver trying to use the edma. I didn't mention that before because > I was trying to remove extraneous detail from the discussion of the > problem. I don't think it is really that important in understanding the > problem. The client driver does nothing really but exercise the edma > driver. It's a nothing driver. It's just there as a test of my edma > driver's functionality. > > If you remember correctly, the problem is that the edma driver has an api > that it makes visible to other drivers who want to call into it. The > function "edma_is_complete" returns a status variable to a calling driver. > When I call this function from my client driver, I never get the correct > status. The problem is the order of events. Before the edma interrupt can > complete and set the variable in question, the system seems to halt the > interrupt execution, finish the edma_is_complete call, then it finishes the > interrupt. This is the reason I get the wrong answer from edma_is_complete > every time. I've verified that this is happening by using post codes. When is your client driver calling 'edma_is_complete'? Also, are you loading the drivers during boot or via kldload after the system is running. Are you using any sort of locking (mutex, etc.) to synchronize between your ISR and edma_is_complete()? > Another interesting development occurred this week. I started calling > edma_is_complete from an ioctl in my client driver. This way, it works. I > get correct status. I don't understand this. Some sort of weird execution > is going on here. > > By the way, does FreeBSD have a concept of a bottom half, analogous to > generic Linux bottom halves? If so, how do I code it? I can't seem to find > information about it or examples. It does have a notion of primary interrupt context which will let your ISR run synchronously rather than in an ithread, but for now I would work on getting your code to work using ithreads first as it is simpler. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org From owner-freebsd-drivers@FreeBSD.ORG Wed Jan 25 10:04:43 2006 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 48CD616A41F for ; Wed, 25 Jan 2006 10:04:43 +0000 (GMT) (envelope-from kedentojas@yahoo.co.uk) Received: from web25410.mail.ukl.yahoo.com (web25410.mail.ukl.yahoo.com [217.146.176.228]) by mx1.FreeBSD.org (Postfix) with SMTP id 33D0243D49 for ; Wed, 25 Jan 2006 10:04:37 +0000 (GMT) (envelope-from kedentojas@yahoo.co.uk) Received: (qmail 12624 invoked by uid 60001); 25 Jan 2006 10:04:36 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.co.uk; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=Oqg1qm6OdGBJKW8y9C/wh3mEHnSwxbmBbrO5PR9oMOmc7TCwAcyngBvcAROK4XWSsitmIdIkDz9AREnlSZBi80NbaKuiPjzBf+45KsstIpgXzqMD/HbvYbqHHgQVlW8Z+yg2DBsSHqcqD3Uf+oxJ/dtgdcLJ4mqyVpMDPVz84TA= ; Message-ID: <20060125100436.12622.qmail@web25410.mail.ukl.yahoo.com> Received: from [195.182.82.250] by web25410.mail.ukl.yahoo.com via HTTP; Wed, 25 Jan 2006 10:04:36 GMT Date: Wed, 25 Jan 2006 10:04:36 +0000 (GMT) From: Aivaras Kondrotas To: freebsd-drivers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: cat problems for firmware upgrade X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2006 10:04:43 -0000 Can anybody explain me if cat command is different in Freebsd than in other linux/unix/bsd os'es, because this problem appear just in Freebsd. I am running a FreeBSD 6.0. To get working my printer I have to upgrade my firmware, but I get problem "cat: stdout: Input/output error". Searched for days in google, but it appears that all results leads to just Freebsd OS. Do I have to switch OS just to make my printer work? ---------------------------------------------------------------- #dmesg | grep ulpt ulpt0: Hewlett-Packard hp LaserJet 1000, rev 1.10/1.20, addr 2, iclass 7/1 ulpt0: using bi-directional mode # cat SIhp1000.dl > /dev/ulpt0 cat: stdout: Input/output error ___________________________________________________________ Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com From owner-freebsd-drivers@FreeBSD.ORG Wed Jan 25 14:56:10 2006 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 45B1A16A41F for ; Wed, 25 Jan 2006 14:56:10 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail6.speedfactory.net [66.23.216.219]) by mx1.FreeBSD.org (Postfix) with ESMTP id 95AAC43D46 for ; Wed, 25 Jan 2006 14:56:09 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.5b3) with ESMTP id 6941707 for multiple; Wed, 25 Jan 2006 09:54:57 -0500 Received: from localhost (john@localhost [127.0.0.1]) by server.baldwin.cx (8.13.4/8.13.4) with ESMTP id k0PEu2gn024929; Wed, 25 Jan 2006 09:56:05 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-drivers@freebsd.org Date: Wed, 25 Jan 2006 09:50:07 -0500 User-Agent: KMail/1.9.1 References: <20060125100436.12622.qmail@web25410.mail.ukl.yahoo.com> In-Reply-To: <20060125100436.12622.qmail@web25410.mail.ukl.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200601250950.08353.jhb@freebsd.org> X-Virus-Scanned: ClamAV 0.87.1/1248/Tue Jan 24 05:54:38 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.4 required=4.2 tests=ALL_TRUSTED autolearn=failed version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on server.baldwin.cx X-Server: High Performance Mail Server - http://surgemail.com r=1653887525 Cc: Subject: Re: cat problems for firmware upgrade X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2006 14:56:10 -0000 On Wednesday 25 January 2006 05:04, Aivaras Kondrotas wrote: > Can anybody explain me if cat command is different in > Freebsd than in other linux/unix/bsd os'es, because > this problem appear just in Freebsd. > > I am running a FreeBSD 6.0. To get working my printer > I have to upgrade my firmware, but > I get problem "cat: stdout: Input/output error". > > Searched for days in google, but it appears that all > results leads to just Freebsd OS. > Do I have to switch OS just to make my printer work? > > > ---------------------------------------------------------------- > #dmesg | grep ulpt > ulpt0: Hewlett-Packard hp LaserJet 1000, rev > 1.10/1.20, addr 2, iclass 7/1 > ulpt0: using bi-directional mode > > # cat SIhp1000.dl > /dev/ulpt0 > cat: stdout: Input/output error The issue is probably with the ulpt(4) driver rather than with cat(1). You are probably better off asking this question on stable@ or questions@ however. This list is for questions about writing device drivers. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org From owner-freebsd-drivers@FreeBSD.ORG Sat Jan 28 00:09:18 2006 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E824916A420 for ; Sat, 28 Jan 2006 00:09:18 +0000 (GMT) (envelope-from JCurtis@fas.edu) Received: from relay.fas.edu (207-114-172-93.gen.twtelecom.net [207.114.172.93]) by mx1.FreeBSD.org (Postfix) with ESMTP id 93F4043D5A for ; Sat, 28 Jan 2006 00:09:18 +0000 (GMT) (envelope-from JCurtis@fas.edu) Content-class: urn:content-classes:message MIME-Version: 1.0 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Date: Fri, 27 Jan 2006 16:11:51 -0800 Message-ID: <37E27EAC319870439379BF42DD12767E01243200@fas-exch-01.FAS.ADS> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Adding new device id's for ATH driver Thread-Index: AcYjnsyXC8FIi4I9RjipGEG8JsV/5g== From: "Jared Curtis" To: Received-SPF: none Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Adding new device id's for ATH driver X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2006 00:09:19 -0000 Hello, This is my first post to this list and I think it's going to be a good one ;). I just recently bought a HP nx6125 laptop (http://h10010.www1.hp.com/wwpc/us/en/sm/WF05a/321957-64295-89315-321838 -f33-471753.html ) that came with a Broadcom bcm4309 wifi card (mini pci). I was aware that this card was not supported by FreeBSD and I planned on switching it out for an Atheros card (sorry I don't have the exact card handy). When I swapped the cards I found out that the HP bios has a lockout feature that checks to verify that only the white listed cards are installed. After some searching I found a tutorial on installing a Atheros card into the nx6125 (http://www.dagarlas.org/stuff/computing/article0001.php ) but it was for a Linux system using the MadWifi driver. I followed all the steps and changed the device id to match that of the Broadcom card and now the laptop boots fine with the Atheros card :). But now I need to modify the drivers to recognize the new device id so that they will work with the card. I modified ah_devid.h and changed out the id's that matched the originals on the Atheros card to now match the Broadcom id's. I then rebuilt the modules and loaded them. They load fine but the card doesn't show up in an ifconfig. I was given this link http://www.demarctech.com/techsupport/rw-wireless-cards-support/free-bsd -setup.htm but it is for a pccard devices does a similar concept work for mini pci devices? And now to my question. Could someone who is more familiar with the ATH driver please point me in the right direction on what files need to be changed to make the ATH driver work with my new Broadcom id's. I can provide more details such as specific hardware info and device id's if someone will be able to assist me. Thanks in advance for any help you can provide.