Deleted Added
full compact
2c2
< * Copyright (c) 1998 - 2003 S�ren Schmidt <sos@FreeBSD.org>
---
> * Copyright (c) 1998 - 2004 S�ren Schmidt <sos@FreeBSD.org>
30c30
< __FBSDID("$FreeBSD: head/sys/dev/ata/ata-lowlevel.c 123421 2003-12-10 23:06:24Z sos $");
---
> __FBSDID("$FreeBSD: head/sys/dev/ata/ata-lowlevel.c 124403 2004-01-11 22:08:34Z sos $");
39c39
< #include <sys/mutex.h>
---
> #include <sys/sema.h>
71a72,77
> /* safety check, device might have been detached FIXME SOS */
> if (!request->device->param) {
> request->result = ENXIO;
> return ATA_OP_FINISHED;
> }
>
74a81,82
> ATA_DEBUG_RQ(request, "transaction");
>
86c94
< /* record command direction here as our request might be done later */
---
> /* record command direction here as our request might be gone later */
108a117
>
138a148
>
296a307,308
> ATA_DEBUG_RQ(request, "interrupt");
>
298c310,311
< if (ATA_IDX_INB(ch, ATA_ALTSTAT) & ATA_S_BUSY) {
---
> if (!(request->flags & ATA_R_TIMEOUT) &&
> ATA_IDX_INB(ch, ATA_ALTSTAT) & ATA_S_BUSY) {
303a317,318
> ATA_DEBUG_RQ(request, "interrupt accepted");
>
306a322,323
> request->flags |= ATA_R_INTR_SEEN;
>
494a512,518
> /* if we timed out, we hold on to the channel, ata_reinit() will unlock */
> if (request->flags & ATA_R_TIMEOUT) {
> ata_finish(request);
> return;
> }
>
> /* schedule completition for this request */
532c556
< /* if nothing showed up no need to get any further */
---
> /* if nothing showed up there is no need to get any further */
542c566,570
< /* reset channel */
---
> /* reset host end of channel (if supported) */
> if (ch->reset)
> ch->reset(ch);
>
> /* reset (both) devices on this channel */
619a648,651
> /* enable interrupt */
> DELAY(10);
> ATA_IDX_OUTB(ch, ATA_ALTSTAT, ATA_A_4BIT);
>
630,664d661
< #if 0
< if (!mask)
< return;
<
< if (mask & 0x01 && ostat0 != 0x00 &&
< !(ch->devices & (ATA_ATA_MASTER | ATA_ATAPI_MASTER))) {
< ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_MASTER);
< DELAY(10);
< ATA_IDX_OUTB(ch, ATA_ERROR, 0x58);
< ATA_IDX_OUTB(ch, ATA_CYL_LSB, 0xa5);
< err = ATA_IDX_INB(ch, ATA_ERROR);
< lsb = ATA_IDX_INB(ch, ATA_CYL_LSB);
< if (bootverbose)
< ata_printf(ch, ATA_MASTER, "ATA err=0x%02x lsb=0x%02x\n", err, lsb);
< if (err != 0x58 && lsb == 0xa5)
< ch->devices |= ATA_ATA_MASTER;
< }
< if (mask & 0x02 && ostat1 != 0x00 &&
< !(ch->devices & (ATA_ATA_SLAVE | ATA_ATAPI_SLAVE))) {
< ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_SLAVE);
< DELAY(10);
< ATA_IDX_OUTB(ch, ATA_ERROR, 0x58);
< ATA_IDX_OUTB(ch, ATA_CYL_LSB, 0xa5);
< err = ATA_IDX_INB(ch, ATA_ERROR);
< lsb = ATA_IDX_INB(ch, ATA_CYL_LSB);
< if (bootverbose)
< ata_printf(ch, ATA_SLAVE, "ATA err=0x%02x lsb=0x%02x\n", err, lsb);
< if (err != 0x58 && lsb == 0xa5)
< ch->devices |= ATA_ATA_SLAVE;
< }
<
< if (bootverbose)
< ata_printf(ch, -1, "reset tp3 devices=0x%b\n", ch->devices,
< "\20\4ATAPI_SLAVE\3ATAPI_MASTER\2ATA_SLAVE\1ATA_MASTER");
< #endif
739,741d735
< /* enable interrupt */
< ATA_IDX_OUTB(atadev->channel, ATA_ALTSTAT, ATA_A_4BIT);
<