ieee1394: resume remote ports when starting a host (fixes device recognition)

After initializing an IEEE 1394 host, broadcast a resume packet. This makes
remote nodes visible which suspended their ports while the host was down.
Such nodes had to be unplugged and replugged in order to be recognized.

Motorola DCT6200 cable reciever was affected, probably other devices too.
http://marc.theaimsgroup.com/?t=113202715800001

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Jody McIntyre <scjody@modernduck.com>
(cherry picked from 14c0fa243b358c24040ff5f44b60c47aaf6430c3 commit)

authored by Stefan Richter and committed by Jody McIntyre 48622b7b e4f5c82a

+26
+1
drivers/ieee1394/hosts.h
··· 41 /* this nodes state */ 42 unsigned in_bus_reset:1; 43 unsigned is_shutdown:1; 44 45 /* this nodes' duties on the bus */ 46 unsigned is_root:1;
··· 41 /* this nodes state */ 42 unsigned in_bus_reset:1; 43 unsigned is_shutdown:1; 44 + unsigned resume_packet_sent:1; 45 46 /* this nodes' duties on the bus */ 47 unsigned is_root:1;
+25
drivers/ieee1394/nodemgr.c
··· 1413 return; 1414 } 1415 1416 /* Because we are a 1394a-2000 compliant IRM, we need to inform all the other 1417 * nodes of the broadcast channel. (Really we're only setting the validity 1418 * bit). Other IRM responsibilities go in here as well. */ ··· 1480 return 0; 1481 } 1482 } 1483 1484 return 1; 1485 }
··· 1413 return; 1414 } 1415 1416 + static int nodemgr_send_resume_packet(struct hpsb_host *host) 1417 + { 1418 + struct hpsb_packet *packet; 1419 + int ret = 1; 1420 + 1421 + packet = hpsb_make_phypacket(host, 1422 + 0x003c0000 | NODEID_TO_NODE(host->node_id) << 24); 1423 + if (packet) { 1424 + packet->no_waiter = 1; 1425 + packet->generation = get_hpsb_generation(host); 1426 + ret = hpsb_send_packet(packet); 1427 + } 1428 + if (ret) 1429 + HPSB_WARN("fw-host%d: Failed to broadcast resume packet", 1430 + host->id); 1431 + return ret; 1432 + } 1433 + 1434 /* Because we are a 1394a-2000 compliant IRM, we need to inform all the other 1435 * nodes of the broadcast channel. (Really we're only setting the validity 1436 * bit). Other IRM responsibilities go in here as well. */ ··· 1462 return 0; 1463 } 1464 } 1465 + 1466 + /* Some devices suspend their ports while being connected to an inactive 1467 + * host adapter, i.e. if connected before the low-level driver is 1468 + * loaded. They become visible either when physically unplugged and 1469 + * replugged, or when receiving a resume packet. Send one once. */ 1470 + if (!host->resume_packet_sent && !nodemgr_send_resume_packet(host)) 1471 + host->resume_packet_sent = 1; 1472 1473 return 1; 1474 }