summaryrefslogtreecommitdiffstats
path: root/include/linux/rio.h
diff options
context:
space:
mode:
authorAlexandre Bounine <alexandre.bounine@idt.com>2012-10-04 17:16:13 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-06 03:05:23 +0900
commitde74e00a965177e8a0d44af0ba31971b80f2bf3f (patch)
tree2c4aec10d723df0a16c46546b222d9e97189f364 /include/linux/rio.h
parent2fb717ec3ec76b0ca4cee9c4d802ce551750413d (diff)
downloadop-kernel-dev-de74e00a965177e8a0d44af0ba31971b80f2bf3f.zip
op-kernel-dev-de74e00a965177e8a0d44af0ba31971b80f2bf3f.tar.gz
rapidio: add destination ID allocation mechanism
Replace the single global destination ID counter with per-net allocation mechanism to allow independent destID management for each available RapidIO network. Using bitmap based mechanism instead of counters allows destination ID release and reuse in systems that support hot-swap. Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com> Cc: Matt Porter <mporter@kernel.crashing.org> Cc: Li Yang <leoli@freescale.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/rio.h')
-rw-r--r--include/linux/rio.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/rio.h b/include/linux/rio.h
index 7ea02c4..d2dff22 100644
--- a/include/linux/rio.h
+++ b/include/linux/rio.h
@@ -264,6 +264,14 @@ struct rio_mport {
#endif
};
+struct rio_id_table {
+ u16 start; /* logical minimal id */
+ u16 next; /* hint for find */
+ u32 max; /* max number of IDs in table */
+ spinlock_t lock;
+ unsigned long *table;
+};
+
/**
* struct rio_net - RIO network info
* @node: Node in global list of RIO networks
@@ -279,6 +287,7 @@ struct rio_net {
struct list_head mports; /* list of ports accessing net */
struct rio_mport *hport; /* primary port for accessing net */
unsigned char id; /* RIO network ID */
+ struct rio_id_table destid_table; /* destID allocation table */
};
/* Definitions used by switch sysfs initialization callback */
OpenPOWER on IntegriCloud