firewire: fw-ohci: check for misconfigured bus (phyID == 63)
authorStefan Richter <stefanr@s5r6.in-berlin.de>
Wed, 29 Aug 2007 22:11:40 +0000 (00:11 +0200)
committerStefan Richter <stefanr@s5r6.in-berlin.de>
Tue, 16 Oct 2007 22:00:08 +0000 (00:00 +0200)
Check NodeID.nodeNumber as per OHCI 1.1 clause 7.2.3.2.  See also IEEE
1394a table 5B-1.

Also, demote the "node ID not valid" message from error to notification
as it is not an error condition.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
drivers/firewire/fw-ohci.c
drivers/firewire/fw-ohci.h

index ec70c9f911712b956426acd92a1148cea9653491..2f307c4df33563217ae7acbb85ae4c89224b866c 100644 (file)
@@ -917,10 +917,15 @@ static void bus_reset_tasklet(unsigned long data)
 
        reg = reg_read(ohci, OHCI1394_NodeID);
        if (!(reg & OHCI1394_NodeID_idValid)) {
-               fw_error("node ID not valid, new bus reset in progress\n");
+               fw_notify("node ID not valid, new bus reset in progress\n");
                return;
        }
-       ohci->node_id = reg & 0xffff;
+       if ((reg & OHCI1394_NodeID_nodeNumber) == 63) {
+               fw_notify("malconfigured bus\n");
+               return;
+       }
+       ohci->node_id = reg & (OHCI1394_NodeID_busNumber |
+                              OHCI1394_NodeID_nodeNumber);
 
        /*
         * The count in the SelfIDCount register is the number of
index fa15706397d74a965ade047a0901a50ca536dc33..dec4f04e6b245c2a89d4c8c986f55d5e6dae987e 100644 (file)
@@ -59,6 +59,8 @@
 #define   OHCI1394_LinkControl_cycleSource     (1 << 22)
 #define OHCI1394_NodeID                       0x0E8
 #define   OHCI1394_NodeID_idValid             0x80000000
+#define   OHCI1394_NodeID_nodeNumber          0x0000003f
+#define   OHCI1394_NodeID_busNumber           0x0000ffc0
 #define OHCI1394_PhyControl                   0x0EC
 #define   OHCI1394_PhyControl_Read(addr)       (((addr) << 8) | 0x00008000)
 #define   OHCI1394_PhyControl_ReadDone         0x80000000