From owner-freebsd-mobile Mon Nov 30 05:32:42 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id FAA26366 for freebsd-mobile-outgoing; Mon, 30 Nov 1998 05:32:42 -0800 (PST) (envelope-from owner-freebsd-mobile@FreeBSD.ORG) Received: from dingo.cdrom.com (ppp7.portal.net.au [202.12.71.107]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id FAA26351 for ; Mon, 30 Nov 1998 05:32:36 -0800 (PST) (envelope-from mike@dingo.cdrom.com) Received: from dingo.cdrom.com (localhost [127.0.0.1]) by dingo.cdrom.com (8.9.1/8.8.8) with ESMTP id BAA00677; Sun, 29 Nov 1998 01:26:53 -0800 (PST) (envelope-from mike@dingo.cdrom.com) Message-Id: <199811290926.BAA00677@dingo.cdrom.com> X-Mailer: exmh version 2.0.2 2/24/98 To: Scott Mitchell cc: freebsd-mobile@FreeBSD.ORG Subject: Re: Reading CIS in kernel In-reply-to: Your message of "Tue, 10 Nov 1998 10:47:55 GMT." <19981110104755.E11520@dcs.qmw.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 29 Nov 1998 01:26:53 -0800 From: Mike Smith Sender: owner-freebsd-mobile@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > Hi all, > > I have (foolishly?) embarked on a quest to get my Xircom Ethernet card > working on FreeBSD, by porting the Linux xirc2_ps driver. Of course this > means that I have to learn both how the Linux driver works and how to write > a FreeBSD/PCMCIA driver... > > Anyhow, the Linux code supports a whole raft of different Xircom cards, > which it tells apart by checking various CIS tuples using the Linux Card > Services stuff. This is (as far as I can tell) all done inside the kernel, > and there doesn't seem to be an easy way of doing that in FreeBSD, from my > reading of the /sys/pccard code. > > So, the question is, how do I parse the CIS from inside a kernel driver? > The only alternative approaches I can think of are to 1)hardwire details of > all the supported cards into the driver, so we can tell what card we have > by reading one magic location in card memory or 2)have the parsing done by > userland code and somehow pass this back down to the driver. Both of these > seem incredibly ugly to me. The "simple" answer is that you should be able to read/write the /dev/card* devices from within the kernel; they use uiomove(), so you will have no trouble with the buffer being in kernel space. Note that you'll need to do the read operations from a user context, not an interrupt context - that should be OK, as you'll be doing it inside the probe routine, which is invoked from a user context. -- \\ Sometimes you're ahead, \\ Mike Smith \\ sometimes you're behind. \\ mike@smith.net.au \\ The race is long, and in the \\ msmith@freebsd.org \\ end it's only with yourself. \\ msmith@cdrom.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-mobile" in the body of the message