]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
firewire: 'add CSR_... support' addendum
authorStefan Richter <stefanr@s5r6.in-berlin.de>
Sat, 12 Jun 2010 18:26:51 +0000 (20:26 +0200)
committerStefan Richter <stefanr@s5r6.in-berlin.de>
Sat, 19 Jun 2010 11:01:40 +0000 (13:01 +0200)
Add a comment on which of the conflicting NODE_IDS specifications we
implement.  Reduce a comment on rather irrelevant register bits that can
all be looked up in the spec (or from now on in the code history).
Directly include the required indirectly included bug.h.

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

index 85a54da243e2e3a39f5d47153220bd0af14f2f42..5069cfc75b5032ccdb72a0c82930ba3a9bfecd6d 100644 (file)
@@ -984,29 +984,10 @@ static const struct fw_address_region registers_region =
 
 static u32 read_state_register(struct fw_card *card)
 {
-       /*
-        * Fixed bits (IEEE 1394-2008 8.3.2.2.1):
-        * Bits 0-1 (state) always read 00=running.
-        * Bits 2,3 (off, atn) are not implemented as per the spec.
-        * Bit 4 (elog) is not implemented because there is no error log.
-        * Bit 6 (dreq) cannot be set.  It is intended to "disable requests
-        *      from unreliable nodes"; however, IEEE 1212 states that devices
-        *      may "clear their own dreq bit when it has been improperly set".
-        *      Our implementation might be seen as an improperly extensive
-        *      interpretation of "improperly", but the 1212-2001 revision
-        *      dropped this bit altogether, so we're in the clear.  :o)
-        * Bit 7 (lost) always reads 0 because a power reset has never occurred
-        *      during normal operation.
-        * Bit 9 (linkoff) is not implemented because the PC is not powered
-        *      from the FireWire cable.
-        * Bit 15 (gone) always reads 0.  It must be set at a power/command/bus
-        *      reset, but then cleared when the units are ready again, which
-        *      happens immediately for us.
-        */
-       u32 value = 0x0000;
+       u32 value;
 
        /* Bit 8 (cmstr): */
-       value |= card->driver->read_csr_reg(card, CSR_STATE_CLEAR);
+       value = card->driver->read_csr_reg(card, CSR_STATE_CLEAR);
 
        /* Bit 10 (abdicate): */
        if (card->csr_abdicate)
@@ -1066,6 +1047,10 @@ static void handle_registers(struct fw_card *card, struct fw_request *request,
                break;
 
        case CSR_NODE_IDS:
+               /*
+                * per IEEE 1394-2008 8.3.22.3, not IEEE 1394.1-2004 3.2.8
+                * and 9.6, but interoperable with IEEE 1394.1-2004 bridges
+                */
                if (tcode == TCODE_READ_QUADLET_REQUEST)
                        *data = cpu_to_be32(card->driver->
                                        read_csr_reg(card, CSR_NODE_IDS));
index 51a55808d88a8ec9f47d13cf4ad26d1fb7286fc9..2abdb3268a10d5acfffb3da998ebd637739229cc 100644 (file)
@@ -18,6 +18,7 @@
  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
+#include <linux/bug.h>
 #include <linux/compiler.h>
 #include <linux/delay.h>
 #include <linux/device.h>