aboutsummaryrefslogtreecommitdiff
path: root/drivers/firewire/core-transaction.c
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2010-06-10 08:37:15 +0200
committerClemens Ladisch <clemens@ladisch.de>2010-06-10 08:37:15 +0200
commit7e0e314f198d5048b74c8f0ef9f4c1c02e5ecfc9 (patch)
tree513fcf8f87f6b24121d4e4eb07e1345e29d81db2 /drivers/firewire/core-transaction.c
parent4ffb7a6a066e4be4577976d1c08e237c7479770a (diff)
firewire: core: add CSR abdicate support
Implement the abdicate bit, which is required for bus manager capable nodes and tested by the Base 1394 Test Suite. Finally, something to do at a command reset! :-) Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Diffstat (limited to 'drivers/firewire/core-transaction.c')
-rw-r--r--drivers/firewire/core-transaction.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/firewire/core-transaction.c b/drivers/firewire/core-transaction.c
index e0c6cce894c..85a54da243e 100644
--- a/drivers/firewire/core-transaction.c
+++ b/drivers/firewire/core-transaction.c
@@ -1008,6 +1008,10 @@ static u32 read_state_register(struct fw_card *card)
/* Bit 8 (cmstr): */
value |= card->driver->read_csr_reg(card, CSR_STATE_CLEAR);
+ /* Bit 10 (abdicate): */
+ if (card->csr_abdicate)
+ value |= CSR_STATE_BIT_ABDICATE;
+
return value;
}
@@ -1041,6 +1045,8 @@ static void handle_registers(struct fw_card *card, struct fw_request *request,
} else if (tcode == TCODE_WRITE_QUADLET_REQUEST) {
card->driver->write_csr_reg(card, CSR_STATE_CLEAR,
be32_to_cpu(*data));
+ if (*data & cpu_to_be32(CSR_STATE_BIT_ABDICATE))
+ card->csr_abdicate = false;
} else {
rcode = RCODE_TYPE_ERROR;
}
@@ -1052,7 +1058,8 @@ static void handle_registers(struct fw_card *card, struct fw_request *request,
} else if (tcode == TCODE_WRITE_QUADLET_REQUEST) {
card->driver->write_csr_reg(card, CSR_STATE_SET,
be32_to_cpu(*data));
- /* FIXME: implement abdicate */
+ if (*data & cpu_to_be32(CSR_STATE_BIT_ABDICATE))
+ card->csr_abdicate = true;
} else {
rcode = RCODE_TYPE_ERROR;
}
@@ -1070,7 +1077,9 @@ static void handle_registers(struct fw_card *card, struct fw_request *request,
break;
case CSR_RESET_START:
- if (tcode != TCODE_WRITE_QUADLET_REQUEST)
+ if (tcode == TCODE_WRITE_QUADLET_REQUEST)
+ card->csr_abdicate = false;
+ else
rcode = RCODE_TYPE_ERROR;
break;