diff options
Diffstat (limited to 'include/linux/rio.h')
| -rw-r--r-- | include/linux/rio.h | 49 |
1 files changed, 39 insertions, 10 deletions
diff --git a/include/linux/rio.h b/include/linux/rio.h index dc0c75556c63..19b5f227096e 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 | |||
| 67 | extern struct bus_type rio_bus_type; | 69 | extern struct bus_type rio_bus_type; |
| 68 | extern struct list_head rio_devices; /* list of all devices */ | 70 | extern struct list_head rio_devices; /* list of all devices */ |
| 69 | 71 | ||
| 70 | struct rio_mport; | 72 | struct rio_mport; |
| 73 | union rio_pw_msg; | ||
| 71 | 74 | ||
| 72 | /** | 75 | /** |
| 73 | * struct rio_dev - RIO device info | 76 | * struct rio_dev - RIO device info |
| @@ -107,11 +110,15 @@ struct rio_dev { | |||
| 107 | u32 swpinfo; /* Only used for switches */ | 110 | u32 swpinfo; /* Only used for switches */ |
| 108 | u32 src_ops; | 111 | u32 src_ops; |
| 109 | u32 dst_ops; | 112 | u32 dst_ops; |
| 113 | u32 comp_tag; | ||
| 114 | u32 phys_efptr; | ||
| 115 | u32 em_efptr; | ||
| 110 | u64 dma_mask; | 116 | u64 dma_mask; |
| 111 | struct rio_switch *rswitch; /* RIO switch info */ | 117 | struct rio_switch *rswitch; /* RIO switch info */ |
| 112 | struct rio_driver *driver; /* RIO driver claiming this device */ | 118 | struct rio_driver *driver; /* RIO driver claiming this device */ |
| 113 | struct device dev; /* LDM device structure */ | 119 | struct device dev; /* LDM device structure */ |
| 114 | struct resource riores[RIO_MAX_DEV_RESOURCES]; | 120 | struct resource riores[RIO_MAX_DEV_RESOURCES]; |
| 121 | int (*pwcback) (struct rio_dev *rdev, union rio_pw_msg *msg, int step); | ||
| 115 | u16 destid; | 122 | u16 destid; |
| 116 | }; | 123 | }; |
| 117 | 124 | ||
| @@ -211,8 +218,12 @@ struct rio_net { | |||
| 211 | * @hopcount: Hopcount to this switch | 218 | * @hopcount: Hopcount to this switch |
| 212 | * @destid: Associated destid in the path | 219 | * @destid: Associated destid in the path |
| 213 | * @route_table: Copy of switch routing table | 220 | * @route_table: Copy of switch routing table |
| 221 | * @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 | 222 | * @add_entry: Callback for switch-specific route add function |
| 215 | * @get_entry: Callback for switch-specific route get function | 223 | * @get_entry: Callback for switch-specific route get function |
| 224 | * @clr_table: Callback for switch-specific clear route table function | ||
| 225 | * @em_init: Callback for switch-specific error management initialization function | ||
| 226 | * @em_handle: Callback for switch-specific error management handler function | ||
| 216 | */ | 227 | */ |
| 217 | struct rio_switch { | 228 | struct rio_switch { |
| 218 | struct list_head node; | 229 | struct list_head node; |
| @@ -220,10 +231,19 @@ struct rio_switch { | |||
| 220 | u16 hopcount; | 231 | u16 hopcount; |
| 221 | u16 destid; | 232 | u16 destid; |
| 222 | u8 *route_table; | 233 | u8 *route_table; |
| 234 | u32 port_ok; | ||
| 223 | int (*add_entry) (struct rio_mport * mport, u16 destid, u8 hopcount, | 235 | int (*add_entry) (struct rio_mport * mport, u16 destid, u8 hopcount, |
| 224 | u16 table, u16 route_destid, u8 route_port); | 236 | u16 table, u16 route_destid, u8 route_port); |
| 225 | int (*get_entry) (struct rio_mport * mport, u16 destid, u8 hopcount, | 237 | int (*get_entry) (struct rio_mport * mport, u16 destid, u8 hopcount, |
| 226 | u16 table, u16 route_destid, u8 * route_port); | 238 | u16 table, u16 route_destid, u8 * route_port); |
| 239 | int (*clr_table) (struct rio_mport *mport, u16 destid, u8 hopcount, | ||
| 240 | u16 table); | ||
| 241 | int (*set_domain) (struct rio_mport *mport, u16 destid, u8 hopcount, | ||
| 242 | u8 sw_domain); | ||
| 243 | int (*get_domain) (struct rio_mport *mport, u16 destid, u8 hopcount, | ||
| 244 | u8 *sw_domain); | ||
| 245 | int (*em_init) (struct rio_dev *dev); | ||
| 246 | int (*em_handle) (struct rio_dev *dev, u8 swport); | ||
| 227 | }; | 247 | }; |
| 228 | 248 | ||
| 229 | /* Low-level architecture-dependent routines */ | 249 | /* Low-level architecture-dependent routines */ |
| @@ -235,6 +255,7 @@ struct rio_switch { | |||
| 235 | * @cread: Callback to perform network read of config space. | 255 | * @cread: Callback to perform network read of config space. |
| 236 | * @cwrite: Callback to perform network write of config space. | 256 | * @cwrite: Callback to perform network write of config space. |
| 237 | * @dsend: Callback to send a doorbell message. | 257 | * @dsend: Callback to send a doorbell message. |
| 258 | * @pwenable: Callback to enable/disable port-write message handling. | ||
| 238 | */ | 259 | */ |
| 239 | struct rio_ops { | 260 | struct rio_ops { |
| 240 | int (*lcread) (struct rio_mport *mport, int index, u32 offset, int len, | 261 | int (*lcread) (struct rio_mport *mport, int index, u32 offset, int len, |
| @@ -246,6 +267,7 @@ struct rio_ops { | |||
| 246 | int (*cwrite) (struct rio_mport *mport, int index, u16 destid, | 267 | int (*cwrite) (struct rio_mport *mport, int index, u16 destid, |
| 247 | u8 hopcount, u32 offset, int len, u32 data); | 268 | u8 hopcount, u32 offset, int len, u32 data); |
| 248 | int (*dsend) (struct rio_mport *mport, int index, u16 destid, u16 data); | 269 | int (*dsend) (struct rio_mport *mport, int index, u16 destid, u16 data); |
| 270 | int (*pwenable) (struct rio_mport *mport, int enable); | ||
| 249 | }; | 271 | }; |
| 250 | 272 | ||
| 251 | #define RIO_RESOURCE_MEM 0x00000100 | 273 | #define RIO_RESOURCE_MEM 0x00000100 |
| @@ -302,21 +324,28 @@ struct rio_device_id { | |||
| 302 | }; | 324 | }; |
| 303 | 325 | ||
| 304 | /** | 326 | /** |
| 305 | * struct rio_route_ops - Per-switch route operations | 327 | * struct rio_switch_ops - Per-switch operations |
| 306 | * @vid: RIO vendor ID | 328 | * @vid: RIO vendor ID |
| 307 | * @did: RIO device ID | 329 | * @did: RIO device ID |
| 308 | * @add_hook: Callback that adds a route entry | 330 | * @init_hook: Callback that performs switch device initialization |
| 309 | * @get_hook: Callback that gets a route entry | ||
| 310 | * | 331 | * |
| 311 | * Defines the operations that are necessary to manipulate the route | 332 | * Defines the operations that are necessary to initialize/control |
| 312 | * tables for a particular RIO switch device. | 333 | * a particular RIO switch device. |
| 313 | */ | 334 | */ |
| 314 | struct rio_route_ops { | 335 | struct rio_switch_ops { |
| 315 | u16 vid, did; | 336 | u16 vid, did; |
| 316 | int (*add_hook) (struct rio_mport * mport, u16 destid, u8 hopcount, | 337 | int (*init_hook) (struct rio_dev *rdev, int do_enum); |
| 317 | u16 table, u16 route_destid, u8 route_port); | 338 | }; |
| 318 | int (*get_hook) (struct rio_mport * mport, u16 destid, u8 hopcount, | 339 | |
| 319 | u16 table, u16 route_destid, u8 * route_port); | 340 | union rio_pw_msg { |
| 341 | struct { | ||
| 342 | u32 comptag; /* Component Tag CSR */ | ||
| 343 | u32 errdetect; /* Port N Error Detect CSR */ | ||
| 344 | u32 is_port; /* Implementation specific + PortID */ | ||
| 345 | u32 ltlerrdet; /* LTL Error Detect CSR */ | ||
| 346 | u32 padding[12]; | ||
| 347 | } em; | ||
| 348 | u32 raw[RIO_PW_MSG_SIZE/sizeof(u32)]; | ||
| 320 | }; | 349 | }; |
| 321 | 350 | ||
| 322 | /* Architecture and hardware-specific functions */ | 351 | /* Architecture and hardware-specific functions */ |
