Commit 635b8c8e authored by Sainath Grandhi's avatar Sainath Grandhi Committed by David S. Miller

tap: Renaming tap related APIs, data structures, macros

Renaming tap related APIs, data structures and macros in tap.c from macvtap_.* to tap_.*
Signed-off-by: default avatarSainath Grandhi <sainath.grandhi@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a8e04698
#include <linux/etherdevice.h>
#include <linux/if_macvlan.h>
#include <linux/if_macvtap.h>
#include <linux/if_tap.h>
#include <linux/if_vlan.h>
#include <linux/interrupt.h>
#include <linux/nsproxy.h>
......@@ -62,7 +62,7 @@ static int macvtap_newlink(struct net *src_net,
*/
vlan->tap_features = TUN_OFFLOADS;
err = netdev_rx_handler_register(dev, macvtap_handle_frame, vlan);
err = netdev_rx_handler_register(dev, tap_handle_frame, vlan);
if (err)
return err;
......@@ -82,7 +82,7 @@ static void macvtap_dellink(struct net_device *dev,
struct list_head *head)
{
netdev_rx_handler_unregister(dev);
macvtap_del_queues(dev);
tap_del_queues(dev);
macvlan_dellink(dev, head);
}
......@@ -121,7 +121,7 @@ static int macvtap_device_event(struct notifier_block *unused,
* been registered but before register_netdevice has
* finished running.
*/
err = macvtap_get_minor(vlan);
err = tap_get_minor(vlan);
if (err)
return notifier_from_errno(err);
......@@ -129,7 +129,7 @@ static int macvtap_device_event(struct notifier_block *unused,
classdev = device_create(&macvtap_class, &dev->dev, devt,
dev, tap_name);
if (IS_ERR(classdev)) {
macvtap_free_minor(vlan);
tap_free_minor(vlan);
return notifier_from_errno(PTR_ERR(classdev));
}
err = sysfs_create_link(&dev->dev.kobj, &classdev->kobj,
......@@ -144,10 +144,10 @@ static int macvtap_device_event(struct notifier_block *unused,
sysfs_remove_link(&dev->dev.kobj, tap_name);
devt = MKDEV(MAJOR(macvtap_major), vlan->minor);
device_destroy(&macvtap_class, devt);
macvtap_free_minor(vlan);
tap_free_minor(vlan);
break;
case NETDEV_CHANGE_TX_QUEUE_LEN:
if (macvtap_queue_resize(vlan))
if (tap_queue_resize(vlan))
return NOTIFY_BAD;
break;
}
......@@ -159,7 +159,7 @@ static struct notifier_block macvtap_notifier_block __read_mostly = {
.notifier_call = macvtap_device_event,
};
extern struct file_operations macvtap_fops;
extern struct file_operations tap_fops;
static int macvtap_init(void)
{
int err;
......@@ -169,7 +169,7 @@ static int macvtap_init(void)
if (err)
goto out1;
cdev_init(&macvtap_cdev, &macvtap_fops);
cdev_init(&macvtap_cdev, &tap_fops);
err = cdev_add(&macvtap_cdev, macvtap_major, MACVTAP_NUM_DEVS);
if (err)
goto out2;
......
This diff is collapsed.
......@@ -24,6 +24,7 @@
#include <linux/if_arp.h>
#include <linux/if_tun.h>
#include <linux/if_macvlan.h>
#include <linux/if_tap.h>
#include <linux/if_vlan.h>
#include <net/sock.h>
......@@ -960,7 +961,7 @@ static struct socket *get_tap_socket(int fd)
sock = tun_get_socket(file);
if (!IS_ERR(sock))
return sock;
sock = macvtap_get_socket(file);
sock = tap_get_socket(file);
if (IS_ERR(sock))
fput(file);
return sock;
......
......@@ -9,19 +9,6 @@
#include <net/netlink.h>
#include <linux/u64_stats_sync.h>
#if IS_ENABLED(CONFIG_MACVTAP)
struct socket *macvtap_get_socket(struct file *);
#else
#include <linux/err.h>
#include <linux/errno.h>
struct file;
struct socket;
static inline struct socket *macvtap_get_socket(struct file *f)
{
return ERR_PTR(-EINVAL);
}
#endif /* CONFIG_MACVTAP */
struct macvlan_port;
struct macvtap_queue;
......@@ -29,7 +16,7 @@ struct macvtap_queue;
* Maximum times a macvtap device can be opened. This can be used to
* configure the number of receive queue, e.g. for multiqueue virtio.
*/
#define MAX_MACVTAP_QUEUES 256
#define MAX_TAP_QUEUES 256
#define MACVLAN_MC_FILTER_BITS 8
#define MACVLAN_MC_FILTER_SZ (1 << MACVLAN_MC_FILTER_BITS)
......@@ -49,7 +36,7 @@ struct macvlan_dev {
enum macvlan_mode mode;
u16 flags;
/* This array tracks active taps. */
struct macvtap_queue __rcu *taps[MAX_MACVTAP_QUEUES];
struct tap_queue __rcu *taps[MAX_TAP_QUEUES];
/* This list tracks all taps (both enabled and disabled) */
struct list_head queue_list;
int numvtaps;
......
#ifndef _LINUX_IF_MACVTAP_H_
#define _LINUX_IF_MACVTAP_H_
rx_handler_result_t macvtap_handle_frame(struct sk_buff **pskb);
void macvtap_del_queues(struct net_device *dev);
int macvtap_get_minor(struct macvlan_dev *vlan);
void macvtap_free_minor(struct macvlan_dev *vlan);
int macvtap_queue_resize(struct macvlan_dev *vlan);
#endif /*_LINUX_IF_MACVTAP_H_*/
#ifndef _LINUX_IF_TAP_H_
#define _LINUX_IF_TAP_H_
#if IS_ENABLED(CONFIG_MACVTAP)
struct socket *tap_get_socket(struct file *);
#else
#include <linux/err.h>
#include <linux/errno.h>
struct file;
struct socket;
static inline struct socket *tap_get_socket(struct file *f)
{
return ERR_PTR(-EINVAL);
}
#endif /* CONFIG_MACVTAP */
rx_handler_result_t tap_handle_frame(struct sk_buff **pskb);
void tap_del_queues(struct net_device *dev);
int tap_get_minor(struct macvlan_dev *vlan);
void tap_free_minor(struct macvlan_dev *vlan);
int tap_queue_resize(struct macvlan_dev *vlan);
#endif /*_LINUX_IF_TAP_H_*/
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment