Subject: Re: Cardbus SIL3112 Sata Driver Development: Request for Help
To: Phil Quinton <pquinton@softhome.net>
From: Jachym Holecek <freza@liberouter.org>
List: tech-kern
Date: 09/19/2005 15:28:06
> The dev/pci/satalink driver's attach() function seems very simple, it 
> looks like this:
> 
> static void
> satalink_attach(struct device *parent, struct device *self, void *aux)
> {
> 	struct pci_attach_args *pa = aux;
> 	struct pciide_softc *sc = (struct pciide_softc *)self;
> 
> 	pciide_common_attach(sc, pa,
> 	    pciide_lookup_product(pa->pa_id, pciide_satalink_products));
> }
> 
> Question 1: How do I get the relavent *aux to pass to 
> pciide_common_attach in my cardbus driver, since the *aux that passed to 
> the cardbus interface is cast as cardbus_attach_args?

Looks like you'll have to initialize pciide_softc manually. A good way
to handle this would probably be to write cardbuside_common_attach()
or somesuch -- all other IDE @ cardbus devices could benefit. You can
still use pciide_lookup_product() with cardbus, the ID on cardbus should
be the same as on PCI (ca_id from cardbus_attach_args).

	HTH,
		-- Jachym Holecek