Deleted Added
full compact
sdhci.c (254423) sdhci.c (254496)
1/*-
2 * Copyright (c) 2008 Alexander Motin <mav@FreeBSD.org>
3 * 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

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

19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2008 Alexander Motin <mav@FreeBSD.org>
3 * 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

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

19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26#include <sys/cdefs.h>
27__FBSDID("$FreeBSD: head/sys/dev/sdhci/sdhci.c 254423 2013-08-16 19:40:00Z ian $");
27__FBSDID("$FreeBSD: head/sys/dev/sdhci/sdhci.c 254496 2013-08-18 19:08:53Z ian $");
28
29#include <sys/param.h>
30#include <sys/systm.h>
31#include <sys/bus.h>
32#include <sys/conf.h>
33#include <sys/kernel.h>
34#include <sys/lock.h>
35#include <sys/module.h>

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

830 }
831 /* If command has response - fetch it. */
832 if (slot->curcmd->flags & MMC_RSP_PRESENT) {
833 if (slot->curcmd->flags & MMC_RSP_136) {
834 /* CRC is stripped so we need one byte shift. */
835 uint8_t extra = 0;
836 for (i = 0; i < 4; i++) {
837 uint32_t val = RD4(slot, SDHCI_RESPONSE + i * 4);
28
29#include <sys/param.h>
30#include <sys/systm.h>
31#include <sys/bus.h>
32#include <sys/conf.h>
33#include <sys/kernel.h>
34#include <sys/lock.h>
35#include <sys/module.h>

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

830 }
831 /* If command has response - fetch it. */
832 if (slot->curcmd->flags & MMC_RSP_PRESENT) {
833 if (slot->curcmd->flags & MMC_RSP_136) {
834 /* CRC is stripped so we need one byte shift. */
835 uint8_t extra = 0;
836 for (i = 0; i < 4; i++) {
837 uint32_t val = RD4(slot, SDHCI_RESPONSE + i * 4);
838 slot->curcmd->resp[3 - i] = (val << 8) + extra;
839 extra = val >> 24;
838 if (slot->quirks & SDHCI_QUIRK_DONT_SHIFT_RESPONSE)
839 slot->curcmd->resp[3 - i] = val;
840 else {
841 slot->curcmd->resp[3 - i] =
842 (val << 8) | extra;
843 extra = val >> 24;
844 }
840 }
841 } else
842 slot->curcmd->resp[0] = RD4(slot, SDHCI_RESPONSE);
843 }
844 /* If data ready - finish. */
845 if (slot->data_done)
846 sdhci_start(slot);
847}

--- 546 unchanged lines hidden ---
845 }
846 } else
847 slot->curcmd->resp[0] = RD4(slot, SDHCI_RESPONSE);
848 }
849 /* If data ready - finish. */
850 if (slot->data_done)
851 sdhci_start(slot);
852}

--- 546 unchanged lines hidden ---