Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b33fdd6c authored by Stefan Richter's avatar Stefan Richter
Browse files

ieee1394: add hpsb_node_read() and hpsb_node_lock()



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: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
parent 29f8ea8a
Loading
Loading
Loading
Loading
+18 −0
Original line number Original line Diff line number Diff line
@@ -21,9 +21,11 @@
#define _IEEE1394_NODEMGR_H
#define _IEEE1394_NODEMGR_H


#include <linux/device.h>
#include <linux/device.h>
#include <asm/system.h>
#include <asm/types.h>
#include <asm/types.h>


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


struct csr1212_csr;
struct csr1212_csr;
@@ -154,6 +156,22 @@ static inline int hpsb_node_entry_valid(struct node_entry *ne)
void hpsb_node_fill_packet(struct node_entry *ne, struct hpsb_packet *packet);
void hpsb_node_fill_packet(struct node_entry *ne, struct hpsb_packet *packet);
int hpsb_node_write(struct node_entry *ne, u64 addr,
int hpsb_node_write(struct node_entry *ne, u64 addr,
		    quadlet_t *buffer, size_t length);
		    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 nodemgr_for_each_host(void *data, int (*cb)(struct hpsb_host *, void *));


int init_ieee1394_nodemgr(void);
int init_ieee1394_nodemgr(void);