| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0 |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) 2001 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) |
|---|
| 3 | 4 | * Copyright (C) 2001 Lennert Buytenhek (buytenh@gnu.org) and |
|---|
| 4 | 5 | * James Leu (jleu@mindspring.net). |
|---|
| 5 | 6 | * Copyright (C) 2001 by various other people who didn't put their name here. |
|---|
| 6 | | - * Licensed under the GPL. |
|---|
| 7 | 7 | */ |
|---|
| 8 | 8 | |
|---|
| 9 | | -#include <linux/bootmem.h> |
|---|
| 9 | +#include <linux/memblock.h> |
|---|
| 10 | 10 | #include <linux/etherdevice.h> |
|---|
| 11 | 11 | #include <linux/ethtool.h> |
|---|
| 12 | 12 | #include <linux/inetdevice.h> |
|---|
| .. | .. |
|---|
| 137 | 137 | schedule_work(&lp->work); |
|---|
| 138 | 138 | goto out; |
|---|
| 139 | 139 | } |
|---|
| 140 | | - reactivate_fd(lp->fd, UM_ETH_IRQ); |
|---|
| 141 | | - |
|---|
| 142 | 140 | out: |
|---|
| 143 | 141 | spin_unlock(&lp->lock); |
|---|
| 144 | 142 | return IRQ_HANDLED; |
|---|
| .. | .. |
|---|
| 249 | 247 | return; |
|---|
| 250 | 248 | } |
|---|
| 251 | 249 | |
|---|
| 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) |
|---|
| 253 | 251 | { |
|---|
| 254 | 252 | netif_trans_update(dev); |
|---|
| 255 | 253 | netif_wake_queue(dev); |
|---|
| .. | .. |
|---|
| 268 | 266 | struct ethtool_drvinfo *info) |
|---|
| 269 | 267 | { |
|---|
| 270 | 268 | strlcpy(info->driver, DRIVER_NAME, sizeof(info->driver)); |
|---|
| 271 | | - strlcpy(info->version, "42", sizeof(info->version)); |
|---|
| 272 | 269 | } |
|---|
| 273 | 270 | |
|---|
| 274 | 271 | static const struct ethtool_ops uml_net_ethtool_ops = { |
|---|
| .. | .. |
|---|
| 276 | 273 | .get_link = ethtool_op_get_link, |
|---|
| 277 | 274 | .get_ts_info = ethtool_op_get_ts_info, |
|---|
| 278 | 275 | }; |
|---|
| 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 | | -} |
|---|
| 290 | 276 | |
|---|
| 291 | 277 | void uml_net_setup_etheraddr(struct net_device *dev, char *str) |
|---|
| 292 | 278 | { |
|---|
| .. | .. |
|---|
| 458 | 444 | .add_address = transport->user->add_address, |
|---|
| 459 | 445 | .delete_address = transport->user->delete_address }); |
|---|
| 460 | 446 | |
|---|
| 461 | | - timer_setup(&lp->tl, uml_net_user_timer_expire, 0); |
|---|
| 462 | 447 | spin_lock_init(&lp->lock); |
|---|
| 463 | 448 | memcpy(lp->mac, dev->dev_addr, sizeof(lp->mac)); |
|---|
| 464 | 449 | |
|---|
| .. | .. |
|---|
| 650 | 635 | return 1; |
|---|
| 651 | 636 | } |
|---|
| 652 | 637 | |
|---|
| 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)); |
|---|
| 654 | 642 | |
|---|
| 655 | 643 | INIT_LIST_HEAD(&new->list); |
|---|
| 656 | 644 | new->index = n; |
|---|