Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/pci/pci_iov.c
Context not available. | |||||
struct resource *res; | struct resource *res; | ||||
struct pcicfg_iov *iov; | struct pcicfg_iov *iov; | ||||
device_t dev, bus; | device_t dev, bus; | ||||
u_long start, end; | rman_res_t start, end; | ||||
pci_addr_t bar_size; | pci_addr_t bar_size; | ||||
int rid; | int rid; | ||||
Context not available. | |||||
rid = iov->iov_pos + PCIR_SRIOV_BAR(bar); | rid = iov->iov_pos + PCIR_SRIOV_BAR(bar); | ||||
bar_size = 1 << bar_shift; | bar_size = 1 << bar_shift; | ||||
res = pci_alloc_multi_resource(bus, dev, SYS_RES_MEMORY, &rid, 0ul, | res = pci_alloc_multi_resource(bus, dev, SYS_RES_MEMORY, &rid, 0, | ||||
~0ul, 1, iov->iov_num_vfs, RF_ACTIVE); | ~0, 1, iov->iov_num_vfs, RF_ACTIVE); | ||||
if (res == NULL) | if (res == NULL) | ||||
return (ENXIO); | return (ENXIO); | ||||
Context not available. | |||||
int error; | int error; | ||||
iov->rman.rm_start = 0; | iov->rman.rm_start = 0; | ||||
iov->rman.rm_end = ~0ul; | iov->rman.rm_end = ~0; | ||||
iov->rman.rm_type = RMAN_ARRAY; | iov->rman.rm_type = RMAN_ARRAY; | ||||
snprintf(iov->rman_name, sizeof(iov->rman_name), "%s VF I/O memory", | snprintf(iov->rman_name, sizeof(iov->rman_name), "%s VF I/O memory", | ||||
device_get_nameunit(pf)); | device_get_nameunit(pf)); | ||||
Context not available. | |||||
} | } | ||||
struct resource * | struct resource * | ||||
pci_vf_alloc_mem_resource(device_t dev, device_t child, int *rid, u_long start, | pci_vf_alloc_mem_resource(device_t dev, device_t child, int *rid, | ||||
u_long end, u_long count, u_int flags) | rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) | ||||
{ | { | ||||
struct pci_devinfo *dinfo; | struct pci_devinfo *dinfo; | ||||
struct pcicfg_iov *iov; | struct pcicfg_iov *iov; | ||||
Context not available. | |||||
struct pci_map *map; | struct pci_map *map; | ||||
struct resource *res; | struct resource *res; | ||||
struct resource_list_entry *rle; | struct resource_list_entry *rle; | ||||
u_long bar_start, bar_end; | rman_res_t bar_start, bar_end; | ||||
pci_addr_t bar_length; | pci_addr_t bar_length; | ||||
int error; | int error; | ||||
Context not available. |