svn commit: r236642 - stable/9/sys/dev/mmc
Marius Strobl
marius at FreeBSD.org
Tue Jun 5 20:53:47 UTC 2012
Author: marius
Date: Tue Jun 5 20:53:46 2012
New Revision: 236642
URL: http://svn.freebsd.org/changeset/base/236642
Log:
MFC: r236491
Add missing prototypes. While at it, sort them alphabetically.
Modified:
stable/9/sys/dev/mmc/mmc.c
stable/9/sys/dev/mmc/mmcsd.c
Directory Properties:
stable/9/sys/ (props changed)
stable/9/sys/amd64/include/xen/ (props changed)
stable/9/sys/boot/ (props changed)
stable/9/sys/boot/i386/efi/ (props changed)
stable/9/sys/boot/ia64/efi/ (props changed)
stable/9/sys/boot/ia64/ski/ (props changed)
stable/9/sys/boot/powerpc/boot1.chrp/ (props changed)
stable/9/sys/boot/powerpc/ofw/ (props changed)
stable/9/sys/cddl/contrib/opensolaris/ (props changed)
stable/9/sys/conf/ (props changed)
stable/9/sys/contrib/dev/acpica/ (props changed)
stable/9/sys/contrib/octeon-sdk/ (props changed)
stable/9/sys/contrib/pf/ (props changed)
stable/9/sys/contrib/x86emu/ (props changed)
stable/9/sys/dev/ (props changed)
stable/9/sys/dev/e1000/ (props changed)
stable/9/sys/dev/ixgbe/ (props changed)
stable/9/sys/fs/ (props changed)
stable/9/sys/fs/ntfs/ (props changed)
stable/9/sys/modules/ (props changed)
Modified: stable/9/sys/dev/mmc/mmc.c
==============================================================================
--- stable/9/sys/dev/mmc/mmc.c Tue Jun 5 20:49:18 2012 (r236641)
+++ stable/9/sys/dev/mmc/mmc.c Tue Jun 5 20:53:46 2012 (r236642)
@@ -112,11 +112,21 @@ static int mmc_debug;
SYSCTL_INT(_hw_mmc, OID_AUTO, debug, CTLFLAG_RW, &mmc_debug, 0, "Debug level");
/* bus entry points */
-static int mmc_probe(device_t dev);
+static int mmc_acquire_bus(device_t busdev, device_t dev);
static int mmc_attach(device_t dev);
+static int mmc_child_location_str(device_t dev, device_t child, char *buf,
+ size_t buflen);
static int mmc_detach(device_t dev);
-static int mmc_suspend(device_t dev);
+static int mmc_probe(device_t dev);
+static int mmc_read_ivar(device_t bus, device_t child, int which,
+ uintptr_t *result);
+static int mmc_release_bus(device_t busdev, device_t dev);
static int mmc_resume(device_t dev);
+static int mmc_suspend(device_t dev);
+static int mmc_wait_for_request(device_t brdev, device_t reqdev,
+ struct mmc_request *req);
+static int mmc_write_ivar(device_t bus, device_t child, int which,
+ uintptr_t value);
#define MMC_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx)
#define MMC_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx)
@@ -127,25 +137,69 @@ static int mmc_resume(device_t dev);
#define MMC_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED);
#define MMC_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED);
+static int mmc_all_send_cid(struct mmc_softc *sc, uint32_t *rawcid);
+static void mmc_app_decode_scr(uint32_t *raw_scr, struct mmc_scr *scr);
+static void mmc_app_decode_sd_status(uint32_t *raw_sd_status,
+ struct mmc_sd_status *sd_status);
+static int mmc_app_sd_status(struct mmc_softc *sc, uint16_t rca,
+ uint32_t *rawsdstatus);
+static int mmc_app_send_scr(struct mmc_softc *sc, uint16_t rca,
+ uint32_t *rawscr);
static int mmc_calculate_clock(struct mmc_softc *sc);
-static void mmc_delayed_attach(void *);
+static void mmc_decode_cid_mmc(uint32_t *raw_cid, struct mmc_cid *cid);
+static void mmc_decode_cid_sd(uint32_t *raw_cid, struct mmc_cid *cid);
+static void mmc_decode_csd_mmc(uint32_t *raw_csd, struct mmc_csd *csd);
+static void mmc_decode_csd_sd(uint32_t *raw_csd, struct mmc_csd *csd);
+static void mmc_delayed_attach(void *xsc);
+static int mmc_delete_cards(struct mmc_softc *sc);
+static void mmc_discover_cards(struct mmc_softc *sc);
+static void mmc_format_card_id_string(struct mmc_ivars *ivar);
+static void mmc_go_discovery(struct mmc_softc *sc);
+static uint32_t mmc_get_bits(uint32_t *bits, int bit_len, int start,
+ int size);
+static int mmc_highest_voltage(uint32_t ocr);
+static void mmc_idle_cards(struct mmc_softc *sc);
+static void mmc_ms_delay(int ms);
+static void mmc_log_card(device_t dev, struct mmc_ivars *ivar, int newcard);
static void mmc_power_down(struct mmc_softc *sc);
+static void mmc_power_up(struct mmc_softc *sc);
+static void mmc_rescan_cards(struct mmc_softc *sc);
+static void mmc_scan(struct mmc_softc *sc);
+static int mmc_sd_switch(struct mmc_softc *sc, uint8_t mode, uint8_t grp,
+ uint8_t value, uint8_t *res);
+static int mmc_select_card(struct mmc_softc *sc, uint16_t rca);
+static uint32_t mmc_select_vdd(struct mmc_softc *sc, uint32_t ocr);
+static int mmc_send_app_op_cond(struct mmc_softc *sc, uint32_t ocr,
+ uint32_t *rocr);
+static int mmc_send_csd(struct mmc_softc *sc, uint16_t rca, uint32_t *rawcsd);
+static int mmc_send_ext_csd(struct mmc_softc *sc, uint8_t *rawextcsd);
+static int mmc_send_if_cond(struct mmc_softc *sc, uint8_t vhs);
+static int mmc_send_op_cond(struct mmc_softc *sc, uint32_t ocr,
+ uint32_t *rocr);
+static int mmc_send_relative_addr(struct mmc_softc *sc, uint32_t *resp);
+static int mmc_send_status(struct mmc_softc *sc, uint16_t rca,
+ uint32_t *status);
+static int mmc_set_blocklen(struct mmc_softc *sc, uint32_t len);
+static int mmc_set_card_bus_width(struct mmc_softc *sc, uint16_t rca,
+ int width);
+static int mmc_set_relative_addr(struct mmc_softc *sc, uint16_t resp);
+static int mmc_set_timing(struct mmc_softc *sc, int timing);
+static int mmc_switch(struct mmc_softc *sc, uint8_t set, uint8_t index,
+ uint8_t value);
+static int mmc_test_bus_width(struct mmc_softc *sc);
+static int mmc_wait_for_app_cmd(struct mmc_softc *sc, uint32_t rca,
+ struct mmc_command *cmd, int retries);
static int mmc_wait_for_cmd(struct mmc_softc *sc, struct mmc_command *cmd,
int retries);
static int mmc_wait_for_command(struct mmc_softc *sc, uint32_t opcode,
uint32_t arg, uint32_t flags, uint32_t *resp, int retries);
-static int mmc_select_card(struct mmc_softc *sc, uint16_t rca);
-static int mmc_set_card_bus_width(struct mmc_softc *sc, uint16_t rca, int width);
-static int mmc_app_send_scr(struct mmc_softc *sc, uint16_t rca, uint32_t *rawscr);
-static void mmc_app_decode_scr(uint32_t *raw_scr, struct mmc_scr *scr);
-static int mmc_send_ext_csd(struct mmc_softc *sc, uint8_t *rawextcsd);
-static void mmc_scan(struct mmc_softc *sc);
-static int mmc_delete_cards(struct mmc_softc *sc);
-static void mmc_format_card_id_string(struct mmc_ivars *ivar);
+static int mmc_wait_for_req(struct mmc_softc *sc, struct mmc_request *req);
+static void mmc_wakeup(struct mmc_request *req);
static void
mmc_ms_delay(int ms)
{
+
DELAY(1000 * ms); /* XXX BAD */
}
Modified: stable/9/sys/dev/mmc/mmcsd.c
==============================================================================
--- stable/9/sys/dev/mmc/mmcsd.c Tue Jun 5 20:49:18 2012 (r236641)
+++ stable/9/sys/dev/mmc/mmcsd.c Tue Jun 5 20:53:46 2012 (r236642)
@@ -89,19 +89,21 @@ struct mmcsd_softc {
};
/* bus entry points */
-static int mmcsd_probe(device_t dev);
static int mmcsd_attach(device_t dev);
static int mmcsd_detach(device_t dev);
+static int mmcsd_probe(device_t dev);
/* disk routines */
-static int mmcsd_open(struct disk *dp);
static int mmcsd_close(struct disk *dp);
-static void mmcsd_strategy(struct bio *bp);
static int mmcsd_dump(void *arg, void *virtual, vm_offset_t physical,
off_t offset, size_t length);
+static int mmcsd_open(struct disk *dp);
+static void mmcsd_strategy(struct bio *bp);
static void mmcsd_task(void *arg);
static int mmcsd_bus_bit_width(device_t dev);
+static daddr_t mmcsd_delete(struct mmcsd_softc *sc, struct bio *bp);
+static daddr_t mmcsd_rw(struct mmcsd_softc *sc, struct bio *bp);
#define MMCSD_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx)
#define MMCSD_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx)
@@ -256,12 +258,14 @@ mmcsd_resume(device_t dev)
static int
mmcsd_open(struct disk *dp)
{
+
return (0);
}
static int
mmcsd_close(struct disk *dp)
{
+
return (0);
}
@@ -521,6 +525,7 @@ out:
static int
mmcsd_bus_bit_width(device_t dev)
{
+
if (mmc_get_bus_width(dev) == bus_width_1)
return (1);
if (mmc_get_bus_width(dev) == bus_width_4)
More information about the svn-src-stable-9
mailing list