Subject: Re: Import JMicron driver
To: Pierrick Brossin <pierrick@bs-network.net>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: tech-kern
Date: 12/12/2006 23:49:28
On Tue, Dec 12, 2006 at 05:39:17PM +0100, Pierrick Brossin wrote:
> Hey guys,
> 
> I am a newcomer to NetBSD kernel / drivers programming.
> Since I need the JMicron driver in NetBSD I thought I'd do the job and
> learn something new!
> 
> I hope I'm not writing to the wrong mailing list. If so please let me
> know where I should ask for help (if it's possible to get some).
> 
> So. FreeBSD recognizes my JMicron controller as atapci. This seems to be
> the generic driver with some add-ons for the JMicron controller support.
> (I would have to make it available for ahcisata on NetBSD as well
> though).

Is the JMicron controller AHCI-compliant ? If so it should work
with ahci without much changes.

> 
> I've started with things I've found by myself. That means, add the
> vendor and product ids to the pcidevs file (will have to add more later
> if I succeed to this import) and I then ran "make -f" as said at the top
> of the file. That makes it nicer in dmesg:
> 
> ahcisata0 at pci4 dev 0 function 0: JMicron JMB363 controller
> pciide0: JMicron JMB363 controller (rev. 0x02)
> 
> That's almost nothing but I tried to find how things work and I can't
> seem to understand.
> 
> My idea (if it's the right way to go) is to create a jmicronide.c file
> in /usr/src/sys/dev/pci/ to handle match and attach (and probably
> more!). Is it correct ? (assuming the jmicron controller will not be
> recognized as full device but will work through pciide)

I'd assume this is for a controller in pciide-compat mode. In this case
yes, you can create a jmicronide.c (of jmicronsata.c if this is a SATA
controller). 

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--