From d509177e3478e010afcfad75d38bc44401cf9152 Mon Sep 17 00:00:00 2001 From: Stefan Richter Date: Thu, 1 Dec 2005 18:51:52 -0500 Subject: [PATCH] --- yaml --- r: 15407 b: refs/heads/master c: 14c0fa243b358c24040ff5f44b60c47aaf6430c3 h: refs/heads/master i: 15405: f6bfb9469db24e1cc0fb58842f9b6176884cbd89 15403: 69e01315987ea2d64fd8c4b69797237a023485e6 15399: fb11196f1e0240227ea2aaa46526902642fe76a3 15391: 66089a5e5804631d2228c231d117b16e0bdcd8fc v: v3 --- [refs] | 2 +- trunk/drivers/ieee1394/hosts.h | 1 + trunk/drivers/ieee1394/nodemgr.c | 25 +++++++++++++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index e858bfa28f1e..e949a570738d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 01fc99864ecc678c4f1f476b2a8b64ebcb14e733 +refs/heads/master: 14c0fa243b358c24040ff5f44b60c47aaf6430c3 diff --git a/trunk/drivers/ieee1394/hosts.h b/trunk/drivers/ieee1394/hosts.h index 38f42112dff0..ae9b02cc013f 100644 --- a/trunk/drivers/ieee1394/hosts.h +++ b/trunk/drivers/ieee1394/hosts.h @@ -41,6 +41,7 @@ struct hpsb_host { /* this nodes state */ unsigned in_bus_reset:1; unsigned is_shutdown:1; + unsigned resume_packet_sent:1; /* this nodes' duties on the bus */ unsigned is_root:1; diff --git a/trunk/drivers/ieee1394/nodemgr.c b/trunk/drivers/ieee1394/nodemgr.c index 3f0917bbd7f5..b56934edd62b 100644 --- a/trunk/drivers/ieee1394/nodemgr.c +++ b/trunk/drivers/ieee1394/nodemgr.c @@ -1410,6 +1410,24 @@ static void nodemgr_node_probe(struct host_info *hi, int generation) return; } +static int nodemgr_send_resume_packet(struct hpsb_host *host) +{ + struct hpsb_packet *packet; + int ret = 1; + + packet = hpsb_make_phypacket(host, + 0x003c0000 | NODEID_TO_NODE(host->node_id) << 24); + if (packet) { + packet->no_waiter = 1; + packet->generation = get_hpsb_generation(host); + ret = hpsb_send_packet(packet); + } + if (ret) + HPSB_WARN("fw-host%d: Failed to broadcast resume packet", + host->id); + 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. */ @@ -1460,6 +1478,13 @@ static int nodemgr_do_irm_duties(struct hpsb_host *host, int cycles) } } + /* Some devices suspend their ports while being connected to an inactive + * host adapter, i.e. if connected before the low-level driver is + * loaded. They become visible either when physically unplugged and + * replugged, or when receiving a resume packet. Send one once. */ + if (!host->resume_packet_sent && !nodemgr_send_resume_packet(host)) + host->resume_packet_sent = 1; + return 1; }