Skip to contentSkip to conversation

appletalk: remove localtalk and ppp support

PATCH Superseded Arnd Bergmann 8 participants 27 messages Oct 9, 2023 – Oct 11, 2023

Subsystems (11)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/10 appletalk: remove localtalk and ppp support

From: Arnd Bergmann <[email protected]>

The last localtalk driver is gone now, and ppp support was never fully merged, so clean up the appletalk code by removing the obvious dead code paths.

Notably, this removes one of the two callers of the old .ndo_do_ioctl() callback that was abused for getting device addresses and is now only used in the ieee802154 subsystem, which still uses the same trick.

The include/uapi/linux/if_ltalk.h header might still be required for building userspace programs, but I made sure that debian code search and the netatalk upstream have no references it it, so it should be fine to remove.

---
 drivers/net/tun.c             |   3 -
 include/linux/atalk.h         |   1 -
 include/linux/if_ltalk.h      |   8 ---
 include/uapi/linux/if_ltalk.h |  10 ----
 net/appletalk/Makefile        |   2 +-
 net/appletalk/aarp.c          | 108 +++-------------------------------
 net/appletalk/ddp.c           |  97 +-----------------------------
 net/appletalk/dev.c           |  46 ---------------
 8 files changed, 11 insertions(+), 264 deletions(-)
 delete mode 100644 include/linux/if_ltalk.h
 delete mode 100644 include/uapi/linux/if_ltalk.h
 delete mode 100644 net/appletalk/dev.c
drivers/net/tun.c +0 -3
index 89ab9efe522c3..e11476296e253 100644
@@ -70,7 +70,6 @@
 #include <linux/bpf_trace.h>
 #include <linux/mutex.h>
 #include <linux/ieee802154.h>
-#include <linux/if_ltalk.h>
 #include <uapi/linux/if_fddi.h>
 #include <uapi/linux/if_hippi.h>
 #include <uapi/linux/if_fc.h>
@@ -3059,8 +3058,6 @@ static unsigned char tun_get_addr_len(unsigned short type)
 		return ROSE_ADDR_LEN;
 	case ARPHRD_NETROM:
 		return AX25_ADDR_LEN;
-	case ARPHRD_LOCALTLK:
-		return LTALK_ALEN;
 	default:
 		return 0;
 	}
include/linux/atalk.h +0 -1
index a55bfc6567d01..2896f2ac9568e 100644
@@ -121,7 +121,6 @@ static inline struct atalk_iface *atalk_find_dev(struct net_device *dev)
 #endif
 
 extern struct atalk_addr *atalk_find_dev_addr(struct net_device *dev);
-extern struct net_device *atrtr_get_dev(struct atalk_addr *sa);
 extern int		 aarp_send_ddp(struct net_device *dev,
 				       struct sk_buff *skb,
 				       struct atalk_addr *sa, void *hwaddr);
include/linux/if_ltalk.h deleted +0 -8
deleted file mode 100644
index 4cc1c0b778700..0000000000000
@@ -1,8 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#ifndef __LINUX_LTALK_H
-#define __LINUX_LTALK_H
-
-#include <uapi/linux/if_ltalk.h>
-
-extern struct net_device *alloc_ltalkdev(int sizeof_priv);
-#endif
include/uapi/linux/if_ltalk.h deleted +0 -10
deleted file mode 100644
index fa61e776f598d..0000000000000
@@ -1,10 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
-#ifndef _UAPI__LINUX_LTALK_H
-#define _UAPI__LINUX_LTALK_H
-
-#define LTALK_HLEN		1
-#define LTALK_MTU		600
-#define LTALK_ALEN		1
-
-
-#endif /* _UAPI__LINUX_LTALK_H */
net/appletalk/Makefile +1 -1
index 33164d972d379..152312a151800 100644
@@ -5,6 +5,6 @@
 
 obj-$(CONFIG_ATALK) += appletalk.o
 
-appletalk-y			:= aarp.o ddp.o dev.o
+appletalk-y			:= aarp.o ddp.o
 appletalk-$(CONFIG_PROC_FS)	+= atalk_proc.o
 appletalk-$(CONFIG_SYSCTL)	+= sysctl_net_atalk.o
net/appletalk/aarp.c +7 -101

143 lines not on this page · raw message

net/appletalk/ddp.c +3 -94

148 lines not on this page · raw message

net/appletalk/dev.c deleted +0 -46

46 lines not on this page · raw message

Signature · 1 line
2.39.2
#1 lore raw

PATCH 2/10 ieee802154: avoid deprecated .ndo_do_ioctl callback

From: Arnd Bergmann <[email protected]>

The ieee802154 socket implementation is the last remaining caller of the netdevice ioctl callback. In order to completely remove this, add a custom pointer to the existing wpan_dev specific operations structure. Since that structure is currently only used to wrap the 'create' header operation, adjust the naming slightly to make this more generic.

It would be a good idea to adjust the calling conventions and split the get/set operations into separate functions, but that can be a follow-up cleanup. For the moment, I kept the actual changes to a minimum to avoid regressions.

---
 include/net/cfg802154.h | 9 +++++----
 net/ieee802154/socket.c | 5 +++--
 net/mac802154/iface.c   | 8 ++++----
 3 files changed, 12 insertions(+), 10 deletions(-)
include/net/cfg802154.h +5 -4
index f79ce133e51a7..e604df98e2ee9 100644
@@ -433,15 +433,16 @@ struct ieee802154_llsec_device_key {
 	u32 frame_counter;
 };
 
