diff options
author | Kristian Høgsberg <krh@redhat.com> | 2006-11-28 17:36:42 -0500 |
---|---|---|
committer | Kristian Høgsberg <krh@redhat.com> | 2006-11-28 17:36:42 -0500 |
commit | 26472096ecfe60d43eefc4ccb43b103a36fa3966 (patch) | |
tree | 50faf1ee1c31efbce03c5204f50a0276bb1af73c | |
parent | 0b44cc961ff699f5040806b240ec6c061f27a88d (diff) |
Add cycle start packet decoding, add --iso and --cycle-start flags.
-rw-r--r-- | nosy-dump.c | 51 |
1 files changed, 42 insertions, 9 deletions
diff --git a/nosy-dump.c b/nosy-dump.c index 03fe664..c070e27 100644 --- a/nosy-dump.c +++ b/nosy-dump.c @@ -27,6 +27,8 @@ static char *option_view = "packet"; static char *option_output = NULL; static char *option_input = NULL; static int option_hex; +static int option_iso; +static int option_cycle_start; static int option_version; static int option_verbose; @@ -64,6 +66,18 @@ static const struct poptOption options[] = { descrip: "Print each packet in hex.", }, { + longName: "iso", + argInfo: POPT_ARG_NONE, + arg: &option_iso, + descrip: "Print iso packets.", + }, + { + longName: "cycle-start", + argInfo: POPT_ARG_NONE, + arg: &option_cycle_start, + descrip: "Print cycle start packets.", + }, + { longName: "verbose", shortName: 'v', argInfo: POPT_ARG_NONE, @@ -128,7 +142,7 @@ struct phy_packet { unsigned int extended : 1; unsigned int phy_id : 6; unsigned int identifier : 2; - } self_id; + } self_id; struct { unsigned int more_packets : 1; @@ -306,6 +320,23 @@ struct link_packet { } write_response; struct { + unsigned int priority : 4; + unsigned int tcode : 4; + unsigned int rt : 2; + unsigned int tlabel : 6; + unsigned int destination : 16; + + unsigned int offset_high : 16; + unsigned int source : 16; + + unsigned long offset_low; + + unsigned long data; + + unsigned long crc; + } cycle_start; + + struct { unsigned int sy : 4; unsigned int tcode : 4; unsigned int channel : 6; @@ -579,10 +610,6 @@ struct packet_field write_response_fields[] = { { "ack", -4, 4, 0, ack_names } }; -struct packet_field cycle_start_fields[] = { - { "tcode", 24, 4, 0, tcode_names }, -}; - struct packet_field iso_data_fields[] = { { "data_length", 0, 16, PACKET_FIELD_DATA_LENGTH }, { "tag", 16, 2 }, @@ -649,8 +676,8 @@ static struct packet_info packet_info[] = { { .name = "cycle_start", .type = PACKET_OTHER, - .fields = cycle_start_fields, - .field_count = array_length(cycle_start_fields) + .fields = write_quadlet_request_fields, + .field_count = array_length(write_quadlet_request_fields) }, { .name = "lock_request", @@ -1108,13 +1135,19 @@ int main(int argc, const char *argv[]) if (1) { unsigned long buf[1024]; + unsigned int filter; int length; + filter = ~0; + if (!option_iso) + filter &= ~(1 <<TCODE_ISO_DATA); + if (!option_cycle_start) + filter &= ~(1 << TCODE_CYCLE_START); + if (view == VIEW_STATS) ioctl(fd, NOSY_IOC_FILTER, ~(1 << TCODE_CYCLE_START)); else - ioctl(fd, NOSY_IOC_FILTER, ~((1 << TCODE_CYCLE_START) | - (1 <<TCODE_ISO_DATA))); + ioctl(fd, NOSY_IOC_FILTER, filter); ioctl(fd, NOSY_IOC_START); |