aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/device.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/device.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/device.c b/src/device.c
index 72b93c7..0916ed6 100644
--- a/src/device.c
+++ b/src/device.c
@@ -26,7 +26,7 @@
static LIST_HEAD(device_list);
-static int open(struct net_device *dev)
+static int wg_open(struct net_device *dev)
{
struct in_device *dev_v4 = __in_dev_get_rtnl(dev);
struct wireguard_device *wg = netdev_priv(dev);
@@ -67,8 +67,8 @@ static int open(struct net_device *dev)
}
#if defined(CONFIG_PM_SLEEP) && !defined(CONFIG_ANDROID)
-static int pm_notification(struct notifier_block *nb, unsigned long action,
- void *data)
+static int wg_pm_notification(struct notifier_block *nb, unsigned long action,
+ void *data)
{
struct wireguard_device *wg;
struct wireguard_peer *peer;
@@ -91,10 +91,10 @@ static int pm_notification(struct notifier_block *nb, unsigned long action,
rcu_barrier_bh();
return 0;
}
-static struct notifier_block pm_notifier = { .notifier_call = pm_notification };
+static struct notifier_block pm_notifier = { .notifier_call = wg_pm_notification };
#endif
-static int stop(struct net_device *dev)
+static int wg_stop(struct net_device *dev)
{
struct wireguard_device *wg = netdev_priv(dev);
struct wireguard_peer *peer;
@@ -115,7 +115,7 @@ static int stop(struct net_device *dev)
return 0;
}
-static netdev_tx_t xmit(struct sk_buff *skb, struct net_device *dev)
+static netdev_tx_t wg_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct wireguard_device *wg = netdev_priv(dev);
struct wireguard_peer *peer;
@@ -212,13 +212,13 @@ err:
}
static const struct net_device_ops netdev_ops = {
- .ndo_open = open,
- .ndo_stop = stop,
- .ndo_start_xmit = xmit,
+ .ndo_open = wg_open,
+ .ndo_stop = wg_stop,
+ .ndo_start_xmit = wg_xmit,
.ndo_get_stats64 = ip_tunnel_get_stats64
};
-static void destruct(struct net_device *dev)
+static void wg_destruct(struct net_device *dev)
{
struct wireguard_device *wg = netdev_priv(dev);
@@ -252,7 +252,7 @@ static void destruct(struct net_device *dev)
static const struct device_type device_type = { .name = KBUILD_MODNAME };
-static void setup(struct net_device *dev)
+static void wg_setup(struct net_device *dev)
{
struct wireguard_device *wg = netdev_priv(dev);
enum { WG_NETDEV_FEATURES = NETIF_F_HW_CSUM | NETIF_F_RXCSUM |
@@ -288,9 +288,9 @@ static void setup(struct net_device *dev)
wg->dev = dev;
}
-static int newlink(struct net *src_net, struct net_device *dev,
- struct nlattr *tb[], struct nlattr *data[],
- struct netlink_ext_ack *extack)
+static int wg_newlink(struct net *src_net, struct net_device *dev,
+ struct nlattr *tb[], struct nlattr *data[],
+ struct netlink_ext_ack *extack)
{
int ret = -ENOMEM;
struct wireguard_device *wg = netdev_priv(dev);
@@ -353,7 +353,7 @@ static int newlink(struct net *src_net, struct net_device *dev,
/* We wait until the end to assign priv_destructor, so that
* register_netdevice doesn't call it for us if it fails.
*/
- dev->priv_destructor = destruct;
+ dev->priv_destructor = wg_destruct;
pr_debug("%s: Interface created\n", dev->name);
return ret;
@@ -381,12 +381,12 @@ error_1:
static struct rtnl_link_ops link_ops __read_mostly = {
.kind = KBUILD_MODNAME,
.priv_size = sizeof(struct wireguard_device),
- .setup = setup,
- .newlink = newlink,
+ .setup = wg_setup,
+ .newlink = wg_newlink,
};
-static int netdevice_notification(struct notifier_block *nb,
- unsigned long action, void *data)
+static int wg_netdevice_notification(struct notifier_block *nb,
+ unsigned long action, void *data)
{
struct net_device *dev = ((struct netdev_notifier_info *)data)->dev;
struct wireguard_device *wg = netdev_priv(dev);
@@ -408,7 +408,7 @@ static int netdevice_notification(struct notifier_block *nb,
}
static struct notifier_block netdevice_notifier = {
- .notifier_call = netdevice_notification
+ .notifier_call = wg_netdevice_notification
};
int __init wg_device_init(void)