1/*-
2 * Copyright (c) 1998,1999,2000 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 67058 2000-10-13 11:21:27Z sos $
29 */
30
31#include "ata.h"
32#include "isa.h"
33#include "card.h"
34#include "pci.h"
35#include "atadisk.h"
36#include "atapicd.h"
--- 29 unchanged lines hidden (view full) ---
66#include <dev/ata/ata-disk.h>
67#include <dev/ata/atapi-all.h>
68
69/* misc defines */
70#define IOMASK 0xfffffffc
71#define ATA_IOADDR_RID 0
72#define ATA_ALTADDR_RID 1
73#define ATA_BMADDR_RID 2
74#define ATA_MASTERDEV(dev) ((pci_get_progif(dev) & 0x80) && \
75 (pci_get_progif(dev) & 0x05) != 0x05)
76
77/* prototypes */
78static int ata_probe(device_t);
79static int ata_attach(device_t);
80static int ata_detach(device_t);
81static int ata_resume(device_t);
82static void ata_boot_attach(void);
83static void ata_intr(void *);
--- 703 unchanged lines hidden (view full) ---
787 if (!io)
788 goto failure;
789 ioaddr = rman_get_start(io);
790
791 rid = ATA_ALTADDR_RID;
792 altio = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0,
793 ATA_ALTIOSIZE, RF_ACTIVE);
794 if (altio) {
795 if (ATA_MASTERDEV(device_get_parent(dev)))
796 altioaddr = rman_get_start(altio);
797 else
798 altioaddr = rman_get_start(altio) + 0x02;
799 }
800 else
801 altioaddr = ioaddr + ATA_IOSIZE;
802
803 rid = ATA_BMADDR_RID;
--- 985 unchanged lines hidden ---
2 * Copyright (c) 1998,1999,2000 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 67058 2000-10-13 11:21:27Z sos $
29 */
30
31#include "ata.h"
32#include "isa.h"
33#include "card.h"
34#include "pci.h"
35#include "atadisk.h"
36#include "atapicd.h"
--- 29 unchanged lines hidden (view full) ---
66#include <dev/ata/ata-disk.h>
67#include <dev/ata/atapi-all.h>
68
69/* misc defines */
70#define IOMASK 0xfffffffc
71#define ATA_IOADDR_RID 0
72#define ATA_ALTADDR_RID 1
73#define ATA_BMADDR_RID 2
74#define ATA_MASTERDEV(dev) ((pci_get_progif(dev) & 0x80) && \
75 (pci_get_progif(dev) & 0x05) != 0x05)
76
77/* prototypes */
78static int ata_probe(device_t);
79static int ata_attach(device_t);
80static int ata_detach(device_t);
81static int ata_resume(device_t);
82static void ata_boot_attach(void);
83static void ata_intr(void *);
--- 703 unchanged lines hidden (view full) ---
787 if (!io)
788 goto failure;
789 ioaddr = rman_get_start(io);
790
791 rid = ATA_ALTADDR_RID;
792 altio = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0,
793 ATA_ALTIOSIZE, RF_ACTIVE);
794 if (altio) {
795 if (ATA_MASTERDEV(device_get_parent(dev)))
796 altioaddr = rman_get_start(altio);
797 else
798 altioaddr = rman_get_start(altio) + 0x02;
799 }
800 else
801 altioaddr = ioaddr + ATA_IOSIZE;
802
803 rid = ATA_BMADDR_RID;
--- 985 unchanged lines hidden ---