diff options
author | Alexandre Bounine <alexandre.bounine@idt.com> | 2010-05-26 14:43:57 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-27 09:12:50 -0700 |
commit | 07590ff03935a2efbc03bc7861f20c059576a479 (patch) | |
tree | 2da1ee2032e1425a138bc2864066a2e10533ce64 /drivers/rapidio/rio-scan.c | |
parent | f67231f80126f4e08c79c7b2056989c5c89ad4c6 (diff) | |
download | kernel_samsung_smdk4412-07590ff03935a2efbc03bc7861f20c059576a479.zip kernel_samsung_smdk4412-07590ff03935a2efbc03bc7861f20c059576a479.tar.gz kernel_samsung_smdk4412-07590ff03935a2efbc03bc7861f20c059576a479.tar.bz2 |
rapidio: add IDT CPS/TSI switches
Extentions to RapidIO switch support:
1. modify switch route operation declarations to allow using single
switch-specific file for family of switches that share the same route
table operations.
2. add standard route table operations for switches that that support
route table manipulation registers as defined in the Rev.1.3 of RapidIO
specification.
3. add clear-route-table operation for switches
4. add CPSxx and TSIxxx families of RapidIO switches
Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com>
Tested-by: Thomas Moll <thomas.moll@sysgo.com>
Cc: Matt Porter <mporter@kernel.crashing.org>
Cc: Li Yang <leoli@freescale.com>
Cc: Kumar Gala <galak@kernel.crashing.org>
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.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/drivers/rapidio/rio-scan.c b/drivers/rapidio/rio-scan.c index 4541509..7f1a675 100644 --- a/drivers/rapidio/rio-scan.c +++ b/drivers/rapidio/rio-scan.c @@ -55,6 +55,7 @@ static int rio_mport_phys_table[] = { static int rio_sport_phys_table[] = { RIO_EFB_PAR_EP_FREE_ID, RIO_EFB_SER_EP_FREE_ID, + RIO_EFB_SER_EP_FREC_ID, -1, }; @@ -246,10 +247,20 @@ static void rio_route_set_ops(struct rio_dev *rdev) pr_debug("RIO: adding routing ops for %s\n", rio_name(rdev)); rdev->rswitch->add_entry = cur->add_hook; rdev->rswitch->get_entry = cur->get_hook; + rdev->rswitch->clr_table = cur->clr_hook; + break; } cur++; } + if ((cur >= end) && (rdev->pef & RIO_PEF_STD_RT)) { + pr_debug("RIO: adding STD routing ops for %s\n", + rio_name(rdev)); + rdev->rswitch->add_entry = rio_std_route_add_entry; + rdev->rswitch->get_entry = rio_std_route_get_entry; + rdev->rswitch->clr_table = rio_std_route_clr_table; + } + if (!rdev->rswitch->add_entry || !rdev->rswitch->get_entry) printk(KERN_ERR "RIO: missing routing ops for %s\n", rio_name(rdev)); @@ -349,7 +360,7 @@ static struct rio_dev __devinit *rio_setup_device(struct rio_net *net, if (rio_is_switch(rdev)) { rio_mport_read_config_32(port, destid, hopcount, RIO_SWP_INFO_CAR, &rdev->swpinfo); - rswitch = kmalloc(sizeof(struct rio_switch), GFP_KERNEL); + rswitch = kzalloc(sizeof(struct rio_switch), GFP_KERNEL); if (!rswitch) goto cleanup; rswitch->switchid = next_switchid; @@ -369,6 +380,10 @@ static struct rio_dev __devinit *rio_setup_device(struct rio_net *net, rdev->rswitch->switchid); rio_route_set_ops(rdev); + if (do_enum && rdev->rswitch->clr_table) + rdev->rswitch->clr_table(port, destid, hopcount, + RIO_GLOBAL_TABLE); + list_add_tail(&rswitch->node, &rio_switches); } else @@ -866,6 +881,9 @@ static void rio_update_route_tables(struct rio_mport *port) continue; if (RIO_INVALID_ROUTE == rswitch->route_table[destid]) { + /* Skip if destid ends in empty switch*/ + if (rswitch->destid == destid) + continue; sport = rio_get_swpinfo_inport(port, rswitch->destid, rswitch->hopcount); |