From 647dcb5fae0ebb5da1272ed2773df0d3f152c303 Mon Sep 17 00:00:00 2001 From: Ben Collins Date: Mon, 12 Jun 2006 18:12:37 -0400 Subject: ieee1394: support for slow links or slow 1394b phy ports Add support for the following types of hardware: + nodes that have a link speed < PHY speed + 1394b PHYs that are less than S800 capable + 1394b/1394a adapter cable between two 1394b PHYs Also, S1600 and S3200 are now supported if IEEE1394_SPEED_MAX is raised. A probing function is added to nodemgr's config ROM fetching routine which adjusts the allowable speed if an access problem was encountered. Pros and Cons of the approach: + minimum code footprint to support this less widely used hardware + nearly no overhead for unaffected hardware - ineffective before nodemgr began to read the ROM of affected nodes - ineffective if ieee1394 is loaded with disable_nodemgr=1 The speed map CSRs which are published to the bus are not touched by the patch. Signed-off-by: Stefan Richter Cc: Hakan Ardo Cc: Calculex Cc: Robert J. Kosinski Signed-off-by: Ben Collins --- drivers/ieee1394/ieee1394_core.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'drivers/ieee1394/ieee1394_core.c') diff --git a/drivers/ieee1394/ieee1394_core.c b/drivers/ieee1394/ieee1394_core.c index be6854e25ad..c83e2b8295e 100644 --- a/drivers/ieee1394/ieee1394_core.c +++ b/drivers/ieee1394/ieee1394_core.c @@ -285,9 +285,9 @@ static int check_selfids(struct hpsb_host *host) static void build_speed_map(struct hpsb_host *host, int nodecount) { - u8 speedcap[nodecount]; u8 cldcnt[nodecount]; u8 *map = host->speed_map; + u8 *speedcap = host->speed; struct selfid *sid; struct ext_selfid *esid; int i, j, n; @@ -354,6 +354,11 @@ static void build_speed_map(struct hpsb_host *host, int nodecount) } } } + + /* assume maximum speed for 1394b PHYs, nodemgr will correct it */ + for (n = 0; n < nodecount; n++) + if (speedcap[n] == 3) + speedcap[n] = IEEE1394_SPEED_MAX; } @@ -554,11 +559,10 @@ int hpsb_send_packet(struct hpsb_packet *packet) return 0; } - if (packet->type == hpsb_async && packet->node_id != ALL_NODES) { + if (packet->type == hpsb_async && + NODEID_TO_NODE(packet->node_id) != ALL_NODES) packet->speed_code = - host->speed_map[NODEID_TO_NODE(host->node_id) * 64 - + NODEID_TO_NODE(packet->node_id)]; - } + host->speed[NODEID_TO_NODE(packet->node_id)]; dump_packet("send packet", packet->header, packet->header_size, packet->speed_code); -- cgit v1.2.3