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>
This commit is contained in:
Clemens Ladisch
2010-06-10 08:36:37 +02:00
parent 3d1f46eb60
commit 4ffb7a6a06
4 changed files with 48 additions and 2 deletions

View File

@@ -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;