aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire/fw-ohci.c
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2007-01-23 15:11:43 -0500
committerStefan Richter <stefanr@s5r6.in-berlin.de>2007-03-09 16:02:43 -0500
commit907293d78872ee492ce6a114258dd853ec5082ae (patch)
tree9384ac58621706b7d3846b34944fa5475f084502 /drivers/firewire/fw-ohci.c
parent366f5f4fa31cd3f3d5901f5edfe255a48906505d (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.c21
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)
828{ 828{
829 struct fw_ohci *ohci = fw_ohci(card); 829 struct fw_ohci *ohci = fw_ohci(card);
830 unsigned long flags; 830 unsigned long flags;
831 int retval = 0; 831 int n, retval = 0;
832 832
833 /* FIXME: make sure this bitmask is cleared when we clear the 833 /* FIXME: Make sure this bitmask is cleared when we clear the busReset
834 * busReset interrupt bit. */ 834 * interrupt bit. Clear physReqResourceAllBuses on bus reset. */
835 835
836 spin_lock_irqsave(&ohci->lock, flags); 836 spin_lock_irqsave(&ohci->lock, flags);
837 837
@@ -840,12 +840,15 @@ ohci_enable_phys_dma(struct fw_card *card, int node_id, int generation)
840 goto out; 840 goto out;
841 } 841 }
842 842
843 if (node_id < 32) { 843 /* NOTE, if the node ID contains a non-local bus ID, physical DMA is
844 reg_write(ohci, OHCI1394_PhyReqFilterLoSet, 1 << node_id); 844 * enabled for _all_ nodes on remote buses. */
845 } else { 845
846 reg_write(ohci, OHCI1394_PhyReqFilterHiSet, 846 n = (node_id & 0xffc0) == LOCAL_BUS ? node_id & 0x3f : 63;
847 1 << (node_id - 32)); 847 if (n < 32)
848 } 848 reg_write(ohci, OHCI1394_PhyReqFilterLoSet, 1 << n);
849 else
850 reg_write(ohci, OHCI1394_PhyReqFilterHiSet, 1 << (n - 32));
851
849 flush_writes(ohci); 852 flush_writes(ohci);
850 out: 853 out:
851 spin_unlock_irqrestore(&ohci->lock, flags); 854 spin_unlock_irqrestore(&ohci->lock, flags);