Changeset View
Changeset View
Standalone View
Standalone View
head/sys/compat/linuxkpi/common/include/linux/pci.h
Show First 20 Lines • Show All 227 Lines • ▼ Show 20 Lines | pci_resource_len(struct pci_dev *pdev, int bar) | ||||
if ((rle = _pci_get_bar(pdev, bar)) == NULL) | if ((rle = _pci_get_bar(pdev, bar)) == NULL) | ||||
return (0); | return (0); | ||||
return rle->count; | return rle->count; | ||||
} | } | ||||
static inline int | static inline int | ||||
pci_resource_type(struct pci_dev *pdev, int bar) | pci_resource_type(struct pci_dev *pdev, int bar) | ||||
{ | { | ||||
struct resource_list_entry *rle; | struct pci_map *pm; | ||||
if ((rle = _pci_get_bar(pdev, bar)) == NULL) | pm = pci_find_bar(pdev->dev.bsddev, PCIR_BAR(bar)); | ||||
if (!pm) | |||||
return (-1); | return (-1); | ||||
return (rle->type); | |||||
if (PCI_BAR_IO(pm->pm_value)) | |||||
return (SYS_RES_IOPORT); | |||||
else | |||||
return (SYS_RES_MEMORY); | |||||
} | } | ||||
/* | /* | ||||
* All drivers just seem to want to inspect the type not flags. | * All drivers just seem to want to inspect the type not flags. | ||||
*/ | */ | ||||
static inline int | static inline int | ||||
pci_resource_flags(struct pci_dev *pdev, int bar) | pci_resource_flags(struct pci_dev *pdev, int bar) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 494 Lines • Show Last 20 Lines |