Deleted Added
full compact
siis.c (214325) siis.c (214988)
1/*-
2 * Copyright (c) 2009 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

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

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

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

20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/dev/siis/siis.c 214325 2010-10-25 07:41:21Z mav $");
28__FBSDID("$FreeBSD: head/sys/dev/siis/siis.c 214988 2010-11-08 15:36:15Z mav $");
29
30#include <sys/param.h>
31#include <sys/module.h>
32#include <sys/systm.h>
33#include <sys/kernel.h>
34#include <sys/ata.h>
35#include <sys/bus.h>
36#include <sys/endian.h>

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

1203 res->device = ATA_INB(ch->r_mem, offs + 7);
1204 res->lba_low_exp = ATA_INB(ch->r_mem, offs + 8);
1205 res->lba_mid_exp = ATA_INB(ch->r_mem, offs + 9);
1206 res->lba_high_exp = ATA_INB(ch->r_mem, offs + 10);
1207 res->sector_count = ATA_INB(ch->r_mem, offs + 12);
1208 res->sector_count_exp = ATA_INB(ch->r_mem, offs + 13);
1209 } else
1210 bzero(res, sizeof(*res));
29
30#include <sys/param.h>
31#include <sys/module.h>
32#include <sys/systm.h>
33#include <sys/kernel.h>
34#include <sys/ata.h>
35#include <sys/bus.h>
36#include <sys/endian.h>

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

1203 res->device = ATA_INB(ch->r_mem, offs + 7);
1204 res->lba_low_exp = ATA_INB(ch->r_mem, offs + 8);
1205 res->lba_mid_exp = ATA_INB(ch->r_mem, offs + 9);
1206 res->lba_high_exp = ATA_INB(ch->r_mem, offs + 10);
1207 res->sector_count = ATA_INB(ch->r_mem, offs + 12);
1208 res->sector_count_exp = ATA_INB(ch->r_mem, offs + 13);
1209 } else
1210 bzero(res, sizeof(*res));
1211 if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN &&
1212 ch->numrslots == 1) {
1213 ccb->ataio.resid = ccb->ataio.dxfer_len -
1214 ATA_INL(ch->r_mem, SIIS_P_LRAM_SLOT(slot->slot) + 4);
1215 }
1216 } else {
1217 if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN &&
1218 ch->numrslots == 1) {
1219 ccb->csio.resid = ccb->csio.dxfer_len -
1220 ATA_INL(ch->r_mem, SIIS_P_LRAM_SLOT(slot->slot) + 4);
1221 }
1211 }
1212 if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) {
1213 bus_dmamap_sync(ch->dma.data_tag, slot->dma.data_map,
1214 (ccb->ccb_h.flags & CAM_DIR_IN) ?
1215 BUS_DMASYNC_POSTREAD : BUS_DMASYNC_POSTWRITE);
1216 bus_dmamap_unload(ch->dma.data_tag, slot->dma.data_map);
1217 }
1218 /* Set proper result status. */

--- 646 unchanged lines hidden ---
1222 }
1223 if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) {
1224 bus_dmamap_sync(ch->dma.data_tag, slot->dma.data_map,
1225 (ccb->ccb_h.flags & CAM_DIR_IN) ?
1226 BUS_DMASYNC_POSTREAD : BUS_DMASYNC_POSTWRITE);
1227 bus_dmamap_unload(ch->dma.data_tag, slot->dma.data_map);
1228 }
1229 /* Set proper result status. */

--- 646 unchanged lines hidden ---