ieee1394_transactions.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #ifndef _IEEE1394_TRANSACTIONS_H
  2. #define _IEEE1394_TRANSACTIONS_H
  3. #include "ieee1394_core.h"
  4. /*
  5. * Get and free transaction labels.
  6. */
  7. int hpsb_get_tlabel(struct hpsb_packet *packet);
  8. void hpsb_free_tlabel(struct hpsb_packet *packet);
  9. struct hpsb_packet *hpsb_make_readpacket(struct hpsb_host *host, nodeid_t node,
  10. u64 addr, size_t length);
  11. struct hpsb_packet *hpsb_make_lockpacket(struct hpsb_host *host, nodeid_t node,
  12. u64 addr, int extcode, quadlet_t *data,
  13. quadlet_t arg);
  14. struct hpsb_packet *hpsb_make_lock64packet(struct hpsb_host *host, nodeid_t node,
  15. u64 addr, int extcode, octlet_t *data,
  16. octlet_t arg);
  17. struct hpsb_packet *hpsb_make_phypacket(struct hpsb_host *host,
  18. quadlet_t data) ;
  19. struct hpsb_packet *hpsb_make_isopacket(struct hpsb_host *host,
  20. int length, int channel,
  21. int tag, int sync);
  22. struct hpsb_packet *hpsb_make_writepacket (struct hpsb_host *host, nodeid_t node,
  23. u64 addr, quadlet_t *buffer, size_t length);
  24. struct hpsb_packet *hpsb_make_streampacket(struct hpsb_host *host, u8 *buffer,
  25. int length, int channel, int tag, int sync);
  26. /*
  27. * hpsb_packet_success - Make sense of the ack and reply codes and
  28. * return more convenient error codes:
  29. * 0 success
  30. * -EBUSY node is busy, try again
  31. * -EAGAIN error which can probably resolved by retry
  32. * -EREMOTEIO node suffers from an internal error
  33. * -EACCES this transaction is not allowed on requested address
  34. * -EINVAL invalid address at node
  35. */
  36. int hpsb_packet_success(struct hpsb_packet *packet);
  37. /*
  38. * The generic read, write and lock functions. All recognize the local node ID
  39. * and act accordingly. Read and write automatically use quadlet commands if
  40. * length == 4 and and block commands otherwise (however, they do not yet
  41. * support lengths that are not a multiple of 4). You must explicitly specifiy
  42. * the generation for which the node ID is valid, to avoid sending packets to
  43. * the wrong nodes when we race with a bus reset.
  44. */
  45. int hpsb_read(struct hpsb_host *host, nodeid_t node, unsigned int generation,
  46. u64 addr, quadlet_t *buffer, size_t length);
  47. int hpsb_write(struct hpsb_host *host, nodeid_t node, unsigned int generation,
  48. u64 addr, quadlet_t *buffer, size_t length);
  49. int hpsb_lock(struct hpsb_host *host, nodeid_t node, unsigned int generation,
  50. u64 addr, int extcode, quadlet_t *data, quadlet_t arg);
  51. int hpsb_lock64(struct hpsb_host *host, nodeid_t node, unsigned int generation,
  52. u64 addr, int extcode, octlet_t *data, octlet_t arg);
  53. int hpsb_send_gasp(struct hpsb_host *host, int channel, unsigned int generation,
  54. quadlet_t *buffer, size_t length, u32 specifier_id,
  55. unsigned int version);
  56. #endif /* _IEEE1394_TRANSACTIONS_H */