Changes based on feedback from GigaFin.
authorJustin Pettit <jpettit@nicira.com>
Thu, 10 Apr 2008 22:50:25 +0000 (15:50 -0700)
committerJustin Pettit <jpettit@nicira.com>
Thu, 10 Apr 2008 22:50:25 +0000 (15:50 -0700)
datapath/linux-2.4/compat-2.4/compat24.c
datapath/linux-2.4/compat-2.4/genetlink.c
datapath/linux-2.4/compat-2.4/include-arm/asm/atomic.h
datapath/linux-2.4/compat-2.4/include/linux/llc.h [new file with mode: 0644]
datapath/linux-2.4/compat-2.4/random32.c
datapath/unit.c
include/netlink.h
include/openflow-netlink.h
lib/netlink.c

index bbacf311fdc77fd33c1e44c52f5035872ccda259..f00569df72de311a6704ab0c18d44a5750c44100 100644 (file)
@@ -2,6 +2,7 @@
  * Distributed under the terms of the GNU GPL version 2.
  */
 
+#include <linux/init.h>
 #include <linux/module.h>
 #include "compat24.h"
 
index c9fc55a6e325f52e8e82e917d7f50a8e016d7974..fe7812a761bdfb07f0cf2d1e3123646e765bd28a 100644 (file)
@@ -6,6 +6,7 @@
  *                             Johannes Berg <johannes@sipsolutions.net>
  */
 
+#include <linux/init.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
index 1a1bb45037a2bcd32c9197a6bfef205aa85e8906..4b7700865002db13d99c01ab5c158d4a8248e0be 100644 (file)
@@ -3,8 +3,6 @@
 
 #include_next <asm/atomic.h>
 
-#error "Cribbed from linux-2.6/include/asm-arm/atomic.h but untested"
-
 #ifdef __KERNEL__
 
 #if __LINUX_ARM_ARCH__ >= 6
@@ -40,11 +38,11 @@ static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
        int ret;
        unsigned long flags;
 
-       raw_local_irq_save(flags);
+       local_irq_save(flags);
        ret = v->counter;
        if (likely(ret == old))
                v->counter = new;
-       raw_local_irq_restore(flags);
+       local_irq_restore(flags);
 
        return ret;
 }
