PERFORCE change 167133 for review
Alexander Motin
mav at FreeBSD.org
Sun Aug 9 14:47:52 UTC 2009
http://perforce.freebsd.org/chv.cgi?CH=167133
Change 167133 by mav at mav_mavbook on 2009/08/09 14:47:10
Remove some more request->dev references. Now only setmode and CHS
related stuff use it in controller drivers code.
Affected files ...
.. //depot/projects/scottl-camlock/src/sys/dev/ata/ata-all.h#17 edit
.. //depot/projects/scottl-camlock/src/sys/dev/ata/ata-lowlevel.c#12 edit
.. //depot/projects/scottl-camlock/src/sys/dev/ata/ata-queue.c#17 edit
.. //depot/projects/scottl-camlock/src/sys/dev/ata/chipsets/ata-siliconimage.c#7 edit
Differences ...
==== //depot/projects/scottl-camlock/src/sys/dev/ata/ata-all.h#17 (text+ko) ====
@@ -389,6 +389,9 @@
#define ATA_R_THREAD 0x00000800
#define ATA_R_DIRECT 0x00001000
+#define ATA_R_ATAPI16 0x00010000
+#define ATA_R_ATAPI_INTR 0x00020000
+
#define ATA_R_DEBUG 0x10000000
#define ATA_R_DANGER1 0x20000000
#define ATA_R_DANGER2 0x40000000
@@ -416,7 +419,7 @@
#define ATA_DEBUG_RQ(request, string) \
{ \
if (request->flags & ATA_R_DEBUG) \
- device_printf(request->dev, "req=%p %s " string "\n", \
+ device_printf(request->parent, "req=%p %s " string "\n", \
request, ata_cmd2str(request)); \
}
#else
==== //depot/projects/scottl-camlock/src/sys/dev/ata/ata-lowlevel.c#12 (text+ko) ====
@@ -228,7 +228,6 @@
ata_end_transaction(struct ata_request *request)
{
struct ata_channel *ch = device_get_softc(request->parent);
- struct ata_device *atadev = device_get_softc(request->dev);
int length;
ATA_DEBUG_RQ(request, "end transaction");
@@ -351,8 +350,7 @@
goto end_finished;
}
ATA_IDX_OUTSW_STRM(ch, ATA_DATA, (int16_t *)request->u.atapi.ccb,
- (atadev->param.config &
- ATA_PROTO_MASK)== ATA_PROTO_ATAPI_12 ? 6 : 8);
+ (request->flags & ATA_R_ATAPI16) ? 8 : 6);
/* return wait for interrupt */
goto end_continue;
@@ -656,7 +654,6 @@
ata_generic_command(struct ata_request *request)
{
struct ata_channel *ch = device_get_softc(request->parent);
- struct ata_device *atadev = device_get_softc(request->dev);
/* select device */
ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_D_LBA | ATA_DEV(request->unit));
@@ -687,7 +684,7 @@
ATA_IDX_OUTB(ch, ATA_COMMAND, ATA_PACKET_CMD);
/* command interrupt device ? just return and wait for interrupt */
- if ((atadev->param.config & ATA_DRQ_MASK) == ATA_DRQ_INTR)
+ if (request->flags & ATA_R_ATAPI_INTR)
return 0;
/* wait for ready to write ATAPI command block */
@@ -711,8 +708,7 @@
/* output command block */
ATA_IDX_OUTSW_STRM(ch, ATA_DATA, (int16_t *)request->u.atapi.ccb,
- (atadev->param.config & ATA_PROTO_MASK) ==
- ATA_PROTO_ATAPI_12 ? 6 : 8);
+ (request->flags & ATA_R_ATAPI16) ? 8 : 6);
}
else {
ch->hw.tf_write(request);
==== //depot/projects/scottl-camlock/src/sys/dev/ata/ata-queue.c#17 (text+ko) ====
@@ -57,7 +57,12 @@
/* treat request as virgin (this might be an ATA_R_REQUEUE) */
request->result = request->status = request->error = 0;
+ /* Prepare paramers required by low-level code. */
request->unit = atadev->unit;
+ if ((atadev->param.config & ATA_PROTO_MASK) == ATA_PROTO_ATAPI_16)
+ request->flags |= ATA_R_ATAPI16;
+ if ((atadev->param.config & ATA_DRQ_MASK) == ATA_DRQ_INTR)
+ request->flags |= ATA_R_ATAPI_INTR;
/* check that the device is still valid */
if (!(request->parent = device_get_parent(request->dev))) {
request->result = ENXIO;
==== //depot/projects/scottl-camlock/src/sys/dev/ata/chipsets/ata-siliconimage.c#7 (text+ko) ====
@@ -571,13 +571,11 @@
/* setup transfer type */
if (request->flags & ATA_R_ATAPI) {
- struct ata_device *atadev = device_get_softc(request->dev);
-
bcopy(request->u.atapi.ccb, prb->u.atapi.ccb, 16);
- if ((atadev->param.config & ATA_PROTO_MASK) == ATA_PROTO_ATAPI_12)
+ if (request->flags & ATA_R_ATAPI16)
+ ATA_OUTL(ctlr->r_res2, 0x1000 + offset, 0x00000020);
+ else
ATA_OUTL(ctlr->r_res2, 0x1004 + offset, 0x00000020);
- else
- ATA_OUTL(ctlr->r_res2, 0x1000 + offset, 0x00000020);
if (request->flags & ATA_R_READ)
prb->control = htole16(0x0010);
if (request->flags & ATA_R_WRITE)
More information about the p4-projects
mailing list