Revert "usb: gadget: prevent change of Host MAC address of 'usb0' interface"
This reverts commit 265801537d
.
Signed-off-by: Badhri Jagan Sridharan <Badhri@google.com>
This commit is contained in:
parent
ef51a2254d
commit
e639a4e74d
1 changed files with 3 additions and 18 deletions
|
@ -863,8 +863,6 @@ static int eth_stop(struct net_device *net)
|
|||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
static u8 host_ethaddr[ETH_ALEN];
|
||||
|
||||
static int get_ether_addr(const char *str, u8 *dev_addr)
|
||||
{
|
||||
if (str) {
|
||||
|
@ -895,17 +893,6 @@ static int get_ether_addr_str(u8 dev_addr[ETH_ALEN], char *str, int len)
|
|||
return 18;
|
||||
}
|
||||
|
||||
static int get_host_ether_addr(u8 *str, u8 *dev_addr)
|
||||
{
|
||||
memcpy(dev_addr, str, ETH_ALEN);
|
||||
if (is_valid_ether_addr(dev_addr))
|
||||
return 0;
|
||||
|
||||
random_ether_addr(dev_addr);
|
||||
memcpy(str, dev_addr, ETH_ALEN);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static const struct net_device_ops eth_netdev_ops = {
|
||||
.ndo_open = eth_open,
|
||||
.ndo_stop = eth_stop,
|
||||
|
@ -963,11 +950,9 @@ struct eth_dev *gether_setup_name(struct usb_gadget *g,
|
|||
if (get_ether_addr(dev_addr, net->dev_addr))
|
||||
dev_warn(&g->dev,
|
||||
"using random %s ethernet address\n", "self");
|
||||
|
||||
if (get_host_ether_addr(host_ethaddr, dev->host_mac))
|
||||
dev_warn(&g->dev, "using random %s ethernet address\n", "host");
|
||||
else
|
||||
dev_warn(&g->dev, "using previous %s ethernet address\n", "host");
|
||||
if (get_ether_addr(host_addr, dev->host_mac))
|
||||
dev_warn(&g->dev,
|
||||
"using random %s ethernet address\n", "host");
|
||||
|
||||
if (ethaddr)
|
||||
memcpy(ethaddr, dev->host_mac, ETH_ALEN);
|
||||
|
|
Loading…
Add table
Reference in a new issue