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.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/include/linux/rio.h b/include/linux/rio.h
index a90ebadd9da0..d2dff22cf681 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
@@ -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,21 @@ 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 u16 next; /* hint for find */
270 u32 max; /* max number of IDs in table */
271 spinlock_t lock;
272 unsigned long *table;
273};
274
265/** 275/**
266 * struct rio_net - RIO network info 276 * struct rio_net - RIO network info
267 * @node: Node in global list of RIO networks 277 * @node: Node in global list of RIO networks
@@ -273,9 +283,11 @@ struct rio_mport {
273struct rio_net { 283struct rio_net {
274 struct list_head node; /* node in list of networks */ 284 struct list_head node; /* node in list of networks */
275 struct list_head devices; /* list of devices in this net */ 285 struct list_head devices; /* list of devices in this net */
286 struct list_head switches; /* list of switches in this net */
276 struct list_head mports; /* list of ports accessing net */ 287 struct list_head mports; /* list of ports accessing net */
277 struct rio_mport *hport; /* primary port for accessing net */ 288 struct rio_mport *hport; /* primary port for accessing net */
278 unsigned char id; /* RIO network ID */ 289 unsigned char id; /* RIO network ID */
290 struct rio_id_table destid_table; /* destID allocation table */
279}; 291};
280 292
281/* Definitions used by switch sysfs initialization callback */ 293/* Definitions used by switch sysfs initialization callback */
@@ -299,6 +311,8 @@ struct rio_net {
299 * @add_outb_message: Callback to add a message to an outbound mailbox queue. 311 * @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. 312 * @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. 313 * @get_inb_message: Callback to get a message from an inbound mailbox queue.
314 * @map_inb: Callback to map RapidIO address region into local memory space.
315 * @unmap_inb: Callback to unmap RapidIO address region mapped with map_inb().
302 */ 316 */
303struct rio_ops { 317struct rio_ops {
304 int (*lcread) (struct rio_mport *mport, int index, u32 offset, int len, 318 int (*lcread) (struct rio_mport *mport, int index, u32 offset, int len,
@@ -321,6 +335,9 @@ struct rio_ops {
321 int mbox, void *buffer, size_t len); 335 int mbox, void *buffer, size_t len);
322 int (*add_inb_buffer)(struct rio_mport *mport, int mbox, void *buf); 336 int (*add_inb_buffer)(struct rio_mport *mport, int mbox, void *buf);
323 void *(*get_inb_message)(struct rio_mport *mport, int mbox); 337 void *(*get_inb_message)(struct rio_mport *mport, int mbox);
338 int (*map_inb)(struct rio_mport *mport, dma_addr_t lstart,
339 u64 rstart, u32 size, u32 flags);
340 void (*unmap_inb)(struct rio_mport *mport, dma_addr_t lstart);
324}; 341};
325 342
326#define RIO_RESOURCE_MEM 0x00000100 343#define RIO_RESOURCE_MEM 0x00000100
@@ -403,7 +420,7 @@ union rio_pw_msg {
403 420
404#ifdef CONFIG_RAPIDIO_DMA_ENGINE 421#ifdef CONFIG_RAPIDIO_DMA_ENGINE
405 422
406/** 423/*
407 * enum rio_write_type - RIO write transaction types used in DMA transfers 424 * enum rio_write_type - RIO write transaction types used in DMA transfers
408 * 425 *
409 * Note: RapidIO specification defines write (NWRITE) and 426 * Note: RapidIO specification defines write (NWRITE) and