* option) any later version.
*/
-#include <linux/config.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/rio_regs.h>
#include <linux/module.h>
#include <linux/spinlock.h>
+#include <linux/slab.h>
+#include <linux/interrupt.h>
#include "rio.h"
rio_local_read_config_32(port, RIO_DID_CSR, &result);
- return (RIO_GET_DID(result));
+ return (RIO_GET_DID(port->sys_size, result));
}
/**
* rio_request_inb_mbox - request inbound mailbox service
* @mport: RIO master port from which to allocate the mailbox resource
+ * @dev_id: Device specific pointer to pass on event
* @mbox: Mailbox number to claim
* @entries: Number of entries in inbound mailbox queue
* @minb: Callback to execute when inbound message is received
* a callback function to the resource. Returns %0 on success.
*/
int rio_request_inb_mbox(struct rio_mport *mport,
+ void *dev_id,
int mbox,
int entries,
- void (*minb) (struct rio_mport * mport, int mbox,
+ void (*minb) (struct rio_mport * mport, void *dev_id, int mbox,
int slot))
{
int rc = 0;
/* Hook the inbound message callback */
mport->inb_msg[mbox].mcback = minb;
- rc = rio_open_inb_mbox(mport, mbox, entries);
+ rc = rio_open_inb_mbox(mport, dev_id, mbox, entries);
} else
rc = -ENOMEM;
/**
* rio_request_outb_mbox - request outbound mailbox service
* @mport: RIO master port from which to allocate the mailbox resource
+ * @dev_id: Device specific pointer to pass on event
* @mbox: Mailbox number to claim
* @entries: Number of entries in outbound mailbox queue
* @moutb: Callback to execute when outbound message is sent
* a callback function to the resource. Returns 0 on success.
*/
int rio_request_outb_mbox(struct rio_mport *mport,
+ void *dev_id,
int mbox,
int entries,
- void (*moutb) (struct rio_mport * mport, int mbox,
- int slot))
+ void (*moutb) (struct rio_mport * mport, void *dev_id, int mbox, int slot))
{
int rc = 0;
/* Hook the inbound message callback */
mport->outb_msg[mbox].mcback = moutb;
- rc = rio_open_outb_mbox(mport, mbox, entries);
+ rc = rio_open_outb_mbox(mport, dev_id, mbox, entries);
} else
rc = -ENOMEM;
/**
* rio_setup_inb_dbell - bind inbound doorbell callback
* @mport: RIO master port to bind the doorbell callback
+ * @dev_id: Device specific pointer to pass on event
* @res: Doorbell message resource
* @dinb: Callback to execute when doorbell is received
*
* satisfied.
*/
static int
-rio_setup_inb_dbell(struct rio_mport *mport, struct resource *res,
- void (*dinb) (struct rio_mport * mport, u16 src, u16 dst,
+rio_setup_inb_dbell(struct rio_mport *mport, void *dev_id, struct resource *res,
+ void (*dinb) (struct rio_mport * mport, void *dev_id, u16 src, u16 dst,
u16 info))
{
int rc = 0;
dbell->res = res;
dbell->dinb = dinb;
+ dbell->dev_id = dev_id;
list_add_tail(&dbell->node, &mport->dbells);
/**
* rio_request_inb_dbell - request inbound doorbell message service
* @mport: RIO master port from which to allocate the doorbell resource
+ * @dev_id: Device specific pointer to pass on event
* @start: Doorbell info range start
* @end: Doorbell info range end
* @dinb: Callback to execute when doorbell is received
* has been satisfied.
*/
int rio_request_inb_dbell(struct rio_mport *mport,
+ void *dev_id,
u16 start,
u16 end,
- void (*dinb) (struct rio_mport * mport, u16 src,
+ void (*dinb) (struct rio_mport * mport, void *dev_id, u16 src,
u16 dst, u16 info))
{
int rc = 0;
}
/* Hook the doorbell callback */
- rc = rio_setup_inb_dbell(mport, res, dinb);
+ rc = rio_setup_inb_dbell(mport, dev_id, res, dinb);
} else
rc = -ENOMEM;
device_initcall(rio_init);
-int rio_init_mports(void)
+int __devinit rio_init_mports(void)
{
int rc = 0;
struct rio_mport *port;
port->iores.end - port->iores.start,
port->name)) {
printk(KERN_ERR
- "RIO: Error requesting master port region %8.8lx-%8.8lx\n",
- port->iores.start, port->iores.end - 1);
+ "RIO: Error requesting master port region 0x%016llx-0x%016llx\n",
+ (u64)port->iores.start, (u64)port->iores.end - 1);
rc = -ENOMEM;
goto out;
}