aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rapidio/rio-scan.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rapidio/rio-scan.c')
-rw-r--r--drivers/rapidio/rio-scan.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/rapidio/rio-scan.c b/drivers/rapidio/rio-scan.c
index e655756e1185..467e82bd0929 100644
--- a/drivers/rapidio/rio-scan.c
+++ b/drivers/rapidio/rio-scan.c
@@ -46,7 +46,6 @@ static void rio_init_em(struct rio_dev *rdev);
46DEFINE_SPINLOCK(rio_global_list_lock); 46DEFINE_SPINLOCK(rio_global_list_lock);
47 47
48static int next_destid = 0; 48static int next_destid = 0;
49static int next_switchid = 0;
50static int next_net = 0; 49static int next_net = 0;
51static int next_comptag = 1; 50static int next_comptag = 1;
52 51
@@ -438,6 +437,10 @@ static struct rio_dev __devinit *rio_setup_device(struct rio_net *net,
438 rio_mport_write_config_32(port, destid, hopcount, 437 rio_mport_write_config_32(port, destid, hopcount,
439 RIO_COMPONENT_TAG_CSR, next_comptag); 438 RIO_COMPONENT_TAG_CSR, next_comptag);
440 rdev->comp_tag = next_comptag++; 439 rdev->comp_tag = next_comptag++;
440 } else {
441 rio_mport_read_config_32(port, destid, hopcount,
442 RIO_COMPONENT_TAG_CSR,
443 &rdev->comp_tag);
441 } 444 }
442 445
443 if (rio_device_has_destid(port, rdev->src_ops, rdev->dst_ops)) { 446 if (rio_device_has_destid(port, rdev->src_ops, rdev->dst_ops)) {
@@ -461,7 +464,7 @@ static struct rio_dev __devinit *rio_setup_device(struct rio_net *net,
461 /* If a PE has both switch and other functions, show it as a switch */ 464 /* If a PE has both switch and other functions, show it as a switch */
462 if (rio_is_switch(rdev)) { 465 if (rio_is_switch(rdev)) {
463 rswitch = rdev->rswitch; 466 rswitch = rdev->rswitch;
464 rswitch->switchid = next_switchid; 467 rswitch->switchid = rdev->comp_tag & RIO_CTAG_UDEVID;
465 rswitch->port_ok = 0; 468 rswitch->port_ok = 0;
466 rswitch->route_table = kzalloc(sizeof(u8)* 469 rswitch->route_table = kzalloc(sizeof(u8)*
467 RIO_MAX_ROUTE_ENTRIES(port->sys_size), 470 RIO_MAX_ROUTE_ENTRIES(port->sys_size),
@@ -816,7 +819,6 @@ static int __devinit rio_enum_peer(struct rio_net *net, struct rio_mport *port,
816 return -1; 819 return -1;
817 820
818 if (rio_is_switch(rdev)) { 821 if (rio_is_switch(rdev)) {
819 next_switchid++;
820 sw_inport = RIO_GET_PORT_NUM(rdev->swpinfo); 822 sw_inport = RIO_GET_PORT_NUM(rdev->swpinfo);
821 rio_route_add_entry(rdev, RIO_GLOBAL_TABLE, 823 rio_route_add_entry(rdev, RIO_GLOBAL_TABLE,
822 port->host_deviceid, sw_inport, 0); 824 port->host_deviceid, sw_inport, 0);
@@ -964,8 +966,6 @@ rio_disc_peer(struct rio_net *net, struct rio_mport *port, u16 destid,
964 return -1; 966 return -1;
965 967
966 if (rio_is_switch(rdev)) { 968 if (rio_is_switch(rdev)) {
967 next_switchid++;
968
969 /* Associated destid is how we accessed this switch */ 969 /* Associated destid is how we accessed this switch */
970 rdev->destid = destid; 970 rdev->destid = destid;
971 971