Merge branch 'for-linus' of git://git.kernel.dk/linux-block
[pandora-kernel.git] / drivers / staging / et131x / et131x_netdev.c
1 /*
2  * Agere Systems Inc.
3  * 10/100/1000 Base-T Ethernet Driver for the ET1301 and ET131x series MACs
4  *
5  * Copyright © 2005 Agere Systems Inc.
6  * All rights reserved.
7  *   http://www.agere.com
8  *
9  *------------------------------------------------------------------------------
10  *
11  * et131x_netdev.c - Routines and data required by all Linux network devices.
12  *
13  *------------------------------------------------------------------------------
14  *
15  * SOFTWARE LICENSE
16  *
17  * This software is provided subject to the following terms and conditions,
18  * which you should read carefully before using the software.  Using this
19  * software indicates your acceptance of these terms and conditions.  If you do
20  * not agree with these terms and conditions, do not use the software.
21  *
22  * Copyright © 2005 Agere Systems Inc.
23  * All rights reserved.
24  *
25  * Redistribution and use in source or binary forms, with or without
26  * modifications, are permitted provided that the following conditions are met:
27  *
28  * . Redistributions of source code must retain the above copyright notice, this
29  *    list of conditions and the following Disclaimer as comments in the code as
30  *    well as in the documentation and/or other materials provided with the
31  *    distribution.
32  *
33  * . Redistributions in binary form must reproduce the above copyright notice,
34  *    this list of conditions and the following Disclaimer in the documentation
35  *    and/or other materials provided with the distribution.
36  *
37  * . Neither the name of Agere Systems Inc. nor the names of the contributors
38  *    may be used to endorse or promote products derived from this software
39  *    without specific prior written permission.
40  *
41  * Disclaimer
42  *
43  * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
44  * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
45  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  ANY
46  * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
47  * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
48  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
49  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
50  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
51  * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
52  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
53  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
54  * DAMAGE.
55  *
56  */
57
58 #include "et131x_version.h"
59 #include "et131x_defs.h"
60
61 #include <linux/init.h>
62 #include <linux/module.h>
63 #include <linux/types.h>
64 #include <linux/kernel.h>
65
66 #include <linux/sched.h>
67 #include <linux/ptrace.h>
68 #include <linux/ctype.h>
69 #include <linux/string.h>
70 #include <linux/timer.h>
71 #include <linux/interrupt.h>
72 #include <linux/in.h>
73 #include <linux/delay.h>
74 #include <linux/io.h>
75 #include <linux/bitops.h>
76 #include <linux/pci.h>
77 #include <asm/system.h>
78
79 #include <linux/mii.h>
80 #include <linux/netdevice.h>
81 #include <linux/etherdevice.h>
82 #include <linux/skbuff.h>
83 #include <linux/if_arp.h>
84 #include <linux/ioport.h>
85
86 #include "et1310_phy.h"
87 #include "et1310_tx.h"
88 #include "et131x_adapter.h"
89 #include "et131x.h"
90
91 /**
92  * et131x_stats - Return the current device statistics.
93  * @netdev: device whose stats are being queried
94  *
95  * Returns 0 on success, errno on failure (as defined in errno.h)
96  */
97 static struct net_device_stats *et131x_stats(struct net_device *netdev)
98 {
99         struct et131x_adapter *adapter = netdev_priv(netdev);
100         struct net_device_stats *stats = &adapter->net_stats;
101         struct ce_stats *devstat = &adapter->stats;
102
103         stats->rx_errors = devstat->length_err + devstat->alignment_err +
104             devstat->crc_err + devstat->code_violations + devstat->other_errors;
105         stats->tx_errors = devstat->max_pkt_error;
106         stats->multicast = devstat->multircv;
107         stats->collisions = devstat->collisions;
108
109         stats->rx_length_errors = devstat->length_err;
110         stats->rx_over_errors = devstat->rx_ov_flow;
111         stats->rx_crc_errors = devstat->crc_err;
112
113         /* NOTE: These stats don't have corresponding values in CE_STATS,
114          * so we're going to have to update these directly from within the
115          * TX/RX code
116          */
117         /* stats->rx_bytes            = 20; devstat->; */
118         /* stats->tx_bytes            = 20;  devstat->; */
119         /* stats->rx_dropped          = devstat->; */
120         /* stats->tx_dropped          = devstat->; */
121
122         /*  NOTE: Not used, can't find analogous statistics */
123         /* stats->rx_frame_errors     = devstat->; */
124         /* stats->rx_fifo_errors      = devstat->; */
125         /* stats->rx_missed_errors    = devstat->; */
126
127         /* stats->tx_aborted_errors   = devstat->; */
128         /* stats->tx_carrier_errors   = devstat->; */
129         /* stats->tx_fifo_errors      = devstat->; */
130         /* stats->tx_heartbeat_errors = devstat->; */
131         /* stats->tx_window_errors    = devstat->; */
132         return stats;
133 }
134
135 /**
136  * et131x_open - Open the device for use.
137  * @netdev: device to be opened
138  *
139  * Returns 0 on success, errno on failure (as defined in errno.h)
140  */
141 int et131x_open(struct net_device *netdev)
142 {
143         int result = 0;
144         struct et131x_adapter *adapter = netdev_priv(netdev);
145
146         /* Start the timer to track NIC errors */
147         add_timer(&adapter->ErrorTimer);
148
149         /* Register our IRQ */
150         result = request_irq(netdev->irq, et131x_isr, IRQF_SHARED,
151                                         netdev->name, netdev);
152         if (result) {
153                 dev_err(&adapter->pdev->dev, "c ould not register IRQ %d\n",
154                         netdev->irq);
155                 return result;
156         }
157
158         /* Enable the Tx and Rx DMA engines (if not already enabled) */
159         et131x_rx_dma_enable(adapter);
160         et131x_tx_dma_enable(adapter);
161
162         /* Enable device interrupts */
163         et131x_enable_interrupts(adapter);
164
165         adapter->flags |= fMP_ADAPTER_INTERRUPT_IN_USE;
166
167         /* We're ready to move some data, so start the queue */
168         netif_start_queue(netdev);
169         return result;
170 }
171
172 /**
173  * et131x_close - Close the device
174  * @netdev: device to be closed
175  *
176  * Returns 0 on success, errno on failure (as defined in errno.h)
177  */
178 int et131x_close(struct net_device *netdev)
179 {
180         struct et131x_adapter *adapter = netdev_priv(netdev);
181
182         /* First thing is to stop the queue */
183         netif_stop_queue(netdev);
184
185         /* Stop the Tx and Rx DMA engines */
186         et131x_rx_dma_disable(adapter);
187         et131x_tx_dma_disable(adapter);
188
189         /* Disable device interrupts */
190         et131x_disable_interrupts(adapter);
191
192         /* Deregistering ISR */
193         adapter->flags &= ~fMP_ADAPTER_INTERRUPT_IN_USE;
194         free_irq(netdev->irq, netdev);
195
196         /* Stop the error timer */
197         del_timer_sync(&adapter->ErrorTimer);
198         return 0;
199 }
200
201 /**
202  * et131x_ioctl_mii - The function which handles MII IOCTLs
203  * @netdev: device on which the query is being made
204  * @reqbuf: the request-specific data buffer
205  * @cmd: the command request code
206  *
207  * Returns 0 on success, errno on failure (as defined in errno.h)
208  */
209 int et131x_ioctl_mii(struct net_device *netdev, struct ifreq *reqbuf, int cmd)
210 {
211         int status = 0;
212         struct et131x_adapter *etdev = netdev_priv(netdev);
213         struct mii_ioctl_data *data = if_mii(reqbuf);
214
215         switch (cmd) {
216         case SIOCGMIIPHY:
217                 data->phy_id = etdev->stats.xcvr_addr;
218                 break;
219
220         case SIOCGMIIREG:
221                 if (!capable(CAP_NET_ADMIN))
222                         status = -EPERM;
223                 else
224                         status = MiRead(etdev,
225                                         data->reg_num, &data->val_out);
226                 break;
227
228         case SIOCSMIIREG:
229                 if (!capable(CAP_NET_ADMIN))
230                         status = -EPERM;
231                 else
232                         status = MiWrite(etdev, data->reg_num,
233                                          data->val_in);
234                 break;
235
236         default:
237                 status = -EOPNOTSUPP;
238         }
239         return status;
240 }
241
242 /**
243  * et131x_ioctl - The I/O Control handler for the driver
244  * @netdev: device on which the control request is being made
245  * @reqbuf: a pointer to the IOCTL request buffer
246  * @cmd: the IOCTL command code
247  *
248  * Returns 0 on success, errno on failure (as defined in errno.h)
249  */
250 int et131x_ioctl(struct net_device *netdev, struct ifreq *reqbuf, int cmd)
251 {
252         int status = 0;
253
254         switch (cmd) {
255         case SIOCGMIIPHY:
256         case SIOCGMIIREG:
257         case SIOCSMIIREG:
258                 status = et131x_ioctl_mii(netdev, reqbuf, cmd);
259                 break;
260
261         default:
262                 status = -EOPNOTSUPP;
263         }
264         return status;
265 }
266
267 /**
268  * et131x_set_packet_filter - Configures the Rx Packet filtering on the device
269  * @adapter: pointer to our private adapter structure
270  *
271  * FIXME: lot of dups with MAC code
272  *
273  * Returns 0 on success, errno on failure
274  */
275 int et131x_set_packet_filter(struct et131x_adapter *adapter)
276 {
277         int status = 0;
278         uint32_t filter = adapter->PacketFilter;
279         u32 ctrl;
280         u32 pf_ctrl;
281
282         ctrl = readl(&adapter->regs->rxmac.ctrl);
283         pf_ctrl = readl(&adapter->regs->rxmac.pf_ctrl);
284
285         /* Default to disabled packet filtering.  Enable it in the individual
286          * case statements that require the device to filter something
287          */
288         ctrl |= 0x04;
289
290         /* Set us to be in promiscuous mode so we receive everything, this
291          * is also true when we get a packet filter of 0
292          */
293         if ((filter & ET131X_PACKET_TYPE_PROMISCUOUS) || filter == 0)
294                 pf_ctrl &= ~7;  /* Clear filter bits */
295         else {
296                 /*
297                  * Set us up with Multicast packet filtering.  Three cases are
298                  * possible - (1) we have a multi-cast list, (2) we receive ALL
299                  * multicast entries or (3) we receive none.
300                  */
301                 if (filter & ET131X_PACKET_TYPE_ALL_MULTICAST)
302                         pf_ctrl &= ~2;  /* Multicast filter bit */
303                 else {
304                         SetupDeviceForMulticast(adapter);
305                         pf_ctrl |= 2;
306                         ctrl &= ~0x04;
307                 }
308
309                 /* Set us up with Unicast packet filtering */
310                 if (filter & ET131X_PACKET_TYPE_DIRECTED) {
311                         SetupDeviceForUnicast(adapter);
312                         pf_ctrl |= 4;
313                         ctrl &= ~0x04;
314                 }
315
316                 /* Set us up with Broadcast packet filtering */
317                 if (filter & ET131X_PACKET_TYPE_BROADCAST) {
318                         pf_ctrl |= 1;   /* Broadcast filter bit */
319                         ctrl &= ~0x04;
320                 } else
321                         pf_ctrl &= ~1;
322
323                 /* Setup the receive mac configuration registers - Packet
324                  * Filter control + the enable / disable for packet filter
325                  * in the control reg.
326                  */
327                 writel(pf_ctrl, &adapter->regs->rxmac.pf_ctrl);
328                 writel(ctrl, &adapter->regs->rxmac.ctrl);
329         }
330         return status;
331 }
332
333 /**
334  * et131x_multicast - The handler to configure multicasting on the interface
335  * @netdev: a pointer to a net_device struct representing the device
336  */
337 void et131x_multicast(struct net_device *netdev)
338 {
339         struct et131x_adapter *adapter = netdev_priv(netdev);
340         uint32_t PacketFilter = 0;
341         unsigned long flags;
342         struct netdev_hw_addr *ha;
343         int i;
344
345         spin_lock_irqsave(&adapter->Lock, flags);
346
347         /* Before we modify the platform-independent filter flags, store them
348          * locally. This allows us to determine if anything's changed and if
349          * we even need to bother the hardware
350          */
351         PacketFilter = adapter->PacketFilter;
352
353         /* Clear the 'multicast' flag locally; because we only have a single
354          * flag to check multicast, and multiple multicast addresses can be
355          * set, this is the easiest way to determine if more than one
356          * multicast address is being set.
357          */
358         PacketFilter &= ~ET131X_PACKET_TYPE_MULTICAST;
359
360         /* Check the net_device flags and set the device independent flags
361          * accordingly
362          */
363
364         if (netdev->flags & IFF_PROMISC)
365                 adapter->PacketFilter |= ET131X_PACKET_TYPE_PROMISCUOUS;
366         else
367                 adapter->PacketFilter &= ~ET131X_PACKET_TYPE_PROMISCUOUS;
368
369         if (netdev->flags & IFF_ALLMULTI)
370                 adapter->PacketFilter |= ET131X_PACKET_TYPE_ALL_MULTICAST;
371
372         if (netdev_mc_count(netdev) > NIC_MAX_MCAST_LIST)
373                 adapter->PacketFilter |= ET131X_PACKET_TYPE_ALL_MULTICAST;
374
375         if (netdev_mc_count(netdev) < 1) {
376                 adapter->PacketFilter &= ~ET131X_PACKET_TYPE_ALL_MULTICAST;
377                 adapter->PacketFilter &= ~ET131X_PACKET_TYPE_MULTICAST;
378         } else
379                 adapter->PacketFilter |= ET131X_PACKET_TYPE_MULTICAST;
380
381         /* Set values in the private adapter struct */
382         i = 0;
383         netdev_for_each_mc_addr(ha, netdev) {
384                 if (i == NIC_MAX_MCAST_LIST)
385                         break;
386                 memcpy(adapter->MCList[i++], ha->addr, ETH_ALEN);
387         }
388         adapter->MCAddressCount = i;
389
390         /* Are the new flags different from the previous ones? If not, then no
391          * action is required
392          *
393          * NOTE - This block will always update the MCList with the hardware,
394          *        even if the addresses aren't the same.
395          */
396         if (PacketFilter != adapter->PacketFilter) {
397                 /* Call the device's filter function */
398                 et131x_set_packet_filter(adapter);
399         }
400         spin_unlock_irqrestore(&adapter->Lock, flags);
401 }
402
403 /**
404  * et131x_tx - The handler to tx a packet on the device
405  * @skb: data to be Tx'd
406  * @netdev: device on which data is to be Tx'd
407  *
408  * Returns 0 on success, errno on failure (as defined in errno.h)
409  */
410 int et131x_tx(struct sk_buff *skb, struct net_device *netdev)
411 {
412         int status = 0;
413
414         /* Save the timestamp for the TX timeout watchdog */
415         netdev->trans_start = jiffies;
416
417         /* Call the device-specific data Tx routine */
418         status = et131x_send_packets(skb, netdev);
419
420         /* Check status and manage the netif queue if necessary */
421         if (status != 0) {
422                 if (status == -ENOMEM) {
423                         /* Put the queue to sleep until resources are
424                          * available
425                          */
426                         netif_stop_queue(netdev);
427                         status = NETDEV_TX_BUSY;
428                 } else {
429                         status = NETDEV_TX_OK;
430                 }
431         }
432         return status;
433 }
434
435 /**
436  * et131x_tx_timeout - Timeout handler
437  * @netdev: a pointer to a net_device struct representing the device
438  *
439  * The handler called when a Tx request times out. The timeout period is
440  * specified by the 'tx_timeo" element in the net_device structure (see
441  * et131x_alloc_device() to see how this value is set).
442  */
443 void et131x_tx_timeout(struct net_device *netdev)
444 {
445         struct et131x_adapter *etdev = netdev_priv(netdev);
446         struct tcb *tcb;
447         unsigned long flags;
448
449         /* Any nonrecoverable hardware error?
450          * Checks adapter->flags for any failure in phy reading
451          */
452         if (etdev->flags & fMP_ADAPTER_NON_RECOVER_ERROR)
453                 return;
454
455         /* Hardware failure? */
456         if (etdev->flags & fMP_ADAPTER_HARDWARE_ERROR) {
457                 dev_err(&etdev->pdev->dev, "hardware error - reset\n");
458                 return;
459         }
460
461         /* Is send stuck? */
462         spin_lock_irqsave(&etdev->TCBSendQLock, flags);
463
464         tcb = etdev->tx_ring.send_head;
465
466         if (tcb != NULL) {
467                 tcb->count++;
468
469                 if (tcb->count > NIC_SEND_HANG_THRESHOLD) {
470                         spin_unlock_irqrestore(&etdev->TCBSendQLock,
471                                                flags);
472
473                         dev_warn(&etdev->pdev->dev,
474                                 "Send stuck - reset.  tcb->WrIndex %x, flags 0x%08x\n",
475                                 tcb->index,
476                                 tcb->flags);
477
478                         et131x_close(netdev);
479                         et131x_open(netdev);
480
481                         return;
482                 }
483         }
484
485         spin_unlock_irqrestore(&etdev->TCBSendQLock, flags);
486 }
487
488 /**
489  * et131x_change_mtu - The handler called to change the MTU for the device
490  * @netdev: device whose MTU is to be changed
491  * @new_mtu: the desired MTU
492  *
493  * Returns 0 on success, errno on failure (as defined in errno.h)
494  */
495 int et131x_change_mtu(struct net_device *netdev, int new_mtu)
496 {
497         int result = 0;
498         struct et131x_adapter *adapter = netdev_priv(netdev);
499
500         /* Make sure the requested MTU is valid */
501         if (new_mtu < 64 || new_mtu > 9216)
502                 return -EINVAL;
503
504         /* Stop the netif queue */
505         netif_stop_queue(netdev);
506
507         /* Stop the Tx and Rx DMA engines */
508         et131x_rx_dma_disable(adapter);
509         et131x_tx_dma_disable(adapter);
510
511         /* Disable device interrupts */
512         et131x_disable_interrupts(adapter);
513         et131x_handle_send_interrupt(adapter);
514         et131x_handle_recv_interrupt(adapter);
515
516         /* Set the new MTU */
517         netdev->mtu = new_mtu;
518
519         /* Free Rx DMA memory */
520         et131x_adapter_memory_free(adapter);
521
522         /* Set the config parameter for Jumbo Packet support */
523         adapter->RegistryJumboPacket = new_mtu + 14;
524         et131x_soft_reset(adapter);
525
526         /* Alloc and init Rx DMA memory */
527         result = et131x_adapter_memory_alloc(adapter);
528         if (result != 0) {
529                 dev_warn(&adapter->pdev->dev,
530                         "Change MTU failed; couldn't re-alloc DMA memory\n");
531                 return result;
532         }
533
534         et131x_init_send(adapter);
535
536         et131x_hwaddr_init(adapter);
537         memcpy(netdev->dev_addr, adapter->addr, ETH_ALEN);
538
539         /* Init the device with the new settings */
540         et131x_adapter_setup(adapter);
541
542         /* Enable interrupts */
543         if (adapter->flags & fMP_ADAPTER_INTERRUPT_IN_USE)
544                 et131x_enable_interrupts(adapter);
545
546         /* Restart the Tx and Rx DMA engines */
547         et131x_rx_dma_enable(adapter);
548         et131x_tx_dma_enable(adapter);
549
550         /* Restart the netif queue */
551         netif_wake_queue(netdev);
552         return result;
553 }
554
555 /**
556  * et131x_set_mac_addr - handler to change the MAC address for the device
557  * @netdev: device whose MAC is to be changed
558  * @new_mac: the desired MAC address
559  *
560  * Returns 0 on success, errno on failure (as defined in errno.h)
561  *
562  * IMPLEMENTED BY : blux http://berndlux.de 22.01.2007 21:14
563  */
564 int et131x_set_mac_addr(struct net_device *netdev, void *new_mac)
565 {
566         int result = 0;
567         struct et131x_adapter *adapter = netdev_priv(netdev);
568         struct sockaddr *address = new_mac;
569
570         /* begin blux */
571
572         if (adapter == NULL)
573                 return -ENODEV;
574
575         /* Make sure the requested MAC is valid */
576         if (!is_valid_ether_addr(address->sa_data))
577                 return -EINVAL;
578
579         /* Stop the netif queue */
580         netif_stop_queue(netdev);
581
582         /* Stop the Tx and Rx DMA engines */
583         et131x_rx_dma_disable(adapter);
584         et131x_tx_dma_disable(adapter);
585
586         /* Disable device interrupts */
587         et131x_disable_interrupts(adapter);
588         et131x_handle_send_interrupt(adapter);
589         et131x_handle_recv_interrupt(adapter);
590
591         /* Set the new MAC */
592         /* netdev->set_mac_address  = &new_mac; */
593         /* netdev->mtu = new_mtu; */
594
595         memcpy(netdev->dev_addr, address->sa_data, netdev->addr_len);
596
597         printk(KERN_INFO "%s: Setting MAC address to %pM\n",
598                         netdev->name, netdev->dev_addr);
599
600         /* Free Rx DMA memory */
601         et131x_adapter_memory_free(adapter);
602
603         /* Set the config parameter for Jumbo Packet support */
604         /* adapter->RegistryJumboPacket = new_mtu + 14; */
605         /* blux: not needet here, we'll change the MAC */
606
607         et131x_soft_reset(adapter);
608
609         /* Alloc and init Rx DMA memory */
610         result = et131x_adapter_memory_alloc(adapter);
611         if (result != 0) {
612                 dev_err(&adapter->pdev->dev,
613                         "Change MAC failed; couldn't re-alloc DMA memory\n");
614                 return result;
615         }
616
617         et131x_init_send(adapter);
618
619         et131x_hwaddr_init(adapter);
620
621         /* Init the device with the new settings */
622         et131x_adapter_setup(adapter);
623
624         /* Enable interrupts */
625         if (adapter->flags & fMP_ADAPTER_INTERRUPT_IN_USE)
626                 et131x_enable_interrupts(adapter);
627
628         /* Restart the Tx and Rx DMA engines */
629         et131x_rx_dma_enable(adapter);
630         et131x_tx_dma_enable(adapter);
631
632         /* Restart the netif queue */
633         netif_wake_queue(netdev);
634         return result;
635 }
636
637 static const struct net_device_ops et131x_netdev_ops = {
638         .ndo_open               = et131x_open,
639         .ndo_stop               = et131x_close,
640         .ndo_start_xmit         = et131x_tx,
641         .ndo_set_multicast_list = et131x_multicast,
642         .ndo_tx_timeout         = et131x_tx_timeout,
643         .ndo_change_mtu         = et131x_change_mtu,
644         .ndo_set_mac_address    = et131x_set_mac_addr,
645         .ndo_validate_addr      = eth_validate_addr,
646         .ndo_get_stats          = et131x_stats,
647         .ndo_do_ioctl           = et131x_ioctl,
648 };
649
650 /**
651  * et131x_device_alloc
652  *
653  * Returns pointer to the allocated and initialized net_device struct for
654  * this device.
655  *
656  * Create instances of net_device and wl_private for the new adapter and
657  * register the device's entry points in the net_device structure.
658  */
659 struct net_device *et131x_device_alloc(void)
660 {
661         struct net_device *netdev;
662
663         /* Alloc net_device and adapter structs */
664         netdev = alloc_etherdev(sizeof(struct et131x_adapter));
665
666         if (netdev == NULL) {
667                 printk(KERN_ERR "et131x: Alloc of net_device struct failed\n");
668                 return NULL;
669         }
670
671         /* Setup the function registration table (and other data) for a
672          * net_device
673          */
674         /* netdev->init               = &et131x_init; */
675         /* netdev->set_config = &et131x_config; */
676         netdev->watchdog_timeo = ET131X_TX_TIMEOUT;
677         netdev->netdev_ops = &et131x_netdev_ops;
678
679         /* netdev->ethtool_ops        = &et131x_ethtool_ops; */
680
681         /* Poll? */
682         /* netdev->poll               = &et131x_poll; */
683         /* netdev->poll_controller    = &et131x_poll_controller; */
684         return netdev;
685 }
686