aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandre Bounine <alexandre.bounine@idt.com>2011-01-12 20:00:41 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-13 11:03:18 -0500
commit17e9620563e25e759e677508068305e5d6ce44ff (patch)
tree3b5ec7329e643418e358598384c563902e168c5b
parente6536927e64a2511864f2141d3e5b198b3f25ba6 (diff)
rapidio: add device object linking into discovery
Add setting links between rio_dev objects into the discovery process. This needed to report device connections on agent (non-host) processors that perform RIO discovery. Originally, these links have been introduced for enumerating host only to support error management. Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com> Cc: Kumar Gala <galak@kernel.crashing.org> Cc: Matt Porter <mporter@kernel.crashing.org> Cc: Li Yang <leoli@freescale.com> Cc: Thomas Moll <thomas.moll@sysgo.com> Cc: Micha Nelissen <micha@neli.hopto.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/rapidio/rio-scan.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/rapidio/rio-scan.c b/drivers/rapidio/rio-scan.c
index 45d14cd6b356..e655756e1185 100644
--- a/drivers/rapidio/rio-scan.c
+++ b/drivers/rapidio/rio-scan.c
@@ -947,7 +947,7 @@ static int rio_enum_complete(struct rio_mport *port)
947 */ 947 */
948static int __devinit 948static int __devinit
949rio_disc_peer(struct rio_net *net, struct rio_mport *port, u16 destid, 949rio_disc_peer(struct rio_net *net, struct rio_mport *port, u16 destid,
950 u8 hopcount) 950 u8 hopcount, struct rio_dev *prev, int prev_port)
951{ 951{
952 u8 port_num, route_port; 952 u8 port_num, route_port;
953 struct rio_dev *rdev; 953 struct rio_dev *rdev;
@@ -957,6 +957,9 @@ rio_disc_peer(struct rio_net *net, struct rio_mport *port, u16 destid,
957 if ((rdev = rio_setup_device(net, port, destid, hopcount, 0))) { 957 if ((rdev = rio_setup_device(net, port, destid, hopcount, 0))) {
958 /* Add device to the global and bus/net specific list. */ 958 /* Add device to the global and bus/net specific list. */
959 list_add_tail(&rdev->net_list, &net->devices); 959 list_add_tail(&rdev->net_list, &net->devices);
960 rdev->prev = prev;
961 if (prev && rio_is_switch(prev))
962 prev->rswitch->nextdev[prev_port] = rdev;
960 } else 963 } else
961 return -1; 964 return -1;
962 965
@@ -998,8 +1001,8 @@ rio_disc_peer(struct rio_net *net, struct rio_mport *port, u16 destid,
998 if (ndestid == RIO_ANY_DESTID(port->sys_size)) 1001 if (ndestid == RIO_ANY_DESTID(port->sys_size))
999 continue; 1002 continue;
1000 rio_unlock_device(port, destid, hopcount); 1003 rio_unlock_device(port, destid, hopcount);
1001 if (rio_disc_peer 1004 if (rio_disc_peer(net, port, ndestid,
1002 (net, port, ndestid, hopcount + 1) < 0) 1005 hopcount + 1, rdev, port_num) < 0)
1003 return -1; 1006 return -1;
1004 } 1007 }
1005 } 1008 }
@@ -1291,7 +1294,7 @@ int __devinit rio_disc_mport(struct rio_mport *mport)
1291 mport->host_deviceid); 1294 mport->host_deviceid);
1292 1295
1293 if (rio_disc_peer(net, mport, RIO_ANY_DESTID(mport->sys_size), 1296 if (rio_disc_peer(net, mport, RIO_ANY_DESTID(mport->sys_size),
1294 0) < 0) { 1297 0, NULL, 0) < 0) {
1295 printk(KERN_INFO 1298 printk(KERN_INFO
1296 "RIO: master port %d device has failed discovery\n", 1299 "RIO: master port %d device has failed discovery\n",
1297 mport->id); 1300 mport->id);