1
/******************************************************************************
2
* Copyright (c) 2011 IBM Corporation
4
* This program and the accompanying materials
5
* are made available under the terms of the BSD License
6
* which accompanies this distribution, and is available at
7
* http://www.opensource.org/licenses/bsd-license.php
10
* IBM Corporation - initial implementation
11
*****************************************************************************/
16
#include <netdriver.h>
18
#define RX_QUEUE_SIZE 16
19
#define BUFFER_ENTRY_SIZE 1514
22
VQ_RX = 0, /* Receive Queue */
23
VQ_TX = 1, /* Transmit Queue */
27
uint64_t id; /* Queue ID */
30
struct vring_desc *desc;
31
struct vring_avail *avail;
32
struct vring_used *used;
35
/* Device is identified by RX queue ID: */
36
#define DEVICE_ID vq[0].id
38
extern net_driver_t *virtionet_open(char *mac_addr, int len, struct virtio_device *dev);
39
extern void virtionet_close(net_driver_t *driver);
40
extern int virtionet_read(char *buf, int len);
41
extern int virtionet_write(char *buf, int len);