diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2009-06-09 21:56:55 (GMT) |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2009-06-14 09:57:06 (GMT) |
commit | 837ec787d85fda8d73193a399ebcea0288e4765b (patch) | |
tree | 813a25088e68dc734966ce5ed4aacada01084996 /drivers/firewire/core-device.c | |
parent | 099d54143e49d49c33cd25779ca725191df59b73 (diff) | |
download | linux-837ec787d85fda8d73193a399ebcea0288e4765b.tar.xz |
firewire: core: don't update Broadcast_Channel if RFC 2734 conditions aren't met
This extra check will avoid Broadcast_Channel register related traffic
to many IIDC, SBP-2, and AV/C devices which aren't IRMC or have a
max_rec < 8 (i.e. support < 512 bytes async payload). This avoids a
little bit of traffic after bus reset and is even more careful with
devices which don't implement this CSR.
The assumption is that no other protocol than IP over 1394 uses the
broadcast channel for streams.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/firewire/core-device.c')
-rw-r--r-- | drivers/firewire/core-device.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/firewire/core-device.c b/drivers/firewire/core-device.c index d6e54a5..97e656a 100644 --- a/drivers/firewire/core-device.c +++ b/drivers/firewire/core-device.c @@ -580,7 +580,9 @@ static int read_bus_info_block(struct fw_device *device, int generation) kfree(old_rom); ret = 0; - device->cmc = rom[2] >> 30 & 1; + device->max_rec = rom[2] >> 12 & 0xf; + device->cmc = rom[2] >> 30 & 1; + device->irmc = rom[2] >> 31 & 1; out: kfree(rom); @@ -841,6 +843,20 @@ static void set_broadcast_channel(struct fw_device *device, int generation) if (!card->broadcast_channel_allocated) return; + /* + * The Broadcast_Channel Valid bit is required by nodes which want to + * transmit on this channel. Such transmissions are practically + * exclusive to IP over 1394 (RFC 2734). IP capable nodes are required + * to be IRM capable and have a max_rec of 8 or more. We use this fact + * to narrow down to which nodes we send Broadcast_Channel updates. + */ + if (!device->irmc || device->max_rec < 8) + return; + + /* + * Some 1394-1995 nodes crash if this 1394a-2000 register is written. + * Perform a read test first. + */ if (device->bc_implemented == BC_UNKNOWN) { rcode = fw_run_transaction(card, TCODE_READ_QUADLET_REQUEST, device->node_id, generation, device->max_speed, |