aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/rio.h
diff options
context:
space:
mode:
authorAlexandre Bounine <alexandre.bounine@idt.com>2014-04-07 18:38:56 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-07 19:36:07 -0400
commit2aaf308b95b24649a6dcfed89cd956e972089b2a (patch)
treea8fdaea74d50c4a38633bd7aafdc8a98723b1628 /include/linux/rio.h
parent40f847baf50debfd42ad66f862bfcfea069ffbe7 (diff)
rapidio: rework device hierarchy and introduce mport class of devices
This patch removes an artificial RapidIO bus root device and establishes actual device hierarchy by providing reference to real parent devices. It also introduces device class for RapidIO controller devices (on-chip or an eternal bridge, known as "mport"). Existing implementation was sufficient for SoC-based platforms that have a single RapidIO controller. With introduction of devices using multiple RapidIO controllers and PCIe-to-RapidIO bridges the old scheme is very limiting or does not work at all. The implemented changes allow to properly reference platform's local RapidIO mport devices and provide device details needed for upper layers. This change to RapidIO device hierarchy does not break any known existing kernel or user space interfaces. Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com> Cc: Matt Porter <mporter@kernel.crashing.org> Cc: Li Yang <leoli@freescale.com> Cc: Kumar Gala <galak@kernel.crashing.org> Cc: Andre van Herk <andre.van.herk@prodrive-technologies.com> Cc: Stef van Os <stef.van.os@prodrive-technologies.com> Cc: Jerry Jacobs <jerry.jacobs@prodrive-technologies.com> Cc: Arno Tiemersma <arno.tiemersma@prodrive-technologies.com> Cc: Rob Landley <rob@landley.net> 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.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/linux/rio.h b/include/linux/rio.h
index b71d5738e683..6bda06f21930 100644
--- a/include/linux/rio.h
+++ b/include/linux/rio.h
@@ -83,7 +83,7 @@
83#define RIO_CTAG_UDEVID 0x0001ffff /* Unique device identifier */ 83#define RIO_CTAG_UDEVID 0x0001ffff /* Unique device identifier */
84 84
85extern struct bus_type rio_bus_type; 85extern struct bus_type rio_bus_type;
86extern struct device rio_bus; 86extern struct class rio_mport_class;
87 87
88struct rio_mport; 88struct rio_mport;
89struct rio_dev; 89struct rio_dev;
@@ -201,6 +201,7 @@ struct rio_dev {
201#define rio_dev_f(n) list_entry(n, struct rio_dev, net_list) 201#define rio_dev_f(n) list_entry(n, struct rio_dev, net_list)
202#define to_rio_dev(n) container_of(n, struct rio_dev, dev) 202#define to_rio_dev(n) container_of(n, struct rio_dev, dev)
203#define sw_to_rio_dev(n) container_of(n, struct rio_dev, rswitch[0]) 203#define sw_to_rio_dev(n) container_of(n, struct rio_dev, rswitch[0])
204#define to_rio_mport(n) container_of(n, struct rio_mport, dev)
204 205
205/** 206/**
206 * struct rio_msg - RIO message event 207 * struct rio_msg - RIO message event
@@ -248,6 +249,7 @@ enum rio_phy_type {
248 * @phy_type: RapidIO phy type 249 * @phy_type: RapidIO phy type
249 * @phys_efptr: RIO port extended features pointer 250 * @phys_efptr: RIO port extended features pointer
250 * @name: Port name string 251 * @name: Port name string
252 * @dev: device structure associated with an mport
251 * @priv: Master port private data 253 * @priv: Master port private data
252 * @dma: DMA device associated with mport 254 * @dma: DMA device associated with mport
253 * @nscan: RapidIO network enumeration/discovery operations 255 * @nscan: RapidIO network enumeration/discovery operations
@@ -272,6 +274,7 @@ struct rio_mport {
272 enum rio_phy_type phy_type; /* RapidIO phy type */ 274 enum rio_phy_type phy_type; /* RapidIO phy type */
273 u32 phys_efptr; 275 u32 phys_efptr;
274 unsigned char name[RIO_MAX_MPORT_NAME]; 276 unsigned char name[RIO_MAX_MPORT_NAME];
277 struct device dev;
275 void *priv; /* Master port private data */ 278 void *priv; /* Master port private data */
276#ifdef CONFIG_RAPIDIO_DMA_ENGINE 279#ifdef CONFIG_RAPIDIO_DMA_ENGINE
277 struct dma_device dma; 280 struct dma_device dma;