aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/typhoon.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/typhoon.c')
-rw-r--r--drivers/net/typhoon.c37
1 files changed, 16 insertions, 21 deletions
diff --git a/drivers/net/typhoon.c b/drivers/net/typhoon.c
index e49e8b520c2..d5c32e9caa9 100644
--- a/drivers/net/typhoon.c
+++ b/drivers/net/typhoon.c
@@ -86,7 +86,7 @@ static const int multicast_filter_limit = 32;
86#define RESPONSE_RING_SIZE (RESPONSE_ENTRIES * sizeof(struct resp_desc)) 86#define RESPONSE_RING_SIZE (RESPONSE_ENTRIES * sizeof(struct resp_desc))
87 87
88/* The 3XP will preload and remove 64 entries from the free buffer 88/* The 3XP will preload and remove 64 entries from the free buffer
89 * list, and we need one entry to keep the ring from wrapping, so 89 * list, and we need one entry to keep the ring from wrapping, so
90 * to keep this a power of two, we use 128 entries. 90 * to keep this a power of two, we use 128 entries.
91 */ 91 */
92#define RXFREE_ENTRIES 128 92#define RXFREE_ENTRIES 128
@@ -100,8 +100,8 @@ static const int multicast_filter_limit = 32;
100#define PKT_BUF_SZ 1536 100#define PKT_BUF_SZ 1536
101 101
102#define DRV_MODULE_NAME "typhoon" 102#define DRV_MODULE_NAME "typhoon"
103#define DRV_MODULE_VERSION "1.5.7" 103#define DRV_MODULE_VERSION "1.5.8"
104#define DRV_MODULE_RELDATE "05/01/07" 104#define DRV_MODULE_RELDATE "06/11/09"
105#define PFX DRV_MODULE_NAME ": " 105#define PFX DRV_MODULE_NAME ": "
106#define ERR_PFX KERN_ERR PFX 106#define ERR_PFX KERN_ERR PFX
107 107
@@ -269,7 +269,7 @@ struct rxbuff_ent {
269 269
270struct typhoon { 270struct typhoon {
271 /* Tx cache line section */ 271 /* Tx cache line section */
272 struct transmit_ring txLoRing ____cacheline_aligned; 272 struct transmit_ring txLoRing ____cacheline_aligned;
273 struct pci_dev * tx_pdev; 273 struct pci_dev * tx_pdev;
274 void __iomem *tx_ioaddr; 274 void __iomem *tx_ioaddr;
275 u32 txlo_dma_addr; 275 u32 txlo_dma_addr;
@@ -333,11 +333,7 @@ enum state_values {
333#define TYPHOON_RESET_TIMEOUT_NOSLEEP ((6 * 1000000) / TYPHOON_UDELAY) 333#define TYPHOON_RESET_TIMEOUT_NOSLEEP ((6 * 1000000) / TYPHOON_UDELAY)
334#define TYPHOON_WAIT_TIMEOUT ((1000000 / 2) / TYPHOON_UDELAY) 334#define TYPHOON_WAIT_TIMEOUT ((1000000 / 2) / TYPHOON_UDELAY)
335 335
336#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 28)
337#define typhoon_synchronize_irq(x) synchronize_irq()
338#else
339#define typhoon_synchronize_irq(x) synchronize_irq(x) 336#define typhoon_synchronize_irq(x) synchronize_irq(x)
340#endif
341 337
342#if defined(NETIF_F_TSO) 338#if defined(NETIF_F_TSO)
343#define skb_tso_size(x) (skb_shinfo(x)->gso_size) 339#define skb_tso_size(x) (skb_shinfo(x)->gso_size)
@@ -805,7 +801,7 @@ typhoon_start_tx(struct sk_buff *skb, struct net_device *dev)
805 * If problems develop with TSO, check this first. 801 * If problems develop with TSO, check this first.
806 */ 802 */
807 numDesc = skb_shinfo(skb)->nr_frags + 1; 803 numDesc = skb_shinfo(skb)->nr_frags + 1;
808 if(skb_tso_size(skb)) 804 if (skb_is_gso(skb))
809 numDesc++; 805 numDesc++;
810 806
811 /* When checking for free space in the ring, we need to also 807 /* When checking for free space in the ring, we need to also
@@ -830,7 +826,7 @@ typhoon_start_tx(struct sk_buff *skb, struct net_device *dev)
830 first_txd->addrHi = (u64)((unsigned long) skb) >> 32; 826 first_txd->addrHi = (u64)((unsigned long) skb) >> 32;
831 first_txd->processFlags = 0; 827 first_txd->processFlags = 0;
832 828
833 if(skb->ip_summed == CHECKSUM_HW) { 829 if(skb->ip_summed == CHECKSUM_PARTIAL) {
834 /* The 3XP will figure out if this is UDP/TCP */ 830 /* The 3XP will figure out if this is UDP/TCP */
835 first_txd->processFlags |= TYPHOON_TX_PF_TCP_CHKSUM; 831 first_txd->processFlags |= TYPHOON_TX_PF_TCP_CHKSUM;
836 first_txd->processFlags |= TYPHOON_TX_PF_UDP_CHKSUM; 832 first_txd->processFlags |= TYPHOON_TX_PF_UDP_CHKSUM;
@@ -845,7 +841,7 @@ typhoon_start_tx(struct sk_buff *skb, struct net_device *dev)
845 TYPHOON_TX_PF_VLAN_TAG_SHIFT); 841 TYPHOON_TX_PF_VLAN_TAG_SHIFT);
846 } 842 }
847 843
848 if(skb_tso_size(skb)) { 844 if (skb_is_gso(skb)) {
849 first_txd->processFlags |= TYPHOON_TX_PF_TCP_SEGMENT; 845 first_txd->processFlags |= TYPHOON_TX_PF_TCP_SEGMENT;
850 first_txd->numDesc++; 846 first_txd->numDesc++;
851 847
@@ -937,8 +933,6 @@ typhoon_set_rx_mode(struct net_device *dev)
937 933
938 filter = TYPHOON_RX_FILTER_DIRECTED | TYPHOON_RX_FILTER_BROADCAST; 934 filter = TYPHOON_RX_FILTER_DIRECTED | TYPHOON_RX_FILTER_BROADCAST;
939 if(dev->flags & IFF_PROMISC) { 935 if(dev->flags & IFF_PROMISC) {
940 printk(KERN_NOTICE "%s: Promiscuous mode enabled.\n",
941 dev->name);
942 filter |= TYPHOON_RX_FILTER_PROMISCOUS; 936 filter |= TYPHOON_RX_FILTER_PROMISCOUS;
943 } else if((dev->mc_count > multicast_filter_limit) || 937 } else if((dev->mc_count > multicast_filter_limit) ||
944 (dev->flags & IFF_ALLMULTI)) { 938 (dev->flags & IFF_ALLMULTI)) {
@@ -1073,7 +1067,7 @@ typhoon_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
1073 } else { 1067 } else {
1074 u32 sleep_ver = xp_resp[0].parm2; 1068 u32 sleep_ver = xp_resp[0].parm2;
1075 snprintf(info->fw_version, 32, "%02x.%03x.%03x", 1069 snprintf(info->fw_version, 32, "%02x.%03x.%03x",
1076 sleep_ver >> 24, (sleep_ver >> 12) & 0xfff, 1070 sleep_ver >> 24, (sleep_ver >> 12) & 0xfff,
1077 sleep_ver & 0xfff); 1071 sleep_ver & 0xfff);
1078 } 1072 }
1079 } 1073 }
@@ -1243,7 +1237,7 @@ typhoon_get_ringparam(struct net_device *dev, struct ethtool_ringparam *ering)
1243 ering->tx_pending = TXLO_ENTRIES - 1; 1237 ering->tx_pending = TXLO_ENTRIES - 1;
1244} 1238}
1245 1239
1246static struct ethtool_ops typhoon_ethtool_ops = { 1240static const struct ethtool_ops typhoon_ethtool_ops = {
1247 .get_settings = typhoon_get_settings, 1241 .get_settings = typhoon_get_settings,
1248 .set_settings = typhoon_set_settings, 1242 .set_settings = typhoon_set_settings,
1249 .get_drvinfo = typhoon_get_drvinfo, 1243 .get_drvinfo = typhoon_get_drvinfo,
@@ -2131,7 +2125,7 @@ typhoon_open(struct net_device *dev)
2131 goto out_sleep; 2125 goto out_sleep;
2132 } 2126 }
2133 2127
2134 err = request_irq(dev->irq, &typhoon_interrupt, SA_SHIRQ, 2128 err = request_irq(dev->irq, &typhoon_interrupt, IRQF_SHARED,
2135 dev->name, dev); 2129 dev->name, dev);
2136 if(err < 0) 2130 if(err < 0)
2137 goto out_sleep; 2131 goto out_sleep;
@@ -2154,7 +2148,7 @@ out_sleep:
2154 goto out; 2148 goto out;
2155 } 2149 }
2156 2150
2157 if(typhoon_sleep(tp, PCI_D3hot, 0) < 0) 2151 if(typhoon_sleep(tp, PCI_D3hot, 0) < 0)
2158 printk(KERN_ERR "%s: unable to go back to sleep\n", dev->name); 2152 printk(KERN_ERR "%s: unable to go back to sleep\n", dev->name);
2159 2153
2160out: 2154out:
@@ -2568,9 +2562,10 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
2568 2562
2569 pci_set_drvdata(pdev, dev); 2563 pci_set_drvdata(pdev, dev);
2570 2564
2571 printk(KERN_INFO "%s: %s at %s 0x%lx, ", 2565 printk(KERN_INFO "%s: %s at %s 0x%llx, ",
2572 dev->name, typhoon_card_info[card_id].name, 2566 dev->name, typhoon_card_info[card_id].name,
2573 use_mmio ? "MMIO" : "IO", pci_resource_start(pdev, use_mmio)); 2567 use_mmio ? "MMIO" : "IO",
2568 (unsigned long long)pci_resource_start(pdev, use_mmio));
2574 for(i = 0; i < 5; i++) 2569 for(i = 0; i < 5; i++)
2575 printk("%2.2x:", dev->dev_addr[i]); 2570 printk("%2.2x:", dev->dev_addr[i]);
2576 printk("%2.2x\n", dev->dev_addr[i]); 2571 printk("%2.2x\n", dev->dev_addr[i]);
@@ -2601,7 +2596,7 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
2601 "(%u:%04x)\n", dev->name, xp_resp[0].numDesc, 2596 "(%u:%04x)\n", dev->name, xp_resp[0].numDesc,
2602 le32_to_cpu(xp_resp[0].parm2)); 2597 le32_to_cpu(xp_resp[0].parm2));
2603 } 2598 }
2604 2599
2605 return 0; 2600 return 0;
2606 2601
2607error_out_reset: 2602error_out_reset:
@@ -2659,7 +2654,7 @@ static struct pci_driver typhoon_driver = {
2659static int __init 2654static int __init
2660typhoon_init(void) 2655typhoon_init(void)
2661{ 2656{
2662 return pci_module_init(&typhoon_driver); 2657 return pci_register_driver(&typhoon_driver);
2663} 2658}
2664 2659
2665static void __exit 2660static void __exit