Deleted Added
full compact
mmcsd.c (183542) mmcsd.c (183704)
1/*-
2 * Copyright (c) 2006 Bernd Walter. All rights reserved.
3 * Copyright (c) 2006 M. Warner Losh. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 37 unchanged lines hidden (view full) ---

46 * implication, estoppel or otherwise under any patent or other rights of the
47 * SD Group, SD-3C LLC, the SD Card Association or any third party. Nothing
48 * herein shall be construed as an obligation by the SD Group, the SD-3C LLC
49 * or the SD Card Association to disclose or distribute any technical
50 * information, know-how or other confidential information to any third party.
51 */
52
53#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2006 Bernd Walter. All rights reserved.
3 * Copyright (c) 2006 M. Warner Losh. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 37 unchanged lines hidden (view full) ---

46 * implication, estoppel or otherwise under any patent or other rights of the
47 * SD Group, SD-3C LLC, the SD Card Association or any third party. Nothing
48 * herein shall be construed as an obligation by the SD Group, the SD-3C LLC
49 * or the SD Card Association to disclose or distribute any technical
50 * information, know-how or other confidential information to any third party.
51 */
52
53#include <sys/cdefs.h>
54__FBSDID("$FreeBSD: head/sys/dev/mmc/mmcsd.c 183542 2008-10-02 07:06:59Z imp $");
54__FBSDID("$FreeBSD: head/sys/dev/mmc/mmcsd.c 183704 2008-10-08 17:35:41Z mav $");
55
56#include <sys/param.h>
57#include <sys/systm.h>
58#include <sys/bio.h>
59#include <sys/bus.h>
60#include <sys/conf.h>
61#include <sys/kernel.h>
62#include <sys/kthread.h>

--- 38 unchanged lines hidden (view full) ---

101#define MMCSD_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx);
102#define MMCSD_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED);
103#define MMCSD_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED);
104
105static int
106mmcsd_probe(device_t dev)
107{
108
55
56#include <sys/param.h>
57#include <sys/systm.h>
58#include <sys/bio.h>
59#include <sys/bus.h>
60#include <sys/conf.h>
61#include <sys/kernel.h>
62#include <sys/kthread.h>

--- 38 unchanged lines hidden (view full) ---

101#define MMCSD_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx);
102#define MMCSD_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED);
103#define MMCSD_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED);
104
105static int
106mmcsd_probe(device_t dev)
107{
108
109 device_quiet(dev);
109 device_set_desc(dev, "MMC/SD Memory Card");
110 return (0);
111}
112
113static int
114mmcsd_attach(device_t dev)
115{
116 struct mmcsd_softc *sc;

--- 134 unchanged lines hidden (view full) ---

251 else
252 cmd.opcode = MMC_READ_SINGLE_BLOCK;
253 } else {
254 if (numblocks > 1)
255 cmd.opcode = MMC_WRITE_MULTIPLE_BLOCK;
256 else
257 cmd.opcode = MMC_WRITE_BLOCK;
258 }
110 device_set_desc(dev, "MMC/SD Memory Card");
111 return (0);
112}
113
114static int
115mmcsd_attach(device_t dev)
116{
117 struct mmcsd_softc *sc;

--- 134 unchanged lines hidden (view full) ---

252 else
253 cmd.opcode = MMC_READ_SINGLE_BLOCK;
254 } else {
255 if (numblocks > 1)
256 cmd.opcode = MMC_WRITE_MULTIPLE_BLOCK;
257 else
258 cmd.opcode = MMC_WRITE_BLOCK;
259 }
259 cmd.arg = block << 9;
260 cmd.arg = block;
261 if (!mmc_get_high_cap(dev))
262 cmd.arg <<= 9;
260 cmd.flags = MMC_RSP_R1 | MMC_CMD_ADTC;
261 data.data = vaddr;
262 data.mrq = &req;
263 if (bp->bio_cmd == BIO_READ)
264 data.flags = MMC_DATA_READ;
265 else
266 data.flags = MMC_DATA_WRITE;
267 data.len = numblocks * sz;

--- 49 unchanged lines hidden ---
263 cmd.flags = MMC_RSP_R1 | MMC_CMD_ADTC;
264 data.data = vaddr;
265 data.mrq = &req;
266 if (bp->bio_cmd == BIO_READ)
267 data.flags = MMC_DATA_READ;
268 else
269 data.flags = MMC_DATA_WRITE;
270 data.len = numblocks * sz;

--- 49 unchanged lines hidden ---