| /pciutils/lib/ |
| H A D | proc.c | 63 char buf[512]; in proc_scan() local 65 if (snprintf(buf, sizeof(buf), "%s/devices", pci_get_param(a, "proc.path")) == sizeof(buf)) in proc_scan() 67 f = fopen(buf, "r"); in proc_scan() 70 while (fgets(buf, sizeof(buf)-1, f)) in proc_scan() 116 while (buf[offset] && isspace(buf[offset])) in proc_scan() 118 driver = &buf[offset]; in proc_scan() 119 while (buf[offset] && !isspace(buf[offset])) in proc_scan() 121 buf[offset] = '\0'; in proc_scan() 141 char buf[1024]; in proc_setup() local 145 e = snprintf(buf, sizeof(buf), "%s/%02x/%02x.%d", in proc_setup() [all …]
|
| H A D | dump.c | 63 char buf[256]; in dump_init() local 71 while (fgets(buf, sizeof(buf)-1, f)) in dump_init() 80 if (z >= buf && *z == '\r') in dump_init() 82 len = z - buf + 1; in dump_init() 84 if (dump_validate(buf, "##:##.# ") && sscanf(buf, "%x:%x.%d", &bn, &dn, &fn) == 3 || in dump_init() 85 dump_validate(buf, "####:##:##.# ") && sscanf(buf, "%x:%x:%x.%d", &mn, &bn, &dn, &fn) == 4 || in dump_init() 87 dump_validate(buf, "######:##:##.# ") && sscanf(buf, "%x:%x:%x.%d", &mn, &bn, &dn, &fn) == 4) in dump_init() 96 … (dump_validate(buf, "##: ") || dump_validate(buf, "###: ") || dump_validate(buf, "####: ") || in dump_init() 97 dump_validate(buf, "#####: ") || dump_validate(buf, "######: ") || in dump_init() 98 dump_validate(buf, "#######: ") || dump_validate(buf, "########: ")) && in dump_init() [all …]
|
| H A D | names.c | 78 res = snprintf(buf, size, "%s", num); in format_name() 82 res = snprintf(buf, size, "%s", name); in format_name() 84 res = snprintf(buf, size, "%s [%s]", name, num); in format_name() 86 buf[size-2] = buf[size-3] = buf[size-4] = '.'; in format_name() 89 return buf; in format_name() 99 res = snprintf(buf, size, "%s", num); in format_name_pair() 105 res = snprintf(buf, size, "Device [%s]", num); in format_name_pair() 112 res = snprintf(buf, size, "%s %s", v, d); in format_name_pair() 114 res = snprintf(buf, size, "Device %s", num); in format_name_pair() 119 buf[size-2] = buf[size-3] = buf[size-4] = '.'; in format_name_pair() [all …]
|
| H A D | rt-thread-smart-dm.c | 63 char buf[512]; in rt_thread_smart_dm_scan() local 65 …if (snprintf(buf, sizeof(buf), "%s/devices", pci_get_param(a, "rt-thread-smart-dm.path")) == sizeo… in rt_thread_smart_dm_scan() 68 f = fopen(buf, "r"); in rt_thread_smart_dm_scan() 72 while (fgets(buf, sizeof(buf)-1, f)) in rt_thread_smart_dm_scan() 118 while (buf[offset] && isspace(buf[offset])) in rt_thread_smart_dm_scan() 120 driver = &buf[offset]; in rt_thread_smart_dm_scan() 121 while (buf[offset] && !isspace(buf[offset])) in rt_thread_smart_dm_scan() 123 buf[offset] = '\0'; in rt_thread_smart_dm_scan() 144 char buf[1024]; in rt_thread_smart_dm_setup() local 148 e = snprintf(buf, sizeof(buf), "%s/%04x:%02x:%02x.%u", in rt_thread_smart_dm_setup() [all …]
|
| H A D | access.c | 102 memset(buf, 0xff, len); in pci_read_data() 108 byte buf; in pci_read_byte() local 109 pci_read_data(d, &buf, pos, 1); in pci_read_byte() 110 return buf; in pci_read_byte() 116 word buf; in pci_read_word() local 117 pci_read_data(d, &buf, pos, 2); in pci_read_word() 118 return le16_to_cpu(buf); in pci_read_word() 124 u32 buf; in pci_read_long() local 126 return le32_to_cpu(buf); in pci_read_long() 160 word buf = cpu_to_le16(data); in pci_write_word() local [all …]
|
| H A D | sysfs.c | 108 n = read(fd, buf, OBJBUFSIZE); in sysfs_get_string() 121 buf[n] = 0; in sysfs_get_string() 146 char buf[OBJBUFSIZE]; in sysfs_get_value() local 149 return strtol(buf, NULL, 0); in sysfs_get_value() 172 if (!fgets(buf, sizeof(buf), file)) in sysfs_get_resources() 315 if (!fgets(buf, sizeof(buf), file) || (res = sscanf(buf, "%x:%x:%x", &dom, &bus, &dev)) < 3) in sysfs_fill_slots() 438 char buf[OBJBUFSIZE]; in sysfs_fill_info() local 445 char buf[OBJBUFSIZE]; in sysfs_fill_info() local 489 char buf[OBJBUFSIZE]; in sysfs_fill_info() local 550 res = pread(fd, buf, len, pos); in sysfs_read() [all …]
|
| H A D | i386-ports.c | 144 return pci_generic_block_read(d, pos, buf, len); in conf1_read() 152 buf[0] = intel_inb(addr); in conf1_read() 155 ((u16 *) buf)[0] = cpu_to_le16(intel_inw(addr)); in conf1_read() 158 ((u32 *) buf)[0] = cpu_to_le32(intel_inl(addr)); in conf1_read() 176 return pci_generic_block_write(d, pos, buf, len); in conf1_write() 184 intel_outb(buf[0], addr); in conf1_write() 238 return pci_generic_block_read(d, pos, buf, len); in conf2_read() 246 buf[0] = intel_inb(addr); in conf2_read() 282 intel_outb(buf[0], addr); in conf2_write() 285 intel_outw(le16_to_cpu(* (u16 *) buf), addr); in conf2_write() [all …]
|
| H A D | hurd.c | 224 return pci_generic_block_read(d, pos, buf, len); in hurd_read() 226 data = (char *) buf; in hurd_read() 229 if (data != (char *) buf) in hurd_read() 237 memcpy(buf, data, nread); in hurd_read() 257 return pci_generic_block_write(d, pos, buf, len); in hurd_write() 271 char *buf = (char *) ®ions; in hurd_fill_regions() local 278 if ((char *) ®ions != buf) in hurd_fill_regions() 287 memcpy(®ions, buf, size); in hurd_fill_regions() 312 char *buf = (char *) &rom; in hurd_fill_rom() local 319 if ((char *) &rom != buf) in hurd_fill_rom() [all …]
|
| H A D | aix-device.c | 90 char buf[256]; in aix_bus_number() local 102 if (fgets(buf, sizeof (buf) - 1, odmget_pipe) != NULL) in aix_bus_number() 104 bp = buf + 1; /* skip leading double quote */ in aix_bus_number() 133 char buf[256]; in aix_detect() local 142 while (fgets(buf, sizeof (buf) - 1, lsdev_pipe) != NULL) in aix_detect() 144 len = strlen(buf); in aix_detect() 145 while (buf[len-1] == '\n' || buf[len-1] == '\r') in aix_detect() 147 buf[len] = '\0'; /* clobber the newline */ in aix_detect() 150 strcpy(name, buf); in aix_detect() 229 mdio.md_data = (char *) buf; in aix_read() [all …]
|
| H A D | generic.c | 217 pci_generic_block_op(struct pci_dev *d, int pos, byte *buf, int len, in pci_generic_block_op() argument 218 int (*r)(struct pci_dev *d, int pos, byte *buf, int len)) in pci_generic_block_op() 222 if (!r(d, pos, buf, 1)) in pci_generic_block_op() 224 pos++; buf++; len--; in pci_generic_block_op() 228 if (!r(d, pos, buf, 2)) in pci_generic_block_op() 230 pos += 2; buf += 2; len -= 2; in pci_generic_block_op() 234 if (!r(d, pos, buf, 4)) in pci_generic_block_op() 236 pos += 4; buf += 4; len -= 4; in pci_generic_block_op() 240 if (!r(d, pos, buf, 2)) in pci_generic_block_op() 242 pos += 2; buf += 2; len -= 2; in pci_generic_block_op() [all …]
|
| H A D | ecam.c | 196 rsdp = (struct acpi_rsdp *)buf; in check_and_parse_rsdp() 199 physmem_unmap(physmem, map, sizeof(buf)); in check_and_parse_rsdp() 223 char buf[1024]; in find_rsdp_address() local 247 while (fgets(buf, sizeof(buf), f)) in find_rsdp_address() 249 len = strlen(buf); in find_rsdp_address() 251 buf[--len] = '\0'; in find_rsdp_address() 252 if (strncmp(buf, "ACPI20=", 7) == 0 && isxdigit(buf[7])) in find_rsdp_address() 259 else if (strncmp(buf, "ACPI=", 5) == 0 && isxdigit(buf[5])) in find_rsdp_address() 283 if (kenv(KENV_GET, "hint.acpi.0.rsdp", buf, sizeof(buf)) > 0) in find_rsdp_address() 1152 buf[0] = physmem_readb(reg); [all …]
|
| H A D | nbsd-libpci.c | 68 nbsd_read(struct pci_dev *d, int pos, byte *buf, int len) in nbsd_read() argument 74 return pci_generic_block_read(d, pos, buf, len); in nbsd_read() 88 *buf = val >> shift; in nbsd_read() 91 *(u16*)buf = cpu_to_le16(val >> shift); in nbsd_read() 94 *(u32*)buf = cpu_to_le32(val); in nbsd_read() 101 nbsd_write(struct pci_dev *d, int pos, byte *buf, int len) in nbsd_write() argument 107 return pci_generic_block_write(d, pos, buf, len); in nbsd_write() 129 val = (val & ~(0xff << shift)) | (buf[0] << shift); in nbsd_write() 132 val = (val & ~(0xffff << shift)) | (le16_to_cpu(*(u16*)buf) << shift); in nbsd_write() 135 val = le32_to_cpu(*(u32*)buf); in nbsd_write()
|
| H A D | sylixos-device.c | 65 sylixos_read(struct pci_dev *d, int pos, byte *buf, int len) in sylixos_read() argument 73 return pci_generic_block_read(d, pos, buf, len); in sylixos_read() 84 buf[0] = (u8)data_byte; in sylixos_read() 91 ((u16 *) buf)[0] = cpu_to_le16(data_word); in sylixos_read() 98 ((u32 *) buf)[0] = cpu_to_le32(data_dword); in sylixos_read() 106 sylixos_write(struct pci_dev *d, int pos, byte *buf, int len) in sylixos_write() argument 114 return pci_generic_block_write(d, pos, buf, len); in sylixos_write() 122 data_byte = buf[0]; in sylixos_write() 129 data_word = le16_to_cpu(((u16 *) buf)[0]); in sylixos_write() 136 data_dword = le32_to_cpu(((u32 *) buf)[0]); in sylixos_write()
|
| H A D | obsd-device.c | 58 obsd_read(struct pci_dev *d, int pos, byte *buf, int len) in obsd_read() argument 68 return pci_generic_block_read(d, pos, buf, len); in obsd_read() 91 buf[0] = (u8) u.u8[pos % 4]; in obsd_read() 94 ((u16 *) buf)[0] = letoh16(u.u16[(pos % 4) / 2]); in obsd_read() 97 ((u32 *) buf)[0] = (u32) letoh32(pi.pi_data); in obsd_read() 104 obsd_write(struct pci_dev *d, int pos, byte *buf, int len) in obsd_write() argument 109 return pci_generic_block_write(d, pos, buf, len); in obsd_write() 124 pi.pi_data = buf[0]; in obsd_write() 127 pi.pi_data = ((u16 *) buf)[0]; in obsd_write() 130 pi.pi_data = ((u32 *) buf)[0]; in obsd_write()
|
| H A D | mmio-ports.c | 307 return pci_generic_block_read(d, pos, buf, len); in conf1_ext_read() 321 buf[0] = physmem_readb(data); in conf1_ext_read() 324 ((u16 *) buf)[0] = physmem_readw(data); in conf1_ext_read() 327 ((u32 *) buf)[0] = physmem_readl(data); in conf1_ext_read() 335 conf1_read(struct pci_dev *d, int pos, byte *buf, int len) in conf1_read() argument 340 return conf1_ext_read(d, pos, buf, len); in conf1_read() 355 return pci_generic_block_write(d, pos, buf, len); in conf1_ext_write() 369 physmem_writeb(buf[0], data); in conf1_ext_write() 372 physmem_writew(((u16 *) buf)[0], data); in conf1_ext_write() 375 physmem_writel(((u32 *) buf)[0], data); in conf1_ext_write() [all …]
|
| H A D | darwin.c | 112 darwin_read(struct pci_dev *d, int pos, byte *buf, int len) in darwin_read() argument 115 return pci_generic_block_read(d, pos, buf, len); in darwin_read() 143 buf[0] = (u8) param.value; in darwin_read() 146 ((u16 *) buf)[0] = cpu_to_le16((u16) param.value); in darwin_read() 149 ((u32 *) buf)[0] = cpu_to_le32((u32) param.value); in darwin_read() 156 darwin_write(struct pci_dev *d, int pos, byte *buf, int len) in darwin_write() argument 159 return pci_generic_block_write(d, pos, buf, len); in darwin_write() 179 param.value = buf[0]; in darwin_write() 182 param.value = le16_to_cpu(((u16 *) buf)[0]); in darwin_write() 185 param.value = le32_to_cpu(((u32 *) buf)[0]); in darwin_write()
|
| H A D | fbsd-device.c | 248 fbsd_read(struct pci_dev *d, int pos, byte *buf, int len) in fbsd_read() argument 259 return pci_generic_block_read(d, pos, buf, len); in fbsd_read() 287 buf[0] = (u8) pi.pi_data; in fbsd_read() 290 ((u16 *) buf)[0] = cpu_to_le16((u16) pi.pi_data); in fbsd_read() 293 ((u32 *) buf)[0] = cpu_to_le32((u32) pi.pi_data); in fbsd_read() 300 fbsd_write(struct pci_dev *d, int pos, byte *buf, int len) in fbsd_write() argument 311 return pci_generic_block_write(d, pos, buf, len); in fbsd_write() 332 pi.pi_data = buf[0]; in fbsd_write() 335 pi.pi_data = le16_to_cpu(((u16 *) buf)[0]); in fbsd_write() 338 pi.pi_data = le32_to_cpu(((u32 *) buf)[0]); in fbsd_write()
|
| H A D | internal.h | 68 int (*read)(struct pci_dev *, int pos, byte *buf, int len); 69 int (*write)(struct pci_dev *, int pos, byte *buf, int len); 70 int (*read_vpd)(struct pci_dev *, int pos, byte *buf, int len); 80 int pci_generic_block_read(struct pci_dev *, int pos, byte *buf, int len); 81 int pci_generic_block_write(struct pci_dev *, int pos, byte *buf, int len); 84 int pci_emulated_read(struct pci_dev *d, int pos, byte *buf, int len);
|
| H A D | aos-expansion.c | 171 aos_expansion_read(struct pci_dev *d, int pos, byte *buf, int len) in aos_expansion_read() argument 174 byte *ptr = buf; in aos_expansion_read() 188 aos_expansion_write(struct pci_dev *d, int pos, byte *buf, int len) in aos_expansion_write() argument 191 byte *ptr = buf; in aos_expansion_write()
|
| H A D | win32-sysdbg.c | 246 win32_sysdbg_read(struct pci_dev *d, int pos, byte *buf, int len) in win32_sysdbg_read() argument 254 status = win32_sysdbg_pci_bus_data(FALSE, d->bus, d->dev, d->func, pos, buf, len, &ret_len); in win32_sysdbg_read() 262 win32_sysdbg_write(struct pci_dev *d, int pos, byte *buf, int len) in win32_sysdbg_write() argument 270 status = win32_sysdbg_pci_bus_data(TRUE, d->bus, d->dev, d->func, pos, buf, len, &ret_len); in win32_sysdbg_write()
|
| H A D | pci.h | 190 int pci_read_vpd(struct pci_dev *d, int pos, u8 *buf, int len) PCI_ABI; 196 int pci_read_block(struct pci_dev *, int pos, u8 *buf, int len) PCI_ABI; 197 int pci_write_block(struct pci_dev *, int pos, u8 *buf, int len) PCI_ABI; 298 char *pci_lookup_name(struct pci_access *a, char *buf, int size, int flags, ...) PCI_ABI;
|
| H A D | filter.c | 128 char buf[BUF_SIZE]; in pci_filter_parse_slot_v38() local 132 if (err = split_to_fields(str, buf, ':', fields, 3)) in pci_filter_parse_slot_v38() 172 char buf[BUF_SIZE]; in pci_filter_parse_id_v38() local 176 if (err = split_to_fields(str, buf, ':', fields, 4)) in pci_filter_parse_id_v38()
|
| /pciutils/ |
| H A D | ls-vpd.c | 62 byte ch = *buf++; in print_vpd_string() 82 printf("%02x", buf[i]); in print_vpd_binary() 92 *csum += *buf++; in read_vpd() 100 byte buf[256]; in cap_vpd() local 118 res_len = buf[0] + (buf[1] << 8); in cap_vpd() 143 if (part_len > sizeof(buf)) in cap_vpd() 144 part_len = sizeof(buf); in cap_vpd() 167 memcpy(id, buf, 2); in cap_vpd() 170 part_len = buf[2]; in cap_vpd() 192 print_vpd_string(buf, part_len); in cap_vpd() [all …]
|
| H A D | ls-ecaps.c | 521 char buf[8]; in cap_vc() local 606 char buf[8]; in cap_rclink() local 773 char buf[48]; in cap_phy_32gt() local 1627 sprintf(buf, "[%x]", off); in offstr() 1628 return buf; in offstr() 1636 snprintf(buf, len, "%s", algo[l]); in ide_alg() 1639 return buf; in ide_alg() 1852 return buf; in link_width_str() 1861 char buf[16]; in cap_dev3() local 1899 link_width_str(buf, sizeof(buf), PCI_DEV3_DEVCTL3_TARGET_LINK_WIDTH(devctl3)), in cap_dev3() [all …]
|
| H A D | bitops.h | 36 #define TABLE(tab, x, buf) \ argument 37 …) < sizeof(tab) / sizeof((tab)[0]) ? (tab)[x] : (snprintf((buf), sizeof(buf), "??%d", (x)), (buf)))
|