3 * Ethernet-type device handling.
5 * Authors: Ben Greear <greearb@candelatech.com>
6 * Please send support related email to: netdev@vger.kernel.org
7 * VLAN Home Page: http://www.candelatech.com/~greear/vlan.html
9 * Fixes: Mar 22 2001: Martin Bokaemper <mbokaemper@unispherenetworks.com>
10 * - reset skb->pkt_type on incoming packets when MAC was changed
11 * - see that changed MAC is saddr for outgoing packets
12 * Oct 20, 2001: Ard van Breeman:
13 * - Fix MC-list, finally.
14 * - Flush MC-list on VLAN destroy.
17 * This program is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU General Public License
19 * as published by the Free Software Foundation; either version
20 * 2 of the License, or (at your option) any later version.
23 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
25 #include <linux/module.h>
26 #include <linux/slab.h>
27 #include <linux/skbuff.h>
28 #include <linux/netdevice.h>
29 #include <linux/etherdevice.h>
30 #include <linux/ethtool.h>
35 #include <linux/if_vlan.h>
38 * Rebuild the Ethernet MAC header. This is called after an ARP
39 * (or in future other address resolution) has completed on this
40 * sk_buff. We now let ARP fill in the other fields.
42 * This routine CANNOT use cached dst->neigh!
43 * Really, it is used only when dst->neigh is wrong.
45 * TODO: This needs a checkup, I'm ignorant here. --BLG
47 static int vlan_dev_rebuild_header(struct sk_buff *skb)
49 struct net_device *dev = skb->dev;
50 struct vlan_ethhdr *veth = (struct vlan_ethhdr *)(skb->data);
52 switch (veth->h_vlan_encapsulated_proto) {
56 /* TODO: Confirm this will work with VLAN headers... */
57 return arp_find(veth->h_dest, skb);
60 pr_debug("%s: unable to resolve type %X addresses\n",
61 dev->name, ntohs(veth->h_vlan_encapsulated_proto));
63 memcpy(veth->h_source, dev->dev_addr, ETH_ALEN);
71 vlan_dev_get_egress_qos_mask(struct net_device *dev, struct sk_buff *skb)
73 struct vlan_priority_tci_mapping *mp;
75 smp_rmb(); /* coupled with smp_wmb() in vlan_dev_set_egress_priority() */
77 mp = vlan_dev_info(dev)->egress_priority_map[(skb->priority & 0xF)];
79 if (mp->priority == skb->priority) {
80 return mp->vlan_qos; /* This should already be shifted
81 * to mask correctly with the
90 * Create the VLAN header for an arbitrary protocol layer
92 * saddr=NULL means use device source address
93 * daddr=NULL means leave destination address (eg unresolved arp)
95 * This is called when the SKB is moving down the stack towards the
98 static int vlan_dev_hard_header(struct sk_buff *skb, struct net_device *dev,
100 const void *daddr, const void *saddr,
103 struct vlan_hdr *vhdr;
104 unsigned int vhdrlen = 0;
108 if (!(vlan_dev_info(dev)->flags & VLAN_FLAG_REORDER_HDR)) {
109 vhdr = (struct vlan_hdr *) skb_push(skb, VLAN_HLEN);
111 vlan_tci = vlan_dev_info(dev)->vlan_id;
112 vlan_tci |= vlan_dev_get_egress_qos_mask(dev, skb);
113 vhdr->h_vlan_TCI = htons(vlan_tci);
116 * Set the protocol type. For a packet of type ETH_P_802_3/2 we
117 * put the length in here instead.
119 if (type != ETH_P_802_3 && type != ETH_P_802_2)
120 vhdr->h_vlan_encapsulated_proto = htons(type);
122 vhdr->h_vlan_encapsulated_proto = htons(len);
124 skb->protocol = htons(ETH_P_8021Q);
129 /* Before delegating work to the lower layer, enter our MAC-address */
131 saddr = dev->dev_addr;
133 /* Now make the underlying real hard header */
134 dev = vlan_dev_info(dev)->real_dev;
135 rc = dev_hard_header(skb, dev, type, daddr, saddr, len + vhdrlen);
141 static netdev_tx_t vlan_dev_hard_start_xmit(struct sk_buff *skb,
142 struct net_device *dev)
144 struct vlan_ethhdr *veth = (struct vlan_ethhdr *)(skb->data);
148 /* Handle non-VLAN frames if they are sent to us, for example by DHCP.
150 * NOTE: THIS ASSUMES DIX ETHERNET, SPECIFICALLY NOT SUPPORTING
151 * OTHER THINGS LIKE FDDI/TokenRing/802.3 SNAPs...
153 if (veth->h_vlan_proto != htons(ETH_P_8021Q) ||
154 vlan_dev_info(dev)->flags & VLAN_FLAG_REORDER_HDR) {
156 vlan_tci = vlan_dev_info(dev)->vlan_id;
157 vlan_tci |= vlan_dev_get_egress_qos_mask(dev, skb);
158 skb = __vlan_hwaccel_put_tag(skb, vlan_tci);
161 skb->dev = vlan_dev_info(dev)->real_dev;
163 ret = dev_queue_xmit(skb);
165 if (likely(ret == NET_XMIT_SUCCESS || ret == NET_XMIT_CN)) {
166 struct vlan_pcpu_stats *stats;
168 stats = this_cpu_ptr(vlan_dev_info(dev)->vlan_pcpu_stats);
169 u64_stats_update_begin(&stats->syncp);
171 stats->tx_bytes += len;
172 u64_stats_update_end(&stats->syncp);
174 this_cpu_inc(vlan_dev_info(dev)->vlan_pcpu_stats->tx_dropped);
180 static int vlan_dev_change_mtu(struct net_device *dev, int new_mtu)
182 /* TODO: gotta make sure the underlying layer can handle it,
183 * maybe an IFF_VLAN_CAPABLE flag for devices?
185 if (vlan_dev_info(dev)->real_dev->mtu < new_mtu)
193 void vlan_dev_set_ingress_priority(const struct net_device *dev,
194 u32 skb_prio, u16 vlan_prio)
196 struct vlan_dev_info *vlan = vlan_dev_info(dev);
198 if (vlan->ingress_priority_map[vlan_prio & 0x7] && !skb_prio)
199 vlan->nr_ingress_mappings--;
200 else if (!vlan->ingress_priority_map[vlan_prio & 0x7] && skb_prio)
201 vlan->nr_ingress_mappings++;
203 vlan->ingress_priority_map[vlan_prio & 0x7] = skb_prio;
206 int vlan_dev_set_egress_priority(const struct net_device *dev,
207 u32 skb_prio, u16 vlan_prio)
209 struct vlan_dev_info *vlan = vlan_dev_info(dev);
210 struct vlan_priority_tci_mapping *mp = NULL;
211 struct vlan_priority_tci_mapping *np;
212 u32 vlan_qos = (vlan_prio << VLAN_PRIO_SHIFT) & VLAN_PRIO_MASK;
214 /* See if a priority mapping exists.. */
215 mp = vlan->egress_priority_map[skb_prio & 0xF];
217 if (mp->priority == skb_prio) {
218 if (mp->vlan_qos && !vlan_qos)
219 vlan->nr_egress_mappings--;
220 else if (!mp->vlan_qos && vlan_qos)
221 vlan->nr_egress_mappings++;
222 mp->vlan_qos = vlan_qos;
228 /* Create a new mapping then. */
229 mp = vlan->egress_priority_map[skb_prio & 0xF];
230 np = kmalloc(sizeof(struct vlan_priority_tci_mapping), GFP_KERNEL);
235 np->priority = skb_prio;
236 np->vlan_qos = vlan_qos;
237 /* Before inserting this element in hash table, make sure all its fields
238 * are committed to memory.
239 * coupled with smp_rmb() in vlan_dev_get_egress_qos_mask()
242 vlan->egress_priority_map[skb_prio & 0xF] = np;
244 vlan->nr_egress_mappings++;
248 /* Flags are defined in the vlan_flags enum in include/linux/if_vlan.h file. */
249 int vlan_dev_change_flags(const struct net_device *dev, u32 flags, u32 mask)
251 struct vlan_dev_info *vlan = vlan_dev_info(dev);
252 u32 old_flags = vlan->flags;
254 if (mask & ~(VLAN_FLAG_REORDER_HDR | VLAN_FLAG_GVRP |
255 VLAN_FLAG_LOOSE_BINDING))
258 vlan->flags = (old_flags & ~mask) | (flags & mask);
260 if (netif_running(dev) && (vlan->flags ^ old_flags) & VLAN_FLAG_GVRP) {
261 if (vlan->flags & VLAN_FLAG_GVRP)
262 vlan_gvrp_request_join(dev);
264 vlan_gvrp_request_leave(dev);
269 void vlan_dev_get_realdev_name(const struct net_device *dev, char *result)
271 strncpy(result, vlan_dev_info(dev)->real_dev->name, 23);
274 static int vlan_dev_open(struct net_device *dev)
276 struct vlan_dev_info *vlan = vlan_dev_info(dev);
277 struct net_device *real_dev = vlan->real_dev;
280 if (!(real_dev->flags & IFF_UP) &&
281 !(vlan->flags & VLAN_FLAG_LOOSE_BINDING))
284 if (compare_ether_addr(dev->dev_addr, real_dev->dev_addr)) {
285 err = dev_uc_add(real_dev, dev->dev_addr);
290 if (dev->flags & IFF_ALLMULTI) {
291 err = dev_set_allmulti(real_dev, 1);
295 if (dev->flags & IFF_PROMISC) {
296 err = dev_set_promiscuity(real_dev, 1);
301 memcpy(vlan->real_dev_addr, real_dev->dev_addr, ETH_ALEN);
303 if (vlan->flags & VLAN_FLAG_GVRP)
304 vlan_gvrp_request_join(dev);
306 if (netif_carrier_ok(real_dev))
307 netif_carrier_on(dev);
311 if (dev->flags & IFF_ALLMULTI)
312 dev_set_allmulti(real_dev, -1);
314 if (compare_ether_addr(dev->dev_addr, real_dev->dev_addr))
315 dev_uc_del(real_dev, dev->dev_addr);
317 netif_carrier_off(dev);
321 static int vlan_dev_stop(struct net_device *dev)
323 struct vlan_dev_info *vlan = vlan_dev_info(dev);
324 struct net_device *real_dev = vlan->real_dev;
326 dev_mc_unsync(real_dev, dev);
327 dev_uc_unsync(real_dev, dev);
328 if (dev->flags & IFF_ALLMULTI)
329 dev_set_allmulti(real_dev, -1);
330 if (dev->flags & IFF_PROMISC)
331 dev_set_promiscuity(real_dev, -1);
333 if (compare_ether_addr(dev->dev_addr, real_dev->dev_addr))
334 dev_uc_del(real_dev, dev->dev_addr);
336 netif_carrier_off(dev);
340 static int vlan_dev_set_mac_address(struct net_device *dev, void *p)
342 struct net_device *real_dev = vlan_dev_info(dev)->real_dev;
343 struct sockaddr *addr = p;
346 if (!is_valid_ether_addr(addr->sa_data))
347 return -EADDRNOTAVAIL;
349 if (!(dev->flags & IFF_UP))
352 if (compare_ether_addr(addr->sa_data, real_dev->dev_addr)) {
353 err = dev_uc_add(real_dev, addr->sa_data);
358 if (compare_ether_addr(dev->dev_addr, real_dev->dev_addr))
359 dev_uc_del(real_dev, dev->dev_addr);
362 memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);
366 static int vlan_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
368 struct net_device *real_dev = vlan_dev_info(dev)->real_dev;
369 const struct net_device_ops *ops = real_dev->netdev_ops;
371 int err = -EOPNOTSUPP;
373 strncpy(ifrr.ifr_name, real_dev->name, IFNAMSIZ);
374 ifrr.ifr_ifru = ifr->ifr_ifru;
380 if (netif_device_present(real_dev) && ops->ndo_do_ioctl)
381 err = ops->ndo_do_ioctl(real_dev, &ifrr, cmd);
386 ifr->ifr_ifru = ifrr.ifr_ifru;
391 static int vlan_dev_neigh_setup(struct net_device *dev, struct neigh_parms *pa)
393 struct net_device *real_dev = vlan_dev_info(dev)->real_dev;
394 const struct net_device_ops *ops = real_dev->netdev_ops;
397 if (netif_device_present(real_dev) && ops->ndo_neigh_setup)
398 err = ops->ndo_neigh_setup(real_dev, pa);
403 #if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE)
404 static int vlan_dev_fcoe_ddp_setup(struct net_device *dev, u16 xid,
405 struct scatterlist *sgl, unsigned int sgc)
407 struct net_device *real_dev = vlan_dev_info(dev)->real_dev;
408 const struct net_device_ops *ops = real_dev->netdev_ops;
411 if (ops->ndo_fcoe_ddp_setup)
412 rc = ops->ndo_fcoe_ddp_setup(real_dev, xid, sgl, sgc);
417 static int vlan_dev_fcoe_ddp_done(struct net_device *dev, u16 xid)
419 struct net_device *real_dev = vlan_dev_info(dev)->real_dev;
420 const struct net_device_ops *ops = real_dev->netdev_ops;
423 if (ops->ndo_fcoe_ddp_done)
424 len = ops->ndo_fcoe_ddp_done(real_dev, xid);
429 static int vlan_dev_fcoe_enable(struct net_device *dev)
431 struct net_device *real_dev = vlan_dev_info(dev)->real_dev;
432 const struct net_device_ops *ops = real_dev->netdev_ops;
435 if (ops->ndo_fcoe_enable)
436 rc = ops->ndo_fcoe_enable(real_dev);
440 static int vlan_dev_fcoe_disable(struct net_device *dev)
442 struct net_device *real_dev = vlan_dev_info(dev)->real_dev;
443 const struct net_device_ops *ops = real_dev->netdev_ops;
446 if (ops->ndo_fcoe_disable)
447 rc = ops->ndo_fcoe_disable(real_dev);
451 static int vlan_dev_fcoe_get_wwn(struct net_device *dev, u64 *wwn, int type)
453 struct net_device *real_dev = vlan_dev_info(dev)->real_dev;
454 const struct net_device_ops *ops = real_dev->netdev_ops;
457 if (ops->ndo_fcoe_get_wwn)
458 rc = ops->ndo_fcoe_get_wwn(real_dev, wwn, type);
462 static int vlan_dev_fcoe_ddp_target(struct net_device *dev, u16 xid,
463 struct scatterlist *sgl, unsigned int sgc)
465 struct net_device *real_dev = vlan_dev_info(dev)->real_dev;
466 const struct net_device_ops *ops = real_dev->netdev_ops;
469 if (ops->ndo_fcoe_ddp_target)
470 rc = ops->ndo_fcoe_ddp_target(real_dev, xid, sgl, sgc);
476 static void vlan_dev_change_rx_flags(struct net_device *dev, int change)
478 struct net_device *real_dev = vlan_dev_info(dev)->real_dev;
480 if (dev->flags & IFF_UP) {
481 if (change & IFF_ALLMULTI)
482 dev_set_allmulti(real_dev, dev->flags & IFF_ALLMULTI ? 1 : -1);
483 if (change & IFF_PROMISC)
484 dev_set_promiscuity(real_dev, dev->flags & IFF_PROMISC ? 1 : -1);
488 static void vlan_dev_set_rx_mode(struct net_device *vlan_dev)
490 dev_mc_sync(vlan_dev_info(vlan_dev)->real_dev, vlan_dev);
491 dev_uc_sync(vlan_dev_info(vlan_dev)->real_dev, vlan_dev);
495 * vlan network devices have devices nesting below it, and are a special
496 * "super class" of normal network devices; split their locks off into a
497 * separate class since they always nest.
499 static struct lock_class_key vlan_netdev_xmit_lock_key;
500 static struct lock_class_key vlan_netdev_addr_lock_key;
502 static void vlan_dev_set_lockdep_one(struct net_device *dev,
503 struct netdev_queue *txq,
506 lockdep_set_class_and_subclass(&txq->_xmit_lock,
507 &vlan_netdev_xmit_lock_key,
511 static void vlan_dev_set_lockdep_class(struct net_device *dev, int subclass)
513 lockdep_set_class_and_subclass(&dev->addr_list_lock,
514 &vlan_netdev_addr_lock_key,
516 netdev_for_each_tx_queue(dev, vlan_dev_set_lockdep_one, &subclass);
519 static const struct header_ops vlan_header_ops = {
520 .create = vlan_dev_hard_header,
521 .rebuild = vlan_dev_rebuild_header,
522 .parse = eth_header_parse,
525 static int vlan_passthru_hard_header(struct sk_buff *skb, struct net_device *dev,
527 const void *daddr, const void *saddr,
530 struct net_device *real_dev = vlan_dev_info(dev)->real_dev;
533 saddr = dev->dev_addr;
535 return dev_hard_header(skb, real_dev, type, daddr, saddr, len);
538 static const struct header_ops vlan_passthru_header_ops = {
539 .create = vlan_passthru_hard_header,
540 .rebuild = dev_rebuild_header,
541 .parse = eth_header_parse,
544 static const struct net_device_ops vlan_netdev_ops;
546 static int vlan_dev_init(struct net_device *dev)
548 struct net_device *real_dev = vlan_dev_info(dev)->real_dev;
551 netif_carrier_off(dev);
553 /* IFF_BROADCAST|IFF_MULTICAST; ??? */
554 dev->flags = real_dev->flags & ~(IFF_UP | IFF_PROMISC | IFF_ALLMULTI |
555 IFF_MASTER | IFF_SLAVE);
556 dev->iflink = real_dev->ifindex;
557 dev->state = (real_dev->state & ((1<<__LINK_STATE_NOCARRIER) |
558 (1<<__LINK_STATE_DORMANT))) |
559 (1<<__LINK_STATE_PRESENT);
561 dev->hw_features = NETIF_F_ALL_CSUM | NETIF_F_SG |
562 NETIF_F_FRAGLIST | NETIF_F_ALL_TSO |
563 NETIF_F_HIGHDMA | NETIF_F_SCTP_CSUM |
566 dev->features |= real_dev->vlan_features | NETIF_F_LLTX;
567 dev->gso_max_size = real_dev->gso_max_size;
569 /* ipv6 shared card related stuff */
570 dev->dev_id = real_dev->dev_id;
572 if (is_zero_ether_addr(dev->dev_addr))
573 memcpy(dev->dev_addr, real_dev->dev_addr, dev->addr_len);
574 if (is_zero_ether_addr(dev->broadcast))
575 memcpy(dev->broadcast, real_dev->broadcast, dev->addr_len);
577 #if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE)
578 dev->fcoe_ddp_xid = real_dev->fcoe_ddp_xid;
581 dev->needed_headroom = real_dev->needed_headroom;
582 if (real_dev->features & NETIF_F_HW_VLAN_TX) {
583 dev->header_ops = &vlan_passthru_header_ops;
584 dev->hard_header_len = real_dev->hard_header_len;
586 dev->header_ops = &vlan_header_ops;
587 dev->hard_header_len = real_dev->hard_header_len + VLAN_HLEN;
590 dev->netdev_ops = &vlan_netdev_ops;
592 if (is_vlan_dev(real_dev))
595 vlan_dev_set_lockdep_class(dev, subclass);
597 vlan_dev_info(dev)->vlan_pcpu_stats = alloc_percpu(struct vlan_pcpu_stats);
598 if (!vlan_dev_info(dev)->vlan_pcpu_stats)
604 static void vlan_dev_uninit(struct net_device *dev)
606 struct vlan_priority_tci_mapping *pm;
607 struct vlan_dev_info *vlan = vlan_dev_info(dev);
610 free_percpu(vlan->vlan_pcpu_stats);
611 vlan->vlan_pcpu_stats = NULL;
612 for (i = 0; i < ARRAY_SIZE(vlan->egress_priority_map); i++) {
613 while ((pm = vlan->egress_priority_map[i]) != NULL) {
614 vlan->egress_priority_map[i] = pm->next;
620 static u32 vlan_dev_fix_features(struct net_device *dev, u32 features)
622 struct net_device *real_dev = vlan_dev_info(dev)->real_dev;
623 u32 old_features = features;
625 features &= real_dev->features;
626 features &= real_dev->vlan_features;
628 features |= old_features & NETIF_F_SOFT_FEATURES;
630 if (dev_ethtool_get_rx_csum(real_dev))
631 features |= NETIF_F_RXCSUM;
632 features |= NETIF_F_LLTX;
637 static int vlan_ethtool_get_settings(struct net_device *dev,
638 struct ethtool_cmd *cmd)
640 const struct vlan_dev_info *vlan = vlan_dev_info(dev);
642 return __ethtool_get_settings(vlan->real_dev, cmd);
645 static void vlan_ethtool_get_drvinfo(struct net_device *dev,
646 struct ethtool_drvinfo *info)
648 strcpy(info->driver, vlan_fullname);
649 strcpy(info->version, vlan_version);
650 strcpy(info->fw_version, "N/A");
653 static struct rtnl_link_stats64 *vlan_dev_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
656 if (vlan_dev_info(dev)->vlan_pcpu_stats) {
657 struct vlan_pcpu_stats *p;
658 u32 rx_errors = 0, tx_dropped = 0;
661 for_each_possible_cpu(i) {
662 u64 rxpackets, rxbytes, rxmulticast, txpackets, txbytes;
665 p = per_cpu_ptr(vlan_dev_info(dev)->vlan_pcpu_stats, i);
667 start = u64_stats_fetch_begin_bh(&p->syncp);
668 rxpackets = p->rx_packets;
669 rxbytes = p->rx_bytes;
670 rxmulticast = p->rx_multicast;
671 txpackets = p->tx_packets;
672 txbytes = p->tx_bytes;
673 } while (u64_stats_fetch_retry_bh(&p->syncp, start));
675 stats->rx_packets += rxpackets;
676 stats->rx_bytes += rxbytes;
677 stats->multicast += rxmulticast;
678 stats->tx_packets += txpackets;
679 stats->tx_bytes += txbytes;
680 /* rx_errors & tx_dropped are u32 */
681 rx_errors += p->rx_errors;
682 tx_dropped += p->tx_dropped;
684 stats->rx_errors = rx_errors;
685 stats->tx_dropped = tx_dropped;
690 static const struct ethtool_ops vlan_ethtool_ops = {
691 .get_settings = vlan_ethtool_get_settings,
692 .get_drvinfo = vlan_ethtool_get_drvinfo,
693 .get_link = ethtool_op_get_link,
696 static const struct net_device_ops vlan_netdev_ops = {
697 .ndo_change_mtu = vlan_dev_change_mtu,
698 .ndo_init = vlan_dev_init,
699 .ndo_uninit = vlan_dev_uninit,
700 .ndo_open = vlan_dev_open,
701 .ndo_stop = vlan_dev_stop,
702 .ndo_start_xmit = vlan_dev_hard_start_xmit,
703 .ndo_validate_addr = eth_validate_addr,
704 .ndo_set_mac_address = vlan_dev_set_mac_address,
705 .ndo_set_rx_mode = vlan_dev_set_rx_mode,
706 .ndo_change_rx_flags = vlan_dev_change_rx_flags,
707 .ndo_do_ioctl = vlan_dev_ioctl,
708 .ndo_neigh_setup = vlan_dev_neigh_setup,
709 .ndo_get_stats64 = vlan_dev_get_stats64,
710 #if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE)
711 .ndo_fcoe_ddp_setup = vlan_dev_fcoe_ddp_setup,
712 .ndo_fcoe_ddp_done = vlan_dev_fcoe_ddp_done,
713 .ndo_fcoe_enable = vlan_dev_fcoe_enable,
714 .ndo_fcoe_disable = vlan_dev_fcoe_disable,
715 .ndo_fcoe_get_wwn = vlan_dev_fcoe_get_wwn,
716 .ndo_fcoe_ddp_target = vlan_dev_fcoe_ddp_target,
718 .ndo_fix_features = vlan_dev_fix_features,
721 void vlan_setup(struct net_device *dev)
725 dev->priv_flags |= IFF_802_1Q_VLAN;
726 dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_TX_SKB_SHARING);
727 dev->tx_queue_len = 0;
729 dev->netdev_ops = &vlan_netdev_ops;
730 dev->destructor = free_netdev;
731 dev->ethtool_ops = &vlan_ethtool_ops;
733 memset(dev->broadcast, 0, ETH_ALEN);