ata_dbdma.c (360bf6787a0550ebf392950f85d166a37c5471f4) | ata_dbdma.c (066f913a94b134b6d5e32b6af88f297c7da9c031) |
---|---|
1/*- 2 * Copyright 2008 by Nathan Whitehorn. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 190 unchanged lines hidden (view full) --- 199 } 200 return 0; 201} 202 203static int 204ata_dbdma_load(struct ata_request *request, void *addr, int *entries) 205{ 206 struct ata_channel *ch = device_get_softc(request->parent); | 1/*- 2 * Copyright 2008 by Nathan Whitehorn. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 190 unchanged lines hidden (view full) --- 199 } 200 return 0; 201} 202 203static int 204ata_dbdma_load(struct ata_request *request, void *addr, int *entries) 205{ 206 struct ata_channel *ch = device_get_softc(request->parent); |
207 struct ata_device *atadev = device_get_softc(request->dev); | |
208 struct ata_dbdma_dmaload_args args; 209 210 int error; 211 212 args.sc = device_get_softc(request->parent); 213 args.write = !(request->flags & ATA_R_READ); 214 215 if (!request->bytecount) { --- 9 unchanged lines hidden (view full) --- 225 } 226 if (request->bytecount > ch->dma.max_iosize) { 227 device_printf(request->dev, 228 "FAILURE - oversized DMA transfer attempt %d > %d\n", 229 request->bytecount, ch->dma.max_iosize); 230 return EIO; 231 } 232 | 207 struct ata_dbdma_dmaload_args args; 208 209 int error; 210 211 args.sc = device_get_softc(request->parent); 212 args.write = !(request->flags & ATA_R_READ); 213 214 if (!request->bytecount) { --- 9 unchanged lines hidden (view full) --- 224 } 225 if (request->bytecount > ch->dma.max_iosize) { 226 device_printf(request->dev, 227 "FAILURE - oversized DMA transfer attempt %d > %d\n", 228 request->bytecount, ch->dma.max_iosize); 229 return EIO; 230 } 231 |
233 request->dma = &ch->dma.slot[atadev->unit]; | 232 request->dma = &ch->dma.slot[0]; |
234 235 if ((error = bus_dmamap_load(request->dma->data_tag, 236 request->dma->data_map, request->data, request->bytecount, 237 &ata_dbdma_setprd, &args, BUS_DMA_NOWAIT))) { 238 device_printf(request->dev, "FAILURE - load data\n"); 239 goto error; 240 } 241 --- 47 unchanged lines hidden --- | 233 234 if ((error = bus_dmamap_load(request->dma->data_tag, 235 request->dma->data_map, request->data, request->bytecount, 236 &ata_dbdma_setprd, &args, BUS_DMA_NOWAIT))) { 237 device_printf(request->dev, "FAILURE - load data\n"); 238 goto error; 239 } 240 --- 47 unchanged lines hidden --- |