~ubuntu-branches/ubuntu/trusty/slof/trusty

« back to all changes in this revision

Viewing changes to lib/libvirtio/virtio-net.h

  • Committer: Package Import Robot
  • Author(s): Logan Rosen
  • Date: 2013-12-11 00:00:46 UTC
  • mfrom: (2.1.3 sid)
  • Revision ID: package-import@ubuntu.com-20131211000046-1199k14mvmd37ts6
Tags: 20131015+dfsg-1ubuntu1
* Merge from Debian unstable. Remaining changes:
  - Since Ubuntu always builds Architecture: all packages on i386, build
    using a cross-compiler.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/******************************************************************************
 
2
 * Copyright (c) 2011 IBM Corporation
 
3
 * All rights reserved.
 
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
 
8
 *
 
9
 * Contributors:
 
10
 *     IBM Corporation - initial implementation
 
11
 *****************************************************************************/
 
12
 
 
13
#ifndef VIRTIO_NET_H
 
14
#define VIRTIO_NET_H
 
15
 
 
16
#include <netdriver.h>
 
17
 
 
18
#define RX_QUEUE_SIZE           16
 
19
#define BUFFER_ENTRY_SIZE       1514
 
20
 
 
21
enum {
 
22
        VQ_RX = 0,      /* Receive Queue */
 
23
        VQ_TX = 1,      /* Transmit Queue */
 
24
};
 
25
 
 
26
struct vqs {
 
27
        uint64_t id;    /* Queue ID */
 
28
        uint32_t size;
 
29
        void *buf_mem;
 
30
        struct vring_desc *desc;
 
31
        struct vring_avail *avail;
 
32
        struct vring_used *used;
 
33
};
 
34
 
 
35
/* Device is identified by RX queue ID: */
 
36
#define DEVICE_ID  vq[0].id
 
37
 
 
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);
 
42
 
 
43
#endif