2 * Copyright (c) 1999 John Hay.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. Neither the name of the author nor the names of any co-contributors
14 * may be used to endorse or promote products derived from this software
15 * without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 #include <sys/param.h>
35 #include <sys/systm.h>
36 #include <sys/kernel.h>
37 #include <sys/malloc.h>
39 #include <pci/pcivar.h>
42 * The must match with the real functions in if_ar.c
44 extern void *arattach_pci(int unit, vm_offset_t mem_vaddr);
45 extern void arintr_hc(void *hc);
47 static const char *ar_pci_probe(pcici_t tag, pcidi_t type);
48 static void ar_pci_attach(pcici_t config_id, int unit);
50 static u_long arc_count = NAR;
52 static struct pci_device ar_pci_driver =
61 COMPAT_PCI_DRIVER (ar_pci, ar_pci_driver);
64 ar_pci_probe(pcici_t tag, pcidi_t type)
68 return ("Digi SYNC/570i-PCI 2 port");
71 printf("Digi SYNC/570i-PCI 2 port (mapped below 1M)\n");
72 printf("Please change the jumper to select linear mode.\n");
75 return ("Digi SYNC/570i-PCI 4 port");
78 printf("Digi SYNC/570i-PCI 4 port (mapped below 1M)\n");
79 printf("Please change the jumper to select linear mode.\n");
88 ar_pci_attach(pcici_t config_id, int unit)
92 vm_offset_t mem_vaddr, mem_paddr;
93 vm_offset_t plx_vaddr, plx_paddr;
95 if(!pci_map_mem(config_id, 0x10, &plx_vaddr, &plx_paddr)) {
96 printf("arp: map failed.\n");
100 if(!pci_map_mem(config_id, 0x18, &mem_vaddr, &mem_paddr)) {
101 printf("arp: map failed.\n");
105 hc = arattach_pci(unit, mem_vaddr);
109 /* Magic to enable the card to generate interrupts. */
110 inten = (u_char *)plx_vaddr;
113 if(!pci_map_int(config_id, arintr_hc, (void *)hc, &net_imask)) {