aboutsummaryrefslogtreecommitdiffstats
path: root/tools/firewire/nosy-dump.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/firewire/nosy-dump.c')
-rw-r--r--tools/firewire/nosy-dump.c37
1 files changed, 18 insertions, 19 deletions
diff --git a/tools/firewire/nosy-dump.c b/tools/firewire/nosy-dump.c
index 64e5ea438928..0bad0a42d772 100644
--- a/tools/firewire/nosy-dump.c
+++ b/tools/firewire/nosy-dump.c
@@ -46,7 +46,7 @@ enum {
46}; 46};
47 47
48static void 48static void
49print_packet(unsigned long *data, size_t length); 49print_packet(uint32_t *data, size_t length);
50static void 50static void
51decode_link_packet(struct link_packet *packet, size_t length, 51decode_link_packet(struct link_packet *packet, size_t length,
52 int include_flags, int exclude_flags); 52 int include_flags, int exclude_flags);
@@ -151,7 +151,7 @@ sigint_handler(int signal_num)
151} 151}
152 152
153struct subaction * 153struct subaction *
154subaction_create(unsigned long *data, size_t length) 154subaction_create(uint32_t *data, size_t length)
155{ 155{
156 struct subaction *sa; 156 struct subaction *sa;
157 157
@@ -247,9 +247,9 @@ handle_transaction(struct link_transaction *t)
247 247
248 if (option_verbose) { 248 if (option_verbose) {
249 list_for_each_entry(sa, &t->request_list, link) 249 list_for_each_entry(sa, &t->request_list, link)
250 print_packet((unsigned long *) &sa->packet, sa->length); 250 print_packet((uint32_t *) &sa->packet, sa->length);
251 list_for_each_entry(sa, &t->response_list, link) 251 list_for_each_entry(sa, &t->response_list, link)
252 print_packet((unsigned long *) &sa->packet, sa->length); 252 print_packet((uint32_t *) &sa->packet, sa->length);
253 } 253 }
254 printf("\r\n"); 254 printf("\r\n");
255 255
@@ -506,7 +506,7 @@ static struct packet_info packet_info[] = {
506}; 506};
507 507
508int 508int
509handle_packet(unsigned long *data, size_t length) 509handle_packet(uint32_t *data, size_t length)
510{ 510{
511 if (length == 0) { 511 if (length == 0) {
512 printf("bus reset\r\n"); 512 printf("bus reset\r\n");
@@ -642,8 +642,8 @@ handle_packet(unsigned long *data, size_t length)
642 642
643unsigned int get_bits(struct link_packet *packet, int offset, int width) 643unsigned int get_bits(struct link_packet *packet, int offset, int width)
644{ 644{
645 unsigned long *data = (unsigned long *) packet; 645 uint32_t *data = (uint32_t *) packet;
646 unsigned long index, shift, mask; 646 uint32_t index, shift, mask;
647 647
648 index = offset / 32 + 1; 648 index = offset / 32 + 1;
649 shift = 32 - (offset & 31) - width; 649 shift = 32 - (offset & 31) - width;
@@ -703,7 +703,7 @@ decode_link_packet(struct link_packet *packet, size_t length,
703 offset = f->offset; 703 offset = f->offset;
704 704
705 if (f->value_names != NULL) { 705 if (f->value_names != NULL) {
706 unsigned long bits; 706 uint32_t bits;
707 707
708 bits = get_bits(packet, offset, f->width); 708 bits = get_bits(packet, offset, f->width);
709 printf("%s", f->value_names[bits]); 709 printf("%s", f->value_names[bits]);
@@ -741,18 +741,18 @@ decode_link_packet(struct link_packet *packet, size_t length,
741} 741}
742 742
743static void 743static void
744print_packet(unsigned long *data, size_t length) 744print_packet(uint32_t *data, size_t length)
745{ 745{
746 int i; 746 int i;
747 747
748 printf("%6lu ", data[0]); 748 printf("%6u ", data[0]);
749 749
750 if (length == 4) 750 if (length == 4)
751 printf("bus reset"); 751 printf("bus reset");
752 else if (length < sizeof(struct phy_packet)) { 752 else if (length < sizeof(struct phy_packet)) {
753 printf("short packet: "); 753 printf("short packet: ");
754 for (i = 1; i < length / 4; i++) 754 for (i = 1; i < length / 4; i++)
755 printf("%s%08lx", i == 0 ? "[" : " ", data[i]); 755 printf("%s%08x", i == 0 ? "[" : " ", data[i]);
756 printf("]"); 756 printf("]");
757 757
758 } 758 }
@@ -803,7 +803,7 @@ print_packet(unsigned long *data, size_t length)
803 default: 803 default:
804 printf("unknown phy packet: "); 804 printf("unknown phy packet: ");
805 for (i = 1; i < length / 4; i++) 805 for (i = 1; i < length / 4; i++)
806 printf("%s%08lx", i == 0 ? "[" : " ", data[i]); 806 printf("%s%08x", i == 0 ? "[" : " ", data[i]);
807 printf("]"); 807 printf("]");
808 break; 808 break;
809 } 809 }
@@ -829,7 +829,7 @@ print_packet(unsigned long *data, size_t length)
829#define CLEAR "\033[H\033[2J" 829#define CLEAR "\033[H\033[2J"
830 830
831static void 831static void
832print_stats(unsigned long *data, size_t length) 832print_stats(uint32_t *data, size_t length)
833{ 833{
834 static int bus_reset_count, short_packet_count, phy_packet_count; 834 static int bus_reset_count, short_packet_count, phy_packet_count;
835 static int tcode_count[16]; 835 static int tcode_count[16];
@@ -959,8 +959,8 @@ int main(int argc, const char *argv[])
959 setvbuf(stdout, NULL, _IOLBF, BUFSIZ); 959 setvbuf(stdout, NULL, _IOLBF, BUFSIZ);
960 960
961 if (1) { 961 if (1) {
962 unsigned long buf[128 * 1024]; 962 uint32_t buf[128 * 1024];
963 unsigned int filter; 963 uint32_t filter;
964 int length; 964 int length;
965 965
966 filter = ~0; 966 filter = ~0;
@@ -968,11 +968,10 @@ int main(int argc, const char *argv[])
968 filter &= ~(1 <<TCODE_ISO_DATA); 968 filter &= ~(1 <<TCODE_ISO_DATA);
969 if (!option_cycle_start) 969 if (!option_cycle_start)
970 filter &= ~(1 << TCODE_CYCLE_START); 970 filter &= ~(1 << TCODE_CYCLE_START);
971
972 if (view == VIEW_STATS) 971 if (view == VIEW_STATS)
973 ioctl(fd, NOSY_IOC_FILTER, ~(1 << TCODE_CYCLE_START)); 972 filter = ~(1 << TCODE_CYCLE_START);
974 else 973
975 ioctl(fd, NOSY_IOC_FILTER, filter); 974 ioctl(fd, NOSY_IOC_FILTER, filter);
976 975
977 ioctl(fd, NOSY_IOC_START); 976 ioctl(fd, NOSY_IOC_START);
978 977