-/* $OpenBSD: sdmmc.c,v 1.50 2018/03/20 04:18:40 jmatthew Exp $ */
+/* $OpenBSD: sdmmc.c,v 1.51 2018/08/09 13:52:36 patrick Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
sc->sc_flags = saa->flags;
sc->sc_caps = saa->caps;
sc->sc_max_xfer = saa->max_xfer;
+ memcpy(&sc->sc_cookies, &saa->cookies, sizeof(sc->sc_cookies));
if (ISSET(sc->sc_caps, SMC_CAPS_DMA) && sc->sc_dmap == NULL) {
error = bus_dmamap_create(sc->sc_dmat, MAXPHYS, SDMMC_MAXNSEGS,
-/* $OpenBSD: sdmmc_io.c,v 1.39 2018/06/17 17:10:17 patrick Exp $ */
+/* $OpenBSD: sdmmc_io.c,v 1.40 2018/08/09 13:52:36 patrick Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
sf = sdmmc_function_alloc(sc);
sf->number = i;
sf->rca = sf0->rca;
+ sf->cookie = sc->sc_cookies[i];
SIMPLEQ_INSERT_TAIL(&sc->sf_head, sf, sf_list);
}
-/* $OpenBSD: sdmmcchip.h,v 1.11 2018/03/20 04:18:40 jmatthew Exp $ */
+/* $OpenBSD: sdmmcchip.h,v 1.12 2018/08/09 13:52:36 patrick Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
#define SDMMC_TIMING_HIGHSPEED 1
#define SDMMC_TIMING_MMC_DDR52 2
+#define SDMMC_MAX_FUNCTIONS 8
+
struct sdmmcbus_attach_args {
const char *saa_busname;
sdmmc_chipset_tag_t sct;
int flags;
int caps;
long max_xfer;
+ void *cookies[SDMMC_MAX_FUNCTIONS];
};
void sdmmc_needs_discover(struct device *);
-/* $OpenBSD: sdmmcvar.h,v 1.29 2018/03/20 04:18:40 jmatthew Exp $ */
+/* $OpenBSD: sdmmcvar.h,v 1.30 2018/08/09 13:52:36 patrick Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
int flags;
#define SFF_ERROR 0x0001 /* function is poo; ignore it */
#define SFF_SDHC 0x0002 /* SD High Capacity card */
+ void *cookie; /* pass extra info from bus to dev */
SIMPLEQ_ENTRY(sdmmc_function) sf_list;
/* SD card I/O function members */
int number; /* I/O function number or -1 */
void *sc_scsibus; /* SCSI bus emulation softc */
TAILQ_HEAD(, sdmmc_intr_handler) sc_intrq; /* interrupt handlers */
long sc_max_xfer; /* maximum transfer size */
+ void *sc_cookies[SDMMC_MAX_FUNCTIONS]; /* pass extra info from bus to dev */
};
/*