2005-04-16 15:20:36 -07:00
|
|
|
#ifndef _IEEE1394_TRANSACTIONS_H
|
|
|
|
#define _IEEE1394_TRANSACTIONS_H
|
|
|
|
|
|
|
|
#include "ieee1394_core.h"
|
|
|
|
|
|
|
|
int hpsb_get_tlabel(struct hpsb_packet *packet);
|
|
|
|
void hpsb_free_tlabel(struct hpsb_packet *packet);
|
|
|
|
struct hpsb_packet *hpsb_make_readpacket(struct hpsb_host *host, nodeid_t node,
|
|
|
|
u64 addr, size_t length);
|
|
|
|
struct hpsb_packet *hpsb_make_lockpacket(struct hpsb_host *host, nodeid_t node,
|
2006-07-03 09:02:28 -07:00
|
|
|
u64 addr, int extcode, quadlet_t *data,
|
2005-04-16 15:20:36 -07:00
|
|
|
quadlet_t arg);
|
2006-07-03 09:02:28 -07:00
|
|
|
struct hpsb_packet *hpsb_make_lock64packet(struct hpsb_host *host,
|
|
|
|
nodeid_t node, u64 addr, int extcode,
|
|
|
|
octlet_t *data, octlet_t arg);
|
|
|
|
struct hpsb_packet *hpsb_make_phypacket(struct hpsb_host *host, quadlet_t data);
|
|
|
|
struct hpsb_packet *hpsb_make_isopacket(struct hpsb_host *host, int length,
|
|
|
|
int channel, int tag, int sync);
|
|
|
|
struct hpsb_packet *hpsb_make_writepacket(struct hpsb_host *host,
|
|
|
|
nodeid_t node, u64 addr,
|
|
|
|
quadlet_t *buffer, size_t length);
|
2005-04-16 15:20:36 -07:00
|
|
|
struct hpsb_packet *hpsb_make_streampacket(struct hpsb_host *host, u8 *buffer,
|
2006-07-03 09:02:28 -07:00
|
|
|
int length, int channel, int tag,
|
|
|
|
int sync);
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
/*
|
|
|
|
* hpsb_packet_success - Make sense of the ack and reply codes and
|
|
|
|
* return more convenient error codes:
|
|
|
|
* 0 success
|
|
|
|
* -EBUSY node is busy, try again
|
|
|
|
* -EAGAIN error which can probably resolved by retry
|
|
|
|
* -EREMOTEIO node suffers from an internal error
|
|
|
|
* -EACCES this transaction is not allowed on requested address
|
|
|
|
* -EINVAL invalid address at node
|
|
|
|
*/
|
|
|
|
int hpsb_packet_success(struct hpsb_packet *packet);
|
|
|
|
|
|
|
|
/*
|
2006-07-03 09:02:28 -07:00
|
|
|
* The generic read and write functions. All recognize the local node ID
|
2005-04-16 15:20:36 -07:00
|
|
|
* and act accordingly. Read and write automatically use quadlet commands if
|
|
|
|
* length == 4 and and block commands otherwise (however, they do not yet
|
|
|
|
* support lengths that are not a multiple of 4). You must explicitly specifiy
|
|
|
|
* the generation for which the node ID is valid, to avoid sending packets to
|
|
|
|
* the wrong nodes when we race with a bus reset.
|
|
|
|
*/
|
|
|
|
int hpsb_read(struct hpsb_host *host, nodeid_t node, unsigned int generation,
|
|
|
|
u64 addr, quadlet_t *buffer, size_t length);
|
|
|
|
int hpsb_write(struct hpsb_host *host, nodeid_t node, unsigned int generation,
|
|
|
|
u64 addr, quadlet_t *buffer, size_t length);
|
|
|
|
|
|
|
|
#endif /* _IEEE1394_TRANSACTIONS_H */
|