aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2010-06-12 14:26:51 -0400
committerStefan Richter <stefanr@s5r6.in-berlin.de>2010-06-19 07:01:40 -0400
commit65b2742ac002f554f6ca0c2eab84cc62400eafdf (patch)
treea13b0dc0883a5e126f2577f8061705c4c38debc0 /drivers
parentc374ab424249b6ab91b1aee7460419d3f2c321df (diff)
firewire: 'add CSR_... support' addendum
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/firewire/core-transaction.c27
-rw-r--r--drivers/firewire/ohci.c1
2 files changed, 7 insertions, 21 deletions
diff --git a/drivers/firewire/core-transaction.c b/drivers/firewire/core-transaction.c
index 85a54da243e2..5069cfc75b50 100644
--- a/drivers/firewire/core-transaction.c
+++ b/drivers/firewire/core-transaction.c
@@ -984,29 +984,10 @@ static const struct fw_address_region registers_region =
984 984
985static u32 read_state_register(struct fw_card *card) 985static u32 read_state_register(struct fw_card *card)
986{ 986{
987 /* 987 u32 value;
988 * Fixed bits (IEEE 1394-2008 8.3.2.2.1):
989 * Bits 0-1 (state) always read 00=running.
990 * Bits 2,3 (off, atn) are not implemented as per the spec.
991 * Bit 4 (elog) is not implemented because there is no error log.
992 * Bit 6 (dreq) cannot be set. It is intended to "disable requests
993 * from unreliable nodes"; however, IEEE 1212 states that devices
994 * may "clear their own dreq bit when it has been improperly set".
995 * Our implementation might be seen as an improperly extensive
996 * interpretation of "improperly", but the 1212-2001 revision
997 * dropped this bit altogether, so we're in the clear. :o)
998 * Bit 7 (lost) always reads 0 because a power reset has never occurred
999 * during normal operation.
1000 * Bit 9 (linkoff) is not implemented because the PC is not powered
1001 * from the FireWire cable.
1002 * Bit 15 (gone) always reads 0. It must be set at a power/command/bus
1003 * reset, but then cleared when the units are ready again, which
1004 * happens immediately for us.
1005 */
1006 u32 value = 0x0000;
1007 988
1008 /* Bit 8 (cmstr): */ 989 /* Bit 8 (cmstr): */
1009 value |= card->driver->read_csr_reg(card, CSR_STATE_CLEAR); 990 value = card->driver->read_csr_reg(card, CSR_STATE_CLEAR);
1010 991
1011 /* Bit 10 (abdicate): */ 992 /* Bit 10 (abdicate): */
1012 if (card->csr_abdicate) 993 if (card->csr_abdicate)
@@ -1066,6 +1047,10 @@ static void handle_registers(struct fw_card *card, struct fw_request *request,
1066 break; 1047 break;
1067 1048
1068 case CSR_NODE_IDS: 1049 case CSR_NODE_IDS:
1050 /*
1051 * per IEEE 1394-2008 8.3.22.3, not IEEE 1394.1-2004 3.2.8
1052 * and 9.6, but interoperable with IEEE 1394.1-2004 bridges
1053 */
1069 if (tcode == TCODE_READ_QUADLET_REQUEST) 1054 if (tcode == TCODE_READ_QUADLET_REQUEST)
1070 *data = cpu_to_be32(card->driver-> 1055 *data = cpu_to_be32(card->driver->
1071 read_csr_reg(card, CSR_NODE_IDS)); 1056 read_csr_reg(card, CSR_NODE_IDS));
diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c
index 51a55808d88a..2abdb3268a10 100644
--- a/drivers/firewire/ohci.c
+++ b/drivers/firewire/ohci.c
@@ -18,6 +18,7 @@
18 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 */ 19 */
20 20
21#include <linux/bug.h>
21#include <linux/compiler.h> 22#include <linux/compiler.h>
22#include <linux/delay.h> 23#include <linux/delay.h>
23#include <linux/device.h> 24#include <linux/device.h>