diff mbox series

[19/30] patches: handle netdev_walk_all_lower_dev()

Message ID 20201201220415.30582-20-hauke@hauke-m.de (mailing list archive)
State New, archived
Headers show
Series backports: Update to match kernel 5.10-rc6 | expand

Commit Message

Hauke Mehrtens Dec. 1, 2020, 10:04 p.m. UTC
The signature of netdev_walk_all_lower_dev() takes a pointer to struct
netdev_nested_priv starting with kernel 5.9. Add a patch to handle both
cases now.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 patches/0098-netdev_nested_priv/qtnfmac.patch | 43 +++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 patches/0098-netdev_nested_priv/qtnfmac.patch
diff mbox series

Patch

diff --git a/patches/0098-netdev_nested_priv/qtnfmac.patch b/patches/0098-netdev_nested_priv/qtnfmac.patch
new file mode 100644
index 00000000..77d07f61
--- /dev/null
+++ b/patches/0098-netdev_nested_priv/qtnfmac.patch
@@ -0,0 +1,43 @@ 
+--- a/drivers/net/wireless/quantenna/qtnfmac/core.c
++++ b/drivers/net/wireless/quantenna/qtnfmac/core.c
+@@ -671,10 +671,16 @@ bool qtnf_netdev_is_qtn(const struct net
+ 	return ndev->netdev_ops == &qtnf_netdev_ops;
+ }
+ 
++#if LINUX_VERSION_IS_GEQ(5,9,0)
+ static int qtnf_check_br_ports(struct net_device *dev,
+ 			       struct netdev_nested_priv *priv)
+ {
+ 	struct net_device *ndev = (struct net_device *)priv->data;
++#else
++static int qtnf_check_br_ports(struct net_device *dev, void *data)
++{
++	struct net_device *ndev = data;
++#endif
+ 
+ 	if (dev != ndev && netdev_port_same_parent_id(dev, ndev))
+ 		return -ENOTSUPP;
+@@ -687,9 +693,11 @@ static int qtnf_core_netdevice_event(str
+ {
+ 	struct net_device *ndev = netdev_notifier_info_to_dev(ptr);
+ 	const struct netdev_notifier_changeupper_info *info;
++#if LINUX_VERSION_IS_GEQ(5,9,0)
+ 	struct netdev_nested_priv priv = {
+ 		.data = (void *)ndev,
+ 	};
++#endif
+ 	struct net_device *brdev;
+ 	struct qtnf_vif *vif;
+ 	struct qtnf_bus *bus;
+@@ -729,7 +737,11 @@ static int qtnf_core_netdevice_event(str
+ 		} else {
+ 			ret = netdev_walk_all_lower_dev(brdev,
+ 							qtnf_check_br_ports,
++#if LINUX_VERSION_IS_GEQ(5,9,0)
+ 							&priv);
++#else
++							ndev);
++#endif
+ 		}
+ 
+ 		break;