diff options
Diffstat (limited to 'drivers/rapidio/switches/idtcps.c')
-rw-r--r-- | drivers/rapidio/switches/idtcps.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/drivers/rapidio/switches/idtcps.c b/drivers/rapidio/switches/idtcps.c index 46e6630dacd3..73c3677e5ac6 100644 --- a/drivers/rapidio/switches/idtcps.c +++ b/drivers/rapidio/switches/idtcps.c | |||
@@ -17,6 +17,8 @@ | |||
17 | 17 | ||
18 | #define CPS_NO_ROUTE 0xdf | 18 | #define CPS_NO_ROUTE 0xdf |
19 | 19 | ||
20 | #define IDTCPS_RIO_DOMAIN 0xf20020 | ||
21 | |||
20 | static int | 22 | static int |
21 | idtcps_route_add_entry(struct rio_mport *mport, u16 destid, u8 hopcount, | 23 | idtcps_route_add_entry(struct rio_mport *mport, u16 destid, u8 hopcount, |
22 | u16 table, u16 route_destid, u8 route_port) | 24 | u16 table, u16 route_destid, u8 route_port) |
@@ -82,12 +84,43 @@ idtcps_route_clr_table(struct rio_mport *mport, u16 destid, u8 hopcount, | |||
82 | return 0; | 84 | return 0; |
83 | } | 85 | } |
84 | 86 | ||
87 | static int | ||
88 | idtcps_set_domain(struct rio_mport *mport, u16 destid, u8 hopcount, | ||
89 | u8 sw_domain) | ||
90 | { | ||
91 | /* | ||
92 | * Switch domain configuration operates only at global level | ||
93 | */ | ||
94 | rio_mport_write_config_32(mport, destid, hopcount, | ||
95 | IDTCPS_RIO_DOMAIN, (u32)sw_domain); | ||
96 | return 0; | ||
97 | } | ||
98 | |||
99 | static int | ||
100 | idtcps_get_domain(struct rio_mport *mport, u16 destid, u8 hopcount, | ||
101 | u8 *sw_domain) | ||
102 | { | ||
103 | u32 regval; | ||
104 | |||
105 | /* | ||
106 | * Switch domain configuration operates only at global level | ||
107 | */ | ||
108 | rio_mport_read_config_32(mport, destid, hopcount, | ||
109 | IDTCPS_RIO_DOMAIN, ®val); | ||
110 | |||
111 | *sw_domain = (u8)(regval & 0xff); | ||
112 | |||
113 | return 0; | ||
114 | } | ||
115 | |||
85 | static int idtcps_switch_init(struct rio_dev *rdev, int do_enum) | 116 | static int idtcps_switch_init(struct rio_dev *rdev, int do_enum) |
86 | { | 117 | { |
87 | pr_debug("RIO: %s for %s\n", __func__, rio_name(rdev)); | 118 | pr_debug("RIO: %s for %s\n", __func__, rio_name(rdev)); |
88 | rdev->rswitch->add_entry = idtcps_route_add_entry; | 119 | rdev->rswitch->add_entry = idtcps_route_add_entry; |
89 | rdev->rswitch->get_entry = idtcps_route_get_entry; | 120 | rdev->rswitch->get_entry = idtcps_route_get_entry; |
90 | rdev->rswitch->clr_table = idtcps_route_clr_table; | 121 | rdev->rswitch->clr_table = idtcps_route_clr_table; |
122 | rdev->rswitch->set_domain = idtcps_set_domain; | ||
123 | rdev->rswitch->get_domain = idtcps_get_domain; | ||
91 | rdev->rswitch->em_init = NULL; | 124 | rdev->rswitch->em_init = NULL; |
92 | rdev->rswitch->em_handle = NULL; | 125 | rdev->rswitch->em_handle = NULL; |
93 | 126 | ||