Lines Matching +full:hw +full:- +full:blink

1 /*-
2 * SPDX-License-Identifier: BSD-4-Clause
83 "%s [-u bus_num] [-prt] [-c node] [-d node] [-o node] [-s node]\n" in usage()
84 "\t [-l file] [-g gap_count] [-f force_root ] [-b pri_req]\n" in usage()
85 "\t [-M mode] [-R filename] [-S filename] [-m EUI64 | hostname]\n" in usage()
86 "\t-u: specify bus number\n" in usage()
87 "\t-p: Display current PHY register settings\n" in usage()
88 "\t-r: bus reset\n" in usage()
89 "\t-t: read topology map\n" in usage()
90 "\t-c: read configuration ROM\n" in usage()
91 "\t-d: hex dump of configuration ROM\n" in usage()
92 "\t-o: send link-on packet to the node\n" in usage()
93 "\t-s: write RESET_START register on the node\n" in usage()
94 "\t-l: load and parse hex dump file of configuration ROM\n" in usage()
95 "\t-g: set gap count\n" in usage()
96 "\t-f: force root node\n" in usage()
97 "\t-b: set PRIORITY_BUDGET register on all supported nodes\n" in usage()
98 "\t-M: specify dv or mpeg\n" in usage()
99 "\t-R: Receive DV or MPEG TS stream\n" in usage()
100 "\t-S: Send DV stream\n" in usage()
101 "\t-m: set fwmem target\n" in usage()
109 *(u_int32_t*)&(eui->octet[0]) = htonl(fweui->hi); in fweui2eui64()
110 *(u_int32_t*)&(eui->octet[4]) = htonl(fweui->lo); in fweui2eui64()
132 return (-1); in str2node()
145 return (-1); in str2node()
152 for (i = 0; i < data->info_len; i++) { in str2node()
153 fweui2eui64(&data->dev[i].eui, &tmpeui); in str2node()
155 node = data->dev[i].dst; in str2node()
160 if (i >= data->info_len) { in str2node()
163 return (-1); in str2node()
168 return (-1); in str2node()
186 printf("%d devices (info_len=%d)\n", data->n, data->info_len); in list_dev()
188 for (i = 0; i < data->info_len; i++) { in list_dev()
189 devinfo = &data->dev[i]; in list_dev()
190 fweui2eui64(&devinfo->eui, &eui); in list_dev()
195 (devinfo->status || i == 0) ? devinfo->dst : -1, in list_dev()
197 devinfo->status, in list_dev()
213 asyreq->req.len = 16; in read_write_quad()
215 asyreq->req.type = FWASREQNODE; in read_write_quad()
216 asyreq->pkt.mode.rreqq.dst = FWLOCALBUS | node; in read_write_quad()
218 asyreq->req.type = FWASREQEUI; in read_write_quad()
219 asyreq->req.dst.eui = eui; in read_write_quad()
221 asyreq->pkt.mode.rreqq.tlrt = 0; in read_write_quad()
223 asyreq->pkt.mode.rreqq.tcode = FWTCODE_RREQQ; in read_write_quad()
225 asyreq->pkt.mode.rreqq.tcode = FWTCODE_WREQQ; in read_write_quad()
227 asyreq->pkt.mode.rreqq.dest_hi = 0xffff; in read_write_quad()
228 asyreq->pkt.mode.rreqq.dest_lo = addr_lo; in read_write_quad()
230 qld = (u_int32_t *)&asyreq->pkt; in read_write_quad()
232 asyreq->pkt.mode.wreqq.data = htonl(data); in read_write_quad()
247 * ieee 1394a-2005 4.3.4.3
258 * PHY config Packet as per 1394a-2005 4.3.4.4
268 asyreq->req.len = 12; in send_phy_config()
269 asyreq->req.type = FWASREQNODE; in send_phy_config()
270 asyreq->pkt.mode.ld[0] = 0; in send_phy_config()
271 asyreq->pkt.mode.ld[1] = 0; in send_phy_config()
272 asyreq->pkt.mode.common.tcode = FWTCODE_PHY; in send_phy_config()
274 asyreq->pkt.mode.ld[1] |= ((root_node << 24) | (1 << 23)); in send_phy_config()
276 asyreq->pkt.mode.ld[1] |= ((1 << 22) | (gap_count << 16)); in send_phy_config()
277 asyreq->pkt.mode.ld[2] = ~asyreq->pkt.mode.ld[1]; in send_phy_config()
295 asyreq->req.len = 12; in link_on()
296 asyreq->req.type = FWASREQNODE; in link_on()
297 asyreq->pkt.mode.common.tcode = FWTCODE_PHY; in link_on()
298 asyreq->pkt.mode.ld[1] |= (1 << 30) | ((node & 0x3f) << 24); in link_on()
299 asyreq->pkt.mode.ld[2] = ~asyreq->pkt.mode.ld[1]; in link_on()
314 asyreq->req.len = 16; in reset_start()
315 asyreq->req.type = FWASREQNODE; in reset_start()
316 asyreq->pkt.mode.wreqq.dst = FWLOCALBUS | (node & 0x3f); in reset_start()
317 asyreq->pkt.mode.wreqq.tlrt = 0; in reset_start()
318 asyreq->pkt.mode.wreqq.tcode = FWTCODE_WREQQ; in reset_start()
320 asyreq->pkt.mode.wreqq.dest_hi = 0xffff; in reset_start()
321 asyreq->pkt.mode.wreqq.dest_lo = 0xf0000000 | RESET_START; in reset_start()
323 asyreq->pkt.mode.wreqq.data = htonl(0x1); in reset_start()
345 for (i = 0; i < data->info_len; i++) { in set_pri_req()
346 devinfo = &data->dev[i]; in set_pri_req()
347 if (!devinfo->status) in set_pri_req()
349 reg = read_write_quad(fd, devinfo->eui, BUGET_REG, 1, 0); in set_pri_req()
350 fweui2eui64(&devinfo->eui, &eui); in set_pri_req()
353 devinfo->dst, addr, reg); in set_pri_req()
359 printf(" 0x%x -> 0x%x\n", old, pri_req); in set_pri_req()
360 read_write_quad(fd, devinfo->eui, BUGET_REG, 0, pri_req); in set_pri_req()
376 fweui2eui64(&bi->eui64, &eui); in parse_bus_info_block()
383 bi->bus_name, in parse_bus_info_block()
384 bi->irmc, bi->cmc, bi->isc, bi->bmc, bi->pmc, in parse_bus_info_block()
385 bi->cyc_clk_acc, bi->max_rec, bi->max_rom, in parse_bus_info_block()
386 bi->generation, bi->link_spd, in parse_bus_info_block()
402 for (i = 0; i < data->info_len; i++) { in get_crom()
403 if (data->dev[i].dst == node && data->dev[i].eui.lo != 0) in get_crom()
406 if (i == data->info_len) in get_crom()
409 buf.eui = data->dev[i].eui; in get_crom()
440 if (hdr->info_len == 1) { in show_crom()
443 printf("verndor ID: 0x%06x\n", reg->val); in show_crom()
447 hdr->info_len, hdr->crc_len, hdr->crc); in show_crom()
448 crc = crom_crc(crom_buf+1, hdr->crc_len); in show_crom()
449 if (crc == hdr->crc) in show_crom()
458 printf("no root directory - giving up\n"); in show_crom()
462 dir->crc_len, dir->crc_len, dir->crc); in show_crom()
463 crc = crom_crc((u_int32_t *)&dir->entry[0], dir->crc_len); in show_crom()
464 if (crc == dir->crc) in show_crom()
468 if (dir->crc_len < 1) in show_crom()
476 reg->key, in show_crom()
477 key_types[(reg->key & CSRTYPE_MASK)>>6], in show_crom()
478 reg->key & CSRKEY_MASK, reg->val, in show_crom()
520 static const char *port_status[] = {" ", "-", "P", "C"}; in show_topology_map()
522 "-1W", "-2W", "-5W", "-9W"}; in show_topology_map()
531 tmap->crc_len, tmap->generation, in show_topology_map()
532 tmap->node_count, tmap->self_id_count); in show_topology_map()
535 for (i = 0; i < tmap->crc_len - 2; i++) { in show_topology_map()
536 sid = tmap->self_id[i]; in show_topology_map()
604 "Max_Legacy_SPD:%d BLINK:%d Bridge:%d\n" in dump_phy_registers()
612 b.legacy_spd, b.blink, b.bridge, in dump_phy_registers()
652 return(-1); in open_dev()
712 switch(ciph->fmt) { in detect_recv_fn()
722 errx(1, "Unsupported format for receiving: fmt=0x%x", ciph->fmt); in detect_recv_fn()
736 int fd = -1, ch, len=1024; in main()
739 * If !command_set, then -u will display the nodes for the board. in main()
740 * This emulates the previous behavior when -u is passed by itself in main()
761 int32_t priority_budget = -1; in main()
762 int32_t set_root_node = -1; in main()
763 int32_t set_gap_count = -1; in main()
764 int32_t send_link_on = -1; in main()
765 int32_t send_reset_start = -1; in main()
785 fd = -1; in main()
791 while ((ch = getopt(argc, argv, "M:f:g:m:o:s:b:prtc:d:l:u:R:S:")) != -1) { in main()
938 * executes the command with non ''-'' in main()
949 * If -u <bus_number> is passed, execute in main()
952 * If -u <bus_number> is not passed, execute in main()
963 * display the nodes on this board "-u" in main()
970 * dump_phy_reg "-p" in main()
976 * send a BUS_RESET Event "-r" in main()
983 * Print out the CROM for this node "-c" in main()
992 * Hex Dump the CROM for this node "-d" in main()
1001 * Set Priority Budget to value for this node "-b" in main()
1007 * Explicitly set the root node of this bus to value "-f" in main()
1010 send_phy_config(fd, set_root_node, -1); in main()
1013 * Set the gap count for this card/bus "-g" in main()
1016 send_phy_config(fd, -1, set_gap_count); in main()
1019 * Load a CROM from a file "-l" in main()
1024 * Set the fwmem target for a node to argument "-m" in main()
1030 sysctl_set_int("hw.firewire.fwmem.eui64_hi", eui.hi); in main()
1031 sysctl_set_int("hw.firewire.fwmem.eui64_lo", eui.lo); in main()
1033 sysctl_set_int("hw.fwmem.eui64_hi", eui.hi); in main()
1034 sysctl_set_int("hw.fwmem.eui64_lo", eui.lo); in main()
1042 * Send a link on to this board/bus "-o" in main()
1048 * Send a reset start to this board/bus "-s" in main()
1054 * Dump the node topology for this board/bus "-t" in main()
1060 * Receive data file from node "-R" in main()
1068 fd = -1; in main()
1073 (*recvfn)(fd, recv_data, TAG | CHANNEL, -1); in main()
1078 * Send data file to node "-S" in main()
1081 dvsend(fd, send_data, TAG | CHANNEL, -1); in main()
1087 fd = -1; in main()