diff options
author | 2023-10-10 14:33:42 +0000 | |
---|---|---|
committer | 2023-10-10 14:33:42 +0000 | |
commit | af1a266670d040d2f4083ff309d732d648afba2a (patch) | |
tree | 2fc46203448ddcc6f81546d379abfaeb323575e9 /roms/SLOF/lib/libvirtio/virtio-net.h | |
parent | e02cda008591317b1625707ff8e115a4841aa889 (diff) |
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'roms/SLOF/lib/libvirtio/virtio-net.h')
-rw-r--r-- | roms/SLOF/lib/libvirtio/virtio-net.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/roms/SLOF/lib/libvirtio/virtio-net.h b/roms/SLOF/lib/libvirtio/virtio-net.h new file mode 100644 index 000000000..c71fbded0 --- /dev/null +++ b/roms/SLOF/lib/libvirtio/virtio-net.h @@ -0,0 +1,40 @@ +/****************************************************************************** + * Copyright (c) 2011 IBM Corporation + * All rights reserved. + * This program and the accompanying materials + * are made available under the terms of the BSD License + * which accompanies this distribution, and is available at + * http://www.opensource.org/licenses/bsd-license.php + * + * Contributors: + * IBM Corporation - initial implementation + *****************************************************************************/ + +#ifndef VIRTIO_NET_H +#define VIRTIO_NET_H + +#include <netdriver.h> +#include "virtio.h" + +#define RX_QUEUE_SIZE 128 +#define BUFFER_ENTRY_SIZE 1514 + +enum { + VQ_RX = 0, /* Receive Queue */ + VQ_TX = 1, /* Transmit Queue */ +}; + +struct virtio_net { + net_driver_t driver; + struct virtio_device vdev; +}; + +/* VIRTIO_NET Feature bits */ +#define VIRTIO_NET_F_MAC (1 << 5) + +extern struct virtio_net *virtionet_open(struct virtio_device *dev); +extern void virtionet_close(struct virtio_net *vnet); +extern int virtionet_read(struct virtio_net *vnet, char *buf, int len); +extern int virtionet_write(struct virtio_net *vnet, char *buf, int len); + +#endif |