diff options
author | Alexandre Bounine <alexandre.bounine@idt.com> | 2016-03-22 14:26:44 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-03-22 15:36:02 -0700 |
commit | 9a0b062742e7e039273c0c2ba4b96ad9ec7e7d8f (patch) | |
tree | 902e3fd63e79f4911b2896a67e8e06d93626abd4 /include | |
parent | b6cb95e8eb97e51a1a1b5609b59df859cc6dc2f2 (diff) | |
download | lwn-9a0b062742e7e039273c0c2ba4b96ad9ec7e7d8f.tar.gz lwn-9a0b062742e7e039273c0c2ba4b96ad9ec7e7d8f.zip |
rapidio: add global inbound port write interfaces
Add new Port Write handler registration interfaces that attach PW
handlers to local mport device objects. This is different from old
interface that attaches PW callback to individual RapidIO device. The
new interfaces are intended for use for common event handling (e.g.
hot-plug notifications) while the old interface is available for
individual device drivers.
This patch is based on patch proposed by Andre van Herk but preserves
existing per-device interface and adds lock protection for list
handling.
Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com>
Cc: Matt Porter <mporter@kernel.crashing.org>
Cc: Aurelien Jacquiot <a-jacquiot@ti.com>
Cc: Andre van Herk <andre.van.herk@prodrive-technologies.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
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 | 2 | ||||
-rw-r--r-- | include/linux/rio_drv.h | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/include/linux/rio.h b/include/linux/rio.h index cb3c47543bb0..44f3da512c15 100644 --- a/include/linux/rio.h +++ b/include/linux/rio.h @@ -245,6 +245,7 @@ enum rio_phy_type { /** * struct rio_mport - RIO master port info * @dbells: List of doorbell events + * @pwrites: List of portwrite events * @node: Node in global list of master ports * @nnode: Node in network list of master ports * @net: RIO net this mport is attached to @@ -270,6 +271,7 @@ enum rio_phy_type { */ struct rio_mport { struct list_head dbells; /* list of doorbell events */ + struct list_head pwrites; /* list of portwrite events */ struct list_head node; /* node in global list of ports */ struct list_head nnode; /* node in net list of ports */ struct rio_net *net; /* RIO net this mport is attached to */ diff --git a/include/linux/rio_drv.h b/include/linux/rio_drv.h index 9fb2bcd0a987..5dff9a4cb675 100644 --- a/include/linux/rio_drv.h +++ b/include/linux/rio_drv.h @@ -374,7 +374,14 @@ extern void rio_unmap_inb_region(struct rio_mport *mport, dma_addr_t lstart); extern int rio_request_inb_pwrite(struct rio_dev *, int (*)(struct rio_dev *, union rio_pw_msg*, int)); extern int rio_release_inb_pwrite(struct rio_dev *); -extern int rio_inb_pwrite_handler(union rio_pw_msg *pw_msg); +extern int rio_add_mport_pw_handler(struct rio_mport *mport, void *dev_id, + int (*pwcback)(struct rio_mport *mport, void *dev_id, + union rio_pw_msg *msg, int step)); +extern int rio_del_mport_pw_handler(struct rio_mport *mport, void *dev_id, + int (*pwcback)(struct rio_mport *mport, void *dev_id, + union rio_pw_msg *msg, int step)); +extern int rio_inb_pwrite_handler(struct rio_mport *mport, + union rio_pw_msg *pw_msg); extern void rio_pw_enable(struct rio_mport *mport, int enable); /* LDM support */ |