rapidio: fix new kernel-doc warnings
[pandora-kernel.git] / include / linux / rio.h
index 68e3f68..bd6eb0e 100644 (file)
@@ -14,8 +14,6 @@
 #ifndef LINUX_RIO_H
 #define LINUX_RIO_H
 
-#ifdef __KERNEL__
-
 #include <linux/types.h>
 #include <linux/ioport.h>
 #include <linux/list.h>
@@ -23,7 +21,6 @@
 #include <linux/device.h>
 #include <linux/rio_regs.h>
 
-#define RIO_ANY_DESTID         0xff
 #define RIO_NO_HOPCOUNT                -1
 #define RIO_INVALID_DESTID     0xffff
 
                                           entry is invalid (no route
                                           exists for the device ID) */
 
-#ifdef CONFIG_RAPIDIO_8_BIT_TRANSPORT
-#define RIO_MAX_ROUTE_ENTRIES  (1 << 8)
-#else
-#define RIO_MAX_ROUTE_ENTRIES  (1 << 16)
-#endif
+#define RIO_MAX_ROUTE_ENTRIES(size)    (size ? (1 << 16) : (1 << 8))
+#define RIO_ANY_DESTID(size)           (size ? 0xffff : 0xff)
 
 #define RIO_MAX_MBOX           4
 #define RIO_MAX_MSG_SIZE       0x1000
 #define RIO_INB_MBOX_RESOURCE  1
 #define RIO_OUTB_MBOX_RESOURCE 2
 
+#define RIO_PW_MSG_SIZE                64
+
 extern struct bus_type rio_bus_type;
 extern struct list_head rio_devices;   /* list of all devices */
 
 struct rio_mport;
