提交 5ec38f30 编写于 作者: S Stephen Hemminger 提交者: David S. Miller

gadget: convert devices to new API

Convert to net_device_ops
Signed-off-by: NStephen Hemminger <shemminger@vyatta.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 e8ac9c55
...@@ -716,6 +716,14 @@ static int __init get_ether_addr(const char *str, u8 *dev_addr) ...@@ -716,6 +716,14 @@ static int __init get_ether_addr(const char *str, u8 *dev_addr)
static struct eth_dev *the_dev; static struct eth_dev *the_dev;
static const struct net_device_ops eth_netdev_ops = {
.ndo_open = eth_open,
.ndo_stop = eth_stop,
.ndo_start_xmit = eth_start_xmit,
.ndo_change_mtu = ueth_change_mtu,
.ndo_set_mac_address = eth_mac_addr,
.ndo_validate_addr = eth_validate_addr,
};
/** /**
* gether_setup - initialize one ethernet-over-usb link * gether_setup - initialize one ethernet-over-usb link
...@@ -764,12 +772,8 @@ int __init gether_setup(struct usb_gadget *g, u8 ethaddr[ETH_ALEN]) ...@@ -764,12 +772,8 @@ int __init gether_setup(struct usb_gadget *g, u8 ethaddr[ETH_ALEN])
if (ethaddr) if (ethaddr)
memcpy(ethaddr, dev->host_mac, ETH_ALEN); memcpy(ethaddr, dev->host_mac, ETH_ALEN);
net->change_mtu = ueth_change_mtu; net->netdev_ops = &eth_netdev_ops;
net->hard_start_xmit = eth_start_xmit;
net->open = eth_open;
net->stop = eth_stop;
/* watchdog_timeo, tx_timeout ... */
/* set_multicast_list */
SET_ETHTOOL_OPS(net, &ops); SET_ETHTOOL_OPS(net, &ops);
/* two kinds of host-initiated state changes: /* two kinds of host-initiated state changes:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册