Lines Matching defs:fd
75 static uint32_t read_long(int fd, int bus, int dev, int func,
77 static uint8_t read_byte(int fd, int bus, int dev, int func, int offset,
79 static uint16_t read_word(int fd, int bus, int dev, int func, int offset,
555 int fd;
565 if ((fd = open(path, O_RDWR)) == -1) {
568 return (fd);
572 read_long(int fd, int bus, int dev, int func, int offset, int *ret)
585 rval = ioctl(fd, PCITOOL_DEVICE_GET_REG, &prg);
595 read_word(int fd, int bus, int dev, int func, int offset, int *ret)
608 rval = ioctl(fd, PCITOOL_DEVICE_GET_REG, &prg);
618 read_byte(int fd, int bus, int dev, int func, int offset, int *ret)
631 rval = ioctl(fd, PCITOOL_DEVICE_GET_REG, &prg);
647 int fd, ret;
652 fd = open_root_complex(device_path);
653 if (fd == -1)
673 cap_ptr = read_byte(fd, bus, dev, func, PCI_CONF_CAP_PTR, &ret);
676 close(fd);
679 cap_reg = read_word(fd, bus, dev, func, cap_ptr, &ret);
682 close(fd);
690 link_cap = read_long(fd, bus, dev, func, cap_ptr +
693 close(fd);
696 link_status = read_word(fd, bus, dev, func,
699 close(fd);
713 (fd, bus, dev, func, PCI_CONF_HEADER, &ret);
716 close(fd);
723 sec_status = read_word(fd, bus, dev, func,
727 close(fd);
751 pcix_status = read_long(fd, bus, dev, func,
755 close(fd);
771 cap_reg = read_word(fd, bus, dev, func, cap_ptr, &ret);
774 close(fd);
780 if (close(fd) == -1) {