| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
Hi Ernesto,
It's probably easiest to just let IOKit do your matching and starting for you. You are on the right track with implementing your driver stack. Most PCI-ATA controller chips implement 2 ATA controllers in the chip. So the driver structure is like you created, you need some sort of driver to match the chip, do any necessary initialization, then create nubs for each bus present in the chip. At Apple, I call this the "Root" driver, so it would be called AppleXYZRoot.kext. This is usually derived from IOService and matches by name the "pci-xyz,abc" device and vendor property.
When the root driver loads it initializes the chip, extends the interrupt tree and then creates the nubs for each bus and copies down any properties needed, like addresses, interrupt numbers, bus ID and stuff. Then it calls nub->registerService() to invoke IOKit's matching. Usually, that's all it needs to do. The "nubs" are just that, attachment points and don't generally have much functional code in them.
IOKit will then look for a kext that has the necessary properties to match the nubs just registered. That should be the ones derived from IOATAController (or in your case, IOPCIATA, which in turn derives from IOATAController). At Apple, I always call this the "ATA" driver, so it would be AppleXYZATA.kext.
Your "root" driver shouldn't need to create any instances of your "ata" driver. Let IOKit do that for you.
| References: | |
| >Re: PCIATA driver matching (From: Larry Barras <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.