summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2021-06-12 11:20:56 +0300
committerDavid S. Miller <davem@davemloft.net>2021-06-12 23:16:45 +0300
commit88b710532e53de2466d1033fb1d5125aabf3215a (patch)
tree38f0824c158291f102271254aed6586f02e46f48 /include/linux
parent00e77ed8e64d5f271c1f015c7153545980d48a76 (diff)
downloadlinux-88b710532e53de2466d1033fb1d5125aabf3215a.tar.xz
wwan: add interface creation support
Add support to create (and destroy) interfaces via a new rtnetlink kind "wwan". The responsible driver has to use the new wwan_register_ops() to make this possible. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com> Signed-off-by: Loic Poulain <loic.poulain@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/wwan.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/linux/wwan.h b/include/linux/wwan.h
index fa33cc16d931..430a3a0817de 100644
--- a/include/linux/wwan.h
+++ b/include/linux/wwan.h
@@ -7,6 +7,7 @@
#include <linux/device.h>
#include <linux/kernel.h>
#include <linux/skbuff.h>
+#include <linux/netlink.h>
/**
* enum wwan_port_type - WWAN port types
@@ -116,4 +117,27 @@ void wwan_port_txon(struct wwan_port *port);
*/
void *wwan_port_get_drvdata(struct wwan_port *port);
+/**
+ * struct wwan_ops - WWAN device ops
+ * @owner: module owner of the WWAN ops
+ * @priv_size: size of private netdev data area
+ * @setup: set up a new netdev
+ * @newlink: register the new netdev
+ * @dellink: remove the given netdev
+ */
+struct wwan_ops {
+ struct module *owner;
+ unsigned int priv_size;
+ void (*setup)(struct net_device *dev);
+ int (*newlink)(void *ctxt, struct net_device *dev,
+ u32 if_id, struct netlink_ext_ack *extack);
+ void (*dellink)(void *ctxt, struct net_device *dev,
+ struct list_head *head);
+};
+
+int wwan_register_ops(struct device *parent, const struct wwan_ops *ops,
+ void *ctxt);
+
+void wwan_unregister_ops(struct device *parent);
+
#endif /* __WWAN_H */