diff options
Diffstat (limited to 'include/linux/rio.h')
| -rw-r--r-- | include/linux/rio.h | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/include/linux/rio.h b/include/linux/rio.h index 68e3f6853fa6..dc0c75556c63 100644 --- a/include/linux/rio.h +++ b/include/linux/rio.h | |||
| @@ -14,8 +14,6 @@ | |||
| 14 | #ifndef LINUX_RIO_H | 14 | #ifndef LINUX_RIO_H |
| 15 | #define LINUX_RIO_H | 15 | #define LINUX_RIO_H |
| 16 | 16 | ||
| 17 | #ifdef __KERNEL__ | ||
| 18 | |||
| 19 | #include <linux/types.h> | 17 | #include <linux/types.h> |
| 20 | #include <linux/ioport.h> | 18 | #include <linux/ioport.h> |
| 21 | #include <linux/list.h> | 19 | #include <linux/list.h> |
| @@ -23,7 +21,6 @@ | |||
| 23 | #include <linux/device.h> | 21 | #include <linux/device.h> |
| 24 | #include <linux/rio_regs.h> | 22 | #include <linux/rio_regs.h> |
| 25 | 23 | ||
| 26 | #define RIO_ANY_DESTID 0xff | ||
| 27 | #define RIO_NO_HOPCOUNT -1 | 24 | #define RIO_NO_HOPCOUNT -1 |
| 28 | #define RIO_INVALID_DESTID 0xffff | 25 | #define RIO_INVALID_DESTID 0xffff |
| 29 | 26 | ||
| @@ -39,11 +36,8 @@ | |||
| 39 | entry is invalid (no route | 36 | entry is invalid (no route |
| 40 | exists for the device ID) */ | 37 | exists for the device ID) */ |
| 41 | 38 | ||
| 42 | #ifdef CONFIG_RAPIDIO_8_BIT_TRANSPORT | 39 | #define RIO_MAX_ROUTE_ENTRIES(size) (size ? (1 << 16) : (1 << 8)) |
| 43 | #define RIO_MAX_ROUTE_ENTRIES (1 << 8) | 40 | #define RIO_ANY_DESTID(size) (size ? 0xffff : 0xff) |
| 44 | #else | ||
| 45 | #define RIO_MAX_ROUTE_ENTRIES (1 << 16) | ||
| 46 | #endif | ||
| 47 | 41 | ||
| 48 | #define RIO_MAX_MBOX 4 | 42 | #define RIO_MAX_MBOX 4 |
| 49 | #define RIO_MAX_MSG_SIZE 0x1000 | 43 | #define RIO_MAX_MSG_SIZE 0x1000 |
| @@ -149,6 +143,11 @@ struct rio_dbell { | |||
| 149 | void *dev_id; | 143 | void *dev_id; |
| 150 | }; | 144 | }; |
| 151 | 145 | ||
| 146 | enum rio_phy_type { | ||
| 147 | RIO_PHY_PARALLEL, | ||
| 148 | RIO_PHY_SERIAL, | ||
| 149 | }; | ||
| 150 | |||
| 152 | /** | 151 | /** |
| 153 | * struct rio_mport - RIO master port info | 152 | * struct rio_mport - RIO master port info |
| 154 | * @dbells: List of doorbell events | 153 | * @dbells: List of doorbell events |
| @@ -162,7 +161,10 @@ struct rio_dbell { | |||
| 162 | * @ops: configuration space functions | 161 | * @ops: configuration space functions |
| 163 | * @id: Port ID, unique among all ports | 162 | * @id: Port ID, unique among all ports |
| 164 | * @index: Port index, unique among all port interfaces of the same type | 163 | * @index: Port index, unique among all port interfaces of the same type |
| 164 | * @sys_size: RapidIO common transport system size | ||
| 165 | * @phy_type: RapidIO phy type | ||
| 165 | * @name: Port name string | 166 | * @name: Port name string |
| 167 | * @priv: Master port private data | ||
| 166 | */ | 168 | */ |
| 167 | struct rio_mport { | 169 | struct rio_mport { |
| 168 | struct list_head dbells; /* list of doorbell events */ | 170 | struct list_head dbells; /* list of doorbell events */ |
| @@ -177,7 +179,13 @@ struct rio_mport { | |||
| 177 | unsigned char id; /* port ID, unique among all ports */ | 179 | unsigned char id; /* port ID, unique among all ports */ |
| 178 | unsigned char index; /* port index, unique among all port | 180 | unsigned char index; /* port index, unique among all port |
| 179 | interfaces of the same type */ | 181 | interfaces of the same type */ |
| 182 | unsigned int sys_size; /* RapidIO common transport system size. | ||
| 183 | * 0 - Small size. 256 devices. | ||
| 184 | * 1 - Large size, 65536 devices. | ||
| 185 | */ | ||
| 186 | enum rio_phy_type phy_type; /* RapidIO phy type */ | ||
| 180 | unsigned char name[40]; | 187 | unsigned char name[40]; |
| 188 | void *priv; /* Master port private data */ | ||
| 181 | }; | 189 | }; |
| 182 | 190 | ||
| 183 | /** | 191 | /** |
| @@ -211,7 +219,7 @@ struct rio_switch { | |||
| 211 | u16 switchid; | 219 | u16 switchid; |
| 212 | u16 hopcount; | 220 | u16 hopcount; |
| 213 | u16 destid; | 221 | u16 destid; |
| 214 | u8 route_table[RIO_MAX_ROUTE_ENTRIES]; | 222 | u8 *route_table; |
| 215 | int (*add_entry) (struct rio_mport * mport, u16 destid, u8 hopcount, | 223 | int (*add_entry) (struct rio_mport * mport, u16 destid, u8 hopcount, |
| 216 | u16 table, u16 route_destid, u8 route_port); | 224 | u16 table, u16 route_destid, u8 route_port); |
| 217 | int (*get_entry) (struct rio_mport * mport, u16 destid, u8 hopcount, | 225 | int (*get_entry) (struct rio_mport * mport, u16 destid, u8 hopcount, |
| @@ -229,13 +237,15 @@ struct rio_switch { | |||
| 229 | * @dsend: Callback to send a doorbell message. | 237 | * @dsend: Callback to send a doorbell message. |
| 230 | */ | 238 | */ |
| 231 | struct rio_ops { | 239 | struct rio_ops { |
| 232 | int (*lcread) (int index, u32 offset, int len, u32 * data); | 240 | int (*lcread) (struct rio_mport *mport, int index, u32 offset, int len, |
| 233 | int (*lcwrite) (int index, u32 offset, int len, u32 data); | 241 | u32 *data); |
| 234 | int (*cread) (int index, u16 destid, u8 hopcount, u32 offset, int len, | 242 | int (*lcwrite) (struct rio_mport *mport, int index, u32 offset, int len, |
| 235 | u32 * data); | 243 | u32 data); |
| 236 | int (*cwrite) (int index, u16 destid, u8 hopcount, u32 offset, int len, | 244 | int (*cread) (struct rio_mport *mport, int index, u16 destid, |
| 237 | u32 data); | 245 | u8 hopcount, u32 offset, int len, u32 *data); |
| 238 | int (*dsend) (int index, u16 destid, u16 data); | 246 | int (*cwrite) (struct rio_mport *mport, int index, u16 destid, |
| 247 | u8 hopcount, u32 offset, int len, u32 data); | ||
| 248 | int (*dsend) (struct rio_mport *mport, int index, u16 destid, u16 data); | ||
| 239 | }; | 249 | }; |
| 240 | 250 | ||
| 241 | #define RIO_RESOURCE_MEM 0x00000100 | 251 | #define RIO_RESOURCE_MEM 0x00000100 |
| @@ -321,5 +331,4 @@ extern void rio_close_inb_mbox(struct rio_mport *, int); | |||
| 321 | extern int rio_open_outb_mbox(struct rio_mport *, void *, int, int); | 331 | extern int rio_open_outb_mbox(struct rio_mport *, void *, int, int); |
| 322 | extern void rio_close_outb_mbox(struct rio_mport *, int); | 332 | extern void rio_close_outb_mbox(struct rio_mport *, int); |
| 323 | 333 | ||
| 324 | #endif /* __KERNEL__ */ | ||
| 325 | #endif /* LINUX_RIO_H */ | 334 | #endif /* LINUX_RIO_H */ |
