ia64/xen-unstable

view xen/include/public/io/netif.h @ 8208:773735517d9d

Inclide grant_ref_t definition in split-driver struct
defns.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Sat Dec 03 10:50:22 2005 +0100 (2005-12-03)
parents a21cbe9a111b
children 4c588e255c85
line source
1 /******************************************************************************
2 * netif.h
3 *
4 * Unified network-device I/O interface for Xen guest OSes.
5 *
6 * Copyright (c) 2003-2004, Keir Fraser
7 */
9 #ifndef __XEN_PUBLIC_IO_NETIF_H__
10 #define __XEN_PUBLIC_IO_NETIF_H__
12 #include "ring.h"
13 #include "../gnttab.h" /* for grant_ref_t */
15 /*
16 * Note that there is *never* any need to notify the backend when enqueuing
17 * receive requests (netif_rx_request_t). Notifications after enqueuing any
18 * other type of message should be conditional on the appropriate req_event
19 * or rsp_event field in the shared ring.
20 */
22 /* Protocol checksum field is blank in the packet (hardware offload)? */
23 #define _NETTXF_csum_blank (0)
24 #define NETTXF_csum_blank (1U<<_NETTXF_csum_blank)
26 typedef struct netif_tx_request {
27 grant_ref_t gref; /* Reference to buffer page */
28 uint16_t offset; /* Offset within buffer page */
29 uint16_t flags; /* NETTXF_* */
30 uint16_t id; /* Echoed in response message. */
31 uint16_t size; /* Packet size in bytes. */
32 } netif_tx_request_t;
34 typedef struct netif_tx_response {
35 uint16_t id;
36 int16_t status; /* NETIF_RSP_* */
37 } netif_tx_response_t;
39 typedef struct {
40 uint16_t id; /* Echoed in response message. */
41 grant_ref_t gref; /* Reference to incoming granted frame */
42 } netif_rx_request_t;
44 /* Protocol checksum already validated (e.g., performed by hardware)? */
45 #define _NETRXF_csum_valid (0)
46 #define NETRXF_csum_valid (1U<<_NETRXF_csum_valid)
48 typedef struct {
49 uint16_t id;
50 uint16_t offset; /* Offset in page of start of received packet */
51 uint16_t flags; /* NETRXF_* */
52 int16_t status; /* -ve: BLKIF_RSP_* ; +ve: Rx'ed pkt size. */
53 } netif_rx_response_t;
55 /*
56 * Generate netif ring structures and types.
57 */
59 DEFINE_RING_TYPES(netif_tx, netif_tx_request_t, netif_tx_response_t);
60 DEFINE_RING_TYPES(netif_rx, netif_rx_request_t, netif_rx_response_t);
62 #define NETIF_RSP_DROPPED -2
63 #define NETIF_RSP_ERROR -1
64 #define NETIF_RSP_OKAY 0
66 #endif
68 /*
69 * Local variables:
70 * mode: C
71 * c-set-style: "BSD"
72 * c-basic-offset: 4
73 * tab-width: 4
74 * indent-tabs-mode: nil
75 * End:
76 */