vport_lock();
if (odp_port->flags & ODP_PORT_INTERNAL)
- vport = __vport_add(odp_port->devname, "internal", NULL);
+ vport = vport_add(odp_port->devname, "internal", NULL);
else
- vport = __vport_add(odp_port->devname, "netdev", NULL);
+ vport = vport_add(odp_port->devname, "netdev", NULL);
vport_unlock();
if (!strcmp(port_type, "netdev") || !strcmp(port_type, "internal")) {
vport_lock();
- __vport_del(vport);
+ vport_del(vport);
vport_unlock();
}
}
goto exit;
case ODP_VPORT_ADD:
- err = vport_add((struct odp_vport_add __user *)argp);
+ err = vport_user_add((struct odp_vport_add __user *)argp);
goto exit;
case ODP_VPORT_MOD:
- err = vport_mod((struct odp_vport_mod __user *)argp);
+ err = vport_user_mod((struct odp_vport_mod __user *)argp);
goto exit;
case ODP_VPORT_DEL:
- err = vport_del((char __user *)argp);
+ err = vport_user_del((char __user *)argp);
goto exit;
case ODP_VPORT_STATS_GET:
- err = vport_stats_get((struct odp_vport_stats_req __user *)argp);
+ err = vport_user_stats_get((struct odp_vport_stats_req __user *)argp);
goto exit;
case ODP_VPORT_ETHER_GET:
- err = vport_ether_get((struct odp_vport_ether __user *)argp);
+ err = vport_user_ether_get((struct odp_vport_ether __user *)argp);
goto exit;
case ODP_VPORT_ETHER_SET:
- err = vport_ether_set((struct odp_vport_ether __user *)argp);
+ err = vport_user_ether_set((struct odp_vport_ether __user *)argp);
goto exit;
case ODP_VPORT_MTU_GET:
- err = vport_mtu_get((struct odp_vport_mtu __user *)argp);
+ err = vport_user_mtu_get((struct odp_vport_mtu __user *)argp);
goto exit;
case ODP_VPORT_MTU_SET:
- err = vport_mtu_set((struct odp_vport_mtu __user *)argp);
+ err = vport_user_mtu_set((struct odp_vport_mtu __user *)argp);
goto exit;
}
return openvswitch_ioctl(f, cmd, (unsigned long)compat_ptr(argp));
case ODP_VPORT_ADD32:
- return compat_vport_add(compat_ptr(argp));
+ return compat_vport_user_add(compat_ptr(argp));
case ODP_VPORT_MOD32:
- return compat_vport_mod(compat_ptr(argp));
+ return compat_vport_user_mod(compat_ptr(argp));
}
dp = get_dp_locked(dp_idx);
struct hlist_node *node, *next;
hlist_for_each_entry_safe(vport, node, next, bucket, hash_node)
- __vport_del(vport);
+ vport_del(vport);
}
vport_unlock();
kfree(dev_table);
}
-/**
- * vport_add - add vport device (for userspace callers)
- *
- * @uvport_config: New port configuration.
- *
- * Creates a new vport with the specified configuration (which is dependent
- * on device type). This function is for userspace callers and assumes no
- * locks are held.
- */
static int
do_vport_add(struct odp_vport_add *vport_config)
{
}
vport_lock();
- vport = __vport_add(vport_config->devname, vport_config->port_type,
- vport_config->config);
+ vport = vport_add(vport_config->devname, vport_config->port_type,
+ vport_config->config);
vport_unlock();
if (IS_ERR(vport))
return err;
}
+/**
+ * vport_user_add - add vport device (for userspace callers)
+ *
+ * @uvport_config: New port configuration.
+ *
+ * Creates a new vport with the specified configuration (which is dependent
+ * on device type). This function is for userspace callers and assumes no
+ * locks are held.
+ */
int
-vport_add(const struct odp_vport_add __user *uvport_config)
+vport_user_add(const struct odp_vport_add __user *uvport_config)
{
struct odp_vport_add vport_config;
#ifdef CONFIG_COMPAT
int
-compat_vport_add(struct compat_odp_vport_add *ucompat)
+compat_vport_user_add(struct compat_odp_vport_add *ucompat)
{
struct compat_odp_vport_add compat;
struct odp_vport_add vport_config;
}
#endif
-/**
- * vport_mod - modify existing vport device (for userspace callers)
- *
- * @uvport_config: New configuration for vport
- *
- * Modifies an existing device with the specified configuration (which is
- * dependent on device type). This function is for userspace callers and
- * assumes no locks are held.
- */
static int
do_vport_mod(struct odp_vport_mod *vport_config)
{
}
vport_lock();
- err = __vport_mod(vport, vport_config->config);
+ err = vport_mod(vport, vport_config->config);
vport_unlock();
out:
return err;
}
+/**
+ * vport_user_mod - modify existing vport device (for userspace callers)
+ *
+ * @uvport_config: New configuration for vport
+ *
+ * Modifies an existing device with the specified configuration (which is
+ * dependent on device type). This function is for userspace callers and
+ * assumes no locks are held.
+ */
int
-vport_mod(const struct odp_vport_mod __user *uvport_config)
+vport_user_mod(const struct odp_vport_mod __user *uvport_config)
{
struct odp_vport_mod vport_config;
#ifdef CONFIG_COMPAT
int
-compat_vport_mod(struct compat_odp_vport_mod *ucompat)
+compat_vport_user_mod(struct compat_odp_vport_mod *ucompat)
{
struct compat_odp_vport_mod compat;
struct odp_vport_mod vport_config;
#endif
/**
- * vport_del - delete existing vport device (for userspace callers)
+ * vport_user_del - delete existing vport device (for userspace callers)
*
* @udevname: Name of device to delete
*
* assumes no locks are held.
*/
int
-vport_del(const char __user *udevname)
+vport_user_del(const char __user *udevname)
{
char devname[IFNAMSIZ];
struct vport *vport;
}
vport_lock();
- err = __vport_del(vport);
+ err = vport_del(vport);
vport_unlock();
out:
}
/**
- * vport_stats_get - retrieve device stats (for userspace callers)
+ * vport_user_stats_get - retrieve device stats (for userspace callers)
*
* @ustats_req: Stats request parameters.
*
* function is for userspace callers and assumes no locks are held.
*/
int
-vport_stats_get(struct odp_vport_stats_req __user *ustats_req)
+vport_user_stats_get(struct odp_vport_stats_req __user *ustats_req)
{
struct odp_vport_stats_req stats_req;
struct vport *vport;
}
/**
- * vport_ether_get - retrieve device Ethernet address (for userspace callers)
+ * vport_user_ether_get - retrieve device Ethernet address (for userspace callers)
*
* @uvport_ether: Ethernet address request parameters.
*
* userspace callers and assumes no locks are held.
*/
int
-vport_ether_get(struct odp_vport_ether __user *uvport_ether)
+vport_user_ether_get(struct odp_vport_ether __user *uvport_ether)
{
struct odp_vport_ether vport_ether;
struct vport *vport;
}
/**
- * vport_ether_set - set device Ethernet address (for userspace callers)
+ * vport_user_ether_set - set device Ethernet address (for userspace callers)
*
* @uvport_ether: Ethernet address request parameters.
*
* are held.
*/
int
-vport_ether_set(struct odp_vport_ether __user *uvport_ether)
+vport_user_ether_set(struct odp_vport_ether __user *uvport_ether)
{
struct odp_vport_ether vport_ether;
struct vport *vport;
}
/**
- * vport_mut_get - retrieve device MTU (for userspace callers)
+ * vport_user_mtu_get - retrieve device MTU (for userspace callers)
*
* @uvport_mtu: MTU request parameters.
*
* callers and assumes no locks are held.
*/
int
-vport_mtu_get(struct odp_vport_mtu __user *uvport_mtu)
+vport_user_mtu_get(struct odp_vport_mtu __user *uvport_mtu)
{
struct odp_vport_mtu vport_mtu;
struct vport *vport;
}
/**
- * vport_mtu_set - set device MTU (for userspace callers)
+ * vport_user_mtu_set - set device MTU (for userspace callers)
*
* @uvport_mtu: MTU request parameters.
*
* for userspace callers and assumes no locks are held.
*/
int
-vport_mtu_set(struct odp_vport_mtu __user *uvport_mtu)
+vport_user_mtu_set(struct odp_vport_mtu __user *uvport_mtu)
{
struct odp_vport_mtu vport_mtu;
struct vport *vport;
}
/**
- * __vport_add - add vport device (for kernel callers)
+ * vport_add - add vport device (for kernel callers)
*
* @name: Name of new device.
* @type: Type of new device (to be matched against types in registered vport
* on device type). Both RTNL and vport locks must be held.
*/
struct vport *
-__vport_add(const char *name, const char *type, const void __user *config)
+vport_add(const char *name, const char *type, const void __user *config)
{
struct vport *vport;
int err = 0;
}
/**
- * __vport_mod - modify existing vport device (for kernel callers)
+ * vport_mod - modify existing vport device (for kernel callers)
*
* @vport: vport to modify.
* @config: Device type specific configuration. Userspace pointer.
* dependent on device type). Both RTNL and vport locks must be held.
*/
int
-__vport_mod(struct vport *vport, const void __user *config)
+vport_mod(struct vport *vport, const void __user *config)
{
ASSERT_RTNL();
ASSERT_VPORT();
}
/**
- * __vport_del - delete existing vport device (for kernel callers)
+ * vport_del - delete existing vport device (for kernel callers)
*
* @vport: vport to delete.
*
* Both RTNL and vport locks must be held.
*/
int
-__vport_del(struct vport *vport)
+vport_del(struct vport *vport)
{
ASSERT_RTNL();
ASSERT_VPORT();
/* The following definitions are for users of the vport subsytem: */
+int vport_user_add(const struct odp_vport_add __user *);
+int vport_user_mod(const struct odp_vport_mod __user *);
+int vport_user_del(const char __user *udevname);
+
+#ifdef CONFIG_COMPAT
+int compat_vport_user_add(struct compat_odp_vport_add __user *);
+int compat_vport_user_mod(struct compat_odp_vport_mod __user *);
+#endif
+
+int vport_user_stats_get(struct odp_vport_stats_req __user *);
+int vport_user_ether_get(struct odp_vport_ether __user *);
+int vport_user_ether_set(struct odp_vport_ether __user *);
+int vport_user_mtu_get(struct odp_vport_mtu __user *);
+int vport_user_mtu_set(struct odp_vport_mtu __user *);
+
void vport_lock(void);
void vport_unlock(void);
int vport_init(void);
void vport_exit(void);
-int vport_add(const struct odp_vport_add __user *);
-int vport_mod(const struct odp_vport_mod __user *);
-int vport_del(const char __user *udevname);
-
-#ifdef CONFIG_COMPAT
-int compat_vport_add(struct compat_odp_vport_add __user *);
-int compat_vport_mod(struct compat_odp_vport_mod __user *);
-#endif
-
-int vport_stats_get(struct odp_vport_stats_req __user *);
-int vport_ether_get(struct odp_vport_ether __user *);
-int vport_ether_set(struct odp_vport_ether __user *);
-int vport_mtu_get(struct odp_vport_mtu __user *);
-int vport_mtu_set(struct odp_vport_mtu __user *);
-
-struct vport *__vport_add(const char *name, const char *type, const void __user *config);
-int __vport_mod(struct vport *, const void __user *config);
-int __vport_del(struct vport *);
+struct vport *vport_add(const char *name, const char *type, const void __user *config);
+int vport_mod(struct vport *, const void __user *config);
+int vport_del(struct vport *);
struct vport *vport_locate(const char *name);