/*
- * Copyright (c) 2009, 2011 Nicira Networks.
- * Distributed under the terms of the GNU GPL version 2.
+ * Copyright (c) 2007-2011 Nicira Networks.
*
- * Significant portions of this file may be copied from parts of the Linux
- * kernel, by Linus Torvalds and others.
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+#include <linux/module.h>
#include <linux/kernel.h>
-#include <asm/uaccess.h>
+#include <linux/uaccess.h>
#include <linux/completion.h>
#include <linux/etherdevice.h>
#include <linux/if_bridge.h>
static struct sk_buff *brc_reply; /* Reply from userspace. */
static u32 brc_seq; /* Sequence number for current op. */
-static struct sk_buff *brc_send_command(struct sk_buff *, struct nlattr **attrs);
+static struct sk_buff *brc_send_command(struct sk_buff *,
+ struct nlattr **attrs);
static int brc_send_simple_command(struct sk_buff *);
static struct sk_buff *brc_make_request(int op, const char *bridge,
int err;
switch (cmd) {
- case SIOCDEVPRIVATE:
- err = old_dev_ioctl(dev, rq, cmd);
- break;
-
- case SIOCBRADDIF:
- return brc_add_del_port(dev, rq->ifr_ifindex, 1);
- case SIOCBRDELIF:
- return brc_add_del_port(dev, rq->ifr_ifindex, 0);
-
- default:
- err = -EOPNOTSUPP;
- break;
+ case SIOCDEVPRIVATE:
+ err = old_dev_ioctl(dev, rq, cmd);
+ break;
+
+ case SIOCBRADDIF:
+ return brc_add_del_port(dev, rq->ifr_ifindex, 1);
+ case SIOCBRDELIF:
+ return brc_add_del_port(dev, rq->ifr_ifindex, 0);
+
+ default:
+ err = -EOPNOTSUPP;
+ break;
}
return err;
if (!wait_for_completion_timeout(&brc_done, BRC_TIMEOUT)) {
pr_warn("timed out waiting for userspace\n");
goto error;
- }
+ }
/* Grab reply. */
spin_lock_irqsave(&brc_lock, flags);
{
int err;
- printk("Open vSwitch Bridge Compatibility, built "__DATE__" "__TIME__"\n");
+ pr_info("Open vSwitch Bridge Compatibility, built "__DATE__" "__TIME__"\n");
/* Set the bridge ioctl handler */
brioctl_set(brc_ioctl_deviceless_stub);