-struct wpan_dev_header_ops {
+struct wpan_dev_ops {
 	/* TODO create callback currently assumes ieee802154_mac_cb inside
 	 * skb->cb. This should be changed to give these information as
 	 * parameter.
 	 */
-	int	(*create)(struct sk_buff *skb, struct net_device *dev,
+	int	(*header_create)(struct sk_buff *skb, struct net_device *dev,
 			  const struct ieee802154_addr *daddr,
 			  const struct ieee802154_addr *saddr,
 			  unsigned int len);
+	int	(*ioctl)(struct net_device *dev, struct ifreq *ifr, int cmd);
 };
 
 struct wpan_dev {
@@ -452,7 +453,7 @@ struct wpan_dev {
 	struct list_head list;
 	struct net_device *netdev;
 
-	const struct wpan_dev_header_ops *header_ops;
+	const struct wpan_dev_ops *ops;
 
 	/* lowpan interface, set when the wpan_dev belongs to one lowpan_dev */
 	struct net_device *lowpan_dev;
@@ -491,7 +492,7 @@ wpan_dev_hard_header(struct sk_buff *skb, struct net_device *dev,
 {
 	struct wpan_dev *wpan_dev = dev->ieee802154_ptr;
 
-	return wpan_dev->header_ops->create(skb, dev, daddr, saddr, len);
+	return wpan_dev->ops->header_create(skb, dev, daddr, saddr, len);
 }
 #endif
 
net/ieee802154/socket.c +3 -2
index 00302e8b9615b..27e58237091ca 100644
@@ -139,8 +139,9 @@ static int ieee802154_dev_ioctl(struct sock *sk, struct ifreq __user *arg,
 	if (!dev)
 		return -ENODEV;
 
-	if (dev->type == ARPHRD_IEEE802154 && dev->netdev_ops->ndo_do_ioctl)
-		ret = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, cmd);
+	if (dev->type == ARPHRD_IEEE802154 && dev->ieee802154_ptr &&
+	    dev->ieee802154_ptr->ops)
+		ret = dev->ieee802154_ptr->ops->ioctl(dev, &ifr, cmd);
 
 	if (!ret && put_user_ifreq(&ifr, arg))
 		ret = -EFAULT;
net/mac802154/iface.c +4 -4
index c0e2da5072bea..4937f8c2fb4cc 100644
@@ -406,8 +406,9 @@ static int ieee802154_header_create(struct sk_buff *skb,
 	return hlen;
 }
 
-static const struct wpan_dev_header_ops ieee802154_header_ops = {
-	.create		= ieee802154_header_create,
+static const struct wpan_dev_ops ieee802154_ops = {
+	.header_create	= ieee802154_header_create,
+	.ioctl		= mac802154_wpan_ioctl,
 };
 
 /* This header create functionality assumes a 8 byte array for
@@ -495,7 +496,6 @@ static const struct net_device_ops mac802154_wpan_ops = {
 	.ndo_open		= mac802154_wpan_open,
 	.ndo_stop		= mac802154_slave_close,
 	.ndo_start_xmit		= ieee802154_subif_start_xmit,
-	.ndo_do_ioctl		= mac802154_wpan_ioctl,
 	.ndo_set_mac_address	= mac802154_wpan_mac_addr,
 };
 
@@ -581,7 +581,7 @@ ieee802154_setup_sdata(struct ieee802154_sub_if_data *sdata,
 		sdata->dev->netdev_ops = &mac802154_wpan_ops;
 		sdata->dev->ml_priv = &mac802154_mlme_wpan;
 		sdata->iface_default_filtering = IEEE802154_FILTERING_4_FRAME_FIELDS;
-		wpan_dev->header_ops = &ieee802154_header_ops;
+		wpan_dev->ops = &ieee802154_ops;
 
 		mutex_init(&sdata->sec_mtx);
 
Signature · 1 line
2.39.2
#2 lore raw

PATCH 3/10 ethernet: sp7021: fix ioctl callback pointer

In reply to Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The old .ndo_do_ioctl() callback is never called any more, instead the driver should set .ndo_eth_ioctl() for the phy operations.

Fixes fd3040b9394c5 ("net: ethernet: Add driver for Sunplus SP7021")
---
 drivers/net/ethernet/sunplus/spl2sw_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/sunplus/spl2sw_driver.c +1 -1
index 391a1bc7f4463..bb4514f4e8157 100644
@@ -199,7 +199,7 @@ static const struct net_device_ops netdev_ops = {
 	.ndo_start_xmit = spl2sw_ethernet_start_xmit,
 	.ndo_set_rx_mode = spl2sw_ethernet_set_rx_mode,
 	.ndo_set_mac_address = spl2sw_ethernet_set_mac_address,
-	.ndo_do_ioctl = phy_do_ioctl,
+	.ndo_eth_ioctl = phy_do_ioctl,
 	.ndo_tx_timeout = spl2sw_ethernet_tx_timeout,
 };
 
Signature · 1 line
2.39.2
#3 lore raw

PATCH 4/10 staging: ks7010: remove unused ioctl handler

In reply to Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The ndo_do_ioctl function has no actual callers, and doesn't do much here, so just remove it entirely as preparation for removing the callback pointer from net_device_ops.

---
 drivers/staging/ks7010/ks_wlan_net.c | 21 ---------------------
 1 file changed, 21 deletions(-)
drivers/staging/ks7010/ks_wlan_net.c +0 -21
index 0fb97a79ad0b3..ab7463bb25169 100644
@@ -51,8 +51,6 @@ static int ks_wlan_close(struct net_device *dev);
 static void ks_wlan_set_rx_mode(struct net_device *dev);
 static struct net_device_stats *ks_wlan_get_stats(struct net_device *dev);
 static int ks_wlan_set_mac_address(struct net_device *dev, void *addr);
-static int ks_wlan_netdev_ioctl(struct net_device *dev, struct ifreq *rq,
-				int cmd);
 
 static atomic_t update_phyinfo;
 static struct timer_list update_phyinfo_timer;
@@ -2458,24 +2456,6 @@ static const struct iw_handler_def ks_wlan_handler_def = {
 	.get_wireless_stats = ks_get_wireless_stats,
 };
 
-static int ks_wlan_netdev_ioctl(struct net_device *dev, struct ifreq *rq,
-				int cmd)
-{
-	int ret;
-	struct iwreq *wrq = (struct iwreq *)rq;
-
-	switch (cmd) {
-	case SIOCIWFIRSTPRIV + 20:	/* KS_WLAN_SET_STOP_REQ */
-		ret = ks_wlan_set_stop_request(dev, NULL, &wrq->u, NULL);
-		break;
-		// All other calls are currently unsupported
-	default:
-		ret = -EOPNOTSUPP;
-	}
-
-	return ret;
-}
-
 static
 struct net_device_stats *ks_wlan_get_stats(struct net_device *dev)
 {
@@ -2608,7 +2588,6 @@ static const struct net_device_ops ks_wlan_netdev_ops = {
 	.ndo_start_xmit = ks_wlan_start_xmit,
 	.ndo_open = ks_wlan_open,
 	.ndo_stop = ks_wlan_close,
-	.ndo_do_ioctl = ks_wlan_netdev_ioctl,
 	.ndo_set_mac_address = ks_wlan_set_mac_address,
 	.ndo_get_stats = ks_wlan_get_stats,
 	.ndo_tx_timeout = ks_wlan_tx_timeout,
Signature · 1 line
2.39.2
#5 lore raw

PATCH 5/10 staging: rtl8192: remove unused legacy ioctl handlers

In reply to Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The .ndo_do_ioctl functions are never called, and can just be removed, especially since this is a staging driver.

---
 drivers/staging/rtl8192u/ieee80211/dot11d.c   |  41 --
 drivers/staging/rtl8192u/ieee80211/dot11d.h   |   2 -
 .../staging/rtl8192u/ieee80211/ieee80211.h    |  12 -
 .../rtl8192u/ieee80211/ieee80211_softmac.c    | 563 ------------------
 drivers/staging/rtl8192u/r8192U.h             |   2 -
 drivers/staging/rtl8192u/r8192U_core.c        | 109 ----
 6 files changed, 729 deletions(-)
drivers/staging/rtl8192u/ieee80211/dot11d.c +0 -41
index ddaf66fa0f936..8a72c1e9eb1e1 100644
@@ -97,22 +97,6 @@ void dot11d_update_country_ie(struct ieee80211_device *dev, u8 *pTaddr,
 }
 EXPORT_SYMBOL(dot11d_update_country_ie);
 
-u8 dot11d_get_max_tx_pwr_in_dbm(struct ieee80211_device *dev, u8 Channel)
-{
-	struct rt_dot11d_info *dot11d_info = GET_DOT11D_INFO(dev);
-	u8 MaxTxPwrInDbm = 255;
-
-	if (Channel > MAX_CHANNEL_NUMBER) {
-		netdev_err(dev->dev, "%s: Invalid Channel\n", __func__);
-		return MaxTxPwrInDbm;
-	}
-	if (dot11d_info->channel_map[Channel])
-		MaxTxPwrInDbm = dot11d_info->max_tx_pwr_dbm_list[Channel];
-
-	return MaxTxPwrInDbm;
-}
-EXPORT_SYMBOL(dot11d_get_max_tx_pwr_in_dbm);
-
 void dot11d_scan_complete(struct ieee80211_device *dev)
 {
 	struct rt_dot11d_info *dot11d_info = GET_DOT11D_INFO(dev);
@@ -147,28 +131,3 @@ int is_legal_channel(struct ieee80211_device *dev, u8 channel)
 	return 0;
 }
 EXPORT_SYMBOL(is_legal_channel);
-
-int to_legal_channel(struct ieee80211_device *dev, u8 channel)
-{
-	struct rt_dot11d_info *dot11d_info = GET_DOT11D_INFO(dev);
-	u8 default_chn = 0;
-	u32 i = 0;
-
-	for (i = 1; i <= MAX_CHANNEL_NUMBER; i++) {
-		if (dot11d_info->channel_map[i] > 0) {
-			default_chn = i;
-			break;
-		}
-	}
-
-	if (channel > MAX_CHANNEL_NUMBER) {
-		netdev_err(dev->dev, "%s: Invalid Channel\n", __func__);
-		return default_chn;
-	}
-
-	if (dot11d_info->channel_map[channel] > 0)
-		return channel;
-
-	return default_chn;
-}
-EXPORT_SYMBOL(to_legal_channel);
drivers/staging/rtl8192u/ieee80211/dot11d.h +0 -2
index 8b485fa180898..fd774265211a5 100644
@@ -49,9 +49,7 @@ void dot11d_update_country_ie(struct ieee80211_device *dev,
 			      u8 *addr,
 			      u16 coutry_ie_len,
 			      u8 *coutry_ie);
-u8 dot11d_get_max_tx_pwr_in_dbm(struct ieee80211_device *dev, u8 channel);
 void dot11d_scan_complete(struct ieee80211_device *dev);
 int is_legal_channel(struct ieee80211_device *dev, u8 channel);
-int to_legal_channel(struct ieee80211_device *dev, u8 channel);
 
 #endif /* #ifndef __INC_DOT11D_H */
drivers/staging/rtl8192u/ieee80211/ieee80211.h +0 -12
index 694d1b18f81c7..fc4201757c408 100644
@@ -223,11 +223,7 @@ struct cb_desc {
 #define MAX_IE_LEN  0xff
 
 // added for kernel conflict
-#define ieee80211_wake_queue		ieee80211_wake_queue_rsl
-#define ieee80211_stop_queue		ieee80211_stop_queue_rsl
 #define notify_wx_assoc_event		notify_wx_assoc_event_rsl
-#define SendDisassociation		SendDisassociation_rsl
-
 
 struct ieee_param {
 	u32 cmd;
@@ -2152,7 +2148,6 @@ int ieee80211_wx_set_gen_ie(struct ieee80211_device *ieee, u8 *ie, size_t len);
 
 /* ieee80211_softmac.c */
 short ieee80211_is_54g(const struct ieee80211_network *net);
-short ieee80211_is_shortslot(const struct ieee80211_network *net);
 int ieee80211_rx_frame_softmac(struct ieee80211_device *ieee,
 			       struct sk_buff *skb,
 			       struct ieee80211_rx_stats *rx_stats,
@@ -2160,7 +2155,6 @@ int ieee80211_rx_frame_softmac(struct ieee80211_device *ieee,
 void ieee80211_softmac_new_net(struct ieee80211_device *ieee,
 			       struct ieee80211_network *net);
 
-void SendDisassociation(struct ieee80211_device *ieee, u8 *asSta, u8 asRsn);
 void ieee80211_softmac_xmit(struct ieee80211_txb *txb,
 			    struct ieee80211_device *ieee);
 
@@ -2182,13 +2176,7 @@ void ieee80211_stop_protocol(struct ieee80211_device *ieee);
 void ieee80211_softmac_start_protocol(struct ieee80211_device *ieee);
 void ieee80211_softmac_stop_protocol(struct ieee80211_device *ieee);
 void ieee80211_reset_queue(struct ieee80211_device *ieee);
-void ieee80211_wake_queue(struct ieee80211_device *ieee);
-void ieee80211_stop_queue(struct ieee80211_device *ieee);
-struct sk_buff *ieee80211_get_beacon(struct ieee80211_device *ieee);
 void ieee80211_start_send_beacons(struct ieee80211_device *ieee);
-int ieee80211_wpa_supplicant_ioctl(struct ieee80211_device *ieee,
-				   struct iw_point *p);
-void ieee80211_ps_tx_ack(struct ieee80211_device *ieee, short success);
 
 void softmac_mgmt_xmit(struct sk_buff *skb, struct ieee80211_device *ieee);
 
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c +0 -563

611 lines not on this page · raw message

drivers/staging/rtl8192u/r8192U.h +0 -2
index ff0ada00bf414..ef59c785f950a 100644
@@ -453,8 +453,6 @@ typedef enum _WIRELESS_MODE {
 	WIRELESS_MODE_N_5G = 0x20
 } WIRELESS_MODE;
 
-#define RTL_IOCTL_WPA_SUPPLICANT		(SIOCIWFIRSTPRIV + 30)
-
 typedef struct buffer {
 	struct buffer *next;
 	u32 *buf;
drivers/staging/rtl8192u/r8192U_core.c +0 -109

121 lines not on this page · raw message

Signature · 1 line
2.39.2
maintainer Reviewed-by on v1 5/10
#6 lore raw

Re: [PATCH 05/10] staging: rtl8192: remove unused legacy ioctl handlers

Quoted 6 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The .ndo_do_ioctl functions are never called, and can just be removed, especially since this is a staging driver.

Quoted 8 lines
---
 drivers/staging/rtl8192u/ieee80211/dot11d.c   |  41 --
 drivers/staging/rtl8192u/ieee80211/dot11d.h   |   2 -
 .../staging/rtl8192u/ieee80211/ieee80211.h    |  12 -
 .../rtl8192u/ieee80211/ieee80211_softmac.c    | 563 ------------------
 drivers/staging/rtl8192u/r8192U.h             |   2 -
 drivers/staging/rtl8192u/r8192U_core.c        | 109 ----
 6 files changed, 729 deletions(-)
#7 lore raw

PATCH 6/10 staging: rtl8712: remove unused legacy ioctl handlers

In reply to Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The .ndo_do_ioctl functions are never called, and can just be removed, especially since this is a staging driver.

---
 drivers/staging/rtl8712/os_intfs.c            |   1 -
 drivers/staging/rtl8712/osdep_intf.h          |   2 -
 drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 124 ------------------
 3 files changed, 127 deletions(-)
drivers/staging/rtl8712/os_intfs.c +0 -1
index b18e6d9c832b8..121edffbd2507 100644
@@ -191,7 +191,6 @@ static const struct net_device_ops rtl8712_netdev_ops = {
 	.ndo_start_xmit = r8712_xmit_entry,
 	.ndo_set_mac_address = r871x_net_set_mac_address,
 	.ndo_get_stats = r871x_net_get_stats,
-	.ndo_do_ioctl = r871x_ioctl,
 };
 
 struct net_device *r8712_init_netdev(void)
drivers/staging/rtl8712/osdep_intf.h +0 -2
index 9e75116c987ec..ce823030bfec2 100644
@@ -27,6 +27,4 @@ struct intf_priv {
 	struct completion io_retevt_comp;
 };
 
-int r871x_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
-
 #endif	/*_OSDEP_INTF_H_*/
drivers/staging/rtl8712/rtl871x_ioctl_linux.c +0 -124

136 lines not on this page · raw message

Signature · 1 line
2.39.2
maintainer Reviewed-by on v1 6/10
#8 lore raw

Re: [PATCH 06/10] staging: rtl8712: remove unused legacy ioctl handlers

Quoted 11 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The .ndo_do_ioctl functions are never called, and can just be removed, especially since this is a staging driver.

---
 drivers/staging/rtl8712/os_intfs.c            |   1 -
 drivers/staging/rtl8712/osdep_intf.h          |   2 -
 drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 124 ------------------
 3 files changed, 127 deletions(-)
#9 lore raw

PATCH 7/10 staging: rtl8723bs: remove dead code

In reply to Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The .ndo_do_ioctl functions are never called, so the three implementation here is useless but only works as a way to identify the device in the notifiers, which can really be removed as well.

Looking through the exported functions, I found a bunch more that have no callers, so just drop all of those.

---
 drivers/staging/rtl8723bs/Makefile            |    1 -
 .../staging/rtl8723bs/include/osdep_intf.h    |   32 -
 drivers/staging/rtl8723bs/include/rtw_io.h    |    1 -
 .../staging/rtl8723bs/os_dep/ioctl_linux.c    | 1300 -----------------
 drivers/staging/rtl8723bs/os_dep/os_intfs.c   |   29 -
 drivers/staging/rtl8723bs/os_dep/sdio_intf.c  |   23 +-
 6 files changed, 1 insertion(+), 1385 deletions(-)
 delete mode 100644 drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
drivers/staging/rtl8723bs/Makefile +0 -1
index 590bde02058c7..0f3f6dea4955e 100644
@@ -50,7 +50,6 @@ r8723bs-y = \
 		hal/HalHWImg8723B_RF.o \
 		hal/HalPhyRf_8723B.o \
 		os_dep/ioctl_cfg80211.o \
-		os_dep/ioctl_linux.o \
 		os_dep/mlme_linux.o \
 		os_dep/osdep_service.o \
 		os_dep/os_intfs.o \
drivers/staging/rtl8723bs/include/osdep_intf.h +0 -32
index 111e0179712ac..83a25598e9627 100644
@@ -8,33 +8,6 @@
 #ifndef __OSDEP_INTF_H_
 #define __OSDEP_INTF_H_
 
-
-struct intf_priv {
-
-	u8 *intf_dev;
-	u32 max_iosz;	/* USB2.0: 128, USB1.1: 64, SDIO:64 */
-	u32 max_xmitsz; /* USB2.0: unlimited, SDIO:512 */
-	u32 max_recvsz; /* USB2.0: unlimited, SDIO:512 */
-
-	volatile u8 *io_rwmem;
-	volatile u8 *allocated_io_rwmem;
-	u32 io_wsz; /* unit: 4bytes */
-	u32 io_rsz;/* unit: 4bytes */
-	u8 intf_status;
-
-	void (*_bus_io)(u8 *priv);
-
-/*
-Under Sync. IRP (SDIO/USB)
-A protection mechanism is necessary for the io_rwmem(read/write protocol)
-
-Under Async. IRP (SDIO/USB)
-The protection mechanism is through the pending queue.
-*/
-
-	struct mutex ioctl_mutex;
-};
-
 struct dvobj_priv *devobj_init(void);
 void devobj_deinit(struct dvobj_priv *pdvobj);
 
@@ -47,17 +20,12 @@ u32 rtw_start_drv_threads(struct adapter *padapter);
 void rtw_stop_drv_threads(struct adapter *padapter);
 void rtw_cancel_all_timer(struct adapter *padapter);
 
-int rtw_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
-
 int rtw_init_netdev_name(struct net_device *pnetdev, const char *ifname);
 struct net_device *rtw_init_netdev(struct adapter *padapter);
 void rtw_unregister_netdevs(struct dvobj_priv *dvobj);
 
 u16 rtw_recv_select_queue(struct sk_buff *skb);
 
-int rtw_ndev_notifier_register(void);
-void rtw_ndev_notifier_unregister(void);
-
 void rtw_ips_dev_unload(struct adapter *padapter);
 
 int rtw_ips_pwr_up(struct adapter *padapter);
drivers/staging/rtl8723bs/include/rtw_io.h +0 -1
index e98083a07a660..f92093e73fe67 100644
@@ -72,7 +72,6 @@
 
 #define _INTF_ASYNC_	BIT(0)	/* support async io */
 
-struct intf_priv;
 struct intf_hdl;
 struct io_queue;
 
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c deleted +0 -1300

1,300 lines not on this page · raw message

drivers/staging/rtl8723bs/os_dep/os_intfs.c +0 -29
index 68bba3c0e757a..90564fbb78f34 100644
@@ -382,34 +382,6 @@ u16 rtw_recv_select_queue(struct sk_buff *skb)
 	return rtw_1d_to_queue[priority];
 }
 
-static int rtw_ndev_notifier_call(struct notifier_block *nb, unsigned long state, void *ptr)
-{
-	struct net_device *dev = netdev_notifier_info_to_dev(ptr);
-
-	if (dev->netdev_ops->ndo_do_ioctl != rtw_ioctl)
-		return NOTIFY_DONE;
-
-	netdev_dbg(dev, FUNC_NDEV_FMT " state:%lu\n", FUNC_NDEV_ARG(dev),
-		    state);
-
-	return NOTIFY_DONE;
-}
-
-static struct notifier_block rtw_ndev_notifier = {
-	.notifier_call = rtw_ndev_notifier_call,
-};
-
-int rtw_ndev_notifier_register(void)
-{
-	return register_netdevice_notifier(&rtw_ndev_notifier);
-}
-
-void rtw_ndev_notifier_unregister(void)
-{
-	unregister_netdevice_notifier(&rtw_ndev_notifier);
-}
-
-
 static int rtw_ndev_init(struct net_device *dev)
 {
 	struct adapter *adapter = rtw_netdev_priv(dev);
@@ -436,7 +408,6 @@ static const struct net_device_ops rtw_netdev_ops = {
 	.ndo_select_queue	= rtw_select_queue,
 	.ndo_set_mac_address = rtw_net_set_mac_address,
 	.ndo_get_stats = rtw_net_get_stats,
-	.ndo_do_ioctl = rtw_ioctl,
 };
 
 int rtw_init_netdev_name(struct net_device *pnetdev, const char *ifname)
drivers/staging/rtl8723bs/os_dep/sdio_intf.c +1 -22
index 4904314845242..effe4ffac54eb 100644
@@ -383,7 +383,6 @@ static int rtw_drv_init(
 	if (sdio_alloc_irq(dvobj) != _SUCCESS)
 		goto free_if1;
 
-	rtw_ndev_notifier_register();
 	status = _SUCCESS;
 
 free_if1:
@@ -483,24 +482,4 @@ static int rtw_sdio_resume(struct device *dev)
 	return ret;
 }
 
-static int __init rtw_drv_entry(void)
-{
-	int ret;
-
-	ret = sdio_register_driver(&rtl8723bs_sdio_driver);
-	if (ret != 0)
-		rtw_ndev_notifier_unregister();
-
-	return ret;
-}
-
-static void __exit rtw_drv_halt(void)
-{
-	sdio_unregister_driver(&rtl8723bs_sdio_driver);
-
-	rtw_ndev_notifier_unregister();
-}
-
-
-module_init(rtw_drv_entry);
-module_exit(rtw_drv_halt);
+module_sdio_driver(rtl8723bs_sdio_driver);
Signature · 1 line
2.39.2
maintainer Reviewed-by on v1 7/10
#10 lore raw

Re: [PATCH 07/10] staging: rtl8723bs: remove dead code

Quoted 10 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The .ndo_do_ioctl functions are never called, so the three implementation here is useless but only works as a way to identify the device in the notifiers, which can really be removed as well.

Looking through the exported functions, I found a bunch more that have no callers, so just drop all of those.

#11 lore raw

PATCH 8/10 wireless: atmel: remove unused ioctl function

In reply to Arnd Bergmann

From: Arnd Bergmann <[email protected]>

This function has no callers, and for the past 20 years, the request_firmware interface has been in place instead of the custom firmware loader.

---
 drivers/net/wireless/atmel/atmel.c | 72 ------------------------------
 1 file changed, 72 deletions(-)
drivers/net/wireless/atmel/atmel.c +0 -72
index 7c2d1c588156d..461dce21de2b0 100644
@@ -571,7 +571,6 @@ static const struct {
 		      { REG_DOMAIN_ISRAEL, 3, 9, "Israel"} };
 
 static void build_wpa_mib(struct atmel_private *priv);
-static int atmel_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
 static void atmel_copy_to_card(struct net_device *dev, u16 dest,
 			       const unsigned char *src, u16 len);
 static void atmel_copy_to_host(struct net_device *dev, unsigned char *dest,
@@ -1487,7 +1486,6 @@ static const struct net_device_ops atmel_netdev_ops = {
 	.ndo_stop		= atmel_close,
 	.ndo_set_mac_address 	= atmel_set_mac_address,
 	.ndo_start_xmit 	= start_tx,
-	.ndo_do_ioctl 		= atmel_ioctl,
 	.ndo_validate_addr	= eth_validate_addr,
 };
 
@@ -2616,76 +2614,6 @@ static const struct iw_handler_def atmel_handler_def = {
 	.get_wireless_stats = atmel_get_wireless_stats
 };
 
-static int atmel_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
-{
-	int i, rc = 0;
-	struct atmel_private *priv = netdev_priv(dev);
-	struct atmel_priv_ioctl com;
-	struct iwreq *wrq = (struct iwreq *) rq;
-	unsigned char *new_firmware;
-	char domain[REGDOMAINSZ + 1];
-
-	switch (cmd) {
-	case ATMELIDIFC:
-		wrq->u.param.value = ATMELMAGIC;
-		break;
-
-	case ATMELFWL:
-		if (copy_from_user(&com, rq->ifr_data, sizeof(com))) {
-			rc = -EFAULT;
-			break;
-		}
-
-		if (!capable(CAP_NET_ADMIN)) {
-			rc = -EPERM;
-			break;
-		}
-
-		new_firmware = memdup_user(com.data, com.len);
-		if (IS_ERR(new_firmware)) {
-			rc = PTR_ERR(new_firmware);
-			break;
-		}
-
-		kfree(priv->firmware);
-
-		priv->firmware = new_firmware;
-		priv->firmware_length = com.len;
-		strncpy(priv->firmware_id, com.id, 31);
-		priv->firmware_id[31] = '\0';
-		break;
-
-	case ATMELRD:
-		if (copy_from_user(domain, rq->ifr_data, REGDOMAINSZ)) {
-			rc = -EFAULT;
-			break;
-		}
-
-		if (!capable(CAP_NET_ADMIN)) {
-			rc = -EPERM;
-			break;
-		}
-
-		domain[REGDOMAINSZ] = 0;
-		rc = -EINVAL;
-		for (i = 0; i < ARRAY_SIZE(channel_table); i++) {
-			if (!strcasecmp(channel_table[i].name, domain)) {
-				priv->config_reg_domain = channel_table[i].reg_domain;
-				rc = 0;
-			}
-		}
-
-		if (rc == 0 &&  priv->station_state != STATION_STATE_DOWN)
-			rc = atmel_open(dev);
-		break;
-
-	default:
-		rc = -EOPNOTSUPP;
-	}
-
-	return rc;
-}
-
 struct auth_body {
 	__le16 alg;
 	__le16 trans_seq;
Signature · 1 line
2.39.2
Acked-by on v1 8/10
#12 lore raw

Re: [PATCH 08/10] wireless: atmel: remove unused ioctl function

Quoted 6 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

This function has no callers, and for the past 20 years, the request_firmware interface has been in place instead of the custom firmware loader.

Yuck, good riddance. In the title we prefer "wifi:" over "wireless:" but that's nitpicking. I assume this goes via a net tree so:

Let me know if I should take this to wireless-next instead.

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
#13 lore raw

PATCH 9/10 wireless: hostap: remove unused ioctl function

In reply to Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The ioctl handler has no actual callers in the kernel and is useless. All the functionality should be reachable through the regualar interfaces.

---
 drivers/net/wireless/intersil/hostap/hostap.h |   1 -
 .../wireless/intersil/hostap/hostap_ioctl.c   | 228 ------------------
 .../wireless/intersil/hostap/hostap_main.c    |   3 -
 3 files changed, 232 deletions(-)
drivers/net/wireless/intersil/hostap/hostap.h +0 -1
index c17ab6dbbb538..552ae33d78751 100644
@@ -92,7 +92,6 @@ void hostap_info_process(local_info_t *local, struct sk_buff *skb);
 extern const struct iw_handler_def hostap_iw_handler_def;
 extern const struct ethtool_ops prism2_ethtool_ops;
 
-int hostap_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
 int hostap_siocdevprivate(struct net_device *dev, struct ifreq *ifr,
 			  void __user *data, int cmd);
 
drivers/net/wireless/intersil/hostap/hostap_ioctl.c +0 -228

246 lines not on this page · raw message

drivers/net/wireless/intersil/hostap/hostap_main.c +0 -3
index 787f685e70b49..bf86ac26c2acc 100644
@@ -796,7 +796,6 @@ static const struct net_device_ops hostap_netdev_ops = {
 
 	.ndo_open		= prism2_open,
 	.ndo_stop		= prism2_close,
-	.ndo_do_ioctl		= hostap_ioctl,
 	.ndo_siocdevprivate	= hostap_siocdevprivate,
 	.ndo_set_mac_address	= prism2_set_mac_address,
 	.ndo_set_rx_mode	= hostap_set_multicast_list,
@@ -809,7 +808,6 @@ static const struct net_device_ops hostap_mgmt_netdev_ops = {
 
 	.ndo_open		= prism2_open,
 	.ndo_stop		= prism2_close,
-	.ndo_do_ioctl		= hostap_ioctl,
 	.ndo_siocdevprivate	= hostap_siocdevprivate,
 	.ndo_set_mac_address	= prism2_set_mac_address,
 	.ndo_set_rx_mode	= hostap_set_multicast_list,
@@ -822,7 +820,6 @@ static const struct net_device_ops hostap_master_ops = {
 
 	.ndo_open		= prism2_open,
 	.ndo_stop		= prism2_close,
-	.ndo_do_ioctl		= hostap_ioctl,
 	.ndo_siocdevprivate	= hostap_siocdevprivate,
 	.ndo_set_mac_address	= prism2_set_mac_address,
 	.ndo_set_rx_mode	= hostap_set_multicast_list,
Signature · 1 line
2.39.2
Acked-by on v1 9/10
#14 lore raw

Re: [PATCH 09/10] wireless: hostap: remove unused ioctl function

Quoted 6 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The ioctl handler has no actual callers in the kernel and is useless. All the functionality should be reachable through the regualar interfaces.

In the title we prefer "wifi:" over "wireless:" but that's nitpicking. I assume this goes via a net tree so:

Let me know if I should take this to wireless-next instead.

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
#15 lore raw

Re: [PATCH 09/10] wireless: hostap: remove unused ioctl function

Quoted 11 lines · Kalle Valo
Quoted 6 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The ioctl handler has no actual callers in the kernel and is useless. All the functionality should be reachable through the regualar interfaces.

In the title we prefer "wifi:" over "wireless:" but that's nitpicking. I assume this goes via a net tree so:

Changed for v2

Quoted 1 line

Thanks

Quoted 1 line

Let me know if I should take this to wireless-next instead.

I think it's better to keep the series together and merge it through net-next directly, since the last patch depends on all the ones before it.

Arnd

#16 lore raw

PATCH 10/10 net: remove ndo_do_ioctl handler

In reply to Arnd Bergmann

From: Arnd Bergmann <[email protected]>

All of the references to the callback pointer are gone, so remove the pointer itself before we grow new references to it.

---
 Documentation/networking/netdevices.rst | 8 --------
 include/linux/netdevice.h               | 7 -------
 2 files changed, 15 deletions(-)
Documentation/networking/netdevices.rst +0 -8
index 9e4cccb90b870..6f9b71c5d37b8 100644
@@ -218,14 +218,6 @@ ndo_stop:
 	Context: process
 	Note: netif_running() is guaranteed false
 
-ndo_do_ioctl:
-	Synchronization: rtnl_lock() semaphore.
-	Context: process
-
-        This is only called by network subsystems internally,
-        not by user space calling ioctl as it was in before
-        linux-5.14.
-
 ndo_siocbond:
         Synchronization: rtnl_lock() semaphore.
         Context: process
include/linux/netdevice.h +0 -7
index e070a4540fbaf..8d1cc8f195cb6 100644
@@ -1121,11 +1121,6 @@ struct netdev_net_notifier {
  * int (*ndo_validate_addr)(struct net_device *dev);
  *	Test if Media Access Control address is valid for the device.
  *
- * int (*ndo_do_ioctl)(struct net_device *dev, struct ifreq *ifr, int cmd);
- *	Old-style ioctl entry point. This is used internally by the
- *	appletalk and ieee802154 subsystems but is no longer called by
- *	the device ioctl handler.
- *
  * int (*ndo_siocbond)(struct net_device *dev, struct ifreq *ifr, int cmd);
  *	Used by the bonding driver for its device specific ioctls:
  *	SIOCBONDENSLAVE, SIOCBONDRELEASE, SIOCBONDSETHWADDR, SIOCBONDCHANGEACTIVE,
@@ -1429,8 +1424,6 @@ struct net_device_ops {
 	int			(*ndo_set_mac_address)(struct net_device *dev,
 						       void *addr);
 	int			(*ndo_validate_addr)(struct net_device *dev);
-	int			(*ndo_do_ioctl)(struct net_device *dev,
-					        struct ifreq *ifr, int cmd);
 	int			(*ndo_eth_ioctl)(struct net_device *dev,
 						 struct ifreq *ifr, int cmd);
 	int			(*ndo_siocbond)(struct net_device *dev,
Signature · 1 line
2.39.2
#17 lore raw
In reply to Arnd Bergmann
Quoted 11 lines

From: Arnd Bergmann <[email protected]>

The last localtalk driver is gone now, and ppp support was never fully merged, so clean up the appletalk code by removing the obvious dead code paths.

Notably, this removes one of the two callers of the old .ndo_do_ioctl() callback that was abused for getting device addresses and is now only used in the ieee802154 subsystem, which still uses the same trick.

Quoted 6 lines

The include/uapi/linux/if_ltalk.h header might still be required for building userspace programs, but I made sure that debian code search and the netatalk upstream have no references it it, so it should be fine to remove.

Hi!
I’ve been working on a new LocalTalk interface driver for the last couple months, do you think it would be possible to at least postpone the removal of LT a bit?

It is a driver for an open source device called TashTalk (https://github.com/lampmerchant/tashtalk), which runs on a PIC micro that does all the LT interfacing, and communicates back via serial to the host system. My driver is relatively simple and works very well with netatalk 2.2 (which is still maintained and still has support for AppleTalk). The driver is basically complete and trsted and I was preparing to submit a patch.

Still having LocalTalk in my view has many advantages for us enthusiasts that still want to bridge old machines to the current world without modifications, for example for printing on modern printers, netbooting, sharing files and even tcp/ip. All this basically works out of the box via the driver, Linux and available userspace tools (netatalk, macipgw).

The old ISA cards supported by COPS were basically unobtanium even 20 years ago, but the solution of using a PIC and a serial port is very robust and much more furure-proof. We also already have a device that can interface a modern machine directly via USB to LocalTalk.

The development of the TashTalk has been also extensively discussed on thr 68KMLA forum (https://68kmla.org/bb/index.php?threads/modtashtalk-lt0-driver-for-linux.45031/)

I hope the decision to remove LocalTalk can be reconsidered at least for the time being so there is a chance to submit a new, modern device making use of this stack.

Many Thanks,
Rodolfo Zitellini

#18 lore raw
Quoted 42 lines · Rodolfo Zitellini
Quoted 10 lines

From: Arnd Bergmann <[email protected]>

The last localtalk driver is gone now, and ppp support was never fully merged, so clean up the appletalk code by removing the obvious dead code paths.

Notably, this removes one of the two callers of the old .ndo_do_ioctl() callback that was abused for getting device addresses and is now only used in the ieee802154 subsystem, which still uses the same trick.

Quoted 6 lines

The include/uapi/linux/if_ltalk.h header might still be required for building userspace programs, but I made sure that debian code search and the netatalk upstream have no references it it, so it should be fine to remove.

Hi!
I’ve been working on a new LocalTalk interface driver for the last couple months, do you think it would be possible to at least postpone the removal of LT a bit?

It is a driver for an open source device called TashTalk
(https://github.com/lampmerchant/tashtalk), which runs on a PIC micro that does all the LT interfacing, and communicates back via serial to the host system. My driver is relatively simple and works very well with netatalk 2.2 (which is still maintained and still has support for AppleTalk). The driver is basically complete and trsted and I was preparing to submit a patch.

Still having LocalTalk in my view has many advantages for us enthusiasts that still want to bridge old machines to the current world without modifications, for example for printing on modern printers, netbooting, sharing files and even tcp/ip. All this basically works out of the box via the driver, Linux and available userspace tools (netatalk, macipgw).

The old ISA cards supported by COPS were basically unobtanium even 20 years ago, but the solution of using a PIC and a serial port is very robust and much more furure-proof. We also already have a device that can interface a modern machine directly via USB to LocalTalk.

Quoted 7 lines

The development of the TashTalk has been also extensively discussed on thr 68KMLA forum
(https://68kmla.org/bb/index.php?threads/modtashtalk-lt0-driver-for-linux.45031/)

I hope the decision to remove LocalTalk can be reconsidered at least for the time being so there is a chance to submit a new, modern device making use of this stack.

Nothing is decided, I'm just proposing my patch as a cleanup for now. It would be nice to still drop the ndo_do_ioctl function though, at least in some form. When your driver actually makes it into the kernel, you can find a different method of communicating the address between the socket interface and the device driver.

I can see a few ways this could work out:

- add a custom callback pointer to struct atalk_iface to get and set the address for phase1 probing instead of going through the ioctl

- rewrite the probing logic in aarp.c more widely, and improve the userspace interface in the process by introducing a netlink interface

- Move your entire driver into userspace and go to the kernel using tun/tap. This has the added benefit of avoiding a lot of the complexity of the tty line discipline code you have.

Arnd

#19 lore raw
Quoted 55 lines

Il giorno 9 ott 2023, alle ore 19:29, Arnd Bergmann <[email protected]> ha scritto:

Quoted 42 lines · Rodolfo Zitellini
Quoted 10 lines

From: Arnd Bergmann <[email protected]>

The last localtalk driver is gone now, and ppp support was never fully merged, so clean up the appletalk code by removing the obvious dead code paths.

Notably, this removes one of the two callers of the old .ndo_do_ioctl() callback that was abused for getting device addresses and is now only used in the ieee802154 subsystem, which still uses the same trick.

Quoted 6 lines

The include/uapi/linux/if_ltalk.h header might still be required for building userspace programs, but I made sure that debian code search and the netatalk upstream have no references it it, so it should be fine to remove.

Hi!
I’ve been working on a new LocalTalk interface driver for the last couple months, do you think it would be possible to at least postpone the removal of LT a bit?

It is a driver for an open source device called TashTalk
(https://github.com/lampmerchant/tashtalk), which runs on a PIC micro that does all the LT interfacing, and communicates back via serial to the host system. My driver is relatively simple and works very well with netatalk 2.2 (which is still maintained and still has support for AppleTalk). The driver is basically complete and trsted and I was preparing to submit a patch.

Still having LocalTalk in my view has many advantages for us enthusiasts that still want to bridge old machines to the current world without modifications, for example for printing on modern printers, netbooting, sharing files and even tcp/ip. All this basically works out of the box via the driver, Linux and available userspace tools (netatalk, macipgw).

The old ISA cards supported by COPS were basically unobtanium even 20 years ago, but the solution of using a PIC and a serial port is very robust and much more furure-proof. We also already have a device that can interface a modern machine directly via USB to LocalTalk.

Quoted 7 lines

The development of the TashTalk has been also extensively discussed on thr 68KMLA forum
(https://68kmla.org/bb/index.php?threads/modtashtalk-lt0-driver-for-linux.45031/)

I hope the decision to remove LocalTalk can be reconsidered at least for the time being so there is a chance to submit a new, modern device making use of this stack.

Quoted 5 lines

Nothing is decided, I'm just proposing my patch as a cleanup for now. It would be nice to still drop the ndo_do_ioctl function though, at least in some form. When your driver actually makes it into the kernel, you can find a different method of communicating the address between the socket interface and the device driver.

Yes I too think it is good to remove ndo_do_ioctl, I designed the TashTalk driver to be a drop-in replacement for COPS mostly for compatibility with netatalk 2.2. My plan was to propose it like this (so nothing else needed to be changed) and the propose some patches in the kernel part and userspace part (netatalk).

Quoted 5 lines

I can see a few ways this could work out:

- add a custom callback pointer to struct atalk_iface to get and set the address for phase1 probing instead of going through the ioctl

This was my initial thought, at least for the moment, mostly to keep netatalk happy and make sure I don’t break other stuff that makes assumptions on how the address probing worked. There are other bits I would like to improve, for example tcpdump (which parses correctly appetalk packets!) is broken in the current implementation.

Quoted 3 lines

- rewrite the probing logic in aarp.c more widely, and improve the userspace interface in the process by introducing a netlink interface

This is sorta the “second step” I was planning, I think the logic for probing could be redesigned and simplified (it also does not work 100% correctly), and it could be a good chance to improve the interface with netatalk too.

Quoted 3 lines

- Move your entire driver into userspace and go to the kernel using tun/tap. This has the added benefit of avoiding a lot of the complexity of the tty line discipline code you have.

We had some discussion too if to just make the lt an userspace stack, I personally like how it is currently implemented because existing code can run basically without modification.

I would propose at this stage to change the TashTalk driver to remove ndo_do_ioctl and to use a custom callback, if this ok.

Many thanks,
Rodolfo

#20 lore raw

PATCH v2 1/1 appletalk: make localtalk and ppp support conditional

From: Arnd Bergmann <[email protected]>

The last localtalk driver is gone now, and ppp support was never fully merged, but the code to support them for phase1 networking still calls the deprecated .ndo_do_ioctl() helper.

In order to better isolate the localtalk and ppp portions of appletalk, guard all of the corresponding code with CONFIG_DEV_APPLETALK checks, including a preprocessor conditional that guards the internal ioctl calls.

This is currently all dead code and will now be left out of the module since this Kconfig symbol is always undefined, but there are plans to add a new driver for localtalk again in the future. When that happens, the logic can be cleaned up to work properly without the need for the ioctl.

---
v2: don't actually remove the code, just make it conditional since we are likely to need it again.

 include/linux/atalk.h  |  1 -
 net/appletalk/Makefile |  3 ++-
 net/appletalk/aarp.c   | 24 +++++++++++++++---------
 net/appletalk/ddp.c    | 24 +++++++++++++-----------
 4 files changed, 30 insertions(+), 22 deletions(-)
include/linux/atalk.h +0 -1
index a55bfc6567d01..2896f2ac9568e 100644
@@ -121,7 +121,6 @@ static inline struct atalk_iface *atalk_find_dev(struct net_device *dev)
 #endif
 
 extern struct atalk_addr *atalk_find_dev_addr(struct net_device *dev);
-extern struct net_device *atrtr_get_dev(struct atalk_addr *sa);
 extern int		 aarp_send_ddp(struct net_device *dev,
 				       struct sk_buff *skb,
 				       struct atalk_addr *sa, void *hwaddr);
net/appletalk/Makefile +2 -1
index 33164d972d379..410d52f9113e2 100644
@@ -5,6 +5,7 @@
 
 obj-$(CONFIG_ATALK) += appletalk.o
 
-appletalk-y			:= aarp.o ddp.o dev.o
+appletalk-y			:= aarp.o ddp.o
 appletalk-$(CONFIG_PROC_FS)	+= atalk_proc.o
 appletalk-$(CONFIG_SYSCTL)	+= sysctl_net_atalk.o
+appletalk-$(CONFIG_DEV_APPLETALK) += dev.o
net/appletalk/aarp.c +15 -9
index 9fa0b246902be..b15f67293ac4c 100644
@@ -438,14 +438,17 @@ static struct atalk_addr *__aarp_proxy_find(struct net_device *dev,
  */
 static void aarp_send_probe_phase1(struct atalk_iface *iface)
 {
+#if IS_ENABLED(CONFIG_DEV_APPLETALK)
 	struct ifreq atreq;
 	struct sockaddr_at *sa = (struct sockaddr_at *)&atreq.ifr_addr;
 	const struct net_device_ops *ops = iface->dev->netdev_ops;
 
 	sa->sat_addr.s_node = iface->address.s_node;
 	sa->sat_addr.s_net = ntohs(iface->address.s_net);
-
-	/* We pass the Net:Node to the drivers/cards by a Device ioctl. */
+	/*
+	 * We used to pass the address via device ioctl, this has to
+	 *  be rewritten if we bring back localtalk.
+	 */
 	if (!(ops->ndo_do_ioctl(iface->dev, &atreq, SIOCSIFADDR))) {
 		ops->ndo_do_ioctl(iface->dev, &atreq, SIOCGIFADDR);
 		if (iface->address.s_net != htons(sa->sat_addr.s_net) ||
@@ -455,13 +458,15 @@ static void aarp_send_probe_phase1(struct atalk_iface *iface)
 		iface->address.s_net  = htons(sa->sat_addr.s_net);
 		iface->address.s_node = sa->sat_addr.s_node;
 	}
+#endif
 }
 
 
 void aarp_probe_network(struct atalk_iface *atif)
 {
-	if (atif->dev->type == ARPHRD_LOCALTLK ||
-	    atif->dev->type == ARPHRD_PPP)
+	if (IS_ENABLED(CONFIG_DEV_APPLETALK) &&
+	    (atif->dev->type == ARPHRD_LOCALTLK ||
+	     atif->dev->type == ARPHRD_PPP))
 		aarp_send_probe_phase1(atif);
 	else {
 		unsigned int count;
@@ -488,8 +493,9 @@ int aarp_proxy_probe_network(struct atalk_iface *atif, struct atalk_addr *sa)
 	 * we don't currently support LocalTalk or PPP for proxy AARP;
 	 * if someone wants to try and add it, have fun
 	 */
-	if (atif->dev->type == ARPHRD_LOCALTLK ||
-	    atif->dev->type == ARPHRD_PPP)
+	if (IS_ENABLED(CONFIG_DEV_APPLETALK) &&
+	    (atif->dev->type == ARPHRD_LOCALTLK ||
+	     atif->dev->type == ARPHRD_PPP))
 		goto out;
 
 	/*
@@ -550,7 +556,8 @@ int aarp_send_ddp(struct net_device *dev, struct sk_buff *skb,
 	skb_reset_network_header(skb);
 
 	/* Check for LocalTalk first */
-	if (dev->type == ARPHRD_LOCALTLK) {
+	if (IS_ENABLED(CONFIG_DEV_APPLETALK) &&
+	    dev->type == ARPHRD_LOCALTLK) {
 		struct atalk_addr *at = atalk_find_dev_addr(dev);
 		struct ddpehdr *ddp = (struct ddpehdr *)skb->data;
 		int ft = 2;
@@ -588,7 +595,7 @@ int aarp_send_ddp(struct net_device *dev, struct sk_buff *skb,
 	}
 
 	/* On a PPP link we neither compress nor aarp.  */
-	if (dev->type == ARPHRD_PPP) {
+	if (IS_ENABLED(CONFIG_DEV_APPLETALK) && dev->type == ARPHRD_PPP) {
 		skb->protocol = htons(ETH_P_PPPTALK);
 		skb->dev = dev;
 		goto sendit;
@@ -674,7 +681,6 @@ int aarp_send_ddp(struct net_device *dev, struct sk_buff *skb,
 drop:
 	return NET_XMIT_DROP;
 }
-EXPORT_SYMBOL(aarp_send_ddp);
 
 /*
  *	An entry in the aarp unresolved queue has become resolved. Send
net/appletalk/ddp.c +13 -11
index 8978fb6212ffb..d4dc6a9fd3b6b 100644
@@ -473,7 +473,7 @@ static struct atalk_route *atrtr_find(struct atalk_addr *target)
  * Given an AppleTalk network, find the device to use. This can be
  * a simple lookup.
  */
-struct net_device *atrtr_get_dev(struct atalk_addr *sa)
+static struct net_device *atrtr_get_dev(struct atalk_addr *sa)
 {
 	struct atalk_route *atr = atrtr_find(sa);
 	return atr ? atr->dev : NULL;
@@ -1947,10 +1947,6 @@ static struct packet_type ppptalk_packet_type __read_mostly = {
 
 static unsigned char ddp_snap_id[] = { 0x08, 0x00, 0x07, 0x80, 0x9B };
 
-/* Export symbols for use by drivers when AppleTalk is a module */
-EXPORT_SYMBOL(atrtr_get_dev);
-EXPORT_SYMBOL(atalk_find_dev_addr);
-
 /* Called by proto.c on kernel start up */
 static int __init atalk_init(void)
 {
@@ -1971,8 +1967,10 @@ static int __init atalk_init(void)
 		goto out_sock;
 	}
 
-	dev_add_pack(&ltalk_packet_type);
-	dev_add_pack(&ppptalk_packet_type);
+	if (IS_ENABLED(CONFIG_DEV_APPLETALK)) {
+		dev_add_pack(&ltalk_packet_type);
+		dev_add_pack(&ppptalk_packet_type);
+	}
 
 	rc = register_netdevice_notifier(&ddp_notifier);
 	if (rc)
@@ -1998,8 +1996,10 @@ static int __init atalk_init(void)
 out_dev:
 	unregister_netdevice_notifier(&ddp_notifier);
 out_snap:
-	dev_remove_pack(&ppptalk_packet_type);
-	dev_remove_pack(&ltalk_packet_type);
+	if (IS_ENABLED(CONFIG_DEV_APPLETALK)) {
+		dev_remove_pack(&ppptalk_packet_type);
+		dev_remove_pack(&ltalk_packet_type);
+	}
 	unregister_snap_client(ddp_dl);
 out_sock:
 	sock_unregister(PF_APPLETALK);
@@ -2026,8 +2026,10 @@ static void __exit atalk_exit(void)
 	atalk_proc_exit();
 	aarp_cleanup_module();	/* General aarp clean-up. */
 	unregister_netdevice_notifier(&ddp_notifier);
-	dev_remove_pack(&ltalk_packet_type);
-	dev_remove_pack(&ppptalk_packet_type);
+	if (IS_ENABLED(CONFIG_DEV_APPLETALK)) {
+		dev_remove_pack(&ltalk_packet_type);
+		dev_remove_pack(&ppptalk_packet_type);
+	}
 	unregister_snap_client(ddp_dl);
 	sock_unregister(PF_APPLETALK);
 	proto_unregister(&ddp_proto);
Signature · 1 line
2.39.2
#21 lore raw
In reply to Rodolfo Zitellini
Quoted 14 lines · Rodolfo Zitellini
Quoted 7 lines

Il giorno 9 ott 2023, alle ore 19:29, Arnd Bergmann <[email protected]> ha scritto:
On Mon, Oct 9, 2023, at 18:49, Rodolfo Zitellini wrote:
I can see a few ways this could work out:

- add a custom callback pointer to struct atalk_iface to get and set the address for phase1 probing instead of going through the ioctl

This was my initial thought, at least for the moment, mostly to keep netatalk happy and make sure I don’t break other stuff that makes assumptions on how the address probing worked. There are other bits I would like to improve, for example tcpdump (which parses correctly appetalk packets!) is broken in the current implementation.

Quoted 8 lines
Quoted 3 lines

- rewrite the probing logic in aarp.c more widely, and improve the userspace interface in the process by introducing a netlink interface

This is sorta the “second step” I was planning, I think the logic for probing could be redesigned and simplified (it also does not work 100% correctly), and it could be a good chance to improve the interface with netatalk too.

Ok, I've adapted my patch now to not actually drop the localtalk code for now, and sent that out, I hope that works for you. Even if we go with the v1 patch that removes it all, you could just as well start with a revert of my patch when you add your driver, so in the end it shouldn't make much of a difference.

Quoted 10 lines
Quoted 3 lines

- Move your entire driver into userspace and go to the kernel using tun/tap. This has the added benefit of avoiding a lot of the complexity of the tty line discipline code you have.

We had some discussion too if to just make the lt an userspace stack, I personally like how it is currently implemented because existing code can run basically without modification.

I would propose at this stage to change the TashTalk driver to remove ndo_do_ioctl and to use a custom callback, if this ok.

It looks like you still need a custom userspace tool to set up the uart for your new driver, so my feeling would be that having a userspace bridge to implement the localtalk/uart to ethertalk/tap driver would actually be nicer for both usability and maintenance.

It's not something we need to decide now though, and is up to you in the end.

Arnd

#22 lore raw
Quoted 28 lines

Il giorno 10 ott 2023, alle ore 10:15, Arnd Bergmann <[email protected]> ha scritto:

Quoted 14 lines · Rodolfo Zitellini
Quoted 7 lines

Il giorno 9 ott 2023, alle ore 19:29, Arnd Bergmann <[email protected]> ha scritto:
On Mon, Oct 9, 2023, at 18:49, Rodolfo Zitellini wrote:
I can see a few ways this could work out:

- add a custom callback pointer to struct atalk_iface to get and set the address for phase1 probing instead of going through the ioctl

This was my initial thought, at least for the moment, mostly to keep netatalk happy and make sure I don’t break other stuff that makes assumptions on how the address probing worked. There are other bits I would like to improve, for example tcpdump (which parses correctly appetalk packets!) is broken in the current implementation.

Quoted 8 lines
Quoted 3 lines

- rewrite the probing logic in aarp.c more widely, and improve the userspace interface in the process by introducing a netlink interface

This is sorta the “second step” I was planning, I think the logic for probing could be redesigned and simplified (it also does not work 100% correctly), and it could be a good chance to improve the interface with netatalk too.

Quoted 6 lines

Ok, I've adapted my patch now to not actually drop the localtalk code for now, and sent that out, I hope that works for you. Even if we go with the v1 patch that removes it all, you could just as well start with a revert of my patch when you add your driver, so in the end it shouldn't make much of a difference.

Thank you very much! I will try to make my patch ready to be submitted soon, and I will add the proper reverts if needed.

Quoted 11 lines
Quoted 10 lines
Quoted 3 lines

- Move your entire driver into userspace and go to the kernel using tun/tap. This has the added benefit of avoiding a lot of the complexity of the tty line discipline code you have.

We had some discussion too if to just make the lt an userspace stack, I personally like how it is currently implemented because existing code can run basically without modification.

I would propose at this stage to change the TashTalk driver to remove ndo_do_ioctl and to use a custom callback, if this ok.

Quoted 7 lines

It looks like you still need a custom userspace tool to set up the uart for your new driver, so my feeling would be that having a userspace bridge to implement the localtalk/uart to ethertalk/tap driver would actually be nicer for both usability and maintenance.

It's not something we need to decide now though, and is up to you in the end.

I will experiment with this too, as it will require a bit of work to morph localtalk packets to ethertalk/aarp ones, and the code in the kernel has some specialized bits for localtalk here and there.

In any case, many thanks!
Rodolfo

#23 lore raw
In reply to Rodolfo Zitellini
Quoted 7 lines · On Mon, 9 Oct 2023 18:49:43 +0200 Rodolfo Zitellini <[email protected]> wrote:

Hi!
I’ve been working on a new LocalTalk interface driver for the last couple months, do you think it would be possible to at least postpone the removal of LT a bit?

It is a driver for an open source device called TashTalk (https://github.com/lampmerchant/tashtalk), which runs on a PIC micro that does all the LT interfacing, and communicates back via serial to the host system. My driver is relatively simple and works very well with netatalk 2.2 (which is still maintained and still has support for AppleTalk). The driver is basically complete and trsted and I was preparing to submit a patch.

Still having LocalTalk in my view has many advantages for us enthusiasts that still want to bridge old machines to the current world without modifications, for example for printing on modern printers, netbooting, sharing files and even tcp/ip. All this basically works out of the box via the driver, Linux and available userspace tools (netatalk, macipgw).

Quoted 8 lines

The old ISA cards supported by COPS were basically unobtanium even 20 years ago, but the solution of using a PIC and a serial port is very robust and much more furure-proof. We also already have a device that can interface a modern machine directly via USB to LocalTalk.

The development of the TashTalk has been also extensively discussed on thr 68KMLA forum (https://68kmla.org/bb/index.php?threads/modtashtalk-lt0-driver-for-linux.45031/)

I hope the decision to remove LocalTalk can be reconsidered at least for the time being so there is a chance to submit a new, modern device making use of this stack.

Many Thanks,
Rodolfo Zitellini

Does it really need it to be a kernel protocol stack? What about doing it in userspace or with BPF?

maintainer
#24 lore raw
In reply to Arnd Bergmann
Quoted 4 lines · On Mon, 9 Oct 2023 16:18:59 +0200 Arnd Bergmann wrote:

The last localtalk driver is gone now, and ppp support was never fully merged, so clean up the appletalk code by removing the obvious dead code paths.

Quoted 8 lines

Notably, this removes one of the two callers of the old .ndo_do_ioctl() callback that was abused for getting device addresses and is now only used in the ieee802154 subsystem, which still uses the same trick.

The include/uapi/linux/if_ltalk.h header might still be required for building userspace programs, but I made sure that debian code search and the netatalk upstream have no references it it, so it should be fine to remove.

Looks like it depends on the ipddp driver removal. Could you repost once that one is merged (~tomorrow)?

Signature · 1 line
pw-bot: cr
#25 lore raw
In reply to Arnd Bergmann
kernel test robot noticed the following build errors:

Hi Arnd,

kernel test robot noticed the following build errors:

[auto build test ERROR on next-20231009]
[cannot apply to linus/master v6.6-rc5 v6.6-rc4 v6.6-rc3 v6.6-rc5] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Arnd-Bergmann/ieee802154-avoid-deprecated-ndo_do_ioctl-callback/20231009-222305
base:   next-20231009
patch link:    https://lore.kernel.org/r/20231009141908.1767241-1-arnd%40kernel.org
patch subject: [PATCH 01/10] appletalk: remove localtalk and ppp support
config: nios2-randconfig-001-20231010 (https://download.01.org/0day-ci/archive/20231010/[email protected]/config)
compiler: nios2-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231010/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All error/warnings (new ones prefixed by >>):

drivers/net/appletalk/ipddp.c: In function 'ipddp_create':

>> drivers/net/appletalk/ipddp.c:207:24: error: implicit declaration of function 'atrtr_get_dev'; did you mean 'to_net_dev'? [-Werror=implicit-function-declaration]
     207 |         if ((rt->dev = atrtr_get_dev(&rt->at)) == NULL) {
         |                        ^~~~~~~~~~~~~
         |                        to_net_dev
>> drivers/net/appletalk/ipddp.c:207:22: warning: assignment to 'struct net_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
     207 |         if ((rt->dev = atrtr_get_dev(&rt->at)) == NULL) {
         |                      ^

cc1: some warnings being treated as errors

vim +207 drivers/net/appletalk/ipddp.c

^1da177e4c3f41 Linus Torvalds   2005-04-16  192  
^1da177e4c3f41 Linus Torvalds   2005-04-16  193  /*
^1da177e4c3f41 Linus Torvalds   2005-04-16  194   * Create a routing entry. We first verify that the
^1da177e4c3f41 Linus Torvalds   2005-04-16  195   * record does not already exist. If it does we return -EEXIST
^1da177e4c3f41 Linus Torvalds   2005-04-16  196   */
^1da177e4c3f41 Linus Torvalds   2005-04-16  197  static int ipddp_create(struct ipddp_route *new_rt)
^1da177e4c3f41 Linus Torvalds   2005-04-16  198  {
ce7e40c432ba84 Vlad Tsyrklevich 2017-01-09  199          struct ipddp_route *rt = kzalloc(sizeof(*rt), GFP_KERNEL);
^1da177e4c3f41 Linus Torvalds   2005-04-16  200  
^1da177e4c3f41 Linus Torvalds   2005-04-16  201          if (rt == NULL)
^1da177e4c3f41 Linus Torvalds   2005-04-16  202                  return -ENOMEM;
^1da177e4c3f41 Linus Torvalds   2005-04-16  203  
^1da177e4c3f41 Linus Torvalds   2005-04-16  204          rt->ip = new_rt->ip;
^1da177e4c3f41 Linus Torvalds   2005-04-16  205          rt->at = new_rt->at;
^1da177e4c3f41 Linus Torvalds   2005-04-16  206          rt->next = NULL;
^1da177e4c3f41 Linus Torvalds   2005-04-16 @207          if ((rt->dev = atrtr_get_dev(&rt->at)) == NULL) {
^1da177e4c3f41 Linus Torvalds   2005-04-16  208  		kfree(rt);
^1da177e4c3f41 Linus Torvalds   2005-04-16  209                  return -ENETUNREACH;
^1da177e4c3f41 Linus Torvalds   2005-04-16  210          }
^1da177e4c3f41 Linus Torvalds   2005-04-16  211  
5615968a708451 David S. Miller  2009-05-27  212  	spin_lock_bh(&ipddp_route_lock);
5615968a708451 David S. Miller  2009-05-27  213  	if (__ipddp_find_route(rt)) {
5615968a708451 David S. Miller  2009-05-27  214  		spin_unlock_bh(&ipddp_route_lock);
^1da177e4c3f41 Linus Torvalds   2005-04-16  215  		kfree(rt);
^1da177e4c3f41 Linus Torvalds   2005-04-16  216  		return -EEXIST;
^1da177e4c3f41 Linus Torvalds   2005-04-16  217  	}
^1da177e4c3f41 Linus Torvalds   2005-04-16  218  
^1da177e4c3f41 Linus Torvalds   2005-04-16  219          rt->next = ipddp_route_list;
^1da177e4c3f41 Linus Torvalds   2005-04-16  220          ipddp_route_list = rt;
^1da177e4c3f41 Linus Torvalds   2005-04-16  221  
5615968a708451 David S. Miller  2009-05-27  222  	spin_unlock_bh(&ipddp_route_lock);
5615968a708451 David S. Miller  2009-05-27  223  
^1da177e4c3f41 Linus Torvalds   2005-04-16  224          return 0;
^1da177e4c3f41 Linus Torvalds   2005-04-16  225  }
^1da177e4c3f41 Linus Torvalds   2005-04-16  226  
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#26 lore raw
In reply to Arnd Bergmann
kernel test robot noticed the following build warnings:

Hi Arnd,

kernel test robot noticed the following build warnings:

[auto build test WARNING on next-20231009]
[cannot apply to linus/master v6.6-rc5 v6.6-rc4 v6.6-rc3 v6.6-rc5] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Arnd-Bergmann/ieee802154-avoid-deprecated-ndo_do_ioctl-callback/20231009-222305
base:   next-20231009
patch link:    https://lore.kernel.org/r/20231009141908.1767241-1-arnd%40kernel.org
patch subject: [PATCH 01/10] appletalk: remove localtalk and ppp support
config: x86_64-randconfig-002-20231011 (https://download.01.org/0day-ci/archive/20231011/[email protected]/config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231011/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

drivers/net/appletalk/ipddp.c: In function 'ipddp_create':
drivers/net/appletalk/ipddp.c:207:24: error: implicit declaration of function 'atrtr_get_dev'; did you mean 'to_net_dev'? [-Werror=implicit-function-declaration]

            if ((rt->dev = atrtr_get_dev(&rt->at)) == NULL) {
                           ^~~~~~~~~~~~~
                           to_net_dev
>> drivers/net/appletalk/ipddp.c:207:22: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
            if ((rt->dev = atrtr_get_dev(&rt->at)) == NULL) {
                         ^

cc1: some warnings being treated as errors

vim +207 drivers/net/appletalk/ipddp.c

^1da177e4c3f41 Linus Torvalds   2005-04-16  192  
^1da177e4c3f41 Linus Torvalds   2005-04-16  193  /*
^1da177e4c3f41 Linus Torvalds   2005-04-16  194   * Create a routing entry. We first verify that the
^1da177e4c3f41 Linus Torvalds   2005-04-16  195   * record does not already exist. If it does we return -EEXIST
^1da177e4c3f41 Linus Torvalds   2005-04-16  196   */
^1da177e4c3f41 Linus Torvalds   2005-04-16  197  static int ipddp_create(struct ipddp_route *new_rt)
^1da177e4c3f41 Linus Torvalds   2005-04-16  198  {
ce7e40c432ba84 Vlad Tsyrklevich 2017-01-09  199          struct ipddp_route *rt = kzalloc(sizeof(*rt), GFP_KERNEL);
^1da177e4c3f41 Linus Torvalds   2005-04-16  200  
^1da177e4c3f41 Linus Torvalds   2005-04-16  201          if (rt == NULL)
^1da177e4c3f41 Linus Torvalds   2005-04-16  202                  return -ENOMEM;
^1da177e4c3f41 Linus Torvalds   2005-04-16  203  
^1da177e4c3f41 Linus Torvalds   2005-04-16  204          rt->ip = new_rt->ip;
^1da177e4c3f41 Linus Torvalds   2005-04-16  205          rt->at = new_rt->at;
^1da177e4c3f41 Linus Torvalds   2005-04-16  206          rt->next = NULL;
^1da177e4c3f41 Linus Torvalds   2005-04-16 @207          if ((rt->dev = atrtr_get_dev(&rt->at)) == NULL) {
^1da177e4c3f41 Linus Torvalds   2005-04-16  208  		kfree(rt);
^1da177e4c3f41 Linus Torvalds   2005-04-16  209                  return -ENETUNREACH;
^1da177e4c3f41 Linus Torvalds   2005-04-16  210          }
^1da177e4c3f41 Linus Torvalds   2005-04-16  211  
5615968a708451 David S. Miller  2009-05-27  212  	spin_lock_bh(&ipddp_route_lock);
5615968a708451 David S. Miller  2009-05-27  213  	if (__ipddp_find_route(rt)) {
5615968a708451 David S. Miller  2009-05-27  214  		spin_unlock_bh(&ipddp_route_lock);
^1da177e4c3f41 Linus Torvalds   2005-04-16  215  		kfree(rt);
^1da177e4c3f41 Linus Torvalds   2005-04-16  216  		return -EEXIST;
^1da177e4c3f41 Linus Torvalds   2005-04-16  217  	}
^1da177e4c3f41 Linus Torvalds   2005-04-16  218  
^1da177e4c3f41 Linus Torvalds   2005-04-16  219          rt->next = ipddp_route_list;
^1da177e4c3f41 Linus Torvalds   2005-04-16  220          ipddp_route_list = rt;
^1da177e4c3f41 Linus Torvalds   2005-04-16  221  
5615968a708451 David S. Miller  2009-05-27  222  	spin_unlock_bh(&ipddp_route_lock);
5615968a708451 David S. Miller  2009-05-27  223  
^1da177e4c3f41 Linus Torvalds   2005-04-16  224          return 0;
^1da177e4c3f41 Linus Torvalds   2005-04-16  225  }
^1da177e4c3f41 Linus Torvalds   2005-04-16  226  
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki