rapidio: add relation links between RIO device structures
[pandora-kernel.git] / include / linux / rio.h
index bd6eb0e..8d9e66d 100644 (file)
@@ -67,6 +67,7 @@
 #define RIO_PW_MSG_SIZE                64
 
 extern struct bus_type rio_bus_type;
+extern struct device rio_bus;
 extern struct list_head rio_devices;   /* list of all devices */
 
 struct rio_mport;
@@ -98,6 +99,7 @@ union rio_pw_msg;
  * @riores: RIO resources this device owns
  * @pwcback: port-write callback function for this device
  * @destid: Network destination ID
+ * @prev: Previous RIO device connected to the current one
  */
 struct rio_dev {
        struct list_head global_list;   /* node in list of all RIO devices */
@@ -111,7 +113,7 @@ struct rio_dev {
        u16 asm_rev;
        u16 efptr;
        u32 pef;
-       u32 swpinfo;            /* Only used for switches */
+       u32 swpinfo;
        u32 src_ops;
        u32 dst_ops;
        u32 comp_tag;
@@ -124,6 +126,7 @@ struct rio_dev {
        struct resource riores[RIO_MAX_DEV_RESOURCES];
        int (*pwcback) (struct rio_dev *rdev, union rio_pw_msg *msg, int step);
        u16 destid;
+       struct rio_dev *prev;
 };
 
 #define rio_dev_g(n) list_entry(n, struct rio_dev, global_list)
@@ -218,6 +221,7 @@ struct rio_net {
 /**
  * struct rio_switch - RIO switch info
  * @node: Node in global list of switches
+ * @rdev: Associated RIO device structure
  * @switchid: Switch ID that is unique across a network
  * @hopcount: Hopcount to this switch
  * @destid: Associated destid in the path
@@ -230,9 +234,11 @@ struct rio_net {
  * @get_domain: Callback for switch-specific domain get function
  * @em_init: Callback for switch-specific error management initialization function
  * @em_handle: Callback for switch-specific error management handler function
+ * @nextdev: Array of per-port pointers to the next attached device
  */
 struct rio_switch {
        struct list_head node;
+       struct rio_dev *rdev;
        u16 switchid;
        u16 hopcount;
        u16 destid;
@@ -250,6 +256,7 @@ struct rio_switch {
                           u8 *sw_domain);
        int (*em_init) (struct rio_dev *dev);
        int (*em_handle) (struct rio_dev *dev, u8 swport);
+       struct rio_dev *nextdev[0];
 };
 
 /* Low-level architecture-dependent routines */