diff options
| author | Alexander Motin <mav@FreeBSD.org> | 2008-10-29 20:01:26 +0000 |
|---|---|---|
| committer | Alexander Motin <mav@FreeBSD.org> | 2008-10-29 20:01:26 +0000 |
| commit | 3a4a255741a05b1759e370f4999a0f8bcb336a84 (patch) | |
| tree | 10739783292b47e8ea27ad741ab455c62044c192 /sys/dev | |
| parent | 0df76605cfd60d7a9b6ee578e46784c955f7cede (diff) | |
Notes
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/mmc/mmc.c | 3 | ||||
| -rw-r--r-- | sys/dev/mmc/mmcbrvar.h | 2 | ||||
| -rw-r--r-- | sys/dev/mmc/mmcsd.c | 9 | ||||
| -rw-r--r-- | sys/dev/mmc/mmcvar.h | 2 | ||||
| -rw-r--r-- | sys/dev/sdhci/sdhci.c | 4 |
5 files changed, 12 insertions, 8 deletions
diff --git a/sys/dev/mmc/mmc.c b/sys/dev/mmc/mmc.c index c6bce350bc5f..bea8c3bcfe9f 100644 --- a/sys/dev/mmc/mmc.c +++ b/sys/dev/mmc/mmc.c @@ -1343,6 +1343,9 @@ mmc_read_ivar(device_t bus, device_t child, int which, u_char *result) case MMC_IVAR_ERASE_SECTOR: *(int *)result = ivar->erase_sector; break; + case MMC_IVAR_MAX_DATA: + *(int *)result = mmcbr_get_max_data(bus); + break; } return (0); } diff --git a/sys/dev/mmc/mmcbrvar.h b/sys/dev/mmc/mmcbrvar.h index 77781393557f..1effa1496fed 100644 --- a/sys/dev/mmc/mmcbrvar.h +++ b/sys/dev/mmc/mmcbrvar.h @@ -72,6 +72,7 @@ enum mmcbr_device_ivars { MMCBR_IVAR_VDD, MMCBR_IVAR_CAPS, MMCBR_IVAR_TIMING, + MMCBR_IVAR_MAX_DATA, // MMCBR_IVAR_, }; @@ -94,6 +95,7 @@ MMCBR_ACCESSOR(power_mode, POWER_MODE, int) MMCBR_ACCESSOR(vdd, VDD, int) MMCBR_ACCESSOR(caps, CAPS, int) MMCBR_ACCESSOR(timing, TIMING, int) +MMCBR_ACCESSOR(max_data, MAX_DATA, int) static int __inline mmcbr_update_ios(device_t dev) diff --git a/sys/dev/mmc/mmcsd.c b/sys/dev/mmc/mmcsd.c index 5e6440bd6df1..428d21530093 100644 --- a/sys/dev/mmc/mmcsd.c +++ b/sys/dev/mmc/mmcsd.c @@ -81,8 +81,6 @@ struct mmcsd_softc { int running; }; -#define MULTI_BLOCK_BROKEN - /* bus entry points */ static int mmcsd_probe(device_t dev); static int mmcsd_attach(device_t dev); @@ -235,12 +233,7 @@ mmcsd_rw(struct mmcsd_softc *sc, struct bio *bp) while (block < end) { char *vaddr = bp->bio_data + (block - bp->bio_pblkno) * sz; - int numblocks; -#ifdef MULTI_BLOCK - numblocks = end - block; -#else - numblocks = 1; -#endif + int numblocks = min(end - block, mmc_get_max_data(dev)); memset(&req, 0, sizeof(req)); memset(&cmd, 0, sizeof(cmd)); memset(&stop, 0, sizeof(stop)); diff --git a/sys/dev/mmc/mmcvar.h b/sys/dev/mmc/mmcvar.h index 5a0e43756551..9126439a851a 100644 --- a/sys/dev/mmc/mmcvar.h +++ b/sys/dev/mmc/mmcvar.h @@ -68,6 +68,7 @@ enum mmc_device_ivars { MMC_IVAR_CARD_TYPE, MMC_IVAR_BUS_WIDTH, MMC_IVAR_ERASE_SECTOR, + MMC_IVAR_MAX_DATA, // MMC_IVAR_, }; @@ -87,5 +88,6 @@ MMC_ACCESSOR(high_cap, HIGH_CAP, int) MMC_ACCESSOR(card_type, CARD_TYPE, int) MMC_ACCESSOR(bus_width, BUS_WIDTH, int) MMC_ACCESSOR(erase_sector, ERASE_SECTOR, int) +MMC_ACCESSOR(max_data, MAX_DATA, int) #endif /* DEV_MMC_MMCVAR_H */ diff --git a/sys/dev/sdhci/sdhci.c b/sys/dev/sdhci/sdhci.c index e7dd9c51b3b7..dcc33b0e4f97 100644 --- a/sys/dev/sdhci/sdhci.c +++ b/sys/dev/sdhci/sdhci.c @@ -1440,6 +1440,9 @@ sdhci_read_ivar(device_t bus, device_t child, int which, u_char *result) case MMCBR_IVAR_TIMING: *(int *)result = slot->host.ios.timing; break; + case MMCBR_IVAR_MAX_DATA: + *(int *)result = 65535; + break; } return (0); } @@ -1494,6 +1497,7 @@ sdhci_write_ivar(device_t bus, device_t child, int which, uintptr_t value) case MMCBR_IVAR_HOST_OCR: case MMCBR_IVAR_F_MIN: case MMCBR_IVAR_F_MAX: + case MMCBR_IVAR_MAX_DATA: return (EINVAL); } return (0); |
