tools/firewire: nosy-dump: use linux/firewire-constants.h
authorStefan Richter <stefanr@s5r6.in-berlin.de>
Thu, 22 Jul 2010 09:58:05 +0000 (11:58 +0200)
committerStefan Richter <stefanr@s5r6.in-berlin.de>
Tue, 27 Jul 2010 09:04:12 +0000 (11:04 +0200)
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
tools/firewire/decode-fcp.c
tools/firewire/nosy-dump.c
tools/firewire/nosy-dump.h

index 9cd1550db24adeccbf12dfdf3c325da3a3fc3752..e41223b6a4c8538ec90ba664f4026445cdc76b3f 100644 (file)
@@ -1,5 +1,7 @@
-#include <stdlib.h>
+#include <linux/firewire-constants.h>
 #include <stdio.h>
+#include <stdlib.h>
+
 #include "list.h"
 #include "nosy-dump.h"
 
@@ -176,7 +178,7 @@ decode_fcp(struct link_transaction *t)
            ((unsigned long long) t->request->packet.common.offset_high << 32) |
            t->request->packet.common.offset_low;
 
-       if (t->request->packet.common.tcode != TCODE_WRITE_BLOCK)
+       if (t->request->packet.common.tcode != TCODE_WRITE_BLOCK_REQUEST)
                return 0;
 
        if (offset == CSR_FCP_COMMAND || offset == CSR_FCP_RESPONSE) {
index 32c48556170bc1892499605bd00812abbb0c918b..5241cb402d6b1bbefe779a72929ce4083ab64001 100644 (file)
@@ -20,6 +20,7 @@
 #include <byteswap.h>
 #include <endian.h>
 #include <fcntl.h>
+#include <linux/firewire-constants.h>
 #include <poll.h>
 #include <popt.h>
 #include <signal.h>
@@ -522,8 +523,8 @@ handle_request_packet(uint32_t *data, size_t length)
 
        switch (sa->ack) {
        case ACK_COMPLETE:
-               if (p->common.tcode != TCODE_WRITE_QUADLET &&
-                   p->common.tcode != TCODE_WRITE_BLOCK)
+               if (p->common.tcode != TCODE_WRITE_QUADLET_REQUEST &&
+                   p->common.tcode != TCODE_WRITE_BLOCK_REQUEST)
                        /* error, unified transactions only allowed for write */;
                list_remove(&t->link);
                handle_transaction(t);
@@ -967,7 +968,7 @@ int main(int argc, const char *argv[])
 
                filter = ~0;
                if (!option_iso)
-                       filter &= ~(1 << TCODE_ISO_DATA);
+                       filter &= ~(1 << TCODE_STREAM_DATA);
                if (!option_cycle_start)
                        filter &= ~(1 << TCODE_CYCLE_START);
                if (view == VIEW_STATS)
index fe8be630efaab3bce22454d32faaefd6219b2b0d..3a4b5b33ba5d3a8e8e7936a119d40bec0c0e40da 100644 (file)
@@ -3,36 +3,11 @@
 
 #define array_length(array) (sizeof(array) / sizeof(array[0]))
 
-#define TCODE_WRITE_QUADLET         0x0
-#define TCODE_WRITE_BLOCK           0x1
-#define TCODE_WRITE_RESPONSE        0x2
-#define TCODE_READ_QUADLET          0x4
-#define TCODE_READ_BLOCK            0x5
-#define TCODE_READ_QUADLET_RESPONSE 0x6
-#define TCODE_READ_BLOCK_RESPONSE   0x7
-#define TCODE_CYCLE_START           0x8
-#define TCODE_LOCK_REQUEST          0x9
-#define TCODE_ISO_DATA              0xa
-#define TCODE_LOCK_RESPONSE         0xb
-#define TCODE_PHY_PACKET            0x10
-
-#define ACK_NO_ACK               0x0
-#define ACK_COMPLETE             0x1
-#define ACK_PENDING              0x2
-#define ACK_BUSY_X               0x4
-#define ACK_BUSY_A               0x5
-#define ACK_BUSY_B               0x6
-#define ACK_DATA_ERROR           0xd
-#define ACK_TYPE_ERROR           0xe 
-
+#define ACK_NO_ACK   0x0
 #define ACK_DONE(a)  ((a >> 2) == 0)
 #define ACK_BUSY(a)  ((a >> 2) == 1)
 #define ACK_ERROR(a) ((a >> 2) == 3)
 
-#define SPEED_100                0x0
-#define SPEED_200                0x1
-#define SPEED_400                0x2
-
 #include <stdint.h>
 
 struct phy_packet {
@@ -92,6 +67,8 @@ struct phy_packet {
        uint32_t ack;
 };
 
+#define TCODE_PHY_PACKET 0x10
+
 #define PHY_PACKET_CONFIGURATION 0x00
 #define PHY_PACKET_LINK_ON 0x01
 #define PHY_PACKET_SELF_ID 0x02