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.h55
1 files changed, 45 insertions, 10 deletions
diff --git a/include/linux/rio.h b/include/linux/rio.h
index dc0c75556c63..bd6eb0ed34a7 100644
--- a/include/linux/rio.h
+++ b/include/linux/rio.h
@@ -64,10 +64,13 @@
64#define RIO_INB_MBOX_RESOURCE 1 64#define RIO_INB_MBOX_RESOURCE 1
65#define RIO_OUTB_MBOX_RESOURCE 2 65#define RIO_OUTB_MBOX_RESOURCE 2
66 66
67#define RIO_PW_MSG_SIZE 64
68
67extern struct bus_type rio_bus_type; 69extern struct bus_type rio_bus_type;
68extern struct list_head rio_devices; /* list of all devices */ 70extern struct list_head rio_devices; /* list of all devices */
69 71
70struct rio_mport; 72struct rio_mport;
73union rio_pw_msg;
71 74
72/** 75/**
73 * struct rio_dev - RIO device info 76 * struct rio_dev - RIO device info
@@ -85,11 +88,15 @@ struct rio_mport;
85 * @swpinfo: Switch port info 88 * @swpinfo: Switch port info
86 * @src_ops: Source operation capabilities 89 * @src_ops: Source operation capabilities
87 * @dst_ops: Destination operation capabilities 90 * @dst_ops: Destination operation capabilities
91 * @comp_tag: RIO component tag
92 * @phys_efptr: RIO device extended features pointer
93 * @em_efptr: RIO Error Management features pointer
88 * @dma_mask: Mask of bits of RIO address this device implements 94 * @dma_mask: Mask of bits of RIO address this device implements
89 * @rswitch: Pointer to &struct rio_switch if valid for this device 95 * @rswitch: Pointer to &struct rio_switch if valid for this device
90 * @driver: Driver claiming this device 96 * @driver: Driver claiming this device
91 * @dev: Device model device 97 * @dev: Device model device
92 * @riores: RIO resources this device owns 98 * @riores: RIO resources this device owns
99 * @pwcback: port-write callback function for this device
93 * @destid: Network destination ID 100 * @destid: Network destination ID
94 */ 101 */
95struct rio_dev { 102struct rio_dev {
@@ -107,11 +114,15 @@ struct rio_dev {
107 u32 swpinfo; /* Only used for switches */ 114 u32 swpinfo; /* Only used for switches */
108 u32 src_ops; 115 u32 src_ops;
109 u32 dst_ops; 116 u32 dst_ops;
117 u32 comp_tag;
118 u32 phys_efptr;
119 u32 em_efptr;
110 u64 dma_mask; 120 u64 dma_mask;
111 struct rio_switch *rswitch; /* RIO switch info */ 121 struct rio_switch *rswitch; /* RIO switch info */
112 struct rio_driver *driver; /* RIO driver claiming this device */ 122 struct rio_driver *driver; /* RIO driver claiming this device */
113 struct device dev; /* LDM device structure */ 123 struct device dev; /* LDM device structure */
114 struct resource riores[RIO_MAX_DEV_RESOURCES]; 124 struct resource riores[RIO_MAX_DEV_RESOURCES];
125 int (*pwcback) (struct rio_dev *rdev, union rio_pw_msg *msg, int step);
115 u16 destid; 126 u16 destid;
116}; 127};
117 128
@@ -211,8 +222,14 @@ struct rio_net {
211 * @hopcount: Hopcount to this switch 222 * @hopcount: Hopcount to this switch
212 * @destid: Associated destid in the path 223 * @destid: Associated destid in the path
213 * @route_table: Copy of switch routing table 224 * @route_table: Copy of switch routing table
225 * @port_ok: Status of each port (one bit per port) - OK=1 or UNINIT=0
214 * @add_entry: Callback for switch-specific route add function 226 * @add_entry: Callback for switch-specific route add function
215 * @get_entry: Callback for switch-specific route get function 227 * @get_entry: Callback for switch-specific route get function
228 * @clr_table: Callback for switch-specific clear route table function
229 * @set_domain: Callback for switch-specific domain setting function
230 * @get_domain: Callback for switch-specific domain get function
231 * @em_init: Callback for switch-specific error management initialization function
232 * @em_handle: Callback for switch-specific error management handler function
216 */ 233 */
217struct rio_switch { 234struct rio_switch {
218 struct list_head node; 235 struct list_head node;
@@ -220,10 +237,19 @@ struct rio_switch {
220 u16 hopcount; 237 u16 hopcount;
221 u16 destid; 238 u16 destid;
222 u8 *route_table; 239 u8 *route_table;
240 u32 port_ok;
223 int (*add_entry) (struct rio_mport * mport, u16 destid, u8 hopcount, 241 int (*add_entry) (struct rio_mport * mport, u16 destid, u8 hopcount,
224 u16 table, u16 route_destid, u8 route_port); 242 u16 table, u16 route_destid, u8 route_port);
225 int (*get_entry) (struct rio_mport * mport, u16 destid, u8 hopcount, 243 int (*get_entry) (struct rio_mport * mport, u16 destid, u8 hopcount,
226 u16 table, u16 route_destid, u8 * route_port); 244 u16 table, u16 route_destid, u8 * route_port);
245 int (*clr_table) (struct rio_mport *mport, u16 destid, u8 hopcount,
246 u16 table);
247 int (*set_domain) (struct rio_mport *mport, u16 destid, u8 hopcount,
248 u8 sw_domain);
249 int (*get_domain) (struct rio_mport *mport, u16 destid, u8 hopcount,
250 u8 *sw_domain);
251 int (*em_init) (struct rio_dev *dev);
252 int (*em_handle) (struct rio_dev *dev, u8 swport);
227}; 253};
228 254
229/* Low-level architecture-dependent routines */ 255/* Low-level architecture-dependent routines */
@@ -235,6 +261,7 @@ struct rio_switch {
235 * @cread: Callback to perform network read of config space. 261 * @cread: Callback to perform network read of config space.
236 * @cwrite: Callback to perform network write of config space. 262 * @cwrite: Callback to perform network write of config space.
237 * @dsend: Callback to send a doorbell message. 263 * @dsend: Callback to send a doorbell message.
264 * @pwenable: Callback to enable/disable port-write message handling.
238 */ 265 */
239struct rio_ops { 266struct rio_ops {
240 int (*lcread) (struct rio_mport *mport, int index, u32 offset, int len, 267 int (*lcread) (struct rio_mport *mport, int index, u32 offset, int len,
@@ -246,6 +273,7 @@ struct rio_ops {
246 int (*cwrite) (struct rio_mport *mport, int index, u16 destid, 273 int (*cwrite) (struct rio_mport *mport, int index, u16 destid,
247 u8 hopcount, u32 offset, int len, u32 data); 274 u8 hopcount, u32 offset, int len, u32 data);
248 int (*dsend) (struct rio_mport *mport, int index, u16 destid, u16 data); 275 int (*dsend) (struct rio_mport *mport, int index, u16 destid, u16 data);
276 int (*pwenable) (struct rio_mport *mport, int enable);
249}; 277};
250 278
251#define RIO_RESOURCE_MEM 0x00000100 279#define RIO_RESOURCE_MEM 0x00000100
@@ -302,21 +330,28 @@ struct rio_device_id {
302}; 330};
303 331
304/** 332/**
305 * struct rio_route_ops - Per-switch route operations 333 * struct rio_switch_ops - Per-switch operations
306 * @vid: RIO vendor ID 334 * @vid: RIO vendor ID
307 * @did: RIO device ID 335 * @did: RIO device ID
308 * @add_hook: Callback that adds a route entry 336 * @init_hook: Callback that performs switch device initialization
309 * @get_hook: Callback that gets a route entry
310 * 337 *
311 * Defines the operations that are necessary to manipulate the route 338 * Defines the operations that are necessary to initialize/control
312 * tables for a particular RIO switch device. 339 * a particular RIO switch device.
313 */ 340 */
314struct rio_route_ops { 341struct rio_switch_ops {
315 u16 vid, did; 342 u16 vid, did;
316 int (*add_hook) (struct rio_mport * mport, u16 destid, u8 hopcount, 343 int (*init_hook) (struct rio_dev *rdev, int do_enum);
317 u16 table, u16 route_destid, u8 route_port); 344};
318 int (*get_hook) (struct rio_mport * mport, u16 destid, u8 hopcount, 345
319 u16 table, u16 route_destid, u8 * route_port); 346union rio_pw_msg {
347 struct {
348 u32 comptag; /* Component Tag CSR */
349 u32 errdetect; /* Port N Error Detect CSR */
350 u32 is_port; /* Implementation specific + PortID */
351 u32 ltlerrdet; /* LTL Error Detect CSR */
352 u32 padding[12];
353 } em;
354 u32 raw[RIO_PW_MSG_SIZE/sizeof(u32)];
320}; 355};
321 356
322/* Architecture and hardware-specific functions */ 357/* Architecture and hardware-specific functions */