net: use netdev_mc_count and netdev_mc_empty when appropriate
[linux-2.6.git] / drivers / staging / et131x / et131x_netdev.c
blobbc1fad248952522ff2e1148ec181af32de70a2d0
1 /*
2 * Agere Systems Inc.
3 * 10/100/1000 Base-T Ethernet Driver for the ET1301 and ET131x series MACs
5 * Copyright © 2005 Agere Systems Inc.
6 * All rights reserved.
7 * http://www.agere.com
9 *------------------------------------------------------------------------------
11 * et131x_netdev.c - Routines and data required by all Linux network devices.
13 *------------------------------------------------------------------------------
15 * SOFTWARE LICENSE
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.
22 * Copyright © 2005 Agere Systems Inc.
23 * All rights reserved.
25 * Redistribution and use in source or binary forms, with or without
26 * modifications, are permitted provided that the following conditions are met:
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.
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.
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.
41 * Disclaimer
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.
58 #include "et131x_version.h"
59 #include "et131x_defs.h"
61 #include <linux/init.h>
62 #include <linux/module.h>
63 #include <linux/types.h>
64 #include <linux/kernel.h>
66 #include <linux/sched.h>
67 #include <linux/ptrace.h>
68 #include <linux/slab.h>
69 #include <linux/ctype.h>
70 #include <linux/string.h>
71 #include <linux/timer.h>
72 #include <linux/interrupt.h>
73 #include <linux/in.h>
74 #include <linux/delay.h>
75 #include <linux/io.h>
76 #include <linux/bitops.h>
77 #include <linux/pci.h>
78 #include <asm/system.h>
80 #include <linux/mii.h>
81 #include <linux/netdevice.h>
82 #include <linux/etherdevice.h>
83 #include <linux/skbuff.h>
84 #include <linux/if_arp.h>
85 #include <linux/ioport.h>
87 #include "et1310_phy.h"
88 #include "et1310_pm.h"
89 #include "et1310_jagcore.h"
90 #include "et1310_mac.h"
91 #include "et1310_tx.h"
93 #include "et131x_adapter.h"
94 #include "et131x_isr.h"
95 #include "et131x_initpci.h"
97 struct net_device_stats *et131x_stats(struct net_device *netdev);
98 int et131x_open(struct net_device *netdev);
99 int et131x_close(struct net_device *netdev);
100 int et131x_ioctl(struct net_device *netdev, struct ifreq *reqbuf, int cmd);
101 void et131x_multicast(struct net_device *netdev);
102 int et131x_tx(struct sk_buff *skb, struct net_device *netdev);
103 void et131x_tx_timeout(struct net_device *netdev);
104 int et131x_change_mtu(struct net_device *netdev, int new_mtu);
105 int et131x_set_mac_addr(struct net_device *netdev, void *new_mac);
106 void et131x_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp);
107 void et131x_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid);
108 void et131x_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid);
110 static const struct net_device_ops et131x_netdev_ops = {
111 .ndo_open = et131x_open,
112 .ndo_stop = et131x_close,
113 .ndo_start_xmit = et131x_tx,
114 .ndo_set_multicast_list = et131x_multicast,
115 .ndo_tx_timeout = et131x_tx_timeout,
116 .ndo_change_mtu = et131x_change_mtu,
117 .ndo_set_mac_address = et131x_set_mac_addr,
118 .ndo_validate_addr = eth_validate_addr,
119 .ndo_get_stats = et131x_stats,
120 .ndo_do_ioctl = et131x_ioctl,
124 * et131x_device_alloc
126 * Returns pointer to the allocated and initialized net_device struct for
127 * this device.
129 * Create instances of net_device and wl_private for the new adapter and
130 * register the device's entry points in the net_device structure.
132 struct net_device *et131x_device_alloc(void)
134 struct net_device *netdev;
136 /* Alloc net_device and adapter structs */
137 netdev = alloc_etherdev(sizeof(struct et131x_adapter));
139 if (netdev == NULL) {
140 printk(KERN_ERR "et131x: Alloc of net_device struct failed\n");
141 return NULL;
144 /* Setup the function registration table (and other data) for a
145 * net_device
147 /* netdev->init = &et131x_init; */
148 /* netdev->set_config = &et131x_config; */
149 netdev->watchdog_timeo = ET131X_TX_TIMEOUT;
150 netdev->netdev_ops = &et131x_netdev_ops;
152 /* netdev->ethtool_ops = &et131x_ethtool_ops; */
154 /* Poll? */
155 /* netdev->poll = &et131x_poll; */
156 /* netdev->poll_controller = &et131x_poll_controller; */
157 return netdev;
161 * et131x_stats - Return the current device statistics.
162 * @netdev: device whose stats are being queried
164 * Returns 0 on success, errno on failure (as defined in errno.h)
166 struct net_device_stats *et131x_stats(struct net_device *netdev)
168 struct et131x_adapter *adapter = netdev_priv(netdev);
169 struct net_device_stats *stats = &adapter->net_stats;
170 CE_STATS_t *devstat = &adapter->Stats;
172 stats->rx_packets = devstat->ipackets;
173 stats->tx_packets = devstat->opackets;
174 stats->rx_errors = devstat->length_err + devstat->alignment_err +
175 devstat->crc_err + devstat->code_violations + devstat->other_errors;
176 stats->tx_errors = devstat->max_pkt_error;
177 stats->multicast = devstat->multircv;
178 stats->collisions = devstat->collisions;
180 stats->rx_length_errors = devstat->length_err;
181 stats->rx_over_errors = devstat->rx_ov_flow;
182 stats->rx_crc_errors = devstat->crc_err;
184 /* NOTE: These stats don't have corresponding values in CE_STATS,
185 * so we're going to have to update these directly from within the
186 * TX/RX code
188 /* stats->rx_bytes = 20; devstat->; */
189 /* stats->tx_bytes = 20; devstat->; */
190 /* stats->rx_dropped = devstat->; */
191 /* stats->tx_dropped = devstat->; */
193 /* NOTE: Not used, can't find analogous statistics */
194 /* stats->rx_frame_errors = devstat->; */
195 /* stats->rx_fifo_errors = devstat->; */
196 /* stats->rx_missed_errors = devstat->; */
198 /* stats->tx_aborted_errors = devstat->; */
199 /* stats->tx_carrier_errors = devstat->; */
200 /* stats->tx_fifo_errors = devstat->; */
201 /* stats->tx_heartbeat_errors = devstat->; */
202 /* stats->tx_window_errors = devstat->; */
203 return stats;
207 * et131x_open - Open the device for use.
208 * @netdev: device to be opened
210 * Returns 0 on success, errno on failure (as defined in errno.h)
212 int et131x_open(struct net_device *netdev)
214 int result = 0;
215 struct et131x_adapter *adapter = netdev_priv(netdev);
217 /* Start the timer to track NIC errors */
218 add_timer(&adapter->ErrorTimer);
220 /* Register our IRQ */
221 result = request_irq(netdev->irq, et131x_isr, IRQF_SHARED,
222 netdev->name, netdev);
223 if (result) {
224 dev_err(&adapter->pdev->dev, "c ould not register IRQ %d\n",
225 netdev->irq);
226 return result;
229 /* Enable the Tx and Rx DMA engines (if not already enabled) */
230 et131x_rx_dma_enable(adapter);
231 et131x_tx_dma_enable(adapter);
233 /* Enable device interrupts */
234 et131x_enable_interrupts(adapter);
236 adapter->Flags |= fMP_ADAPTER_INTERRUPT_IN_USE;
238 /* We're ready to move some data, so start the queue */
239 netif_start_queue(netdev);
240 return result;
244 * et131x_close - Close the device
245 * @netdev: device to be closed
247 * Returns 0 on success, errno on failure (as defined in errno.h)
249 int et131x_close(struct net_device *netdev)
251 struct et131x_adapter *adapter = netdev_priv(netdev);
253 /* First thing is to stop the queue */
254 netif_stop_queue(netdev);
256 /* Stop the Tx and Rx DMA engines */
257 et131x_rx_dma_disable(adapter);
258 et131x_tx_dma_disable(adapter);
260 /* Disable device interrupts */
261 et131x_disable_interrupts(adapter);
263 /* Deregistering ISR */
264 adapter->Flags &= ~fMP_ADAPTER_INTERRUPT_IN_USE;
265 free_irq(netdev->irq, netdev);
267 /* Stop the error timer */
268 del_timer_sync(&adapter->ErrorTimer);
269 return 0;
273 * et131x_ioctl_mii - The function which handles MII IOCTLs
274 * @netdev: device on which the query is being made
275 * @reqbuf: the request-specific data buffer
276 * @cmd: the command request code
278 * Returns 0 on success, errno on failure (as defined in errno.h)
280 int et131x_ioctl_mii(struct net_device *netdev, struct ifreq *reqbuf, int cmd)
282 int status = 0;
283 struct et131x_adapter *etdev = netdev_priv(netdev);
284 struct mii_ioctl_data *data = if_mii(reqbuf);
286 switch (cmd) {
287 case SIOCGMIIPHY:
288 data->phy_id = etdev->Stats.xcvr_addr;
289 break;
291 case SIOCGMIIREG:
292 if (!capable(CAP_NET_ADMIN))
293 status = -EPERM;
294 else
295 status = MiRead(etdev,
296 data->reg_num, &data->val_out);
297 break;
299 case SIOCSMIIREG:
300 if (!capable(CAP_NET_ADMIN))
301 status = -EPERM;
302 else
303 status = MiWrite(etdev, data->reg_num,
304 data->val_in);
305 break;
307 default:
308 status = -EOPNOTSUPP;
310 return status;
314 * et131x_ioctl - The I/O Control handler for the driver
315 * @netdev: device on which the control request is being made
316 * @reqbuf: a pointer to the IOCTL request buffer
317 * @cmd: the IOCTL command code
319 * Returns 0 on success, errno on failure (as defined in errno.h)
321 int et131x_ioctl(struct net_device *netdev, struct ifreq *reqbuf, int cmd)
323 int status = 0;
325 switch (cmd) {
326 case SIOCGMIIPHY:
327 case SIOCGMIIREG:
328 case SIOCSMIIREG:
329 status = et131x_ioctl_mii(netdev, reqbuf, cmd);
330 break;
332 default:
333 status = -EOPNOTSUPP;
335 return status;
339 * et131x_set_packet_filter - Configures the Rx Packet filtering on the device
340 * @adapter: pointer to our private adapter structure
342 * Returns 0 on success, errno on failure
344 int et131x_set_packet_filter(struct et131x_adapter *adapter)
346 int status = 0;
347 uint32_t filter = adapter->PacketFilter;
348 RXMAC_CTRL_t ctrl;
349 RXMAC_PF_CTRL_t pf_ctrl;
351 ctrl.value = readl(&adapter->regs->rxmac.ctrl.value);
352 pf_ctrl.value = readl(&adapter->regs->rxmac.pf_ctrl.value);
354 /* Default to disabled packet filtering. Enable it in the individual
355 * case statements that require the device to filter something
357 ctrl.bits.pkt_filter_disable = 1;
359 /* Set us to be in promiscuous mode so we receive everything, this
360 * is also true when we get a packet filter of 0
362 if ((filter & ET131X_PACKET_TYPE_PROMISCUOUS) || filter == 0) {
363 pf_ctrl.bits.filter_broad_en = 0;
364 pf_ctrl.bits.filter_multi_en = 0;
365 pf_ctrl.bits.filter_uni_en = 0;
366 } else {
368 * Set us up with Multicast packet filtering. Three cases are
369 * possible - (1) we have a multi-cast list, (2) we receive ALL
370 * multicast entries or (3) we receive none.
372 if (filter & ET131X_PACKET_TYPE_ALL_MULTICAST) {
373 pf_ctrl.bits.filter_multi_en = 0;
374 } else {
375 SetupDeviceForMulticast(adapter);
376 pf_ctrl.bits.filter_multi_en = 1;
377 ctrl.bits.pkt_filter_disable = 0;
380 /* Set us up with Unicast packet filtering */
381 if (filter & ET131X_PACKET_TYPE_DIRECTED) {
382 SetupDeviceForUnicast(adapter);
383 pf_ctrl.bits.filter_uni_en = 1;
384 ctrl.bits.pkt_filter_disable = 0;
387 /* Set us up with Broadcast packet filtering */
388 if (filter & ET131X_PACKET_TYPE_BROADCAST) {
389 pf_ctrl.bits.filter_broad_en = 1;
390 ctrl.bits.pkt_filter_disable = 0;
391 } else {
392 pf_ctrl.bits.filter_broad_en = 0;
395 /* Setup the receive mac configuration registers - Packet
396 * Filter control + the enable / disable for packet filter
397 * in the control reg.
399 writel(pf_ctrl.value,
400 &adapter->regs->rxmac.pf_ctrl.value);
401 writel(ctrl.value, &adapter->regs->rxmac.ctrl.value);
403 return status;
407 * et131x_multicast - The handler to configure multicasting on the interface
408 * @netdev: a pointer to a net_device struct representing the device
410 void et131x_multicast(struct net_device *netdev)
412 struct et131x_adapter *adapter = netdev_priv(netdev);
413 uint32_t PacketFilter = 0;
414 uint32_t count;
415 unsigned long flags;
416 struct dev_mc_list *mclist = netdev->mc_list;
418 spin_lock_irqsave(&adapter->Lock, flags);
420 /* Before we modify the platform-independent filter flags, store them
421 * locally. This allows us to determine if anything's changed and if
422 * we even need to bother the hardware
424 PacketFilter = adapter->PacketFilter;
426 /* Clear the 'multicast' flag locally; becuase we only have a single
427 * flag to check multicast, and multiple multicast addresses can be
428 * set, this is the easiest way to determine if more than one
429 * multicast address is being set.
431 PacketFilter &= ~ET131X_PACKET_TYPE_MULTICAST;
433 /* Check the net_device flags and set the device independent flags
434 * accordingly
437 if (netdev->flags & IFF_PROMISC) {
438 adapter->PacketFilter |= ET131X_PACKET_TYPE_PROMISCUOUS;
439 } else {
440 adapter->PacketFilter &= ~ET131X_PACKET_TYPE_PROMISCUOUS;
443 if (netdev->flags & IFF_ALLMULTI) {
444 adapter->PacketFilter |= ET131X_PACKET_TYPE_ALL_MULTICAST;
447 if (netdev_mc_count(netdev) > NIC_MAX_MCAST_LIST) {
448 adapter->PacketFilter |= ET131X_PACKET_TYPE_ALL_MULTICAST;
451 if (netdev_mc_count(netdev) < 1) {
452 adapter->PacketFilter &= ~ET131X_PACKET_TYPE_ALL_MULTICAST;
453 adapter->PacketFilter &= ~ET131X_PACKET_TYPE_MULTICAST;
454 } else {
455 adapter->PacketFilter |= ET131X_PACKET_TYPE_MULTICAST;
458 /* Set values in the private adapter struct */
459 adapter->MCAddressCount = netdev_mc_count(netdev);
461 if (!netdev_mc_empty(netdev)) {
462 count = netdev_mc_count(netdev) - 1;
463 memcpy(adapter->MCList[count], mclist->dmi_addr, ETH_ALEN);
466 /* Are the new flags different from the previous ones? If not, then no
467 * action is required
469 * NOTE - This block will always update the MCList with the hardware,
470 * even if the addresses aren't the same.
472 if (PacketFilter != adapter->PacketFilter) {
473 /* Call the device's filter function */
474 et131x_set_packet_filter(adapter);
476 spin_unlock_irqrestore(&adapter->Lock, flags);
480 * et131x_tx - The handler to tx a packet on the device
481 * @skb: data to be Tx'd
482 * @netdev: device on which data is to be Tx'd
484 * Returns 0 on success, errno on failure (as defined in errno.h)
486 int et131x_tx(struct sk_buff *skb, struct net_device *netdev)
488 int status = 0;
490 /* Save the timestamp for the TX timeout watchdog */
491 netdev->trans_start = jiffies;
493 /* Call the device-specific data Tx routine */
494 status = et131x_send_packets(skb, netdev);
496 /* Check status and manage the netif queue if necessary */
497 if (status != 0) {
498 if (status == -ENOMEM) {
499 /* Put the queue to sleep until resources are
500 * available
502 netif_stop_queue(netdev);
503 status = NETDEV_TX_BUSY;
504 } else {
505 status = NETDEV_TX_OK;
508 return status;
512 * et131x_tx_timeout - Timeout handler
513 * @netdev: a pointer to a net_device struct representing the device
515 * The handler called when a Tx request times out. The timeout period is
516 * specified by the 'tx_timeo" element in the net_device structure (see
517 * et131x_alloc_device() to see how this value is set).
519 void et131x_tx_timeout(struct net_device *netdev)
521 struct et131x_adapter *etdev = netdev_priv(netdev);
522 struct tcb *tcb;
523 unsigned long flags;
525 /* Just skip this part if the adapter is doing link detection */
526 if (etdev->Flags & fMP_ADAPTER_LINK_DETECTION)
527 return;
529 /* Any nonrecoverable hardware error?
530 * Checks adapter->flags for any failure in phy reading
532 if (etdev->Flags & fMP_ADAPTER_NON_RECOVER_ERROR)
533 return;
535 /* Hardware failure? */
536 if (etdev->Flags & fMP_ADAPTER_HARDWARE_ERROR) {
537 dev_err(&etdev->pdev->dev, "hardware error - reset\n");
538 return;
541 /* Is send stuck? */
542 spin_lock_irqsave(&etdev->TCBSendQLock, flags);
544 tcb = etdev->tx_ring.send_head;
546 if (tcb != NULL) {
547 tcb->count++;
549 if (tcb->count > NIC_SEND_HANG_THRESHOLD) {
550 spin_unlock_irqrestore(&etdev->TCBSendQLock,
551 flags);
553 dev_warn(&etdev->pdev->dev,
554 "Send stuck - reset. tcb->WrIndex %x, Flags 0x%08x\n",
555 tcb->index,
556 tcb->flags);
558 et131x_close(netdev);
559 et131x_open(netdev);
561 return;
565 spin_unlock_irqrestore(&etdev->TCBSendQLock, flags);
569 * et131x_change_mtu - The handler called to change the MTU for the device
570 * @netdev: device whose MTU is to be changed
571 * @new_mtu: the desired MTU
573 * Returns 0 on success, errno on failure (as defined in errno.h)
575 int et131x_change_mtu(struct net_device *netdev, int new_mtu)
577 int result = 0;
578 struct et131x_adapter *adapter = netdev_priv(netdev);
580 /* Make sure the requested MTU is valid */
581 if (new_mtu < 64 || new_mtu > 9216)
582 return -EINVAL;
584 /* Stop the netif queue */
585 netif_stop_queue(netdev);
587 /* Stop the Tx and Rx DMA engines */
588 et131x_rx_dma_disable(adapter);
589 et131x_tx_dma_disable(adapter);
591 /* Disable device interrupts */
592 et131x_disable_interrupts(adapter);
593 et131x_handle_send_interrupt(adapter);
594 et131x_handle_recv_interrupt(adapter);
596 /* Set the new MTU */
597 netdev->mtu = new_mtu;
599 /* Free Rx DMA memory */
600 et131x_adapter_memory_free(adapter);
602 /* Set the config parameter for Jumbo Packet support */
603 adapter->RegistryJumboPacket = new_mtu + 14;
604 et131x_soft_reset(adapter);
606 /* Alloc and init Rx DMA memory */
607 result = et131x_adapter_memory_alloc(adapter);
608 if (result != 0) {
609 dev_warn(&adapter->pdev->dev,
610 "Change MTU failed; couldn't re-alloc DMA memory\n");
611 return result;
614 et131x_init_send(adapter);
616 et131x_hwaddr_init(adapter);
617 memcpy(netdev->dev_addr, adapter->CurrentAddress, ETH_ALEN);
619 /* Init the device with the new settings */
620 et131x_adapter_setup(adapter);
622 /* Enable interrupts */
623 if (adapter->Flags & fMP_ADAPTER_INTERRUPT_IN_USE)
624 et131x_enable_interrupts(adapter);
626 /* Restart the Tx and Rx DMA engines */
627 et131x_rx_dma_enable(adapter);
628 et131x_tx_dma_enable(adapter);
630 /* Restart the netif queue */
631 netif_wake_queue(netdev);
632 return result;
636 * et131x_set_mac_addr - handler to change the MAC address for the device
637 * @netdev: device whose MAC is to be changed
638 * @new_mac: the desired MAC address
640 * Returns 0 on success, errno on failure (as defined in errno.h)
642 * IMPLEMENTED BY : blux http://berndlux.de 22.01.2007 21:14
644 int et131x_set_mac_addr(struct net_device *netdev, void *new_mac)
646 int result = 0;
647 struct et131x_adapter *adapter = netdev_priv(netdev);
648 struct sockaddr *address = new_mac;
650 /* begin blux */
652 if (adapter == NULL)
653 return -ENODEV;
655 /* Make sure the requested MAC is valid */
656 if (!is_valid_ether_addr(address->sa_data))
657 return -EINVAL;
659 /* Stop the netif queue */
660 netif_stop_queue(netdev);
662 /* Stop the Tx and Rx DMA engines */
663 et131x_rx_dma_disable(adapter);
664 et131x_tx_dma_disable(adapter);
666 /* Disable device interrupts */
667 et131x_disable_interrupts(adapter);
668 et131x_handle_send_interrupt(adapter);
669 et131x_handle_recv_interrupt(adapter);
671 /* Set the new MAC */
672 /* netdev->set_mac_address = &new_mac; */
673 /* netdev->mtu = new_mtu; */
675 memcpy(netdev->dev_addr, address->sa_data, netdev->addr_len);
677 printk(KERN_INFO
678 "%s: Setting MAC address to %02x:%02x:%02x:%02x:%02x:%02x\n",
679 netdev->name,
680 netdev->dev_addr[0], netdev->dev_addr[1],
681 netdev->dev_addr[2], netdev->dev_addr[3],
682 netdev->dev_addr[4], netdev->dev_addr[5]);
684 /* Free Rx DMA memory */
685 et131x_adapter_memory_free(adapter);
687 /* Set the config parameter for Jumbo Packet support */
688 /* adapter->RegistryJumboPacket = new_mtu + 14; */
689 /* blux: not needet here, we'll change the MAC */
691 et131x_soft_reset(adapter);
693 /* Alloc and init Rx DMA memory */
694 result = et131x_adapter_memory_alloc(adapter);
695 if (result != 0) {
696 dev_err(&adapter->pdev->dev,
697 "Change MAC failed; couldn't re-alloc DMA memory\n");
698 return result;
701 et131x_init_send(adapter);
703 et131x_hwaddr_init(adapter);
705 /* Init the device with the new settings */
706 et131x_adapter_setup(adapter);
708 /* Enable interrupts */
709 if (adapter->Flags & fMP_ADAPTER_INTERRUPT_IN_USE)
710 et131x_enable_interrupts(adapter);
712 /* Restart the Tx and Rx DMA engines */
713 et131x_rx_dma_enable(adapter);
714 et131x_tx_dma_enable(adapter);
716 /* Restart the netif queue */
717 netif_wake_queue(netdev);
718 return result;