diff --git a/datapath/linux-2.4/compat-2.4/include/linux/llc.h b/datapath/linux-2.4/compat-2.4/include/linux/llc.h
new file mode 100644 (file)
index 0000000..09f2e6d
--- /dev/null
@@ -0,0 +1,80 @@
+#ifndef __LINUX_LLC_H
+#define __LINUX_LLC_H
+/*
+ * IEEE 802.2 User Interface SAPs for Linux, data structures and indicators.
+ *
+ * Copyright (c) 2001 by Jay Schulist <jschlst@samba.org>
+ *
+ * This program can be redistributed or modified under the terms of the
+ * GNU General Public License as published by the Free Software Foundation.
+ * This program is distributed without any warranty or implied warranty
+ * of merchantability or fitness for a particular purpose.
+ *
+ * See the GNU General Public License for more details.
+ */
+#define __LLC_SOCK_SIZE__ 16   /* sizeof(sockaddr_llc), word align. */
+struct sockaddr_llc {
+       sa_family_t     sllc_family;    /* AF_LLC */
+       sa_family_t     sllc_arphrd;    /* ARPHRD_ETHER */
+       unsigned char   sllc_test;
+       unsigned char   sllc_xid;
+       unsigned char   sllc_ua;        /* UA data, only for SOCK_STREAM. */
+       unsigned char   sllc_sap;
+       unsigned char   sllc_mac[IFHWADDRLEN];
+       unsigned char   __pad[__LLC_SOCK_SIZE__ - sizeof(sa_family_t) * 2 -
+                             sizeof(unsigned char) * 4 - IFHWADDRLEN];
+};
+
+/* sockopt definitions. */
+enum llc_sockopts {
+       LLC_OPT_UNKNOWN = 0,
+       LLC_OPT_RETRY,          /* max retrans attempts. */
+       LLC_OPT_SIZE,           /* max PDU size (octets). */
+       LLC_OPT_ACK_TMR_EXP,    /* ack expire time (secs). */
+       LLC_OPT_P_TMR_EXP,      /* pf cycle expire time (secs). */
+       LLC_OPT_REJ_TMR_EXP,    /* rej sent expire time (secs). */
+       LLC_OPT_BUSY_TMR_EXP,   /* busy state expire time (secs). */
+       LLC_OPT_TX_WIN,         /* tx window size. */
+       LLC_OPT_RX_WIN,         /* rx window size. */
+       LLC_OPT_MAX
+};
+
+#define LLC_OPT_MAX_RETRY       100
+#define LLC_OPT_MAX_SIZE       4196
+#define LLC_OPT_MAX_WIN                 127
+#define LLC_OPT_MAX_ACK_TMR_EXP          60
+#define LLC_OPT_MAX_P_TMR_EXP    60
+#define LLC_OPT_MAX_REJ_TMR_EXP          60
+#define LLC_OPT_MAX_BUSY_TMR_EXP  60
+
+/* LLC SAP types. */
+#define LLC_SAP_NULL   0x00            /* NULL SAP.                    */
+#define LLC_SAP_LLC    0x02            /* LLC Sublayer Managment.      */
+#define LLC_SAP_SNA    0x04            /* SNA Path Control.            */
+#define LLC_SAP_PNM    0x0E            /* Proway Network Managment.    */      
+#define LLC_SAP_IP     0x06            /* TCP/IP.                      */
+#define LLC_SAP_BSPAN  0x42            /* Bridge Spanning Tree Proto   */
+#define LLC_SAP_MMS    0x4E            /* Manufacturing Message Srv.   */
+#define LLC_SAP_8208   0x7E            /* ISO 8208                     */
+#define LLC_SAP_3COM   0x80            /* 3COM.                        */
+#define LLC_SAP_PRO    0x8E            /* Proway Active Station List   */
+#define LLC_SAP_SNAP   0xAA            /* SNAP.                        */
+#define LLC_SAP_BANYAN 0xBC            /* Banyan.                      */
+#define LLC_SAP_IPX    0xE0            /* IPX/SPX.                     */
+#define LLC_SAP_NETBEUI        0xF0            /* NetBEUI.                     */
+#define LLC_SAP_LANMGR 0xF4            /* LanManager.                  */
+#define LLC_SAP_IMPL   0xF8            /* IMPL                         */
+#define LLC_SAP_DISC   0xFC            /* Discovery                    */
+#define LLC_SAP_OSI    0xFE            /* OSI Network Layers.          */
+#define LLC_SAP_LAR    0xDC            /* LAN Address Resolution       */
+#define LLC_SAP_RM     0xD4            /* Resource Management          */
+#define LLC_SAP_GLOBAL 0xFF            /* Global SAP.                  */
+
+#ifdef __KERNEL__
+#define LLC_SAP_DYN_START      0xC0
+#define LLC_SAP_DYN_STOP       0xDE
+#define LLC_SAP_DYN_TRIES      4
+
+#define llc_ui_skb_cb(__skb) ((struct sockaddr_llc *)&((__skb)->cb[0]))
+#endif /* __KERNEL__ */
+#endif /* __LINUX_LLC_H */
index 3a19e73ae2ac748098d9b61440ebf1bf272774be..f3c30e19d8ec49753a9642f87fc8b8ca313e519f 100644 (file)
@@ -33,8 +33,9 @@
 
 */
 
-#include <linux/types.h>
+#include <linux/init.h>
 #include <linux/module.h>
+#include <linux/types.h>
 #include <linux/jiffies.h>
 #include <linux/random.h>
 #include <linux/threads.h>
index d9e06f27980a31a285436282a8114865baef6c8d..94a4439c2f7a765296720b5421fe36a9eba948ce 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <linux/autoconf.h>
+#include <linux/init.h>
 #include <linux/module.h>
 #include <linux/string.h>
 #include <linux/version.h>
index ccd52b0a3ad045596ec1a0c0d76e8a2ff35177e3..48bedbfd4a1af0e80c0cfc6462d07adbf03d5662 100644 (file)
@@ -46,6 +46,7 @@
 #include <stdbool.h>
 #include <stdint.h>
 #include <sys/socket.h>
+#include <linux/types.h>
 #include <linux/netlink.h>
 #include <linux/genetlink.h>
 #include <linux/version.h>
index cad7b47b74b6abdafc2d0487dda2355e3a76c839..d9862b0bab420f19dbc3c1d9851ab291045b1b20 100644 (file)
@@ -34,6 +34,7 @@
 #ifndef OPENFLOW_NETLINK_H
 #define OPENFLOW_NETLINK_H 1
 
+#include <linux/types.h>
 #include <linux/netlink.h>
 
 #define DP_GENL_FAMILY_NAME "OpenFlow"
index eb199e59953ee72fda9e68c216034e28ca1c11a8..898f7400a25360b7bdb093dbf2416b638dbfba92 100644 (file)
@@ -150,6 +150,7 @@ nl_sock_create(int protocol, int multicast_group,
         goto error_free_pid;
     }
 
+#ifdef NETLINK_ADD_MEMBERSHIP
     /* This method of joining multicast groups is only supported by newish
      * kernels, but it allows for an arbitrary number of multicast groups. */
     if (multicast_group > 32
@@ -159,6 +160,7 @@ nl_sock_create(int protocol, int multicast_group,
                  multicast_group, strerror(errno));
         goto error_free_pid;
     }
+#endif
 
     *sockp = sock;
     return 0;