diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2007-01-23 21:11:43 +0100 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2007-03-09 22:02:43 +0100 |
commit | 907293d78872ee492ce6a114258dd853ec5082ae (patch) | |
tree | 9384ac58621706b7d3846b34944fa5475f084502 /drivers/firewire/fw-ohci.c | |
parent | 366f5f4fa31cd3f3d5901f5edfe255a48906505d (diff) |
firewire: consistent usage of node_id
Definitions as per IEEE 1212 and IEEE 1394:
Node ID: Concatenation of bus ID and local ID. 16 bits long.
Bus ID: Identifies a particular bus within a group of buses
interconnected by bus bridges.
Local ID: Identifies a particular node on a bus.
PHY ID: Local ID of IEEE 1394 nodes. 6 bits long.
Never ever use a variable called node_id for anything else than a node ID.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/firewire/fw-ohci.c')
-rw-r--r-- | drivers/firewire/fw-ohci.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c index ba10203725c1..d6f0644b05d4 100644 --- a/drivers/firewire/fw-ohci.c +++ b/drivers/firewire/fw-ohci.c @@ -828,10 +828,10 @@ ohci_enable_phys_dma(struct fw_card *card, int node_id, int generation) { struct fw_ohci *ohci = fw_ohci(card); unsigned long flags; - int retval = 0; + int n, retval = 0; - /* FIXME: make sure this bitmask is cleared when we clear the - * busReset interrupt bit. */ + /* FIXME: Make sure this bitmask is cleared when we clear the busReset + * interrupt bit. Clear physReqResourceAllBuses on bus reset. */ spin_lock_irqsave(&ohci->lock, flags); @@ -840,12 +840,15 @@ ohci_enable_phys_dma(struct fw_card *card, int node_id, int generation) goto out; } - if (node_id < 32) { - reg_write(ohci, OHCI1394_PhyReqFilterLoSet, 1 << node_id); - } else { - reg_write(ohci, OHCI1394_PhyReqFilterHiSet, - 1 << (node_id - 32)); - } + /* NOTE, if the node ID contains a non-local bus ID, physical DMA is + * enabled for _all_ nodes on remote buses. */ + + n = (node_id & 0xffc0) == LOCAL_BUS ? node_id & 0x3f : 63; + if (n < 32) + reg_write(ohci, OHCI1394_PhyReqFilterLoSet, 1 << n); + else + reg_write(ohci, OHCI1394_PhyReqFilterHiSet, 1 << (n - 32)); + flush_writes(ohci); out: spin_unlock_irqrestore(&ohci->lock, flags); |