smsc9420.c (9edd576d89a5b6d3e136d7dcab654d887c0d25b7) smsc9420.c (f2cedb63df14342ad40a8b5b324fc5d94a60b665)
1 /***************************************************************************
2 *
3 * Copyright (C) 2007,2008 SMSC
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.

--- 495 unchanged lines hidden (view full) ---

504 dev->dev_addr[4] = (u8)(mac_high16);
505 dev->dev_addr[5] = (u8)(mac_high16 >> 8);
506
507 if (is_valid_ether_addr(dev->dev_addr)) {
508 /* eeprom values are valid so use them */
509 smsc_dbg(PROBE, "Mac Address is read from EEPROM");
510 } else {
511 /* eeprom values are invalid, generate random MAC */
1 /***************************************************************************
2 *
3 * Copyright (C) 2007,2008 SMSC
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.

--- 495 unchanged lines hidden (view full) ---

504 dev->dev_addr[4] = (u8)(mac_high16);
505 dev->dev_addr[5] = (u8)(mac_high16 >> 8);
506
507 if (is_valid_ether_addr(dev->dev_addr)) {
508 /* eeprom values are valid so use them */
509 smsc_dbg(PROBE, "Mac Address is read from EEPROM");
510 } else {
511 /* eeprom values are invalid, generate random MAC */
512 random_ether_addr(dev->dev_addr);
512 eth_hw_addr_random(dev);
513 smsc9420_set_mac_address(dev);
513 smsc9420_set_mac_address(dev);
514 smsc_dbg(PROBE,
515 "MAC Address is set to random_ether_addr");
514 smsc_dbg(PROBE, "MAC Address is set to random");
516 }
517 }
518}
519
520static void smsc9420_stop_tx(struct smsc9420_pdata *pd)
521{
522 u32 dmac_control, mac_cr, dma_intr_ena;
523 int timeout = 1000;

--- 321 unchanged lines hidden (view full) ---

845 BUG_ON(pd->rx_buffers[index].skb);
846 BUG_ON(pd->rx_buffers[index].mapping);
847
848 if (unlikely(!skb)) {
849 smsc_warn(RX_ERR, "Failed to allocate new skb!");
850 return -ENOMEM;
851 }
852
515 }
516 }
517}
518
519static void smsc9420_stop_tx(struct smsc9420_pdata *pd)
520{
521 u32 dmac_control, mac_cr, dma_intr_ena;
522 int timeout = 1000;

--- 321 unchanged lines hidden (view full) ---

844 BUG_ON(pd->rx_buffers[index].skb);
845 BUG_ON(pd->rx_buffers[index].mapping);
846
847 if (unlikely(!skb)) {
848 smsc_warn(RX_ERR, "Failed to allocate new skb!");
849 return -ENOMEM;
850 }
851
853 skb->dev = pd->dev;
854
855 mapping = pci_map_single(pd->pdev, skb_tail_pointer(skb),
856 PKT_BUF_SZ, PCI_DMA_FROMDEVICE);
857 if (pci_dma_mapping_error(pd->pdev, mapping)) {
858 dev_kfree_skb_any(skb);
859 smsc_warn(RX_ERR, "pci_map_single failed!");
860 return -ENOMEM;
861 }
862

--- 730 unchanged lines hidden (view full) ---

1593 if (unlikely(result)) {
1594 printk(KERN_ERR "Cannot enable smsc9420\n");
1595 goto out_0;
1596 }
1597
1598 pci_set_master(pdev);
1599
1600 dev = alloc_etherdev(sizeof(*pd));
852 mapping = pci_map_single(pd->pdev, skb_tail_pointer(skb),
853 PKT_BUF_SZ, PCI_DMA_FROMDEVICE);
854 if (pci_dma_mapping_error(pd->pdev, mapping)) {
855 dev_kfree_skb_any(skb);
856 smsc_warn(RX_ERR, "pci_map_single failed!");
857 return -ENOMEM;
858 }
859

--- 730 unchanged lines hidden (view full) ---

1590 if (unlikely(result)) {
1591 printk(KERN_ERR "Cannot enable smsc9420\n");
1592 goto out_0;
1593 }
1594
1595 pci_set_master(pdev);
1596
1597 dev = alloc_etherdev(sizeof(*pd));
1601 if (!dev) {
1602 printk(KERN_ERR "ether device alloc failed\n");
1598 if (!dev)
1603 goto out_disable_pci_device_1;
1599 goto out_disable_pci_device_1;
1604 }
1605
1606 SET_NETDEV_DEV(dev, &pdev->dev);
1607
1608 if (!(pci_resource_flags(pdev, SMSC_BAR) & IORESOURCE_MEM)) {
1609 printk(KERN_ERR "Cannot find PCI device base address\n");
1610 goto out_free_netdev_2;
1611 }
1612

--- 153 unchanged lines hidden ---
1600
1601 SET_NETDEV_DEV(dev, &pdev->dev);
1602
1603 if (!(pci_resource_flags(pdev, SMSC_BAR) & IORESOURCE_MEM)) {
1604 printk(KERN_ERR "Cannot find PCI device base address\n");
1605 goto out_free_netdev_2;
1606 }
1607

--- 153 unchanged lines hidden ---