summaryrefslogtreecommitdiff
path: root/drivers/firewire/core-transaction.c
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2010-06-10 08:36:37 +0200
committerClemens Ladisch <clemens@ladisch.de>2010-06-10 08:36:37 +0200
commit4ffb7a6a066e4be4577976d1c08e237c7479770a (patch)
treefd4c275e8ef894d60602e1b4d1f81150e54b32f8 /drivers/firewire/core-transaction.c
parent3d1f46eb60b155c705e389ecdf313f11b4b91976 (diff)
firewire: add CSR cmstr support
Implement the cmstr bit, which is required for cycle master capable nodes and tested for by the Base 1394 Test Suite. This bit allows the bus master to disable cycle start packets; there are bus master implementations that actually do this. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Diffstat (limited to 'drivers/firewire/core-transaction.c')
-rw-r--r--drivers/firewire/core-transaction.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/firewire/core-transaction.c b/drivers/firewire/core-transaction.c
index dd8ef650a7cb..e0c6cce894cf 100644
--- a/drivers/firewire/core-transaction.c
+++ b/drivers/firewire/core-transaction.c
@@ -1003,7 +1003,12 @@ static u32 read_state_register(struct fw_card *card)
* reset, but then cleared when the units are ready again, which
* happens immediately for us.
*/
- return 0;
+ u32 value = 0x0000;
+
+ /* Bit 8 (cmstr): */
+ value |= card->driver->read_csr_reg(card, CSR_STATE_CLEAR);
+
+ return value;
}
static void update_split_timeout(struct fw_card *card)
@@ -1034,6 +1039,8 @@ static void handle_registers(struct fw_card *card, struct fw_request *request,
if (tcode == TCODE_READ_QUADLET_REQUEST) {
*data = cpu_to_be32(read_state_register(card));
} else if (tcode == TCODE_WRITE_QUADLET_REQUEST) {
+ card->driver->write_csr_reg(card, CSR_STATE_CLEAR,
+ be32_to_cpu(*data));
} else {
rcode = RCODE_TYPE_ERROR;
}
@@ -1043,7 +1050,8 @@ static void handle_registers(struct fw_card *card, struct fw_request *request,
if (tcode == TCODE_READ_QUADLET_REQUEST) {
*data = cpu_to_be32(read_state_register(card));
} else if (tcode == TCODE_WRITE_QUADLET_REQUEST) {
- /* FIXME: implement cmstr */
+ card->driver->write_csr_reg(card, CSR_STATE_SET,
+ be32_to_cpu(*data));
/* FIXME: implement abdicate */
} else {
rcode = RCODE_TYPE_ERROR;