/drivers/staging/hv/channel.h

https://bitbucket.org/accelecon/linux-at91 · C Header · 112 lines · 69 code · 19 blank · 24 comment · 0 complexity · 24bba71d8bb8cb826c04a986f4d2fe13 MD5 · raw file

  1. /*
  2. *
  3. * Copyright (c) 2009, Microsoft Corporation.
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms and conditions of the GNU General Public License,
  7. * version 2, as published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12. * more details.
  13. *
  14. * You should have received a copy of the GNU General Public License along with
  15. * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
  16. * Place - Suite 330, Boston, MA 02111-1307 USA.
  17. *
  18. * Authors:
  19. * Haiyang Zhang <haiyangz@microsoft.com>
  20. * Hank Janssen <hjanssen@microsoft.com>
  21. *
  22. */
  23. #ifndef _CHANNEL_H_
  24. #define _CHANNEL_H_
  25. #include "channel_mgmt.h"
  26. /* The format must be the same as struct vmdata_gpa_direct */
  27. struct vmbus_channel_packet_page_buffer {
  28. u16 type;
  29. u16 dataoffset8;
  30. u16 length8;
  31. u16 flags;
  32. u64 transactionid;
  33. u32 reserved;
  34. u32 rangecount;
  35. struct hv_page_buffer range[MAX_PAGE_BUFFER_COUNT];
  36. } __packed;
  37. /* The format must be the same as struct vmdata_gpa_direct */
  38. struct vmbus_channel_packet_multipage_buffer {
  39. u16 type;
  40. u16 dataoffset8;
  41. u16 length8;
  42. u16 flags;
  43. u64 transactionid;
  44. u32 reserved;
  45. u32 rangecount; /* Always 1 in this case */
  46. struct hv_multipage_buffer range;
  47. } __packed;
  48. extern int vmbus_open(struct vmbus_channel *channel,
  49. u32 send_ringbuffersize,
  50. u32 recv_ringbuffersize,
  51. void *userdata,
  52. u32 userdatalen,
  53. void(*onchannel_callback)(void *context),
  54. void *context);
  55. extern void vmbus_close(struct vmbus_channel *channel);
  56. extern int vmbus_sendpacket(struct vmbus_channel *channel,
  57. const void *buffer,
  58. u32 bufferLen,
  59. u64 requestid,
  60. enum vmbus_packet_type type,
  61. u32 flags);
  62. extern int vmbus_sendpacket_pagebuffer(struct vmbus_channel *channel,
  63. struct hv_page_buffer pagebuffers[],
  64. u32 pagecount,
  65. void *buffer,
  66. u32 bufferlen,
  67. u64 requestid);
  68. extern int vmbus_sendpacket_multipagebuffer(struct vmbus_channel *channel,
  69. struct hv_multipage_buffer *mpb,
  70. void *buffer,
  71. u32 bufferlen,
  72. u64 requestid);
  73. extern int vmbus_establish_gpadl(struct vmbus_channel *channel,
  74. void *kbuffer,
  75. u32 size,
  76. u32 *gpadl_handle);
  77. extern int vmbus_teardown_gpadl(struct vmbus_channel *channel,
  78. u32 gpadl_handle);
  79. extern int vmbus_recvpacket(struct vmbus_channel *channel,
  80. void *buffer,
  81. u32 bufferlen,
  82. u32 *buffer_actual_len,
  83. u64 *requestid);
  84. extern int vmbus_recvpacket_raw(struct vmbus_channel *channel,
  85. void *buffer,
  86. u32 bufferlen,
  87. u32 *buffer_actual_len,
  88. u64 *requestid);
  89. extern void vmbus_onchannel_event(struct vmbus_channel *channel);
  90. extern void vmbus_get_debug_info(struct vmbus_channel *channel,
  91. struct vmbus_channel_debug_info *debug);
  92. extern void vmbus_ontimer(unsigned long data);
  93. #endif /* _CHANNEL_H_ */