| /pciutils/lmr/ |
| H A D | margin_hw.c | 75 *up_port = dev; in margin_find_pair() 117 .dev = dev, in fill_dev_wrapper() 149 u16 lnk_ctl = pci_read_word(dev->dev, pcie->addr + PCI_EXP_LNKCTL); in margin_prep_dev() 153 pci_write_word(dev->dev, pcie->addr + PCI_EXP_LNKCTL, lnk_ctl); in margin_prep_dev() 158 pci_write_word(dev->dev, pcie->addr + PCI_EXP_LNKCTL, lnk_ctl); in margin_prep_dev() 160 u16 lnk_ctl2 = pci_read_word(dev->dev, pcie->addr + PCI_EXP_LNKCTL2); in margin_prep_dev() 163 pci_write_word(dev->dev, pcie->addr + PCI_EXP_LNKCTL2, lnk_ctl2); in margin_prep_dev() 176 u16 lnk_ctl = pci_read_word(dev->dev, pcie->addr + PCI_EXP_LNKCTL); in margin_restore_dev() 179 pci_write_word(dev->dev, pcie->addr + PCI_EXP_LNKCTL, lnk_ctl); in margin_restore_dev() 181 u16 lnk_ctl2 = pci_read_word(dev->dev, pcie->addr + PCI_EXP_LNKCTL2); in margin_restore_dev() [all …]
|
| H A D | margin.c | 129 pci_write_word(dev->dev, LMR_LANE_CTRL(dev->lmr_cap_addr, lane), cmd); in margin_set_cmd() 131 return pci_read_word(dev->dev, LMR_LANE_STATUS(dev->lmr_cap_addr, lane)) == cmd; in margin_set_cmd() 137 pci_write_word(dev->dev, LMR_LANE_CTRL(dev->lmr_cap_addr, lane), cmd); in margin_report_cmd() 139 *result = pci_read_word(dev->dev, LMR_LANE_STATUS(dev->lmr_cap_addr, lane)); in margin_report_cmd() 148 switch (recv->dev->hw) in margin_apply_hw_quirks() 169 margin_set_cmd(dev, lane, NO_COMMAND); in read_params_internal() 264 pci_write_word(arg.recv->dev->dev, ctrl_addr, step_cmd); in margin_test_lanes() 274 lane_status = pci_read_word(arg.recv->dev->dev, status_addr); in margin_test_lanes() 314 struct margin_recv recv = { .dev = dev, in margin_test_receiver() 326 if (!margin_check_ready_bit(dev->dev)) in margin_test_receiver() [all …]
|
| H A D | margin_log.c | 33 margin_log("%x:%x:%x.%x -> %x:%x:%x.%x", down->domain, down->bus, down->dev, down->func, in margin_log_bdfs() 34 up->domain, up->bus, up->dev, up->func); in margin_log_bdfs() 36 margin_log("%x:%x.%x -> %x:%x.%x", down->bus, down->dev, down->func, up->bus, up->dev, in margin_log_bdfs() 44 snprintf(dest, maxlen, "%x:%x:%x.%x -> %x:%x:%x.%x", down->domain, down->bus, down->dev, in margin_gen_bdfs() 45 down->func, up->domain, up->bus, up->dev, up->func); in margin_gen_bdfs() 47 snprintf(dest, maxlen, "%x:%x.%x -> %x:%x.%x", down->bus, down->dev, down->func, up->bus, in margin_gen_bdfs() 48 up->dev, up->func); in margin_gen_bdfs() 55 margin_log_bdfs(link->down_port.dev, link->up_port.dev); in margin_log_link() 159 switch (recv->dev->hw) in margin_log_hw_quirks()
|
| H A D | lmr.h | 25 struct pci_dev *dev; member 153 struct margin_dev *dev; member 191 bool margin_port_is_down(struct pci_dev *dev); 194 bool margin_find_pair(struct pci_access *pacc, struct pci_dev *dev, struct pci_dev **down_port, 201 bool margin_check_ready_bit(struct pci_dev *dev); 216 bool margin_read_params(struct pci_access *pacc, struct pci_dev *dev, u8 recvn,
|
| /pciutils/ |
| H A D | example.c | 15 struct pci_dev *dev; in main() local 23 for (dev=pacc->devices; dev; dev=dev->next) /* Iterate over all devices */ in main() 25 …pci_fill_info(dev, PCI_FILL_IDENT | PCI_FILL_BASES | PCI_FILL_CLASS); /* Fill in header info we ne… in main() 26 c = pci_read_byte(dev, PCI_INTERRUPT_PIN); /* Read config register directly */ in main() 28 dev->domain, dev->bus, dev->dev, dev->func, dev->vendor_id, dev->device_id, in main() 29 dev->device_class, dev->irq, c, (long) dev->base_addr[0]); in main() 32 …name = pci_lookup_name(pacc, namebuf, sizeof(namebuf), PCI_LOOKUP_DEVICE, dev->vendor_id, dev->dev… in main()
|
| H A D | setpci.c | 76 devs[i++] = dev; in select_devices() 82 struct pci_dev **devs, *dev; in select_devices() local 86 for (dev = pacc->devices; dev; dev = dev->next) in select_devices() 87 if (pci_filter_match(f, dev)) in select_devices() 92 for (dev = pacc->devices; dev; dev = dev->next) in select_devices() 93 if (pci_filter_match(f, dev)) in select_devices() 94 devs[i++] = dev; in select_devices() 121 snprintf(slot, sizeof(slot), "%04x:%02x:%02x.%x", dev->domain, dev->bus, dev->dev, dev->func); in exec_op() 209 x = pci_read_byte(dev, addr); in exec_op() 232 struct pci_dev *dev; in execute() local [all …]
|
| H A D | ls-kernel.c | 75 pci_fill_info(d->dev, PCI_FILL_MODULE_ALIAS); in next_module() 76 if (!d->dev->module_alias) in next_module() 177 struct pci_dev *dev = d->dev; in match_pcimap() local 178 unsigned int class = (((unsigned int)dev->device_class << 8) | dev->prog_if); in match_pcimap() 182 MATCH(dev->vendor_id, e->vendor) && in match_pcimap() 183 MATCH(dev->device_id, e->device) && in match_pcimap() 185 MATCH(dev->subsys_id, e->subdevice) && in match_pcimap() 240 pci_fill_info(d->dev, PCI_FILL_DRIVER); in show_kernel() 259 pci_fill_info(d->dev, PCI_FILL_DRIVER); in show_kernel_machine() 277 pci_fill_info(d->dev, PCI_FILL_DRIVER); in show_kernel() [all …]
|
| H A D | ls-map.c | 19 byte this, dev, func, first, last, bug; member 34 struct pci_dev *p = d->dev; in map_bridge() 39 b->dev = p->dev; in map_bridge() 44 p->bus, p->dev, p->func, b->this, b->first, b->last); in map_bridge() 58 int dev, func; in do_map_bus() local 65 for (dev = 0; dev < 32; dev++) in do_map_bus() 66 if (filter.slot < 0 || filter.slot == dev) in do_map_bus() 72 struct pci_dev *p = pci_get_dev(pacc, domain, bus, dev, func); in do_map_bus() 79 printf("Discovered device %04x:%02x:%02x.%d\n", domain, bus, dev, func); in do_map_bus() 142 printf("Entered via %02x:%02x.%d\n", b->this, b->dev, b->func); in map_bridges() [all …]
|
| H A D | ls-tree.c | 38 if (d->dev == dd) in find_device() 64 struct pci_dev *p = d->dev; in insert_dev() 126 b->domain = d->dev->domain; in grow_tree() 144 struct pci_dev *dd = d->dev; in grow_tree() 186 b->domain = parent->dev->domain; in grow_tree() 187 b->primary = parent->dev->bus; in grow_tree() 188 b->secondary = d->dev->bus; in grow_tree() 199 parent->dev->bus, parent->dev->dev, parent->dev->func); in grow_tree() 292 struct pci_dev *q = d->dev; in show_tree_dev() 323 if (pci_filter_match(filter, d->dev)) in get_filter_for_child() [all …]
|
| H A D | update-pciids.sh | 17 if ! touch ${DEST} >/dev/null 2>&1 ; then 22 if command -v xz >/dev/null 2>&1 ; then 25 elif command -v bzip2 >/dev/null 2>&1 ; then 28 elif command -v gzip >/dev/null 2>&1 ; then 35 if command -v curl >/dev/null 2>&1 ; then 41 elif command -v wget >/dev/null 2>&1 ; then 47 elif command -v lynx >/dev/null 2>&1 ; then 68 if ! $GREP >/dev/null "^C " $DEST.new.plain ; then 76 chmod -f --reference=$DEST.old $DEST.new $DEST.new.plain 2>/dev/null || true
|
| H A D | pcilmr.c | 71 for (struct pci_dev *dev = pacc->devices; dev; dev = dev->next) in main() local 73 if (dev->domain != 0) in main() 143 pacc, link_args->recvs[j] == 6 ? links[i].up_port.dev : links[i].down_port.dev, in main() 201 margin_log_bdfs(links[i].down_port.dev, links[i].up_port.dev); in main()
|
| H A D | lspci.c | 110 pci_setup_cache(d->dev, d->config, d->dev->cache_len); in config_fetch() 129 d->dev = p; in scan_device() 220 if (a->dev < b->dev) in compare_them() 222 if (a->dev > b->dev) in compare_them() 261 struct pci_dev *p = d->dev; in show_slot_path() 284 struct pci_dev *p = d->dev; in show_slot_name() 295 struct pci_dev *p = d->dev; in show_terse() 400 struct pci_dev *p = d->dev; in show_bases() 497 struct pci_dev *p = d->dev; in show_rom() 548 struct pci_dev *p = d->dev; in show_htype1() [all …]
|
| H A D | README | 21 FreeBSD (via /dev/pci) 23 OpenBSD (via /dev/pci or i386 ports) 24 GNU/kFreeBSD (via /dev/pci) 26 Aix (via /dev/pci and odmget) 31 Haiku (via /dev/misc/poke)
|
| H A D | ls-caps-vendor.c | 235 switch (d->dev->vendor_id) in do_show_vendor_caps() 238 if (d->dev->device_id >= 0x1000 && in do_show_vendor_caps() 239 d->dev->device_id <= 0x107f) in do_show_vendor_caps()
|
| /pciutils/lib/ |
| H A D | dump.c | 37 dump_alloc_data(struct pci_dev *dev, int len) in dump_alloc_data() argument 43 dev->backend_data = dd; in dump_alloc_data() 64 struct pci_dev *dev = NULL; in dump_init() local 89 dev = pci_get_dev(a, mn, bn, dn, fn); in dump_init() 90 dump_alloc_data(dev, 256); in dump_init() 91 pci_link_dev(a, dev); in dump_init() 94 dev = NULL; in dump_init() 95 else if (dev && in dump_init() 113 dump_alloc_data(dev, 4096); in dump_init() 116 dd = dev->backend_data; in dump_init() [all …]
|
| H A D | generic.c | 18 int dev, multi, ht; in pci_generic_scan_bus() local 31 for (dev=0; dev<32; dev++) in pci_generic_scan_bus() 33 t->dev = dev; in pci_generic_scan_bus() 49 d->dev = t->dev; in pci_generic_scan_bus() 65 …Device %04x:%02x:%02x.%d has unknown header type %02x.\n", d->domain, d->bus, d->dev, d->func, ht); in pci_generic_scan_bus() 174 …04x:%02x:%02x.%d: Invalid 64-bit address seen for BAR %d.", d->domain, d->bus, d->dev, d->func, i); in pci_generic_fill_info() 182 …a->warning("%04x:%02x:%02x.%d 64-bit device address ignored.", d->domain, d->bus, d->dev, d->func); in pci_generic_fill_info()
|
| H A D | i386-ports.c | 86 for (d.dev = 0; d.dev < 32; d.dev++) in intel_sanity_check() 94 a->debug("...outside the Asylum at 0/%02x/0", d.dev); in intel_sanity_check() 147 …intel_outl(0x80000000 | ((d->bus & 0xff) << 16) | (PCI_DEVFN(d->dev, d->func) << 8) | (pos&~3), 0x… in conf1_read() 179 …intel_outl(0x80000000 | ((d->bus & 0xff) << 16) | (PCI_DEVFN(d->dev, d->func) << 8) | (pos&~3), 0x… in conf1_write() 228 int addr = 0xc000 | (d->dev << 8) | pos; in conf2_read() 233 if (d->dev >= 16) in conf2_read() 264 int addr = 0xc000 | (d->dev << 8) | pos; in conf2_write() 269 if (d->dev >= 16) in conf2_write()
|
| H A D | sysfs.c | 85 sysfs_name(d->access), d->domain, d->bus, d->dev, d->func, object); in sysfs_obj_name() 253 unsigned int dom, bus, dev, func; in sysfs_scan() local 260 if (sscanf(entry->d_name, "%x:%x:%x.%d", &dom, &bus, &dev, &func) < 4) in sysfs_scan() 269 d->dev = dev; in sysfs_scan() 295 unsigned int dom, bus, dev; in sysfs_fill_slots() local 315 if (!fgets(buf, sizeof(buf), file) || (res = sscanf(buf, "%x:%x:%x", &dom, &bus, &dev)) < 3) in sysfs_fill_slots() 328 if (dom == (unsigned)d->domain && bus == d->bus && dev == d->dev && !d->phy_slot) in sysfs_fill_slots() 389 unsigned int domain, bus, dev, func; in sysfs_fill_info() local 401 if (name && sscanf(name, "%x:%x:%x.%d", &domain, &bus, &dev, &func) == 4 && domain <= 0x7fffffff) in sysfs_fill_info() 403 …if (parent->domain == (int)domain && parent->bus == bus && parent->dev == dev && parent->func == f… in sysfs_fill_info()
|
| H A D | sylixos-device.c | 81 ret = pciConfigInByte(d->bus, d->dev, d->func, pos, &data_byte); in sylixos_read() 88 ret = pciConfigInWord(d->bus, d->dev, d->func, pos, &data_word); in sylixos_read() 95 ret = pciConfigInDword(d->bus, d->dev, d->func, pos, &data_dword); in sylixos_read() 123 ret = pciConfigOutByte(d->bus, d->dev, d->func, pos, data_byte); in sylixos_write() 130 ret = pciConfigOutWord(d->bus, d->dev, d->func, pos, data_word); in sylixos_write() 137 ret = pciConfigOutDword(d->bus, d->dev, d->func, pos, data_dword); in sylixos_write()
|
| H A D | hurd.c | 104 _SERVERS_BUS_PCI, d->domain, d->bus, d->dev, d->func, in device_port_lookup() 118 int dev, int func, tree_level lev) in enum_devices() argument 169 dev = ret; in enum_devices() 181 enum_devices(path, a, domain, bus, dev, func, lev + 1); in enum_devices() 193 d->dev = dev; in enum_devices()
|
| H A D | fbsd-device.c | 147 t->dev = matches[i].pc_sel.pc_dev; in fbsd_scan() 193 pattern.pc_sel.pc_dev = d->dev; in fbsd_fill_info() 220 bar.pbi_sel.pc_dev = d->dev; in fbsd_fill_info() 271 pi.pi_sel.pc_dev = d->dev; in fbsd_read() 323 pi.pi_sel.pc_dev = d->dev; in fbsd_write()
|
| H A D | win32-cfgmgr32.c | 1196 …NSTID_A devinst_id, unsigned int *domain, unsigned int *bus, unsigned int *dev, unsigned int *func) in get_device_location() argument 1228 *dev = drp_address >> 16; in get_device_location() 1267 sscanf(instance_id, "BUS_%x&DEV_%x&FUNC_%x", bus, dev, func) == 3) in get_device_location() 1275 *dev = devfn >> 3; in get_device_location() 1297 *bus = *dev = *func = 0; in get_device_location() 1307 *dev = *func = 0; in get_device_location() 1491 unsigned int domain, bus, dev, func; in scan_devinst_id() local 1506 if (!get_device_location(a, devinst, devinst_id, &domain, &bus, &dev, &func)) in scan_devinst_id() 1509 d = pci_get_dev(a, domain, bus, dev, func); in scan_devinst_id() 1680 d->backend_data = dcfg = pci_get_dev(acfg, d->domain, d->bus, d->dev, d->func); in win32_cfgmgr32_read() [all …]
|
| H A D | nbsd-libpci.c | 82 if (pcibus_conf_read(d->access->fd, d->bus, d->dev, d->func, pos, &val) < 0) in nbsd_read() 122 if (pcibus_conf_read(d->access->fd, d->bus, d->dev, d->func, pos, &val) < 0) in nbsd_write() 139 if (pcibus_conf_write(d->access->fd, d->bus, d->dev, d->func, pos, val) < 0) in nbsd_write()
|
| H A D | proc.c | 101 d->dev = PCI_SLOT(dfn & 0xff); in proc_scan() 147 d->bus, d->dev, d->func); in proc_setup() 156 d->domain, d->bus, d->dev, d->func); in proc_setup()
|
| H A D | access.c | 61 pci_get_dev(struct pci_access *a, int domain, int bus, int dev, int func) in pci_get_dev() argument 67 d->dev = dev; in pci_get_dev()
|