On Fri, Jul 08, 2011 at 04:34:36PM -0700, Matthew Dempsky wrote:
> autoconf doesn't allow you to attach multiple child devices to the
> same device with different attach arg types.  sdmmc(4) tries to attach
> both scsibus(4) and SDIO devices (currently just the disabled sbt(4)
> bluetooth adapter).  The way it does this is by creating a
> sdmmc_attach_args structure that was compatible with
> scsibus_attach_args, and then new SDIO-specific fields at the bottom.
> 
> However, I've added new fields to scsibus_attach_args, which
> sdmmc_attach_args doesn't know about.  The stupid kludge for now is to
> just include a complete "struct scsibus_attach_args" in
> sdmmc_attach_args instead of replicating its fields.
> 
> There are better fixes for this, but the sdmmc stuff is too tangled,
> and I want to finish with my SCSI diffs before messing with this more.
> 
> ok?

sure. ok krw@

.... Ken

> 
> Index: sdmmcvar.h
> ===================================================================
> RCS file: /home/mdempsky/anoncvs/cvs/src/sys/dev/sdmmc/sdmmcvar.h,v
> retrieving revision 1.18
> diff -u -p -r1.18 sdmmcvar.h
> --- sdmmcvar.h        24 Aug 2010 14:52:23 -0000      1.18
> +++ sdmmcvar.h        8 Jul 2011 23:27:33 -0000
> @@ -182,7 +182,7 @@ struct sdmmc_softc {
>   * Attach devices at the sdmmc bus.
>   */
>  struct sdmmc_attach_args {
> -     struct scsi_link *scsi_link;    /* XXX */
> +     struct scsibus_attach_args saa; /* XXX */
>       struct sdmmc_function *sf;
>  };
>  
> Index: sdmmc_scsi.c
> ===================================================================
> RCS file: /home/mdempsky/anoncvs/cvs/src/sys/dev/sdmmc/sdmmc_scsi.c,v
> retrieving revision 1.27
> diff -u -p -r1.27 sdmmc_scsi.c
> --- sdmmc_scsi.c      16 Jun 2011 01:09:16 -0000      1.27
> +++ sdmmc_scsi.c      8 Jul 2011 23:28:14 -0000
> @@ -139,9 +139,9 @@ sdmmc_scsi_attach(struct sdmmc_softc *sc
>       scbus->sc_link.pool = &scbus->sc_iopool;
>  
>       bzero(&saa, sizeof(saa));
> -     saa.scsi_link = &scbus->sc_link;
> +     saa.saa.saa_sc_link = &scbus->sc_link;
>  
> -     scbus->sc_child = config_found(&sc->sc_dev, &saa, scsiprint);
> +     scbus->sc_child = config_found(&sc->sc_dev, &saa.saa, scsiprint);
>       if (scbus->sc_child == NULL) {
>               printf("%s: can't attach scsibus\n", sc->sc_dev.dv_xname);
>               goto free_ccbs;

Reply via email to