WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [patch 3/5] netif: separate typedef from struct definition

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [patch 3/5] netif: separate typedef from struct definition
From: Chris Wright <chrisw@xxxxxxxxxxxx>
Date: Fri, 19 May 2006 00:00:03 -0700
Cc: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>
Delivery-date: Fri, 19 May 2006 02:56:29 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20060519095537.236338000@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
This makes sharing the file with Linux easier, as the typedefs in things
like netfront/netback code won't be accepted.

Signed-off-by: Chris Wright <chrisw@xxxxxxxxxxxx>
---
 xen/include/public/io/netif.h |   32 ++++++++++++++++++--------------
 1 file changed, 18 insertions(+), 14 deletions(-)

--- xen-unstable.orig/xen/include/public/io/netif.h
+++ xen-unstable/xen/include/public/io/netif.h
@@ -13,10 +13,10 @@
 #include "../grant_table.h"
 
 /*
- * Note that there is *never* any need to notify the backend when enqueuing
- * receive requests (netif_rx_request_t). Notifications after enqueuing any
- * other type of message should be conditional on the appropriate req_event
- * or rsp_event field in the shared ring.
+ * Note that there is *never* any need to notify the backend when
+ * enqueuing receive requests (struct netif_rx_request). Notifications
+ * after enqueuing any other type of message should be conditional on
+ * the appropriate req_event or rsp_event field in the shared ring.
  */
 
 /* Protocol checksum field is blank in the packet (hardware offload)? */
@@ -27,23 +27,26 @@
 #define _NETTXF_data_validated (1)
 #define  NETTXF_data_validated (1U<<_NETTXF_data_validated)
 
-typedef struct netif_tx_request {
+struct netif_tx_request {
     grant_ref_t gref;      /* Reference to buffer page */
     uint16_t offset;       /* Offset within buffer page */
     uint16_t flags;        /* NETTXF_* */
     uint16_t id;           /* Echoed in response message. */
     uint16_t size;         /* Packet size in bytes.       */
-} netif_tx_request_t;
+};
+typedef struct netif_tx_request netif_tx_request_t;
 
-typedef struct netif_tx_response {
+struct netif_tx_response {
     uint16_t id;
     int16_t  status;       /* NETIF_RSP_* */
-} netif_tx_response_t;
+};
+typedef struct netif_tx_response netif_tx_response_t;
 
-typedef struct {
+struct netif_rx_request {
     uint16_t    id;        /* Echoed in response message.        */
     grant_ref_t gref;      /* Reference to incoming granted frame */
-} netif_rx_request_t;
+};
+typedef struct netif_rx_request netif_rx_request_t;
 
 /* Packet data has been validated against protocol checksum. */
 #define _NETRXF_data_validated (0)
@@ -53,19 +56,20 @@ typedef struct {
 #define _NETRXF_csum_blank     (1)
 #define  NETRXF_csum_blank     (1U<<_NETRXF_csum_blank)
 
-typedef struct {
+struct netif_rx_response {
     uint16_t id;
     uint16_t offset;       /* Offset in page of start of received packet  */
     uint16_t flags;        /* NETRXF_* */
     int16_t  status;       /* -ve: BLKIF_RSP_* ; +ve: Rx'ed pkt size. */
-} netif_rx_response_t;
+};
+typedef struct netif_rx_response netif_rx_response_t;
 
 /*
  * Generate netif ring structures and types.
  */
 
-DEFINE_RING_TYPES(netif_tx, netif_tx_request_t, netif_tx_response_t);
-DEFINE_RING_TYPES(netif_rx, netif_rx_request_t, netif_rx_response_t);
+DEFINE_RING_TYPES(netif_tx, struct netif_tx_request, struct netif_tx_response);
+DEFINE_RING_TYPES(netif_rx, struct netif_rx_request, struct netif_rx_response);
 
 #define NETIF_RSP_DROPPED         -2
 #define NETIF_RSP_ERROR           -1

--

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel