[patch 02/10] ieee1394: add hpsb_node_read() and hpsb_node_lock()

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <devel@...>
Date: Monday, September 29, 2008 - 1:17 pm

Date: Wed, 27 Aug 2008 13:40:02 +0200
From: Stefan Richter

These will be used by the firedtv driver. Like hpsb_node_write() they
are much better APIs for high-level drivers than hpsb_write() and its
siblings --- easier to use correctly and also terser.

Unlike hspb_node_write(), the two new functions will only be used by
one call site. Hence make them static inline instead of exported
symbols.

Signed-off-by: Stefan Richter
---
drivers/ieee1394/nodemgr.h | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)

Index: linux/drivers/ieee1394/nodemgr.h
===================================================================
--- linux.orig/drivers/ieee1394/nodemgr.h
+++ linux/drivers/ieee1394/nodemgr.h
@@ -21,9 +21,11 @@
#define _IEEE1394_NODEMGR_H

#include
+#include
#include

#include "ieee1394_core.h"
+#include "ieee1394_transactions.h"
#include "ieee1394_types.h"

struct csr1212_csr;
@@ -157,6 +159,22 @@ static inline int hpsb_node_entry_valid(
void hpsb_node_fill_packet(struct node_entry *ne, struct hpsb_packet *packet);
int hpsb_node_write(struct node_entry *ne, u64 addr,
quadlet_t *buffer, size_t length);
+static inline int hpsb_node_read(struct node_entry *ne, u64 addr,
+ quadlet_t *buffer, size_t length)
+{
+ unsigned int g = ne->generation;
+
+ smp_rmb();
+ return hpsb_read(ne->host, ne->nodeid, g, addr, buffer, length);
+}
+static inline int hpsb_node_lock(struct node_entry *ne, u64 addr, int extcode,
+ quadlet_t *buffer, quadlet_t arg)
+{
+ unsigned int g = ne->generation;
+
+ smp_rmb();
+ return hpsb_lock(ne->host, ne->nodeid, g, addr, extcode, buffer, arg);
+}
int nodemgr_for_each_host(void *data, int (*cb)(struct hpsb_host *, void *));

int init_ieee1394_nodemgr(void);

--
Stefan Richter
-=====-==--- =--= ===-=
http://arcgraph.de/sr/

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Gettinng started with Linux drivers, Amit Uttamchandani, (Fri Apr 10, 6:04 pm)
broken mailing list, try 47..., Greg KH, (Fri Jan 11, 3:12 pm)
Mailing Lists, Tomasz Grzegurzko, (Fri Feb 8, 8:22 pm)
what is the status of this initiative ?, JoJo jojo, (Thu Mar 13, 3:20 am)
A tablet driver question, Steven Hunt, (Wed May 20, 12:49 am)
Dearest Beloved,, Mr. Kunio Uematsu, (Tue Mar 16, 3:52 pm)
[patch 00/10] firedtv: a few more updates, Stefan Richter, (Mon Sep 29, 1:15 pm)
Re: A tablet driver question, Greg KH, (Wed May 20, 1:12 am)
Re: A tablet driver question, Steven Hunt, (Wed May 20, 2:16 am)
Re: A tablet driver question, Jiri Slaby, (Wed May 20, 3:19 am)
Re: A tablet driver question, Steven Hunt, (Wed May 20, 11:58 am)
Re: A tablet driver question, Jiri Slaby, (Wed May 20, 12:24 pm)
Re: A tablet driver question, Mohamed Ikbel Boulabiar, (Wed May 20, 12:50 pm)
Re: A tablet driver question, Jiri Kosina, (Thu May 21, 4:33 am)
Re: Gettinng started with Linux drivers, Stefan Richter, (Sat Apr 11, 6:00 am)
Re: Gettinng started with Linux drivers, Amit Uttamchandani, (Sun Apr 12, 9:08 pm)
Re: Gettinng started with Linux drivers, Stefan Richter, (Mon Apr 13, 3:39 am)
Re: [patch 00/10] firedtv: a few more updates, Stefan Richter, (Mon Sep 29, 1:46 pm)
[patch 08/10] firedtv: remove unused struct members, Stefan Richter, (Mon Sep 29, 1:21 pm)
[patch 02/10] ieee1394: add hpsb_node_read() and hpsb_node_l..., Stefan Richter, (Mon Sep 29, 1:17 pm)
Re: what is the status of this initiative ?, Greg KH, (Thu Mar 13, 10:51 am)
Re: what is the status of this initiative ?, Javi Roman, (Thu Mar 13, 1:13 pm)
Re: what is the status of this initiative ?, Greg KH, (Thu Mar 13, 1:36 pm)
Re: what is the status of this initiative ?, Davide Madrisan, (Thu Mar 13, 1:30 pm)
Re: broken mailing list, try 47..., Steven Le Roux, (Sat Jan 12, 2:10 pm)
Re: broken mailing list, try 47..., stuart, (Sat Jan 12, 6:56 pm)
Kick off the Linux Driver Project (again, this time for real), Peter W. Morreale, (Thu Sep 27, 9:21 am)
Kick off the Linux Driver Project (again, this time for real), Peter W. Morreale, (Thu Sep 27, 9:55 am)
Kick off the Linux Driver Project (again, this time for real), Peter W. Morreale, (Thu Sep 27, 10:58 am)
Kick off the Linux Driver Project (again, this time for real), Tomasz Grzegurzko, (Thu Sep 27, 9:40 pm)