aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/rio.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/rio.h')
-rw-r--r--include/linux/rio.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/include/linux/rio.h b/include/linux/rio.h
index bd6eb0ed34a7..0bed941f9b13 100644
--- a/include/linux/rio.h
+++ b/include/linux/rio.h
@@ -67,6 +67,7 @@
67#define RIO_PW_MSG_SIZE 64 67#define RIO_PW_MSG_SIZE 64
68 68
69extern struct bus_type rio_bus_type; 69extern struct bus_type rio_bus_type;
70extern struct device rio_bus;
70extern struct list_head rio_devices; /* list of all devices */ 71extern struct list_head rio_devices; /* list of all devices */
71 72
72struct rio_mport; 73struct rio_mport;
@@ -98,6 +99,7 @@ union rio_pw_msg;
98 * @riores: RIO resources this device owns 99 * @riores: RIO resources this device owns
99 * @pwcback: port-write callback function for this device 100 * @pwcback: port-write callback function for this device
100 * @destid: Network destination ID 101 * @destid: Network destination ID
102 * @prev: Previous RIO device connected to the current one
101 */ 103 */
102struct rio_dev { 104struct rio_dev {
103 struct list_head global_list; /* node in list of all RIO devices */ 105 struct list_head global_list; /* node in list of all RIO devices */
@@ -111,7 +113,7 @@ struct rio_dev {
111 u16 asm_rev; 113 u16 asm_rev;
112 u16 efptr; 114 u16 efptr;
113 u32 pef; 115 u32 pef;
114 u32 swpinfo; /* Only used for switches */ 116 u32 swpinfo;
115 u32 src_ops; 117 u32 src_ops;
116 u32 dst_ops; 118 u32 dst_ops;
117 u32 comp_tag; 119 u32 comp_tag;
@@ -124,6 +126,7 @@ struct rio_dev {
124 struct resource riores[RIO_MAX_DEV_RESOURCES]; 126 struct resource riores[RIO_MAX_DEV_RESOURCES];
125 int (*pwcback) (struct rio_dev *rdev, union rio_pw_msg *msg, int step); 127 int (*pwcback) (struct rio_dev *rdev, union rio_pw_msg *msg, int step);
126 u16 destid; 128 u16 destid;
129 struct rio_dev *prev;
127}; 130};
128 131
129#define rio_dev_g(n) list_entry(n, struct rio_dev, global_list) 132#define rio_dev_g(n) list_entry(n, struct rio_dev, global_list)
@@ -174,6 +177,7 @@ enum rio_phy_type {
174 * @index: Port index, unique among all port interfaces of the same type 177 * @index: Port index, unique among all port interfaces of the same type
175 * @sys_size: RapidIO common transport system size 178 * @sys_size: RapidIO common transport system size
176 * @phy_type: RapidIO phy type 179 * @phy_type: RapidIO phy type
180 * @phys_efptr: RIO port extended features pointer
177 * @name: Port name string 181 * @name: Port name string
178 * @priv: Master port private data 182 * @priv: Master port private data
179 */ 183 */
@@ -195,6 +199,7 @@ struct rio_mport {
195 * 1 - Large size, 65536 devices. 199 * 1 - Large size, 65536 devices.
196 */ 200 */
197 enum rio_phy_type phy_type; /* RapidIO phy type */ 201 enum rio_phy_type phy_type; /* RapidIO phy type */
202 u32 phys_efptr;
198 unsigned char name[40]; 203 unsigned char name[40];
199 void *priv; /* Master port private data */ 204 void *priv; /* Master port private data */
200}; 205};
@@ -215,9 +220,14 @@ struct rio_net {
215 unsigned char id; /* RIO network ID */ 220 unsigned char id; /* RIO network ID */
216}; 221};
217 222
223/* Definitions used by switch sysfs initialization callback */
224#define RIO_SW_SYSFS_CREATE 1 /* Create switch attributes */
225#define RIO_SW_SYSFS_REMOVE 0 /* Remove switch attributes */
226
218/** 227/**
219 * struct rio_switch - RIO switch info 228 * struct rio_switch - RIO switch info
220 * @node: Node in global list of switches 229 * @node: Node in global list of switches
230 * @rdev: Associated RIO device structure
221 * @switchid: Switch ID that is unique across a network 231 * @switchid: Switch ID that is unique across a network
222 * @hopcount: Hopcount to this switch 232 * @hopcount: Hopcount to this switch
223 * @destid: Associated destid in the path 233 * @destid: Associated destid in the path
@@ -230,9 +240,12 @@ struct rio_net {
230 * @get_domain: Callback for switch-specific domain get function 240 * @get_domain: Callback for switch-specific domain get function
231 * @em_init: Callback for switch-specific error management initialization function 241 * @em_init: Callback for switch-specific error management initialization function
232 * @em_handle: Callback for switch-specific error management handler function 242 * @em_handle: Callback for switch-specific error management handler function
243 * @sw_sysfs: Callback that initializes switch-specific sysfs attributes
244 * @nextdev: Array of per-port pointers to the next attached device
233 */ 245 */
234struct rio_switch { 246struct rio_switch {
235 struct list_head node; 247 struct list_head node;
248 struct rio_dev *rdev;
236 u16 switchid; 249 u16 switchid;
237 u16 hopcount; 250 u16 hopcount;
238 u16 destid; 251 u16 destid;
@@ -250,6 +263,8 @@ struct rio_switch {
250 u8 *sw_domain); 263 u8 *sw_domain);
251 int (*em_init) (struct rio_dev *dev); 264 int (*em_init) (struct rio_dev *dev);
252 int (*em_handle) (struct rio_dev *dev, u8 swport); 265 int (*em_handle) (struct rio_dev *dev, u8 swport);
266 int (*sw_sysfs) (struct rio_dev *dev, int create);
267 struct rio_dev *nextdev[0];
253}; 268};
254 269
255/* Low-level architecture-dependent routines */ 270/* Low-level architecture-dependent routines */