Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/pci/pcivar.h
Show First 20 Lines • Show All 253 Lines • ▼ Show 20 Lines | typedef struct { | ||||
uint32_t pccardif; /* PC Card 16bit IF legacy more base addr. */ | uint32_t pccardif; /* PC Card 16bit IF legacy more base addr. */ | ||||
uint16_t secstat; /* secondary bus status register */ | uint16_t secstat; /* secondary bus status register */ | ||||
uint16_t bridgectl; /* bridge control register */ | uint16_t bridgectl; /* bridge control register */ | ||||
uint8_t seclat; /* CardBus latency timer */ | uint8_t seclat; /* CardBus latency timer */ | ||||
} pcih2cfgregs; | } pcih2cfgregs; | ||||
extern uint32_t pci_numdevs; | extern uint32_t pci_numdevs; | ||||
struct pci_device_table { | |||||
#if BYTE_ORDER == LITTLE_ENDIAN | |||||
uint16_t | |||||
match_flag_vendor:1, | |||||
match_flag_device:1, | |||||
match_flag_subvendor:1, | |||||
match_flag_subdevice:1, | |||||
match_flag_class:1, | |||||
match_flag_subclass:1, | |||||
match_flag_revid:1, | |||||
match_flag_unused:9; | |||||
#else | |||||
uint16_t | |||||
match_flag_unused:9, | |||||
match_flag_revid:1, | |||||
match_flag_subclass:1, | |||||
match_flag_class:1, | |||||
match_flag_subdevice:1, | |||||
match_flag_subvendor:1, | |||||
match_flag_device:1, | |||||
match_flag_vendor:1; | |||||
#endif | |||||
uint16_t vendor; | |||||
uint16_t device; | |||||
uint16_t subvendor; | |||||
uint16_t subdevice; | |||||
uint16_t class_id; | |||||
uint16_t subclass; | |||||
uint16_t revid; | |||||
uint16_t unused; | |||||
uintptr_t driver_data; | |||||
char *descr; | |||||
}; | |||||
#define PCI_DEV(v, d) \ | |||||
.match_flag_vendor = 1, .vendor = (v), \ | |||||
.match_flag_device = 1, .device = (d) | |||||
#define PCI_SUBDEV(sv, sd) \ | |||||
.match_flag_subvendor = 1, .subvendor = (sv), \ | |||||
.match_flag_subdevice = 1, .subdevice = (sd) | |||||
#define PCI_CLASS(x) \ | |||||
.match_flag_class = 1, .class_id = (x) | |||||
#define PCI_SUBCLASS(x) \ | |||||
.match_flag_subclass = 1, .subclass = (x) | |||||
#define PCI_REVID(x) \ | |||||
.match_flag_revid = 1, .revid = (x) | |||||
#define PCI_DESCR(x) \ | |||||
.descr = (x) | |||||
#define PCI_PNP_STR \ | |||||
"M16:mask;U16:vendor;U16:device;U16:subvendor;U16:subdevice;" \ | |||||
"U16:class;U16:subclass;U16:revid;" | |||||
#define PCI_PNP_INFO(table) \ | |||||
MODULE_PNP_INFO(PCI_PNP_STR, pci, table, table, sizeof(table[0]), \ | |||||
sizeof(table) / sizeof(table[0])) | |||||
const struct pci_device_table *pci_match_device(device_t child, | |||||
const struct pci_device_table *id, size_t nelt); | |||||
#define PCI_MATCH(child, table) \ | |||||
pci_match_device(child, (table), nitems(table)); | |||||
/* Only if the prerequisites are present */ | /* Only if the prerequisites are present */ | ||||
#if defined(_SYS_BUS_H_) && defined(_SYS_PCIIO_H_) | #if defined(_SYS_BUS_H_) && defined(_SYS_PCIIO_H_) | ||||
struct pci_devinfo { | struct pci_devinfo { | ||||
STAILQ_ENTRY(pci_devinfo) pci_links; | STAILQ_ENTRY(pci_devinfo) pci_links; | ||||
struct resource_list resources; | struct resource_list resources; | ||||
pcicfgregs cfg; | pcicfgregs cfg; | ||||
struct pci_conf conf; | struct pci_conf conf; | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 141 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
/* | /* | ||||
* Check if the address range falls within the VGA defined address range(s) | * Check if the address range falls within the VGA defined address range(s) | ||||
*/ | */ | ||||
static __inline int | static __inline int | ||||
pci_is_vga_ioport_range(rman_res_t start, rman_res_t end) | pci_is_vga_ioport_range(rman_res_t start, rman_res_t end) | ||||
{ | { | ||||
return (((start >= 0x3b0 && end <= 0x3bb) || | return (((start >= 0x3b0 && end <= 0x3bb) || | ||||
(start >= 0x3c0 && end <= 0x3df)) ? 1 : 0); | (start >= 0x3c0 && end <= 0x3df)) ? 1 : 0); | ||||
} | } | ||||
static __inline int | static __inline int | ||||
pci_is_vga_memory_range(rman_res_t start, rman_res_t end) | pci_is_vga_memory_range(rman_res_t start, rman_res_t end) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 241 Lines • Show Last 20 Lines |