aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/f_phonet.c12
-rw-r--r--drivers/usb/gadget/u_ether.c16
2 files changed, 18 insertions, 10 deletions
diff --git a/drivers/usb/gadget/f_phonet.c b/drivers/usb/gadget/f_phonet.c
index d8fc9b32fe36..c0916c7b217e 100644
--- a/drivers/usb/gadget/f_phonet.c
+++ b/drivers/usb/gadget/f_phonet.c
@@ -279,6 +279,13 @@ static int pn_net_mtu(struct net_device *dev, int new_mtu)
279 return err; 279 return err;
280} 280}
281 281
282static const struct net_device_ops pn_netdev_ops = {
283 .ndo_open = pn_net_open,
284 .ndo_stop = pn_net_close,
285 .ndo_start_xmit = pn_net_xmit,
286 .ndo_change_mtu = pn_net_mtu,
287};
288
282static void pn_net_setup(struct net_device *dev) 289static void pn_net_setup(struct net_device *dev)
283{ 290{
284 dev->features = 0; 291 dev->features = 0;
@@ -290,12 +297,9 @@ static void pn_net_setup(struct net_device *dev)
290 dev->addr_len = 1; 297 dev->addr_len = 1;
291 dev->tx_queue_len = 1; 298 dev->tx_queue_len = 1;
292 299
300 dev->netdev_ops = &pn_netdev_ops;
293 dev->destructor = free_netdev; 301 dev->destructor = free_netdev;
294 dev->header_ops = &phonet_header_ops; 302 dev->header_ops = &phonet_header_ops;
295 dev->open = pn_net_open;
296 dev->stop = pn_net_close;
297 dev->hard_start_xmit = pn_net_xmit; /* mandatory */
298 dev->change_mtu = pn_net_mtu;
299} 303}
300 304
301/*-------------------------------------------------------------------------*/ 305/*-------------------------------------------------------------------------*/
diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c
index d9739d52f8f5..96d65ca06ecd 100644
--- a/drivers/usb/gadget/u_ether.c
+++ b/drivers/usb/gadget/u_ether.c
@@ -716,6 +716,14 @@ static int __init get_ether_addr(const char *str, u8 *dev_addr)
716 716
717static struct eth_dev *the_dev; 717static struct eth_dev *the_dev;
718 718
719static const struct net_device_ops eth_netdev_ops = {
720 .ndo_open = eth_open,
721 .ndo_stop = eth_stop,
722 .ndo_start_xmit = eth_start_xmit,
723 .ndo_change_mtu = ueth_change_mtu,
724 .ndo_set_mac_address = eth_mac_addr,
725 .ndo_validate_addr = eth_validate_addr,
726};
719 727
720/** 728/**
721 * gether_setup - initialize one ethernet-over-usb link 729 * 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 if (ethaddr) 772 if (ethaddr)
765 memcpy(ethaddr, dev->host_mac, ETH_ALEN); 773 memcpy(ethaddr, dev->host_mac, ETH_ALEN);
766 774
767 net->change_mtu = ueth_change_mtu; 775 net->netdev_ops = &eth_netdev_ops;
768 net->hard_start_xmit = eth_start_xmit; 776
769 net->open = eth_open;
770 net->stop = eth_stop;
771 /* watchdog_timeo, tx_timeout ... */
772 /* set_multicast_list */
773 SET_ETHTOOL_OPS(net, &ops); 777 SET_ETHTOOL_OPS(net, &ops);
774 778
775 /* two kinds of host-initiated state changes: 779 /* two kinds of host-initiated state changes: