forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rapidio: modify initialization of switch operations
Modify the way how RapidIO switch operations are declared. Multiple assignments through the linker script replaced by single initialization call. Signed-off-by: Alexandre Bounine <[email protected]> Cc: Matt Porter <[email protected]> Cc: Li Yang <[email protected]> Cc: Kumar Gala <[email protected]> Cc: Thomas Moll <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
- Loading branch information
Showing
8 changed files
with
111 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
/* | ||
* IDT CPS RapidIO switches support | ||
* | ||
* Copyright 2009 Integrated Device Technology, Inc. | ||
* Copyright 2009-2010 Integrated Device Technology, Inc. | ||
* Alexandre Bounine <[email protected]> | ||
* | ||
* This program is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License as published by the | ||
|
@@ -81,9 +82,21 @@ idtcps_route_clr_table(struct rio_mport *mport, u16 destid, u8 hopcount, | |
return 0; | ||
} | ||
|
||
DECLARE_RIO_ROUTE_OPS(RIO_VID_IDT, RIO_DID_IDTCPS6Q, idtcps_route_add_entry, idtcps_route_get_entry, idtcps_route_clr_table); | ||
DECLARE_RIO_ROUTE_OPS(RIO_VID_IDT, RIO_DID_IDTCPS8, idtcps_route_add_entry, idtcps_route_get_entry, idtcps_route_clr_table); | ||
DECLARE_RIO_ROUTE_OPS(RIO_VID_IDT, RIO_DID_IDTCPS10Q, idtcps_route_add_entry, idtcps_route_get_entry, idtcps_route_clr_table); | ||
DECLARE_RIO_ROUTE_OPS(RIO_VID_IDT, RIO_DID_IDTCPS12, idtcps_route_add_entry, idtcps_route_get_entry, idtcps_route_clr_table); | ||
DECLARE_RIO_ROUTE_OPS(RIO_VID_IDT, RIO_DID_IDTCPS16, idtcps_route_add_entry, idtcps_route_get_entry, idtcps_route_clr_table); | ||
DECLARE_RIO_ROUTE_OPS(RIO_VID_IDT, RIO_DID_IDT70K200, idtcps_route_add_entry, idtcps_route_get_entry, idtcps_route_clr_table); | ||
static int idtcps_switch_init(struct rio_dev *rdev, int do_enum) | ||
{ | ||
pr_debug("RIO: %s for %s\n", __func__, rio_name(rdev)); | ||
rdev->rswitch->add_entry = idtcps_route_add_entry; | ||
rdev->rswitch->get_entry = idtcps_route_get_entry; | ||
rdev->rswitch->clr_table = idtcps_route_clr_table; | ||
rdev->rswitch->em_init = NULL; | ||
rdev->rswitch->em_handle = NULL; | ||
|
||
return 0; | ||
} | ||
|
||
DECLARE_RIO_SWITCH_INIT(RIO_VID_IDT, RIO_DID_IDTCPS6Q, idtcps_switch_init); | ||
DECLARE_RIO_SWITCH_INIT(RIO_VID_IDT, RIO_DID_IDTCPS8, idtcps_switch_init); | ||
DECLARE_RIO_SWITCH_INIT(RIO_VID_IDT, RIO_DID_IDTCPS10Q, idtcps_switch_init); | ||
DECLARE_RIO_SWITCH_INIT(RIO_VID_IDT, RIO_DID_IDTCPS12, idtcps_switch_init); | ||
DECLARE_RIO_SWITCH_INIT(RIO_VID_IDT, RIO_DID_IDTCPS16, idtcps_switch_init); | ||
DECLARE_RIO_SWITCH_INIT(RIO_VID_IDT, RIO_DID_IDT70K200, idtcps_switch_init); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
/* | ||
* RapidIO Tsi500 switch support | ||
* | ||
* Copyright 2009-2010 Integrated Device Technology, Inc. | ||
* Alexandre Bounine <[email protected]> | ||
* - Modified switch operations initialization. | ||
* | ||
* Copyright 2005 MontaVista Software, Inc. | ||
* Matt Porter <[email protected]> | ||
* | ||
|
@@ -57,4 +61,16 @@ tsi500_route_get_entry(struct rio_mport *mport, u16 destid, u8 hopcount, u16 tab | |
return ret; | ||
} | ||
|
||
DECLARE_RIO_ROUTE_OPS(RIO_VID_TUNDRA, RIO_DID_TSI500, tsi500_route_add_entry, tsi500_route_get_entry, NULL); | ||
static int tsi500_switch_init(struct rio_dev *rdev, int do_enum) | ||
{ | ||
pr_debug("RIO: %s for %s\n", __func__, rio_name(rdev)); | ||
rdev->rswitch->add_entry = tsi500_route_add_entry; | ||
rdev->rswitch->get_entry = tsi500_route_get_entry; | ||
rdev->rswitch->clr_table = NULL; | ||
rdev->rswitch->em_init = NULL; | ||
rdev->rswitch->em_handle = NULL; | ||
|
||
return 0; | ||
} | ||
|
||
DECLARE_RIO_SWITCH_INIT(RIO_VID_TUNDRA, RIO_DID_TSI500, tsi500_switch_init); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,10 @@ | |
* RapidIO Tsi568 switch support | ||
* | ||
* Copyright 2009-2010 Integrated Device Technology, Inc. | ||
* Alexandre Bounine <[email protected]> | ||
* - Added EM support | ||
* - Modified switch operations initialization. | ||
* | ||
* Copyright 2005 MontaVista Software, Inc. | ||
* Matt Porter <[email protected]> | ||
* | ||
|
@@ -106,8 +110,6 @@ tsi568_route_clr_table(struct rio_mport *mport, u16 destid, u8 hopcount, | |
return 0; | ||
} | ||
|
||
DECLARE_RIO_ROUTE_OPS(RIO_VID_TUNDRA, RIO_DID_TSI568, tsi568_route_add_entry, tsi568_route_get_entry, tsi568_route_clr_table); | ||
|
||
static int | ||
tsi568_em_init(struct rio_dev *rdev) | ||
{ | ||
|
@@ -127,4 +129,16 @@ tsi568_em_init(struct rio_dev *rdev) | |
return 0; | ||
} | ||
|
||
DECLARE_RIO_EM_OPS(RIO_VID_TUNDRA, RIO_DID_TSI568, tsi568_em_init, NULL); | ||
static int tsi568_switch_init(struct rio_dev *rdev, int do_enum) | ||
{ | ||
pr_debug("RIO: %s for %s\n", __func__, rio_name(rdev)); | ||
rdev->rswitch->add_entry = tsi568_route_add_entry; | ||
rdev->rswitch->get_entry = tsi568_route_get_entry; | ||
rdev->rswitch->clr_table = tsi568_route_clr_table; | ||
rdev->rswitch->em_init = tsi568_em_init; | ||
rdev->rswitch->em_handle = NULL; | ||
|
||
return 0; | ||
} | ||
|
||
DECLARE_RIO_SWITCH_INIT(RIO_VID_TUNDRA, RIO_DID_TSI568, tsi568_switch_init); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
/* | ||
* RapidIO Tsi57x switch family support | ||
* | ||
* Copyright 2009 Integrated Device Technology, Inc. | ||
* Copyright 2009-2010 Integrated Device Technology, Inc. | ||
* Alexandre Bounine <[email protected]> | ||
* - Added EM support | ||
* - Modified switch operations initialization. | ||
* | ||
* Copyright 2005 MontaVista Software, Inc. | ||
* Matt Porter <[email protected]> | ||
* | ||
|
@@ -108,11 +112,6 @@ tsi57x_route_clr_table(struct rio_mport *mport, u16 destid, u8 hopcount, | |
return 0; | ||
} | ||
|
||
DECLARE_RIO_ROUTE_OPS(RIO_VID_TUNDRA, RIO_DID_TSI572, tsi57x_route_add_entry, tsi57x_route_get_entry, tsi57x_route_clr_table); | ||
DECLARE_RIO_ROUTE_OPS(RIO_VID_TUNDRA, RIO_DID_TSI574, tsi57x_route_add_entry, tsi57x_route_get_entry, tsi57x_route_clr_table); | ||
DECLARE_RIO_ROUTE_OPS(RIO_VID_TUNDRA, RIO_DID_TSI577, tsi57x_route_add_entry, tsi57x_route_get_entry, tsi57x_route_clr_table); | ||
DECLARE_RIO_ROUTE_OPS(RIO_VID_TUNDRA, RIO_DID_TSI578, tsi57x_route_add_entry, tsi57x_route_get_entry, tsi57x_route_clr_table); | ||
|
||
static int | ||
tsi57x_em_init(struct rio_dev *rdev) | ||
{ | ||
|
@@ -253,7 +252,19 @@ tsi57x_em_handler(struct rio_dev *rdev, u8 portnum) | |
return 0; | ||
} | ||
|
||
DECLARE_RIO_EM_OPS(RIO_VID_TUNDRA, RIO_DID_TSI572, tsi57x_em_init, tsi57x_em_handler); | ||
DECLARE_RIO_EM_OPS(RIO_VID_TUNDRA, RIO_DID_TSI574, tsi57x_em_init, tsi57x_em_handler); | ||
DECLARE_RIO_EM_OPS(RIO_VID_TUNDRA, RIO_DID_TSI577, tsi57x_em_init, tsi57x_em_handler); | ||
DECLARE_RIO_EM_OPS(RIO_VID_TUNDRA, RIO_DID_TSI578, tsi57x_em_init, tsi57x_em_handler); | ||
static int tsi57x_switch_init(struct rio_dev *rdev, int do_enum) | ||
{ | ||
pr_debug("RIO: %s for %s\n", __func__, rio_name(rdev)); | ||
rdev->rswitch->add_entry = tsi57x_route_add_entry; | ||
rdev->rswitch->get_entry = tsi57x_route_get_entry; | ||
rdev->rswitch->clr_table = tsi57x_route_clr_table; | ||
rdev->rswitch->em_init = tsi57x_em_init; | ||
rdev->rswitch->em_handle = tsi57x_em_handler; | ||
|
||
return 0; | ||
} | ||
|
||
DECLARE_RIO_SWITCH_INIT(RIO_VID_TUNDRA, RIO_DID_TSI572, tsi57x_switch_init); | ||
DECLARE_RIO_SWITCH_INIT(RIO_VID_TUNDRA, RIO_DID_TSI574, tsi57x_switch_init); | ||
DECLARE_RIO_SWITCH_INIT(RIO_VID_TUNDRA, RIO_DID_TSI577, tsi57x_switch_init); | ||
DECLARE_RIO_SWITCH_INIT(RIO_VID_TUNDRA, RIO_DID_TSI578, tsi57x_switch_init); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters