aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2006-07-02 18:58:01 -0400
committerBen Collins <bcollins@ubuntu.com>2006-07-03 00:03:59 -0400
commitd7530a1e767b562c7e071f559d542c132d85fff7 (patch)
treef607e05022d084fd50ea44f794f33edc49fc14ed
parent29454dde27d8e340bb1987bad9aa504af7081eba (diff)
[PATCH] ieee1394: fix cosmetic problem in speed probe
If ieee1394.h::IEEE1394_SPEED_MAX is bigger than the actual speed of an 1394b host adapter and the speed to another 1394b node was probed, a bigger speed than actually used was kept in host->speed[n]. The only resulting problem so far was sbp2 displaying bogus values in the syslog, e.g. S3200 for actual S800 connections if IEEE1394_SPEED_MAX was S3200. But other high-level drivers which access this field could get into more trouble. (Eth1394 is the only other in-tree driver which does so. It seems it is not affected.) Nodemgr now clips this value according to the host adapter's link speed. A pointer expression in nodemgr_check_speed is also changed for clarity. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Ben Collins <bcollins@ubuntu.com>
-rw-r--r--drivers/ieee1394/nodemgr.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c
index d541b508a159..dfed2ed2ed99 100644
--- a/drivers/ieee1394/nodemgr.c
+++ b/drivers/ieee1394/nodemgr.c
@@ -71,7 +71,7 @@ static int nodemgr_check_speed(struct nodemgr_csr_info *ci, u64 addr,
71 u8 i, *speed, old_speed, good_speed; 71 u8 i, *speed, old_speed, good_speed;
72 int ret; 72 int ret;
73 73
74 speed = ci->host->speed + NODEID_TO_NODE(ci->nodeid); 74 speed = &(ci->host->speed[NODEID_TO_NODE(ci->nodeid)]);
75 old_speed = *speed; 75 old_speed = *speed;
76 good_speed = IEEE1394_SPEED_MAX + 1; 76 good_speed = IEEE1394_SPEED_MAX + 1;
77 77
@@ -1251,6 +1251,7 @@ static void nodemgr_node_scan_one(struct host_info *hi,
1251 octlet_t guid; 1251 octlet_t guid;
1252 struct csr1212_csr *csr; 1252 struct csr1212_csr *csr;
1253 struct nodemgr_csr_info *ci; 1253 struct nodemgr_csr_info *ci;
1254 u8 *speed;
1254 1255
1255 ci = kmalloc(sizeof(*ci), GFP_KERNEL); 1256 ci = kmalloc(sizeof(*ci), GFP_KERNEL);
1256 if (!ci) 1257 if (!ci)
@@ -1259,8 +1260,12 @@ static void nodemgr_node_scan_one(struct host_info *hi,
1259 ci->host = host; 1260 ci->host = host;
1260 ci->nodeid = nodeid; 1261 ci->nodeid = nodeid;
1261 ci->generation = generation; 1262 ci->generation = generation;
1262 ci->speed_unverified = 1263
1263 host->speed[NODEID_TO_NODE(nodeid)] > IEEE1394_SPEED_100; 1264 /* Prepare for speed probe which occurs when reading the ROM */
1265 speed = &(host->speed[NODEID_TO_NODE(nodeid)]);
1266 if (*speed > host->csr.lnk_spd)
1267 *speed = host->csr.lnk_spd;
1268 ci->speed_unverified = *speed > IEEE1394_SPEED_100;
1264 1269
1265 /* We need to detect when the ConfigROM's generation has changed, 1270 /* We need to detect when the ConfigROM's generation has changed,
1266 * so we only update the node's info when it needs to be. */ 1271 * so we only update the node's info when it needs to be. */
@@ -1300,8 +1305,6 @@ static void nodemgr_node_scan_one(struct host_info *hi,
1300 nodemgr_create_node(guid, csr, hi, nodeid, generation); 1305 nodemgr_create_node(guid, csr, hi, nodeid, generation);
1301 else 1306 else
1302 nodemgr_update_node(ne, csr, hi, nodeid, generation); 1307 nodemgr_update_node(ne, csr, hi, nodeid, generation);
1303
1304 return;
1305} 1308}
1306 1309
1307 1310