-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtransport.h
34 lines (25 loc) · 856 Bytes
/
transport.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* Copyright (c) 2023 Elliot Nunn */
/* Licensed under the MIT license */
// Implemented by transport-*.c
#pragma once
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
// The reference number is enough to find the underlying hardware
// returns true for OK
bool VInit(short refNum);
// Sets these globals
extern void *VConfig;
// Negotiate features
bool VGetDevFeature(uint32_t number);
void VSetFeature(uint32_t number, bool val);
bool VFeaturesOK(void);
void VDriverOK(void);
void VFail(void);
// Tell the device where to find the three (split) virtqueue rings
uint16_t VQueueMaxSize(uint16_t q);
void VQueueSet(uint16_t q, uint16_t size, uint32_t desc, uint32_t avail, uint32_t used);
// Tell the device about a change to the avail ring
void VNotify(uint16_t queue);
// Quiesce the device (no more notifications)
void VReset(void);