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.h22
1 files changed, 19 insertions, 3 deletions
diff --git a/include/linux/rio.h b/include/linux/rio.h
index a90ebadd9da0..4187da511006 100644
--- a/include/linux/rio.h
+++ b/include/linux/rio.h
@@ -30,6 +30,7 @@
30#define RIO_MAX_MPORTS 8 30#define RIO_MAX_MPORTS 8
31#define RIO_MAX_MPORT_RESOURCES 16 31#define RIO_MAX_MPORT_RESOURCES 16
32#define RIO_MAX_DEV_RESOURCES 16 32#define RIO_MAX_DEV_RESOURCES 16
33#define RIO_MAX_MPORT_NAME 40
33 34
34#define RIO_GLOBAL_TABLE 0xff /* Indicates access of a switch's 35#define RIO_GLOBAL_TABLE 0xff /* Indicates access of a switch's
35 global routing table if it 36 global routing table if it
@@ -62,7 +63,7 @@
62 * 63 *
63 * 0 RapidIO inbound doorbells 64 * 0 RapidIO inbound doorbells
64 * 1 RapidIO inbound mailboxes 65 * 1 RapidIO inbound mailboxes
65 * 1 RapidIO outbound mailboxes 66 * 2 RapidIO outbound mailboxes
66 */ 67 */
67#define RIO_DOORBELL_RESOURCE 0 68#define RIO_DOORBELL_RESOURCE 0
68#define RIO_INB_MBOX_RESOURCE 1 69#define RIO_INB_MBOX_RESOURCE 1
@@ -235,6 +236,7 @@ enum rio_phy_type {
235 * @phys_efptr: RIO port extended features pointer 236 * @phys_efptr: RIO port extended features pointer
236 * @name: Port name string 237 * @name: Port name string
237 * @priv: Master port private data 238 * @priv: Master port private data
239 * @dma: DMA device associated with mport
238 */ 240 */
239struct rio_mport { 241struct rio_mport {
240 struct list_head dbells; /* list of doorbell events */ 242 struct list_head dbells; /* list of doorbell events */
@@ -255,13 +257,20 @@ struct rio_mport {
255 */ 257 */
256 enum rio_phy_type phy_type; /* RapidIO phy type */ 258 enum rio_phy_type phy_type; /* RapidIO phy type */
257 u32 phys_efptr; 259 u32 phys_efptr;
258 unsigned char name[40]; 260 unsigned char name[RIO_MAX_MPORT_NAME];
259 void *priv; /* Master port private data */ 261 void *priv; /* Master port private data */
260#ifdef CONFIG_RAPIDIO_DMA_ENGINE 262#ifdef CONFIG_RAPIDIO_DMA_ENGINE
261 struct dma_device dma; 263 struct dma_device dma;
262#endif 264#endif
263}; 265};
264 266
267struct rio_id_table {
268 u16 start; /* logical minimal id */
269 u32 max; /* max number of IDs in table */
270 spinlock_t lock;
271 unsigned long *table;
272};
273
265/** 274/**
266 * struct rio_net - RIO network info 275 * struct rio_net - RIO network info
267 * @node: Node in global list of RIO networks 276 * @node: Node in global list of RIO networks
@@ -273,9 +282,11 @@ struct rio_mport {
273struct rio_net { 282struct rio_net {
274 struct list_head node; /* node in list of networks */ 283 struct list_head node; /* node in list of networks */
275 struct list_head devices; /* list of devices in this net */ 284 struct list_head devices; /* list of devices in this net */
285 struct list_head switches; /* list of switches in this net */
276 struct list_head mports; /* list of ports accessing net */ 286 struct list_head mports; /* list of ports accessing net */
277 struct rio_mport *hport; /* primary port for accessing net */ 287 struct rio_mport *hport; /* primary port for accessing net */
278 unsigned char id; /* RIO network ID */ 288 unsigned char id; /* RIO network ID */
289 struct rio_id_table destid_table; /* destID allocation table */
279}; 290};
280 291
281/* Definitions used by switch sysfs initialization callback */ 292/* Definitions used by switch sysfs initialization callback */
@@ -299,6 +310,8 @@ struct rio_net {
299 * @add_outb_message: Callback to add a message to an outbound mailbox queue. 310 * @add_outb_message: Callback to add a message to an outbound mailbox queue.
300 * @add_inb_buffer: Callback to add a buffer to an inbound mailbox queue. 311 * @add_inb_buffer: Callback to add a buffer to an inbound mailbox queue.
301 * @get_inb_message: Callback to get a message from an inbound mailbox queue. 312 * @get_inb_message: Callback to get a message from an inbound mailbox queue.
313 * @map_inb: Callback to map RapidIO address region into local memory space.
314 * @unmap_inb: Callback to unmap RapidIO address region mapped with map_inb().
302 */ 315 */
303struct rio_ops { 316struct rio_ops {
304 int (*lcread) (struct rio_mport *mport, int index, u32 offset, int len, 317 int (*lcread) (struct rio_mport *mport, int index, u32 offset, int len,
@@ -321,6 +334,9 @@ struct rio_ops {
321 int mbox, void *buffer, size_t len); 334 int mbox, void *buffer, size_t len);
322 int (*add_inb_buffer)(struct rio_mport *mport, int mbox, void *buf); 335 int (*add_inb_buffer)(struct rio_mport *mport, int mbox, void *buf);
323 void *(*get_inb_message)(struct rio_mport *mport, int mbox); 336 void *(*get_inb_message)(struct rio_mport *mport, int mbox);
337 int (*map_inb)(struct rio_mport *mport, dma_addr_t lstart,
338 u64 rstart, u32 size, u32 flags);
339 void (*unmap_inb)(struct rio_mport *mport, dma_addr_t lstart);
324}; 340};
325 341
326#define RIO_RESOURCE_MEM 0x00000100 342#define RIO_RESOURCE_MEM 0x00000100
@@ -403,7 +419,7 @@ union rio_pw_msg {
403 419
404#ifdef CONFIG_RAPIDIO_DMA_ENGINE 420#ifdef CONFIG_RAPIDIO_DMA_ENGINE
405 421
406/** 422/*
407 * enum rio_write_type - RIO write transaction types used in DMA transfers 423 * enum rio_write_type - RIO write transaction types used in DMA transfers
408 * 424 *
409 * Note: RapidIO specification defines write (NWRITE) and 425 * Note: RapidIO specification defines write (NWRITE) and