diff options
author | Alexandre Bounine <alexandre.bounine@idt.com> | 2011-03-23 23:43:02 (GMT) |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-24 02:46:41 (GMT) |
commit | f8f0626989c85b3d8bd67eff29d9dd3d14a5e71f (patch) | |
tree | 1132c3ca38b6f68c00864df0ded229c45230d4c5 /include | |
parent | e15b4d687f3015aa7953687e5a80f1cc4ba9b736 (diff) | |
download | linux-f8f0626989c85b3d8bd67eff29d9dd3d14a5e71f.tar.xz |
rapidio: add architecture specific callbacks
This set of patches eliminates RapidIO dependency on PowerPC architecture
and makes it available to other architectures (x86 and MIPS). It also
enables support of new platform independent RapidIO controllers such as
PCI-to-SRIO and PCI Express-to-SRIO.
This patch:
Extend number of mport callback functions to eliminate direct linking of
architecture specific mport operations.
Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com>
Cc: Kumar Gala <galak@kernel.crashing.org>
Cc: Matt Porter <mporter@kernel.crashing.org>
Cc: Li Yang <leoli@freescale.com>
Cc: Thomas Moll <thomas.moll@sysgo.com>
Cc: Micha Nelissen <micha@neli.hopto.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/rio.h | 23 | ||||
-rw-r--r-- | include/linux/rio_drv.h | 7 |
2 files changed, 22 insertions, 8 deletions
diff --git a/include/linux/rio.h b/include/linux/rio.h index ff681eb..efed116 100644 --- a/include/linux/rio.h +++ b/include/linux/rio.h @@ -241,7 +241,7 @@ struct rio_mport { struct rio_msg inb_msg[RIO_MAX_MBOX]; struct rio_msg outb_msg[RIO_MAX_MBOX]; int host_deviceid; /* Host device ID */ - struct rio_ops *ops; /* maintenance transaction functions */ + struct rio_ops *ops; /* low-level architecture-dependent routines */ unsigned char id; /* port ID, unique among all ports */ unsigned char index; /* port index, unique among all port interfaces of the same type */ @@ -285,6 +285,13 @@ struct rio_net { * @cwrite: Callback to perform network write of config space. * @dsend: Callback to send a doorbell message. * @pwenable: Callback to enable/disable port-write message handling. + * @open_outb_mbox: Callback to initialize outbound mailbox. + * @close_outb_mbox: Callback to shut down outbound mailbox. + * @open_inb_mbox: Callback to initialize inbound mailbox. + * @close_inb_mbox: Callback to shut down inbound mailbox. + * @add_outb_message: Callback to add a message to an outbound mailbox queue. + * @add_inb_buffer: Callback to add a buffer to an inbound mailbox queue. + * @get_inb_message: Callback to get a message from an inbound mailbox queue. */ struct rio_ops { int (*lcread) (struct rio_mport *mport, int index, u32 offset, int len, @@ -297,6 +304,16 @@ struct rio_ops { u8 hopcount, u32 offset, int len, u32 data); int (*dsend) (struct rio_mport *mport, int index, u16 destid, u16 data); int (*pwenable) (struct rio_mport *mport, int enable); + int (*open_outb_mbox)(struct rio_mport *mport, void *dev_id, + int mbox, int entries); + void (*close_outb_mbox)(struct rio_mport *mport, int mbox); + int (*open_inb_mbox)(struct rio_mport *mport, void *dev_id, + int mbox, int entries); + void (*close_inb_mbox)(struct rio_mport *mport, int mbox); + int (*add_outb_message)(struct rio_mport *mport, struct rio_dev *rdev, + int mbox, void *buffer, size_t len); + int (*add_inb_buffer)(struct rio_mport *mport, int mbox, void *buf); + void *(*get_inb_message)(struct rio_mport *mport, int mbox); }; #define RIO_RESOURCE_MEM 0x00000100 @@ -380,10 +397,6 @@ union rio_pw_msg { /* Architecture and hardware-specific functions */ extern int rio_init_mports(void); extern void rio_register_mport(struct rio_mport *); -extern int rio_hw_add_outb_message(struct rio_mport *, struct rio_dev *, int, - void *, size_t); -extern int rio_hw_add_inb_buffer(struct rio_mport *, int, void *); -extern void *rio_hw_get_inb_message(struct rio_mport *, int); extern int rio_open_inb_mbox(struct rio_mport *, void *, int, int); extern void rio_close_inb_mbox(struct rio_mport *, int); extern int rio_open_outb_mbox(struct rio_mport *, void *, int, int); diff --git a/include/linux/rio_drv.h b/include/linux/rio_drv.h index e09e565..229b3ca 100644 --- a/include/linux/rio_drv.h +++ b/include/linux/rio_drv.h @@ -317,7 +317,8 @@ static inline int rio_add_outb_message(struct rio_mport *mport, struct rio_dev *rdev, int mbox, void *buffer, size_t len) { - return rio_hw_add_outb_message(mport, rdev, mbox, buffer, len); + return mport->ops->add_outb_message(mport, rdev, mbox, + buffer, len); } extern int rio_request_inb_mbox(struct rio_mport *, void *, int, int, @@ -336,7 +337,7 @@ extern int rio_release_inb_mbox(struct rio_mport *, int); static inline int rio_add_inb_buffer(struct rio_mport *mport, int mbox, void *buffer) { - return rio_hw_add_inb_buffer(mport, mbox, buffer); + return mport->ops->add_inb_buffer(mport, mbox, buffer); } /** @@ -348,7 +349,7 @@ static inline int rio_add_inb_buffer(struct rio_mport *mport, int mbox, */ static inline void *rio_get_inb_message(struct rio_mport *mport, int mbox) { - return rio_hw_get_inb_message(mport, mbox); + return mport->ops->get_inb_message(mport, mbox); } /* Doorbell management */ |