pcivar.h (188fafbc3f2af56fcbcaffb937cf02b91e58c4ad) | pcivar.h (06915ea69a48dd223d1612cefc20795c2d38d359) |
---|---|
1#ifndef PCI_COMPAT 2#define PCI_COMPAT 3#endif | |
4/* 5 * Copyright (c) 1997, Stefan Esser <se@freebsd.org> 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions 10 * are met: 11 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * | 1/* 2 * Copyright (c) 1997, Stefan Esser <se@freebsd.org> 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 --- 9 unchanged lines hidden (view full) --- 18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * |
29 * $Id: pcivar.h,v 1.19 1998/07/22 08:39:08 dfr Exp $ | 26 * $Id: pcivar.h,v 1.20 1998/08/13 19:12:20 gibbs Exp $ |
30 * 31 */ 32 | 27 * 28 */ 29 |
30#ifndef _PCIVAR_H_ 31#define _PCIVAR_H_ 32 33#ifndef PCI_COMPAT 34#define PCI_COMPAT 35#endif 36 37#include <pci/pci_ioctl.h> /* XXX KDM */ 38#include <sys/queue.h> 39 |
|
33/* some PCI bus constants */ 34 35#define PCI_BUSMAX 255 /* highest supported bus number */ 36#define PCI_SLOTMAX 31 /* highest supported slot number */ 37#define PCI_FUNCMAX 7 /* highest supported function number */ 38#define PCI_REGMAX 255 /* highest supported config register addr. */ 39 40#define PCI_MAXMAPS_0 6 /* max. no. of memory/port maps */ --- 19 unchanged lines hidden (view full) --- 60 u_int8_t ln2size; 61 u_int8_t ln2range; 62/* u_int8_t dummy;*/ 63} pcimap; 64 65/* config header information common to all header types */ 66 67typedef struct pcicfg { | 40/* some PCI bus constants */ 41 42#define PCI_BUSMAX 255 /* highest supported bus number */ 43#define PCI_SLOTMAX 31 /* highest supported slot number */ 44#define PCI_FUNCMAX 7 /* highest supported function number */ 45#define PCI_REGMAX 255 /* highest supported config register addr. */ 46 47#define PCI_MAXMAPS_0 6 /* max. no. of memory/port maps */ --- 19 unchanged lines hidden (view full) --- 67 u_int8_t ln2size; 68 u_int8_t ln2range; 69/* u_int8_t dummy;*/ 70} pcimap; 71 72/* config header information common to all header types */ 73 74typedef struct pcicfg { |
68 struct pcicfg *parent; 69 struct pcicfg *next; | |
70 pcimap *map; /* pointer to array of PCI maps */ 71 void *hdrspec; /* pointer to header type specific data */ 72 73 u_int16_t subvendor; /* card vendor ID */ 74 u_int16_t subdevice; /* card device ID, assigned by card vendor */ 75 u_int16_t vendor; /* chip vendor ID */ 76 u_int16_t device; /* chip device ID, assigned by chip vendor */ 77 --- 70 unchanged lines hidden (view full) --- 148/* PCI bus attach definitions (there could be multiple PCI bus *trees* ... */ 149 150typedef struct pciattach { 151 int unit; 152 int pcibushigh; 153 struct pciattach *next; 154} pciattach; 155 | 75 pcimap *map; /* pointer to array of PCI maps */ 76 void *hdrspec; /* pointer to header type specific data */ 77 78 u_int16_t subvendor; /* card vendor ID */ 79 u_int16_t subdevice; /* card device ID, assigned by card vendor */ 80 u_int16_t vendor; /* chip vendor ID */ 81 u_int16_t device; /* chip device ID, assigned by chip vendor */ 82 --- 70 unchanged lines hidden (view full) --- 153/* PCI bus attach definitions (there could be multiple PCI bus *trees* ... */ 154 155typedef struct pciattach { 156 int unit; 157 int pcibushigh; 158 struct pciattach *next; 159} pciattach; 160 |
161struct pci_devinfo { 162 STAILQ_ENTRY(pci_devinfo) pci_links; 163 struct pci_device *device; /* should this be ifdefed? */ 164 pcicfgregs cfg; 165 struct pci_conf conf; 166}; 167 168extern u_int32_t pci_numdevs; 169 170 |
|
156/* externally visible functions */ 157 158int pci_probe (pciattach *attach); | 171/* externally visible functions */ 172 173int pci_probe (pciattach *attach); |
159void pci_drvattach(pcicfgregs *cfg); | 174void pci_drvattach(struct pci_devinfo *dinfo); |
160 161/* low level PCI config register functions provided by pcibus.c */ 162 163int pci_cfgopen (void); 164int pci_cfgread (pcicfgregs *cfg, int reg, int bytes); 165void pci_cfgwrite (pcicfgregs *cfg, int reg, int data, int bytes); 166 167/* for compatibility to FreeBSD-2.2 version of PCI code */ --- 35 unchanged lines hidden (view full) --- 203void pci_configure (void); 204int pci_map_port (pcici_t tag, u_long reg, pci_port_t* pa); 205int pci_map_mem (pcici_t tag, u_long reg, vm_offset_t* va, vm_offset_t* pa); 206int pci_map_int (pcici_t tag, pci_inthand_t *func, void *arg, unsigned *maskptr); 207int pci_unmap_int (pcici_t tag); 208int pci_register_lkm (struct pci_device *dvp, int if_revision); 209 210#endif /* PCI_COMPAT */ | 175 176/* low level PCI config register functions provided by pcibus.c */ 177 178int pci_cfgopen (void); 179int pci_cfgread (pcicfgregs *cfg, int reg, int bytes); 180void pci_cfgwrite (pcicfgregs *cfg, int reg, int data, int bytes); 181 182/* for compatibility to FreeBSD-2.2 version of PCI code */ --- 35 unchanged lines hidden (view full) --- 218void pci_configure (void); 219int pci_map_port (pcici_t tag, u_long reg, pci_port_t* pa); 220int pci_map_mem (pcici_t tag, u_long reg, vm_offset_t* va, vm_offset_t* pa); 221int pci_map_int (pcici_t tag, pci_inthand_t *func, void *arg, unsigned *maskptr); 222int pci_unmap_int (pcici_t tag); 223int pci_register_lkm (struct pci_device *dvp, int if_revision); 224 225#endif /* PCI_COMPAT */ |
226#endif /* _PCIVAR_H_ */ |
|