iPXE
vmbus.h
Go to the documentation of this file.
1 #ifndef _IPXE_VMBUS_H
2 #define _IPXE_VMBUS_H
3 
4 /** @file
5  *
6  * Hyper-V virtual machine bus
7  *
8  */
9 
10 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11 
12 #include <byteswap.h>
13 #include <ipxe/uuid.h>
14 #include <ipxe/device.h>
15 #include <ipxe/tables.h>
16 #include <ipxe/iobuf.h>
17 #include <ipxe/hyperv.h>
18 
19 /** VMBus message connection ID */
20 #define VMBUS_MESSAGE_ID 1
21 
22 /** VMBus event connection ID */
23 #define VMBUS_EVENT_ID 2
24 
25 /** VMBus message type */
26 #define VMBUS_MESSAGE_TYPE 1
27 
28 /** VMBus message synthetic interrupt */
29 #define VMBUS_MESSAGE_SINT 2
30 
31 /** VMBus version number */
33  /** Raw version */
35  /** Major/minor version */
36  struct {
37  /** Minor version */
39  /** Major version */
41  };
42 } __attribute__ (( packed ));
43 
44 /** Known VMBus protocol versions */
46  /** Windows Server 2008 */
47  VMBUS_VERSION_WS2008 = ( ( 0 << 16 ) | ( 13 << 0 ) ),
48  /** Windows 7 */
49  VMBUS_VERSION_WIN7 = ( ( 1 << 16 ) | ( 1 << 0 ) ),
50  /** Windows 8 */
51  VMBUS_VERSION_WIN8 = ( ( 2 << 16 ) | ( 4 << 0 ) ),
52  /** Windows 8.1 */
53  VMBUS_VERSION_WIN8_1 = ( ( 3 << 16 ) | ( 0 << 0 ) ),
54 };
55 
56 /** Guest physical address range descriptor */
58  /** Byte count */
60  /** Starting byte offset */
62  /** Page frame numbers
63  *
64  * The length of this array is implied by the byte count and
65  * starting offset.
66  */
68 } __attribute__ (( packed ));
69 
70 /** VMBus message header */
72  /** Message type */
74  /** Reserved */
76 } __attribute__ (( packed ));
77 
78 /** VMBus message types */
94 };
95 
96 /** VMBus "offer channel" message */
98  /** Message header */
100  /** Channel type */
101  union uuid type;
102  /** Channel instance */
103  union uuid instance;
104  /** Reserved */
106  /** Flags */
108  /** Reserved */
110  /** User data */
111  uint8_t data[120];
112  /** Reserved */
114  /** Channel ID */
116  /** Monitor ID */
118  /** Monitor exists */
120  /** Reserved */
122  /** Connection ID */
124 } __attribute__ (( packed ));
125 
126 /** VMBus "open channel" message */
128  /** Message header */
130  /** Channel ID */
132  /** Open ID */
134  /** Ring buffer GPADL ID */
136  /** Reserved */
138  /** Outbound ring buffer size (in pages) */
140  /** User-specific data */
141  uint8_t data[120];
142 } __attribute__ (( packed ));
143 
144 /** VMBus "open channel result" message */
146  /** Message header */
148  /** Channel ID */
150  /** Open ID */
152  /** Status */
154 } __attribute__ (( packed ));
155 
156 /** VMBus "close channel" message */
158  /** Message header */
160  /** Channel ID */
162 } __attribute__ (( packed ));
163 
164 /** VMBus "GPADL header" message */
166  /** Message header */
168  /** Channel ID */
170  /** GPADL ID */
172  /** Length of range descriptors */
174  /** Number of range descriptors */
176  /** Range descriptors */
178 } __attribute__ (( packed ));
179 
180 /** VMBus "GPADL created" message */
182  /** Message header */
184  /** Channel ID */
186  /** GPADL ID */
188  /** Creation status */
190 } __attribute__ (( packed ));
191 
192 /** VMBus "GPADL teardown" message */
194  /** Message header */
196  /** Channel ID */
198  /** GPADL ID */
200 } __attribute__ (( packed ));
201 
202 /** VMBus "GPADL torndown" message */
204  /** Message header */
206  /** GPADL ID */
208 } __attribute__ (( packed ));
209 
210 /** VMBus "initiate contact" message */
212  /** Message header */
214  /** Requested version */
216  /** Target virtual CPU */
218  /** Interrupt page base address */
220  /** Parent to child monitor page base address */
222  /** Child to parent monitor page base address */
224 } __attribute__ (( packed ));
225 
226 /** VMBus "version response" message */
228  /** Message header */
230  /** Version is supported */
232  /** Reserved */
234  /** Version */
236 } __attribute__ (( packed ));
237 
238 /** VMBus message */
240  /** Common message header */
242  /** "Offer channel" message */
244  /** "Open channel" message */
246  /** "Open channel result" message */
248  /** "Close channel" message */
250  /** "GPADL header" message */
252  /** "GPADL created" message */
254  /** "GPADL teardown" message */
256  /** "GPADL torndown" message */
258  /** "Initiate contact" message */
260  /** "Version response" message */
262 };
263 
264 /** VMBus packet header */
266  /** Type */
268  /** Length of packet header (in quadwords) */
270  /** Length of packet (in quadwords) */
272  /** Flags */
274  /** Transaction ID
275  *
276  * This is an opaque token: we therefore treat it as
277  * native-endian and don't worry about byte-swapping.
278  */
280 } __attribute__ (( packed ));
281 
282 /** VMBus packet types */
289 };
290 
291 /** VMBus packet flags */
294 };
295 
296 /** VMBus GPA direct header */
298  /** Packet header */
300  /** Reserved */
302  /** Number of range descriptors */
304  /** Range descriptors */
306 } __attribute__ (( packed ));
307 
308 /** VMBus transfer page range */
310  /** Length */
312  /** Offset */
314 } __attribute__ (( packed ));
315 
316 /** VMBus transfer page header */
318  /** Packet header */
320  /** Page set ID */
322  /** Sender owns page set */
324  /** Reserved */
326  /** Number of range descriptors */
328  /** Range descriptors */
330 } __attribute__ (( packed ));
331 
332 /** Maximum expected size of VMBus packet header */
333 #define VMBUS_PACKET_MAX_HEADER_LEN 64
334 
335 /** VMBus maximum-sized packet header */
337  /** Common header */
339  /** GPA direct header */
341  /** Transfer page header */
343  /** Padding to maximum supported size */
345 } __attribute__ (( packed ));
346 
347 /** VMBus packet footer */
349  /** Reserved */
351  /** Producer index of the first byte of the packet */
353 } __attribute__ (( packed ));
354 
355 /** VMBus ring buffer
356  *
357  * This is the structure of the each of the ring buffers created when
358  * a VMBus channel is opened.
359  */
360 struct vmbus_ring {
361  /** Producer index (modulo ring length) */
363  /** Consumer index (modulo ring length) */
365  /** Interrupt mask */
367  /** Reserved */
369  /** Ring buffer contents */
371 } __attribute__ (( packed ));
372 
373 /** VMBus interrupt page */
375  /** Inbound interrupts */
377  /** Outbound interrupts */
379 } __attribute__ (( packed ));
380 
381 /** A virtual machine bus */
382 struct vmbus {
383  /** Interrupt page */
385  /** Inbound notifications */
387  /** Outbound notifications */
389  /** Received message buffer */
390  const union vmbus_message *message;
391 };
392 
393 struct vmbus_device;
394 
395 /** VMBus channel operations */
397  /**
398  * Handle received control packet
399  *
400  * @v vmdev VMBus device
401  * @v xid Transaction ID
402  * @v data Data
403  * @v len Length of data
404  * @ret rc Return status code
405  */
406  int ( * recv_control ) ( struct vmbus_device *vmdev, uint64_t xid,
407  const void *data, size_t len );
408  /**
409  * Handle received data packet
410  *
411  * @v vmdev VMBus device
412  * @v xid Transaction ID
413  * @v data Data
414  * @v len Length of data
415  * @v list List of I/O buffers
416  * @ret rc Return status code
417  *
418  * This function takes ownership of the I/O buffer. It should
419  * eventually call vmbus_send_completion() to indicate to the
420  * host that the buffer can be reused.
421  */
422  int ( * recv_data ) ( struct vmbus_device *vmdev, uint64_t xid,
423  const void *data, size_t len,
424  struct list_head *list );
425  /**
426  * Handle received completion packet
427  *
428  * @v vmdev VMBus device
429  * @v xid Transaction ID
430  * @v data Data
431  * @v len Length of data
432  * @ret rc Return status code
433  */
434  int ( * recv_completion ) ( struct vmbus_device *vmdev, uint64_t xid,
435  const void *data, size_t len );
436  /**
437  * Handle received cancellation packet
438  *
439  * @v vmdev VMBus device
440  * @v xid Transaction ID
441  * @ret rc Return status code
442  */
443  int ( * recv_cancellation ) ( struct vmbus_device *vmdev,
444  uint64_t xid );
445 };
446 
447 struct vmbus_xfer_pages;
448 
449 /** VMBus transfer page set operations */
451  /**
452  * Copy data from transfer page
453  *
454  * @v pages Transfer page set
455  * @v data Data buffer
456  * @v offset Offset within page set
457  * @v len Length within page set
458  * @ret rc Return status code
459  */
460  int ( * copy ) ( struct vmbus_xfer_pages *pages, void *data,
461  size_t offset, size_t len );
462 };
463 
464 /** VMBus transfer page set */
466  /** List of all transfer page sets */
467  struct list_head list;
468  /** Page set ID (in protocol byte order) */
470  /** Page set operations */
472 };
473 
474 /** A VMBus device */
475 struct vmbus_device {
476  /** Generic iPXE device */
477  struct device dev;
478  /** Hyper-V hypervisor */
479  struct hv_hypervisor *hv;
480 
481  /** Channel instance */
482  union uuid instance;
483  /** Channel ID */
484  unsigned int channel;
485  /** Monitor ID */
486  unsigned int monitor;
487  /** Signal channel
488  *
489  * @v vmdev VMBus device
490  */
491  void ( * signal ) ( struct vmbus_device *vmdev );
492 
493  /** Outbound ring buffer length */
495  /** Inbound ring buffer length */
497  /** Outbound ring buffer */
498  struct vmbus_ring *out;
499  /** Inbound ring buffer */
500  struct vmbus_ring *in;
501  /** Ring buffer GPADL ID */
502  unsigned int gpadl;
503 
504  /** Channel operations */
506  /** Maximum expected data packet length */
507  size_t mtu;
508  /** Packet buffer */
509  void *packet;
510  /** List of transfer page sets */
511  struct list_head pages;
512 
513  /** Driver */
515  /** Driver-private data */
516  void *priv;
517 };
518 
519 /** A VMBus device driver */
520 struct vmbus_driver {
521  /** Name */
522  const char *name;
523  /** Device type */
524  union uuid type;
525  /** Probe device
526  *
527  * @v vmdev VMBus device
528  * @ret rc Return status code
529  */
530  int ( * probe ) ( struct vmbus_device *vmdev );
531  /** Reset device
532  *
533  * @v vmdev VMBus device
534  * @ret rc Return status code
535  */
536  int ( * reset ) ( struct vmbus_device *vmdev );
537  /** Remove device
538  *
539  * @v vmdev VMBus device
540  */
541  void ( * remove ) ( struct vmbus_device *vmdev );
542 };
543 
544 /** VMBus device driver table */
545 #define VMBUS_DRIVERS __table ( struct vmbus_driver, "vmbus_drivers" )
546 
547 /** Declare a VMBus device driver */
548 #define __vmbus_driver __table_entry ( VMBUS_DRIVERS, 01 )
549 
550 /**
551  * Set VMBus device driver-private data
552  *
553  * @v vmdev VMBus device
554  * @v priv Private data
555  */
556 static inline void vmbus_set_drvdata ( struct vmbus_device *vmdev, void *priv ){
557  vmdev->priv = priv;
558 }
559 
560 /**
561  * Get VMBus device driver-private data
562  *
563  * @v vmdev VMBus device
564  * @ret priv Private data
565  */
566 static inline void * vmbus_get_drvdata ( struct vmbus_device *vmdev ) {
567  return vmdev->priv;
568 }
569 
570 /** Construct VMBus type */
571 #define VMBUS_TYPE( a, b, c, d, e0, e1, e2, e3, e4, e5 ) { \
572  .canonical = { \
573  cpu_to_le32 ( a ), cpu_to_le16 ( b ), \
574  cpu_to_le16 ( c ), cpu_to_be16 ( d ), \
575  { e0, e1, e2, e3, e4, e5 } \
576  } }
577 
578 /**
579  * Check if data is present in ring buffer
580  *
581  * @v vmdev VMBus device
582  * @v has_data Data is present
583  */
584 static inline __attribute__ (( always_inline )) int
585 vmbus_has_data ( struct vmbus_device *vmdev ) {
586 
587  return ( vmdev->in->prod != vmdev->in->cons );
588 }
589 
590 /**
591  * Register transfer page set
592  *
593  * @v vmdev VMBus device
594  * @v pages Transfer page set
595  * @ret rc Return status code
596  */
597 static inline __attribute__ (( always_inline )) int
599  struct vmbus_xfer_pages *pages ) {
600 
601  list_add ( &pages->list, &vmdev->pages );
602  return 0;
603 }
604 
605 /**
606  * Unregister transfer page set
607  *
608  * @v vmdev VMBus device
609  * @v pages Transfer page set
610  */
611 static inline __attribute__ (( always_inline )) void
613  struct vmbus_xfer_pages *pages ) {
614 
615  list_check_contains_entry ( pages, &vmdev->pages, list );
616  list_del ( &pages->list );
617 }
618 
619 extern unsigned int vmbus_obsolete_gpadl;
620 
621 /**
622  * Check if GPADL is obsolete
623  *
624  * @v gpadl GPADL ID
625  * @v is_obsolete GPADL ID is obsolete
626  *
627  * Check if GPADL is obsolete (i.e. was created before the most recent
628  * Hyper-V reset).
629  */
630 static inline __attribute__ (( always_inline )) int
631 vmbus_gpadl_is_obsolete ( unsigned int gpadl ) {
632 
633  return ( gpadl <= vmbus_obsolete_gpadl );
634 }
635 
636 extern int vmbus_establish_gpadl ( struct vmbus_device *vmdev, void *data,
637  size_t len );
638 extern int vmbus_gpadl_teardown ( struct vmbus_device *vmdev,
639  unsigned int gpadl );
640 extern int vmbus_open ( struct vmbus_device *vmdev,
642  size_t out_len, size_t in_len, size_t mtu );
643 extern void vmbus_close ( struct vmbus_device *vmdev );
644 extern int vmbus_send_control ( struct vmbus_device *vmdev, uint64_t xid,
645  const void *data, size_t len );
646 extern int vmbus_send_data ( struct vmbus_device *vmdev, uint64_t xid,
647  const void *data, size_t len,
648  struct io_buffer *iobuf );
649 extern int vmbus_send_completion ( struct vmbus_device *vmdev, uint64_t xid,
650  const void *data, size_t len );
651 extern int vmbus_send_cancellation ( struct vmbus_device *vmdev, uint64_t xid );
652 extern int vmbus_poll ( struct vmbus_device *vmdev );
653 extern void vmbus_dump_channel ( struct vmbus_device *vmdev );
654 
655 extern int vmbus_probe ( struct hv_hypervisor *hv, struct device *parent );
656 extern int vmbus_reset ( struct hv_hypervisor *hv, struct device *parent );
657 extern void vmbus_remove ( struct hv_hypervisor *hv, struct device *parent );
658 
659 #endif /* _IPXE_VMBUS_H */
uint32_t channel
Channel ID.
Definition: vmbus.h:149
#define __attribute__(x)
Definition: compiler.h:10
VMBus transfer page header.
Definition: vmbus.h:317
struct vmbus_message_header header
Message header.
Definition: vmbus.h:183
const char * name
Name.
Definition: vmbus.h:522
uint32_t channel
Channel ID.
Definition: vmbus.h:161
unsigned short uint16_t
Definition: stdint.h:11
struct vmbus_ring * out
Outbound ring buffer.
Definition: vmbus.h:498
uint8_t out[PAGE_SIZE/2]
Outbound interrupts.
Definition: vmbus.h:378
uint32_t raw
Raw version.
Definition: vmbus.h:34
struct vmbus_xfer_page_header xfer
Transfer page header.
Definition: vmbus.h:342
VMBus message header.
Definition: vmbus.h:71
struct device dev
Generic iPXE device.
Definition: vmbus.h:477
uint8_t padding[VMBUS_PACKET_MAX_HEADER_LEN]
Padding to maximum supported size.
Definition: vmbus.h:344
static int vmbus_has_data(struct vmbus_device *vmdev)
Check if data is present in ring buffer.
Definition: vmbus.h:585
uint16_t type
Type.
Definition: vmbus.h:267
struct vmbus_offer_channel offer
"Offer channel" message
Definition: vmbus.h:243
uint8_t reserved_b[2]
Reserved.
Definition: vmbus.h:109
void vmbus_close(struct vmbus_device *vmdev)
Close VMBus channel.
Definition: vmbus.c:524
int vmbus_poll(struct vmbus_device *vmdev)
Poll ring buffer.
Definition: vmbus.c:972
VMBus message.
Definition: vmbus.h:239
int(* recv_control)(struct vmbus_device *vmdev, uint64_t xid, const void *data, size_t len)
Handle received control packet.
Definition: vmbus.h:406
struct vmbus_message_header header
Message header.
Definition: vmbus.h:229
#define list_add(new, head)
Add a new entry to the head of a list.
Definition: list.h:69
int(* recv_data)(struct vmbus_device *vmdev, uint64_t xid, const void *data, size_t len, struct list_head *list)
Handle received data packet.
Definition: vmbus.h:422
uint32_t offset
Starting byte offset.
Definition: vmbus.h:61
A universally unique ID.
Definition: uuid.h:15
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
struct list_head list
List of all transfer page sets.
Definition: vmbus.h:467
uint8_t monitor
Monitor ID.
Definition: vmbus.h:117
struct vmbus_channel_operations * op
Channel operations.
Definition: vmbus.h:505
int(* recv_completion)(struct vmbus_device *vmdev, uint64_t xid, const void *data, size_t len)
Handle received completion packet.
Definition: vmbus.h:434
A monitor page.
Definition: hyperv.h:165
I/O buffers.
uint32_t channel
Channel ID.
Definition: vmbus.h:115
uint32_t connection
Connection ID.
Definition: vmbus.h:123
int vmbus_send_data(struct vmbus_device *vmdev, uint64_t xid, const void *data, size_t len, struct io_buffer *iobuf)
Send data packet via ring buffer.
Definition: vmbus.c:794
uint64_t monitor_in
Parent to child monitor page base address.
Definition: vmbus.h:221
uint8_t in[PAGE_SIZE/2]
Inbound interrupts.
Definition: vmbus.h:376
#define VMBUS_PACKET_MAX_HEADER_LEN
Maximum expected size of VMBus packet header.
Definition: vmbus.h:333
uint64_t monitor_out
Child to parent monitor page base address.
Definition: vmbus.h:223
uint32_t len
Byte count.
Definition: vmbus.h:59
vmbus_message_type
VMBus message types.
Definition: vmbus.h:79
A VMBus device.
Definition: vmbus.h:475
uint32_t status
Status.
Definition: vmbus.h:153
unsigned long long uint64_t
Definition: stdint.h:13
VMBus maximum-sized packet header.
Definition: vmbus.h:336
struct vmbus_message_header header
Message header.
Definition: vmbus.h:195
void * priv
Driver-private data.
Definition: vmbus.h:516
Universally unique IDs.
uint8_t owner
Sender owns page set.
Definition: vmbus.h:323
uint32_t out_len
Outbound ring buffer length.
Definition: vmbus.h:494
uint8_t reserved[4084]
Reserved.
Definition: vmbus.h:368
uint32_t gpadl
GPADL ID.
Definition: vmbus.h:207
struct vmbus_xfer_pages_operations * op
Page set operations.
Definition: vmbus.h:471
#define PAGE_SIZE
Page size.
Definition: io.h:27
struct vmbus_gpa_direct_header gpa
GPA direct header.
Definition: vmbus.h:340
uint8_t data[120]
User-specific data.
Definition: vmbus.h:141
uint64_t intr
Interrupt page base address.
Definition: vmbus.h:219
uint8_t reserved[3]
Reserved.
Definition: vmbus.h:233
union vmbus_version version
Requested version.
Definition: vmbus.h:215
uint32_t status
Creation status.
Definition: vmbus.h:189
VMBus "open channel" message.
Definition: vmbus.h:127
VMBus "GPADL created" message.
Definition: vmbus.h:181
vmbus_packet_type
VMBus packet types.
Definition: vmbus.h:283
struct vmbus_gpadl_torndown torndown
"GPADL torndown" message
Definition: vmbus.h:257
struct vmbus_packet_header header
Packet header.
Definition: vmbus.h:319
int vmbus_send_control(struct vmbus_device *vmdev, uint64_t xid, const void *data, size_t len)
Send control packet via ring buffer.
Definition: vmbus.c:765
A doubly-linked list entry (or list head)
Definition: list.h:18
static int vmbus_register_pages(struct vmbus_device *vmdev, struct vmbus_xfer_pages *pages)
Register transfer page set.
Definition: vmbus.h:598
VMBus "version response" message.
Definition: vmbus.h:227
struct vmbus_packet_header header
Common header.
Definition: vmbus.h:338
struct vmbus_gpa_range range[0]
Range descriptors.
Definition: vmbus.h:305
uint16_t pageset
Page set ID.
Definition: vmbus.h:321
const union vmbus_message * message
Received message buffer.
Definition: vmbus.h:390
Hyper-V interface.
Guest physical address range descriptor.
Definition: vmbus.h:57
uint32_t vcpu
Target virtual CPU.
Definition: vmbus.h:217
#define list_del(list)
Delete an entry from a list.
Definition: list.h:119
VMBus "initiate contact" message.
Definition: vmbus.h:211
uint32_t gpadl
GPADL ID.
Definition: vmbus.h:187
A hardware device.
Definition: device.h:76
uint32_t channel
Channel ID.
Definition: vmbus.h:185
uint32_t range_count
Number of range descriptors.
Definition: vmbus.h:327
uint32_t prod
Producer index (modulo ring length)
Definition: vmbus.h:362
uint8_t reserved
Reserved.
Definition: vmbus.h:325
uint16_t pageset
Page set ID (in protocol byte order)
Definition: vmbus.h:469
uint32_t channel
Channel ID.
Definition: vmbus.h:169
static int vmbus_gpadl_is_obsolete(unsigned int gpadl)
Check if GPADL is obsolete.
Definition: vmbus.h:631
uint32_t cons
Consumer index (modulo ring length)
Definition: vmbus.h:364
int vmbus_gpadl_teardown(struct vmbus_device *vmdev, unsigned int gpadl)
Tear down GPA descriptor list.
Definition: vmbus.c:347
struct vmbus_packet_header header
Packet header.
Definition: vmbus.h:299
uint32_t intr_mask
Interrupt mask.
Definition: vmbus.h:366
struct vmbus_message_header header
Message header.
Definition: vmbus.h:129
struct vmbus_gpa_range range[0]
Range descriptors.
Definition: vmbus.h:177
VMBus packet header.
Definition: vmbus.h:265
uint32_t in_len
Inbound ring buffer length.
Definition: vmbus.h:496
uint32_t reserved
Reserved.
Definition: vmbus.h:137
ring len
Length.
Definition: dwmac.h:231
struct vmbus_message_header header
Message header.
Definition: vmbus.h:167
void * packet
Packet buffer.
Definition: vmbus.h:509
int vmbus_probe(struct hv_hypervisor *hv, struct device *parent)
Probe Hyper-V virtual machine bus.
Definition: vmbus.c:1365
int vmbus_send_cancellation(struct vmbus_device *vmdev, uint64_t xid)
Send cancellation packet via ring buffer.
Definition: vmbus.c:857
struct vmbus_close_channel close
"Close channel" message
Definition: vmbus.h:249
A virtual machine bus.
Definition: vmbus.h:382
union uuid type
Channel type.
Definition: vmbus.h:101
uint16_t range_len
Length of range descriptors.
Definition: vmbus.h:173
unsigned int vmbus_obsolete_gpadl
Obsolete GPADL ID threshold.
Definition: vmbus.c:61
VMBus "GPADL torndown" message.
Definition: vmbus.h:203
uint64_t xid
Transaction ID.
Definition: vmbus.h:279
Windows 7.
Definition: vmbus.h:49
struct vmbus_gpadl_created created
"GPADL created" message
Definition: vmbus.h:253
VMBus GPA direct header.
Definition: vmbus.h:297
uint8_t data[0]
Ring buffer contents.
Definition: vmbus.h:370
Windows 8.1.
Definition: vmbus.h:53
uint16_t minor
Minor version.
Definition: vmbus.h:38
static void * vmbus_get_drvdata(struct vmbus_device *vmdev)
Get VMBus device driver-private data.
Definition: vmbus.h:566
union uuid type
Device type.
Definition: vmbus.h:524
struct vmbus_driver * driver
Driver.
Definition: vmbus.h:514
uint32_t channel
Channel ID.
Definition: vmbus.h:197
struct vmbus_gpadl_header gpadlhdr
"GPADL header" message
Definition: vmbus.h:251
A VMBus device driver.
Definition: vmbus.h:520
uint32_t offset
Offset.
Definition: vmbus.h:313
unsigned char uint8_t
Definition: stdint.h:10
struct hv_monitor * monitor_in
Inbound notifications.
Definition: vmbus.h:386
uint32_t gpadl
GPADL ID.
Definition: netvsc.h:14
static void vmbus_unregister_pages(struct vmbus_device *vmdev, struct vmbus_xfer_pages *pages)
Unregister transfer page set.
Definition: vmbus.h:612
struct vmbus_ring * in
Inbound ring buffer.
Definition: vmbus.h:500
uint8_t supported
Version is supported.
Definition: vmbus.h:231
unsigned int uint32_t
Definition: stdint.h:12
Windows 8.
Definition: vmbus.h:51
uint32_t reserved
Reserved.
Definition: vmbus.h:75
int(* copy)(struct vmbus_xfer_pages *pages, void *data, size_t offset, size_t len)
Copy data from transfer page.
Definition: vmbus.h:460
vmbus_raw_version
Known VMBus protocol versions.
Definition: vmbus.h:45
uint8_t monitored
Monitor exists.
Definition: vmbus.h:119
uint32_t gpadl
GPADL ID.
Definition: vmbus.h:171
void vmbus_dump_channel(struct vmbus_device *vmdev)
Dump channel status (for debugging)
Definition: vmbus.c:1089
uint16_t range_count
Number of range descriptors.
Definition: vmbus.h:175
vmbus_packet_flags
VMBus packet flags.
Definition: vmbus.h:292
uint32_t gpadl
GPADL ID.
Definition: vmbus.h:199
struct vmbus_version_response version
"Version response" message
Definition: vmbus.h:261
uint32_t id
Open ID.
Definition: vmbus.h:151
VMBus transfer page set operations.
Definition: vmbus.h:450
uint16_t qlen
Length of packet (in quadwords)
Definition: vmbus.h:271
VMBus interrupt page.
Definition: vmbus.h:374
struct vmbus_open_channel open
"Open channel" message
Definition: vmbus.h:245
static uint16_t struct vmbus_xfer_pages_operations * op
Definition: netvsc.h:327
A Hyper-V hypervisor.
Definition: hyperv.h:203
VMBus transfer page set.
Definition: vmbus.h:465
VMBus "open channel result" message.
Definition: vmbus.h:145
unsigned int channel
Channel ID.
Definition: vmbus.h:484
union vmbus_version version
Version.
Definition: vmbus.h:235
unsigned int monitor
Monitor ID.
Definition: vmbus.h:486
VMBus "close channel" message.
Definition: vmbus.h:157
uint32_t len
Length.
Definition: vmbus.h:311
int vmbus_open(struct vmbus_device *vmdev, struct vmbus_channel_operations *op, size_t out_len, size_t in_len, size_t mtu)
Open VMBus channel.
Definition: vmbus.c:403
uint64_t pfn[0]
Page frame numbers.
Definition: vmbus.h:67
struct hv_hypervisor * hv
Hyper-V hypervisor.
Definition: vmbus.h:479
struct vmbus_initiate_contact initiate
"Initiate contact" message
Definition: vmbus.h:259
static struct tlan_private * priv
Definition: tlan.c:225
VMBus channel operations.
Definition: vmbus.h:396
struct vmbus_message_header header
Message header.
Definition: vmbus.h:213
uint32_t mtu
Maximum MTU.
Definition: ena.h:28
struct vmbus_message_header header
Message header.
Definition: vmbus.h:147
unsigned int gpadl
Ring buffer GPADL ID.
Definition: vmbus.h:502
VMBus "offer channel" message.
Definition: vmbus.h:97
uint8_t reserved_a[16]
Reserved.
Definition: vmbus.h:105
uint8_t data[120]
User data.
Definition: vmbus.h:111
struct vmbus_open_channel_result opened
"Open channel result" message
Definition: vmbus.h:247
struct vmbus_interrupt * intr
Interrupt page.
Definition: vmbus.h:384
struct vmbus_gpadl_teardown teardown
"GPADL teardown" message
Definition: vmbus.h:255
uint32_t range_count
Number of range descriptors.
Definition: vmbus.h:303
struct vmbus_message_header header
Message header.
Definition: vmbus.h:205
uint8_t data[48]
Additional event data.
Definition: ena.h:22
int vmbus_send_completion(struct vmbus_device *vmdev, uint64_t xid, const void *data, size_t len)
Send completion packet via ring buffer.
Definition: vmbus.c:834
Windows Server 2008.
Definition: vmbus.h:47
union uuid instance
Channel instance.
Definition: vmbus.h:103
Linker tables.
union uuid instance
Channel instance.
Definition: vmbus.h:482
int(* probe)(struct vmbus_device *vmdev)
Probe device.
Definition: vmbus.h:530
void(* remove)(struct vmbus_device *vmdev)
Remove device.
Definition: vmbus.h:541
VMBus ring buffer.
Definition: vmbus.h:360
uint16_t major
Major version.
Definition: vmbus.h:40
uint16_t flags
Flags.
Definition: vmbus.h:107
Device model.
struct hv_monitor * monitor_out
Outbound notifications.
Definition: vmbus.h:388
uint32_t type
Message type.
Definition: vmbus.h:73
uint16_t hdr_qlen
Length of packet header (in quadwords)
Definition: vmbus.h:269
uint16_t flags
Flags.
Definition: vmbus.h:273
VMBus "GPADL teardown" message.
Definition: vmbus.h:193
void(* signal)(struct vmbus_device *vmdev)
Signal channel.
Definition: vmbus.h:491
uint16_t offset
Offset to command line.
Definition: bzimage.h:8
uint32_t out_pages
Outbound ring buffer size (in pages)
Definition: vmbus.h:139
static void vmbus_set_drvdata(struct vmbus_device *vmdev, void *priv)
Set VMBus device driver-private data.
Definition: vmbus.h:556
uint32_t id
Open ID.
Definition: vmbus.h:133
uint8_t reserved[2]
Reserved.
Definition: vmbus.h:121
int vmbus_establish_gpadl(struct vmbus_device *vmdev, void *data, size_t len)
Establish GPA descriptor list.
Definition: vmbus.c:276
struct vmbus_message_header header
Message header.
Definition: vmbus.h:159
#define list_check_contains_entry(entry, head, member)
Check list contains a specified entry.
Definition: list.h:549
struct list_head pages
List of transfer page sets.
Definition: vmbus.h:511
struct vmbus_message_header header
Common message header.
Definition: vmbus.h:241
size_t mtu
Maximum expected data packet length.
Definition: vmbus.h:507
VMBus "GPADL header" message.
Definition: vmbus.h:165
uint8_t reserved_c[4]
Reserved.
Definition: vmbus.h:113
void vmbus_remove(struct hv_hypervisor *hv, struct device *parent)
Remove Hyper-V virtual machine bus.
Definition: vmbus.c:1458
int vmbus_reset(struct hv_hypervisor *hv, struct device *parent)
Reset Hyper-V virtual machine bus.
Definition: vmbus.c:1426
VMBus transfer page range.
Definition: vmbus.h:309
uint32_t reserved
Reserved.
Definition: vmbus.h:301
struct vmbus_message_header header
Message header.
Definition: vmbus.h:99
int(* recv_cancellation)(struct vmbus_device *vmdev, uint64_t xid)
Handle received cancellation packet.
Definition: vmbus.h:443
VMBus version number.
Definition: vmbus.h:32
uint32_t channel
Channel ID.
Definition: vmbus.h:131
A persistent I/O buffer.
Definition: iobuf.h:37
int(* reset)(struct vmbus_device *vmdev)
Reset device.
Definition: vmbus.h:536
uint32_t gpadl
Ring buffer GPADL ID.
Definition: vmbus.h:135
struct vmbus_xfer_page_range range[0]
Range descriptors.
Definition: vmbus.h:329