summaryrefslogtreecommitdiffstats
path: root/drivers/rapidio/rio.h
diff options
context:
space:
mode:
authorAlexandre Bounine <alexandre.bounine@idt.com>2010-05-26 14:44:03 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-27 09:12:51 -0700
commit058f88d672b3161fe511ebe2996c3faef63c1c8e (patch)
treefb4bb8d93aef661cc9e24e1e6e2e8bd4edc2e764 /drivers/rapidio/rio.h
parent011507e49a696462c30914e2eeebcdda33ed30f8 (diff)
downloadop-kernel-dev-058f88d672b3161fe511ebe2996c3faef63c1c8e.zip
op-kernel-dev-058f88d672b3161fe511ebe2996c3faef63c1c8e.tar.gz
rapidio: modify initialization of switch operations
Modify the way how RapidIO switch operations are declared. Multiple assignments through the linker script replaced by single initialization call. 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: Thomas Moll <thomas.moll@sysgo.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rapidio/rio.h')
-rw-r--r--drivers/rapidio/rio.h56
1 files changed, 15 insertions, 41 deletions
diff --git a/drivers/rapidio/rio.h b/drivers/rapidio/rio.h
index 2f628ce..f27b7a9 100644
--- a/drivers/rapidio/rio.h
+++ b/drivers/rapidio/rio.h
@@ -39,55 +39,29 @@ extern int rio_set_port_lockout(struct rio_dev *rdev, u32 pnum, int lock);
extern struct device_attribute rio_dev_attrs[];
extern spinlock_t rio_global_list_lock;
-extern struct rio_route_ops __start_rio_route_ops[];
-extern struct rio_route_ops __end_rio_route_ops[];
+extern struct rio_switch_ops __start_rio_switch_ops[];
+extern struct rio_switch_ops __end_rio_switch_ops[];
/* Helpers internal to the RIO core code */
-#define DECLARE_RIO_ROUTE_SECTION(section, name, vid, did, add_hook, get_hook, clr_hook) \
- static const struct rio_route_ops __rio_route_##name __used \
- __section(section) = { vid, did, add_hook, get_hook, clr_hook };
+#define DECLARE_RIO_SWITCH_SECTION(section, name, vid, did, init_hook) \
+ static const struct rio_switch_ops __rio_switch_##name __used \
+ __section(section) = { vid, did, init_hook };
/**
- * DECLARE_RIO_ROUTE_OPS - Registers switch routing operations
+ * DECLARE_RIO_SWITCH_INIT - Registers switch initialization routine
* @vid: RIO vendor ID
* @did: RIO device ID
- * @add_hook: Callback that adds a route entry
- * @get_hook: Callback that gets a route entry
+ * @init_hook: Callback that performs switch-specific initialization
*
- * Manipulating switch route tables in RIO is switch specific. This
- * registers a switch by vendor and device ID with two callbacks for
- * modifying and retrieving route entries in a switch. A &struct
- * rio_route_ops is initialized with the ops and placed into a
- * RIO-specific kernel section.
+ * Manipulating switch route tables and error management in RIO
+ * is switch specific. This registers a switch by vendor and device ID with
+ * initialization callback for setting up switch operations and (if required)
+ * hardware initialization. A &struct rio_switch_ops is initialized with
+ * pointer to the init routine and placed into a RIO-specific kernel section.
*/
-#define DECLARE_RIO_ROUTE_OPS(vid, did, add_hook, get_hook, clr_hook) \
- DECLARE_RIO_ROUTE_SECTION(.rio_route_ops, vid##did, \
- vid, did, add_hook, get_hook, clr_hook)
+#define DECLARE_RIO_SWITCH_INIT(vid, did, init_hook) \
+ DECLARE_RIO_SWITCH_SECTION(.rio_switch_ops, vid##did, \
+ vid, did, init_hook)
#define RIO_GET_DID(size, x) (size ? (x & 0xffff) : ((x & 0x00ff0000) >> 16))
#define RIO_SET_DID(size, x) (size ? (x & 0xffff) : ((x & 0x000000ff) << 16))
-
-/*
- * RapidIO Error Management
- */
-extern struct rio_em_ops __start_rio_em_ops[];
-extern struct rio_em_ops __end_rio_em_ops[];
-
-/* Helpers internal to the RIO core code */
-#define DECLARE_RIO_EM_SECTION(section, name, vid, did, init_hook, em_hook) \
- static const struct rio_em_ops __rio_em_##name __used \
- __section(section) = { vid, did, init_hook, em_hook };
-
-/**
- * DECLARE_RIO_EM_OPS - Registers switch EM operations
- * @vid: RIO vendor ID
- * @did: RIO device ID
- * @init_hook: Callback that initializes device specific EM
- * @em_hook: Callback that handles device specific EM
- *
- * A &struct rio_em_ops is initialized with the ops and placed into a
- * RIO-specific kernel section.
- */
-#define DECLARE_RIO_EM_OPS(vid, did, init_hook, em_hook) \
- DECLARE_RIO_EM_SECTION(.rio_em_ops, vid##did, \
- vid, did, init_hook, em_hook)
OpenPOWER on IntegriCloud