Lines Matching refs:fd

125 get_dev(int fd, struct fw_devlstreq *data)
129 if( ioctl(fd, FW_GDEVLST, data) < 0) {
135 str2node(int fd, const char *nodestr)
165 get_dev(fd,data);
189 list_dev(int fd)
200 get_dev(fd, data);
217 read_write_quad(int fd, struct fw_eui64 eui, u_int32_t addr_lo, int readmode, u_int32_t data)
246 if (ioctl(fd, FW_ASYREQ, asyreq) < 0) {
273 send_phy_config(int fd, int root_node, int gap_count)
294 if (ioctl(fd, FW_ASYREQ, asyreq) < 0)
300 link_on(int fd, int node)
313 if (ioctl(fd, FW_ASYREQ, asyreq) < 0)
319 reset_start(int fd, int node)
337 if (ioctl(fd, FW_ASYREQ, asyreq) < 0)
343 set_pri_req(int fd, u_int32_t pri_req)
355 get_dev(fd, data);
361 reg = read_write_quad(fd, devinfo->eui, BUGET_REG, 1, 0);
372 read_write_quad(fd, devinfo->eui, BUGET_REG, 0, pri_req);
403 get_crom(int fd, int node, void *crom_buf, int len)
412 get_dev(fd, data);
427 if ((error = ioctl(fd, FW_GCROM, &buf)) < 0) {
527 show_topology_map(int fd)
539 if (ioctl(fd, FW_GTPMAP, tmap) < 0) {
572 read_phy_registers(int fd, u_int8_t *buf, int offset, int len)
579 if (ioctl(fd, FWOHCI_RDPHYREG, &reg) < 0)
588 read_phy_page(int fd, u_int8_t *buf, int page, int port)
594 if (ioctl(fd, FWOHCI_WRPHYREG, &reg) < 0)
596 read_phy_registers(fd, buf, 8, 8);
600 dump_phy_registers(int fd)
608 read_phy_registers(fd, (u_int8_t *)&b, 0, 8);
630 read_phy_page(fd, (u_int8_t *)&p, 0, i);
647 read_phy_page(fd, (u_int8_t *)&v, 1, 0);
659 open_dev(int *fd, char *devname)
661 if (*fd < 0) {
662 *fd = open(devname, O_RDWR);
663 if (*fd < 0)
680 detect_recv_fn(int fd, char ich)
699 if (ioctl(fd, FW_SSTBUF, &bufreq) < 0)
705 if (ioctl(fd, FW_SRSTREAM, &isoreq) < 0)
720 len = read(fd, buf, RECV_NUM_PACKET * RECV_PACKET_SZ);
754 int fd = -1, ch, len=1024;
795 if (open_dev(&fd, devbase) < 0) {
803 list_dev(fd);
804 close(fd);
805 fd = -1;
884 send_link_on = str2node(fd, optarg);
904 send_reset_start = str2node(fd, optarg);
986 if (open_dev(&fd, devbase) < 0) {
995 list_dev(fd);
1001 dump_phy_registers(fd);
1007 if(ioctl(fd, FW_IBUSRST, &tmp) < 0)
1014 tmp = str2node(fd, crom_string);
1015 get_crom(fd, tmp, crom_buf, len);
1023 tmp = str2node(fd, crom_string_hex);
1024 get_crom(fd, tmp, crom_buf_hex, len);
1032 set_pri_req(fd, priority_budget);
1038 send_phy_config(fd, set_root_node, -1);
1044 send_phy_config(fd, -1, set_gap_count);
1073 link_on(fd, send_link_on);
1079 reset_start(fd, send_reset_start);
1085 show_topology_map(fd);
1094 recvfn = detect_recv_fn(fd, TAG | CHANNEL);
1095 close(fd);
1096 fd = -1;
1099 if (open_dev(&fd, devbase) < 0)
1101 (*recvfn)(fd, recv_data, TAG | CHANNEL, -1);
1109 dvsend(fd, send_data, TAG | CHANNEL, -1);
1113 if (fd > 0) {
1114 close(fd);
1115 fd = -1;