aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rapidio/rio-scan.c
diff options
context:
space:
mode:
authorAlexandre Bounine <alexandre.bounine@idt.com>2013-07-03 18:09:01 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-03 19:08:05 -0400
commit6ca40c2565fc617534d20d10a5848b626213608c (patch)
tree8d0ddc5543772647e232158d7f332a25b3291ae7 /drivers/rapidio/rio-scan.c
parented5edee2f8547d5c2b28de21cb1471aaea71ee0a (diff)
rapidio: change endpoint device name format
Change endpoint device name format to use a component tag value instead of device destination ID. RapidIO specification defines a component tag to be a unique identifier for devices in a network. RapidIO switches already use component tag as part of their device name and also use it for device identification when processing error management event notifications. Forming an endpoint's device name using its component tag instead of destination ID allows to keep sysfs device directories unchanged in case if a routing process dynamically changes endpoint's destination ID as a result of route optimization. This change should not affect any existing users because a valid device destination ID always should be obtained by reading "destid" attribute and not by parsing device name. This patch also removes switchid member from struct rio_switch because it simply duplicates the component tag and does not have other use than in device name generation. Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com> Cc: Matt Porter <mporter@kernel.crashing.org> Cc: Li Yang <leoli@freescale.com> Cc: Kumar Gala <galak@kernel.crashing.org> Cc: Andre van Herk <andre.van.herk@Prodrive.nl> Cc: Micha Nelissen <micha.nelissen@Prodrive.nl> Cc: Stef van Os <stef.van.os@Prodrive.nl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rapidio/rio-scan.c')
-rw-r--r--drivers/rapidio/rio-scan.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/rapidio/rio-scan.c b/drivers/rapidio/rio-scan.c
index ab837fdb2383..d3a6539a77cc 100644
--- a/drivers/rapidio/rio-scan.c
+++ b/drivers/rapidio/rio-scan.c
@@ -433,7 +433,6 @@ static struct rio_dev *rio_setup_device(struct rio_net *net,
433 /* If a PE has both switch and other functions, show it as a switch */ 433 /* If a PE has both switch and other functions, show it as a switch */
434 if (rio_is_switch(rdev)) { 434 if (rio_is_switch(rdev)) {
435 rswitch = rdev->rswitch; 435 rswitch = rdev->rswitch;
436 rswitch->switchid = rdev->comp_tag & RIO_CTAG_UDEVID;
437 rswitch->port_ok = 0; 436 rswitch->port_ok = 0;
438 spin_lock_init(&rswitch->lock); 437 spin_lock_init(&rswitch->lock);
439 rswitch->route_table = kzalloc(sizeof(u8)* 438 rswitch->route_table = kzalloc(sizeof(u8)*
@@ -446,7 +445,7 @@ static struct rio_dev *rio_setup_device(struct rio_net *net,
446 rdid++) 445 rdid++)
447 rswitch->route_table[rdid] = RIO_INVALID_ROUTE; 446 rswitch->route_table[rdid] = RIO_INVALID_ROUTE;
448 dev_set_name(&rdev->dev, "%02x:s:%04x", rdev->net->id, 447 dev_set_name(&rdev->dev, "%02x:s:%04x", rdev->net->id,
449 rswitch->switchid); 448 rdev->comp_tag & RIO_CTAG_UDEVID);
450 449
451 if (do_enum) 450 if (do_enum)
452 rio_route_clr_table(rdev, RIO_GLOBAL_TABLE, 0); 451 rio_route_clr_table(rdev, RIO_GLOBAL_TABLE, 0);
@@ -459,7 +458,7 @@ static struct rio_dev *rio_setup_device(struct rio_net *net,
459 rio_enable_rx_tx_port(port, 0, destid, hopcount, 0); 458 rio_enable_rx_tx_port(port, 0, destid, hopcount, 0);
460 459
461 dev_set_name(&rdev->dev, "%02x:e:%04x", rdev->net->id, 460 dev_set_name(&rdev->dev, "%02x:e:%04x", rdev->net->id,
462 rdev->destid); 461 rdev->comp_tag & RIO_CTAG_UDEVID);
463 } 462 }
464 463
465 rio_attach_device(rdev); 464 rio_attach_device(rdev);