Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 15221
b: refs/heads/master
c: d51e86c
h: refs/heads/master
i:
  15219: bd7703f
v: v3
  • Loading branch information
Stefan Richter authored and Jody McIntyre committed Dec 13, 2005
1 parent 3bd811f commit 60de234
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 48622b7bde008387218a416586e9d072b385f1ae
refs/heads/master: d51e86c18a479f1dbcef3aa20e58ad04d1233016
42 changes: 32 additions & 10 deletions trunk/drivers/ieee1394/nodemgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1349,6 +1349,33 @@ static void nodemgr_update_pdrv(struct node_entry *ne)
}


/* Write the BROADCAST_CHANNEL as per IEEE1394a 8.3.2.3.11 and 8.4.2.3. This
* seems like an optional service but in the end it is practically mandatory
* as a consequence of these clauses.
*
* Note that we cannot do a broadcast write to all nodes at once because some
* pre-1394a devices would hang. */
static void nodemgr_irm_write_bc(struct node_entry *ne, int generation)
{
const u64 bc_addr = (CSR_REGISTER_BASE | CSR_BROADCAST_CHANNEL);
quadlet_t bc_remote, bc_local;
int ret;

if (!ne->host->is_irm || ne->generation != generation ||
ne->nodeid == ne->host->node_id)
return;

bc_local = cpu_to_be32(ne->host->csr.broadcast_channel);

/* Check if the register is implemented and 1394a compliant. */
ret = hpsb_read(ne->host, ne->nodeid, generation, bc_addr, &bc_remote,
sizeof(bc_remote));
if (!ret && bc_remote & cpu_to_be32(0x80000000) &&
bc_remote != bc_local)
hpsb_node_write(ne, bc_addr, &bc_local, sizeof(bc_local));
}


static void nodemgr_probe_ne(struct host_info *hi, struct node_entry *ne, int generation)
{
struct device *dev;
Expand All @@ -1360,6 +1387,8 @@ static void nodemgr_probe_ne(struct host_info *hi, struct node_entry *ne, int ge
if (!dev)
return;

nodemgr_irm_write_bc(ne, generation);

/* If "needs_probe", then this is either a new or changed node we
* rescan totally. If the generation matches for an existing node
* (one that existed prior to the bus reset) we send update calls
Expand Down Expand Up @@ -1431,9 +1460,7 @@ static int nodemgr_send_resume_packet(struct hpsb_host *host)
return ret;
}

/* Because we are a 1394a-2000 compliant IRM, we need to inform all the other
* nodes of the broadcast channel. (Really we're only setting the validity
* bit). Other IRM responsibilities go in here as well. */
/* Perform a few high-level IRM responsibilities. */
static int nodemgr_do_irm_duties(struct hpsb_host *host, int cycles)
{
quadlet_t bc;
Expand All @@ -1442,13 +1469,8 @@ static int nodemgr_do_irm_duties(struct hpsb_host *host, int cycles)
if (!host->is_irm || host->irm_id == (nodeid_t)-1)
return 1;

host->csr.broadcast_channel |= 0x40000000; /* set validity bit */

bc = cpu_to_be32(host->csr.broadcast_channel);

hpsb_write(host, LOCAL_BUS | ALL_NODES, get_hpsb_generation(host),
(CSR_REGISTER_BASE | CSR_BROADCAST_CHANNEL),
&bc, sizeof(quadlet_t));
/* We are a 1394a-2000 compliant IRM. Set the validity bit. */
host->csr.broadcast_channel |= 0x40000000;

/* If there is no bus manager then we should set the root node's
* force_root bit to promote bus stability per the 1394
Expand Down

0 comments on commit 60de234

Please sign in to comment.