Date: Sun, 29 Nov 1998 01:26:53 -0800 From: Mike Smith <mike@smith.net.au> To: Scott Mitchell <scott@dcs.qmw.ac.uk> Cc: freebsd-mobile@FreeBSD.ORG Subject: Re: Reading CIS in kernel Message-ID: <199811290926.BAA00677@dingo.cdrom.com> In-Reply-To: Your message of "Tue, 10 Nov 1998 10:47:55 GMT." <19981110104755.E11520@dcs.qmw.ac.uk>
next in thread | previous in thread | raw e-mail | index | archive | help
> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199811290926.BAA00677>