hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/arch/um/drivers/net_kern.c
....@@ -1,12 +1,12 @@
1
+// SPDX-License-Identifier: GPL-2.0
12 /*
23 * Copyright (C) 2001 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
34 * Copyright (C) 2001 Lennert Buytenhek (buytenh@gnu.org) and
45 * James Leu (jleu@mindspring.net).
56 * Copyright (C) 2001 by various other people who didn't put their name here.
6
- * Licensed under the GPL.
77 */
88
9
-#include <linux/bootmem.h>
9
+#include <linux/memblock.h>
1010 #include <linux/etherdevice.h>
1111 #include <linux/ethtool.h>
1212 #include <linux/inetdevice.h>
....@@ -137,8 +137,6 @@
137137 schedule_work(&lp->work);
138138 goto out;
139139 }
140
- reactivate_fd(lp->fd, UM_ETH_IRQ);
141
-
142140 out:
143141 spin_unlock(&lp->lock);
144142 return IRQ_HANDLED;
....@@ -249,7 +247,7 @@
249247 return;
250248 }
251249
252
-static void uml_net_tx_timeout(struct net_device *dev)
250
+static void uml_net_tx_timeout(struct net_device *dev, unsigned int txqueue)
253251 {
254252 netif_trans_update(dev);
255253 netif_wake_queue(dev);
....@@ -268,7 +266,6 @@
268266 struct ethtool_drvinfo *info)
269267 {
270268 strlcpy(info->driver, DRIVER_NAME, sizeof(info->driver));
271
- strlcpy(info->version, "42", sizeof(info->version));
272269 }
273270
274271 static const struct ethtool_ops uml_net_ethtool_ops = {
....@@ -276,17 +273,6 @@
276273 .get_link = ethtool_op_get_link,
277274 .get_ts_info = ethtool_op_get_ts_info,
278275 };
279
-
280
-static void uml_net_user_timer_expire(struct timer_list *t)
281
-{
282
-#ifdef undef
283
- struct uml_net_private *lp = from_timer(lp, t, tl);
284
- struct connection *conn = &lp->user;
285
-
286
- dprintk(KERN_INFO "uml_net_user_timer_expire [%p]\n", conn);
287
- do_connect(conn);
288
-#endif
289
-}
290276
291277 void uml_net_setup_etheraddr(struct net_device *dev, char *str)
292278 {
....@@ -458,7 +444,6 @@
458444 .add_address = transport->user->add_address,
459445 .delete_address = transport->user->delete_address });
460446
461
- timer_setup(&lp->tl, uml_net_user_timer_expire, 0);
462447 spin_lock_init(&lp->lock);
463448 memcpy(lp->mac, dev->dev_addr, sizeof(lp->mac));
464449
....@@ -650,7 +635,10 @@
650635 return 1;
651636 }
652637
653
- new = alloc_bootmem(sizeof(*new));
638
+ new = memblock_alloc(sizeof(*new), SMP_CACHE_BYTES);
639
+ if (!new)
640
+ panic("%s: Failed to allocate %zu bytes\n", __func__,
641
+ sizeof(*new));
654642
655643 INIT_LIST_HEAD(&new->list);
656644 new->index = n;