+union rio_pw_msg;
 
 /**
  * struct rio_dev - RIO device info
@@ -91,11 +88,15 @@ struct rio_mport;
  * @swpinfo: Switch port info
  * @src_ops: Source operation capabilities
  * @dst_ops: Destination operation capabilities
+ * @comp_tag: RIO component tag
+ * @phys_efptr: RIO device extended features pointer
+ * @em_efptr: RIO Error Management features pointer
  * @dma_mask: Mask of bits of RIO address this device implements
  * @rswitch: Pointer to &struct rio_switch if valid for this device
  * @driver: Driver claiming this device
  * @dev: Device model device
  * @riores: RIO resources this device owns
+ * @pwcback: port-write callback function for this device
  * @destid: Network destination ID
  */
 struct rio_dev {
@@ -113,11 +114,15 @@ struct rio_dev {
        u32 swpinfo;            /* Only used for switches */
        u32 src_ops;
        u32 dst_ops;
+       u32 comp_tag;
+       u32 phys_efptr;
+       u32 em_efptr;
        u64 dma_mask;
        struct rio_switch *rswitch;     /* RIO switch info */
        struct rio_driver *driver;      /* RIO driver claiming this device */
        struct device dev;      /* LDM device structure */
        struct resource riores[RIO_MAX_DEV_RESOURCES];
+       int (*pwcback) (struct rio_dev *rdev, union rio_pw_msg *msg, int step);
        u16 destid;
 };
 
@@ -149,6 +154,11 @@ struct rio_dbell {
        void *dev_id;
 };
 
+enum rio_phy_type {
+       RIO_PHY_PARALLEL,
+       RIO_PHY_SERIAL,
+};
+
 /**
  * struct rio_mport - RIO master port info
  * @dbells: List of doorbell events
@@ -162,7 +172,10 @@ struct rio_dbell {
  * @ops: configuration space functions
  * @id: Port ID, unique among all ports
  * @index: Port index, unique among all port interfaces of the same type
+ * @sys_size: RapidIO common transport system size
+ * @phy_type: RapidIO phy type
  * @name: Port name string
+ * @priv: Master port private data
  */
 struct rio_mport {
        struct list_head dbells;        /* list of doorbell events */
@@ -177,7 +190,13 @@ struct rio_mport {
        unsigned char id;       /* port ID, unique among all ports */
        unsigned char index;    /* port index, unique among all port
                                   interfaces of the same type */
+       unsigned int sys_size;  /* RapidIO common transport system size.
+                                * 0 - Small size. 256 devices.
+                                * 1 - Large size, 65536 devices.
+                                */
+       enum rio_phy_type phy_type;     /* RapidIO phy type */
        unsigned char name[40];
+       void *priv;             /* Master port private data */
 };
 
 /**
@@ -203,19 +222,34 @@ struct rio_net {
  * @hopcount: Hopcount to this switch
  * @destid: Associated destid in the path
  * @route_table: Copy of switch routing table
+ * @port_ok: Status of each port (one bit per port) - OK=1 or UNINIT=0
  * @add_entry: Callback for switch-specific route add function
  * @get_entry: Callback for switch-specific route get function
+ * @clr_table: Callback for switch-specific clear route table function
+ * @set_domain: Callback for switch-specific domain setting function
+ * @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
  */
 struct rio_switch {
        struct list_head node;
        u16 switchid;
        u16 hopcount;
        u16 destid;
-       u8 route_table[RIO_MAX_ROUTE_ENTRIES];
+       u8 *route_table;
+       u32 port_ok;
        int (*add_entry) (struct rio_mport * mport, u16 destid, u8 hopcount,
                          u16 table, u16 route_destid, u8 route_port);
        int (*get_entry) (struct rio_mport * mport, u16 destid, u8 hopcount,
                          u16 table, u16 route_destid, u8 * route_port);
+       int (*clr_table) (struct rio_mport *mport, u16 destid, u8 hopcount,
+                         u16 table);
+       int (*set_domain) (struct rio_mport *mport, u16 destid, u8 hopcount,
+                          u8 sw_domain);
+       int (*get_domain) (struct rio_mport *mport, u16 destid, u8 hopcount,
+                          u8 *sw_domain);
+       int (*em_init) (struct rio_dev *dev);
+       int (*em_handle) (struct rio_dev *dev, u8 swport);
 };
 
 /* Low-level architecture-dependent routines */
@@ -227,15 +261,19 @@ struct rio_switch {
  * @cread: Callback to perform network read of config space.
  * @cwrite: Callback to perform network write of config space.
  * @dsend: Callback to send a doorbell message.
+ * @pwenable: Callback to enable/disable port-write message handling.
  */
 struct rio_ops {
-       int (*lcread) (int index, u32 offset, int len, u32 * data);
-       int (*lcwrite) (int index, u32 offset, int len, u32 data);
-       int (*cread) (int index, u16 destid, u8 hopcount, u32 offset, int len,
-                     u32 * data);
-       int (*cwrite) (int index, u16 destid, u8 hopcount, u32 offset, int len,
-                      u32 data);
-       int (*dsend) (int index, u16 destid, u16 data);
+       int (*lcread) (struct rio_mport *mport, int index, u32 offset, int len,
+                       u32 *data);
+       int (*lcwrite) (struct rio_mport *mport, int index, u32 offset, int len,
+                       u32 data);
+       int (*cread) (struct rio_mport *mport, int index, u16 destid,
+                       u8 hopcount, u32 offset, int len, u32 *data);
+       int (*cwrite) (struct rio_mport *mport, int index, u16 destid,
+                       u8 hopcount, u32 offset, int len, u32 data);
+       int (*dsend) (struct rio_mport *mport, int index, u16 destid, u16 data);
+       int (*pwenable) (struct rio_mport *mport, int enable);
 };
 
 #define RIO_RESOURCE_MEM       0x00000100
@@ -292,21 +330,28 @@ struct rio_device_id {
 };
 
 /**
- * struct rio_route_ops - Per-switch route operations
+ * struct rio_switch_ops - Per-switch operations
  * @vid: RIO vendor ID
  * @did: RIO device ID
- * @add_hook: Callback that adds a route entry
- * @get_hook: Callback that gets a route entry
+ * @init_hook: Callback that performs switch device initialization
  *
- * Defines the operations that are necessary to manipulate the route
- * tables for a particular RIO switch device.
+ * Defines the operations that are necessary to initialize/control
+ * a particular RIO switch device.
  */
-struct rio_route_ops {
+struct rio_switch_ops {
        u16 vid, did;
-       int (*add_hook) (struct rio_mport * mport, u16 destid, u8 hopcount,
-                        u16 table, u16 route_destid, u8 route_port);
-       int (*get_hook) (struct rio_mport * mport, u16 destid, u8 hopcount,
-                        u16 table, u16 route_destid, u8 * route_port);
+       int (*init_hook) (struct rio_dev *rdev, int do_enum);
+};
+
+union rio_pw_msg {
+       struct {
+               u32 comptag;    /* Component Tag CSR */
+               u32 errdetect;  /* Port N Error Detect CSR */
+               u32 is_port;    /* Implementation specific + PortID */
+               u32 ltlerrdet;  /* LTL Error Detect CSR */
+               u32 padding[12];
+       } em;
+       u32 raw[RIO_PW_MSG_SIZE/sizeof(u32)];
 };
 
 /* Architecture and hardware-specific functions */
@@ -321,5 +366,4 @@ extern void rio_close_inb_mbox(struct rio_mport *, int);
 extern int rio_open_outb_mbox(struct rio_mport *, void *, int, int);
 extern void rio_close_outb_mbox(struct rio_mport *, int);
 
-#endif                         /* __KERNEL__ */
 #endif                         /* LINUX_RIO_H */