Loading arch/um/drivers/net_kern.c +8 −14 Original line number Diff line number Diff line Loading @@ -293,8 +293,9 @@ static void uml_net_user_timer_expire(unsigned long _conn) #endif } static int setup_etheraddr(char *str, unsigned char *addr, char *name) static void setup_etheraddr(struct net_device *dev, char *str) { unsigned char *addr = dev->dev_addr; char *end; int i; Loading Loading @@ -334,13 +335,12 @@ static int setup_etheraddr(char *str, unsigned char *addr, char *name) addr[0] | 0x02, addr[1], addr[2], addr[3], addr[4], addr[5]); } return 0; return; random: printk(KERN_INFO "Choosing a random ethernet address for device %s\n", name); eth_random_addr(addr); return 1; "Choosing a random ethernet address for device %s\n", dev->name); eth_hw_addr_random(dev); } static DEFINE_SPINLOCK(devices_lock); Loading Loading @@ -392,7 +392,6 @@ static void eth_configure(int n, void *init, char *mac, struct net_device *dev; struct uml_net_private *lp; int err, size; int random_mac; size = transport->private_size + sizeof(struct uml_net_private); Loading @@ -419,9 +418,9 @@ static void eth_configure(int n, void *init, char *mac, */ snprintf(dev->name, sizeof(dev->name), "eth%d", n); random_mac = setup_etheraddr(mac, device->mac, dev->name); setup_etheraddr(dev, mac); printk(KERN_INFO "Netdevice %d (%pM) : ", n, device->mac); printk(KERN_INFO "Netdevice %d (%pM) : ", n, dev->dev_addr); lp = netdev_priv(dev); /* This points to the transport private data. It's still clear, but we Loading Loading @@ -468,17 +467,12 @@ static void eth_configure(int n, void *init, char *mac, init_timer(&lp->tl); spin_lock_init(&lp->lock); lp->tl.function = uml_net_user_timer_expire; memcpy(lp->mac, device->mac, sizeof(lp->mac)); memcpy(lp->mac, dev->dev_addr, sizeof(lp->mac)); if ((transport->user->init != NULL) && ((*transport->user->init)(&lp->user, dev) != 0)) goto out_unregister; /* don't use eth_mac_addr, it will not work here */ memcpy(dev->dev_addr, device->mac, ETH_ALEN); if (random_mac) dev->addr_assign_type |= NET_ADDR_RANDOM; dev->mtu = transport->user->mtu; dev->netdev_ops = ¨_netdev_ops; dev->ethtool_ops = ¨_net_ethtool_ops; Loading arch/um/include/shared/net_kern.h +0 −1 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ struct uml_net { struct net_device *dev; struct platform_device pdev; int index; unsigned char mac[ETH_ALEN]; }; struct uml_net_private { Loading Loading
arch/um/drivers/net_kern.c +8 −14 Original line number Diff line number Diff line Loading @@ -293,8 +293,9 @@ static void uml_net_user_timer_expire(unsigned long _conn) #endif } static int setup_etheraddr(char *str, unsigned char *addr, char *name) static void setup_etheraddr(struct net_device *dev, char *str) { unsigned char *addr = dev->dev_addr; char *end; int i; Loading Loading @@ -334,13 +335,12 @@ static int setup_etheraddr(char *str, unsigned char *addr, char *name) addr[0] | 0x02, addr[1], addr[2], addr[3], addr[4], addr[5]); } return 0; return; random: printk(KERN_INFO "Choosing a random ethernet address for device %s\n", name); eth_random_addr(addr); return 1; "Choosing a random ethernet address for device %s\n", dev->name); eth_hw_addr_random(dev); } static DEFINE_SPINLOCK(devices_lock); Loading Loading @@ -392,7 +392,6 @@ static void eth_configure(int n, void *init, char *mac, struct net_device *dev; struct uml_net_private *lp; int err, size; int random_mac; size = transport->private_size + sizeof(struct uml_net_private); Loading @@ -419,9 +418,9 @@ static void eth_configure(int n, void *init, char *mac, */ snprintf(dev->name, sizeof(dev->name), "eth%d", n); random_mac = setup_etheraddr(mac, device->mac, dev->name); setup_etheraddr(dev, mac); printk(KERN_INFO "Netdevice %d (%pM) : ", n, device->mac); printk(KERN_INFO "Netdevice %d (%pM) : ", n, dev->dev_addr); lp = netdev_priv(dev); /* This points to the transport private data. It's still clear, but we Loading Loading @@ -468,17 +467,12 @@ static void eth_configure(int n, void *init, char *mac, init_timer(&lp->tl); spin_lock_init(&lp->lock); lp->tl.function = uml_net_user_timer_expire; memcpy(lp->mac, device->mac, sizeof(lp->mac)); memcpy(lp->mac, dev->dev_addr, sizeof(lp->mac)); if ((transport->user->init != NULL) && ((*transport->user->init)(&lp->user, dev) != 0)) goto out_unregister; /* don't use eth_mac_addr, it will not work here */ memcpy(dev->dev_addr, device->mac, ETH_ALEN); if (random_mac) dev->addr_assign_type |= NET_ADDR_RANDOM; dev->mtu = transport->user->mtu; dev->netdev_ops = ¨_netdev_ops; dev->ethtool_ops = ¨_net_ethtool_ops; Loading
arch/um/include/shared/net_kern.h +0 −1 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ struct uml_net { struct net_device *dev; struct platform_device pdev; int index; unsigned char mac[ETH_ALEN]; }; struct uml_net_private { Loading