Loading tools/firewire/nosy-dump.c +132 −113 Original line number Diff line number Diff line Loading @@ -487,18 +487,12 @@ static const struct packet_info packet_info[] = { }; static int handle_packet(uint32_t *data, size_t length) handle_request_packet(uint32_t *data, size_t length) { if (length == 0) { printf("bus reset\r\n"); clear_pending_transaction_list(); } else if (length > sizeof(struct phy_packet)) { struct link_packet *p = (struct link_packet *) data; struct subaction *sa, *prev; struct link_transaction *t; switch (packet_info[p->common.tcode].type) { case PACKET_REQUEST: t = link_transaction_lookup(p->common.source, p->common.destination, p->common.tlabel); sa = subaction_create(data, length); Loading Loading @@ -553,9 +547,17 @@ handle_packet(uint32_t *data, size_t length) /* check that retry protocol is respected. */ break; } break; case PACKET_RESPONSE: return 1; } static int handle_response_packet(uint32_t *data, size_t length) { struct link_packet *p = (struct link_packet *) data; struct subaction *sa, *prev; struct link_transaction *t; t = link_transaction_lookup(p->common.destination, p->common.source, p->common.tlabel); if (list_empty(&t->request_list)) { Loading Loading @@ -618,7 +620,24 @@ handle_packet(uint32_t *data, size_t length) break; } break; return 1; } static int handle_packet(uint32_t *data, size_t length) { if (length == 0) { printf("bus reset\r\n"); clear_pending_transaction_list(); } else if (length > sizeof(struct phy_packet)) { struct link_packet *p = (struct link_packet *) data; switch (packet_info[p->common.tcode].type) { case PACKET_REQUEST: return handle_request_packet(data, length); case PACKET_RESPONSE: return handle_response_packet(data, length); case PACKET_OTHER: case PACKET_RESERVED: Loading Loading
tools/firewire/nosy-dump.c +132 −113 Original line number Diff line number Diff line Loading @@ -487,18 +487,12 @@ static const struct packet_info packet_info[] = { }; static int handle_packet(uint32_t *data, size_t length) handle_request_packet(uint32_t *data, size_t length) { if (length == 0) { printf("bus reset\r\n"); clear_pending_transaction_list(); } else if (length > sizeof(struct phy_packet)) { struct link_packet *p = (struct link_packet *) data; struct subaction *sa, *prev; struct link_transaction *t; switch (packet_info[p->common.tcode].type) { case PACKET_REQUEST: t = link_transaction_lookup(p->common.source, p->common.destination, p->common.tlabel); sa = subaction_create(data, length); Loading Loading @@ -553,9 +547,17 @@ handle_packet(uint32_t *data, size_t length) /* check that retry protocol is respected. */ break; } break; case PACKET_RESPONSE: return 1; } static int handle_response_packet(uint32_t *data, size_t length) { struct link_packet *p = (struct link_packet *) data; struct subaction *sa, *prev; struct link_transaction *t; t = link_transaction_lookup(p->common.destination, p->common.source, p->common.tlabel); if (list_empty(&t->request_list)) { Loading Loading @@ -618,7 +620,24 @@ handle_packet(uint32_t *data, size_t length) break; } break; return 1; } static int handle_packet(uint32_t *data, size_t length) { if (length == 0) { printf("bus reset\r\n"); clear_pending_transaction_list(); } else if (length > sizeof(struct phy_packet)) { struct link_packet *p = (struct link_packet *) data; switch (packet_info[p->common.tcode].type) { case PACKET_REQUEST: return handle_request_packet(data, length); case PACKET_RESPONSE: return handle_response_packet(data, length); case PACKET_OTHER: case PACKET_RESERVED: Loading