forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/drivers/net/slip/slip.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * slip.c This module implements the SLIP protocol for kernel-based
34 * devices like TTY. It interfaces between a raw TTY, and the
....@@ -79,7 +80,6 @@
7980 #include <linux/rtnetlink.h>
8081 #include <linux/if_arp.h>
8182 #include <linux/if_slip.h>
82
-#include <linux/compat.h>
8383 #include <linux/delay.h>
8484 #include <linux/init.h>
8585 #include <linux/slab.h>
....@@ -456,22 +456,19 @@
456456
457457 rcu_read_lock();
458458 sl = rcu_dereference(tty->disc_data);
459
- if (!sl)
460
- goto out;
461
-
462
- schedule_work(&sl->tx_work);
463
-out:
459
+ if (sl)
460
+ schedule_work(&sl->tx_work);
464461 rcu_read_unlock();
465462 }
466463
467
-static void sl_tx_timeout(struct net_device *dev)
464
+static void sl_tx_timeout(struct net_device *dev, unsigned int txqueue)
468465 {
469466 struct slip *sl = netdev_priv(dev);
470467
471468 spin_lock(&sl->lock);
472469
473470 if (netif_queue_stopped(dev)) {
474
- if (!netif_running(dev))
471
+ if (!netif_running(dev) || !sl->tty)
475472 goto out;
476473
477474 /* May be we must check transmitter timeout here ?
....@@ -1180,27 +1177,6 @@
11801177 }
11811178 }
11821179
1183
-#ifdef CONFIG_COMPAT
1184
-static long slip_compat_ioctl(struct tty_struct *tty, struct file *file,
1185
- unsigned int cmd, unsigned long arg)
1186
-{
1187
- switch (cmd) {
1188
- case SIOCGIFNAME:
1189
- case SIOCGIFENCAP:
1190
- case SIOCSIFENCAP:
1191
- case SIOCSIFHWADDR:
1192
- case SIOCSKEEPALIVE:
1193
- case SIOCGKEEPALIVE:
1194
- case SIOCSOUTFILL:
1195
- case SIOCGOUTFILL:
1196
- return slip_ioctl(tty, file, cmd,
1197
- (unsigned long)compat_ptr(arg));
1198
- }
1199
-
1200
- return -ENOIOCTLCMD;
1201
-}
1202
-#endif
1203
-
12041180 /* VSV changes start here */
12051181 #ifdef CONFIG_SLIP_SMART
12061182 /* function do_ioctl called from net/core/dev.c
....@@ -1293,9 +1269,6 @@
12931269 .close = slip_close,
12941270 .hangup = slip_hangup,
12951271 .ioctl = slip_ioctl,
1296
-#ifdef CONFIG_COMPAT
1297
- .compat_ioctl = slip_compat_ioctl,
1298
-#endif
12991272 .receive_buf = slip_receive_buf,
13001273 .write_wakeup = slip_write_wakeup,
13011274 };