aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorAlexandre Bounine <alexandre.bounine@idt.com>2011-03-23 19:43:02 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-23 22:46:41 -0400
commitf8f0626989c85b3d8bd67eff29d9dd3d14a5e71f (patch)
tree1132c3ca38b6f68c00864df0ded229c45230d4c5 /include/linux
parente15b4d687f3015aa7953687e5a80f1cc4ba9b736 (diff)
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/linux')
-rw-r--r--include/linux/rio.h23
-rw-r--r--include/linux/rio_drv.h7
2 files changed, 22 insertions, 8 deletions
diff --git a/include/linux/rio.h b/include/linux/rio.h
index ff681ebba585..efed116efe9c 100644
--- a/include/linux/rio.h
+++ b/include/linux/rio.h
@@ -241,7 +241,7 @@ struct rio_mport {
241 struct rio_msg inb_msg[RIO_MAX_MBOX]; 241 struct rio_msg inb_msg[RIO_MAX_MBOX];
242 struct rio_msg outb_msg[RIO_MAX_MBOX]; 242 struct rio_msg outb_msg[RIO_MAX_MBOX];
243 int host_deviceid; /* Host device ID */ 243 int host_deviceid; /* Host device ID */
244 struct rio_ops *ops; /* maintenance transaction functions */ 244 struct rio_ops *ops; /* low-level architecture-dependent routines */
245 unsigned char id; /* port ID, unique among all ports */ 245 unsigned char id; /* port ID, unique among all ports */
246 unsigned char index; /* port index, unique among all port 246 unsigned char index; /* port index, unique among all port
247 interfaces of the same type */ 247 interfaces of the same type */
@@ -285,6 +285,13 @@ struct rio_net {
285 * @cwrite: Callback to perform network write of config space. 285 * @cwrite: Callback to perform network write of config space.
286 * @dsend: Callback to send a doorbell message. 286 * @dsend: Callback to send a doorbell message.
287 * @pwenable: Callback to enable/disable port-write message handling. 287 * @pwenable: Callback to enable/disable port-write message handling.
288 * @open_outb_mbox: Callback to initialize outbound mailbox.
289 * @close_outb_mbox: Callback to shut down outbound mailbox.
290 * @open_inb_mbox: Callback to initialize inbound mailbox.
291 * @close_inb_mbox: Callback to shut down inbound mailbox.
292 * @add_outb_message: Callback to add a message to an outbound mailbox queue.
293 * @add_inb_buffer: Callback to add a buffer to an inbound mailbox queue.
294 * @get_inb_message: Callback to get a message from an inbound mailbox queue.
288 */ 295 */
289struct rio_ops { 296struct rio_ops {
290 int (*lcread) (struct rio_mport *mport, int index, u32 offset, int len, 297 int (*lcread) (struct rio_mport *mport, int index, u32 offset, int len,
@@ -297,6 +304,16 @@ struct rio_ops {
297 u8 hopcount, u32 offset, int len, u32 data); 304 u8 hopcount, u32 offset, int len, u32 data);
298 int (*dsend) (struct rio_mport *mport, int index, u16 destid, u16 data); 305 int (*dsend) (struct rio_mport *mport, int index, u16 destid, u16 data);
299 int (*pwenable) (struct rio_mport *mport, int enable); 306 int (*pwenable) (struct rio_mport *mport, int enable);
307 int (*open_outb_mbox)(struct rio_mport *mport, void *dev_id,
308 int mbox, int entries);
309 void (*close_outb_mbox)(struct rio_mport *mport, int mbox);
310 int (*open_inb_mbox)(struct rio_mport *mport, void *dev_id,
311 int mbox, int entries);
312 void (*close_inb_mbox)(struct rio_mport *mport, int mbox);
313 int (*add_outb_message)(struct rio_mport *mport, struct rio_dev *rdev,
314 int mbox, void *buffer, size_t len);
315 int (*add_inb_buffer)(struct rio_mport *mport, int mbox, void *buf);
316 void *(*get_inb_message)(struct rio_mport *mport, int mbox);
300}; 317};
301 318
302#define RIO_RESOURCE_MEM 0x00000100 319#define RIO_RESOURCE_MEM 0x00000100
@@ -380,10 +397,6 @@ union rio_pw_msg {
380/* Architecture and hardware-specific functions */ 397/* Architecture and hardware-specific functions */
381extern int rio_init_mports(void); 398extern int rio_init_mports(void);
382extern void rio_register_mport(struct rio_mport *); 399extern void rio_register_mport(struct rio_mport *);
383extern int rio_hw_add_outb_message(struct rio_mport *, struct rio_dev *, int,
384 void *, size_t);
385extern int rio_hw_add_inb_buffer(struct rio_mport *, int, void *);
386extern void *rio_hw_get_inb_message(struct rio_mport *, int);
387extern int rio_open_inb_mbox(struct rio_mport *, void *, int, int); 400extern int rio_open_inb_mbox(struct rio_mport *, void *, int, int);
388extern void rio_close_inb_mbox(struct rio_mport *, int); 401extern void rio_close_inb_mbox(struct rio_mport *, int);
389extern int rio_open_outb_mbox(struct rio_mport *, void *, int, int); 402extern 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 e09e565c4bce..229b3ca23134 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,
317 struct rio_dev *rdev, int mbox, 317 struct rio_dev *rdev, int mbox,
318 void *buffer, size_t len) 318 void *buffer, size_t len)
319{ 319{
320 return rio_hw_add_outb_message(mport, rdev, mbox, buffer, len); 320 return mport->ops->add_outb_message(mport, rdev, mbox,
321 buffer, len);
321} 322}
322 323
323extern int rio_request_inb_mbox(struct rio_mport *, void *, int, int, 324extern 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);
336static inline int rio_add_inb_buffer(struct rio_mport *mport, int mbox, 337static inline int rio_add_inb_buffer(struct rio_mport *mport, int mbox,
337 void *buffer) 338 void *buffer)
338{ 339{
339 return rio_hw_add_inb_buffer(mport, mbox, buffer); 340 return mport->ops->add_inb_buffer(mport, mbox, buffer);
340} 341}
341 342
342/** 343/**
@@ -348,7 +349,7 @@ static inline int rio_add_inb_buffer(struct rio_mport *mport, int mbox,
348 */ 349 */
349static inline void *rio_get_inb_message(struct rio_mport *mport, int mbox) 350static inline void *rio_get_inb_message(struct rio_mport *mport, int mbox)
350{ 351{
351 return rio_hw_get_inb_message(mport, mbox); 352 return mport->ops->get_inb_message(mport, mbox);
352} 353}
353 354
354/* Doorbell management */ 355/* Doorbell management */