ata-all.c (54270) | ata-all.c (54544) |
---|---|
1/*- 2 * Copyright (c) 1998,1999 S�ren Schmidt 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 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * | 1/*- 2 * Copyright (c) 1998,1999 S�ren Schmidt 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 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * |
28 * $FreeBSD: head/sys/dev/ata/ata-all.c 54270 1999-12-07 22:07:18Z sos $ | 28 * $FreeBSD: head/sys/dev/ata/ata-all.c 54544 1999-12-13 10:19:39Z sos $ |
29 */ 30 31#include "ata.h" 32#include "apm.h" 33#include "isa.h" 34#include "pci.h" 35#include "atadisk.h" 36#include "atapicd.h" --- 153 unchanged lines hidden (view full) --- 190 case 0x12308086: 191 return "Intel PIIX ATA controller"; 192 case 0x70108086: 193 return "Intel PIIX3 ATA controller"; 194 case 0x71118086: 195 return "Intel PIIX4 ATA controller"; 196 case 0x522910b9: 197 return "AcerLabs Aladdin ATA controller"; | 29 */ 30 31#include "ata.h" 32#include "apm.h" 33#include "isa.h" 34#include "pci.h" 35#include "atadisk.h" 36#include "atapicd.h" --- 153 unchanged lines hidden (view full) --- 190 case 0x12308086: 191 return "Intel PIIX ATA controller"; 192 case 0x70108086: 193 return "Intel PIIX3 ATA controller"; 194 case 0x71118086: 195 return "Intel PIIX4 ATA controller"; 196 case 0x522910b9: 197 return "AcerLabs Aladdin ATA controller"; |
198 case 0x4d33105a: 199 return "Promise Ultra/33 ATA controller"; 200 case 0x4d38105a: 201 return "Promise Ultra/66 ATA controller"; 202 case 0x00041103: 203 return "HighPoint HPT366 ATA controller"; | |
204 case 0x05711106: /* 82c586 & 82c686 */ 205 switch (pci_read_config(dev, 0x08, 1)) { 206 case 1: 207 return "VIA 82C586 ATA controller"; 208 case 6: 209 return "VIA 82C686 ATA controller"; 210 } 211 return "VIA Apollo ATA controller"; | 198 case 0x05711106: /* 82c586 & 82c686 */ 199 switch (pci_read_config(dev, 0x08, 1)) { 200 case 1: 201 return "VIA 82C586 ATA controller"; 202 case 6: 203 return "VIA 82C686 ATA controller"; 204 } 205 return "VIA Apollo ATA controller"; |
206 case 0x55131039: 207 return "SiS 5591 ATA controller"; 208 case 0x4d33105a: 209 return "Promise Ultra/33 ATA controller"; 210 case 0x4d38105a: 211 return "Promise Ultra/66 ATA controller"; 212 case 0x00041103: 213 return "HighPoint HPT366 ATA controller"; |
|
212 213 /* unsupported but known chipsets, generic DMA only */ 214 case 0x05961106: 215 return "VIA 82C596 ATA controller (generic mode)"; 216 case 0x06401095: 217 return "CMD 640 ATA controller (generic mode)"; 218 case 0x06461095: 219 return "CMD 646 ATA controller (generic mode)"; --- 541 unchanged lines hidden (view full) --- 761} 762 763int32_t 764ata_wait(struct ata_softc *scp, int32_t device, u_int8_t mask) 765{ 766 u_int8_t status; 767 u_int32_t timeout = 0; 768 | 214 215 /* unsupported but known chipsets, generic DMA only */ 216 case 0x05961106: 217 return "VIA 82C596 ATA controller (generic mode)"; 218 case 0x06401095: 219 return "CMD 640 ATA controller (generic mode)"; 220 case 0x06461095: 221 return "CMD 646 ATA controller (generic mode)"; --- 541 unchanged lines hidden (view full) --- 763} 764 765int32_t 766ata_wait(struct ata_softc *scp, int32_t device, u_int8_t mask) 767{ 768 u_int8_t status; 769 u_int32_t timeout = 0; 770 |
771 DELAY(1); |
|
769 while (timeout <= 5000000) { /* timeout 5 secs */ 770 status = inb(scp->ioaddr + ATA_STATUS); 771 772 /* if drive fails status, reselect the drive just to be sure */ 773 if (status == 0xff) { 774 printf("ata%d: %s: no status, reselecting device\n", 775 scp->lun, device?"slave":"master"); 776 outb(scp->ioaddr + ATA_DRIVE, ATA_D_IBM | device); --- 171 unchanged lines hidden --- | 772 while (timeout <= 5000000) { /* timeout 5 secs */ 773 status = inb(scp->ioaddr + ATA_STATUS); 774 775 /* if drive fails status, reselect the drive just to be sure */ 776 if (status == 0xff) { 777 printf("ata%d: %s: no status, reselecting device\n", 778 scp->lun, device?"slave":"master"); 779 outb(scp->ioaddr + ATA_DRIVE, ATA_D_IBM | device); --- 171 unchanged lines hidden --- |