Lines Matching refs:fd
195 static uint32_t read_long(int fd, int bus, int dev, int func,
197 static uint8_t read_byte(int fd, int bus, int dev, int func, int offset,
199 static uint16_t read_word(int fd, int bus, int dev, int func, int offset,
2293 int path_size, fd;
2305 fd = open(path, O_RDWR);
2307 return (fd);
2311 read_long(int fd, int bus, int dev, int func, int offset, int *ret)
2324 rval = ioctl(fd, PCITOOL_DEVICE_GET_REG, &prg);
2334 read_word(int fd, int bus, int dev, int func, int offset, int *ret)
2347 rval = ioctl(fd, PCITOOL_DEVICE_GET_REG, &prg);
2357 read_byte(int fd, int bus, int dev, int func, int offset, int *ret)
2370 rval = ioctl(fd, PCITOOL_DEVICE_GET_REG, &prg);
2386 int fd, ret;
2391 fd = open_root_complex(device_path);
2392 if (fd == -1) {
2413 cap_ptr = read_byte(fd, bus, dev, func, PCI_CONF_CAP_PTR, &ret);
2416 (void) close(fd);
2419 cap_reg = read_word(fd, bus, dev, func, cap_ptr, &ret);
2422 (void) close(fd);
2429 link_status = read_word(fd, bus, dev, func,
2432 (void) close(fd);
2454 (fd, bus, dev, func, PCI_CONF_HEADER, &ret);
2457 (void) close(fd);
2464 sec_status = read_word(fd, bus, dev, func,
2468 (void) close(fd);
2492 pcix_status = read_long(fd, bus, dev, func,
2496 (void) close(fd);
2512 cap_reg = read_word(fd, bus, dev, func, cap_ptr, &ret);
2515 (void) close(fd);
2521 if (close(fd) == -1) {