diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-05 21:44:59 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-05 21:44:59 -0500 |
commit | 15b0669072127f282896b3bef2e9df4ec5d7264f (patch) | |
tree | 8480e09bbc7c26cd5c9ef048b734664cb6fe76be /drivers | |
parent | c155b914651753f843445d2f860bc00137df5d52 (diff) | |
parent | 3537d54c0c39de5738bba8d19f128478b0b96a71 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (44 commits)
qlge: Fix sparse warnings for tx ring indexes.
qlge: Fix sparse warning regarding rx buffer queues.
qlge: Fix sparse endian warning in ql_hw_csum_setup().
qlge: Fix sparse endian warning for inbound packet control block flags.
qlge: Fix sparse warnings for byte swapping in qlge_ethool.c
myri10ge: print MAC and serial number on probe failure
pkt_sched: cls_u32: Fix locking in u32_change()
iucv: fix cpu hotplug
af_iucv: Free iucv path/socket in path_pending callback
af_iucv: avoid left over IUCV connections from failing connects
af_iucv: New error return codes for connect()
net/ehea: bitops work on unsigned longs
Revert "net: Fix for initial link state in 2.6.28"
tcp: Kill extraneous SPLICE_F_NONBLOCK checks.
tcp: don't mask EOF and socket errors on nonblocking splice receive
dccp: Integrate the TFRC library with DCCP
dccp: Clean up ccid.c after integration of CCID plugins
dccp: Lockless integration of CCID congestion-control plugins
qeth: get rid of extra argument after printk to dev_* conversion
qeth: No large send using EDDP for HiperSockets.
...
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/isdn/capi/capidrv.c | 4 | ||||
-rw-r--r-- | drivers/net/acenic.c | 117 | ||||
-rw-r--r-- | drivers/net/acenic.h | 4 | ||||
-rw-r--r-- | drivers/net/e100.c | 268 | ||||
-rw-r--r-- | drivers/net/ehea/ehea.h | 3 | ||||
-rw-r--r-- | drivers/net/ehea/ehea_main.c | 2 | ||||
-rw-r--r-- | drivers/net/enc28j60.c | 4 | ||||
-rw-r--r-- | drivers/net/myri10ge/myri10ge.c | 6 | ||||
-rw-r--r-- | drivers/net/qlge/qlge.h | 57 | ||||
-rw-r--r-- | drivers/net/qlge/qlge_dbg.c | 13 | ||||
-rw-r--r-- | drivers/net/qlge/qlge_ethtool.c | 8 | ||||
-rw-r--r-- | drivers/net/qlge/qlge_main.c | 116 | ||||
-rw-r--r-- | drivers/net/starfire.c | 54 | ||||
-rw-r--r-- | drivers/net/starfire_firmware.h | 346 | ||||
-rw-r--r-- | drivers/net/starfire_firmware.pl | 31 | ||||
-rw-r--r-- | drivers/net/tg3.c | 792 | ||||
-rw-r--r-- | drivers/net/tg3.h | 4 | ||||
-rw-r--r-- | drivers/net/tun.c | 2 | ||||
-rw-r--r-- | drivers/s390/net/qeth_core.h | 1 | ||||
-rw-r--r-- | drivers/s390/net/qeth_core_main.c | 57 | ||||
-rw-r--r-- | drivers/s390/net/qeth_l2_main.c | 8 | ||||
-rw-r--r-- | drivers/s390/net/qeth_l3_main.c | 26 |
22 files changed, 509 insertions, 1414 deletions
diff --git a/drivers/isdn/capi/capidrv.c b/drivers/isdn/capi/capidrv.c index d5b4cc357a3c..650120261abf 100644 --- a/drivers/isdn/capi/capidrv.c +++ b/drivers/isdn/capi/capidrv.c | |||
@@ -1519,7 +1519,7 @@ static int decodeFVteln(char *teln, unsigned long *bmaskp, int *activep) | |||
1519 | int digit2 = 0; | 1519 | int digit2 = 0; |
1520 | if (!isdigit(*s)) return -3; | 1520 | if (!isdigit(*s)) return -3; |
1521 | while (isdigit(*s)) { digit1 = digit1*10 + (*s - '0'); s++; } | 1521 | while (isdigit(*s)) { digit1 = digit1*10 + (*s - '0'); s++; } |
1522 | if (digit1 <= 0 && digit1 > 30) return -4; | 1522 | if (digit1 <= 0 || digit1 > 30) return -4; |
1523 | if (*s == 0 || *s == ',' || *s == ' ') { | 1523 | if (*s == 0 || *s == ',' || *s == ' ') { |
1524 | bmask |= (1 << digit1); | 1524 | bmask |= (1 << digit1); |
1525 | digit1 = 0; | 1525 | digit1 = 0; |
@@ -1530,7 +1530,7 @@ static int decodeFVteln(char *teln, unsigned long *bmaskp, int *activep) | |||
1530 | s++; | 1530 | s++; |
1531 | if (!isdigit(*s)) return -3; | 1531 | if (!isdigit(*s)) return -3; |
1532 | while (isdigit(*s)) { digit2 = digit2*10 + (*s - '0'); s++; } | 1532 | while (isdigit(*s)) { digit2 = digit2*10 + (*s - '0'); s++; } |
1533 | if (digit2 <= 0 && digit2 > 30) return -4; | 1533 | if (digit2 <= 0 || digit2 > 30) return -4; |
1534 | if (*s == 0 || *s == ',' || *s == ' ') { | 1534 | if (*s == 0 || *s == ',' || *s == ' ') { |
1535 | if (digit1 > digit2) | 1535 | if (digit1 > digit2) |
1536 | for (i = digit2; i <= digit1 ; i++) | 1536 | for (i = digit2; i <= digit1 ; i++) |
diff --git a/drivers/net/acenic.c b/drivers/net/acenic.c index 517fce48d94a..5b396ff6c83f 100644 --- a/drivers/net/acenic.c +++ b/drivers/net/acenic.c | |||
@@ -66,6 +66,7 @@ | |||
66 | #include <linux/mm.h> | 66 | #include <linux/mm.h> |
67 | #include <linux/highmem.h> | 67 | #include <linux/highmem.h> |
68 | #include <linux/sockios.h> | 68 | #include <linux/sockios.h> |
69 | #include <linux/firmware.h> | ||
69 | 70 | ||
70 | #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) | 71 | #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) |
71 | #include <linux/if_vlan.h> | 72 | #include <linux/if_vlan.h> |
@@ -186,8 +187,6 @@ MODULE_DEVICE_TABLE(pci, acenic_pci_tbl); | |||
186 | #define MAX_RODATA_LEN 8*1024 | 187 | #define MAX_RODATA_LEN 8*1024 |
187 | #define MAX_DATA_LEN 2*1024 | 188 | #define MAX_DATA_LEN 2*1024 |
188 | 189 | ||
189 | #include "acenic_firmware.h" | ||
190 | |||
191 | #ifndef tigon2FwReleaseLocal | 190 | #ifndef tigon2FwReleaseLocal |
192 | #define tigon2FwReleaseLocal 0 | 191 | #define tigon2FwReleaseLocal 0 |
193 | #endif | 192 | #endif |
@@ -417,6 +416,10 @@ static int dis_pci_mem_inval[ACE_MAX_MOD_PARMS] = {1, 1, 1, 1, 1, 1, 1, 1}; | |||
417 | MODULE_AUTHOR("Jes Sorensen <jes@trained-monkey.org>"); | 416 | MODULE_AUTHOR("Jes Sorensen <jes@trained-monkey.org>"); |
418 | MODULE_LICENSE("GPL"); | 417 | MODULE_LICENSE("GPL"); |
419 | MODULE_DESCRIPTION("AceNIC/3C985/GA620 Gigabit Ethernet driver"); | 418 | MODULE_DESCRIPTION("AceNIC/3C985/GA620 Gigabit Ethernet driver"); |
419 | #ifndef CONFIG_ACENIC_OMIT_TIGON_I | ||
420 | MODULE_FIRMWARE("acenic/tg1.bin"); | ||
421 | #endif | ||
422 | MODULE_FIRMWARE("acenic/tg2.bin"); | ||
420 | 423 | ||
421 | module_param_array_named(link, link_state, int, NULL, 0); | 424 | module_param_array_named(link, link_state, int, NULL, 0); |
422 | module_param_array(trace, int, NULL, 0); | 425 | module_param_array(trace, int, NULL, 0); |
@@ -943,8 +946,8 @@ static int __devinit ace_init(struct net_device *dev) | |||
943 | case 4: | 946 | case 4: |
944 | case 5: | 947 | case 5: |
945 | printk(KERN_INFO " Tigon I (Rev. %i), Firmware: %i.%i.%i, ", | 948 | printk(KERN_INFO " Tigon I (Rev. %i), Firmware: %i.%i.%i, ", |
946 | tig_ver, tigonFwReleaseMajor, tigonFwReleaseMinor, | 949 | tig_ver, ap->firmware_major, ap->firmware_minor, |
947 | tigonFwReleaseFix); | 950 | ap->firmware_fix); |
948 | writel(0, ®s->LocalCtrl); | 951 | writel(0, ®s->LocalCtrl); |
949 | ap->version = 1; | 952 | ap->version = 1; |
950 | ap->tx_ring_entries = TIGON_I_TX_RING_ENTRIES; | 953 | ap->tx_ring_entries = TIGON_I_TX_RING_ENTRIES; |
@@ -952,8 +955,8 @@ static int __devinit ace_init(struct net_device *dev) | |||
952 | #endif | 955 | #endif |
953 | case 6: | 956 | case 6: |
954 | printk(KERN_INFO " Tigon II (Rev. %i), Firmware: %i.%i.%i, ", | 957 | printk(KERN_INFO " Tigon II (Rev. %i), Firmware: %i.%i.%i, ", |
955 | tig_ver, tigon2FwReleaseMajor, tigon2FwReleaseMinor, | 958 | tig_ver, ap->firmware_major, ap->firmware_minor, |
956 | tigon2FwReleaseFix); | 959 | ap->firmware_fix); |
957 | writel(readl(®s->CpuBCtrl) | CPU_HALT, ®s->CpuBCtrl); | 960 | writel(readl(®s->CpuBCtrl) | CPU_HALT, ®s->CpuBCtrl); |
958 | readl(®s->CpuBCtrl); /* PCI write posting */ | 961 | readl(®s->CpuBCtrl); /* PCI write posting */ |
959 | /* | 962 | /* |
@@ -1205,7 +1208,9 @@ static int __devinit ace_init(struct net_device *dev) | |||
1205 | memset(ap->info, 0, sizeof(struct ace_info)); | 1208 | memset(ap->info, 0, sizeof(struct ace_info)); |
1206 | memset(ap->skb, 0, sizeof(struct ace_skb)); | 1209 | memset(ap->skb, 0, sizeof(struct ace_skb)); |
1207 | 1210 | ||
1208 | ace_load_firmware(dev); | 1211 | if (ace_load_firmware(dev)) |
1212 | goto init_error; | ||
1213 | |||
1209 | ap->fw_running = 0; | 1214 | ap->fw_running = 0; |
1210 | 1215 | ||
1211 | tmp_ptr = ap->info_dma; | 1216 | tmp_ptr = ap->info_dma; |
@@ -1441,10 +1446,7 @@ static int __devinit ace_init(struct net_device *dev) | |||
1441 | if (ap->version >= 2) | 1446 | if (ap->version >= 2) |
1442 | writel(tmp, ®s->TuneFastLink); | 1447 | writel(tmp, ®s->TuneFastLink); |
1443 | 1448 | ||
1444 | if (ACE_IS_TIGON_I(ap)) | 1449 | writel(ap->firmware_start, ®s->Pc); |
1445 | writel(tigonFwStartAddr, ®s->Pc); | ||
1446 | if (ap->version == 2) | ||
1447 | writel(tigon2FwStartAddr, ®s->Pc); | ||
1448 | 1450 | ||
1449 | writel(0, ®s->Mb0Lo); | 1451 | writel(0, ®s->Mb0Lo); |
1450 | 1452 | ||
@@ -2761,8 +2763,8 @@ static void ace_get_drvinfo(struct net_device *dev, | |||
2761 | 2763 | ||
2762 | strlcpy(info->driver, "acenic", sizeof(info->driver)); | 2764 | strlcpy(info->driver, "acenic", sizeof(info->driver)); |
2763 | snprintf(info->version, sizeof(info->version), "%i.%i.%i", | 2765 | snprintf(info->version, sizeof(info->version), "%i.%i.%i", |
2764 | tigonFwReleaseMajor, tigonFwReleaseMinor, | 2766 | ap->firmware_major, ap->firmware_minor, |
2765 | tigonFwReleaseFix); | 2767 | ap->firmware_fix); |
2766 | 2768 | ||
2767 | if (ap->pdev) | 2769 | if (ap->pdev) |
2768 | strlcpy(info->bus_info, pci_name(ap->pdev), | 2770 | strlcpy(info->bus_info, pci_name(ap->pdev), |
@@ -2869,11 +2871,10 @@ static struct net_device_stats *ace_get_stats(struct net_device *dev) | |||
2869 | } | 2871 | } |
2870 | 2872 | ||
2871 | 2873 | ||
2872 | static void __devinit ace_copy(struct ace_regs __iomem *regs, void *src, | 2874 | static void __devinit ace_copy(struct ace_regs __iomem *regs, const __be32 *src, |
2873 | u32 dest, int size) | 2875 | u32 dest, int size) |
2874 | { | 2876 | { |
2875 | void __iomem *tdest; | 2877 | void __iomem *tdest; |
2876 | u32 *wsrc; | ||
2877 | short tsize, i; | 2878 | short tsize, i; |
2878 | 2879 | ||
2879 | if (size <= 0) | 2880 | if (size <= 0) |
@@ -2885,20 +2886,15 @@ static void __devinit ace_copy(struct ace_regs __iomem *regs, void *src, | |||
2885 | tdest = (void __iomem *) ®s->Window + | 2886 | tdest = (void __iomem *) ®s->Window + |
2886 | (dest & (ACE_WINDOW_SIZE - 1)); | 2887 | (dest & (ACE_WINDOW_SIZE - 1)); |
2887 | writel(dest & ~(ACE_WINDOW_SIZE - 1), ®s->WinBase); | 2888 | writel(dest & ~(ACE_WINDOW_SIZE - 1), ®s->WinBase); |
2888 | /* | ||
2889 | * This requires byte swapping on big endian, however | ||
2890 | * writel does that for us | ||
2891 | */ | ||
2892 | wsrc = src; | ||
2893 | for (i = 0; i < (tsize / 4); i++) { | 2889 | for (i = 0; i < (tsize / 4); i++) { |
2894 | writel(wsrc[i], tdest + i*4); | 2890 | /* Firmware is big-endian */ |
2891 | writel(be32_to_cpup(src), tdest); | ||
2892 | src++; | ||
2893 | tdest += 4; | ||
2894 | dest += 4; | ||
2895 | size -= 4; | ||
2895 | } | 2896 | } |
2896 | dest += tsize; | ||
2897 | src += tsize; | ||
2898 | size -= tsize; | ||
2899 | } | 2897 | } |
2900 | |||
2901 | return; | ||
2902 | } | 2898 | } |
2903 | 2899 | ||
2904 | 2900 | ||
@@ -2937,8 +2933,13 @@ static void __devinit ace_clear(struct ace_regs __iomem *regs, u32 dest, int siz | |||
2937 | */ | 2933 | */ |
2938 | static int __devinit ace_load_firmware(struct net_device *dev) | 2934 | static int __devinit ace_load_firmware(struct net_device *dev) |
2939 | { | 2935 | { |
2936 | const struct firmware *fw; | ||
2937 | const char *fw_name = "acenic/tg2.bin"; | ||
2940 | struct ace_private *ap = netdev_priv(dev); | 2938 | struct ace_private *ap = netdev_priv(dev); |
2941 | struct ace_regs __iomem *regs = ap->regs; | 2939 | struct ace_regs __iomem *regs = ap->regs; |
2940 | const __be32 *fw_data; | ||
2941 | u32 load_addr; | ||
2942 | int ret; | ||
2942 | 2943 | ||
2943 | if (!(readl(®s->CpuCtrl) & CPU_HALTED)) { | 2944 | if (!(readl(®s->CpuCtrl) & CPU_HALTED)) { |
2944 | printk(KERN_ERR "%s: trying to download firmware while the " | 2945 | printk(KERN_ERR "%s: trying to download firmware while the " |
@@ -2946,28 +2947,52 @@ static int __devinit ace_load_firmware(struct net_device *dev) | |||
2946 | return -EFAULT; | 2947 | return -EFAULT; |
2947 | } | 2948 | } |
2948 | 2949 | ||
2950 | if (ACE_IS_TIGON_I(ap)) | ||
2951 | fw_name = "acenic/tg1.bin"; | ||
2952 | |||
2953 | ret = request_firmware(&fw, fw_name, &ap->pdev->dev); | ||
2954 | if (ret) { | ||
2955 | printk(KERN_ERR "%s: Failed to load firmware \"%s\"\n", | ||
2956 | ap->name, fw_name); | ||
2957 | return ret; | ||
2958 | } | ||
2959 | |||
2960 | fw_data = (void *)fw->data; | ||
2961 | |||
2962 | /* Firmware blob starts with version numbers, followed by | ||
2963 | load and start address. Remainder is the blob to be loaded | ||
2964 | contiguously from load address. We don't bother to represent | ||
2965 | the BSS/SBSS sections any more, since we were clearing the | ||
2966 | whole thing anyway. */ | ||
2967 | ap->firmware_major = fw->data[0]; | ||
2968 | ap->firmware_minor = fw->data[1]; | ||
2969 | ap->firmware_fix = fw->data[2]; | ||
2970 | |||
2971 | ap->firmware_start = be32_to_cpu(fw_data[1]); | ||
2972 | if (ap->firmware_start < 0x4000 || ap->firmware_start >= 0x80000) { | ||
2973 | printk(KERN_ERR "%s: bogus load address %08x in \"%s\"\n", | ||
2974 | ap->name, ap->firmware_start, fw_name); | ||
2975 | ret = -EINVAL; | ||
2976 | goto out; | ||
2977 | } | ||
2978 | |||
2979 | load_addr = be32_to_cpu(fw_data[2]); | ||
2980 | if (load_addr < 0x4000 || load_addr >= 0x80000) { | ||
2981 | printk(KERN_ERR "%s: bogus load address %08x in \"%s\"\n", | ||
2982 | ap->name, load_addr, fw_name); | ||
2983 | ret = -EINVAL; | ||
2984 | goto out; | ||
2985 | } | ||
2986 | |||
2949 | /* | 2987 | /* |
2950 | * Do not try to clear more than 512KB or we end up seeing | 2988 | * Do not try to clear more than 512KiB or we end up seeing |
2951 | * funny things on NICs with only 512KB SRAM | 2989 | * funny things on NICs with only 512KiB SRAM |
2952 | */ | 2990 | */ |
2953 | ace_clear(regs, 0x2000, 0x80000-0x2000); | 2991 | ace_clear(regs, 0x2000, 0x80000-0x2000); |
2954 | if (ACE_IS_TIGON_I(ap)) { | 2992 | ace_copy(regs, &fw_data[3], load_addr, fw->size-12); |
2955 | ace_copy(regs, tigonFwText, tigonFwTextAddr, tigonFwTextLen); | 2993 | out: |
2956 | ace_copy(regs, tigonFwData, tigonFwDataAddr, tigonFwDataLen); | 2994 | release_firmware(fw); |
2957 | ace_copy(regs, tigonFwRodata, tigonFwRodataAddr, | 2995 | return ret; |
2958 | tigonFwRodataLen); | ||
2959 | ace_clear(regs, tigonFwBssAddr, tigonFwBssLen); | ||
2960 | ace_clear(regs, tigonFwSbssAddr, tigonFwSbssLen); | ||
2961 | }else if (ap->version == 2) { | ||
2962 | ace_clear(regs, tigon2FwBssAddr, tigon2FwBssLen); | ||
2963 | ace_clear(regs, tigon2FwSbssAddr, tigon2FwSbssLen); | ||
2964 | ace_copy(regs, tigon2FwText, tigon2FwTextAddr,tigon2FwTextLen); | ||
2965 | ace_copy(regs, tigon2FwRodata, tigon2FwRodataAddr, | ||
2966 | tigon2FwRodataLen); | ||
2967 | ace_copy(regs, tigon2FwData, tigon2FwDataAddr,tigon2FwDataLen); | ||
2968 | } | ||
2969 | |||
2970 | return 0; | ||
2971 | } | 2996 | } |
2972 | 2997 | ||
2973 | 2998 | ||
diff --git a/drivers/net/acenic.h b/drivers/net/acenic.h index 4487f32759a4..c987c9b5a137 100644 --- a/drivers/net/acenic.h +++ b/drivers/net/acenic.h | |||
@@ -694,6 +694,10 @@ struct ace_private | |||
694 | u32 last_tx, last_std_rx, last_mini_rx; | 694 | u32 last_tx, last_std_rx, last_mini_rx; |
695 | #endif | 695 | #endif |
696 | int pci_using_dac; | 696 | int pci_using_dac; |
697 | u8 firmware_major; | ||
698 | u8 firmware_minor; | ||
699 | u8 firmware_fix; | ||
700 | u32 firmware_start; | ||
697 | }; | 701 | }; |
698 | 702 | ||
699 | 703 | ||
diff --git a/drivers/net/e100.c b/drivers/net/e100.c index 9f38b16ccbbd..134b2d60b479 100644 --- a/drivers/net/e100.c +++ b/drivers/net/e100.c | |||
@@ -658,12 +658,12 @@ static int e100_self_test(struct nic *nic) | |||
658 | e100_disable_irq(nic); | 658 | e100_disable_irq(nic); |
659 | 659 | ||
660 | /* Check results of self-test */ | 660 | /* Check results of self-test */ |
661 | if(nic->mem->selftest.result != 0) { | 661 | if (nic->mem->selftest.result != 0) { |
662 | DPRINTK(HW, ERR, "Self-test failed: result=0x%08X\n", | 662 | DPRINTK(HW, ERR, "Self-test failed: result=0x%08X\n", |
663 | nic->mem->selftest.result); | 663 | nic->mem->selftest.result); |
664 | return -ETIMEDOUT; | 664 | return -ETIMEDOUT; |
665 | } | 665 | } |
666 | if(nic->mem->selftest.signature == 0) { | 666 | if (nic->mem->selftest.signature == 0) { |
667 | DPRINTK(HW, ERR, "Self-test failed: timed out\n"); | 667 | DPRINTK(HW, ERR, "Self-test failed: timed out\n"); |
668 | return -ETIMEDOUT; | 668 | return -ETIMEDOUT; |
669 | } | 669 | } |
@@ -684,13 +684,13 @@ static void e100_eeprom_write(struct nic *nic, u16 addr_len, u16 addr, __le16 da | |||
684 | cmd_addr_data[2] = op_ewds << (addr_len - 2); | 684 | cmd_addr_data[2] = op_ewds << (addr_len - 2); |
685 | 685 | ||
686 | /* Bit-bang cmds to write word to eeprom */ | 686 | /* Bit-bang cmds to write word to eeprom */ |
687 | for(j = 0; j < 3; j++) { | 687 | for (j = 0; j < 3; j++) { |
688 | 688 | ||
689 | /* Chip select */ | 689 | /* Chip select */ |
690 | iowrite8(eecs | eesk, &nic->csr->eeprom_ctrl_lo); | 690 | iowrite8(eecs | eesk, &nic->csr->eeprom_ctrl_lo); |
691 | e100_write_flush(nic); udelay(4); | 691 | e100_write_flush(nic); udelay(4); |
692 | 692 | ||
693 | for(i = 31; i >= 0; i--) { | 693 | for (i = 31; i >= 0; i--) { |
694 | ctrl = (cmd_addr_data[j] & (1 << i)) ? | 694 | ctrl = (cmd_addr_data[j] & (1 << i)) ? |
695 | eecs | eedi : eecs; | 695 | eecs | eedi : eecs; |
696 | iowrite8(ctrl, &nic->csr->eeprom_ctrl_lo); | 696 | iowrite8(ctrl, &nic->csr->eeprom_ctrl_lo); |
@@ -723,7 +723,7 @@ static __le16 e100_eeprom_read(struct nic *nic, u16 *addr_len, u16 addr) | |||
723 | e100_write_flush(nic); udelay(4); | 723 | e100_write_flush(nic); udelay(4); |
724 | 724 | ||
725 | /* Bit-bang to read word from eeprom */ | 725 | /* Bit-bang to read word from eeprom */ |
726 | for(i = 31; i >= 0; i--) { | 726 | for (i = 31; i >= 0; i--) { |
727 | ctrl = (cmd_addr_data & (1 << i)) ? eecs | eedi : eecs; | 727 | ctrl = (cmd_addr_data & (1 << i)) ? eecs | eedi : eecs; |
728 | iowrite8(ctrl, &nic->csr->eeprom_ctrl_lo); | 728 | iowrite8(ctrl, &nic->csr->eeprom_ctrl_lo); |
729 | e100_write_flush(nic); udelay(4); | 729 | e100_write_flush(nic); udelay(4); |
@@ -734,7 +734,7 @@ static __le16 e100_eeprom_read(struct nic *nic, u16 *addr_len, u16 addr) | |||
734 | /* Eeprom drives a dummy zero to EEDO after receiving | 734 | /* Eeprom drives a dummy zero to EEDO after receiving |
735 | * complete address. Use this to adjust addr_len. */ | 735 | * complete address. Use this to adjust addr_len. */ |
736 | ctrl = ioread8(&nic->csr->eeprom_ctrl_lo); | 736 | ctrl = ioread8(&nic->csr->eeprom_ctrl_lo); |
737 | if(!(ctrl & eedo) && i > 16) { | 737 | if (!(ctrl & eedo) && i > 16) { |
738 | *addr_len -= (i - 16); | 738 | *addr_len -= (i - 16); |
739 | i = 17; | 739 | i = 17; |
740 | } | 740 | } |
@@ -758,9 +758,9 @@ static int e100_eeprom_load(struct nic *nic) | |||
758 | e100_eeprom_read(nic, &addr_len, 0); | 758 | e100_eeprom_read(nic, &addr_len, 0); |
759 | nic->eeprom_wc = 1 << addr_len; | 759 | nic->eeprom_wc = 1 << addr_len; |
760 | 760 | ||
761 | for(addr = 0; addr < nic->eeprom_wc; addr++) { | 761 | for (addr = 0; addr < nic->eeprom_wc; addr++) { |
762 | nic->eeprom[addr] = e100_eeprom_read(nic, &addr_len, addr); | 762 | nic->eeprom[addr] = e100_eeprom_read(nic, &addr_len, addr); |
763 | if(addr < nic->eeprom_wc - 1) | 763 | if (addr < nic->eeprom_wc - 1) |
764 | checksum += le16_to_cpu(nic->eeprom[addr]); | 764 | checksum += le16_to_cpu(nic->eeprom[addr]); |
765 | } | 765 | } |
766 | 766 | ||
@@ -784,15 +784,15 @@ static int e100_eeprom_save(struct nic *nic, u16 start, u16 count) | |||
784 | e100_eeprom_read(nic, &addr_len, 0); | 784 | e100_eeprom_read(nic, &addr_len, 0); |
785 | nic->eeprom_wc = 1 << addr_len; | 785 | nic->eeprom_wc = 1 << addr_len; |
786 | 786 | ||
787 | if(start + count >= nic->eeprom_wc) | 787 | if (start + count >= nic->eeprom_wc) |
788 | return -EINVAL; | 788 | return -EINVAL; |
789 | 789 | ||
790 | for(addr = start; addr < start + count; addr++) | 790 | for (addr = start; addr < start + count; addr++) |
791 | e100_eeprom_write(nic, addr_len, addr, nic->eeprom[addr]); | 791 | e100_eeprom_write(nic, addr_len, addr, nic->eeprom[addr]); |
792 | 792 | ||
793 | /* The checksum, stored in the last word, is calculated such that | 793 | /* The checksum, stored in the last word, is calculated such that |
794 | * the sum of words should be 0xBABA */ | 794 | * the sum of words should be 0xBABA */ |
795 | for(addr = 0; addr < nic->eeprom_wc - 1; addr++) | 795 | for (addr = 0; addr < nic->eeprom_wc - 1; addr++) |
796 | checksum += le16_to_cpu(nic->eeprom[addr]); | 796 | checksum += le16_to_cpu(nic->eeprom[addr]); |
797 | nic->eeprom[nic->eeprom_wc - 1] = cpu_to_le16(0xBABA - checksum); | 797 | nic->eeprom[nic->eeprom_wc - 1] = cpu_to_le16(0xBABA - checksum); |
798 | e100_eeprom_write(nic, addr_len, nic->eeprom_wc - 1, | 798 | e100_eeprom_write(nic, addr_len, nic->eeprom_wc - 1, |
@@ -812,19 +812,19 @@ static int e100_exec_cmd(struct nic *nic, u8 cmd, dma_addr_t dma_addr) | |||
812 | spin_lock_irqsave(&nic->cmd_lock, flags); | 812 | spin_lock_irqsave(&nic->cmd_lock, flags); |
813 | 813 | ||
814 | /* Previous command is accepted when SCB clears */ | 814 | /* Previous command is accepted when SCB clears */ |
815 | for(i = 0; i < E100_WAIT_SCB_TIMEOUT; i++) { | 815 | for (i = 0; i < E100_WAIT_SCB_TIMEOUT; i++) { |
816 | if(likely(!ioread8(&nic->csr->scb.cmd_lo))) | 816 | if (likely(!ioread8(&nic->csr->scb.cmd_lo))) |
817 | break; | 817 | break; |
818 | cpu_relax(); | 818 | cpu_relax(); |
819 | if(unlikely(i > E100_WAIT_SCB_FAST)) | 819 | if (unlikely(i > E100_WAIT_SCB_FAST)) |
820 | udelay(5); | 820 | udelay(5); |
821 | } | 821 | } |
822 | if(unlikely(i == E100_WAIT_SCB_TIMEOUT)) { | 822 | if (unlikely(i == E100_WAIT_SCB_TIMEOUT)) { |
823 | err = -EAGAIN; | 823 | err = -EAGAIN; |
824 | goto err_unlock; | 824 | goto err_unlock; |
825 | } | 825 | } |
826 | 826 | ||
827 | if(unlikely(cmd != cuc_resume)) | 827 | if (unlikely(cmd != cuc_resume)) |
828 | iowrite32(dma_addr, &nic->csr->scb.gen_ptr); | 828 | iowrite32(dma_addr, &nic->csr->scb.gen_ptr); |
829 | iowrite8(cmd, &nic->csr->scb.cmd_lo); | 829 | iowrite8(cmd, &nic->csr->scb.cmd_lo); |
830 | 830 | ||
@@ -843,7 +843,7 @@ static int e100_exec_cb(struct nic *nic, struct sk_buff *skb, | |||
843 | 843 | ||
844 | spin_lock_irqsave(&nic->cb_lock, flags); | 844 | spin_lock_irqsave(&nic->cb_lock, flags); |
845 | 845 | ||
846 | if(unlikely(!nic->cbs_avail)) { | 846 | if (unlikely(!nic->cbs_avail)) { |
847 | err = -ENOMEM; | 847 | err = -ENOMEM; |
848 | goto err_unlock; | 848 | goto err_unlock; |
849 | } | 849 | } |
@@ -853,7 +853,7 @@ static int e100_exec_cb(struct nic *nic, struct sk_buff *skb, | |||
853 | nic->cbs_avail--; | 853 | nic->cbs_avail--; |
854 | cb->skb = skb; | 854 | cb->skb = skb; |
855 | 855 | ||
856 | if(unlikely(!nic->cbs_avail)) | 856 | if (unlikely(!nic->cbs_avail)) |
857 | err = -ENOSPC; | 857 | err = -ENOSPC; |
858 | 858 | ||
859 | cb_prepare(nic, cb, skb); | 859 | cb_prepare(nic, cb, skb); |
@@ -864,15 +864,15 @@ static int e100_exec_cb(struct nic *nic, struct sk_buff *skb, | |||
864 | wmb(); | 864 | wmb(); |
865 | cb->prev->command &= cpu_to_le16(~cb_s); | 865 | cb->prev->command &= cpu_to_le16(~cb_s); |
866 | 866 | ||
867 | while(nic->cb_to_send != nic->cb_to_use) { | 867 | while (nic->cb_to_send != nic->cb_to_use) { |
868 | if(unlikely(e100_exec_cmd(nic, nic->cuc_cmd, | 868 | if (unlikely(e100_exec_cmd(nic, nic->cuc_cmd, |
869 | nic->cb_to_send->dma_addr))) { | 869 | nic->cb_to_send->dma_addr))) { |
870 | /* Ok, here's where things get sticky. It's | 870 | /* Ok, here's where things get sticky. It's |
871 | * possible that we can't schedule the command | 871 | * possible that we can't schedule the command |
872 | * because the controller is too busy, so | 872 | * because the controller is too busy, so |
873 | * let's just queue the command and try again | 873 | * let's just queue the command and try again |
874 | * when another command is scheduled. */ | 874 | * when another command is scheduled. */ |
875 | if(err == -ENOSPC) { | 875 | if (err == -ENOSPC) { |
876 | //request a reset | 876 | //request a reset |
877 | schedule_work(&nic->tx_timeout_task); | 877 | schedule_work(&nic->tx_timeout_task); |
878 | } | 878 | } |
@@ -945,7 +945,7 @@ static void e100_get_defaults(struct nic *nic) | |||
945 | 945 | ||
946 | /* MAC type is encoded as rev ID; exception: ICH is treated as 82559 */ | 946 | /* MAC type is encoded as rev ID; exception: ICH is treated as 82559 */ |
947 | nic->mac = (nic->flags & ich) ? mac_82559_D101M : nic->pdev->revision; | 947 | nic->mac = (nic->flags & ich) ? mac_82559_D101M : nic->pdev->revision; |
948 | if(nic->mac == mac_unknown) | 948 | if (nic->mac == mac_unknown) |
949 | nic->mac = mac_82557_D100_A; | 949 | nic->mac = mac_82557_D100_A; |
950 | 950 | ||
951 | nic->params.rfds = rfds; | 951 | nic->params.rfds = rfds; |
@@ -1008,23 +1008,23 @@ static void e100_configure(struct nic *nic, struct cb *cb, struct sk_buff *skb) | |||
1008 | config->adaptive_ifs = nic->adaptive_ifs; | 1008 | config->adaptive_ifs = nic->adaptive_ifs; |
1009 | config->loopback = nic->loopback; | 1009 | config->loopback = nic->loopback; |
1010 | 1010 | ||
1011 | if(nic->mii.force_media && nic->mii.full_duplex) | 1011 | if (nic->mii.force_media && nic->mii.full_duplex) |
1012 | config->full_duplex_force = 0x1; /* 1=force, 0=auto */ | 1012 | config->full_duplex_force = 0x1; /* 1=force, 0=auto */ |
1013 | 1013 | ||
1014 | if(nic->flags & promiscuous || nic->loopback) { | 1014 | if (nic->flags & promiscuous || nic->loopback) { |
1015 | config->rx_save_bad_frames = 0x1; /* 1=save, 0=discard */ | 1015 | config->rx_save_bad_frames = 0x1; /* 1=save, 0=discard */ |
1016 | config->rx_discard_short_frames = 0x0; /* 1=discard, 0=save */ | 1016 | config->rx_discard_short_frames = 0x0; /* 1=discard, 0=save */ |
1017 | config->promiscuous_mode = 0x1; /* 1=on, 0=off */ | 1017 | config->promiscuous_mode = 0x1; /* 1=on, 0=off */ |
1018 | } | 1018 | } |
1019 | 1019 | ||
1020 | if(nic->flags & multicast_all) | 1020 | if (nic->flags & multicast_all) |
1021 | config->multicast_all = 0x1; /* 1=accept, 0=no */ | 1021 | config->multicast_all = 0x1; /* 1=accept, 0=no */ |
1022 | 1022 | ||
1023 | /* disable WoL when up */ | 1023 | /* disable WoL when up */ |
1024 | if(netif_running(nic->netdev) || !(nic->flags & wol_magic)) | 1024 | if (netif_running(nic->netdev) || !(nic->flags & wol_magic)) |
1025 | config->magic_packet_disable = 0x1; /* 1=off, 0=on */ | 1025 | config->magic_packet_disable = 0x1; /* 1=off, 0=on */ |
1026 | 1026 | ||
1027 | if(nic->mac >= mac_82558_D101_A4) { | 1027 | if (nic->mac >= mac_82558_D101_A4) { |
1028 | config->fc_disable = 0x1; /* 1=Tx fc off, 0=Tx fc on */ | 1028 | config->fc_disable = 0x1; /* 1=Tx fc off, 0=Tx fc on */ |
1029 | config->mwi_enable = 0x1; /* 1=enable, 0=disable */ | 1029 | config->mwi_enable = 0x1; /* 1=enable, 0=disable */ |
1030 | config->standard_tcb = 0x0; /* 1=standard, 0=extended */ | 1030 | config->standard_tcb = 0x0; /* 1=standard, 0=extended */ |
@@ -1369,21 +1369,21 @@ static int e100_phy_init(struct nic *nic) | |||
1369 | u16 bmcr, stat, id_lo, id_hi, cong; | 1369 | u16 bmcr, stat, id_lo, id_hi, cong; |
1370 | 1370 | ||
1371 | /* Discover phy addr by searching addrs in order {1,0,2,..., 31} */ | 1371 | /* Discover phy addr by searching addrs in order {1,0,2,..., 31} */ |
1372 | for(addr = 0; addr < 32; addr++) { | 1372 | for (addr = 0; addr < 32; addr++) { |
1373 | nic->mii.phy_id = (addr == 0) ? 1 : (addr == 1) ? 0 : addr; | 1373 | nic->mii.phy_id = (addr == 0) ? 1 : (addr == 1) ? 0 : addr; |
1374 | bmcr = mdio_read(netdev, nic->mii.phy_id, MII_BMCR); | 1374 | bmcr = mdio_read(netdev, nic->mii.phy_id, MII_BMCR); |
1375 | stat = mdio_read(netdev, nic->mii.phy_id, MII_BMSR); | 1375 | stat = mdio_read(netdev, nic->mii.phy_id, MII_BMSR); |
1376 | stat = mdio_read(netdev, nic->mii.phy_id, MII_BMSR); | 1376 | stat = mdio_read(netdev, nic->mii.phy_id, MII_BMSR); |
1377 | if(!((bmcr == 0xFFFF) || ((stat == 0) && (bmcr == 0)))) | 1377 | if (!((bmcr == 0xFFFF) || ((stat == 0) && (bmcr == 0)))) |
1378 | break; | 1378 | break; |
1379 | } | 1379 | } |
1380 | DPRINTK(HW, DEBUG, "phy_addr = %d\n", nic->mii.phy_id); | 1380 | DPRINTK(HW, DEBUG, "phy_addr = %d\n", nic->mii.phy_id); |
1381 | if(addr == 32) | 1381 | if (addr == 32) |
1382 | return -EAGAIN; | 1382 | return -EAGAIN; |
1383 | 1383 | ||
1384 | /* Selected the phy and isolate the rest */ | 1384 | /* Selected the phy and isolate the rest */ |
1385 | for(addr = 0; addr < 32; addr++) { | 1385 | for (addr = 0; addr < 32; addr++) { |
1386 | if(addr != nic->mii.phy_id) { | 1386 | if (addr != nic->mii.phy_id) { |
1387 | mdio_write(netdev, addr, MII_BMCR, BMCR_ISOLATE); | 1387 | mdio_write(netdev, addr, MII_BMCR, BMCR_ISOLATE); |
1388 | } else { | 1388 | } else { |
1389 | bmcr = mdio_read(netdev, addr, MII_BMCR); | 1389 | bmcr = mdio_read(netdev, addr, MII_BMCR); |
@@ -1400,7 +1400,7 @@ static int e100_phy_init(struct nic *nic) | |||
1400 | 1400 | ||
1401 | /* Handle National tx phys */ | 1401 | /* Handle National tx phys */ |
1402 | #define NCS_PHY_MODEL_MASK 0xFFF0FFFF | 1402 | #define NCS_PHY_MODEL_MASK 0xFFF0FFFF |
1403 | if((nic->phy & NCS_PHY_MODEL_MASK) == phy_nsc_tx) { | 1403 | if ((nic->phy & NCS_PHY_MODEL_MASK) == phy_nsc_tx) { |
1404 | /* Disable congestion control */ | 1404 | /* Disable congestion control */ |
1405 | cong = mdio_read(netdev, nic->mii.phy_id, MII_NSC_CONG); | 1405 | cong = mdio_read(netdev, nic->mii.phy_id, MII_NSC_CONG); |
1406 | cong |= NSC_CONG_TXREADY; | 1406 | cong |= NSC_CONG_TXREADY; |
@@ -1408,7 +1408,7 @@ static int e100_phy_init(struct nic *nic) | |||
1408 | mdio_write(netdev, nic->mii.phy_id, MII_NSC_CONG, cong); | 1408 | mdio_write(netdev, nic->mii.phy_id, MII_NSC_CONG, cong); |
1409 | } | 1409 | } |
1410 | 1410 | ||
1411 | if((nic->mac >= mac_82550_D102) || ((nic->flags & ich) && | 1411 | if ((nic->mac >= mac_82550_D102) || ((nic->flags & ich) && |
1412 | (mdio_read(netdev, nic->mii.phy_id, MII_TPISTATUS) & 0x8000) && | 1412 | (mdio_read(netdev, nic->mii.phy_id, MII_TPISTATUS) & 0x8000) && |
1413 | !(nic->eeprom[eeprom_cnfg_mdix] & eeprom_mdix_enabled))) { | 1413 | !(nic->eeprom[eeprom_cnfg_mdix] & eeprom_mdix_enabled))) { |
1414 | /* enable/disable MDI/MDI-X auto-switching. */ | 1414 | /* enable/disable MDI/MDI-X auto-switching. */ |
@@ -1426,25 +1426,25 @@ static int e100_hw_init(struct nic *nic) | |||
1426 | e100_hw_reset(nic); | 1426 | e100_hw_reset(nic); |
1427 | 1427 | ||
1428 | DPRINTK(HW, ERR, "e100_hw_init\n"); | 1428 | DPRINTK(HW, ERR, "e100_hw_init\n"); |
1429 | if(!in_interrupt() && (err = e100_self_test(nic))) | 1429 | if (!in_interrupt() && (err = e100_self_test(nic))) |
1430 | return err; | 1430 | return err; |
1431 | 1431 | ||
1432 | if((err = e100_phy_init(nic))) | 1432 | if ((err = e100_phy_init(nic))) |
1433 | return err; | 1433 | return err; |
1434 | if((err = e100_exec_cmd(nic, cuc_load_base, 0))) | 1434 | if ((err = e100_exec_cmd(nic, cuc_load_base, 0))) |
1435 | return err; | 1435 | return err; |
1436 | if((err = e100_exec_cmd(nic, ruc_load_base, 0))) | 1436 | if ((err = e100_exec_cmd(nic, ruc_load_base, 0))) |
1437 | return err; | 1437 | return err; |
1438 | if ((err = e100_exec_cb_wait(nic, NULL, e100_setup_ucode))) | 1438 | if ((err = e100_exec_cb_wait(nic, NULL, e100_setup_ucode))) |
1439 | return err; | 1439 | return err; |
1440 | if((err = e100_exec_cb(nic, NULL, e100_configure))) | 1440 | if ((err = e100_exec_cb(nic, NULL, e100_configure))) |
1441 | return err; | 1441 | return err; |
1442 | if((err = e100_exec_cb(nic, NULL, e100_setup_iaaddr))) | 1442 | if ((err = e100_exec_cb(nic, NULL, e100_setup_iaaddr))) |
1443 | return err; | 1443 | return err; |
1444 | if((err = e100_exec_cmd(nic, cuc_dump_addr, | 1444 | if ((err = e100_exec_cmd(nic, cuc_dump_addr, |
1445 | nic->dma_addr + offsetof(struct mem, stats)))) | 1445 | nic->dma_addr + offsetof(struct mem, stats)))) |
1446 | return err; | 1446 | return err; |
1447 | if((err = e100_exec_cmd(nic, cuc_dump_reset, 0))) | 1447 | if ((err = e100_exec_cmd(nic, cuc_dump_reset, 0))) |
1448 | return err; | 1448 | return err; |
1449 | 1449 | ||
1450 | e100_disable_irq(nic); | 1450 | e100_disable_irq(nic); |
@@ -1460,7 +1460,7 @@ static void e100_multi(struct nic *nic, struct cb *cb, struct sk_buff *skb) | |||
1460 | 1460 | ||
1461 | cb->command = cpu_to_le16(cb_multi); | 1461 | cb->command = cpu_to_le16(cb_multi); |
1462 | cb->u.multi.count = cpu_to_le16(count * ETH_ALEN); | 1462 | cb->u.multi.count = cpu_to_le16(count * ETH_ALEN); |
1463 | for(i = 0; list && i < count; i++, list = list->next) | 1463 | for (i = 0; list && i < count; i++, list = list->next) |
1464 | memcpy(&cb->u.multi.addr[i*ETH_ALEN], &list->dmi_addr, | 1464 | memcpy(&cb->u.multi.addr[i*ETH_ALEN], &list->dmi_addr, |
1465 | ETH_ALEN); | 1465 | ETH_ALEN); |
1466 | } | 1466 | } |
@@ -1472,12 +1472,12 @@ static void e100_set_multicast_list(struct net_device *netdev) | |||
1472 | DPRINTK(HW, DEBUG, "mc_count=%d, flags=0x%04X\n", | 1472 | DPRINTK(HW, DEBUG, "mc_count=%d, flags=0x%04X\n", |
1473 | netdev->mc_count, netdev->flags); | 1473 | netdev->mc_count, netdev->flags); |
1474 | 1474 | ||
1475 | if(netdev->flags & IFF_PROMISC) | 1475 | if (netdev->flags & IFF_PROMISC) |
1476 | nic->flags |= promiscuous; | 1476 | nic->flags |= promiscuous; |
1477 | else | 1477 | else |
1478 | nic->flags &= ~promiscuous; | 1478 | nic->flags &= ~promiscuous; |
1479 | 1479 | ||
1480 | if(netdev->flags & IFF_ALLMULTI || | 1480 | if (netdev->flags & IFF_ALLMULTI || |
1481 | netdev->mc_count > E100_MAX_MULTICAST_ADDRS) | 1481 | netdev->mc_count > E100_MAX_MULTICAST_ADDRS) |
1482 | nic->flags |= multicast_all; | 1482 | nic->flags |= multicast_all; |
1483 | else | 1483 | else |
@@ -1500,7 +1500,7 @@ static void e100_update_stats(struct nic *nic) | |||
1500 | * complete, so we're always waiting for results of the | 1500 | * complete, so we're always waiting for results of the |
1501 | * previous command. */ | 1501 | * previous command. */ |
1502 | 1502 | ||
1503 | if(*complete == cpu_to_le32(cuc_dump_reset_complete)) { | 1503 | if (*complete == cpu_to_le32(cuc_dump_reset_complete)) { |
1504 | *complete = 0; | 1504 | *complete = 0; |
1505 | nic->tx_frames = le32_to_cpu(s->tx_good_frames); | 1505 | nic->tx_frames = le32_to_cpu(s->tx_good_frames); |
1506 | nic->tx_collisions = le32_to_cpu(s->tx_total_collisions); | 1506 | nic->tx_collisions = le32_to_cpu(s->tx_total_collisions); |
@@ -1527,12 +1527,12 @@ static void e100_update_stats(struct nic *nic) | |||
1527 | le32_to_cpu(s->tx_single_collisions); | 1527 | le32_to_cpu(s->tx_single_collisions); |
1528 | nic->tx_multiple_collisions += | 1528 | nic->tx_multiple_collisions += |
1529 | le32_to_cpu(s->tx_multiple_collisions); | 1529 | le32_to_cpu(s->tx_multiple_collisions); |
1530 | if(nic->mac >= mac_82558_D101_A4) { | 1530 | if (nic->mac >= mac_82558_D101_A4) { |
1531 | nic->tx_fc_pause += le32_to_cpu(s->fc_xmt_pause); | 1531 | nic->tx_fc_pause += le32_to_cpu(s->fc_xmt_pause); |
1532 | nic->rx_fc_pause += le32_to_cpu(s->fc_rcv_pause); | 1532 | nic->rx_fc_pause += le32_to_cpu(s->fc_rcv_pause); |
1533 | nic->rx_fc_unsupported += | 1533 | nic->rx_fc_unsupported += |
1534 | le32_to_cpu(s->fc_rcv_unsupported); | 1534 | le32_to_cpu(s->fc_rcv_unsupported); |
1535 | if(nic->mac >= mac_82559_D101M) { | 1535 | if (nic->mac >= mac_82559_D101M) { |
1536 | nic->tx_tco_frames += | 1536 | nic->tx_tco_frames += |
1537 | le16_to_cpu(s->xmt_tco_frames); | 1537 | le16_to_cpu(s->xmt_tco_frames); |
1538 | nic->rx_tco_frames += | 1538 | nic->rx_tco_frames += |
@@ -1542,7 +1542,7 @@ static void e100_update_stats(struct nic *nic) | |||
1542 | } | 1542 | } |
1543 | 1543 | ||
1544 | 1544 | ||
1545 | if(e100_exec_cmd(nic, cuc_dump_reset, 0)) | 1545 | if (e100_exec_cmd(nic, cuc_dump_reset, 0)) |
1546 | DPRINTK(TX_ERR, DEBUG, "exec cuc_dump_reset failed\n"); | 1546 | DPRINTK(TX_ERR, DEBUG, "exec cuc_dump_reset failed\n"); |
1547 | } | 1547 | } |
1548 | 1548 | ||
@@ -1551,19 +1551,19 @@ static void e100_adjust_adaptive_ifs(struct nic *nic, int speed, int duplex) | |||
1551 | /* Adjust inter-frame-spacing (IFS) between two transmits if | 1551 | /* Adjust inter-frame-spacing (IFS) between two transmits if |
1552 | * we're getting collisions on a half-duplex connection. */ | 1552 | * we're getting collisions on a half-duplex connection. */ |
1553 | 1553 | ||
1554 | if(duplex == DUPLEX_HALF) { | 1554 | if (duplex == DUPLEX_HALF) { |
1555 | u32 prev = nic->adaptive_ifs; | 1555 | u32 prev = nic->adaptive_ifs; |
1556 | u32 min_frames = (speed == SPEED_100) ? 1000 : 100; | 1556 | u32 min_frames = (speed == SPEED_100) ? 1000 : 100; |
1557 | 1557 | ||
1558 | if((nic->tx_frames / 32 < nic->tx_collisions) && | 1558 | if ((nic->tx_frames / 32 < nic->tx_collisions) && |
1559 | (nic->tx_frames > min_frames)) { | 1559 | (nic->tx_frames > min_frames)) { |
1560 | if(nic->adaptive_ifs < 60) | 1560 | if (nic->adaptive_ifs < 60) |
1561 | nic->adaptive_ifs += 5; | 1561 | nic->adaptive_ifs += 5; |
1562 | } else if (nic->tx_frames < min_frames) { | 1562 | } else if (nic->tx_frames < min_frames) { |
1563 | if(nic->adaptive_ifs >= 5) | 1563 | if (nic->adaptive_ifs >= 5) |
1564 | nic->adaptive_ifs -= 5; | 1564 | nic->adaptive_ifs -= 5; |
1565 | } | 1565 | } |
1566 | if(nic->adaptive_ifs != prev) | 1566 | if (nic->adaptive_ifs != prev) |
1567 | e100_exec_cb(nic, NULL, e100_configure); | 1567 | e100_exec_cb(nic, NULL, e100_configure); |
1568 | } | 1568 | } |
1569 | } | 1569 | } |
@@ -1579,12 +1579,12 @@ static void e100_watchdog(unsigned long data) | |||
1579 | 1579 | ||
1580 | mii_ethtool_gset(&nic->mii, &cmd); | 1580 | mii_ethtool_gset(&nic->mii, &cmd); |
1581 | 1581 | ||
1582 | if(mii_link_ok(&nic->mii) && !netif_carrier_ok(nic->netdev)) { | 1582 | if (mii_link_ok(&nic->mii) && !netif_carrier_ok(nic->netdev)) { |
1583 | printk(KERN_INFO "e100: %s NIC Link is Up %s Mbps %s Duplex\n", | 1583 | printk(KERN_INFO "e100: %s NIC Link is Up %s Mbps %s Duplex\n", |
1584 | nic->netdev->name, | 1584 | nic->netdev->name, |
1585 | cmd.speed == SPEED_100 ? "100" : "10", | 1585 | cmd.speed == SPEED_100 ? "100" : "10", |
1586 | cmd.duplex == DUPLEX_FULL ? "Full" : "Half"); | 1586 | cmd.duplex == DUPLEX_FULL ? "Full" : "Half"); |
1587 | } else if(!mii_link_ok(&nic->mii) && netif_carrier_ok(nic->netdev)) { | 1587 | } else if (!mii_link_ok(&nic->mii) && netif_carrier_ok(nic->netdev)) { |
1588 | printk(KERN_INFO "e100: %s NIC Link is Down\n", | 1588 | printk(KERN_INFO "e100: %s NIC Link is Down\n", |
1589 | nic->netdev->name); | 1589 | nic->netdev->name); |
1590 | } | 1590 | } |
@@ -1604,11 +1604,11 @@ static void e100_watchdog(unsigned long data) | |||
1604 | e100_update_stats(nic); | 1604 | e100_update_stats(nic); |
1605 | e100_adjust_adaptive_ifs(nic, cmd.speed, cmd.duplex); | 1605 | e100_adjust_adaptive_ifs(nic, cmd.speed, cmd.duplex); |
1606 | 1606 | ||
1607 | if(nic->mac <= mac_82557_D100_C) | 1607 | if (nic->mac <= mac_82557_D100_C) |
1608 | /* Issue a multicast command to workaround a 557 lock up */ | 1608 | /* Issue a multicast command to workaround a 557 lock up */ |
1609 | e100_set_multicast_list(nic->netdev); | 1609 | e100_set_multicast_list(nic->netdev); |
1610 | 1610 | ||
1611 | if(nic->flags & ich && cmd.speed==SPEED_10 && cmd.duplex==DUPLEX_HALF) | 1611 | if (nic->flags & ich && cmd.speed==SPEED_10 && cmd.duplex==DUPLEX_HALF) |
1612 | /* Need SW workaround for ICH[x] 10Mbps/half duplex Tx hang. */ | 1612 | /* Need SW workaround for ICH[x] 10Mbps/half duplex Tx hang. */ |
1613 | nic->flags |= ich_10h_workaround; | 1613 | nic->flags |= ich_10h_workaround; |
1614 | else | 1614 | else |
@@ -1623,7 +1623,7 @@ static void e100_xmit_prepare(struct nic *nic, struct cb *cb, | |||
1623 | { | 1623 | { |
1624 | cb->command = nic->tx_command; | 1624 | cb->command = nic->tx_command; |
1625 | /* interrupt every 16 packets regardless of delay */ | 1625 | /* interrupt every 16 packets regardless of delay */ |
1626 | if((nic->cbs_avail & ~15) == nic->cbs_avail) | 1626 | if ((nic->cbs_avail & ~15) == nic->cbs_avail) |
1627 | cb->command |= cpu_to_le16(cb_i); | 1627 | cb->command |= cpu_to_le16(cb_i); |
1628 | cb->u.tcb.tbd_array = cb->dma_addr + offsetof(struct cb, u.tcb.tbd); | 1628 | cb->u.tcb.tbd_array = cb->dma_addr + offsetof(struct cb, u.tcb.tbd); |
1629 | cb->u.tcb.tcb_byte_count = 0; | 1629 | cb->u.tcb.tcb_byte_count = 0; |
@@ -1640,18 +1640,18 @@ static int e100_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
1640 | struct nic *nic = netdev_priv(netdev); | 1640 | struct nic *nic = netdev_priv(netdev); |
1641 | int err; | 1641 | int err; |
1642 | 1642 | ||
1643 | if(nic->flags & ich_10h_workaround) { | 1643 | if (nic->flags & ich_10h_workaround) { |
1644 | /* SW workaround for ICH[x] 10Mbps/half duplex Tx hang. | 1644 | /* SW workaround for ICH[x] 10Mbps/half duplex Tx hang. |
1645 | Issue a NOP command followed by a 1us delay before | 1645 | Issue a NOP command followed by a 1us delay before |
1646 | issuing the Tx command. */ | 1646 | issuing the Tx command. */ |
1647 | if(e100_exec_cmd(nic, cuc_nop, 0)) | 1647 | if (e100_exec_cmd(nic, cuc_nop, 0)) |
1648 | DPRINTK(TX_ERR, DEBUG, "exec cuc_nop failed\n"); | 1648 | DPRINTK(TX_ERR, DEBUG, "exec cuc_nop failed\n"); |
1649 | udelay(1); | 1649 | udelay(1); |
1650 | } | 1650 | } |
1651 | 1651 | ||
1652 | err = e100_exec_cb(nic, skb, e100_xmit_prepare); | 1652 | err = e100_exec_cb(nic, skb, e100_xmit_prepare); |
1653 | 1653 | ||
1654 | switch(err) { | 1654 | switch (err) { |
1655 | case -ENOSPC: | 1655 | case -ENOSPC: |
1656 | /* We queued the skb, but now we're out of space. */ | 1656 | /* We queued the skb, but now we're out of space. */ |
1657 | DPRINTK(TX_ERR, DEBUG, "No space for CB\n"); | 1657 | DPRINTK(TX_ERR, DEBUG, "No space for CB\n"); |
@@ -1677,14 +1677,14 @@ static int e100_tx_clean(struct nic *nic) | |||
1677 | spin_lock(&nic->cb_lock); | 1677 | spin_lock(&nic->cb_lock); |
1678 | 1678 | ||
1679 | /* Clean CBs marked complete */ | 1679 | /* Clean CBs marked complete */ |
1680 | for(cb = nic->cb_to_clean; | 1680 | for (cb = nic->cb_to_clean; |
1681 | cb->status & cpu_to_le16(cb_complete); | 1681 | cb->status & cpu_to_le16(cb_complete); |
1682 | cb = nic->cb_to_clean = cb->next) { | 1682 | cb = nic->cb_to_clean = cb->next) { |
1683 | DPRINTK(TX_DONE, DEBUG, "cb[%d]->status = 0x%04X\n", | 1683 | DPRINTK(TX_DONE, DEBUG, "cb[%d]->status = 0x%04X\n", |
1684 | (int)(((void*)cb - (void*)nic->cbs)/sizeof(struct cb)), | 1684 | (int)(((void*)cb - (void*)nic->cbs)/sizeof(struct cb)), |
1685 | cb->status); | 1685 | cb->status); |
1686 | 1686 | ||
1687 | if(likely(cb->skb != NULL)) { | 1687 | if (likely(cb->skb != NULL)) { |
1688 | dev->stats.tx_packets++; | 1688 | dev->stats.tx_packets++; |
1689 | dev->stats.tx_bytes += cb->skb->len; | 1689 | dev->stats.tx_bytes += cb->skb->len; |
1690 | 1690 | ||
@@ -1703,7 +1703,7 @@ static int e100_tx_clean(struct nic *nic) | |||
1703 | spin_unlock(&nic->cb_lock); | 1703 | spin_unlock(&nic->cb_lock); |
1704 | 1704 | ||
1705 | /* Recover from running out of Tx resources in xmit_frame */ | 1705 | /* Recover from running out of Tx resources in xmit_frame */ |
1706 | if(unlikely(tx_cleaned && netif_queue_stopped(nic->netdev))) | 1706 | if (unlikely(tx_cleaned && netif_queue_stopped(nic->netdev))) |
1707 | netif_wake_queue(nic->netdev); | 1707 | netif_wake_queue(nic->netdev); |
1708 | 1708 | ||
1709 | return tx_cleaned; | 1709 | return tx_cleaned; |
@@ -1711,10 +1711,10 @@ static int e100_tx_clean(struct nic *nic) | |||
1711 | 1711 | ||
1712 | static void e100_clean_cbs(struct nic *nic) | 1712 | static void e100_clean_cbs(struct nic *nic) |
1713 | { | 1713 | { |
1714 | if(nic->cbs) { | 1714 | if (nic->cbs) { |
1715 | while(nic->cbs_avail != nic->params.cbs.count) { | 1715 | while (nic->cbs_avail != nic->params.cbs.count) { |
1716 | struct cb *cb = nic->cb_to_clean; | 1716 | struct cb *cb = nic->cb_to_clean; |
1717 | if(cb->skb) { | 1717 | if (cb->skb) { |
1718 | pci_unmap_single(nic->pdev, | 1718 | pci_unmap_single(nic->pdev, |
1719 | le32_to_cpu(cb->u.tcb.tbd.buf_addr), | 1719 | le32_to_cpu(cb->u.tcb.tbd.buf_addr), |
1720 | le16_to_cpu(cb->u.tcb.tbd.size), | 1720 | le16_to_cpu(cb->u.tcb.tbd.size), |
@@ -1746,10 +1746,10 @@ static int e100_alloc_cbs(struct nic *nic) | |||
1746 | 1746 | ||
1747 | nic->cbs = pci_alloc_consistent(nic->pdev, | 1747 | nic->cbs = pci_alloc_consistent(nic->pdev, |
1748 | sizeof(struct cb) * count, &nic->cbs_dma_addr); | 1748 | sizeof(struct cb) * count, &nic->cbs_dma_addr); |
1749 | if(!nic->cbs) | 1749 | if (!nic->cbs) |
1750 | return -ENOMEM; | 1750 | return -ENOMEM; |
1751 | 1751 | ||
1752 | for(cb = nic->cbs, i = 0; i < count; cb++, i++) { | 1752 | for (cb = nic->cbs, i = 0; i < count; cb++, i++) { |
1753 | cb->next = (i + 1 < count) ? cb + 1 : nic->cbs; | 1753 | cb->next = (i + 1 < count) ? cb + 1 : nic->cbs; |
1754 | cb->prev = (i == 0) ? nic->cbs + count - 1 : cb - 1; | 1754 | cb->prev = (i == 0) ? nic->cbs + count - 1 : cb - 1; |
1755 | 1755 | ||
@@ -1767,14 +1767,14 @@ static int e100_alloc_cbs(struct nic *nic) | |||
1767 | 1767 | ||
1768 | static inline void e100_start_receiver(struct nic *nic, struct rx *rx) | 1768 | static inline void e100_start_receiver(struct nic *nic, struct rx *rx) |
1769 | { | 1769 | { |
1770 | if(!nic->rxs) return; | 1770 | if (!nic->rxs) return; |
1771 | if(RU_SUSPENDED != nic->ru_running) return; | 1771 | if (RU_SUSPENDED != nic->ru_running) return; |
1772 | 1772 | ||
1773 | /* handle init time starts */ | 1773 | /* handle init time starts */ |
1774 | if(!rx) rx = nic->rxs; | 1774 | if (!rx) rx = nic->rxs; |
1775 | 1775 | ||
1776 | /* (Re)start RU if suspended or idle and RFA is non-NULL */ | 1776 | /* (Re)start RU if suspended or idle and RFA is non-NULL */ |
1777 | if(rx->skb) { | 1777 | if (rx->skb) { |
1778 | e100_exec_cmd(nic, ruc_start, rx->dma_addr); | 1778 | e100_exec_cmd(nic, ruc_start, rx->dma_addr); |
1779 | nic->ru_running = RU_RUNNING; | 1779 | nic->ru_running = RU_RUNNING; |
1780 | } | 1780 | } |
@@ -1783,7 +1783,7 @@ static inline void e100_start_receiver(struct nic *nic, struct rx *rx) | |||
1783 | #define RFD_BUF_LEN (sizeof(struct rfd) + VLAN_ETH_FRAME_LEN) | 1783 | #define RFD_BUF_LEN (sizeof(struct rfd) + VLAN_ETH_FRAME_LEN) |
1784 | static int e100_rx_alloc_skb(struct nic *nic, struct rx *rx) | 1784 | static int e100_rx_alloc_skb(struct nic *nic, struct rx *rx) |
1785 | { | 1785 | { |
1786 | if(!(rx->skb = netdev_alloc_skb(nic->netdev, RFD_BUF_LEN + NET_IP_ALIGN))) | 1786 | if (!(rx->skb = netdev_alloc_skb(nic->netdev, RFD_BUF_LEN + NET_IP_ALIGN))) |
1787 | return -ENOMEM; | 1787 | return -ENOMEM; |
1788 | 1788 | ||
1789 | /* Align, init, and map the RFD. */ | 1789 | /* Align, init, and map the RFD. */ |
@@ -1820,7 +1820,7 @@ static int e100_rx_indicate(struct nic *nic, struct rx *rx, | |||
1820 | struct rfd *rfd = (struct rfd *)skb->data; | 1820 | struct rfd *rfd = (struct rfd *)skb->data; |
1821 | u16 rfd_status, actual_size; | 1821 | u16 rfd_status, actual_size; |
1822 | 1822 | ||
1823 | if(unlikely(work_done && *work_done >= work_to_do)) | 1823 | if (unlikely(work_done && *work_done >= work_to_do)) |
1824 | return -EAGAIN; | 1824 | return -EAGAIN; |
1825 | 1825 | ||
1826 | /* Need to sync before taking a peek at cb_complete bit */ | 1826 | /* Need to sync before taking a peek at cb_complete bit */ |
@@ -1847,7 +1847,7 @@ static int e100_rx_indicate(struct nic *nic, struct rx *rx, | |||
1847 | 1847 | ||
1848 | /* Get actual data size */ | 1848 | /* Get actual data size */ |
1849 | actual_size = le16_to_cpu(rfd->actual_size) & 0x3FFF; | 1849 | actual_size = le16_to_cpu(rfd->actual_size) & 0x3FFF; |
1850 | if(unlikely(actual_size > RFD_BUF_LEN - sizeof(struct rfd))) | 1850 | if (unlikely(actual_size > RFD_BUF_LEN - sizeof(struct rfd))) |
1851 | actual_size = RFD_BUF_LEN - sizeof(struct rfd); | 1851 | actual_size = RFD_BUF_LEN - sizeof(struct rfd); |
1852 | 1852 | ||
1853 | /* Get data */ | 1853 | /* Get data */ |
@@ -1872,10 +1872,10 @@ static int e100_rx_indicate(struct nic *nic, struct rx *rx, | |||
1872 | skb_put(skb, actual_size); | 1872 | skb_put(skb, actual_size); |
1873 | skb->protocol = eth_type_trans(skb, nic->netdev); | 1873 | skb->protocol = eth_type_trans(skb, nic->netdev); |
1874 | 1874 | ||
1875 | if(unlikely(!(rfd_status & cb_ok))) { | 1875 | if (unlikely(!(rfd_status & cb_ok))) { |
1876 | /* Don't indicate if hardware indicates errors */ | 1876 | /* Don't indicate if hardware indicates errors */ |
1877 | dev_kfree_skb_any(skb); | 1877 | dev_kfree_skb_any(skb); |
1878 | } else if(actual_size > ETH_DATA_LEN + VLAN_ETH_HLEN) { | 1878 | } else if (actual_size > ETH_DATA_LEN + VLAN_ETH_HLEN) { |
1879 | /* Don't indicate oversized frames */ | 1879 | /* Don't indicate oversized frames */ |
1880 | nic->rx_over_length_errors++; | 1880 | nic->rx_over_length_errors++; |
1881 | dev_kfree_skb_any(skb); | 1881 | dev_kfree_skb_any(skb); |
@@ -1883,7 +1883,7 @@ static int e100_rx_indicate(struct nic *nic, struct rx *rx, | |||
1883 | dev->stats.rx_packets++; | 1883 | dev->stats.rx_packets++; |
1884 | dev->stats.rx_bytes += actual_size; | 1884 | dev->stats.rx_bytes += actual_size; |
1885 | netif_receive_skb(skb); | 1885 | netif_receive_skb(skb); |
1886 | if(work_done) | 1886 | if (work_done) |
1887 | (*work_done)++; | 1887 | (*work_done)++; |
1888 | } | 1888 | } |
1889 | 1889 | ||
@@ -1901,7 +1901,7 @@ static void e100_rx_clean(struct nic *nic, unsigned int *work_done, | |||
1901 | struct rfd *old_before_last_rfd, *new_before_last_rfd; | 1901 | struct rfd *old_before_last_rfd, *new_before_last_rfd; |
1902 | 1902 | ||
1903 | /* Indicate newly arrived packets */ | 1903 | /* Indicate newly arrived packets */ |
1904 | for(rx = nic->rx_to_clean; rx->skb; rx = nic->rx_to_clean = rx->next) { | 1904 | for (rx = nic->rx_to_clean; rx->skb; rx = nic->rx_to_clean = rx->next) { |
1905 | err = e100_rx_indicate(nic, rx, work_done, work_to_do); | 1905 | err = e100_rx_indicate(nic, rx, work_done, work_to_do); |
1906 | /* Hit quota or no more to clean */ | 1906 | /* Hit quota or no more to clean */ |
1907 | if (-EAGAIN == err || -ENODATA == err) | 1907 | if (-EAGAIN == err || -ENODATA == err) |
@@ -1922,8 +1922,8 @@ static void e100_rx_clean(struct nic *nic, unsigned int *work_done, | |||
1922 | old_before_last_rfd = (struct rfd *)old_before_last_rx->skb->data; | 1922 | old_before_last_rfd = (struct rfd *)old_before_last_rx->skb->data; |
1923 | 1923 | ||
1924 | /* Alloc new skbs to refill list */ | 1924 | /* Alloc new skbs to refill list */ |
1925 | for(rx = nic->rx_to_use; !rx->skb; rx = nic->rx_to_use = rx->next) { | 1925 | for (rx = nic->rx_to_use; !rx->skb; rx = nic->rx_to_use = rx->next) { |
1926 | if(unlikely(e100_rx_alloc_skb(nic, rx))) | 1926 | if (unlikely(e100_rx_alloc_skb(nic, rx))) |
1927 | break; /* Better luck next time (see watchdog) */ | 1927 | break; /* Better luck next time (see watchdog) */ |
1928 | } | 1928 | } |
1929 | 1929 | ||
@@ -1959,11 +1959,11 @@ static void e100_rx_clean(struct nic *nic, unsigned int *work_done, | |||
1959 | PCI_DMA_BIDIRECTIONAL); | 1959 | PCI_DMA_BIDIRECTIONAL); |
1960 | } | 1960 | } |
1961 | 1961 | ||
1962 | if(restart_required) { | 1962 | if (restart_required) { |
1963 | // ack the rnr? | 1963 | // ack the rnr? |
1964 | iowrite8(stat_ack_rnr, &nic->csr->scb.stat_ack); | 1964 | iowrite8(stat_ack_rnr, &nic->csr->scb.stat_ack); |
1965 | e100_start_receiver(nic, nic->rx_to_clean); | 1965 | e100_start_receiver(nic, nic->rx_to_clean); |
1966 | if(work_done) | 1966 | if (work_done) |
1967 | (*work_done)++; | 1967 | (*work_done)++; |
1968 | } | 1968 | } |
1969 | } | 1969 | } |
@@ -1975,9 +1975,9 @@ static void e100_rx_clean_list(struct nic *nic) | |||
1975 | 1975 | ||
1976 | nic->ru_running = RU_UNINITIALIZED; | 1976 | nic->ru_running = RU_UNINITIALIZED; |
1977 | 1977 | ||
1978 | if(nic->rxs) { | 1978 | if (nic->rxs) { |
1979 | for(rx = nic->rxs, i = 0; i < count; rx++, i++) { | 1979 | for (rx = nic->rxs, i = 0; i < count; rx++, i++) { |
1980 | if(rx->skb) { | 1980 | if (rx->skb) { |
1981 | pci_unmap_single(nic->pdev, rx->dma_addr, | 1981 | pci_unmap_single(nic->pdev, rx->dma_addr, |
1982 | RFD_BUF_LEN, PCI_DMA_BIDIRECTIONAL); | 1982 | RFD_BUF_LEN, PCI_DMA_BIDIRECTIONAL); |
1983 | dev_kfree_skb(rx->skb); | 1983 | dev_kfree_skb(rx->skb); |
@@ -1999,13 +1999,13 @@ static int e100_rx_alloc_list(struct nic *nic) | |||
1999 | nic->rx_to_use = nic->rx_to_clean = NULL; | 1999 | nic->rx_to_use = nic->rx_to_clean = NULL; |
2000 | nic->ru_running = RU_UNINITIALIZED; | 2000 | nic->ru_running = RU_UNINITIALIZED; |
2001 | 2001 | ||
2002 | if(!(nic->rxs = kcalloc(count, sizeof(struct rx), GFP_ATOMIC))) | 2002 | if (!(nic->rxs = kcalloc(count, sizeof(struct rx), GFP_ATOMIC))) |
2003 | return -ENOMEM; | 2003 | return -ENOMEM; |
2004 | 2004 | ||
2005 | for(rx = nic->rxs, i = 0; i < count; rx++, i++) { | 2005 | for (rx = nic->rxs, i = 0; i < count; rx++, i++) { |
2006 | rx->next = (i + 1 < count) ? rx + 1 : nic->rxs; | 2006 | rx->next = (i + 1 < count) ? rx + 1 : nic->rxs; |
2007 | rx->prev = (i == 0) ? nic->rxs + count - 1 : rx - 1; | 2007 | rx->prev = (i == 0) ? nic->rxs + count - 1 : rx - 1; |
2008 | if(e100_rx_alloc_skb(nic, rx)) { | 2008 | if (e100_rx_alloc_skb(nic, rx)) { |
2009 | e100_rx_clean_list(nic); | 2009 | e100_rx_clean_list(nic); |
2010 | return -ENOMEM; | 2010 | return -ENOMEM; |
2011 | } | 2011 | } |
@@ -2038,7 +2038,7 @@ static irqreturn_t e100_intr(int irq, void *dev_id) | |||
2038 | 2038 | ||
2039 | DPRINTK(INTR, DEBUG, "stat_ack = 0x%02X\n", stat_ack); | 2039 | DPRINTK(INTR, DEBUG, "stat_ack = 0x%02X\n", stat_ack); |
2040 | 2040 | ||
2041 | if(stat_ack == stat_ack_not_ours || /* Not our interrupt */ | 2041 | if (stat_ack == stat_ack_not_ours || /* Not our interrupt */ |
2042 | stat_ack == stat_ack_not_present) /* Hardware is ejected */ | 2042 | stat_ack == stat_ack_not_present) /* Hardware is ejected */ |
2043 | return IRQ_NONE; | 2043 | return IRQ_NONE; |
2044 | 2044 | ||
@@ -2046,10 +2046,10 @@ static irqreturn_t e100_intr(int irq, void *dev_id) | |||
2046 | iowrite8(stat_ack, &nic->csr->scb.stat_ack); | 2046 | iowrite8(stat_ack, &nic->csr->scb.stat_ack); |
2047 | 2047 | ||
2048 | /* We hit Receive No Resource (RNR); restart RU after cleaning */ | 2048 | /* We hit Receive No Resource (RNR); restart RU after cleaning */ |
2049 | if(stat_ack & stat_ack_rnr) | 2049 | if (stat_ack & stat_ack_rnr) |
2050 | nic->ru_running = RU_SUSPENDED; | 2050 | nic->ru_running = RU_SUSPENDED; |
2051 | 2051 | ||
2052 | if(likely(netif_rx_schedule_prep(&nic->napi))) { | 2052 | if (likely(netif_rx_schedule_prep(&nic->napi))) { |
2053 | e100_disable_irq(nic); | 2053 | e100_disable_irq(nic); |
2054 | __netif_rx_schedule(&nic->napi); | 2054 | __netif_rx_schedule(&nic->napi); |
2055 | } | 2055 | } |
@@ -2102,7 +2102,7 @@ static int e100_set_mac_address(struct net_device *netdev, void *p) | |||
2102 | 2102 | ||
2103 | static int e100_change_mtu(struct net_device *netdev, int new_mtu) | 2103 | static int e100_change_mtu(struct net_device *netdev, int new_mtu) |
2104 | { | 2104 | { |
2105 | if(new_mtu < ETH_ZLEN || new_mtu > ETH_DATA_LEN) | 2105 | if (new_mtu < ETH_ZLEN || new_mtu > ETH_DATA_LEN) |
2106 | return -EINVAL; | 2106 | return -EINVAL; |
2107 | netdev->mtu = new_mtu; | 2107 | netdev->mtu = new_mtu; |
2108 | return 0; | 2108 | return 0; |
@@ -2121,16 +2121,16 @@ static int e100_up(struct nic *nic) | |||
2121 | { | 2121 | { |
2122 | int err; | 2122 | int err; |
2123 | 2123 | ||
2124 | if((err = e100_rx_alloc_list(nic))) | 2124 | if ((err = e100_rx_alloc_list(nic))) |
2125 | return err; | 2125 | return err; |
2126 | if((err = e100_alloc_cbs(nic))) | 2126 | if ((err = e100_alloc_cbs(nic))) |
2127 | goto err_rx_clean_list; | 2127 | goto err_rx_clean_list; |
2128 | if((err = e100_hw_init(nic))) | 2128 | if ((err = e100_hw_init(nic))) |
2129 | goto err_clean_cbs; | 2129 | goto err_clean_cbs; |
2130 | e100_set_multicast_list(nic->netdev); | 2130 | e100_set_multicast_list(nic->netdev); |
2131 | e100_start_receiver(nic, NULL); | 2131 | e100_start_receiver(nic, NULL); |
2132 | mod_timer(&nic->watchdog, jiffies); | 2132 | mod_timer(&nic->watchdog, jiffies); |
2133 | if((err = request_irq(nic->pdev->irq, e100_intr, IRQF_SHARED, | 2133 | if ((err = request_irq(nic->pdev->irq, e100_intr, IRQF_SHARED, |
2134 | nic->netdev->name, nic->netdev))) | 2134 | nic->netdev->name, nic->netdev))) |
2135 | goto err_no_irq; | 2135 | goto err_no_irq; |
2136 | netif_wake_queue(nic->netdev); | 2136 | netif_wake_queue(nic->netdev); |
@@ -2192,26 +2192,26 @@ static int e100_loopback_test(struct nic *nic, enum loopback loopback_mode) | |||
2192 | * in loopback mode, and the test passes if the received | 2192 | * in loopback mode, and the test passes if the received |
2193 | * packet compares byte-for-byte to the transmitted packet. */ | 2193 | * packet compares byte-for-byte to the transmitted packet. */ |
2194 | 2194 | ||
2195 | if((err = e100_rx_alloc_list(nic))) | 2195 | if ((err = e100_rx_alloc_list(nic))) |
2196 | return err; | 2196 | return err; |
2197 | if((err = e100_alloc_cbs(nic))) | 2197 | if ((err = e100_alloc_cbs(nic))) |
2198 | goto err_clean_rx; | 2198 | goto err_clean_rx; |
2199 | 2199 | ||
2200 | /* ICH PHY loopback is broken so do MAC loopback instead */ | 2200 | /* ICH PHY loopback is broken so do MAC loopback instead */ |
2201 | if(nic->flags & ich && loopback_mode == lb_phy) | 2201 | if (nic->flags & ich && loopback_mode == lb_phy) |
2202 | loopback_mode = lb_mac; | 2202 | loopback_mode = lb_mac; |
2203 | 2203 | ||
2204 | nic->loopback = loopback_mode; | 2204 | nic->loopback = loopback_mode; |
2205 | if((err = e100_hw_init(nic))) | 2205 | if ((err = e100_hw_init(nic))) |
2206 | goto err_loopback_none; | 2206 | goto err_loopback_none; |
2207 | 2207 | ||
2208 | if(loopback_mode == lb_phy) | 2208 | if (loopback_mode == lb_phy) |
2209 | mdio_write(nic->netdev, nic->mii.phy_id, MII_BMCR, | 2209 | mdio_write(nic->netdev, nic->mii.phy_id, MII_BMCR, |
2210 | BMCR_LOOPBACK); | 2210 | BMCR_LOOPBACK); |
2211 | 2211 | ||
2212 | e100_start_receiver(nic, NULL); | 2212 | e100_start_receiver(nic, NULL); |
2213 | 2213 | ||
2214 | if(!(skb = netdev_alloc_skb(nic->netdev, ETH_DATA_LEN))) { | 2214 | if (!(skb = netdev_alloc_skb(nic->netdev, ETH_DATA_LEN))) { |
2215 | err = -ENOMEM; | 2215 | err = -ENOMEM; |
2216 | goto err_loopback_none; | 2216 | goto err_loopback_none; |
2217 | } | 2217 | } |
@@ -2224,7 +2224,7 @@ static int e100_loopback_test(struct nic *nic, enum loopback loopback_mode) | |||
2224 | pci_dma_sync_single_for_cpu(nic->pdev, nic->rx_to_clean->dma_addr, | 2224 | pci_dma_sync_single_for_cpu(nic->pdev, nic->rx_to_clean->dma_addr, |
2225 | RFD_BUF_LEN, PCI_DMA_BIDIRECTIONAL); | 2225 | RFD_BUF_LEN, PCI_DMA_BIDIRECTIONAL); |
2226 | 2226 | ||
2227 | if(memcmp(nic->rx_to_clean->skb->data + sizeof(struct rfd), | 2227 | if (memcmp(nic->rx_to_clean->skb->data + sizeof(struct rfd), |
2228 | skb->data, ETH_DATA_LEN)) | 2228 | skb->data, ETH_DATA_LEN)) |
2229 | err = -EAGAIN; | 2229 | err = -EAGAIN; |
2230 | 2230 | ||
@@ -2301,7 +2301,7 @@ static void e100_get_regs(struct net_device *netdev, | |||
2301 | buff[0] = ioread8(&nic->csr->scb.cmd_hi) << 24 | | 2301 | buff[0] = ioread8(&nic->csr->scb.cmd_hi) << 24 | |
2302 | ioread8(&nic->csr->scb.cmd_lo) << 16 | | 2302 | ioread8(&nic->csr->scb.cmd_lo) << 16 | |
2303 | ioread16(&nic->csr->scb.status); | 2303 | ioread16(&nic->csr->scb.status); |
2304 | for(i = E100_PHY_REGS; i >= 0; i--) | 2304 | for (i = E100_PHY_REGS; i >= 0; i--) |
2305 | buff[1 + E100_PHY_REGS - i] = | 2305 | buff[1 + E100_PHY_REGS - i] = |
2306 | mdio_read(netdev, nic->mii.phy_id, i); | 2306 | mdio_read(netdev, nic->mii.phy_id, i); |
2307 | memset(nic->mem->dump_buf, 0, sizeof(nic->mem->dump_buf)); | 2307 | memset(nic->mem->dump_buf, 0, sizeof(nic->mem->dump_buf)); |
@@ -2326,7 +2326,7 @@ static int e100_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) | |||
2326 | !device_can_wakeup(&nic->pdev->dev)) | 2326 | !device_can_wakeup(&nic->pdev->dev)) |
2327 | return -EOPNOTSUPP; | 2327 | return -EOPNOTSUPP; |
2328 | 2328 | ||
2329 | if(wol->wolopts) | 2329 | if (wol->wolopts) |
2330 | nic->flags |= wol_magic; | 2330 | nic->flags |= wol_magic; |
2331 | else | 2331 | else |
2332 | nic->flags &= ~wol_magic; | 2332 | nic->flags &= ~wol_magic; |
@@ -2385,7 +2385,7 @@ static int e100_set_eeprom(struct net_device *netdev, | |||
2385 | { | 2385 | { |
2386 | struct nic *nic = netdev_priv(netdev); | 2386 | struct nic *nic = netdev_priv(netdev); |
2387 | 2387 | ||
2388 | if(eeprom->magic != E100_EEPROM_MAGIC) | 2388 | if (eeprom->magic != E100_EEPROM_MAGIC) |
2389 | return -EINVAL; | 2389 | return -EINVAL; |
2390 | 2390 | ||
2391 | memcpy(&((u8 *)nic->eeprom)[eeprom->offset], bytes, eeprom->len); | 2391 | memcpy(&((u8 *)nic->eeprom)[eeprom->offset], bytes, eeprom->len); |
@@ -2421,7 +2421,7 @@ static int e100_set_ringparam(struct net_device *netdev, | |||
2421 | if ((ring->rx_mini_pending) || (ring->rx_jumbo_pending)) | 2421 | if ((ring->rx_mini_pending) || (ring->rx_jumbo_pending)) |
2422 | return -EINVAL; | 2422 | return -EINVAL; |
2423 | 2423 | ||
2424 | if(netif_running(netdev)) | 2424 | if (netif_running(netdev)) |
2425 | e100_down(nic); | 2425 | e100_down(nic); |
2426 | rfds->count = max(ring->rx_pending, rfds->min); | 2426 | rfds->count = max(ring->rx_pending, rfds->min); |
2427 | rfds->count = min(rfds->count, rfds->max); | 2427 | rfds->count = min(rfds->count, rfds->max); |
@@ -2429,7 +2429,7 @@ static int e100_set_ringparam(struct net_device *netdev, | |||
2429 | cbs->count = min(cbs->count, cbs->max); | 2429 | cbs->count = min(cbs->count, cbs->max); |
2430 | DPRINTK(DRV, INFO, "Ring Param settings: rx: %d, tx %d\n", | 2430 | DPRINTK(DRV, INFO, "Ring Param settings: rx: %d, tx %d\n", |
2431 | rfds->count, cbs->count); | 2431 | rfds->count, cbs->count); |
2432 | if(netif_running(netdev)) | 2432 | if (netif_running(netdev)) |
2433 | e100_up(nic); | 2433 | e100_up(nic); |
2434 | 2434 | ||
2435 | return 0; | 2435 | return 0; |
@@ -2454,12 +2454,12 @@ static void e100_diag_test(struct net_device *netdev, | |||
2454 | memset(data, 0, E100_TEST_LEN * sizeof(u64)); | 2454 | memset(data, 0, E100_TEST_LEN * sizeof(u64)); |
2455 | data[0] = !mii_link_ok(&nic->mii); | 2455 | data[0] = !mii_link_ok(&nic->mii); |
2456 | data[1] = e100_eeprom_load(nic); | 2456 | data[1] = e100_eeprom_load(nic); |
2457 | if(test->flags & ETH_TEST_FL_OFFLINE) { | 2457 | if (test->flags & ETH_TEST_FL_OFFLINE) { |
2458 | 2458 | ||
2459 | /* save speed, duplex & autoneg settings */ | 2459 | /* save speed, duplex & autoneg settings */ |
2460 | err = mii_ethtool_gset(&nic->mii, &cmd); | 2460 | err = mii_ethtool_gset(&nic->mii, &cmd); |
2461 | 2461 | ||
2462 | if(netif_running(netdev)) | 2462 | if (netif_running(netdev)) |
2463 | e100_down(nic); | 2463 | e100_down(nic); |
2464 | data[2] = e100_self_test(nic); | 2464 | data[2] = e100_self_test(nic); |
2465 | data[3] = e100_loopback_test(nic, lb_mac); | 2465 | data[3] = e100_loopback_test(nic, lb_mac); |
@@ -2468,10 +2468,10 @@ static void e100_diag_test(struct net_device *netdev, | |||
2468 | /* restore speed, duplex & autoneg settings */ | 2468 | /* restore speed, duplex & autoneg settings */ |
2469 | err = mii_ethtool_sset(&nic->mii, &cmd); | 2469 | err = mii_ethtool_sset(&nic->mii, &cmd); |
2470 | 2470 | ||
2471 | if(netif_running(netdev)) | 2471 | if (netif_running(netdev)) |
2472 | e100_up(nic); | 2472 | e100_up(nic); |
2473 | } | 2473 | } |
2474 | for(i = 0; i < E100_TEST_LEN; i++) | 2474 | for (i = 0; i < E100_TEST_LEN; i++) |
2475 | test->flags |= data[i] ? ETH_TEST_FL_FAILED : 0; | 2475 | test->flags |= data[i] ? ETH_TEST_FL_FAILED : 0; |
2476 | 2476 | ||
2477 | msleep_interruptible(4 * 1000); | 2477 | msleep_interruptible(4 * 1000); |
@@ -2481,7 +2481,7 @@ static int e100_phys_id(struct net_device *netdev, u32 data) | |||
2481 | { | 2481 | { |
2482 | struct nic *nic = netdev_priv(netdev); | 2482 | struct nic *nic = netdev_priv(netdev); |
2483 | 2483 | ||
2484 | if(!data || data > (u32)(MAX_SCHEDULE_TIMEOUT / HZ)) | 2484 | if (!data || data > (u32)(MAX_SCHEDULE_TIMEOUT / HZ)) |
2485 | data = (u32)(MAX_SCHEDULE_TIMEOUT / HZ); | 2485 | data = (u32)(MAX_SCHEDULE_TIMEOUT / HZ); |
2486 | mod_timer(&nic->blink_timer, jiffies); | 2486 | mod_timer(&nic->blink_timer, jiffies); |
2487 | msleep_interruptible(data * 1000); | 2487 | msleep_interruptible(data * 1000); |
@@ -2524,7 +2524,7 @@ static void e100_get_ethtool_stats(struct net_device *netdev, | |||
2524 | struct nic *nic = netdev_priv(netdev); | 2524 | struct nic *nic = netdev_priv(netdev); |
2525 | int i; | 2525 | int i; |
2526 | 2526 | ||
2527 | for(i = 0; i < E100_NET_STATS_LEN; i++) | 2527 | for (i = 0; i < E100_NET_STATS_LEN; i++) |
2528 | data[i] = ((unsigned long *)&netdev->stats)[i]; | 2528 | data[i] = ((unsigned long *)&netdev->stats)[i]; |
2529 | 2529 | ||
2530 | data[i++] = nic->tx_deferred; | 2530 | data[i++] = nic->tx_deferred; |
@@ -2539,7 +2539,7 @@ static void e100_get_ethtool_stats(struct net_device *netdev, | |||
2539 | 2539 | ||
2540 | static void e100_get_strings(struct net_device *netdev, u32 stringset, u8 *data) | 2540 | static void e100_get_strings(struct net_device *netdev, u32 stringset, u8 *data) |
2541 | { | 2541 | { |
2542 | switch(stringset) { | 2542 | switch (stringset) { |
2543 | case ETH_SS_TEST: | 2543 | case ETH_SS_TEST: |
2544 | memcpy(data, *e100_gstrings_test, sizeof(e100_gstrings_test)); | 2544 | memcpy(data, *e100_gstrings_test, sizeof(e100_gstrings_test)); |
2545 | break; | 2545 | break; |
@@ -2589,7 +2589,7 @@ static int e100_alloc(struct nic *nic) | |||
2589 | 2589 | ||
2590 | static void e100_free(struct nic *nic) | 2590 | static void e100_free(struct nic *nic) |
2591 | { | 2591 | { |
2592 | if(nic->mem) { | 2592 | if (nic->mem) { |
2593 | pci_free_consistent(nic->pdev, sizeof(struct mem), | 2593 | pci_free_consistent(nic->pdev, sizeof(struct mem), |
2594 | nic->mem, nic->dma_addr); | 2594 | nic->mem, nic->dma_addr); |
2595 | nic->mem = NULL; | 2595 | nic->mem = NULL; |
@@ -2602,7 +2602,7 @@ static int e100_open(struct net_device *netdev) | |||
2602 | int err = 0; | 2602 | int err = 0; |
2603 | 2603 | ||
2604 | netif_carrier_off(netdev); | 2604 | netif_carrier_off(netdev); |
2605 | if((err = e100_up(nic))) | 2605 | if ((err = e100_up(nic))) |
2606 | DPRINTK(IFUP, ERR, "Cannot open interface, aborting.\n"); | 2606 | DPRINTK(IFUP, ERR, "Cannot open interface, aborting.\n"); |
2607 | return err; | 2607 | return err; |
2608 | } | 2608 | } |
@@ -2635,8 +2635,8 @@ static int __devinit e100_probe(struct pci_dev *pdev, | |||
2635 | struct nic *nic; | 2635 | struct nic *nic; |
2636 | int err; | 2636 | int err; |
2637 | 2637 | ||
2638 | if(!(netdev = alloc_etherdev(sizeof(struct nic)))) { | 2638 | if (!(netdev = alloc_etherdev(sizeof(struct nic)))) { |
2639 | if(((1 << debug) - 1) & NETIF_MSG_PROBE) | 2639 | if (((1 << debug) - 1) & NETIF_MSG_PROBE) |
2640 | printk(KERN_ERR PFX "Etherdev alloc failed, abort.\n"); | 2640 | printk(KERN_ERR PFX "Etherdev alloc failed, abort.\n"); |
2641 | return -ENOMEM; | 2641 | return -ENOMEM; |
2642 | } | 2642 | } |
@@ -2653,24 +2653,24 @@ static int __devinit e100_probe(struct pci_dev *pdev, | |||
2653 | nic->msg_enable = (1 << debug) - 1; | 2653 | nic->msg_enable = (1 << debug) - 1; |
2654 | pci_set_drvdata(pdev, netdev); | 2654 | pci_set_drvdata(pdev, netdev); |
2655 | 2655 | ||
2656 | if((err = pci_enable_device(pdev))) { | 2656 | if ((err = pci_enable_device(pdev))) { |
2657 | DPRINTK(PROBE, ERR, "Cannot enable PCI device, aborting.\n"); | 2657 | DPRINTK(PROBE, ERR, "Cannot enable PCI device, aborting.\n"); |
2658 | goto err_out_free_dev; | 2658 | goto err_out_free_dev; |
2659 | } | 2659 | } |
2660 | 2660 | ||
2661 | if(!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) { | 2661 | if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) { |
2662 | DPRINTK(PROBE, ERR, "Cannot find proper PCI device " | 2662 | DPRINTK(PROBE, ERR, "Cannot find proper PCI device " |
2663 | "base address, aborting.\n"); | 2663 | "base address, aborting.\n"); |
2664 | err = -ENODEV; | 2664 | err = -ENODEV; |
2665 | goto err_out_disable_pdev; | 2665 | goto err_out_disable_pdev; |
2666 | } | 2666 | } |
2667 | 2667 | ||
2668 | if((err = pci_request_regions(pdev, DRV_NAME))) { | 2668 | if ((err = pci_request_regions(pdev, DRV_NAME))) { |
2669 | DPRINTK(PROBE, ERR, "Cannot obtain PCI resources, aborting.\n"); | 2669 | DPRINTK(PROBE, ERR, "Cannot obtain PCI resources, aborting.\n"); |
2670 | goto err_out_disable_pdev; | 2670 | goto err_out_disable_pdev; |
2671 | } | 2671 | } |
2672 | 2672 | ||
2673 | if((err = pci_set_dma_mask(pdev, DMA_32BIT_MASK))) { | 2673 | if ((err = pci_set_dma_mask(pdev, DMA_32BIT_MASK))) { |
2674 | DPRINTK(PROBE, ERR, "No usable DMA configuration, aborting.\n"); | 2674 | DPRINTK(PROBE, ERR, "No usable DMA configuration, aborting.\n"); |
2675 | goto err_out_free_res; | 2675 | goto err_out_free_res; |
2676 | } | 2676 | } |
@@ -2681,13 +2681,13 @@ static int __devinit e100_probe(struct pci_dev *pdev, | |||
2681 | DPRINTK(PROBE, INFO, "using i/o access mode\n"); | 2681 | DPRINTK(PROBE, INFO, "using i/o access mode\n"); |
2682 | 2682 | ||
2683 | nic->csr = pci_iomap(pdev, (use_io ? 1 : 0), sizeof(struct csr)); | 2683 | nic->csr = pci_iomap(pdev, (use_io ? 1 : 0), sizeof(struct csr)); |
2684 | if(!nic->csr) { | 2684 | if (!nic->csr) { |
2685 | DPRINTK(PROBE, ERR, "Cannot map device registers, aborting.\n"); | 2685 | DPRINTK(PROBE, ERR, "Cannot map device registers, aborting.\n"); |
2686 | err = -ENOMEM; | 2686 | err = -ENOMEM; |
2687 | goto err_out_free_res; | 2687 | goto err_out_free_res; |
2688 | } | 2688 | } |
2689 | 2689 | ||
2690 | if(ent->driver_data) | 2690 | if (ent->driver_data) |
2691 | nic->flags |= ich; | 2691 | nic->flags |= ich; |
2692 | else | 2692 | else |
2693 | nic->flags &= ~ich; | 2693 | nic->flags &= ~ich; |
@@ -2715,12 +2715,12 @@ static int __devinit e100_probe(struct pci_dev *pdev, | |||
2715 | 2715 | ||
2716 | INIT_WORK(&nic->tx_timeout_task, e100_tx_timeout_task); | 2716 | INIT_WORK(&nic->tx_timeout_task, e100_tx_timeout_task); |
2717 | 2717 | ||
2718 | if((err = e100_alloc(nic))) { | 2718 | if ((err = e100_alloc(nic))) { |
2719 | DPRINTK(PROBE, ERR, "Cannot alloc driver memory, aborting.\n"); | 2719 | DPRINTK(PROBE, ERR, "Cannot alloc driver memory, aborting.\n"); |
2720 | goto err_out_iounmap; | 2720 | goto err_out_iounmap; |
2721 | } | 2721 | } |
2722 | 2722 | ||
2723 | if((err = e100_eeprom_load(nic))) | 2723 | if ((err = e100_eeprom_load(nic))) |
2724 | goto err_out_free; | 2724 | goto err_out_free; |
2725 | 2725 | ||
2726 | e100_phy_init(nic); | 2726 | e100_phy_init(nic); |
@@ -2740,7 +2740,7 @@ static int __devinit e100_probe(struct pci_dev *pdev, | |||
2740 | } | 2740 | } |
2741 | 2741 | ||
2742 | /* Wol magic packet can be enabled from eeprom */ | 2742 | /* Wol magic packet can be enabled from eeprom */ |
2743 | if((nic->mac >= mac_82558_D101_A4) && | 2743 | if ((nic->mac >= mac_82558_D101_A4) && |
2744 | (nic->eeprom[eeprom_id] & eeprom_id_wol)) { | 2744 | (nic->eeprom[eeprom_id] & eeprom_id_wol)) { |
2745 | nic->flags |= wol_magic; | 2745 | nic->flags |= wol_magic; |
2746 | device_set_wakeup_enable(&pdev->dev, true); | 2746 | device_set_wakeup_enable(&pdev->dev, true); |
@@ -2750,7 +2750,7 @@ static int __devinit e100_probe(struct pci_dev *pdev, | |||
2750 | pci_pme_active(pdev, false); | 2750 | pci_pme_active(pdev, false); |
2751 | 2751 | ||
2752 | strcpy(netdev->name, "eth%d"); | 2752 | strcpy(netdev->name, "eth%d"); |
2753 | if((err = register_netdev(netdev))) { | 2753 | if ((err = register_netdev(netdev))) { |
2754 | DPRINTK(PROBE, ERR, "Cannot register net device, aborting.\n"); | 2754 | DPRINTK(PROBE, ERR, "Cannot register net device, aborting.\n"); |
2755 | goto err_out_free; | 2755 | goto err_out_free; |
2756 | } | 2756 | } |
@@ -2779,7 +2779,7 @@ static void __devexit e100_remove(struct pci_dev *pdev) | |||
2779 | { | 2779 | { |
2780 | struct net_device *netdev = pci_get_drvdata(pdev); | 2780 | struct net_device *netdev = pci_get_drvdata(pdev); |
2781 | 2781 | ||
2782 | if(netdev) { | 2782 | if (netdev) { |
2783 | struct nic *nic = netdev_priv(netdev); | 2783 | struct nic *nic = netdev_priv(netdev); |
2784 | unregister_netdev(netdev); | 2784 | unregister_netdev(netdev); |
2785 | e100_free(nic); | 2785 | e100_free(nic); |
@@ -2932,7 +2932,7 @@ static struct pci_driver e100_driver = { | |||
2932 | 2932 | ||
2933 | static int __init e100_init_module(void) | 2933 | static int __init e100_init_module(void) |
2934 | { | 2934 | { |
2935 | if(((1 << debug) - 1) & NETIF_MSG_DRV) { | 2935 | if (((1 << debug) - 1) & NETIF_MSG_DRV) { |
2936 | printk(KERN_INFO PFX "%s, %s\n", DRV_DESCRIPTION, DRV_VERSION); | 2936 | printk(KERN_INFO PFX "%s, %s\n", DRV_DESCRIPTION, DRV_VERSION); |
2937 | printk(KERN_INFO PFX "%s\n", DRV_COPYRIGHT); | 2937 | printk(KERN_INFO PFX "%s\n", DRV_COPYRIGHT); |
2938 | } | 2938 | } |
diff --git a/drivers/net/ehea/ehea.h b/drivers/net/ehea/ehea.h index 9930d5f8b9e1..6271b9411ccf 100644 --- a/drivers/net/ehea/ehea.h +++ b/drivers/net/ehea/ehea.h | |||
@@ -478,7 +478,7 @@ struct ehea_port { | |||
478 | int num_add_tx_qps; | 478 | int num_add_tx_qps; |
479 | int num_mcs; | 479 | int num_mcs; |
480 | int resets; | 480 | int resets; |
481 | u64 flags; | 481 | unsigned long flags; |
482 | u64 mac_addr; | 482 | u64 mac_addr; |
483 | u32 logical_port_id; | 483 | u32 logical_port_id; |
484 | u32 port_speed; | 484 | u32 port_speed; |
@@ -510,7 +510,6 @@ void ehea_set_ethtool_ops(struct net_device *netdev); | |||
510 | int ehea_sense_port_attr(struct ehea_port *port); | 510 | int ehea_sense_port_attr(struct ehea_port *port); |
511 | int ehea_set_portspeed(struct ehea_port *port, u32 port_speed); | 511 | int ehea_set_portspeed(struct ehea_port *port, u32 port_speed); |
512 | 512 | ||
513 | extern u64 ehea_driver_flags; | ||
514 | extern struct work_struct ehea_rereg_mr_task; | 513 | extern struct work_struct ehea_rereg_mr_task; |
515 | 514 | ||
516 | #endif /* __EHEA_H__ */ | 515 | #endif /* __EHEA_H__ */ |
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c index a2f1905a23df..e3131ea629cd 100644 --- a/drivers/net/ehea/ehea_main.c +++ b/drivers/net/ehea/ehea_main.c | |||
@@ -99,7 +99,7 @@ MODULE_PARM_DESC(use_lro, " Large Receive Offload, 1: enable, 0: disable, " | |||
99 | 99 | ||
100 | static int port_name_cnt; | 100 | static int port_name_cnt; |
101 | static LIST_HEAD(adapter_list); | 101 | static LIST_HEAD(adapter_list); |
102 | u64 ehea_driver_flags; | 102 | static unsigned long ehea_driver_flags; |
103 | struct work_struct ehea_rereg_mr_task; | 103 | struct work_struct ehea_rereg_mr_task; |
104 | static DEFINE_MUTEX(dlpar_mem_lock); | 104 | static DEFINE_MUTEX(dlpar_mem_lock); |
105 | struct ehea_fw_handle_array ehea_fw_handles; | 105 | struct ehea_fw_handle_array ehea_fw_handles; |
diff --git a/drivers/net/enc28j60.c b/drivers/net/enc28j60.c index b0ef46c51a9d..cefe1d98f93e 100644 --- a/drivers/net/enc28j60.c +++ b/drivers/net/enc28j60.c | |||
@@ -944,7 +944,7 @@ static void enc28j60_hw_rx(struct net_device *ndev) | |||
944 | if (netif_msg_rx_status(priv)) | 944 | if (netif_msg_rx_status(priv)) |
945 | enc28j60_dump_rsv(priv, __func__, next_packet, len, rxstat); | 945 | enc28j60_dump_rsv(priv, __func__, next_packet, len, rxstat); |
946 | 946 | ||
947 | if (!RSV_GETBIT(rxstat, RSV_RXOK)) { | 947 | if (!RSV_GETBIT(rxstat, RSV_RXOK) || len > MAX_FRAMELEN) { |
948 | if (netif_msg_rx_err(priv)) | 948 | if (netif_msg_rx_err(priv)) |
949 | dev_err(&ndev->dev, "Rx Error (%04x)\n", rxstat); | 949 | dev_err(&ndev->dev, "Rx Error (%04x)\n", rxstat); |
950 | ndev->stats.rx_errors++; | 950 | ndev->stats.rx_errors++; |
@@ -952,6 +952,8 @@ static void enc28j60_hw_rx(struct net_device *ndev) | |||
952 | ndev->stats.rx_crc_errors++; | 952 | ndev->stats.rx_crc_errors++; |
953 | if (RSV_GETBIT(rxstat, RSV_LENCHECKERR)) | 953 | if (RSV_GETBIT(rxstat, RSV_LENCHECKERR)) |
954 | ndev->stats.rx_frame_errors++; | 954 | ndev->stats.rx_frame_errors++; |
955 | if (len > MAX_FRAMELEN) | ||
956 | ndev->stats.rx_over_errors++; | ||
955 | } else { | 957 | } else { |
956 | skb = dev_alloc_skb(len + NET_IP_ALIGN); | 958 | skb = dev_alloc_skb(len + NET_IP_ALIGN); |
957 | if (!skb) { | 959 | if (!skb) { |
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index 5e70180bf569..6bb71b687f7b 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c | |||
@@ -75,7 +75,7 @@ | |||
75 | #include "myri10ge_mcp.h" | 75 | #include "myri10ge_mcp.h" |
76 | #include "myri10ge_mcp_gen_header.h" | 76 | #include "myri10ge_mcp_gen_header.h" |
77 | 77 | ||
78 | #define MYRI10GE_VERSION_STR "1.4.4-1.395" | 78 | #define MYRI10GE_VERSION_STR "1.4.4-1.398" |
79 | 79 | ||
80 | MODULE_DESCRIPTION("Myricom 10G driver (10GbE)"); | 80 | MODULE_DESCRIPTION("Myricom 10G driver (10GbE)"); |
81 | MODULE_AUTHOR("Maintainer: help@myri.com"); | 81 | MODULE_AUTHOR("Maintainer: help@myri.com"); |
@@ -3929,6 +3929,10 @@ abort_with_firmware: | |||
3929 | myri10ge_dummy_rdma(mgp, 0); | 3929 | myri10ge_dummy_rdma(mgp, 0); |
3930 | 3930 | ||
3931 | abort_with_ioremap: | 3931 | abort_with_ioremap: |
3932 | if (mgp->mac_addr_string != NULL) | ||
3933 | dev_err(&pdev->dev, | ||
3934 | "myri10ge_probe() failed: MAC=%s, SN=%ld\n", | ||
3935 | mgp->mac_addr_string, mgp->serial_number); | ||
3932 | iounmap(mgp->sram); | 3936 | iounmap(mgp->sram); |
3933 | 3937 | ||
3934 | abort_with_mtrr: | 3938 | abort_with_mtrr: |
diff --git a/drivers/net/qlge/qlge.h b/drivers/net/qlge/qlge.h index ba2e1c5b6bcf..459663a4023d 100644 --- a/drivers/net/qlge/qlge.h +++ b/drivers/net/qlge/qlge.h | |||
@@ -818,15 +818,6 @@ struct tx_doorbell_context { | |||
818 | }; | 818 | }; |
819 | 819 | ||
820 | /* DATA STRUCTURES SHARED WITH HARDWARE. */ | 820 | /* DATA STRUCTURES SHARED WITH HARDWARE. */ |
821 | |||
822 | struct bq_element { | ||
823 | u32 addr_lo; | ||
824 | #define BQ_END 0x00000001 | ||
825 | #define BQ_CONT 0x00000002 | ||
826 | #define BQ_MASK 0x00000003 | ||
827 | u32 addr_hi; | ||
828 | } __attribute((packed)); | ||
829 | |||
830 | struct tx_buf_desc { | 821 | struct tx_buf_desc { |
831 | __le64 addr; | 822 | __le64 addr; |
832 | __le32 len; | 823 | __le32 len; |
@@ -860,8 +851,8 @@ struct ob_mac_iocb_req { | |||
860 | __le16 frame_len; | 851 | __le16 frame_len; |
861 | #define OB_MAC_IOCB_LEN_MASK 0x3ffff | 852 | #define OB_MAC_IOCB_LEN_MASK 0x3ffff |
862 | __le16 reserved2; | 853 | __le16 reserved2; |
863 | __le32 tid; | 854 | u32 tid; |
864 | __le32 txq_idx; | 855 | u32 txq_idx; |
865 | __le32 reserved3; | 856 | __le32 reserved3; |
866 | __le16 vlan_tci; | 857 | __le16 vlan_tci; |
867 | __le16 reserved4; | 858 | __le16 reserved4; |
@@ -880,8 +871,8 @@ struct ob_mac_iocb_rsp { | |||
880 | u8 flags2; /* */ | 871 | u8 flags2; /* */ |
881 | u8 flags3; /* */ | 872 | u8 flags3; /* */ |
882 | #define OB_MAC_IOCB_RSP_B 0x80 /* */ | 873 | #define OB_MAC_IOCB_RSP_B 0x80 /* */ |
883 | __le32 tid; | 874 | u32 tid; |
884 | __le32 txq_idx; | 875 | u32 txq_idx; |
885 | __le32 reserved[13]; | 876 | __le32 reserved[13]; |
886 | } __attribute((packed)); | 877 | } __attribute((packed)); |
887 | 878 | ||
@@ -903,8 +894,8 @@ struct ob_mac_tso_iocb_req { | |||
903 | #define OB_MAC_TSO_IOCB_V 0x04 | 894 | #define OB_MAC_TSO_IOCB_V 0x04 |
904 | __le32 reserved1[2]; | 895 | __le32 reserved1[2]; |
905 | __le32 frame_len; | 896 | __le32 frame_len; |
906 | __le32 tid; | 897 | u32 tid; |
907 | __le32 txq_idx; | 898 | u32 txq_idx; |
908 | __le16 total_hdrs_len; | 899 | __le16 total_hdrs_len; |
909 | __le16 net_trans_offset; | 900 | __le16 net_trans_offset; |
910 | #define OB_MAC_TRANSPORT_HDR_SHIFT 6 | 901 | #define OB_MAC_TRANSPORT_HDR_SHIFT 6 |
@@ -925,8 +916,8 @@ struct ob_mac_tso_iocb_rsp { | |||
925 | u8 flags2; /* */ | 916 | u8 flags2; /* */ |
926 | u8 flags3; /* */ | 917 | u8 flags3; /* */ |
927 | #define OB_MAC_TSO_IOCB_RSP_B 0x8000 | 918 | #define OB_MAC_TSO_IOCB_RSP_B 0x8000 |
928 | __le32 tid; | 919 | u32 tid; |
929 | __le32 txq_idx; | 920 | u32 txq_idx; |
930 | __le32 reserved2[13]; | 921 | __le32 reserved2[13]; |
931 | } __attribute((packed)); | 922 | } __attribute((packed)); |
932 | 923 | ||
@@ -979,10 +970,11 @@ struct ib_mac_iocb_rsp { | |||
979 | 970 | ||
980 | __le16 reserved1; | 971 | __le16 reserved1; |
981 | __le32 reserved2[6]; | 972 | __le32 reserved2[6]; |
982 | __le32 flags4; | 973 | u8 reserved3[3]; |
983 | #define IB_MAC_IOCB_RSP_HV 0x20000000 /* */ | 974 | u8 flags4; |
984 | #define IB_MAC_IOCB_RSP_HS 0x40000000 /* */ | 975 | #define IB_MAC_IOCB_RSP_HV 0x20 |
985 | #define IB_MAC_IOCB_RSP_HL 0x80000000 /* */ | 976 | #define IB_MAC_IOCB_RSP_HS 0x40 |
977 | #define IB_MAC_IOCB_RSP_HL 0x80 | ||
986 | __le32 hdr_len; /* */ | 978 | __le32 hdr_len; /* */ |
987 | __le32 hdr_addr_lo; /* */ | 979 | __le32 hdr_addr_lo; /* */ |
988 | __le32 hdr_addr_hi; /* */ | 980 | __le32 hdr_addr_hi; /* */ |
@@ -1126,7 +1118,7 @@ struct map_list { | |||
1126 | struct tx_ring_desc { | 1118 | struct tx_ring_desc { |
1127 | struct sk_buff *skb; | 1119 | struct sk_buff *skb; |
1128 | struct ob_mac_iocb_req *queue_entry; | 1120 | struct ob_mac_iocb_req *queue_entry; |
1129 | int index; | 1121 | u32 index; |
1130 | struct oal oal; | 1122 | struct oal oal; |
1131 | struct map_list map[MAX_SKB_FRAGS + 1]; | 1123 | struct map_list map[MAX_SKB_FRAGS + 1]; |
1132 | int map_cnt; | 1124 | int map_cnt; |
@@ -1138,8 +1130,8 @@ struct bq_desc { | |||
1138 | struct page *lbq_page; | 1130 | struct page *lbq_page; |
1139 | struct sk_buff *skb; | 1131 | struct sk_buff *skb; |
1140 | } p; | 1132 | } p; |
1141 | struct bq_element *bq; | 1133 | __le64 *addr; |
1142 | int index; | 1134 | u32 index; |
1143 | DECLARE_PCI_UNMAP_ADDR(mapaddr); | 1135 | DECLARE_PCI_UNMAP_ADDR(mapaddr); |
1144 | DECLARE_PCI_UNMAP_LEN(maplen); | 1136 | DECLARE_PCI_UNMAP_LEN(maplen); |
1145 | }; | 1137 | }; |
@@ -1189,7 +1181,7 @@ struct rx_ring { | |||
1189 | u32 cq_size; | 1181 | u32 cq_size; |
1190 | u32 cq_len; | 1182 | u32 cq_len; |
1191 | u16 cq_id; | 1183 | u16 cq_id; |
1192 | u32 *prod_idx_sh_reg; /* Shadowed producer register. */ | 1184 | volatile __le32 *prod_idx_sh_reg; /* Shadowed producer register. */ |
1193 | dma_addr_t prod_idx_sh_reg_dma; | 1185 | dma_addr_t prod_idx_sh_reg_dma; |
1194 | void __iomem *cnsmr_idx_db_reg; /* PCI doorbell mem area + 0 */ | 1186 | void __iomem *cnsmr_idx_db_reg; /* PCI doorbell mem area + 0 */ |
1195 | u32 cnsmr_idx; /* current sw idx */ | 1187 | u32 cnsmr_idx; /* current sw idx */ |
@@ -1467,21 +1459,6 @@ static inline void ql_write_db_reg(u32 val, void __iomem *addr) | |||
1467 | mmiowb(); | 1459 | mmiowb(); |
1468 | } | 1460 | } |
1469 | 1461 | ||
1470 | /* | ||
1471 | * Shadow Registers: | ||
1472 | * Outbound queues have a consumer index that is maintained by the chip. | ||
1473 | * Inbound queues have a producer index that is maintained by the chip. | ||
1474 | * For lower overhead, these registers are "shadowed" to host memory | ||
1475 | * which allows the device driver to track the queue progress without | ||
1476 | * PCI reads. When an entry is placed on an inbound queue, the chip will | ||
1477 | * update the relevant index register and then copy the value to the | ||
1478 | * shadow register in host memory. | ||
1479 | */ | ||
1480 | static inline unsigned int ql_read_sh_reg(const volatile void *addr) | ||
1481 | { | ||
1482 | return *(volatile unsigned int __force *)addr; | ||
1483 | } | ||
1484 | |||
1485 | extern char qlge_driver_name[]; | 1462 | extern char qlge_driver_name[]; |
1486 | extern const char qlge_driver_version[]; | 1463 | extern const char qlge_driver_version[]; |
1487 | extern const struct ethtool_ops qlge_ethtool_ops; | 1464 | extern const struct ethtool_ops qlge_ethtool_ops; |
diff --git a/drivers/net/qlge/qlge_dbg.c b/drivers/net/qlge/qlge_dbg.c index 47df304a02c8..3f5e02d2e4a9 100644 --- a/drivers/net/qlge/qlge_dbg.c +++ b/drivers/net/qlge/qlge_dbg.c | |||
@@ -821,14 +821,11 @@ void ql_dump_ib_mac_rsp(struct ib_mac_iocb_rsp *ib_mac_rsp) | |||
821 | le16_to_cpu(ib_mac_rsp->vlan_id)); | 821 | le16_to_cpu(ib_mac_rsp->vlan_id)); |
822 | 822 | ||
823 | printk(KERN_ERR PFX "flags4 = %s%s%s.\n", | 823 | printk(KERN_ERR PFX "flags4 = %s%s%s.\n", |
824 | le32_to_cpu(ib_mac_rsp-> | 824 | ib_mac_rsp->flags4 & IB_MAC_IOCB_RSP_HV ? "HV " : "", |
825 | flags4) & IB_MAC_IOCB_RSP_HV ? "HV " : "", | 825 | ib_mac_rsp->flags4 & IB_MAC_IOCB_RSP_HS ? "HS " : "", |
826 | le32_to_cpu(ib_mac_rsp-> | 826 | ib_mac_rsp->flags4 & IB_MAC_IOCB_RSP_HL ? "HL " : ""); |
827 | flags4) & IB_MAC_IOCB_RSP_HS ? "HS " : "", | 827 | |
828 | le32_to_cpu(ib_mac_rsp-> | 828 | if (ib_mac_rsp->flags4 & IB_MAC_IOCB_RSP_HV) { |
829 | flags4) & IB_MAC_IOCB_RSP_HL ? "HL " : ""); | ||
830 | |||
831 | if (le32_to_cpu(ib_mac_rsp->flags4) & IB_MAC_IOCB_RSP_HV) { | ||
832 | printk(KERN_ERR PFX "hdr length = %d.\n", | 829 | printk(KERN_ERR PFX "hdr length = %d.\n", |
833 | le32_to_cpu(ib_mac_rsp->hdr_len)); | 830 | le32_to_cpu(ib_mac_rsp->hdr_len)); |
834 | printk(KERN_ERR PFX "hdr addr_hi = 0x%x.\n", | 831 | printk(KERN_ERR PFX "hdr addr_hi = 0x%x.\n", |
diff --git a/drivers/net/qlge/qlge_ethtool.c b/drivers/net/qlge/qlge_ethtool.c index eefb81b13758..9d922e2ff226 100644 --- a/drivers/net/qlge/qlge_ethtool.c +++ b/drivers/net/qlge/qlge_ethtool.c | |||
@@ -56,9 +56,9 @@ static int ql_update_ring_coalescing(struct ql_adapter *qdev) | |||
56 | for (i = 1; i < qdev->rss_ring_first_cq_id; i++, rx_ring++) { | 56 | for (i = 1; i < qdev->rss_ring_first_cq_id; i++, rx_ring++) { |
57 | rx_ring = &qdev->rx_ring[i]; | 57 | rx_ring = &qdev->rx_ring[i]; |
58 | cqicb = (struct cqicb *)rx_ring; | 58 | cqicb = (struct cqicb *)rx_ring; |
59 | cqicb->irq_delay = le16_to_cpu(qdev->tx_coalesce_usecs); | 59 | cqicb->irq_delay = cpu_to_le16(qdev->tx_coalesce_usecs); |
60 | cqicb->pkt_delay = | 60 | cqicb->pkt_delay = |
61 | le16_to_cpu(qdev->tx_max_coalesced_frames); | 61 | cpu_to_le16(qdev->tx_max_coalesced_frames); |
62 | cqicb->flags = FLAGS_LI; | 62 | cqicb->flags = FLAGS_LI; |
63 | status = ql_write_cfg(qdev, cqicb, sizeof(cqicb), | 63 | status = ql_write_cfg(qdev, cqicb, sizeof(cqicb), |
64 | CFG_LCQ, rx_ring->cq_id); | 64 | CFG_LCQ, rx_ring->cq_id); |
@@ -79,9 +79,9 @@ static int ql_update_ring_coalescing(struct ql_adapter *qdev) | |||
79 | i++) { | 79 | i++) { |
80 | rx_ring = &qdev->rx_ring[i]; | 80 | rx_ring = &qdev->rx_ring[i]; |
81 | cqicb = (struct cqicb *)rx_ring; | 81 | cqicb = (struct cqicb *)rx_ring; |
82 | cqicb->irq_delay = le16_to_cpu(qdev->rx_coalesce_usecs); | 82 | cqicb->irq_delay = cpu_to_le16(qdev->rx_coalesce_usecs); |
83 | cqicb->pkt_delay = | 83 | cqicb->pkt_delay = |
84 | le16_to_cpu(qdev->rx_max_coalesced_frames); | 84 | cpu_to_le16(qdev->rx_max_coalesced_frames); |
85 | cqicb->flags = FLAGS_LI; | 85 | cqicb->flags = FLAGS_LI; |
86 | status = ql_write_cfg(qdev, cqicb, sizeof(cqicb), | 86 | status = ql_write_cfg(qdev, cqicb, sizeof(cqicb), |
87 | CFG_LCQ, rx_ring->cq_id); | 87 | CFG_LCQ, rx_ring->cq_id); |
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c index 718a7bd0cd1a..f4c016012f18 100644 --- a/drivers/net/qlge/qlge_main.c +++ b/drivers/net/qlge/qlge_main.c | |||
@@ -257,7 +257,7 @@ int ql_get_mac_addr_reg(struct ql_adapter *qdev, u32 type, u16 index, | |||
257 | { | 257 | { |
258 | status = | 258 | status = |
259 | ql_wait_reg_rdy(qdev, | 259 | ql_wait_reg_rdy(qdev, |
260 | MAC_ADDR_IDX, MAC_ADDR_MW, MAC_ADDR_E); | 260 | MAC_ADDR_IDX, MAC_ADDR_MW, 0); |
261 | if (status) | 261 | if (status) |
262 | goto exit; | 262 | goto exit; |
263 | ql_write32(qdev, MAC_ADDR_IDX, (offset++) | /* offset */ | 263 | ql_write32(qdev, MAC_ADDR_IDX, (offset++) | /* offset */ |
@@ -265,13 +265,13 @@ int ql_get_mac_addr_reg(struct ql_adapter *qdev, u32 type, u16 index, | |||
265 | MAC_ADDR_ADR | MAC_ADDR_RS | type); /* type */ | 265 | MAC_ADDR_ADR | MAC_ADDR_RS | type); /* type */ |
266 | status = | 266 | status = |
267 | ql_wait_reg_rdy(qdev, | 267 | ql_wait_reg_rdy(qdev, |
268 | MAC_ADDR_IDX, MAC_ADDR_MR, MAC_ADDR_E); | 268 | MAC_ADDR_IDX, MAC_ADDR_MR, 0); |
269 | if (status) | 269 | if (status) |
270 | goto exit; | 270 | goto exit; |
271 | *value++ = ql_read32(qdev, MAC_ADDR_DATA); | 271 | *value++ = ql_read32(qdev, MAC_ADDR_DATA); |
272 | status = | 272 | status = |
273 | ql_wait_reg_rdy(qdev, | 273 | ql_wait_reg_rdy(qdev, |
274 | MAC_ADDR_IDX, MAC_ADDR_MW, MAC_ADDR_E); | 274 | MAC_ADDR_IDX, MAC_ADDR_MW, 0); |
275 | if (status) | 275 | if (status) |
276 | goto exit; | 276 | goto exit; |
277 | ql_write32(qdev, MAC_ADDR_IDX, (offset++) | /* offset */ | 277 | ql_write32(qdev, MAC_ADDR_IDX, (offset++) | /* offset */ |
@@ -279,14 +279,14 @@ int ql_get_mac_addr_reg(struct ql_adapter *qdev, u32 type, u16 index, | |||
279 | MAC_ADDR_ADR | MAC_ADDR_RS | type); /* type */ | 279 | MAC_ADDR_ADR | MAC_ADDR_RS | type); /* type */ |
280 | status = | 280 | status = |
281 | ql_wait_reg_rdy(qdev, | 281 | ql_wait_reg_rdy(qdev, |
282 | MAC_ADDR_IDX, MAC_ADDR_MR, MAC_ADDR_E); | 282 | MAC_ADDR_IDX, MAC_ADDR_MR, 0); |
283 | if (status) | 283 | if (status) |
284 | goto exit; | 284 | goto exit; |
285 | *value++ = ql_read32(qdev, MAC_ADDR_DATA); | 285 | *value++ = ql_read32(qdev, MAC_ADDR_DATA); |
286 | if (type == MAC_ADDR_TYPE_CAM_MAC) { | 286 | if (type == MAC_ADDR_TYPE_CAM_MAC) { |
287 | status = | 287 | status = |
288 | ql_wait_reg_rdy(qdev, | 288 | ql_wait_reg_rdy(qdev, |
289 | MAC_ADDR_IDX, MAC_ADDR_MW, MAC_ADDR_E); | 289 | MAC_ADDR_IDX, MAC_ADDR_MW, 0); |
290 | if (status) | 290 | if (status) |
291 | goto exit; | 291 | goto exit; |
292 | ql_write32(qdev, MAC_ADDR_IDX, (offset++) | /* offset */ | 292 | ql_write32(qdev, MAC_ADDR_IDX, (offset++) | /* offset */ |
@@ -294,7 +294,7 @@ int ql_get_mac_addr_reg(struct ql_adapter *qdev, u32 type, u16 index, | |||
294 | MAC_ADDR_ADR | MAC_ADDR_RS | type); /* type */ | 294 | MAC_ADDR_ADR | MAC_ADDR_RS | type); /* type */ |
295 | status = | 295 | status = |
296 | ql_wait_reg_rdy(qdev, MAC_ADDR_IDX, | 296 | ql_wait_reg_rdy(qdev, MAC_ADDR_IDX, |
297 | MAC_ADDR_MR, MAC_ADDR_E); | 297 | MAC_ADDR_MR, 0); |
298 | if (status) | 298 | if (status) |
299 | goto exit; | 299 | goto exit; |
300 | *value++ = ql_read32(qdev, MAC_ADDR_DATA); | 300 | *value++ = ql_read32(qdev, MAC_ADDR_DATA); |
@@ -344,7 +344,7 @@ static int ql_set_mac_addr_reg(struct ql_adapter *qdev, u8 *addr, u32 type, | |||
344 | 344 | ||
345 | status = | 345 | status = |
346 | ql_wait_reg_rdy(qdev, | 346 | ql_wait_reg_rdy(qdev, |
347 | MAC_ADDR_IDX, MAC_ADDR_MW, MAC_ADDR_E); | 347 | MAC_ADDR_IDX, MAC_ADDR_MW, 0); |
348 | if (status) | 348 | if (status) |
349 | goto exit; | 349 | goto exit; |
350 | ql_write32(qdev, MAC_ADDR_IDX, (offset++) | /* offset */ | 350 | ql_write32(qdev, MAC_ADDR_IDX, (offset++) | /* offset */ |
@@ -353,7 +353,7 @@ static int ql_set_mac_addr_reg(struct ql_adapter *qdev, u8 *addr, u32 type, | |||
353 | ql_write32(qdev, MAC_ADDR_DATA, lower); | 353 | ql_write32(qdev, MAC_ADDR_DATA, lower); |
354 | status = | 354 | status = |
355 | ql_wait_reg_rdy(qdev, | 355 | ql_wait_reg_rdy(qdev, |
356 | MAC_ADDR_IDX, MAC_ADDR_MW, MAC_ADDR_E); | 356 | MAC_ADDR_IDX, MAC_ADDR_MW, 0); |
357 | if (status) | 357 | if (status) |
358 | goto exit; | 358 | goto exit; |
359 | ql_write32(qdev, MAC_ADDR_IDX, (offset++) | /* offset */ | 359 | ql_write32(qdev, MAC_ADDR_IDX, (offset++) | /* offset */ |
@@ -362,7 +362,7 @@ static int ql_set_mac_addr_reg(struct ql_adapter *qdev, u8 *addr, u32 type, | |||
362 | ql_write32(qdev, MAC_ADDR_DATA, upper); | 362 | ql_write32(qdev, MAC_ADDR_DATA, upper); |
363 | status = | 363 | status = |
364 | ql_wait_reg_rdy(qdev, | 364 | ql_wait_reg_rdy(qdev, |
365 | MAC_ADDR_IDX, MAC_ADDR_MW, MAC_ADDR_E); | 365 | MAC_ADDR_IDX, MAC_ADDR_MW, 0); |
366 | if (status) | 366 | if (status) |
367 | goto exit; | 367 | goto exit; |
368 | ql_write32(qdev, MAC_ADDR_IDX, (offset) | /* offset */ | 368 | ql_write32(qdev, MAC_ADDR_IDX, (offset) | /* offset */ |
@@ -400,7 +400,7 @@ static int ql_set_mac_addr_reg(struct ql_adapter *qdev, u8 *addr, u32 type, | |||
400 | 400 | ||
401 | status = | 401 | status = |
402 | ql_wait_reg_rdy(qdev, | 402 | ql_wait_reg_rdy(qdev, |
403 | MAC_ADDR_IDX, MAC_ADDR_MW, MAC_ADDR_E); | 403 | MAC_ADDR_IDX, MAC_ADDR_MW, 0); |
404 | if (status) | 404 | if (status) |
405 | goto exit; | 405 | goto exit; |
406 | ql_write32(qdev, MAC_ADDR_IDX, offset | /* offset */ | 406 | ql_write32(qdev, MAC_ADDR_IDX, offset | /* offset */ |
@@ -431,13 +431,13 @@ int ql_get_routing_reg(struct ql_adapter *qdev, u32 index, u32 *value) | |||
431 | if (status) | 431 | if (status) |
432 | goto exit; | 432 | goto exit; |
433 | 433 | ||
434 | status = ql_wait_reg_rdy(qdev, RT_IDX, RT_IDX_MW, RT_IDX_E); | 434 | status = ql_wait_reg_rdy(qdev, RT_IDX, RT_IDX_MW, 0); |
435 | if (status) | 435 | if (status) |
436 | goto exit; | 436 | goto exit; |
437 | 437 | ||
438 | ql_write32(qdev, RT_IDX, | 438 | ql_write32(qdev, RT_IDX, |
439 | RT_IDX_TYPE_NICQ | RT_IDX_RS | (index << RT_IDX_IDX_SHIFT)); | 439 | RT_IDX_TYPE_NICQ | RT_IDX_RS | (index << RT_IDX_IDX_SHIFT)); |
440 | status = ql_wait_reg_rdy(qdev, RT_IDX, RT_IDX_MR, RT_IDX_E); | 440 | status = ql_wait_reg_rdy(qdev, RT_IDX, RT_IDX_MR, 0); |
441 | if (status) | 441 | if (status) |
442 | goto exit; | 442 | goto exit; |
443 | *value = ql_read32(qdev, RT_DATA); | 443 | *value = ql_read32(qdev, RT_DATA); |
@@ -874,7 +874,6 @@ static void ql_update_lbq(struct ql_adapter *qdev, struct rx_ring *rx_ring) | |||
874 | { | 874 | { |
875 | int clean_idx = rx_ring->lbq_clean_idx; | 875 | int clean_idx = rx_ring->lbq_clean_idx; |
876 | struct bq_desc *lbq_desc; | 876 | struct bq_desc *lbq_desc; |
877 | struct bq_element *bq; | ||
878 | u64 map; | 877 | u64 map; |
879 | int i; | 878 | int i; |
880 | 879 | ||
@@ -884,7 +883,6 @@ static void ql_update_lbq(struct ql_adapter *qdev, struct rx_ring *rx_ring) | |||
884 | "lbq: try cleaning clean_idx = %d.\n", | 883 | "lbq: try cleaning clean_idx = %d.\n", |
885 | clean_idx); | 884 | clean_idx); |
886 | lbq_desc = &rx_ring->lbq[clean_idx]; | 885 | lbq_desc = &rx_ring->lbq[clean_idx]; |
887 | bq = lbq_desc->bq; | ||
888 | if (lbq_desc->p.lbq_page == NULL) { | 886 | if (lbq_desc->p.lbq_page == NULL) { |
889 | QPRINTK(qdev, RX_STATUS, DEBUG, | 887 | QPRINTK(qdev, RX_STATUS, DEBUG, |
890 | "lbq: getting new page for index %d.\n", | 888 | "lbq: getting new page for index %d.\n", |
@@ -906,10 +904,7 @@ static void ql_update_lbq(struct ql_adapter *qdev, struct rx_ring *rx_ring) | |||
906 | } | 904 | } |
907 | pci_unmap_addr_set(lbq_desc, mapaddr, map); | 905 | pci_unmap_addr_set(lbq_desc, mapaddr, map); |
908 | pci_unmap_len_set(lbq_desc, maplen, PAGE_SIZE); | 906 | pci_unmap_len_set(lbq_desc, maplen, PAGE_SIZE); |
909 | bq->addr_lo = /*lbq_desc->addr_lo = */ | 907 | *lbq_desc->addr = cpu_to_le64(map); |
910 | cpu_to_le32(map); | ||
911 | bq->addr_hi = /*lbq_desc->addr_hi = */ | ||
912 | cpu_to_le32(map >> 32); | ||
913 | } | 908 | } |
914 | clean_idx++; | 909 | clean_idx++; |
915 | if (clean_idx == rx_ring->lbq_len) | 910 | if (clean_idx == rx_ring->lbq_len) |
@@ -934,7 +929,6 @@ static void ql_update_sbq(struct ql_adapter *qdev, struct rx_ring *rx_ring) | |||
934 | { | 929 | { |
935 | int clean_idx = rx_ring->sbq_clean_idx; | 930 | int clean_idx = rx_ring->sbq_clean_idx; |
936 | struct bq_desc *sbq_desc; | 931 | struct bq_desc *sbq_desc; |
937 | struct bq_element *bq; | ||
938 | u64 map; | 932 | u64 map; |
939 | int i; | 933 | int i; |
940 | 934 | ||
@@ -944,7 +938,6 @@ static void ql_update_sbq(struct ql_adapter *qdev, struct rx_ring *rx_ring) | |||
944 | QPRINTK(qdev, RX_STATUS, DEBUG, | 938 | QPRINTK(qdev, RX_STATUS, DEBUG, |
945 | "sbq: try cleaning clean_idx = %d.\n", | 939 | "sbq: try cleaning clean_idx = %d.\n", |
946 | clean_idx); | 940 | clean_idx); |
947 | bq = sbq_desc->bq; | ||
948 | if (sbq_desc->p.skb == NULL) { | 941 | if (sbq_desc->p.skb == NULL) { |
949 | QPRINTK(qdev, RX_STATUS, DEBUG, | 942 | QPRINTK(qdev, RX_STATUS, DEBUG, |
950 | "sbq: getting new skb for index %d.\n", | 943 | "sbq: getting new skb for index %d.\n", |
@@ -963,11 +956,15 @@ static void ql_update_sbq(struct ql_adapter *qdev, struct rx_ring *rx_ring) | |||
963 | sbq_desc->p.skb->data, | 956 | sbq_desc->p.skb->data, |
964 | rx_ring->sbq_buf_size / | 957 | rx_ring->sbq_buf_size / |
965 | 2, PCI_DMA_FROMDEVICE); | 958 | 2, PCI_DMA_FROMDEVICE); |
959 | if (pci_dma_mapping_error(qdev->pdev, map)) { | ||
960 | QPRINTK(qdev, IFUP, ERR, "PCI mapping failed.\n"); | ||
961 | rx_ring->sbq_clean_idx = clean_idx; | ||
962 | return; | ||
963 | } | ||
966 | pci_unmap_addr_set(sbq_desc, mapaddr, map); | 964 | pci_unmap_addr_set(sbq_desc, mapaddr, map); |
967 | pci_unmap_len_set(sbq_desc, maplen, | 965 | pci_unmap_len_set(sbq_desc, maplen, |
968 | rx_ring->sbq_buf_size / 2); | 966 | rx_ring->sbq_buf_size / 2); |
969 | bq->addr_lo = cpu_to_le32(map); | 967 | *sbq_desc->addr = cpu_to_le64(map); |
970 | bq->addr_hi = cpu_to_le32(map >> 32); | ||
971 | } | 968 | } |
972 | 969 | ||
973 | clean_idx++; | 970 | clean_idx++; |
@@ -1303,6 +1300,11 @@ static struct sk_buff *ql_build_rx_skb(struct ql_adapter *qdev, | |||
1303 | "No skb available, drop the packet.\n"); | 1300 | "No skb available, drop the packet.\n"); |
1304 | return NULL; | 1301 | return NULL; |
1305 | } | 1302 | } |
1303 | pci_unmap_page(qdev->pdev, | ||
1304 | pci_unmap_addr(lbq_desc, | ||
1305 | mapaddr), | ||
1306 | pci_unmap_len(lbq_desc, maplen), | ||
1307 | PCI_DMA_FROMDEVICE); | ||
1306 | skb_reserve(skb, NET_IP_ALIGN); | 1308 | skb_reserve(skb, NET_IP_ALIGN); |
1307 | QPRINTK(qdev, RX_STATUS, DEBUG, | 1309 | QPRINTK(qdev, RX_STATUS, DEBUG, |
1308 | "%d bytes of headers and data in large. Chain page to new skb and pull tail.\n", length); | 1310 | "%d bytes of headers and data in large. Chain page to new skb and pull tail.\n", length); |
@@ -1330,7 +1332,7 @@ static struct sk_buff *ql_build_rx_skb(struct ql_adapter *qdev, | |||
1330 | * eventually be in trouble. | 1332 | * eventually be in trouble. |
1331 | */ | 1333 | */ |
1332 | int size, offset, i = 0; | 1334 | int size, offset, i = 0; |
1333 | struct bq_element *bq, bq_array[8]; | 1335 | __le64 *bq, bq_array[8]; |
1334 | sbq_desc = ql_get_curr_sbuf(rx_ring); | 1336 | sbq_desc = ql_get_curr_sbuf(rx_ring); |
1335 | pci_unmap_single(qdev->pdev, | 1337 | pci_unmap_single(qdev->pdev, |
1336 | pci_unmap_addr(sbq_desc, mapaddr), | 1338 | pci_unmap_addr(sbq_desc, mapaddr), |
@@ -1356,16 +1358,10 @@ static struct sk_buff *ql_build_rx_skb(struct ql_adapter *qdev, | |||
1356 | } else { | 1358 | } else { |
1357 | QPRINTK(qdev, RX_STATUS, DEBUG, | 1359 | QPRINTK(qdev, RX_STATUS, DEBUG, |
1358 | "Headers in small, %d bytes of data in chain of large.\n", length); | 1360 | "Headers in small, %d bytes of data in chain of large.\n", length); |
1359 | bq = (struct bq_element *)sbq_desc->p.skb->data; | 1361 | bq = (__le64 *)sbq_desc->p.skb->data; |
1360 | } | 1362 | } |
1361 | while (length > 0) { | 1363 | while (length > 0) { |
1362 | lbq_desc = ql_get_curr_lbuf(rx_ring); | 1364 | lbq_desc = ql_get_curr_lbuf(rx_ring); |
1363 | if ((bq->addr_lo & ~BQ_MASK) != lbq_desc->bq->addr_lo) { | ||
1364 | QPRINTK(qdev, RX_STATUS, ERR, | ||
1365 | "Panic!!! bad large buffer address, expected 0x%.08x, got 0x%.08x.\n", | ||
1366 | lbq_desc->bq->addr_lo, bq->addr_lo); | ||
1367 | return NULL; | ||
1368 | } | ||
1369 | pci_unmap_page(qdev->pdev, | 1365 | pci_unmap_page(qdev->pdev, |
1370 | pci_unmap_addr(lbq_desc, | 1366 | pci_unmap_addr(lbq_desc, |
1371 | mapaddr), | 1367 | mapaddr), |
@@ -1549,7 +1545,7 @@ static void ql_process_chip_ae_intr(struct ql_adapter *qdev, | |||
1549 | static int ql_clean_outbound_rx_ring(struct rx_ring *rx_ring) | 1545 | static int ql_clean_outbound_rx_ring(struct rx_ring *rx_ring) |
1550 | { | 1546 | { |
1551 | struct ql_adapter *qdev = rx_ring->qdev; | 1547 | struct ql_adapter *qdev = rx_ring->qdev; |
1552 | u32 prod = ql_read_sh_reg(rx_ring->prod_idx_sh_reg); | 1548 | u32 prod = le32_to_cpu(*rx_ring->prod_idx_sh_reg); |
1553 | struct ob_mac_iocb_rsp *net_rsp = NULL; | 1549 | struct ob_mac_iocb_rsp *net_rsp = NULL; |
1554 | int count = 0; | 1550 | int count = 0; |
1555 | 1551 | ||
@@ -1575,7 +1571,7 @@ static int ql_clean_outbound_rx_ring(struct rx_ring *rx_ring) | |||
1575 | } | 1571 | } |
1576 | count++; | 1572 | count++; |
1577 | ql_update_cq(rx_ring); | 1573 | ql_update_cq(rx_ring); |
1578 | prod = ql_read_sh_reg(rx_ring->prod_idx_sh_reg); | 1574 | prod = le32_to_cpu(*rx_ring->prod_idx_sh_reg); |
1579 | } | 1575 | } |
1580 | ql_write_cq_idx(rx_ring); | 1576 | ql_write_cq_idx(rx_ring); |
1581 | if (netif_queue_stopped(qdev->ndev) && net_rsp != NULL) { | 1577 | if (netif_queue_stopped(qdev->ndev) && net_rsp != NULL) { |
@@ -1595,7 +1591,7 @@ static int ql_clean_outbound_rx_ring(struct rx_ring *rx_ring) | |||
1595 | static int ql_clean_inbound_rx_ring(struct rx_ring *rx_ring, int budget) | 1591 | static int ql_clean_inbound_rx_ring(struct rx_ring *rx_ring, int budget) |
1596 | { | 1592 | { |
1597 | struct ql_adapter *qdev = rx_ring->qdev; | 1593 | struct ql_adapter *qdev = rx_ring->qdev; |
1598 | u32 prod = ql_read_sh_reg(rx_ring->prod_idx_sh_reg); | 1594 | u32 prod = le32_to_cpu(*rx_ring->prod_idx_sh_reg); |
1599 | struct ql_net_rsp_iocb *net_rsp; | 1595 | struct ql_net_rsp_iocb *net_rsp; |
1600 | int count = 0; | 1596 | int count = 0; |
1601 | 1597 | ||
@@ -1628,7 +1624,7 @@ static int ql_clean_inbound_rx_ring(struct rx_ring *rx_ring, int budget) | |||
1628 | } | 1624 | } |
1629 | count++; | 1625 | count++; |
1630 | ql_update_cq(rx_ring); | 1626 | ql_update_cq(rx_ring); |
1631 | prod = ql_read_sh_reg(rx_ring->prod_idx_sh_reg); | 1627 | prod = le32_to_cpu(*rx_ring->prod_idx_sh_reg); |
1632 | if (count == budget) | 1628 | if (count == budget) |
1633 | break; | 1629 | break; |
1634 | } | 1630 | } |
@@ -1791,7 +1787,7 @@ static irqreturn_t qlge_isr(int irq, void *dev_id) | |||
1791 | * Check the default queue and wake handler if active. | 1787 | * Check the default queue and wake handler if active. |
1792 | */ | 1788 | */ |
1793 | rx_ring = &qdev->rx_ring[0]; | 1789 | rx_ring = &qdev->rx_ring[0]; |
1794 | if (ql_read_sh_reg(rx_ring->prod_idx_sh_reg) != rx_ring->cnsmr_idx) { | 1790 | if (le32_to_cpu(*rx_ring->prod_idx_sh_reg) != rx_ring->cnsmr_idx) { |
1795 | QPRINTK(qdev, INTR, INFO, "Waking handler for rx_ring[0].\n"); | 1791 | QPRINTK(qdev, INTR, INFO, "Waking handler for rx_ring[0].\n"); |
1796 | ql_disable_completion_interrupt(qdev, intr_context->intr); | 1792 | ql_disable_completion_interrupt(qdev, intr_context->intr); |
1797 | queue_delayed_work_on(smp_processor_id(), qdev->q_workqueue, | 1793 | queue_delayed_work_on(smp_processor_id(), qdev->q_workqueue, |
@@ -1805,7 +1801,7 @@ static irqreturn_t qlge_isr(int irq, void *dev_id) | |||
1805 | */ | 1801 | */ |
1806 | for (i = 1; i < qdev->rx_ring_count; i++) { | 1802 | for (i = 1; i < qdev->rx_ring_count; i++) { |
1807 | rx_ring = &qdev->rx_ring[i]; | 1803 | rx_ring = &qdev->rx_ring[i]; |
1808 | if (ql_read_sh_reg(rx_ring->prod_idx_sh_reg) != | 1804 | if (le32_to_cpu(*rx_ring->prod_idx_sh_reg) != |
1809 | rx_ring->cnsmr_idx) { | 1805 | rx_ring->cnsmr_idx) { |
1810 | QPRINTK(qdev, INTR, INFO, | 1806 | QPRINTK(qdev, INTR, INFO, |
1811 | "Waking handler for rx_ring[%d].\n", i); | 1807 | "Waking handler for rx_ring[%d].\n", i); |
@@ -1874,7 +1870,7 @@ static void ql_hw_csum_setup(struct sk_buff *skb, | |||
1874 | { | 1870 | { |
1875 | int len; | 1871 | int len; |
1876 | struct iphdr *iph = ip_hdr(skb); | 1872 | struct iphdr *iph = ip_hdr(skb); |
1877 | u16 *check; | 1873 | __sum16 *check; |
1878 | mac_iocb_ptr->opcode = OPCODE_OB_MAC_TSO_IOCB; | 1874 | mac_iocb_ptr->opcode = OPCODE_OB_MAC_TSO_IOCB; |
1879 | mac_iocb_ptr->frame_len = cpu_to_le32((u32) skb->len); | 1875 | mac_iocb_ptr->frame_len = cpu_to_le32((u32) skb->len); |
1880 | mac_iocb_ptr->net_trans_offset = | 1876 | mac_iocb_ptr->net_trans_offset = |
@@ -2083,8 +2079,6 @@ static void ql_free_lbq_buffers(struct ql_adapter *qdev, struct rx_ring *rx_ring | |||
2083 | put_page(lbq_desc->p.lbq_page); | 2079 | put_page(lbq_desc->p.lbq_page); |
2084 | lbq_desc->p.lbq_page = NULL; | 2080 | lbq_desc->p.lbq_page = NULL; |
2085 | } | 2081 | } |
2086 | lbq_desc->bq->addr_lo = 0; | ||
2087 | lbq_desc->bq->addr_hi = 0; | ||
2088 | } | 2082 | } |
2089 | } | 2083 | } |
2090 | 2084 | ||
@@ -2097,12 +2091,12 @@ static int ql_alloc_lbq_buffers(struct ql_adapter *qdev, | |||
2097 | int i; | 2091 | int i; |
2098 | struct bq_desc *lbq_desc; | 2092 | struct bq_desc *lbq_desc; |
2099 | u64 map; | 2093 | u64 map; |
2100 | struct bq_element *bq = rx_ring->lbq_base; | 2094 | __le64 *bq = rx_ring->lbq_base; |
2101 | 2095 | ||
2102 | for (i = 0; i < rx_ring->lbq_len; i++) { | 2096 | for (i = 0; i < rx_ring->lbq_len; i++) { |
2103 | lbq_desc = &rx_ring->lbq[i]; | 2097 | lbq_desc = &rx_ring->lbq[i]; |
2104 | memset(lbq_desc, 0, sizeof(lbq_desc)); | 2098 | memset(lbq_desc, 0, sizeof(lbq_desc)); |
2105 | lbq_desc->bq = bq; | 2099 | lbq_desc->addr = bq; |
2106 | lbq_desc->index = i; | 2100 | lbq_desc->index = i; |
2107 | lbq_desc->p.lbq_page = alloc_page(GFP_ATOMIC); | 2101 | lbq_desc->p.lbq_page = alloc_page(GFP_ATOMIC); |
2108 | if (unlikely(!lbq_desc->p.lbq_page)) { | 2102 | if (unlikely(!lbq_desc->p.lbq_page)) { |
@@ -2119,8 +2113,7 @@ static int ql_alloc_lbq_buffers(struct ql_adapter *qdev, | |||
2119 | } | 2113 | } |
2120 | pci_unmap_addr_set(lbq_desc, mapaddr, map); | 2114 | pci_unmap_addr_set(lbq_desc, mapaddr, map); |
2121 | pci_unmap_len_set(lbq_desc, maplen, PAGE_SIZE); | 2115 | pci_unmap_len_set(lbq_desc, maplen, PAGE_SIZE); |
2122 | bq->addr_lo = cpu_to_le32(map); | 2116 | *lbq_desc->addr = cpu_to_le64(map); |
2123 | bq->addr_hi = cpu_to_le32(map >> 32); | ||
2124 | } | 2117 | } |
2125 | bq++; | 2118 | bq++; |
2126 | } | 2119 | } |
@@ -2149,13 +2142,6 @@ static void ql_free_sbq_buffers(struct ql_adapter *qdev, struct rx_ring *rx_ring | |||
2149 | dev_kfree_skb(sbq_desc->p.skb); | 2142 | dev_kfree_skb(sbq_desc->p.skb); |
2150 | sbq_desc->p.skb = NULL; | 2143 | sbq_desc->p.skb = NULL; |
2151 | } | 2144 | } |
2152 | if (sbq_desc->bq == NULL) { | ||
2153 | QPRINTK(qdev, IFUP, ERR, "sbq_desc->bq %d is NULL.\n", | ||
2154 | i); | ||
2155 | return; | ||
2156 | } | ||
2157 | sbq_desc->bq->addr_lo = 0; | ||
2158 | sbq_desc->bq->addr_hi = 0; | ||
2159 | } | 2145 | } |
2160 | } | 2146 | } |
2161 | 2147 | ||
@@ -2167,13 +2153,13 @@ static int ql_alloc_sbq_buffers(struct ql_adapter *qdev, | |||
2167 | struct bq_desc *sbq_desc; | 2153 | struct bq_desc *sbq_desc; |
2168 | struct sk_buff *skb; | 2154 | struct sk_buff *skb; |
2169 | u64 map; | 2155 | u64 map; |
2170 | struct bq_element *bq = rx_ring->sbq_base; | 2156 | __le64 *bq = rx_ring->sbq_base; |
2171 | 2157 | ||
2172 | for (i = 0; i < rx_ring->sbq_len; i++) { | 2158 | for (i = 0; i < rx_ring->sbq_len; i++) { |
2173 | sbq_desc = &rx_ring->sbq[i]; | 2159 | sbq_desc = &rx_ring->sbq[i]; |
2174 | memset(sbq_desc, 0, sizeof(sbq_desc)); | 2160 | memset(sbq_desc, 0, sizeof(sbq_desc)); |
2175 | sbq_desc->index = i; | 2161 | sbq_desc->index = i; |
2176 | sbq_desc->bq = bq; | 2162 | sbq_desc->addr = bq; |
2177 | skb = netdev_alloc_skb(qdev->ndev, rx_ring->sbq_buf_size); | 2163 | skb = netdev_alloc_skb(qdev->ndev, rx_ring->sbq_buf_size); |
2178 | if (unlikely(!skb)) { | 2164 | if (unlikely(!skb)) { |
2179 | /* Better luck next round */ | 2165 | /* Better luck next round */ |
@@ -2199,10 +2185,7 @@ static int ql_alloc_sbq_buffers(struct ql_adapter *qdev, | |||
2199 | } | 2185 | } |
2200 | pci_unmap_addr_set(sbq_desc, mapaddr, map); | 2186 | pci_unmap_addr_set(sbq_desc, mapaddr, map); |
2201 | pci_unmap_len_set(sbq_desc, maplen, rx_ring->sbq_buf_size / 2); | 2187 | pci_unmap_len_set(sbq_desc, maplen, rx_ring->sbq_buf_size / 2); |
2202 | bq->addr_lo = /*sbq_desc->addr_lo = */ | 2188 | *sbq_desc->addr = cpu_to_le64(map); |
2203 | cpu_to_le32(map); | ||
2204 | bq->addr_hi = /*sbq_desc->addr_hi = */ | ||
2205 | cpu_to_le32(map >> 32); | ||
2206 | bq++; | 2189 | bq++; |
2207 | } | 2190 | } |
2208 | return 0; | 2191 | return 0; |
@@ -2481,7 +2464,8 @@ static int ql_start_rx_ring(struct ql_adapter *qdev, struct rx_ring *rx_ring) | |||
2481 | memset((void *)cqicb, 0, sizeof(struct cqicb)); | 2464 | memset((void *)cqicb, 0, sizeof(struct cqicb)); |
2482 | cqicb->msix_vect = rx_ring->irq; | 2465 | cqicb->msix_vect = rx_ring->irq; |
2483 | 2466 | ||
2484 | cqicb->len = cpu_to_le16(rx_ring->cq_len | LEN_V | LEN_CPP_CONT); | 2467 | bq_len = (rx_ring->cq_len == 65536) ? 0 : (u16) rx_ring->cq_len; |
2468 | cqicb->len = cpu_to_le16(bq_len | LEN_V | LEN_CPP_CONT); | ||
2485 | 2469 | ||
2486 | cqicb->addr_lo = cpu_to_le32(rx_ring->cq_base_dma); | 2470 | cqicb->addr_lo = cpu_to_le32(rx_ring->cq_base_dma); |
2487 | cqicb->addr_hi = cpu_to_le32((u64) rx_ring->cq_base_dma >> 32); | 2471 | cqicb->addr_hi = cpu_to_le32((u64) rx_ring->cq_base_dma >> 32); |
@@ -2503,8 +2487,11 @@ static int ql_start_rx_ring(struct ql_adapter *qdev, struct rx_ring *rx_ring) | |||
2503 | cpu_to_le32(rx_ring->lbq_base_indirect_dma); | 2487 | cpu_to_le32(rx_ring->lbq_base_indirect_dma); |
2504 | cqicb->lbq_addr_hi = | 2488 | cqicb->lbq_addr_hi = |
2505 | cpu_to_le32((u64) rx_ring->lbq_base_indirect_dma >> 32); | 2489 | cpu_to_le32((u64) rx_ring->lbq_base_indirect_dma >> 32); |
2506 | cqicb->lbq_buf_size = cpu_to_le32(rx_ring->lbq_buf_size); | 2490 | bq_len = (rx_ring->lbq_buf_size == 65536) ? 0 : |
2507 | bq_len = (u16) rx_ring->lbq_len; | 2491 | (u16) rx_ring->lbq_buf_size; |
2492 | cqicb->lbq_buf_size = cpu_to_le16(bq_len); | ||
2493 | bq_len = (rx_ring->lbq_len == 65536) ? 0 : | ||
2494 | (u16) rx_ring->lbq_len; | ||
2508 | cqicb->lbq_len = cpu_to_le16(bq_len); | 2495 | cqicb->lbq_len = cpu_to_le16(bq_len); |
2509 | rx_ring->lbq_prod_idx = rx_ring->lbq_len - 16; | 2496 | rx_ring->lbq_prod_idx = rx_ring->lbq_len - 16; |
2510 | rx_ring->lbq_curr_idx = 0; | 2497 | rx_ring->lbq_curr_idx = 0; |
@@ -2520,7 +2507,8 @@ static int ql_start_rx_ring(struct ql_adapter *qdev, struct rx_ring *rx_ring) | |||
2520 | cpu_to_le32((u64) rx_ring->sbq_base_indirect_dma >> 32); | 2507 | cpu_to_le32((u64) rx_ring->sbq_base_indirect_dma >> 32); |
2521 | cqicb->sbq_buf_size = | 2508 | cqicb->sbq_buf_size = |
2522 | cpu_to_le16(((rx_ring->sbq_buf_size / 2) + 8) & 0xfffffff8); | 2509 | cpu_to_le16(((rx_ring->sbq_buf_size / 2) + 8) & 0xfffffff8); |
2523 | bq_len = (u16) rx_ring->sbq_len; | 2510 | bq_len = (rx_ring->sbq_len == 65536) ? 0 : |
2511 | (u16) rx_ring->sbq_len; | ||
2524 | cqicb->sbq_len = cpu_to_le16(bq_len); | 2512 | cqicb->sbq_len = cpu_to_le16(bq_len); |
2525 | rx_ring->sbq_prod_idx = rx_ring->sbq_len - 16; | 2513 | rx_ring->sbq_prod_idx = rx_ring->sbq_len - 16; |
2526 | rx_ring->sbq_curr_idx = 0; | 2514 | rx_ring->sbq_curr_idx = 0; |
@@ -3341,11 +3329,11 @@ static int ql_configure_rings(struct ql_adapter *qdev) | |||
3341 | rx_ring->cq_len * sizeof(struct ql_net_rsp_iocb); | 3329 | rx_ring->cq_len * sizeof(struct ql_net_rsp_iocb); |
3342 | rx_ring->lbq_len = NUM_LARGE_BUFFERS; | 3330 | rx_ring->lbq_len = NUM_LARGE_BUFFERS; |
3343 | rx_ring->lbq_size = | 3331 | rx_ring->lbq_size = |
3344 | rx_ring->lbq_len * sizeof(struct bq_element); | 3332 | rx_ring->lbq_len * sizeof(__le64); |
3345 | rx_ring->lbq_buf_size = LARGE_BUFFER_SIZE; | 3333 | rx_ring->lbq_buf_size = LARGE_BUFFER_SIZE; |
3346 | rx_ring->sbq_len = NUM_SMALL_BUFFERS; | 3334 | rx_ring->sbq_len = NUM_SMALL_BUFFERS; |
3347 | rx_ring->sbq_size = | 3335 | rx_ring->sbq_size = |
3348 | rx_ring->sbq_len * sizeof(struct bq_element); | 3336 | rx_ring->sbq_len * sizeof(__le64); |
3349 | rx_ring->sbq_buf_size = SMALL_BUFFER_SIZE * 2; | 3337 | rx_ring->sbq_buf_size = SMALL_BUFFER_SIZE * 2; |
3350 | rx_ring->type = DEFAULT_Q; | 3338 | rx_ring->type = DEFAULT_Q; |
3351 | } else if (i < qdev->rss_ring_first_cq_id) { | 3339 | } else if (i < qdev->rss_ring_first_cq_id) { |
@@ -3372,11 +3360,11 @@ static int ql_configure_rings(struct ql_adapter *qdev) | |||
3372 | rx_ring->cq_len * sizeof(struct ql_net_rsp_iocb); | 3360 | rx_ring->cq_len * sizeof(struct ql_net_rsp_iocb); |
3373 | rx_ring->lbq_len = NUM_LARGE_BUFFERS; | 3361 | rx_ring->lbq_len = NUM_LARGE_BUFFERS; |
3374 | rx_ring->lbq_size = | 3362 | rx_ring->lbq_size = |
3375 | rx_ring->lbq_len * sizeof(struct bq_element); | 3363 | rx_ring->lbq_len * sizeof(__le64); |
3376 | rx_ring->lbq_buf_size = LARGE_BUFFER_SIZE; | 3364 | rx_ring->lbq_buf_size = LARGE_BUFFER_SIZE; |
3377 | rx_ring->sbq_len = NUM_SMALL_BUFFERS; | 3365 | rx_ring->sbq_len = NUM_SMALL_BUFFERS; |
3378 | rx_ring->sbq_size = | 3366 | rx_ring->sbq_size = |
3379 | rx_ring->sbq_len * sizeof(struct bq_element); | 3367 | rx_ring->sbq_len * sizeof(__le64); |
3380 | rx_ring->sbq_buf_size = SMALL_BUFFER_SIZE * 2; | 3368 | rx_ring->sbq_buf_size = SMALL_BUFFER_SIZE * 2; |
3381 | rx_ring->type = RX_Q; | 3369 | rx_ring->type = RX_Q; |
3382 | } | 3370 | } |
diff --git a/drivers/net/starfire.c b/drivers/net/starfire.c index f54ac2389da2..57fb1f71c47b 100644 --- a/drivers/net/starfire.c +++ b/drivers/net/starfire.c | |||
@@ -42,11 +42,11 @@ | |||
42 | #include <linux/mii.h> | 42 | #include <linux/mii.h> |
43 | #include <linux/if_vlan.h> | 43 | #include <linux/if_vlan.h> |
44 | #include <linux/mm.h> | 44 | #include <linux/mm.h> |
45 | #include <linux/firmware.h> | ||
45 | #include <asm/processor.h> /* Processor type for cache alignment. */ | 46 | #include <asm/processor.h> /* Processor type for cache alignment. */ |
46 | #include <asm/uaccess.h> | 47 | #include <asm/uaccess.h> |
47 | #include <asm/io.h> | 48 | #include <asm/io.h> |
48 | 49 | ||
49 | #include "starfire_firmware.h" | ||
50 | /* | 50 | /* |
51 | * The current frame processor firmware fails to checksum a fragment | 51 | * The current frame processor firmware fails to checksum a fragment |
52 | * of length 1. If and when this is fixed, the #define below can be removed. | 52 | * of length 1. If and when this is fixed, the #define below can be removed. |
@@ -173,6 +173,10 @@ static int full_duplex[MAX_UNITS] = {0, }; | |||
173 | #define skb_first_frag_len(skb) skb_headlen(skb) | 173 | #define skb_first_frag_len(skb) skb_headlen(skb) |
174 | #define skb_num_frags(skb) (skb_shinfo(skb)->nr_frags + 1) | 174 | #define skb_num_frags(skb) (skb_shinfo(skb)->nr_frags + 1) |
175 | 175 | ||
176 | /* Firmware names */ | ||
177 | #define FIRMWARE_RX "adaptec/starfire_rx.bin" | ||
178 | #define FIRMWARE_TX "adaptec/starfire_tx.bin" | ||
179 | |||
176 | /* These identify the driver base version and may not be removed. */ | 180 | /* These identify the driver base version and may not be removed. */ |
177 | static char version[] = | 181 | static char version[] = |
178 | KERN_INFO "starfire.c:v1.03 7/26/2000 Written by Donald Becker <becker@scyld.com>\n" | 182 | KERN_INFO "starfire.c:v1.03 7/26/2000 Written by Donald Becker <becker@scyld.com>\n" |
@@ -182,6 +186,8 @@ MODULE_AUTHOR("Donald Becker <becker@scyld.com>"); | |||
182 | MODULE_DESCRIPTION("Adaptec Starfire Ethernet driver"); | 186 | MODULE_DESCRIPTION("Adaptec Starfire Ethernet driver"); |
183 | MODULE_LICENSE("GPL"); | 187 | MODULE_LICENSE("GPL"); |
184 | MODULE_VERSION(DRV_VERSION); | 188 | MODULE_VERSION(DRV_VERSION); |
189 | MODULE_FIRMWARE(FIRMWARE_RX); | ||
190 | MODULE_FIRMWARE(FIRMWARE_TX); | ||
185 | 191 | ||
186 | module_param(max_interrupt_work, int, 0); | 192 | module_param(max_interrupt_work, int, 0); |
187 | module_param(mtu, int, 0); | 193 | module_param(mtu, int, 0); |
@@ -902,9 +908,12 @@ static void mdio_write(struct net_device *dev, int phy_id, int location, int val | |||
902 | 908 | ||
903 | static int netdev_open(struct net_device *dev) | 909 | static int netdev_open(struct net_device *dev) |
904 | { | 910 | { |
911 | const struct firmware *fw_rx, *fw_tx; | ||
912 | const __be32 *fw_rx_data, *fw_tx_data; | ||
905 | struct netdev_private *np = netdev_priv(dev); | 913 | struct netdev_private *np = netdev_priv(dev); |
906 | void __iomem *ioaddr = np->base; | 914 | void __iomem *ioaddr = np->base; |
907 | int i, retval; | 915 | int i, retval; |
916 | size_t tx_size, rx_size; | ||
908 | size_t tx_done_q_size, rx_done_q_size, tx_ring_size, rx_ring_size; | 917 | size_t tx_done_q_size, rx_done_q_size, tx_ring_size, rx_ring_size; |
909 | 918 | ||
910 | /* Do we ever need to reset the chip??? */ | 919 | /* Do we ever need to reset the chip??? */ |
@@ -1040,11 +1049,40 @@ static int netdev_open(struct net_device *dev) | |||
1040 | writel(ETH_P_8021Q, ioaddr + VlanType); | 1049 | writel(ETH_P_8021Q, ioaddr + VlanType); |
1041 | #endif /* VLAN_SUPPORT */ | 1050 | #endif /* VLAN_SUPPORT */ |
1042 | 1051 | ||
1052 | retval = request_firmware(&fw_rx, FIRMWARE_RX, &np->pci_dev->dev); | ||
1053 | if (retval) { | ||
1054 | printk(KERN_ERR "starfire: Failed to load firmware \"%s\"\n", | ||
1055 | FIRMWARE_RX); | ||
1056 | return retval; | ||
1057 | } | ||
1058 | if (fw_rx->size % 4) { | ||
1059 | printk(KERN_ERR "starfire: bogus length %zu in \"%s\"\n", | ||
1060 | fw_rx->size, FIRMWARE_RX); | ||
1061 | retval = -EINVAL; | ||
1062 | goto out_rx; | ||
1063 | } | ||
1064 | retval = request_firmware(&fw_tx, FIRMWARE_TX, &np->pci_dev->dev); | ||
1065 | if (retval) { | ||
1066 | printk(KERN_ERR "starfire: Failed to load firmware \"%s\"\n", | ||
1067 | FIRMWARE_TX); | ||
1068 | goto out_rx; | ||
1069 | } | ||
1070 | if (fw_tx->size % 4) { | ||
1071 | printk(KERN_ERR "starfire: bogus length %zu in \"%s\"\n", | ||
1072 | fw_tx->size, FIRMWARE_TX); | ||
1073 | retval = -EINVAL; | ||
1074 | goto out_tx; | ||
1075 | } | ||
1076 | fw_rx_data = (const __be32 *)&fw_rx->data[0]; | ||
1077 | fw_tx_data = (const __be32 *)&fw_tx->data[0]; | ||
1078 | rx_size = fw_rx->size / 4; | ||
1079 | tx_size = fw_tx->size / 4; | ||
1080 | |||
1043 | /* Load Rx/Tx firmware into the frame processors */ | 1081 | /* Load Rx/Tx firmware into the frame processors */ |
1044 | for (i = 0; i < FIRMWARE_RX_SIZE * 2; i++) | 1082 | for (i = 0; i < rx_size; i++) |
1045 | writel(firmware_rx[i], ioaddr + RxGfpMem + i * 4); | 1083 | writel(be32_to_cpup(&fw_rx_data[i]), ioaddr + RxGfpMem + i * 4); |
1046 | for (i = 0; i < FIRMWARE_TX_SIZE * 2; i++) | 1084 | for (i = 0; i < tx_size; i++) |
1047 | writel(firmware_tx[i], ioaddr + TxGfpMem + i * 4); | 1085 | writel(be32_to_cpup(&fw_tx_data[i]), ioaddr + TxGfpMem + i * 4); |
1048 | if (enable_hw_cksum) | 1086 | if (enable_hw_cksum) |
1049 | /* Enable the Rx and Tx units, and the Rx/Tx frame processors. */ | 1087 | /* Enable the Rx and Tx units, and the Rx/Tx frame processors. */ |
1050 | writel(TxEnable|TxGFPEnable|RxEnable|RxGFPEnable, ioaddr + GenCtrl); | 1088 | writel(TxEnable|TxGFPEnable|RxEnable|RxGFPEnable, ioaddr + GenCtrl); |
@@ -1056,7 +1094,11 @@ static int netdev_open(struct net_device *dev) | |||
1056 | printk(KERN_DEBUG "%s: Done netdev_open().\n", | 1094 | printk(KERN_DEBUG "%s: Done netdev_open().\n", |
1057 | dev->name); | 1095 | dev->name); |
1058 | 1096 | ||
1059 | return 0; | 1097 | out_tx: |
1098 | release_firmware(fw_tx); | ||
1099 | out_rx: | ||
1100 | release_firmware(fw_rx); | ||
1101 | return retval; | ||
1060 | } | 1102 | } |
1061 | 1103 | ||
1062 | 1104 | ||
diff --git a/drivers/net/starfire_firmware.h b/drivers/net/starfire_firmware.h deleted file mode 100644 index 0a668528955d..000000000000 --- a/drivers/net/starfire_firmware.h +++ /dev/null | |||
@@ -1,346 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright 2003 Adaptec, Inc. | ||
3 | * | ||
4 | * Please read the following license before using the Adaptec Software | ||
5 | * ("Program"). If you do not agree to the license terms, do not use the | ||
6 | * Program: | ||
7 | * | ||
8 | * You agree to be bound by version 2 of the General Public License ("GPL") | ||
9 | * dated June 1991, which can be found at http://www.fsf.org/licenses/gpl.html. | ||
10 | * If the link is broken, write to Free Software Foundation, 59 Temple Place, | ||
11 | * Boston, Massachusetts 02111-1307. | ||
12 | * | ||
13 | * BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE IT IS LICENSED "AS IS" AND | ||
14 | * THERE IS NO WARRANTY FOR THE PROGRAM, INCLUDING BUT NOT LIMITED TO THE | ||
15 | * IMPLIED WARRANTIES OF MERCHANTIBILITY OR FITNESS FOR A PARTICULAR PURPOSE | ||
16 | * (TO THE EXTENT PERMITTED BY APPLICABLE LAW). USE OF THE PROGRAM IS AT YOUR | ||
17 | * OWN RISK. IN NO EVENT WILL ADAPTEC OR ITS LICENSORS BE LIABLE TO YOU FOR | ||
18 | * DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES | ||
19 | * ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM. | ||
20 | * | ||
21 | */ | ||
22 | |||
23 | static const u32 firmware_rx[] = { | ||
24 | 0x010003dc, 0x00000000, | ||
25 | 0x04000421, 0x00000086, | ||
26 | 0x80000015, 0x0000180e, | ||
27 | 0x81000015, 0x00006664, | ||
28 | 0x1a0040ab, 0x00000b06, | ||
29 | 0x14200011, 0x00000000, | ||
30 | 0x14204022, 0x0000aaaa, | ||
31 | 0x14204022, 0x00000300, | ||
32 | 0x14204022, 0x00000000, | ||
33 | 0x1a0040ab, 0x00000b14, | ||
34 | 0x14200011, 0x00000000, | ||
35 | 0x83000015, 0x00000002, | ||
36 | 0x04000021, 0x00000000, | ||
37 | 0x00000010, 0x00000000, | ||
38 | 0x04000421, 0x00000087, | ||
39 | 0x00000010, 0x00000000, | ||
40 | 0x00000010, 0x00000000, | ||
41 | 0x00008015, 0x00000000, | ||
42 | 0x0000003e, 0x00000000, | ||
43 | 0x00000010, 0x00000000, | ||
44 | 0x82000015, 0x00004000, | ||
45 | 0x009e8050, 0x00000000, | ||
46 | 0x03008015, 0x00000000, | ||
47 | 0x86008015, 0x00000000, | ||
48 | 0x82000015, 0x00008000, | ||
49 | 0x0100001c, 0x00000000, | ||
50 | 0x000050a0, 0x0000010c, | ||
51 | 0x4e20d011, 0x00006008, | ||
52 | 0x1420d012, 0x00004008, | ||
53 | 0x0000f090, 0x00007000, | ||
54 | 0x0000c8b0, 0x00003000, | ||
55 | 0x00004040, 0x00000000, | ||
56 | 0x00108015, 0x00000000, | ||
57 | 0x00a2c150, 0x00004000, | ||
58 | 0x00a400b0, 0x00000014, | ||
59 | 0x00000020, 0x00000000, | ||
60 | 0x2500400d, 0x00002525, | ||
61 | 0x00047220, 0x00003100, | ||
62 | 0x00934070, 0x00000000, | ||
63 | 0x00000020, 0x00000000, | ||
64 | 0x00924460, 0x00000184, | ||
65 | 0x2b20c011, 0x00000000, | ||
66 | 0x0000c420, 0x00000540, | ||
67 | 0x36014018, 0x0000422d, | ||
68 | 0x14200011, 0x00000000, | ||
69 | 0x00924460, 0x00000183, | ||
70 | 0x3200001f, 0x00000034, | ||
71 | 0x02ac0015, 0x00000002, | ||
72 | 0x00a60110, 0x00000008, | ||
73 | 0x42200011, 0x00000000, | ||
74 | 0x00924060, 0x00000103, | ||
75 | 0x0000001e, 0x00000000, | ||
76 | 0x00000020, 0x00000100, | ||
77 | 0x0000001e, 0x00000000, | ||
78 | 0x00924460, 0x00000086, | ||
79 | 0x00004080, 0x00000000, | ||
80 | 0x0092c070, 0x00000000, | ||
81 | 0x00924060, 0x00000100, | ||
82 | 0x0000c890, 0x00005000, | ||
83 | 0x00a6c110, 0x00000000, | ||
84 | 0x00b0c090, 0x00000012, | ||
85 | 0x021c0015, 0x00000000, | ||
86 | 0x3200001f, 0x00000034, | ||
87 | 0x00924460, 0x00000510, | ||
88 | 0x44210011, 0x00000000, | ||
89 | 0x42000011, 0x00000000, | ||
90 | 0x83000015, 0x00000040, | ||
91 | 0x00924460, 0x00000508, | ||
92 | 0x45014018, 0x00004545, | ||
93 | 0x00808050, 0x00000000, | ||
94 | 0x62208012, 0x00000000, | ||
95 | 0x82000015, 0x00000800, | ||
96 | 0x15200011, 0x00000000, | ||
97 | 0x00000010, 0x00000000, | ||
98 | 0x00000010, 0x00000000, | ||
99 | 0x00000010, 0x00000000, | ||
100 | 0x00000010, 0x00000000, | ||
101 | 0x00000010, 0x00000000, | ||
102 | 0x80000015, 0x0000eea4, | ||
103 | 0x81000015, 0x0000005f, | ||
104 | 0x00000060, 0x00000000, | ||
105 | 0x00004120, 0x00000000, | ||
106 | 0x00004a00, 0x00004000, | ||
107 | 0x00924460, 0x00000190, | ||
108 | 0x5601401a, 0x00005956, | ||
109 | 0x14000011, 0x00000000, | ||
110 | 0x00934050, 0x00000018, | ||
111 | 0x00930050, 0x00000018, | ||
112 | 0x3601403a, 0x0000002d, | ||
113 | 0x000643a9, 0x00000000, | ||
114 | 0x0000c420, 0x00000140, | ||
115 | 0x5601401a, 0x00005956, | ||
116 | 0x14000011, 0x00000000, | ||
117 | 0x00000010, 0x00000000, | ||
118 | 0x00000010, 0x00000000, | ||
119 | 0x000642a9, 0x00000000, | ||
120 | 0x00024420, 0x00000183, | ||
121 | 0x5601401a, 0x00005956, | ||
122 | 0x82000015, 0x00002000, | ||
123 | 0x15200011, 0x00000000, | ||
124 | 0x82000015, 0x00000010, | ||
125 | 0x15200011, 0x00000000, | ||
126 | 0x82000015, 0x00000010, | ||
127 | 0x15200011, 0x00000000, | ||
128 | }; /* 104 Rx instructions */ | ||
129 | #define FIRMWARE_RX_SIZE 104 | ||
130 | |||
131 | static const u32 firmware_tx[] = { | ||
132 | 0x010003dc, 0x00000000, | ||
133 | 0x04000421, 0x00000086, | ||
134 | 0x80000015, 0x0000180e, | ||
135 | 0x81000015, 0x00006664, | ||
136 | 0x1a0040ab, 0x00000b06, | ||
137 | 0x14200011, 0x00000000, | ||
138 | 0x14204022, 0x0000aaaa, | ||
139 | 0x14204022, 0x00000300, | ||
140 | 0x14204022, 0x00000000, | ||
141 | 0x1a0040ab, 0x00000b14, | ||
142 | 0x14200011, 0x00000000, | ||
143 | 0x83000015, 0x00000002, | ||
144 | 0x04000021, 0x00000000, | ||
145 | 0x00000010, 0x00000000, | ||
146 | 0x04000421, 0x00000087, | ||
147 | 0x00000010, 0x00000000, | ||
148 | 0x00000010, 0x00000000, | ||
149 | 0x00008015, 0x00000000, | ||
150 | 0x0000003e, 0x00000000, | ||
151 | 0x00000010, 0x00000000, | ||
152 | 0x82000015, 0x00004000, | ||
153 | 0x009e8050, 0x00000000, | ||
154 | 0x03008015, 0x00000000, | ||
155 | 0x86008015, 0x00000000, | ||
156 | 0x82000015, 0x00008000, | ||
157 | 0x0100001c, 0x00000000, | ||
158 | 0x000050a0, 0x0000010c, | ||
159 | 0x4e20d011, 0x00006008, | ||
160 | 0x1420d012, 0x00004008, | ||
161 | 0x0000f090, 0x00007000, | ||
162 | 0x0000c8b0, 0x00003000, | ||
163 | 0x00004040, 0x00000000, | ||
164 | 0x00108015, 0x00000000, | ||
165 | 0x00a2c150, 0x00004000, | ||
166 | 0x00a400b0, 0x00000014, | ||
167 | 0x00000020, 0x00000000, | ||
168 | 0x2500400d, 0x00002525, | ||
169 | 0x00047220, 0x00003100, | ||
170 | 0x00934070, 0x00000000, | ||
171 | 0x00000020, 0x00000000, | ||
172 | 0x00924460, 0x00000184, | ||
173 | 0x2b20c011, 0x00000000, | ||
174 | 0x0000c420, 0x00000540, | ||
175 | 0x36014018, 0x0000422d, | ||
176 | 0x14200011, 0x00000000, | ||
177 | 0x00924460, 0x00000183, | ||
178 | 0x3200001f, 0x00000034, | ||
179 | 0x02ac0015, 0x00000002, | ||
180 | 0x00a60110, 0x00000008, | ||
181 | 0x42200011, 0x00000000, | ||
182 | 0x00924060, 0x00000103, | ||
183 | 0x0000001e, 0x00000000, | ||
184 | 0x00000020, 0x00000100, | ||
185 | 0x0000001e, 0x00000000, | ||
186 | 0x00924460, 0x00000086, | ||
187 | 0x00004080, 0x00000000, | ||
188 | 0x0092c070, 0x00000000, | ||
189 | 0x00924060, 0x00000100, | ||
190 | 0x0000c890, 0x00005000, | ||
191 | 0x00a6c110, 0x00000000, | ||
192 | 0x00b0c090, 0x00000012, | ||
193 | 0x021c0015, 0x00000000, | ||
194 | 0x3200001f, 0x00000034, | ||
195 | 0x00924460, 0x00000510, | ||
196 | 0x44210011, 0x00000000, | ||
197 | 0x42000011, 0x00000000, | ||
198 | 0x83000015, 0x00000040, | ||
199 | 0x00924460, 0x00000508, | ||
200 | 0x45014018, 0x00004545, | ||
201 | 0x00808050, 0x00000000, | ||
202 | 0x62208012, 0x00000000, | ||
203 | 0x82000015, 0x00000800, | ||
204 | 0x15200011, 0x00000000, | ||
205 | 0x00000010, 0x00000000, | ||
206 | 0x00000010, 0x00000000, | ||
207 | 0x00000010, 0x00000000, | ||
208 | 0x00000010, 0x00000000, | ||
209 | 0x00000010, 0x00000000, | ||
210 | 0x80000015, 0x0000eea4, | ||
211 | 0x81000015, 0x0000005f, | ||
212 | 0x00000060, 0x00000000, | ||
213 | 0x00004120, 0x00000000, | ||
214 | 0x00004a00, 0x00004000, | ||
215 | 0x00924460, 0x00000190, | ||
216 | 0x5601401a, 0x00005956, | ||
217 | 0x14000011, 0x00000000, | ||
218 | 0x00934050, 0x00000018, | ||
219 | 0x00930050, 0x00000018, | ||
220 | 0x3601403a, 0x0000002d, | ||
221 | 0x000643a9, 0x00000000, | ||
222 | 0x0000c420, 0x00000140, | ||
223 | 0x5601401a, 0x00005956, | ||
224 | 0x14000011, 0x00000000, | ||
225 | 0x00000010, 0x00000000, | ||
226 | 0x00000010, 0x00000000, | ||
227 | 0x000642a9, 0x00000000, | ||
228 | 0x00024420, 0x00000183, | ||
229 | 0x5601401a, 0x00005956, | ||
230 | 0x82000015, 0x00002000, | ||
231 | 0x15200011, 0x00000000, | ||
232 | 0x82000015, 0x00000010, | ||
233 | 0x15200011, 0x00000000, | ||
234 | 0x82000015, 0x00000010, | ||
235 | 0x15200011, 0x00000000, | ||
236 | }; /* 104 Tx instructions */ | ||
237 | #define FIRMWARE_TX_SIZE 104 | ||
238 | #if 0 | ||
239 | static const u32 firmware_wol[] = { | ||
240 | 0x010003dc, 0x00000000, | ||
241 | 0x19000421, 0x00000087, | ||
242 | 0x80000015, 0x00001a1a, | ||
243 | 0x81000015, 0x00001a1a, | ||
244 | 0x1a0040ab, 0x00000b06, | ||
245 | 0x15200011, 0x00000000, | ||
246 | 0x15204022, 0x0000aaaa, | ||
247 | 0x15204022, 0x00000300, | ||
248 | 0x15204022, 0x00000000, | ||
249 | 0x1a0040ab, 0x00000b15, | ||
250 | 0x15200011, 0x00000000, | ||
251 | 0x83000015, 0x00000002, | ||
252 | 0x04000021, 0x00000000, | ||
253 | 0x00000010, 0x00000000, | ||
254 | 0x04000421, 0x00000087, | ||
255 | 0x00000010, 0x00000000, | ||
256 | 0x00000010, 0x00000000, | ||
257 | 0x00008015, 0x00000000, | ||
258 | 0x0000003e, 0x00000000, | ||
259 | 0x00000010, 0x00000000, | ||
260 | 0x00000010, 0x00000000, | ||
261 | 0x82000015, 0x00004000, | ||
262 | 0x82000015, 0x00008000, | ||
263 | 0x0000000c, 0x00000000, | ||
264 | 0x00000010, 0x00000000, | ||
265 | 0x00004080, 0x00000100, | ||
266 | 0x1f20c011, 0x00001122, | ||
267 | 0x2720f011, 0x00003011, | ||
268 | 0x19200071, 0x00000000, | ||
269 | 0x1a200051, 0x00000000, | ||
270 | 0x00000010, 0x00000000, | ||
271 | 0x00000010, 0x00000000, | ||
272 | 0x1d2040a4, 0x00003344, | ||
273 | 0x1d2040a2, 0x00005566, | ||
274 | 0x000040a0, 0x00000100, | ||
275 | 0x00108050, 0x00000001, | ||
276 | 0x1a208012, 0x00000006, | ||
277 | 0x82000015, 0x00008080, | ||
278 | 0x010003dc, 0x00000000, | ||
279 | 0x1d2040a4, 0x00002233, | ||
280 | 0x1d2040a4, 0x00004455, | ||
281 | 0x2d208011, 0x00000005, | ||
282 | 0x1d2040a4, 0x00006611, | ||
283 | 0x00108050, 0x00000001, | ||
284 | 0x27200011, 0x00000000, | ||
285 | 0x1d2050a4, 0x00006600, | ||
286 | 0x82000015, 0x00008080, | ||
287 | 0x010003dc, 0x00000000, | ||
288 | 0x00000050, 0x00000000, | ||
289 | 0x1b200031, 0x00000000, | ||
290 | 0x0000001e, 0x00000000, | ||
291 | 0x0000001e, 0x00000000, | ||
292 | 0x0000001e, 0x00000000, | ||
293 | 0x0000001e, 0x00000000, | ||
294 | 0x00924460, 0x00000086, | ||
295 | 0x00004080, 0x00000000, | ||
296 | 0x0092c070, 0x00000000, | ||
297 | 0x00924060, 0x00000100, | ||
298 | 0x0000c890, 0x00005000, | ||
299 | 0x00a6c110, 0x00000000, | ||
300 | 0x00b0c090, 0x00000012, | ||
301 | 0x021c0015, 0x00000000, | ||
302 | 0x3200001f, 0x00000034, | ||
303 | 0x00924460, 0x00000510, | ||
304 | 0x44210011, 0x00000000, | ||
305 | 0x42000011, 0x00000000, | ||
306 | 0x83000015, 0x00000040, | ||
307 | 0x00924460, 0x00000508, | ||
308 | 0x476a0012, 0x00000100, | ||
309 | 0x83000015, 0x00000008, | ||
310 | 0x16200011, 0x00000000, | ||
311 | 0x001e8050, 0x00000000, | ||
312 | 0x001e8050, 0x00000000, | ||
313 | 0x00808050, 0x00000000, | ||
314 | 0x03008015, 0x00000000, | ||
315 | 0x62208012, 0x00000000, | ||
316 | 0x82000015, 0x00000800, | ||
317 | 0x16200011, 0x00000000, | ||
318 | 0x80000015, 0x0000eea4, | ||
319 | 0x81000015, 0x0000005f, | ||
320 | 0x00000020, 0x00000000, | ||
321 | 0x00004120, 0x00000000, | ||
322 | 0x00004a00, 0x00004000, | ||
323 | 0x00924460, 0x00000190, | ||
324 | 0x5c01401a, 0x0000595c, | ||
325 | 0x15000011, 0x00000000, | ||
326 | 0x00934050, 0x00000018, | ||
327 | 0x00930050, 0x00000018, | ||
328 | 0x3601403a, 0x0000002d, | ||
329 | 0x00064029, 0x00000000, | ||
330 | 0x0000c420, 0x00000140, | ||
331 | 0x5c01401a, 0x0000595c, | ||
332 | 0x15000011, 0x00000000, | ||
333 | 0x00000010, 0x00000000, | ||
334 | 0x00000010, 0x00000000, | ||
335 | 0x00064029, 0x00000000, | ||
336 | 0x00024420, 0x00000183, | ||
337 | 0x5c01401a, 0x0000595c, | ||
338 | 0x82000015, 0x00002000, | ||
339 | 0x16200011, 0x00000000, | ||
340 | 0x82000015, 0x00000010, | ||
341 | 0x16200011, 0x00000000, | ||
342 | 0x82000015, 0x00000010, | ||
343 | 0x16200011, 0x00000000, | ||
344 | }; /* 104 WoL instructions */ | ||
345 | #define FIRMWARE_WOL_SIZE 104 | ||
346 | #endif | ||
diff --git a/drivers/net/starfire_firmware.pl b/drivers/net/starfire_firmware.pl deleted file mode 100644 index 0c82b80e1074..000000000000 --- a/drivers/net/starfire_firmware.pl +++ /dev/null | |||
@@ -1,31 +0,0 @@ | |||
1 | #!/usr/bin/perl | ||
2 | |||
3 | # This script can be used to generate a new starfire_firmware.h | ||
4 | # from GFP_RX.DAT and GFP_TX.DAT, files included with the DDK | ||
5 | # and also with the Novell drivers. | ||
6 | |||
7 | open FW, "GFP_RX.DAT" || die; | ||
8 | open FWH, ">starfire_firmware.h" || die; | ||
9 | |||
10 | printf(FWH "static u32 firmware_rx[] = {\n"); | ||
11 | $counter = 0; | ||
12 | while ($foo = <FW>) { | ||
13 | chomp; | ||
14 | printf(FWH " 0x%s, 0x0000%s,\n", substr($foo, 4, 8), substr($foo, 0, 4)); | ||
15 | $counter++; | ||
16 | } | ||
17 | |||
18 | close FW; | ||
19 | open FW, "GFP_TX.DAT" || die; | ||
20 | |||
21 | printf(FWH "};\t/* %d Rx instructions */\n#define FIRMWARE_RX_SIZE %d\n\nstatic u32 firmware_tx[] = {\n", $counter, $counter); | ||
22 | $counter = 0; | ||
23 | while ($foo = <FW>) { | ||
24 | chomp; | ||
25 | printf(FWH " 0x%s, 0x0000%s,\n", substr($foo, 4, 8), substr($foo, 0, 4)); | ||
26 | $counter++; | ||
27 | } | ||
28 | |||
29 | close FW; | ||
30 | printf(FWH "};\t/* %d Tx instructions */\n#define FIRMWARE_TX_SIZE %d\n", $counter, $counter); | ||
31 | close(FWH); | ||
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 04ae1e86aeaa..5e2dbaee125b 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -40,6 +40,7 @@ | |||
40 | #include <linux/workqueue.h> | 40 | #include <linux/workqueue.h> |
41 | #include <linux/prefetch.h> | 41 | #include <linux/prefetch.h> |
42 | #include <linux/dma-mapping.h> | 42 | #include <linux/dma-mapping.h> |
43 | #include <linux/firmware.h> | ||
43 | 44 | ||
44 | #include <net/checksum.h> | 45 | #include <net/checksum.h> |
45 | #include <net/ip.h> | 46 | #include <net/ip.h> |
@@ -137,6 +138,10 @@ | |||
137 | 138 | ||
138 | #define TG3_NUM_TEST 6 | 139 | #define TG3_NUM_TEST 6 |
139 | 140 | ||
141 | #define FIRMWARE_TG3 "tigon/tg3.bin" | ||
142 | #define FIRMWARE_TG3TSO "tigon/tg3_tso.bin" | ||
143 | #define FIRMWARE_TG3TSO5 "tigon/tg3_tso5.bin" | ||
144 | |||
140 | static char version[] __devinitdata = | 145 | static char version[] __devinitdata = |
141 | DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n"; | 146 | DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n"; |
142 | 147 | ||
@@ -144,6 +149,10 @@ MODULE_AUTHOR("David S. Miller (davem@redhat.com) and Jeff Garzik (jgarzik@pobox | |||
144 | MODULE_DESCRIPTION("Broadcom Tigon3 ethernet driver"); | 149 | MODULE_DESCRIPTION("Broadcom Tigon3 ethernet driver"); |
145 | MODULE_LICENSE("GPL"); | 150 | MODULE_LICENSE("GPL"); |
146 | MODULE_VERSION(DRV_MODULE_VERSION); | 151 | MODULE_VERSION(DRV_MODULE_VERSION); |
152 | MODULE_FIRMWARE(FIRMWARE_TG3); | ||
153 | MODULE_FIRMWARE(FIRMWARE_TG3TSO); | ||
154 | MODULE_FIRMWARE(FIRMWARE_TG3TSO5); | ||
155 | |||
147 | 156 | ||
148 | static int tg3_debug = -1; /* -1 == use TG3_DEF_MSG_ENABLE as value */ | 157 | static int tg3_debug = -1; /* -1 == use TG3_DEF_MSG_ENABLE as value */ |
149 | module_param(tg3_debug, int, 0); | 158 | module_param(tg3_debug, int, 0); |
@@ -6205,130 +6214,6 @@ static int tg3_halt(struct tg3 *tp, int kind, int silent) | |||
6205 | return 0; | 6214 | return 0; |
6206 | } | 6215 | } |
6207 | 6216 | ||
6208 | #define TG3_FW_RELEASE_MAJOR 0x0 | ||
6209 | #define TG3_FW_RELASE_MINOR 0x0 | ||
6210 | #define TG3_FW_RELEASE_FIX 0x0 | ||
6211 | #define TG3_FW_START_ADDR 0x08000000 | ||
6212 | #define TG3_FW_TEXT_ADDR 0x08000000 | ||
6213 | #define TG3_FW_TEXT_LEN 0x9c0 | ||
6214 | #define TG3_FW_RODATA_ADDR 0x080009c0 | ||
6215 | #define TG3_FW_RODATA_LEN 0x60 | ||
6216 | #define TG3_FW_DATA_ADDR 0x08000a40 | ||
6217 | #define TG3_FW_DATA_LEN 0x20 | ||
6218 | #define TG3_FW_SBSS_ADDR 0x08000a60 | ||
6219 | #define TG3_FW_SBSS_LEN 0xc | ||
6220 | #define TG3_FW_BSS_ADDR 0x08000a70 | ||
6221 | #define TG3_FW_BSS_LEN 0x10 | ||
6222 | |||
6223 | static const u32 tg3FwText[(TG3_FW_TEXT_LEN / sizeof(u32)) + 1] = { | ||
6224 | 0x00000000, 0x10000003, 0x00000000, 0x0000000d, 0x0000000d, 0x3c1d0800, | ||
6225 | 0x37bd3ffc, 0x03a0f021, 0x3c100800, 0x26100000, 0x0e000018, 0x00000000, | ||
6226 | 0x0000000d, 0x3c1d0800, 0x37bd3ffc, 0x03a0f021, 0x3c100800, 0x26100034, | ||
6227 | 0x0e00021c, 0x00000000, 0x0000000d, 0x00000000, 0x00000000, 0x00000000, | ||
6228 | 0x27bdffe0, 0x3c1cc000, 0xafbf0018, 0xaf80680c, 0x0e00004c, 0x241b2105, | ||
6229 | 0x97850000, 0x97870002, 0x9782002c, 0x9783002e, 0x3c040800, 0x248409c0, | ||
6230 | 0xafa00014, 0x00021400, 0x00621825, 0x00052c00, 0xafa30010, 0x8f860010, | ||
6231 | 0x00e52825, 0x0e000060, 0x24070102, 0x3c02ac00, 0x34420100, 0x3c03ac01, | ||
6232 | 0x34630100, 0xaf820490, 0x3c02ffff, 0xaf820494, 0xaf830498, 0xaf82049c, | ||
6233 | 0x24020001, 0xaf825ce0, 0x0e00003f, 0xaf825d00, 0x0e000140, 0x00000000, | ||
6234 | 0x8fbf0018, 0x03e00008, 0x27bd0020, 0x2402ffff, 0xaf825404, 0x8f835400, | ||
6235 | 0x34630400, 0xaf835400, 0xaf825404, 0x3c020800, 0x24420034, 0xaf82541c, | ||
6236 | 0x03e00008, 0xaf805400, 0x00000000, 0x00000000, 0x3c020800, 0x34423000, | ||
6237 | 0x3c030800, 0x34633000, 0x3c040800, 0x348437ff, 0x3c010800, 0xac220a64, | ||
6238 | 0x24020040, 0x3c010800, 0xac220a68, 0x3c010800, 0xac200a60, 0xac600000, | ||
6239 | 0x24630004, 0x0083102b, 0x5040fffd, 0xac600000, 0x03e00008, 0x00000000, | ||
6240 | 0x00804821, 0x8faa0010, 0x3c020800, 0x8c420a60, 0x3c040800, 0x8c840a68, | ||
6241 | 0x8fab0014, 0x24430001, 0x0044102b, 0x3c010800, 0xac230a60, 0x14400003, | ||
6242 | 0x00004021, 0x3c010800, 0xac200a60, 0x3c020800, 0x8c420a60, 0x3c030800, | ||
6243 | 0x8c630a64, 0x91240000, 0x00021140, 0x00431021, 0x00481021, 0x25080001, | ||
6244 | 0xa0440000, 0x29020008, 0x1440fff4, 0x25290001, 0x3c020800, 0x8c420a60, | ||
6245 | 0x3c030800, 0x8c630a64, 0x8f84680c, 0x00021140, 0x00431021, 0xac440008, | ||
6246 | 0xac45000c, 0xac460010, 0xac470014, 0xac4a0018, 0x03e00008, 0xac4b001c, | ||
6247 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
6248 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
6249 | 0, 0, 0, 0, 0, 0, | ||
6250 | 0x02000008, 0x00000000, 0x0a0001e3, 0x3c0a0001, 0x0a0001e3, 0x3c0a0002, | ||
6251 | 0x0a0001e3, 0x00000000, 0x0a0001e3, 0x00000000, 0x0a0001e3, 0x00000000, | ||
6252 | 0x0a0001e3, 0x00000000, 0x0a0001e3, 0x00000000, 0x0a0001e3, 0x00000000, | ||
6253 | 0x0a0001e3, 0x00000000, 0x0a0001e3, 0x00000000, 0x0a0001e3, 0x00000000, | ||
6254 | 0x0a0001e3, 0x3c0a0007, 0x0a0001e3, 0x3c0a0008, 0x0a0001e3, 0x3c0a0009, | ||
6255 | 0x0a0001e3, 0x00000000, 0x0a0001e3, 0x00000000, 0x0a0001e3, 0x3c0a000b, | ||
6256 | 0x0a0001e3, 0x3c0a000c, 0x0a0001e3, 0x3c0a000d, 0x0a0001e3, 0x00000000, | ||
6257 | 0x0a0001e3, 0x00000000, 0x0a0001e3, 0x3c0a000e, 0x0a0001e3, 0x00000000, | ||
6258 | 0x0a0001e3, 0x00000000, 0x0a0001e3, 0x00000000, 0x0a0001e3, 0x00000000, | ||
6259 | 0x0a0001e3, 0x00000000, 0x0a0001e3, 0x00000000, 0x0a0001e3, 0x00000000, | ||
6260 | 0x0a0001e3, 0x00000000, 0x0a0001e3, 0x3c0a0013, 0x0a0001e3, 0x3c0a0014, | ||
6261 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
6262 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
6263 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
6264 | 0x27bdffe0, 0x00001821, 0x00001021, 0xafbf0018, 0xafb10014, 0xafb00010, | ||
6265 | 0x3c010800, 0x00220821, 0xac200a70, 0x3c010800, 0x00220821, 0xac200a74, | ||
6266 | 0x3c010800, 0x00220821, 0xac200a78, 0x24630001, 0x1860fff5, 0x2442000c, | ||
6267 | 0x24110001, 0x8f906810, 0x32020004, 0x14400005, 0x24040001, 0x3c020800, | ||
6268 | 0x8c420a78, 0x18400003, 0x00002021, 0x0e000182, 0x00000000, 0x32020001, | ||
6269 | 0x10400003, 0x00000000, 0x0e000169, 0x00000000, 0x0a000153, 0xaf915028, | ||
6270 | 0x8fbf0018, 0x8fb10014, 0x8fb00010, 0x03e00008, 0x27bd0020, 0x3c050800, | ||
6271 | 0x8ca50a70, 0x3c060800, 0x8cc60a80, 0x3c070800, 0x8ce70a78, 0x27bdffe0, | ||
6272 | 0x3c040800, 0x248409d0, 0xafbf0018, 0xafa00010, 0x0e000060, 0xafa00014, | ||
6273 | 0x0e00017b, 0x00002021, 0x8fbf0018, 0x03e00008, 0x27bd0020, 0x24020001, | ||
6274 | 0x8f836810, 0x00821004, 0x00021027, 0x00621824, 0x03e00008, 0xaf836810, | ||
6275 | 0x27bdffd8, 0xafbf0024, 0x1080002e, 0xafb00020, 0x8f825cec, 0xafa20018, | ||
6276 | 0x8f825cec, 0x3c100800, 0x26100a78, 0xafa2001c, 0x34028000, 0xaf825cec, | ||
6277 | 0x8e020000, 0x18400016, 0x00000000, 0x3c020800, 0x94420a74, 0x8fa3001c, | ||
6278 | 0x000221c0, 0xac830004, 0x8fa2001c, 0x3c010800, 0x0e000201, 0xac220a74, | ||
6279 | 0x10400005, 0x00000000, 0x8e020000, 0x24420001, 0x0a0001df, 0xae020000, | ||
6280 | 0x3c020800, 0x8c420a70, 0x00021c02, 0x000321c0, 0x0a0001c5, 0xafa2001c, | ||
6281 | 0x0e000201, 0x00000000, 0x1040001f, 0x00000000, 0x8e020000, 0x8fa3001c, | ||
6282 | 0x24420001, 0x3c010800, 0xac230a70, 0x3c010800, 0xac230a74, 0x0a0001df, | ||
6283 | 0xae020000, 0x3c100800, 0x26100a78, 0x8e020000, 0x18400028, 0x00000000, | ||
6284 | 0x0e000201, 0x00000000, 0x14400024, 0x00000000, 0x8e020000, 0x3c030800, | ||
6285 | 0x8c630a70, 0x2442ffff, 0xafa3001c, 0x18400006, 0xae020000, 0x00031402, | ||
6286 | 0x000221c0, 0x8c820004, 0x3c010800, 0xac220a70, 0x97a2001e, 0x2442ff00, | ||
6287 | 0x2c420300, 0x1440000b, 0x24024000, 0x3c040800, 0x248409dc, 0xafa00010, | ||
6288 | 0xafa00014, 0x8fa6001c, 0x24050008, 0x0e000060, 0x00003821, 0x0a0001df, | ||
6289 | 0x00000000, 0xaf825cf8, 0x3c020800, 0x8c420a40, 0x8fa3001c, 0x24420001, | ||
6290 | 0xaf835cf8, 0x3c010800, 0xac220a40, 0x8fbf0024, 0x8fb00020, 0x03e00008, | ||
6291 | 0x27bd0028, 0x27bdffe0, 0x3c040800, 0x248409e8, 0x00002821, 0x00003021, | ||
6292 | 0x00003821, 0xafbf0018, 0xafa00010, 0x0e000060, 0xafa00014, 0x8fbf0018, | ||
6293 | 0x03e00008, 0x27bd0020, 0x8f82680c, 0x8f85680c, 0x00021827, 0x0003182b, | ||
6294 | 0x00031823, 0x00431024, 0x00441021, 0x00a2282b, 0x10a00006, 0x00000000, | ||
6295 | 0x00401821, 0x8f82680c, 0x0043102b, 0x1440fffd, 0x00000000, 0x03e00008, | ||
6296 | 0x00000000, 0x3c040800, 0x8c840000, 0x3c030800, 0x8c630a40, 0x0064102b, | ||
6297 | 0x54400002, 0x00831023, 0x00641023, 0x2c420008, 0x03e00008, 0x38420001, | ||
6298 | 0x27bdffe0, 0x00802821, 0x3c040800, 0x24840a00, 0x00003021, 0x00003821, | ||
6299 | 0xafbf0018, 0xafa00010, 0x0e000060, 0xafa00014, 0x0a000216, 0x00000000, | ||
6300 | 0x8fbf0018, 0x03e00008, 0x27bd0020, 0x00000000, 0x27bdffe0, 0x3c1cc000, | ||
6301 | 0xafbf0018, 0x0e00004c, 0xaf80680c, 0x3c040800, 0x24840a10, 0x03802821, | ||
6302 | 0x00003021, 0x00003821, 0xafa00010, 0x0e000060, 0xafa00014, 0x2402ffff, | ||
6303 | 0xaf825404, 0x3c0200aa, 0x0e000234, 0xaf825434, 0x8fbf0018, 0x03e00008, | ||
6304 | 0x27bd0020, 0x00000000, 0x00000000, 0x00000000, 0x27bdffe8, 0xafb00010, | ||
6305 | 0x24100001, 0xafbf0014, 0x3c01c003, 0xac200000, 0x8f826810, 0x30422000, | ||
6306 | 0x10400003, 0x00000000, 0x0e000246, 0x00000000, 0x0a00023a, 0xaf905428, | ||
6307 | 0x8fbf0014, 0x8fb00010, 0x03e00008, 0x27bd0018, 0x27bdfff8, 0x8f845d0c, | ||
6308 | 0x3c0200ff, 0x3c030800, 0x8c630a50, 0x3442fff8, 0x00821024, 0x1043001e, | ||
6309 | 0x3c0500ff, 0x34a5fff8, 0x3c06c003, 0x3c074000, 0x00851824, 0x8c620010, | ||
6310 | 0x3c010800, 0xac230a50, 0x30420008, 0x10400005, 0x00871025, 0x8cc20000, | ||
6311 | 0x24420001, 0xacc20000, 0x00871025, 0xaf825d0c, 0x8fa20000, 0x24420001, | ||
6312 | 0xafa20000, 0x8fa20000, 0x8fa20000, 0x24420001, 0xafa20000, 0x8fa20000, | ||
6313 | 0x8f845d0c, 0x3c030800, 0x8c630a50, 0x00851024, 0x1443ffe8, 0x00851824, | ||
6314 | 0x27bd0008, 0x03e00008, 0x00000000, 0x00000000, 0x00000000 | ||
6315 | }; | ||
6316 | |||
6317 | static const u32 tg3FwRodata[(TG3_FW_RODATA_LEN / sizeof(u32)) + 1] = { | ||
6318 | 0x35373031, 0x726c7341, 0x00000000, 0x00000000, 0x53774576, 0x656e7430, | ||
6319 | 0x00000000, 0x726c7045, 0x76656e74, 0x31000000, 0x556e6b6e, 0x45766e74, | ||
6320 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x66617461, 0x6c457272, | ||
6321 | 0x00000000, 0x00000000, 0x4d61696e, 0x43707542, 0x00000000, 0x00000000, | ||
6322 | 0x00000000 | ||
6323 | }; | ||
6324 | |||
6325 | #if 0 /* All zeros, don't eat up space with it. */ | ||
6326 | u32 tg3FwData[(TG3_FW_DATA_LEN / sizeof(u32)) + 1] = { | ||
6327 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, | ||
6328 | 0x00000000, 0x00000000, 0x00000000, 0x00000000 | ||
6329 | }; | ||
6330 | #endif | ||
6331 | |||
6332 | #define RX_CPU_SCRATCH_BASE 0x30000 | 6217 | #define RX_CPU_SCRATCH_BASE 0x30000 |
6333 | #define RX_CPU_SCRATCH_SIZE 0x04000 | 6218 | #define RX_CPU_SCRATCH_SIZE 0x04000 |
6334 | #define TX_CPU_SCRATCH_BASE 0x34000 | 6219 | #define TX_CPU_SCRATCH_BASE 0x34000 |
@@ -6383,15 +6268,9 @@ static int tg3_halt_cpu(struct tg3 *tp, u32 offset) | |||
6383 | } | 6268 | } |
6384 | 6269 | ||
6385 | struct fw_info { | 6270 | struct fw_info { |
6386 | unsigned int text_base; | 6271 | unsigned int fw_base; |
6387 | unsigned int text_len; | 6272 | unsigned int fw_len; |
6388 | const u32 *text_data; | 6273 | const __be32 *fw_data; |
6389 | unsigned int rodata_base; | ||
6390 | unsigned int rodata_len; | ||
6391 | const u32 *rodata_data; | ||
6392 | unsigned int data_base; | ||
6393 | unsigned int data_len; | ||
6394 | const u32 *data_data; | ||
6395 | }; | 6274 | }; |
6396 | 6275 | ||
6397 | /* tp->lock is held. */ | 6276 | /* tp->lock is held. */ |
@@ -6428,24 +6307,11 @@ static int tg3_load_firmware_cpu(struct tg3 *tp, u32 cpu_base, u32 cpu_scratch_b | |||
6428 | write_op(tp, cpu_scratch_base + i, 0); | 6307 | write_op(tp, cpu_scratch_base + i, 0); |
6429 | tw32(cpu_base + CPU_STATE, 0xffffffff); | 6308 | tw32(cpu_base + CPU_STATE, 0xffffffff); |
6430 | tw32(cpu_base + CPU_MODE, tr32(cpu_base+CPU_MODE)|CPU_MODE_HALT); | 6309 | tw32(cpu_base + CPU_MODE, tr32(cpu_base+CPU_MODE)|CPU_MODE_HALT); |
6431 | for (i = 0; i < (info->text_len / sizeof(u32)); i++) | 6310 | for (i = 0; i < (info->fw_len / sizeof(u32)); i++) |
6432 | write_op(tp, (cpu_scratch_base + | ||
6433 | (info->text_base & 0xffff) + | ||
6434 | (i * sizeof(u32))), | ||
6435 | (info->text_data ? | ||
6436 | info->text_data[i] : 0)); | ||
6437 | for (i = 0; i < (info->rodata_len / sizeof(u32)); i++) | ||
6438 | write_op(tp, (cpu_scratch_base + | ||
6439 | (info->rodata_base & 0xffff) + | ||
6440 | (i * sizeof(u32))), | ||
6441 | (info->rodata_data ? | ||
6442 | info->rodata_data[i] : 0)); | ||
6443 | for (i = 0; i < (info->data_len / sizeof(u32)); i++) | ||
6444 | write_op(tp, (cpu_scratch_base + | 6311 | write_op(tp, (cpu_scratch_base + |
6445 | (info->data_base & 0xffff) + | 6312 | (info->fw_base & 0xffff) + |
6446 | (i * sizeof(u32))), | 6313 | (i * sizeof(u32))), |
6447 | (info->data_data ? | 6314 | be32_to_cpu(info->fw_data[i])); |
6448 | info->data_data[i] : 0)); | ||
6449 | 6315 | ||
6450 | err = 0; | 6316 | err = 0; |
6451 | 6317 | ||
@@ -6457,17 +6323,20 @@ out: | |||
6457 | static int tg3_load_5701_a0_firmware_fix(struct tg3 *tp) | 6323 | static int tg3_load_5701_a0_firmware_fix(struct tg3 *tp) |
6458 | { | 6324 | { |
6459 | struct fw_info info; | 6325 | struct fw_info info; |
6326 | const __be32 *fw_data; | ||
6460 | int err, i; | 6327 | int err, i; |
6461 | 6328 | ||
6462 | info.text_base = TG3_FW_TEXT_ADDR; | 6329 | fw_data = (void *)tp->fw->data; |
6463 | info.text_len = TG3_FW_TEXT_LEN; | 6330 | |
6464 | info.text_data = &tg3FwText[0]; | 6331 | /* Firmware blob starts with version numbers, followed by |
6465 | info.rodata_base = TG3_FW_RODATA_ADDR; | 6332 | start address and length. We are setting complete length. |
6466 | info.rodata_len = TG3_FW_RODATA_LEN; | 6333 | length = end_address_of_bss - start_address_of_text. |
6467 | info.rodata_data = &tg3FwRodata[0]; | 6334 | Remainder is the blob to be loaded contiguously |
6468 | info.data_base = TG3_FW_DATA_ADDR; | 6335 | from start address. */ |
6469 | info.data_len = TG3_FW_DATA_LEN; | 6336 | |
6470 | info.data_data = NULL; | 6337 | info.fw_base = be32_to_cpu(fw_data[1]); |
6338 | info.fw_len = tp->fw->size - 12; | ||
6339 | info.fw_data = &fw_data[3]; | ||
6471 | 6340 | ||
6472 | err = tg3_load_firmware_cpu(tp, RX_CPU_BASE, | 6341 | err = tg3_load_firmware_cpu(tp, RX_CPU_BASE, |
6473 | RX_CPU_SCRATCH_BASE, RX_CPU_SCRATCH_SIZE, | 6342 | RX_CPU_SCRATCH_BASE, RX_CPU_SCRATCH_SIZE, |
@@ -6483,21 +6352,21 @@ static int tg3_load_5701_a0_firmware_fix(struct tg3 *tp) | |||
6483 | 6352 | ||
6484 | /* Now startup only the RX cpu. */ | 6353 | /* Now startup only the RX cpu. */ |
6485 | tw32(RX_CPU_BASE + CPU_STATE, 0xffffffff); | 6354 | tw32(RX_CPU_BASE + CPU_STATE, 0xffffffff); |
6486 | tw32_f(RX_CPU_BASE + CPU_PC, TG3_FW_TEXT_ADDR); | 6355 | tw32_f(RX_CPU_BASE + CPU_PC, info.fw_base); |
6487 | 6356 | ||
6488 | for (i = 0; i < 5; i++) { | 6357 | for (i = 0; i < 5; i++) { |
6489 | if (tr32(RX_CPU_BASE + CPU_PC) == TG3_FW_TEXT_ADDR) | 6358 | if (tr32(RX_CPU_BASE + CPU_PC) == info.fw_base) |
6490 | break; | 6359 | break; |
6491 | tw32(RX_CPU_BASE + CPU_STATE, 0xffffffff); | 6360 | tw32(RX_CPU_BASE + CPU_STATE, 0xffffffff); |
6492 | tw32(RX_CPU_BASE + CPU_MODE, CPU_MODE_HALT); | 6361 | tw32(RX_CPU_BASE + CPU_MODE, CPU_MODE_HALT); |
6493 | tw32_f(RX_CPU_BASE + CPU_PC, TG3_FW_TEXT_ADDR); | 6362 | tw32_f(RX_CPU_BASE + CPU_PC, info.fw_base); |
6494 | udelay(1000); | 6363 | udelay(1000); |
6495 | } | 6364 | } |
6496 | if (i >= 5) { | 6365 | if (i >= 5) { |
6497 | printk(KERN_ERR PFX "tg3_load_firmware fails for %s " | 6366 | printk(KERN_ERR PFX "tg3_load_firmware fails for %s " |
6498 | "to set RX CPU PC, is %08x should be %08x\n", | 6367 | "to set RX CPU PC, is %08x should be %08x\n", |
6499 | tp->dev->name, tr32(RX_CPU_BASE + CPU_PC), | 6368 | tp->dev->name, tr32(RX_CPU_BASE + CPU_PC), |
6500 | TG3_FW_TEXT_ADDR); | 6369 | info.fw_base); |
6501 | return -ENODEV; | 6370 | return -ENODEV; |
6502 | } | 6371 | } |
6503 | tw32(RX_CPU_BASE + CPU_STATE, 0xffffffff); | 6372 | tw32(RX_CPU_BASE + CPU_STATE, 0xffffffff); |
@@ -6506,547 +6375,36 @@ static int tg3_load_5701_a0_firmware_fix(struct tg3 *tp) | |||
6506 | return 0; | 6375 | return 0; |
6507 | } | 6376 | } |
6508 | 6377 | ||
6509 | |||
6510 | #define TG3_TSO_FW_RELEASE_MAJOR 0x1 | ||
6511 | #define TG3_TSO_FW_RELASE_MINOR 0x6 | ||
6512 | #define TG3_TSO_FW_RELEASE_FIX 0x0 | ||
6513 | #define TG3_TSO_FW_START_ADDR 0x08000000 | ||
6514 | #define TG3_TSO_FW_TEXT_ADDR 0x08000000 | ||
6515 | #define TG3_TSO_FW_TEXT_LEN 0x1aa0 | ||
6516 | #define TG3_TSO_FW_RODATA_ADDR 0x08001aa0 | ||
6517 | #define TG3_TSO_FW_RODATA_LEN 0x60 | ||
6518 | #define TG3_TSO_FW_DATA_ADDR 0x08001b20 | ||
6519 | #define TG3_TSO_FW_DATA_LEN 0x30 | ||
6520 | #define TG3_TSO_FW_SBSS_ADDR 0x08001b50 | ||
6521 | #define TG3_TSO_FW_SBSS_LEN 0x2c | ||
6522 | #define TG3_TSO_FW_BSS_ADDR 0x08001b80 | ||
6523 | #define TG3_TSO_FW_BSS_LEN 0x894 | ||
6524 | |||
6525 | static const u32 tg3TsoFwText[(TG3_TSO_FW_TEXT_LEN / 4) + 1] = { | ||
6526 | 0x0e000003, 0x00000000, 0x08001b24, 0x00000000, 0x10000003, 0x00000000, | ||
6527 | 0x0000000d, 0x0000000d, 0x3c1d0800, 0x37bd4000, 0x03a0f021, 0x3c100800, | ||
6528 | 0x26100000, 0x0e000010, 0x00000000, 0x0000000d, 0x27bdffe0, 0x3c04fefe, | ||
6529 | 0xafbf0018, 0x0e0005d8, 0x34840002, 0x0e000668, 0x00000000, 0x3c030800, | ||
6530 | 0x90631b68, 0x24020002, 0x3c040800, 0x24841aac, 0x14620003, 0x24050001, | ||
6531 | 0x3c040800, 0x24841aa0, 0x24060006, 0x00003821, 0xafa00010, 0x0e00067c, | ||
6532 | 0xafa00014, 0x8f625c50, 0x34420001, 0xaf625c50, 0x8f625c90, 0x34420001, | ||
6533 | 0xaf625c90, 0x2402ffff, 0x0e000034, 0xaf625404, 0x8fbf0018, 0x03e00008, | ||
6534 | 0x27bd0020, 0x00000000, 0x00000000, 0x00000000, 0x27bdffe0, 0xafbf001c, | ||
6535 | 0xafb20018, 0xafb10014, 0x0e00005b, 0xafb00010, 0x24120002, 0x24110001, | ||
6536 | 0x8f706820, 0x32020100, 0x10400003, 0x00000000, 0x0e0000bb, 0x00000000, | ||
6537 | 0x8f706820, 0x32022000, 0x10400004, 0x32020001, 0x0e0001f0, 0x24040001, | ||
6538 | 0x32020001, 0x10400003, 0x00000000, 0x0e0000a3, 0x00000000, 0x3c020800, | ||
6539 | 0x90421b98, 0x14520003, 0x00000000, 0x0e0004c0, 0x00000000, 0x0a00003c, | ||
6540 | 0xaf715028, 0x8fbf001c, 0x8fb20018, 0x8fb10014, 0x8fb00010, 0x03e00008, | ||
6541 | 0x27bd0020, 0x27bdffe0, 0x3c040800, 0x24841ac0, 0x00002821, 0x00003021, | ||
6542 | 0x00003821, 0xafbf0018, 0xafa00010, 0x0e00067c, 0xafa00014, 0x3c040800, | ||
6543 | 0x248423d8, 0xa4800000, 0x3c010800, 0xa0201b98, 0x3c010800, 0xac201b9c, | ||
6544 | 0x3c010800, 0xac201ba0, 0x3c010800, 0xac201ba4, 0x3c010800, 0xac201bac, | ||
6545 | 0x3c010800, 0xac201bb8, 0x3c010800, 0xac201bbc, 0x8f624434, 0x3c010800, | ||
6546 | 0xac221b88, 0x8f624438, 0x3c010800, 0xac221b8c, 0x8f624410, 0xac80f7a8, | ||
6547 | 0x3c010800, 0xac201b84, 0x3c010800, 0xac2023e0, 0x3c010800, 0xac2023c8, | ||
6548 | 0x3c010800, 0xac2023cc, 0x3c010800, 0xac202400, 0x3c010800, 0xac221b90, | ||
6549 | 0x8f620068, 0x24030007, 0x00021702, 0x10430005, 0x00000000, 0x8f620068, | ||
6550 | 0x00021702, 0x14400004, 0x24020001, 0x3c010800, 0x0a000097, 0xac20240c, | ||
6551 | 0xac820034, 0x3c040800, 0x24841acc, 0x3c050800, 0x8ca5240c, 0x00003021, | ||
6552 | 0x00003821, 0xafa00010, 0x0e00067c, 0xafa00014, 0x8fbf0018, 0x03e00008, | ||
6553 | 0x27bd0020, 0x27bdffe0, 0x3c040800, 0x24841ad8, 0x00002821, 0x00003021, | ||
6554 | 0x00003821, 0xafbf0018, 0xafa00010, 0x0e00067c, 0xafa00014, 0x0e00005b, | ||
6555 | 0x00000000, 0x0e0000b4, 0x00002021, 0x8fbf0018, 0x03e00008, 0x27bd0020, | ||
6556 | 0x24020001, 0x8f636820, 0x00821004, 0x00021027, 0x00621824, 0x03e00008, | ||
6557 | 0xaf636820, 0x27bdffd0, 0xafbf002c, 0xafb60028, 0xafb50024, 0xafb40020, | ||
6558 | 0xafb3001c, 0xafb20018, 0xafb10014, 0xafb00010, 0x8f675c5c, 0x3c030800, | ||
6559 | 0x24631bbc, 0x8c620000, 0x14470005, 0x3c0200ff, 0x3c020800, 0x90421b98, | ||
6560 | 0x14400119, 0x3c0200ff, 0x3442fff8, 0x00e28824, 0xac670000, 0x00111902, | ||
6561 | 0x306300ff, 0x30e20003, 0x000211c0, 0x00622825, 0x00a04021, 0x00071602, | ||
6562 | 0x3c030800, 0x90631b98, 0x3044000f, 0x14600036, 0x00804821, 0x24020001, | ||
6563 | 0x3c010800, 0xa0221b98, 0x00051100, 0x00821025, 0x3c010800, 0xac201b9c, | ||
6564 | 0x3c010800, 0xac201ba0, 0x3c010800, 0xac201ba4, 0x3c010800, 0xac201bac, | ||
6565 | 0x3c010800, 0xac201bb8, 0x3c010800, 0xac201bb0, 0x3c010800, 0xac201bb4, | ||
6566 | 0x3c010800, 0xa42223d8, 0x9622000c, 0x30437fff, 0x3c010800, 0xa4222410, | ||
6567 | 0x30428000, 0x3c010800, 0xa4231bc6, 0x10400005, 0x24020001, 0x3c010800, | ||
6568 | 0xac2223f4, 0x0a000102, 0x2406003e, 0x24060036, 0x3c010800, 0xac2023f4, | ||
6569 | 0x9622000a, 0x3c030800, 0x94631bc6, 0x3c010800, 0xac2023f0, 0x3c010800, | ||
6570 | 0xac2023f8, 0x00021302, 0x00021080, 0x00c21021, 0x00621821, 0x3c010800, | ||
6571 | 0xa42223d0, 0x3c010800, 0x0a000115, 0xa4231b96, 0x9622000c, 0x3c010800, | ||
6572 | 0xa42223ec, 0x3c040800, 0x24841b9c, 0x8c820000, 0x00021100, 0x3c010800, | ||
6573 | 0x00220821, 0xac311bc8, 0x8c820000, 0x00021100, 0x3c010800, 0x00220821, | ||
6574 | 0xac271bcc, 0x8c820000, 0x25030001, 0x306601ff, 0x00021100, 0x3c010800, | ||
6575 | 0x00220821, 0xac261bd0, 0x8c820000, 0x00021100, 0x3c010800, 0x00220821, | ||
6576 | 0xac291bd4, 0x96230008, 0x3c020800, 0x8c421bac, 0x00432821, 0x3c010800, | ||
6577 | 0xac251bac, 0x9622000a, 0x30420004, 0x14400018, 0x00061100, 0x8f630c14, | ||
6578 | 0x3063000f, 0x2c620002, 0x1440000b, 0x3c02c000, 0x8f630c14, 0x3c020800, | ||
6579 | 0x8c421b40, 0x3063000f, 0x24420001, 0x3c010800, 0xac221b40, 0x2c620002, | ||
6580 | 0x1040fff7, 0x3c02c000, 0x00e21825, 0xaf635c5c, 0x8f625c50, 0x30420002, | ||
6581 | 0x10400014, 0x00000000, 0x0a000147, 0x00000000, 0x3c030800, 0x8c631b80, | ||
6582 | 0x3c040800, 0x94841b94, 0x01221025, 0x3c010800, 0xa42223da, 0x24020001, | ||
6583 | 0x3c010800, 0xac221bb8, 0x24630001, 0x0085202a, 0x3c010800, 0x10800003, | ||
6584 | 0xac231b80, 0x3c010800, 0xa4251b94, 0x3c060800, 0x24c61b9c, 0x8cc20000, | ||
6585 | 0x24420001, 0xacc20000, 0x28420080, 0x14400005, 0x00000000, 0x0e000656, | ||
6586 | 0x24040002, 0x0a0001e6, 0x00000000, 0x3c020800, 0x8c421bb8, 0x10400078, | ||
6587 | 0x24020001, 0x3c050800, 0x90a51b98, 0x14a20072, 0x00000000, 0x3c150800, | ||
6588 | 0x96b51b96, 0x3c040800, 0x8c841bac, 0x32a3ffff, 0x0083102a, 0x1440006c, | ||
6589 | 0x00000000, 0x14830003, 0x00000000, 0x3c010800, 0xac2523f0, 0x1060005c, | ||
6590 | 0x00009021, 0x24d60004, 0x0060a021, 0x24d30014, 0x8ec20000, 0x00028100, | ||
6591 | 0x3c110800, 0x02308821, 0x0e000625, 0x8e311bc8, 0x00402821, 0x10a00054, | ||
6592 | 0x00000000, 0x9628000a, 0x31020040, 0x10400005, 0x2407180c, 0x8e22000c, | ||
6593 | 0x2407188c, 0x00021400, 0xaca20018, 0x3c030800, 0x00701821, 0x8c631bd0, | ||
6594 | 0x3c020800, 0x00501021, 0x8c421bd4, 0x00031d00, 0x00021400, 0x00621825, | ||
6595 | 0xaca30014, 0x8ec30004, 0x96220008, 0x00432023, 0x3242ffff, 0x3083ffff, | ||
6596 | 0x00431021, 0x0282102a, 0x14400002, 0x02b23023, 0x00803021, 0x8e620000, | ||
6597 | 0x30c4ffff, 0x00441021, 0xae620000, 0x8e220000, 0xaca20000, 0x8e220004, | ||
6598 | 0x8e63fff4, 0x00431021, 0xaca20004, 0xa4a6000e, 0x8e62fff4, 0x00441021, | ||
6599 | 0xae62fff4, 0x96230008, 0x0043102a, 0x14400005, 0x02469021, 0x8e62fff0, | ||
6600 | 0xae60fff4, 0x24420001, 0xae62fff0, 0xaca00008, 0x3242ffff, 0x14540008, | ||
6601 | 0x24020305, 0x31020080, 0x54400001, 0x34e70010, 0x24020905, 0xa4a2000c, | ||
6602 | 0x0a0001cb, 0x34e70020, 0xa4a2000c, 0x3c020800, 0x8c4223f0, 0x10400003, | ||
6603 | 0x3c024b65, 0x0a0001d3, 0x34427654, 0x3c02b49a, 0x344289ab, 0xaca2001c, | ||
6604 | 0x30e2ffff, 0xaca20010, 0x0e0005a2, 0x00a02021, 0x3242ffff, 0x0054102b, | ||
6605 | 0x1440ffa9, 0x00000000, 0x24020002, 0x3c010800, 0x0a0001e6, 0xa0221b98, | ||
6606 | 0x8ec2083c, 0x24420001, 0x0a0001e6, 0xaec2083c, 0x0e0004c0, 0x00000000, | ||
6607 | 0x8fbf002c, 0x8fb60028, 0x8fb50024, 0x8fb40020, 0x8fb3001c, 0x8fb20018, | ||
6608 | 0x8fb10014, 0x8fb00010, 0x03e00008, 0x27bd0030, 0x27bdffd0, 0xafbf0028, | ||
6609 | 0xafb30024, 0xafb20020, 0xafb1001c, 0xafb00018, 0x8f725c9c, 0x3c0200ff, | ||
6610 | 0x3442fff8, 0x3c070800, 0x24e71bb4, 0x02428824, 0x9623000e, 0x8ce20000, | ||
6611 | 0x00431021, 0xace20000, 0x8e220010, 0x30420020, 0x14400011, 0x00809821, | ||
6612 | 0x0e00063b, 0x02202021, 0x3c02c000, 0x02421825, 0xaf635c9c, 0x8f625c90, | ||
6613 | 0x30420002, 0x1040011e, 0x00000000, 0xaf635c9c, 0x8f625c90, 0x30420002, | ||
6614 | 0x10400119, 0x00000000, 0x0a00020d, 0x00000000, 0x8e240008, 0x8e230014, | ||
6615 | 0x00041402, 0x000231c0, 0x00031502, 0x304201ff, 0x2442ffff, 0x3042007f, | ||
6616 | 0x00031942, 0x30637800, 0x00021100, 0x24424000, 0x00624821, 0x9522000a, | ||
6617 | 0x3084ffff, 0x30420008, 0x104000b0, 0x000429c0, 0x3c020800, 0x8c422400, | ||
6618 | 0x14400024, 0x24c50008, 0x94c20014, 0x3c010800, 0xa42223d0, 0x8cc40010, | ||
6619 | 0x00041402, 0x3c010800, 0xa42223d2, 0x3c010800, 0xa42423d4, 0x94c2000e, | ||
6620 | 0x3083ffff, 0x00431023, 0x3c010800, 0xac222408, 0x94c2001a, 0x3c010800, | ||
6621 | 0xac262400, 0x3c010800, 0xac322404, 0x3c010800, 0xac2223fc, 0x3c02c000, | ||
6622 | 0x02421825, 0xaf635c9c, 0x8f625c90, 0x30420002, 0x104000e5, 0x00000000, | ||
6623 | 0xaf635c9c, 0x8f625c90, 0x30420002, 0x104000e0, 0x00000000, 0x0a000246, | ||
6624 | 0x00000000, 0x94c2000e, 0x3c030800, 0x946323d4, 0x00434023, 0x3103ffff, | ||
6625 | 0x2c620008, 0x1040001c, 0x00000000, 0x94c20014, 0x24420028, 0x00a22821, | ||
6626 | 0x00031042, 0x1840000b, 0x00002021, 0x24e60848, 0x00403821, 0x94a30000, | ||
6627 | 0x8cc20000, 0x24840001, 0x00431021, 0xacc20000, 0x0087102a, 0x1440fff9, | ||
6628 | 0x24a50002, 0x31020001, 0x1040001f, 0x3c024000, 0x3c040800, 0x248423fc, | ||
6629 | 0xa0a00001, 0x94a30000, 0x8c820000, 0x00431021, 0x0a000285, 0xac820000, | ||
6630 | 0x8f626800, 0x3c030010, 0x00431024, 0x10400009, 0x00000000, 0x94c2001a, | ||
6631 | 0x3c030800, 0x8c6323fc, 0x00431021, 0x3c010800, 0xac2223fc, 0x0a000286, | ||
6632 | 0x3c024000, 0x94c2001a, 0x94c4001c, 0x3c030800, 0x8c6323fc, 0x00441023, | ||
6633 | 0x00621821, 0x3c010800, 0xac2323fc, 0x3c024000, 0x02421825, 0xaf635c9c, | ||
6634 | 0x8f625c90, 0x30420002, 0x1440fffc, 0x00000000, 0x9522000a, 0x30420010, | ||
6635 | 0x1040009b, 0x00000000, 0x3c030800, 0x946323d4, 0x3c070800, 0x24e72400, | ||
6636 | 0x8ce40000, 0x8f626800, 0x24630030, 0x00832821, 0x3c030010, 0x00431024, | ||
6637 | 0x1440000a, 0x00000000, 0x94a20004, 0x3c040800, 0x8c842408, 0x3c030800, | ||
6638 | 0x8c6323fc, 0x00441023, 0x00621821, 0x3c010800, 0xac2323fc, 0x3c040800, | ||
6639 | 0x8c8423fc, 0x00041c02, 0x3082ffff, 0x00622021, 0x00041402, 0x00822021, | ||
6640 | 0x00041027, 0xa4a20006, 0x3c030800, 0x8c632404, 0x3c0200ff, 0x3442fff8, | ||
6641 | 0x00628824, 0x96220008, 0x24050001, 0x24034000, 0x000231c0, 0x00801021, | ||
6642 | 0xa4c2001a, 0xa4c0001c, 0xace00000, 0x3c010800, 0xac251b60, 0xaf635cb8, | ||
6643 | 0x8f625cb0, 0x30420002, 0x10400003, 0x00000000, 0x3c010800, 0xac201b60, | ||
6644 | 0x8e220008, 0xaf625cb8, 0x8f625cb0, 0x30420002, 0x10400003, 0x00000000, | ||
6645 | 0x3c010800, 0xac201b60, 0x3c020800, 0x8c421b60, 0x1040ffec, 0x00000000, | ||
6646 | 0x3c040800, 0x0e00063b, 0x8c842404, 0x0a00032a, 0x00000000, 0x3c030800, | ||
6647 | 0x90631b98, 0x24020002, 0x14620003, 0x3c034b65, 0x0a0002e1, 0x00008021, | ||
6648 | 0x8e22001c, 0x34637654, 0x10430002, 0x24100002, 0x24100001, 0x00c02021, | ||
6649 | 0x0e000350, 0x02003021, 0x24020003, 0x3c010800, 0xa0221b98, 0x24020002, | ||
6650 | 0x1202000a, 0x24020001, 0x3c030800, 0x8c6323f0, 0x10620006, 0x00000000, | ||
6651 | 0x3c020800, 0x944223d8, 0x00021400, 0x0a00031f, 0xae220014, 0x3c040800, | ||
6652 | 0x248423da, 0x94820000, 0x00021400, 0xae220014, 0x3c020800, 0x8c421bbc, | ||
6653 | 0x3c03c000, 0x3c010800, 0xa0201b98, 0x00431025, 0xaf625c5c, 0x8f625c50, | ||
6654 | 0x30420002, 0x10400009, 0x00000000, 0x2484f7e2, 0x8c820000, 0x00431025, | ||
6655 | 0xaf625c5c, 0x8f625c50, 0x30420002, 0x1440fffa, 0x00000000, 0x3c020800, | ||
6656 | 0x24421b84, 0x8c430000, 0x24630001, 0xac430000, 0x8f630c14, 0x3063000f, | ||
6657 | 0x2c620002, 0x1440000c, 0x3c024000, 0x8f630c14, 0x3c020800, 0x8c421b40, | ||
6658 | 0x3063000f, 0x24420001, 0x3c010800, 0xac221b40, 0x2c620002, 0x1040fff7, | ||
6659 | 0x00000000, 0x3c024000, 0x02421825, 0xaf635c9c, 0x8f625c90, 0x30420002, | ||
6660 | 0x1440fffc, 0x00000000, 0x12600003, 0x00000000, 0x0e0004c0, 0x00000000, | ||
6661 | 0x8fbf0028, 0x8fb30024, 0x8fb20020, 0x8fb1001c, 0x8fb00018, 0x03e00008, | ||
6662 | 0x27bd0030, 0x8f634450, 0x3c040800, 0x24841b88, 0x8c820000, 0x00031c02, | ||
6663 | 0x0043102b, 0x14400007, 0x3c038000, 0x8c840004, 0x8f624450, 0x00021c02, | ||
6664 | 0x0083102b, 0x1040fffc, 0x3c038000, 0xaf634444, 0x8f624444, 0x00431024, | ||
6665 | 0x1440fffd, 0x00000000, 0x8f624448, 0x03e00008, 0x3042ffff, 0x3c024000, | ||
6666 | 0x00822025, 0xaf645c38, 0x8f625c30, 0x30420002, 0x1440fffc, 0x00000000, | ||
6667 | 0x03e00008, 0x00000000, 0x27bdffe0, 0x00805821, 0x14c00011, 0x256e0008, | ||
6668 | 0x3c020800, 0x8c4223f4, 0x10400007, 0x24020016, 0x3c010800, 0xa42223d2, | ||
6669 | 0x2402002a, 0x3c010800, 0x0a000364, 0xa42223d4, 0x8d670010, 0x00071402, | ||
6670 | 0x3c010800, 0xa42223d2, 0x3c010800, 0xa42723d4, 0x3c040800, 0x948423d4, | ||
6671 | 0x3c030800, 0x946323d2, 0x95cf0006, 0x3c020800, 0x944223d0, 0x00832023, | ||
6672 | 0x01e2c023, 0x3065ffff, 0x24a20028, 0x01c24821, 0x3082ffff, 0x14c0001a, | ||
6673 | 0x01226021, 0x9582000c, 0x3042003f, 0x3c010800, 0xa42223d6, 0x95820004, | ||
6674 | 0x95830006, 0x3c010800, 0xac2023e4, 0x3c010800, 0xac2023e8, 0x00021400, | ||
6675 | 0x00431025, 0x3c010800, 0xac221bc0, 0x95220004, 0x3c010800, 0xa4221bc4, | ||
6676 | 0x95230002, 0x01e51023, 0x0043102a, 0x10400010, 0x24020001, 0x3c010800, | ||
6677 | 0x0a000398, 0xac2223f8, 0x3c030800, 0x8c6323e8, 0x3c020800, 0x94421bc4, | ||
6678 | 0x00431021, 0xa5220004, 0x3c020800, 0x94421bc0, 0xa5820004, 0x3c020800, | ||
6679 | 0x8c421bc0, 0xa5820006, 0x3c020800, 0x8c4223f0, 0x3c0d0800, 0x8dad23e4, | ||
6680 | 0x3c0a0800, 0x144000e5, 0x8d4a23e8, 0x3c020800, 0x94421bc4, 0x004a1821, | ||
6681 | 0x3063ffff, 0x0062182b, 0x24020002, 0x10c2000d, 0x01435023, 0x3c020800, | ||
6682 | 0x944223d6, 0x30420009, 0x10400008, 0x00000000, 0x9582000c, 0x3042fff6, | ||
6683 | 0xa582000c, 0x3c020800, 0x944223d6, 0x30420009, 0x01a26823, 0x3c020800, | ||
6684 | 0x8c4223f8, 0x1040004a, 0x01203821, 0x3c020800, 0x944223d2, 0x00004021, | ||
6685 | 0xa520000a, 0x01e21023, 0xa5220002, 0x3082ffff, 0x00021042, 0x18400008, | ||
6686 | 0x00003021, 0x00401821, 0x94e20000, 0x25080001, 0x00c23021, 0x0103102a, | ||
6687 | 0x1440fffb, 0x24e70002, 0x00061c02, 0x30c2ffff, 0x00623021, 0x00061402, | ||
6688 | 0x00c23021, 0x00c02821, 0x00061027, 0xa522000a, 0x00003021, 0x2527000c, | ||
6689 | 0x00004021, 0x94e20000, 0x25080001, 0x00c23021, 0x2d020004, 0x1440fffb, | ||
6690 | 0x24e70002, 0x95220002, 0x00004021, 0x91230009, 0x00442023, 0x01803821, | ||
6691 | 0x3082ffff, 0xa4e00010, 0x00621821, 0x00021042, 0x18400010, 0x00c33021, | ||
6692 | 0x00404821, 0x94e20000, 0x24e70002, 0x00c23021, 0x30e2007f, 0x14400006, | ||
6693 | 0x25080001, 0x8d630000, 0x3c02007f, 0x3442ff80, 0x00625824, 0x25670008, | ||
6694 | 0x0109102a, 0x1440fff3, 0x00000000, 0x30820001, 0x10400005, 0x00061c02, | ||
6695 | 0xa0e00001, 0x94e20000, 0x00c23021, 0x00061c02, 0x30c2ffff, 0x00623021, | ||
6696 | 0x00061402, 0x00c23021, 0x0a00047d, 0x30c6ffff, 0x24020002, 0x14c20081, | ||
6697 | 0x00000000, 0x3c020800, 0x8c42240c, 0x14400007, 0x00000000, 0x3c020800, | ||
6698 | 0x944223d2, 0x95230002, 0x01e21023, 0x10620077, 0x00000000, 0x3c020800, | ||
6699 | 0x944223d2, 0x01e21023, 0xa5220002, 0x3c020800, 0x8c42240c, 0x1040001a, | ||
6700 | 0x31e3ffff, 0x8dc70010, 0x3c020800, 0x94421b96, 0x00e04021, 0x00072c02, | ||
6701 | 0x00aa2021, 0x00431023, 0x00823823, 0x00072402, 0x30e2ffff, 0x00823821, | ||
6702 | 0x00071027, 0xa522000a, 0x3102ffff, 0x3c040800, 0x948423d4, 0x00453023, | ||
6703 | 0x00e02821, 0x00641823, 0x006d1821, 0x00c33021, 0x00061c02, 0x30c2ffff, | ||
6704 | 0x0a00047d, 0x00623021, 0x01203821, 0x00004021, 0x3082ffff, 0x00021042, | ||
6705 | 0x18400008, 0x00003021, 0x00401821, 0x94e20000, 0x25080001, 0x00c23021, | ||
6706 | 0x0103102a, 0x1440fffb, 0x24e70002, 0x00061c02, 0x30c2ffff, 0x00623021, | ||
6707 | 0x00061402, 0x00c23021, 0x00c02821, 0x00061027, 0xa522000a, 0x00003021, | ||
6708 | 0x2527000c, 0x00004021, 0x94e20000, 0x25080001, 0x00c23021, 0x2d020004, | ||
6709 | 0x1440fffb, 0x24e70002, 0x95220002, 0x00004021, 0x91230009, 0x00442023, | ||
6710 | 0x01803821, 0x3082ffff, 0xa4e00010, 0x3c040800, 0x948423d4, 0x00621821, | ||
6711 | 0x00c33021, 0x00061c02, 0x30c2ffff, 0x00623021, 0x00061c02, 0x3c020800, | ||
6712 | 0x944223d0, 0x00c34821, 0x00441023, 0x00021fc2, 0x00431021, 0x00021043, | ||
6713 | 0x18400010, 0x00003021, 0x00402021, 0x94e20000, 0x24e70002, 0x00c23021, | ||
6714 | 0x30e2007f, 0x14400006, 0x25080001, 0x8d630000, 0x3c02007f, 0x3442ff80, | ||
6715 | 0x00625824, 0x25670008, 0x0104102a, 0x1440fff3, 0x00000000, 0x3c020800, | ||
6716 | 0x944223ec, 0x00c23021, 0x3122ffff, 0x00c23021, 0x00061c02, 0x30c2ffff, | ||
6717 | 0x00623021, 0x00061402, 0x00c23021, 0x00c04021, 0x00061027, 0xa5820010, | ||
6718 | 0xadc00014, 0x0a00049d, 0xadc00000, 0x8dc70010, 0x00e04021, 0x11400007, | ||
6719 | 0x00072c02, 0x00aa3021, 0x00061402, 0x30c3ffff, 0x00433021, 0x00061402, | ||
6720 | 0x00c22821, 0x00051027, 0xa522000a, 0x3c030800, 0x946323d4, 0x3102ffff, | ||
6721 | 0x01e21021, 0x00433023, 0x00cd3021, 0x00061c02, 0x30c2ffff, 0x00623021, | ||
6722 | 0x00061402, 0x00c23021, 0x00c04021, 0x00061027, 0xa5820010, 0x3102ffff, | ||
6723 | 0x00051c00, 0x00431025, 0xadc20010, 0x3c020800, 0x8c4223f4, 0x10400005, | ||
6724 | 0x2de205eb, 0x14400002, 0x25e2fff2, 0x34028870, 0xa5c20034, 0x3c030800, | ||
6725 | 0x246323e8, 0x8c620000, 0x24420001, 0xac620000, 0x3c040800, 0x8c8423e4, | ||
6726 | 0x3c020800, 0x8c421bc0, 0x3303ffff, 0x00832021, 0x00431821, 0x0062102b, | ||
6727 | 0x3c010800, 0xac2423e4, 0x10400003, 0x2482ffff, 0x3c010800, 0xac2223e4, | ||
6728 | 0x3c010800, 0xac231bc0, 0x03e00008, 0x27bd0020, 0x27bdffb8, 0x3c050800, | ||
6729 | 0x24a51b96, 0xafbf0044, 0xafbe0040, 0xafb7003c, 0xafb60038, 0xafb50034, | ||
6730 | 0xafb40030, 0xafb3002c, 0xafb20028, 0xafb10024, 0xafb00020, 0x94a90000, | ||
6731 | 0x3c020800, 0x944223d0, 0x3c030800, 0x8c631bb0, 0x3c040800, 0x8c841bac, | ||
6732 | 0x01221023, 0x0064182a, 0xa7a9001e, 0x106000be, 0xa7a20016, 0x24be0022, | ||
6733 | 0x97b6001e, 0x24b3001a, 0x24b70016, 0x8fc20000, 0x14400008, 0x00000000, | ||
6734 | 0x8fc2fff8, 0x97a30016, 0x8fc4fff4, 0x00431021, 0x0082202a, 0x148000b0, | ||
6735 | 0x00000000, 0x97d50818, 0x32a2ffff, 0x104000a3, 0x00009021, 0x0040a021, | ||
6736 | 0x00008821, 0x0e000625, 0x00000000, 0x00403021, 0x14c00007, 0x00000000, | ||
6737 | 0x3c020800, 0x8c4223dc, 0x24420001, 0x3c010800, 0x0a000596, 0xac2223dc, | ||
6738 | 0x3c100800, 0x02118021, 0x8e101bc8, 0x9608000a, 0x31020040, 0x10400005, | ||
6739 | 0x2407180c, 0x8e02000c, 0x2407188c, 0x00021400, 0xacc20018, 0x31020080, | ||
6740 | 0x54400001, 0x34e70010, 0x3c020800, 0x00511021, 0x8c421bd0, 0x3c030800, | ||
6741 | 0x00711821, 0x8c631bd4, 0x00021500, 0x00031c00, 0x00431025, 0xacc20014, | ||
6742 | 0x96040008, 0x3242ffff, 0x00821021, 0x0282102a, 0x14400002, 0x02b22823, | ||
6743 | 0x00802821, 0x8e020000, 0x02459021, 0xacc20000, 0x8e020004, 0x00c02021, | ||
6744 | 0x26310010, 0xac820004, 0x30e2ffff, 0xac800008, 0xa485000e, 0xac820010, | ||
6745 | 0x24020305, 0x0e0005a2, 0xa482000c, 0x3242ffff, 0x0054102b, 0x1440ffc5, | ||
6746 | 0x3242ffff, 0x0a00058e, 0x00000000, 0x8e620000, 0x8e63fffc, 0x0043102a, | ||
6747 | 0x10400067, 0x00000000, 0x8e62fff0, 0x00028900, 0x3c100800, 0x02118021, | ||
6748 | 0x0e000625, 0x8e101bc8, 0x00403021, 0x14c00005, 0x00000000, 0x8e62082c, | ||
6749 | 0x24420001, 0x0a000596, 0xae62082c, 0x9608000a, 0x31020040, 0x10400005, | ||
6750 | 0x2407180c, 0x8e02000c, 0x2407188c, 0x00021400, 0xacc20018, 0x3c020800, | ||
6751 | 0x00511021, 0x8c421bd0, 0x3c030800, 0x00711821, 0x8c631bd4, 0x00021500, | ||
6752 | 0x00031c00, 0x00431025, 0xacc20014, 0x8e63fff4, 0x96020008, 0x00432023, | ||
6753 | 0x3242ffff, 0x3083ffff, 0x00431021, 0x02c2102a, 0x10400003, 0x00802821, | ||
6754 | 0x97a9001e, 0x01322823, 0x8e620000, 0x30a4ffff, 0x00441021, 0xae620000, | ||
6755 | 0xa4c5000e, 0x8e020000, 0xacc20000, 0x8e020004, 0x8e63fff4, 0x00431021, | ||
6756 | 0xacc20004, 0x8e63fff4, 0x96020008, 0x00641821, 0x0062102a, 0x14400006, | ||
6757 | 0x02459021, 0x8e62fff0, 0xae60fff4, 0x24420001, 0x0a000571, 0xae62fff0, | ||
6758 | 0xae63fff4, 0xacc00008, 0x3242ffff, 0x10560003, 0x31020004, 0x10400006, | ||
6759 | 0x24020305, 0x31020080, 0x54400001, 0x34e70010, 0x34e70020, 0x24020905, | ||
6760 | 0xa4c2000c, 0x8ee30000, 0x8ee20004, 0x14620007, 0x3c02b49a, 0x8ee20860, | ||
6761 | 0x54400001, 0x34e70400, 0x3c024b65, 0x0a000588, 0x34427654, 0x344289ab, | ||
6762 | 0xacc2001c, 0x30e2ffff, 0xacc20010, 0x0e0005a2, 0x00c02021, 0x3242ffff, | ||
6763 | 0x0056102b, 0x1440ff9b, 0x00000000, 0x8e620000, 0x8e63fffc, 0x0043102a, | ||
6764 | 0x1440ff48, 0x00000000, 0x8fbf0044, 0x8fbe0040, 0x8fb7003c, 0x8fb60038, | ||
6765 | 0x8fb50034, 0x8fb40030, 0x8fb3002c, 0x8fb20028, 0x8fb10024, 0x8fb00020, | ||
6766 | 0x03e00008, 0x27bd0048, 0x27bdffe8, 0xafbf0014, 0xafb00010, 0x8f624450, | ||
6767 | 0x8f634410, 0x0a0005b1, 0x00808021, 0x8f626820, 0x30422000, 0x10400003, | ||
6768 | 0x00000000, 0x0e0001f0, 0x00002021, 0x8f624450, 0x8f634410, 0x3042ffff, | ||
6769 | 0x0043102b, 0x1440fff5, 0x00000000, 0x8f630c14, 0x3063000f, 0x2c620002, | ||
6770 | 0x1440000b, 0x00000000, 0x8f630c14, 0x3c020800, 0x8c421b40, 0x3063000f, | ||
6771 | 0x24420001, 0x3c010800, 0xac221b40, 0x2c620002, 0x1040fff7, 0x00000000, | ||
6772 | 0xaf705c18, 0x8f625c10, 0x30420002, 0x10400009, 0x00000000, 0x8f626820, | ||
6773 | 0x30422000, 0x1040fff8, 0x00000000, 0x0e0001f0, 0x00002021, 0x0a0005c4, | ||
6774 | 0x00000000, 0x8fbf0014, 0x8fb00010, 0x03e00008, 0x27bd0018, 0x00000000, | ||
6775 | 0x00000000, 0x00000000, 0x27bdffe8, 0x3c1bc000, 0xafbf0014, 0xafb00010, | ||
6776 | 0xaf60680c, 0x8f626804, 0x34420082, 0xaf626804, 0x8f634000, 0x24020b50, | ||
6777 | 0x3c010800, 0xac221b54, 0x24020b78, 0x3c010800, 0xac221b64, 0x34630002, | ||
6778 | 0xaf634000, 0x0e000605, 0x00808021, 0x3c010800, 0xa0221b68, 0x304200ff, | ||
6779 | 0x24030002, 0x14430005, 0x00000000, 0x3c020800, 0x8c421b54, 0x0a0005f8, | ||
6780 | 0xac5000c0, 0x3c020800, 0x8c421b54, 0xac5000bc, 0x8f624434, 0x8f634438, | ||
6781 | 0x8f644410, 0x3c010800, 0xac221b5c, 0x3c010800, 0xac231b6c, 0x3c010800, | ||
6782 | 0xac241b58, 0x8fbf0014, 0x8fb00010, 0x03e00008, 0x27bd0018, 0x3c040800, | ||
6783 | 0x8c870000, 0x3c03aa55, 0x3463aa55, 0x3c06c003, 0xac830000, 0x8cc20000, | ||
6784 | 0x14430007, 0x24050002, 0x3c0355aa, 0x346355aa, 0xac830000, 0x8cc20000, | ||
6785 | 0x50430001, 0x24050001, 0x3c020800, 0xac470000, 0x03e00008, 0x00a01021, | ||
6786 | 0x27bdfff8, 0x18800009, 0x00002821, 0x8f63680c, 0x8f62680c, 0x1043fffe, | ||
6787 | 0x00000000, 0x24a50001, 0x00a4102a, 0x1440fff9, 0x00000000, 0x03e00008, | ||
6788 | 0x27bd0008, 0x8f634450, 0x3c020800, 0x8c421b5c, 0x00031c02, 0x0043102b, | ||
6789 | 0x14400008, 0x3c038000, 0x3c040800, 0x8c841b6c, 0x8f624450, 0x00021c02, | ||
6790 | 0x0083102b, 0x1040fffc, 0x3c038000, 0xaf634444, 0x8f624444, 0x00431024, | ||
6791 | 0x1440fffd, 0x00000000, 0x8f624448, 0x03e00008, 0x3042ffff, 0x3082ffff, | ||
6792 | 0x2442e000, 0x2c422001, 0x14400003, 0x3c024000, 0x0a000648, 0x2402ffff, | ||
6793 | 0x00822025, 0xaf645c38, 0x8f625c30, 0x30420002, 0x1440fffc, 0x00001021, | ||
6794 | 0x03e00008, 0x00000000, 0x8f624450, 0x3c030800, 0x8c631b58, 0x0a000651, | ||
6795 | 0x3042ffff, 0x8f624450, 0x3042ffff, 0x0043102b, 0x1440fffc, 0x00000000, | ||
6796 | 0x03e00008, 0x00000000, 0x27bdffe0, 0x00802821, 0x3c040800, 0x24841af0, | ||
6797 | 0x00003021, 0x00003821, 0xafbf0018, 0xafa00010, 0x0e00067c, 0xafa00014, | ||
6798 | 0x0a000660, 0x00000000, 0x8fbf0018, 0x03e00008, 0x27bd0020, 0x00000000, | ||
6799 | 0x00000000, 0x00000000, 0x3c020800, 0x34423000, 0x3c030800, 0x34633000, | ||
6800 | 0x3c040800, 0x348437ff, 0x3c010800, 0xac221b74, 0x24020040, 0x3c010800, | ||
6801 | 0xac221b78, 0x3c010800, 0xac201b70, 0xac600000, 0x24630004, 0x0083102b, | ||
6802 | 0x5040fffd, 0xac600000, 0x03e00008, 0x00000000, 0x00804821, 0x8faa0010, | ||
6803 | 0x3c020800, 0x8c421b70, 0x3c040800, 0x8c841b78, 0x8fab0014, 0x24430001, | ||
6804 | 0x0044102b, 0x3c010800, 0xac231b70, 0x14400003, 0x00004021, 0x3c010800, | ||
6805 | 0xac201b70, 0x3c020800, 0x8c421b70, 0x3c030800, 0x8c631b74, 0x91240000, | ||
6806 | 0x00021140, 0x00431021, 0x00481021, 0x25080001, 0xa0440000, 0x29020008, | ||
6807 | 0x1440fff4, 0x25290001, 0x3c020800, 0x8c421b70, 0x3c030800, 0x8c631b74, | ||
6808 | 0x8f64680c, 0x00021140, 0x00431021, 0xac440008, 0xac45000c, 0xac460010, | ||
6809 | 0xac470014, 0xac4a0018, 0x03e00008, 0xac4b001c, 0x00000000, 0x00000000, | ||
6810 | }; | ||
6811 | |||
6812 | static const u32 tg3TsoFwRodata[] = { | ||
6813 | 0x4d61696e, 0x43707542, 0x00000000, 0x4d61696e, 0x43707541, 0x00000000, | ||
6814 | 0x00000000, 0x00000000, 0x73746b6f, 0x66666c64, 0x496e0000, 0x73746b6f, | ||
6815 | 0x66662a2a, 0x00000000, 0x53774576, 0x656e7430, 0x00000000, 0x00000000, | ||
6816 | 0x00000000, 0x00000000, 0x66617461, 0x6c457272, 0x00000000, 0x00000000, | ||
6817 | 0x00000000, | ||
6818 | }; | ||
6819 | |||
6820 | static const u32 tg3TsoFwData[] = { | ||
6821 | 0x00000000, 0x73746b6f, 0x66666c64, 0x5f76312e, 0x362e3000, 0x00000000, | ||
6822 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, | ||
6823 | 0x00000000, | ||
6824 | }; | ||
6825 | |||
6826 | /* 5705 needs a special version of the TSO firmware. */ | 6378 | /* 5705 needs a special version of the TSO firmware. */ |
6827 | #define TG3_TSO5_FW_RELEASE_MAJOR 0x1 | ||
6828 | #define TG3_TSO5_FW_RELASE_MINOR 0x2 | ||
6829 | #define TG3_TSO5_FW_RELEASE_FIX 0x0 | ||
6830 | #define TG3_TSO5_FW_START_ADDR 0x00010000 | ||
6831 | #define TG3_TSO5_FW_TEXT_ADDR 0x00010000 | ||
6832 | #define TG3_TSO5_FW_TEXT_LEN 0xe90 | ||
6833 | #define TG3_TSO5_FW_RODATA_ADDR 0x00010e90 | ||
6834 | #define TG3_TSO5_FW_RODATA_LEN 0x50 | ||
6835 | #define TG3_TSO5_FW_DATA_ADDR 0x00010f00 | ||
6836 | #define TG3_TSO5_FW_DATA_LEN 0x20 | ||
6837 | #define TG3_TSO5_FW_SBSS_ADDR 0x00010f20 | ||
6838 | #define TG3_TSO5_FW_SBSS_LEN 0x28 | ||
6839 | #define TG3_TSO5_FW_BSS_ADDR 0x00010f50 | ||
6840 | #define TG3_TSO5_FW_BSS_LEN 0x88 | ||
6841 | |||
6842 | static const u32 tg3Tso5FwText[(TG3_TSO5_FW_TEXT_LEN / 4) + 1] = { | ||
6843 | 0x0c004003, 0x00000000, 0x00010f04, 0x00000000, 0x10000003, 0x00000000, | ||
6844 | 0x0000000d, 0x0000000d, 0x3c1d0001, 0x37bde000, 0x03a0f021, 0x3c100001, | ||
6845 | 0x26100000, 0x0c004010, 0x00000000, 0x0000000d, 0x27bdffe0, 0x3c04fefe, | ||
6846 | 0xafbf0018, 0x0c0042e8, 0x34840002, 0x0c004364, 0x00000000, 0x3c030001, | ||
6847 | 0x90630f34, 0x24020002, 0x3c040001, 0x24840e9c, 0x14620003, 0x24050001, | ||
6848 | 0x3c040001, 0x24840e90, 0x24060002, 0x00003821, 0xafa00010, 0x0c004378, | ||
6849 | 0xafa00014, 0x0c00402c, 0x00000000, 0x8fbf0018, 0x03e00008, 0x27bd0020, | ||
6850 | 0x00000000, 0x00000000, 0x27bdffe0, 0xafbf001c, 0xafb20018, 0xafb10014, | ||
6851 | 0x0c0042d4, 0xafb00010, 0x3c128000, 0x24110001, 0x8f706810, 0x32020400, | ||
6852 | 0x10400007, 0x00000000, 0x8f641008, 0x00921024, 0x14400003, 0x00000000, | ||
6853 | 0x0c004064, 0x00000000, 0x3c020001, 0x90420f56, 0x10510003, 0x32020200, | ||
6854 | 0x1040fff1, 0x00000000, 0x0c0041b4, 0x00000000, 0x08004034, 0x00000000, | ||
6855 | 0x8fbf001c, 0x8fb20018, 0x8fb10014, 0x8fb00010, 0x03e00008, 0x27bd0020, | ||
6856 | 0x27bdffe0, 0x3c040001, 0x24840eb0, 0x00002821, 0x00003021, 0x00003821, | ||
6857 | 0xafbf0018, 0xafa00010, 0x0c004378, 0xafa00014, 0x0000d021, 0x24020130, | ||
6858 | 0xaf625000, 0x3c010001, 0xa4200f50, 0x3c010001, 0xa0200f57, 0x8fbf0018, | ||
6859 | 0x03e00008, 0x27bd0020, 0x00000000, 0x00000000, 0x3c030001, 0x24630f60, | ||
6860 | 0x90620000, 0x27bdfff0, 0x14400003, 0x0080c021, 0x08004073, 0x00004821, | ||
6861 | 0x3c022000, 0x03021024, 0x10400003, 0x24090002, 0x08004073, 0xa0600000, | ||
6862 | 0x24090001, 0x00181040, 0x30431f80, 0x346f8008, 0x1520004b, 0x25eb0028, | ||
6863 | 0x3c040001, 0x00832021, 0x8c848010, 0x3c050001, 0x24a50f7a, 0x00041402, | ||
6864 | 0xa0a20000, 0x3c010001, 0xa0240f7b, 0x3c020001, 0x00431021, 0x94428014, | ||
6865 | 0x3c010001, 0xa0220f7c, 0x3c0c0001, 0x01836021, 0x8d8c8018, 0x304200ff, | ||
6866 | 0x24420008, 0x000220c3, 0x24020001, 0x3c010001, 0xa0220f60, 0x0124102b, | ||
6867 | 0x1040000c, 0x00003821, 0x24a6000e, 0x01602821, 0x8ca20000, 0x8ca30004, | ||
6868 | 0x24a50008, 0x24e70001, 0xacc20000, 0xacc30004, 0x00e4102b, 0x1440fff8, | ||
6869 | 0x24c60008, 0x00003821, 0x3c080001, 0x25080f7b, 0x91060000, 0x3c020001, | ||
6870 | 0x90420f7c, 0x2503000d, 0x00c32821, 0x00461023, 0x00021fc2, 0x00431021, | ||
6871 | 0x00021043, 0x1840000c, 0x00002021, 0x91020001, 0x00461023, 0x00021fc2, | ||
6872 | 0x00431021, 0x00021843, 0x94a20000, 0x24e70001, 0x00822021, 0x00e3102a, | ||
6873 | 0x1440fffb, 0x24a50002, 0x00041c02, 0x3082ffff, 0x00622021, 0x00041402, | ||
6874 | 0x00822021, 0x3c02ffff, 0x01821024, 0x3083ffff, 0x00431025, 0x3c010001, | ||
6875 | 0x080040fa, 0xac220f80, 0x3c050001, 0x24a50f7c, 0x90a20000, 0x3c0c0001, | ||
6876 | 0x01836021, 0x8d8c8018, 0x000220c2, 0x1080000e, 0x00003821, 0x01603021, | ||
6877 | 0x24a5000c, 0x8ca20000, 0x8ca30004, 0x24a50008, 0x24e70001, 0xacc20000, | ||
6878 | 0xacc30004, 0x00e4102b, 0x1440fff8, 0x24c60008, 0x3c050001, 0x24a50f7c, | ||
6879 | 0x90a20000, 0x30430007, 0x24020004, 0x10620011, 0x28620005, 0x10400005, | ||
6880 | 0x24020002, 0x10620008, 0x000710c0, 0x080040fa, 0x00000000, 0x24020006, | ||
6881 | 0x1062000e, 0x000710c0, 0x080040fa, 0x00000000, 0x00a21821, 0x9463000c, | ||
6882 | 0x004b1021, 0x080040fa, 0xa4430000, 0x000710c0, 0x00a21821, 0x8c63000c, | ||
6883 | 0x004b1021, 0x080040fa, 0xac430000, 0x00a21821, 0x8c63000c, 0x004b2021, | ||
6884 | 0x00a21021, 0xac830000, 0x94420010, 0xa4820004, 0x95e70006, 0x3c020001, | ||
6885 | 0x90420f7c, 0x3c030001, 0x90630f7a, 0x00e2c823, 0x3c020001, 0x90420f7b, | ||
6886 | 0x24630028, 0x01e34021, 0x24420028, 0x15200012, 0x01e23021, 0x94c2000c, | ||
6887 | 0x3c010001, 0xa4220f78, 0x94c20004, 0x94c30006, 0x3c010001, 0xa4200f76, | ||
6888 | 0x3c010001, 0xa4200f72, 0x00021400, 0x00431025, 0x3c010001, 0xac220f6c, | ||
6889 | 0x95020004, 0x3c010001, 0x08004124, 0xa4220f70, 0x3c020001, 0x94420f70, | ||
6890 | 0x3c030001, 0x94630f72, 0x00431021, 0xa5020004, 0x3c020001, 0x94420f6c, | ||
6891 | 0xa4c20004, 0x3c020001, 0x8c420f6c, 0xa4c20006, 0x3c040001, 0x94840f72, | ||
6892 | 0x3c020001, 0x94420f70, 0x3c0a0001, 0x954a0f76, 0x00441821, 0x3063ffff, | ||
6893 | 0x0062182a, 0x24020002, 0x1122000b, 0x00832023, 0x3c030001, 0x94630f78, | ||
6894 | 0x30620009, 0x10400006, 0x3062fff6, 0xa4c2000c, 0x3c020001, 0x94420f78, | ||
6895 | 0x30420009, 0x01425023, 0x24020001, 0x1122001b, 0x29220002, 0x50400005, | ||
6896 | 0x24020002, 0x11200007, 0x31a2ffff, 0x08004197, 0x00000000, 0x1122001d, | ||
6897 | 0x24020016, 0x08004197, 0x31a2ffff, 0x3c0e0001, 0x95ce0f80, 0x10800005, | ||
6898 | 0x01806821, 0x01c42021, 0x00041c02, 0x3082ffff, 0x00627021, 0x000e1027, | ||
6899 | 0xa502000a, 0x3c030001, 0x90630f7b, 0x31a2ffff, 0x00e21021, 0x0800418d, | ||
6900 | 0x00432023, 0x3c020001, 0x94420f80, 0x00442021, 0x00041c02, 0x3082ffff, | ||
6901 | 0x00622021, 0x00807021, 0x00041027, 0x08004185, 0xa502000a, 0x3c050001, | ||
6902 | 0x24a50f7a, 0x90a30000, 0x14620002, 0x24e2fff2, 0xa5e20034, 0x90a20000, | ||
6903 | 0x00e21023, 0xa5020002, 0x3c030001, 0x94630f80, 0x3c020001, 0x94420f5a, | ||
6904 | 0x30e5ffff, 0x00641821, 0x00451023, 0x00622023, 0x00041c02, 0x3082ffff, | ||
6905 | 0x00622021, 0x00041027, 0xa502000a, 0x3c030001, 0x90630f7c, 0x24620001, | ||
6906 | 0x14a20005, 0x00807021, 0x01631021, 0x90420000, 0x08004185, 0x00026200, | ||
6907 | 0x24620002, 0x14a20003, 0x306200fe, 0x004b1021, 0x944c0000, 0x3c020001, | ||
6908 | 0x94420f82, 0x3183ffff, 0x3c040001, 0x90840f7b, 0x00431021, 0x00e21021, | ||
6909 | 0x00442023, 0x008a2021, 0x00041c02, 0x3082ffff, 0x00622021, 0x00041402, | ||
6910 | 0x00822021, 0x00806821, 0x00041027, 0xa4c20010, 0x31a2ffff, 0x000e1c00, | ||
6911 | 0x00431025, 0x3c040001, 0x24840f72, 0xade20010, 0x94820000, 0x3c050001, | ||
6912 | 0x94a50f76, 0x3c030001, 0x8c630f6c, 0x24420001, 0x00b92821, 0xa4820000, | ||
6913 | 0x3322ffff, 0x00622021, 0x0083182b, 0x3c010001, 0xa4250f76, 0x10600003, | ||
6914 | 0x24a2ffff, 0x3c010001, 0xa4220f76, 0x3c024000, 0x03021025, 0x3c010001, | ||
6915 | 0xac240f6c, 0xaf621008, 0x03e00008, 0x27bd0010, 0x3c030001, 0x90630f56, | ||
6916 | 0x27bdffe8, 0x24020001, 0xafbf0014, 0x10620026, 0xafb00010, 0x8f620cf4, | ||
6917 | 0x2442ffff, 0x3042007f, 0x00021100, 0x8c434000, 0x3c010001, 0xac230f64, | ||
6918 | 0x8c434008, 0x24444000, 0x8c5c4004, 0x30620040, 0x14400002, 0x24020088, | ||
6919 | 0x24020008, 0x3c010001, 0xa4220f68, 0x30620004, 0x10400005, 0x24020001, | ||
6920 | 0x3c010001, 0xa0220f57, 0x080041d5, 0x00031402, 0x3c010001, 0xa0200f57, | ||
6921 | 0x00031402, 0x3c010001, 0xa4220f54, 0x9483000c, 0x24020001, 0x3c010001, | ||
6922 | 0xa4200f50, 0x3c010001, 0xa0220f56, 0x3c010001, 0xa4230f62, 0x24020001, | ||
6923 | 0x1342001e, 0x00000000, 0x13400005, 0x24020003, 0x13420067, 0x00000000, | ||
6924 | 0x080042cf, 0x00000000, 0x3c020001, 0x94420f62, 0x241a0001, 0x3c010001, | ||
6925 | 0xa4200f5e, 0x3c010001, 0xa4200f52, 0x304407ff, 0x00021bc2, 0x00031823, | ||
6926 | 0x3063003e, 0x34630036, 0x00021242, 0x3042003c, 0x00621821, 0x3c010001, | ||
6927 | 0xa4240f58, 0x00832021, 0x24630030, 0x3c010001, 0xa4240f5a, 0x3c010001, | ||
6928 | 0xa4230f5c, 0x3c060001, 0x24c60f52, 0x94c50000, 0x94c30002, 0x3c040001, | ||
6929 | 0x94840f5a, 0x00651021, 0x0044102a, 0x10400013, 0x3c108000, 0x00a31021, | ||
6930 | 0xa4c20000, 0x3c02a000, 0xaf620cf4, 0x3c010001, 0xa0200f56, 0x8f641008, | ||
6931 | 0x00901024, 0x14400003, 0x00000000, 0x0c004064, 0x00000000, 0x8f620cf4, | ||
6932 | 0x00501024, 0x104000b7, 0x00000000, 0x0800420f, 0x00000000, 0x3c030001, | ||
6933 | 0x94630f50, 0x00851023, 0xa4c40000, 0x00621821, 0x3042ffff, 0x3c010001, | ||
6934 | 0xa4230f50, 0xaf620ce8, 0x3c020001, 0x94420f68, 0x34420024, 0xaf620cec, | ||
6935 | 0x94c30002, 0x3c020001, 0x94420f50, 0x14620012, 0x3c028000, 0x3c108000, | ||
6936 | 0x3c02a000, 0xaf620cf4, 0x3c010001, 0xa0200f56, 0x8f641008, 0x00901024, | ||
6937 | 0x14400003, 0x00000000, 0x0c004064, 0x00000000, 0x8f620cf4, 0x00501024, | ||
6938 | 0x1440fff7, 0x00000000, 0x080042cf, 0x241a0003, 0xaf620cf4, 0x3c108000, | ||
6939 | 0x8f641008, 0x00901024, 0x14400003, 0x00000000, 0x0c004064, 0x00000000, | ||
6940 | 0x8f620cf4, 0x00501024, 0x1440fff7, 0x00000000, 0x080042cf, 0x241a0003, | ||
6941 | 0x3c070001, 0x24e70f50, 0x94e20000, 0x03821021, 0xaf620ce0, 0x3c020001, | ||
6942 | 0x8c420f64, 0xaf620ce4, 0x3c050001, 0x94a50f54, 0x94e30000, 0x3c040001, | ||
6943 | 0x94840f58, 0x3c020001, 0x94420f5e, 0x00a32823, 0x00822023, 0x30a6ffff, | ||
6944 | 0x3083ffff, 0x00c3102b, 0x14400043, 0x00000000, 0x3c020001, 0x94420f5c, | ||
6945 | 0x00021400, 0x00621025, 0xaf620ce8, 0x94e20000, 0x3c030001, 0x94630f54, | ||
6946 | 0x00441021, 0xa4e20000, 0x3042ffff, 0x14430021, 0x3c020008, 0x3c020001, | ||
6947 | 0x90420f57, 0x10400006, 0x3c03000c, 0x3c020001, 0x94420f68, 0x34630624, | ||
6948 | 0x0800427c, 0x0000d021, 0x3c020001, 0x94420f68, 0x3c030008, 0x34630624, | ||
6949 | 0x00431025, 0xaf620cec, 0x3c108000, 0x3c02a000, 0xaf620cf4, 0x3c010001, | ||
6950 | 0xa0200f56, 0x8f641008, 0x00901024, 0x14400003, 0x00000000, 0x0c004064, | ||
6951 | 0x00000000, 0x8f620cf4, 0x00501024, 0x10400015, 0x00000000, 0x08004283, | ||
6952 | 0x00000000, 0x3c030001, 0x94630f68, 0x34420624, 0x3c108000, 0x00621825, | ||
6953 | 0x3c028000, 0xaf630cec, 0xaf620cf4, 0x8f641008, 0x00901024, 0x14400003, | ||
6954 | 0x00000000, 0x0c004064, 0x00000000, 0x8f620cf4, 0x00501024, 0x1440fff7, | ||
6955 | 0x00000000, 0x3c010001, 0x080042cf, 0xa4200f5e, 0x3c020001, 0x94420f5c, | ||
6956 | 0x00021400, 0x00c21025, 0xaf620ce8, 0x3c020001, 0x90420f57, 0x10400009, | ||
6957 | 0x3c03000c, 0x3c020001, 0x94420f68, 0x34630624, 0x0000d021, 0x00431025, | ||
6958 | 0xaf620cec, 0x080042c1, 0x3c108000, 0x3c020001, 0x94420f68, 0x3c030008, | ||
6959 | 0x34630604, 0x00431025, 0xaf620cec, 0x3c020001, 0x94420f5e, 0x00451021, | ||
6960 | 0x3c010001, 0xa4220f5e, 0x3c108000, 0x3c02a000, 0xaf620cf4, 0x3c010001, | ||
6961 | 0xa0200f56, 0x8f641008, 0x00901024, 0x14400003, 0x00000000, 0x0c004064, | ||
6962 | 0x00000000, 0x8f620cf4, 0x00501024, 0x1440fff7, 0x00000000, 0x8fbf0014, | ||
6963 | 0x8fb00010, 0x03e00008, 0x27bd0018, 0x00000000, 0x27bdffe0, 0x3c040001, | ||
6964 | 0x24840ec0, 0x00002821, 0x00003021, 0x00003821, 0xafbf0018, 0xafa00010, | ||
6965 | 0x0c004378, 0xafa00014, 0x0000d021, 0x24020130, 0xaf625000, 0x3c010001, | ||
6966 | 0xa4200f50, 0x3c010001, 0xa0200f57, 0x8fbf0018, 0x03e00008, 0x27bd0020, | ||
6967 | 0x27bdffe8, 0x3c1bc000, 0xafbf0014, 0xafb00010, 0xaf60680c, 0x8f626804, | ||
6968 | 0x34420082, 0xaf626804, 0x8f634000, 0x24020b50, 0x3c010001, 0xac220f20, | ||
6969 | 0x24020b78, 0x3c010001, 0xac220f30, 0x34630002, 0xaf634000, 0x0c004315, | ||
6970 | 0x00808021, 0x3c010001, 0xa0220f34, 0x304200ff, 0x24030002, 0x14430005, | ||
6971 | 0x00000000, 0x3c020001, 0x8c420f20, 0x08004308, 0xac5000c0, 0x3c020001, | ||
6972 | 0x8c420f20, 0xac5000bc, 0x8f624434, 0x8f634438, 0x8f644410, 0x3c010001, | ||
6973 | 0xac220f28, 0x3c010001, 0xac230f38, 0x3c010001, 0xac240f24, 0x8fbf0014, | ||
6974 | 0x8fb00010, 0x03e00008, 0x27bd0018, 0x03e00008, 0x24020001, 0x27bdfff8, | ||
6975 | 0x18800009, 0x00002821, 0x8f63680c, 0x8f62680c, 0x1043fffe, 0x00000000, | ||
6976 | 0x24a50001, 0x00a4102a, 0x1440fff9, 0x00000000, 0x03e00008, 0x27bd0008, | ||
6977 | 0x8f634450, 0x3c020001, 0x8c420f28, 0x00031c02, 0x0043102b, 0x14400008, | ||
6978 | 0x3c038000, 0x3c040001, 0x8c840f38, 0x8f624450, 0x00021c02, 0x0083102b, | ||
6979 | 0x1040fffc, 0x3c038000, 0xaf634444, 0x8f624444, 0x00431024, 0x1440fffd, | ||
6980 | 0x00000000, 0x8f624448, 0x03e00008, 0x3042ffff, 0x3082ffff, 0x2442e000, | ||
6981 | 0x2c422001, 0x14400003, 0x3c024000, 0x08004347, 0x2402ffff, 0x00822025, | ||
6982 | 0xaf645c38, 0x8f625c30, 0x30420002, 0x1440fffc, 0x00001021, 0x03e00008, | ||
6983 | 0x00000000, 0x8f624450, 0x3c030001, 0x8c630f24, 0x08004350, 0x3042ffff, | ||
6984 | 0x8f624450, 0x3042ffff, 0x0043102b, 0x1440fffc, 0x00000000, 0x03e00008, | ||
6985 | 0x00000000, 0x27bdffe0, 0x00802821, 0x3c040001, 0x24840ed0, 0x00003021, | ||
6986 | 0x00003821, 0xafbf0018, 0xafa00010, 0x0c004378, 0xafa00014, 0x0800435f, | ||
6987 | 0x00000000, 0x8fbf0018, 0x03e00008, 0x27bd0020, 0x3c020001, 0x3442d600, | ||
6988 | 0x3c030001, 0x3463d600, 0x3c040001, 0x3484ddff, 0x3c010001, 0xac220f40, | ||
6989 | 0x24020040, 0x3c010001, 0xac220f44, 0x3c010001, 0xac200f3c, 0xac600000, | ||
6990 | 0x24630004, 0x0083102b, 0x5040fffd, 0xac600000, 0x03e00008, 0x00000000, | ||
6991 | 0x00804821, 0x8faa0010, 0x3c020001, 0x8c420f3c, 0x3c040001, 0x8c840f44, | ||
6992 | 0x8fab0014, 0x24430001, 0x0044102b, 0x3c010001, 0xac230f3c, 0x14400003, | ||
6993 | 0x00004021, 0x3c010001, 0xac200f3c, 0x3c020001, 0x8c420f3c, 0x3c030001, | ||
6994 | 0x8c630f40, 0x91240000, 0x00021140, 0x00431021, 0x00481021, 0x25080001, | ||
6995 | 0xa0440000, 0x29020008, 0x1440fff4, 0x25290001, 0x3c020001, 0x8c420f3c, | ||
6996 | 0x3c030001, 0x8c630f40, 0x8f64680c, 0x00021140, 0x00431021, 0xac440008, | ||
6997 | 0xac45000c, 0xac460010, 0xac470014, 0xac4a0018, 0x03e00008, 0xac4b001c, | ||
6998 | 0x00000000, 0x00000000, 0x00000000, | ||
6999 | }; | ||
7000 | |||
7001 | static const u32 tg3Tso5FwRodata[(TG3_TSO5_FW_RODATA_LEN / 4) + 1] = { | ||
7002 | 0x4d61696e, 0x43707542, 0x00000000, 0x4d61696e, 0x43707541, 0x00000000, | ||
7003 | 0x00000000, 0x00000000, 0x73746b6f, 0x66666c64, 0x00000000, 0x00000000, | ||
7004 | 0x73746b6f, 0x66666c64, 0x00000000, 0x00000000, 0x66617461, 0x6c457272, | ||
7005 | 0x00000000, 0x00000000, 0x00000000, | ||
7006 | }; | ||
7007 | |||
7008 | static const u32 tg3Tso5FwData[(TG3_TSO5_FW_DATA_LEN / 4) + 1] = { | ||
7009 | 0x00000000, 0x73746b6f, 0x66666c64, 0x5f76312e, 0x322e3000, 0x00000000, | ||
7010 | 0x00000000, 0x00000000, 0x00000000, | ||
7011 | }; | ||
7012 | 6379 | ||
7013 | /* tp->lock is held. */ | 6380 | /* tp->lock is held. */ |
7014 | static int tg3_load_tso_firmware(struct tg3 *tp) | 6381 | static int tg3_load_tso_firmware(struct tg3 *tp) |
7015 | { | 6382 | { |
7016 | struct fw_info info; | 6383 | struct fw_info info; |
6384 | const __be32 *fw_data; | ||
7017 | unsigned long cpu_base, cpu_scratch_base, cpu_scratch_size; | 6385 | unsigned long cpu_base, cpu_scratch_base, cpu_scratch_size; |
7018 | int err, i; | 6386 | int err, i; |
7019 | 6387 | ||
7020 | if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) | 6388 | if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) |
7021 | return 0; | 6389 | return 0; |
7022 | 6390 | ||
6391 | fw_data = (void *)tp->fw->data; | ||
6392 | |||
6393 | /* Firmware blob starts with version numbers, followed by | ||
6394 | start address and length. We are setting complete length. | ||
6395 | length = end_address_of_bss - start_address_of_text. | ||
6396 | Remainder is the blob to be loaded contiguously | ||
6397 | from start address. */ | ||
6398 | |||
6399 | info.fw_base = be32_to_cpu(fw_data[1]); | ||
6400 | cpu_scratch_size = tp->fw_len; | ||
6401 | info.fw_len = tp->fw->size - 12; | ||
6402 | info.fw_data = &fw_data[3]; | ||
6403 | |||
7023 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705) { | 6404 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705) { |
7024 | info.text_base = TG3_TSO5_FW_TEXT_ADDR; | ||
7025 | info.text_len = TG3_TSO5_FW_TEXT_LEN; | ||
7026 | info.text_data = &tg3Tso5FwText[0]; | ||
7027 | info.rodata_base = TG3_TSO5_FW_RODATA_ADDR; | ||
7028 | info.rodata_len = TG3_TSO5_FW_RODATA_LEN; | ||
7029 | info.rodata_data = &tg3Tso5FwRodata[0]; | ||
7030 | info.data_base = TG3_TSO5_FW_DATA_ADDR; | ||
7031 | info.data_len = TG3_TSO5_FW_DATA_LEN; | ||
7032 | info.data_data = &tg3Tso5FwData[0]; | ||
7033 | cpu_base = RX_CPU_BASE; | 6405 | cpu_base = RX_CPU_BASE; |
7034 | cpu_scratch_base = NIC_SRAM_MBUF_POOL_BASE5705; | 6406 | cpu_scratch_base = NIC_SRAM_MBUF_POOL_BASE5705; |
7035 | cpu_scratch_size = (info.text_len + | ||
7036 | info.rodata_len + | ||
7037 | info.data_len + | ||
7038 | TG3_TSO5_FW_SBSS_LEN + | ||
7039 | TG3_TSO5_FW_BSS_LEN); | ||
7040 | } else { | 6407 | } else { |
7041 | info.text_base = TG3_TSO_FW_TEXT_ADDR; | ||
7042 | info.text_len = TG3_TSO_FW_TEXT_LEN; | ||
7043 | info.text_data = &tg3TsoFwText[0]; | ||
7044 | info.rodata_base = TG3_TSO_FW_RODATA_ADDR; | ||
7045 | info.rodata_len = TG3_TSO_FW_RODATA_LEN; | ||
7046 | info.rodata_data = &tg3TsoFwRodata[0]; | ||
7047 | info.data_base = TG3_TSO_FW_DATA_ADDR; | ||
7048 | info.data_len = TG3_TSO_FW_DATA_LEN; | ||
7049 | info.data_data = &tg3TsoFwData[0]; | ||
7050 | cpu_base = TX_CPU_BASE; | 6408 | cpu_base = TX_CPU_BASE; |
7051 | cpu_scratch_base = TX_CPU_SCRATCH_BASE; | 6409 | cpu_scratch_base = TX_CPU_SCRATCH_BASE; |
7052 | cpu_scratch_size = TX_CPU_SCRATCH_SIZE; | 6410 | cpu_scratch_size = TX_CPU_SCRATCH_SIZE; |
@@ -7060,21 +6418,21 @@ static int tg3_load_tso_firmware(struct tg3 *tp) | |||
7060 | 6418 | ||
7061 | /* Now startup the cpu. */ | 6419 | /* Now startup the cpu. */ |
7062 | tw32(cpu_base + CPU_STATE, 0xffffffff); | 6420 | tw32(cpu_base + CPU_STATE, 0xffffffff); |
7063 | tw32_f(cpu_base + CPU_PC, info.text_base); | 6421 | tw32_f(cpu_base + CPU_PC, info.fw_base); |
7064 | 6422 | ||
7065 | for (i = 0; i < 5; i++) { | 6423 | for (i = 0; i < 5; i++) { |
7066 | if (tr32(cpu_base + CPU_PC) == info.text_base) | 6424 | if (tr32(cpu_base + CPU_PC) == info.fw_base) |
7067 | break; | 6425 | break; |
7068 | tw32(cpu_base + CPU_STATE, 0xffffffff); | 6426 | tw32(cpu_base + CPU_STATE, 0xffffffff); |
7069 | tw32(cpu_base + CPU_MODE, CPU_MODE_HALT); | 6427 | tw32(cpu_base + CPU_MODE, CPU_MODE_HALT); |
7070 | tw32_f(cpu_base + CPU_PC, info.text_base); | 6428 | tw32_f(cpu_base + CPU_PC, info.fw_base); |
7071 | udelay(1000); | 6429 | udelay(1000); |
7072 | } | 6430 | } |
7073 | if (i >= 5) { | 6431 | if (i >= 5) { |
7074 | printk(KERN_ERR PFX "tg3_load_tso_firmware fails for %s " | 6432 | printk(KERN_ERR PFX "tg3_load_tso_firmware fails for %s " |
7075 | "to set CPU PC, is %08x should be %08x\n", | 6433 | "to set CPU PC, is %08x should be %08x\n", |
7076 | tp->dev->name, tr32(cpu_base + CPU_PC), | 6434 | tp->dev->name, tr32(cpu_base + CPU_PC), |
7077 | info.text_base); | 6435 | info.fw_base); |
7078 | return -ENODEV; | 6436 | return -ENODEV; |
7079 | } | 6437 | } |
7080 | tw32(cpu_base + CPU_STATE, 0xffffffff); | 6438 | tw32(cpu_base + CPU_STATE, 0xffffffff); |
@@ -7299,11 +6657,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) | |||
7299 | else if (tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE) { | 6657 | else if (tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE) { |
7300 | int fw_len; | 6658 | int fw_len; |
7301 | 6659 | ||
7302 | fw_len = (TG3_TSO5_FW_TEXT_LEN + | 6660 | fw_len = tp->fw_len; |
7303 | TG3_TSO5_FW_RODATA_LEN + | ||
7304 | TG3_TSO5_FW_DATA_LEN + | ||
7305 | TG3_TSO5_FW_SBSS_LEN + | ||
7306 | TG3_TSO5_FW_BSS_LEN); | ||
7307 | fw_len = (fw_len + (0x80 - 1)) & ~(0x80 - 1); | 6661 | fw_len = (fw_len + (0x80 - 1)) & ~(0x80 - 1); |
7308 | tw32(BUFMGR_MB_POOL_ADDR, | 6662 | tw32(BUFMGR_MB_POOL_ADDR, |
7309 | NIC_SRAM_MBUF_POOL_BASE5705 + fw_len); | 6663 | NIC_SRAM_MBUF_POOL_BASE5705 + fw_len); |
@@ -13580,6 +12934,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
13580 | struct net_device *dev; | 12934 | struct net_device *dev; |
13581 | struct tg3 *tp; | 12935 | struct tg3 *tp; |
13582 | int err, pm_cap; | 12936 | int err, pm_cap; |
12937 | const char *fw_name = NULL; | ||
13583 | char str[40]; | 12938 | char str[40]; |
13584 | u64 dma_mask, persist_dma_mask; | 12939 | u64 dma_mask, persist_dma_mask; |
13585 | 12940 | ||
@@ -13735,6 +13090,9 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
13735 | 13090 | ||
13736 | tg3_init_bufmgr_config(tp); | 13091 | tg3_init_bufmgr_config(tp); |
13737 | 13092 | ||
13093 | if (tp->pci_chip_rev_id == CHIPREV_ID_5701_A0) | ||
13094 | fw_name = FIRMWARE_TG3; | ||
13095 | |||
13738 | if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) { | 13096 | if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) { |
13739 | tp->tg3_flags2 |= TG3_FLG2_TSO_CAPABLE; | 13097 | tp->tg3_flags2 |= TG3_FLG2_TSO_CAPABLE; |
13740 | } | 13098 | } |
@@ -13747,6 +13105,37 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
13747 | } else { | 13105 | } else { |
13748 | tp->tg3_flags2 |= TG3_FLG2_TSO_CAPABLE | TG3_FLG2_TSO_BUG; | 13106 | tp->tg3_flags2 |= TG3_FLG2_TSO_CAPABLE | TG3_FLG2_TSO_BUG; |
13749 | } | 13107 | } |
13108 | if (tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE) { | ||
13109 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705) | ||
13110 | fw_name = FIRMWARE_TG3TSO5; | ||
13111 | else | ||
13112 | fw_name = FIRMWARE_TG3TSO; | ||
13113 | } | ||
13114 | |||
13115 | if (fw_name) { | ||
13116 | const __be32 *fw_data; | ||
13117 | |||
13118 | err = request_firmware(&tp->fw, fw_name, &tp->pdev->dev); | ||
13119 | if (err) { | ||
13120 | printk(KERN_ERR "tg3: Failed to load firmware \"%s\"\n", | ||
13121 | fw_name); | ||
13122 | goto err_out_iounmap; | ||
13123 | } | ||
13124 | |||
13125 | fw_data = (void *)tp->fw->data; | ||
13126 | |||
13127 | /* Firmware blob starts with version numbers, followed by | ||
13128 | start address and _full_ length including BSS sections | ||
13129 | (which must be longer than the actual data, of course */ | ||
13130 | |||
13131 | tp->fw_len = be32_to_cpu(fw_data[2]); /* includes bss */ | ||
13132 | if (tp->fw_len < (tp->fw->size - 12)) { | ||
13133 | printk(KERN_ERR "tg3: bogus length %d in \"%s\"\n", | ||
13134 | tp->fw_len, fw_name); | ||
13135 | err = -EINVAL; | ||
13136 | goto err_out_fw; | ||
13137 | } | ||
13138 | } | ||
13750 | 13139 | ||
13751 | /* TSO is on by default on chips that support hardware TSO. | 13140 | /* TSO is on by default on chips that support hardware TSO. |
13752 | * Firmware TSO on older chips gives lower performance, so it | 13141 | * Firmware TSO on older chips gives lower performance, so it |
@@ -13778,7 +13167,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
13778 | if (err) { | 13167 | if (err) { |
13779 | printk(KERN_ERR PFX "Could not obtain valid ethernet address, " | 13168 | printk(KERN_ERR PFX "Could not obtain valid ethernet address, " |
13780 | "aborting.\n"); | 13169 | "aborting.\n"); |
13781 | goto err_out_iounmap; | 13170 | goto err_out_fw; |
13782 | } | 13171 | } |
13783 | 13172 | ||
13784 | if (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE) { | 13173 | if (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE) { |
@@ -13787,7 +13176,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
13787 | printk(KERN_ERR PFX "Cannot map APE registers, " | 13176 | printk(KERN_ERR PFX "Cannot map APE registers, " |
13788 | "aborting.\n"); | 13177 | "aborting.\n"); |
13789 | err = -ENOMEM; | 13178 | err = -ENOMEM; |
13790 | goto err_out_iounmap; | 13179 | goto err_out_fw; |
13791 | } | 13180 | } |
13792 | 13181 | ||
13793 | tg3_ape_lock_init(tp); | 13182 | tg3_ape_lock_init(tp); |
@@ -13867,6 +13256,10 @@ err_out_apeunmap: | |||
13867 | tp->aperegs = NULL; | 13256 | tp->aperegs = NULL; |
13868 | } | 13257 | } |
13869 | 13258 | ||
13259 | err_out_fw: | ||
13260 | if (tp->fw) | ||
13261 | release_firmware(tp->fw); | ||
13262 | |||
13870 | err_out_iounmap: | 13263 | err_out_iounmap: |
13871 | if (tp->regs) { | 13264 | if (tp->regs) { |
13872 | iounmap(tp->regs); | 13265 | iounmap(tp->regs); |
@@ -13892,6 +13285,9 @@ static void __devexit tg3_remove_one(struct pci_dev *pdev) | |||
13892 | if (dev) { | 13285 | if (dev) { |
13893 | struct tg3 *tp = netdev_priv(dev); | 13286 | struct tg3 *tp = netdev_priv(dev); |
13894 | 13287 | ||
13288 | if (tp->fw) | ||
13289 | release_firmware(tp->fw); | ||
13290 | |||
13895 | flush_scheduled_work(); | 13291 | flush_scheduled_work(); |
13896 | 13292 | ||
13897 | if (tp->tg3_flags3 & TG3_FLG3_USE_PHYLIB) { | 13293 | if (tp->tg3_flags3 & TG3_FLG3_USE_PHYLIB) { |
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h index 8936edfb0438..ae5da603c6af 100644 --- a/drivers/net/tg3.h +++ b/drivers/net/tg3.h | |||
@@ -2762,6 +2762,10 @@ struct tg3 { | |||
2762 | #define SST_25VF0X0_PAGE_SIZE 4098 | 2762 | #define SST_25VF0X0_PAGE_SIZE 4098 |
2763 | 2763 | ||
2764 | struct ethtool_coalesce coal; | 2764 | struct ethtool_coalesce coal; |
2765 | |||
2766 | /* firmware info */ | ||
2767 | const struct firmware *fw; | ||
2768 | u32 fw_len; /* includes BSS */ | ||
2765 | }; | 2769 | }; |
2766 | 2770 | ||
2767 | #endif /* !(_T3_H) */ | 2771 | #endif /* !(_T3_H) */ |
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 69f9a0ec764d..d7b81e4fdd56 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c | |||
@@ -213,7 +213,7 @@ static int check_filter(struct tap_filter *filter, const struct sk_buff *skb) | |||
213 | 213 | ||
214 | /* Network device part of the driver */ | 214 | /* Network device part of the driver */ |
215 | 215 | ||
216 | static unsigned int tun_net_id; | 216 | static int tun_net_id; |
217 | struct tun_net { | 217 | struct tun_net { |
218 | struct list_head dev_list; | 218 | struct list_head dev_list; |
219 | }; | 219 | }; |
diff --git a/drivers/s390/net/qeth_core.h b/drivers/s390/net/qeth_core.h index d5ccce1643e4..e0c45574b0c8 100644 --- a/drivers/s390/net/qeth_core.h +++ b/drivers/s390/net/qeth_core.h | |||
@@ -643,7 +643,6 @@ struct qeth_card_options { | |||
643 | int macaddr_mode; | 643 | int macaddr_mode; |
644 | int fake_broadcast; | 644 | int fake_broadcast; |
645 | int add_hhlen; | 645 | int add_hhlen; |
646 | int fake_ll; | ||
647 | int layer2; | 646 | int layer2; |
648 | enum qeth_large_send_types large_send; | 647 | enum qeth_large_send_types large_send; |
649 | int performance_stats; | 648 | int performance_stats; |
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c index e783644a2105..6811dd529f48 100644 --- a/drivers/s390/net/qeth_core_main.c +++ b/drivers/s390/net/qeth_core_main.c | |||
@@ -287,8 +287,15 @@ int qeth_set_large_send(struct qeth_card *card, | |||
287 | card->options.large_send = type; | 287 | card->options.large_send = type; |
288 | switch (card->options.large_send) { | 288 | switch (card->options.large_send) { |
289 | case QETH_LARGE_SEND_EDDP: | 289 | case QETH_LARGE_SEND_EDDP: |
290 | card->dev->features |= NETIF_F_TSO | NETIF_F_SG | | 290 | if (card->info.type != QETH_CARD_TYPE_IQD) { |
291 | card->dev->features |= NETIF_F_TSO | NETIF_F_SG | | ||
291 | NETIF_F_HW_CSUM; | 292 | NETIF_F_HW_CSUM; |
293 | } else { | ||
294 | card->dev->features &= ~(NETIF_F_TSO | NETIF_F_SG | | ||
295 | NETIF_F_HW_CSUM); | ||
296 | card->options.large_send = QETH_LARGE_SEND_NO; | ||
297 | rc = -EOPNOTSUPP; | ||
298 | } | ||
292 | break; | 299 | break; |
293 | case QETH_LARGE_SEND_TSO: | 300 | case QETH_LARGE_SEND_TSO: |
294 | if (qeth_is_supported(card, IPA_OUTBOUND_TSO)) { | 301 | if (qeth_is_supported(card, IPA_OUTBOUND_TSO)) { |
@@ -572,6 +579,10 @@ static void qeth_send_control_data_cb(struct qeth_channel *channel, | |||
572 | card = CARD_FROM_CDEV(channel->ccwdev); | 579 | card = CARD_FROM_CDEV(channel->ccwdev); |
573 | if (qeth_check_idx_response(iob->data)) { | 580 | if (qeth_check_idx_response(iob->data)) { |
574 | qeth_clear_ipacmd_list(card); | 581 | qeth_clear_ipacmd_list(card); |
582 | if (((iob->data[2] & 0xc0) == 0xc0) && iob->data[4] == 0xf6) | ||
583 | dev_err(&card->gdev->dev, | ||
584 | "The qeth device is not configured " | ||
585 | "for the OSI layer required by z/VM\n"); | ||
575 | qeth_schedule_recovery(card); | 586 | qeth_schedule_recovery(card); |
576 | goto out; | 587 | goto out; |
577 | } | 588 | } |
@@ -1072,7 +1083,6 @@ static void qeth_set_intial_options(struct qeth_card *card) | |||
1072 | card->options.macaddr_mode = QETH_TR_MACADDR_NONCANONICAL; | 1083 | card->options.macaddr_mode = QETH_TR_MACADDR_NONCANONICAL; |
1073 | card->options.fake_broadcast = 0; | 1084 | card->options.fake_broadcast = 0; |
1074 | card->options.add_hhlen = DEFAULT_ADD_HHLEN; | 1085 | card->options.add_hhlen = DEFAULT_ADD_HHLEN; |
1075 | card->options.fake_ll = 0; | ||
1076 | card->options.performance_stats = 0; | 1086 | card->options.performance_stats = 0; |
1077 | card->options.rx_sg_cb = QETH_RX_SG_CB; | 1087 | card->options.rx_sg_cb = QETH_RX_SG_CB; |
1078 | } | 1088 | } |
@@ -1682,6 +1692,7 @@ int qeth_send_control_data(struct qeth_card *card, int len, | |||
1682 | unsigned long flags; | 1692 | unsigned long flags; |
1683 | struct qeth_reply *reply = NULL; | 1693 | struct qeth_reply *reply = NULL; |
1684 | unsigned long timeout; | 1694 | unsigned long timeout; |
1695 | struct qeth_ipa_cmd *cmd; | ||
1685 | 1696 | ||
1686 | QETH_DBF_TEXT(TRACE, 2, "sendctl"); | 1697 | QETH_DBF_TEXT(TRACE, 2, "sendctl"); |
1687 | 1698 | ||
@@ -1728,17 +1739,34 @@ int qeth_send_control_data(struct qeth_card *card, int len, | |||
1728 | wake_up(&card->wait_q); | 1739 | wake_up(&card->wait_q); |
1729 | return rc; | 1740 | return rc; |
1730 | } | 1741 | } |
1731 | while (!atomic_read(&reply->received)) { | 1742 | |
1732 | if (time_after(jiffies, timeout)) { | 1743 | /* we have only one long running ipassist, since we can ensure |
1733 | spin_lock_irqsave(&reply->card->lock, flags); | 1744 | process context of this command we can sleep */ |
1734 | list_del_init(&reply->list); | 1745 | cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE); |
1735 | spin_unlock_irqrestore(&reply->card->lock, flags); | 1746 | if ((cmd->hdr.command == IPA_CMD_SETIP) && |
1736 | reply->rc = -ETIME; | 1747 | (cmd->hdr.prot_version == QETH_PROT_IPV4)) { |
1737 | atomic_inc(&reply->received); | 1748 | if (!wait_event_timeout(reply->wait_q, |
1738 | wake_up(&reply->wait_q); | 1749 | atomic_read(&reply->received), timeout)) |
1739 | } | 1750 | goto time_err; |
1740 | cpu_relax(); | 1751 | } else { |
1741 | }; | 1752 | while (!atomic_read(&reply->received)) { |
1753 | if (time_after(jiffies, timeout)) | ||
1754 | goto time_err; | ||
1755 | cpu_relax(); | ||
1756 | }; | ||
1757 | } | ||
1758 | |||
1759 | rc = reply->rc; | ||
1760 | qeth_put_reply(reply); | ||
1761 | return rc; | ||
1762 | |||
1763 | time_err: | ||
1764 | spin_lock_irqsave(&reply->card->lock, flags); | ||
1765 | list_del_init(&reply->list); | ||
1766 | spin_unlock_irqrestore(&reply->card->lock, flags); | ||
1767 | reply->rc = -ETIME; | ||
1768 | atomic_inc(&reply->received); | ||
1769 | wake_up(&reply->wait_q); | ||
1742 | rc = reply->rc; | 1770 | rc = reply->rc; |
1743 | qeth_put_reply(reply); | 1771 | qeth_put_reply(reply); |
1744 | return rc; | 1772 | return rc; |
@@ -2250,7 +2278,8 @@ void qeth_print_status_message(struct qeth_card *card) | |||
2250 | } | 2278 | } |
2251 | /* fallthrough */ | 2279 | /* fallthrough */ |
2252 | case QETH_CARD_TYPE_IQD: | 2280 | case QETH_CARD_TYPE_IQD: |
2253 | if (card->info.guestlan) { | 2281 | if ((card->info.guestlan) || |
2282 | (card->info.mcl_level[0] & 0x80)) { | ||
2254 | card->info.mcl_level[0] = (char) _ebcasc[(__u8) | 2283 | card->info.mcl_level[0] = (char) _ebcasc[(__u8) |
2255 | card->info.mcl_level[0]]; | 2284 | card->info.mcl_level[0]]; |
2256 | card->info.mcl_level[1] = (char) _ebcasc[(__u8) | 2285 | card->info.mcl_level[1] = (char) _ebcasc[(__u8) |
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c index 2c48591ced44..21627ba3093b 100644 --- a/drivers/s390/net/qeth_l2_main.c +++ b/drivers/s390/net/qeth_l2_main.c | |||
@@ -1126,9 +1126,11 @@ static int qeth_l2_recover(void *ptr) | |||
1126 | dev_info(&card->gdev->dev, | 1126 | dev_info(&card->gdev->dev, |
1127 | "Device successfully recovered!\n"); | 1127 | "Device successfully recovered!\n"); |
1128 | else { | 1128 | else { |
1129 | rtnl_lock(); | 1129 | if (card->dev) { |
1130 | dev_close(card->dev); | 1130 | rtnl_lock(); |
1131 | rtnl_unlock(); | 1131 | dev_close(card->dev); |
1132 | rtnl_unlock(); | ||
1133 | } | ||
1132 | dev_warn(&card->gdev->dev, "The qeth device driver " | 1134 | dev_warn(&card->gdev->dev, "The qeth device driver " |
1133 | "failed to recover an error on the device\n"); | 1135 | "failed to recover an error on the device\n"); |
1134 | } | 1136 | } |
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c index c0b30b25a5f1..cfda1ecffdf2 100644 --- a/drivers/s390/net/qeth_l3_main.c +++ b/drivers/s390/net/qeth_l3_main.c | |||
@@ -1047,7 +1047,7 @@ static int qeth_l3_setadapter_parms(struct qeth_card *card) | |||
1047 | rc = qeth_setadpparms_change_macaddr(card); | 1047 | rc = qeth_setadpparms_change_macaddr(card); |
1048 | if (rc) | 1048 | if (rc) |
1049 | dev_warn(&card->gdev->dev, "Reading the adapter MAC" | 1049 | dev_warn(&card->gdev->dev, "Reading the adapter MAC" |
1050 | " address failed\n", rc); | 1050 | " address failed\n"); |
1051 | } | 1051 | } |
1052 | 1052 | ||
1053 | if ((card->info.link_type == QETH_LINK_TYPE_HSTR) || | 1053 | if ((card->info.link_type == QETH_LINK_TYPE_HSTR) || |
@@ -1207,12 +1207,9 @@ static int qeth_l3_start_ipa_source_mac(struct qeth_card *card) | |||
1207 | 1207 | ||
1208 | QETH_DBF_TEXT(TRACE, 3, "stsrcmac"); | 1208 | QETH_DBF_TEXT(TRACE, 3, "stsrcmac"); |
1209 | 1209 | ||
1210 | if (!card->options.fake_ll) | ||
1211 | return -EOPNOTSUPP; | ||
1212 | |||
1213 | if (!qeth_is_supported(card, IPA_SOURCE_MAC)) { | 1210 | if (!qeth_is_supported(card, IPA_SOURCE_MAC)) { |
1214 | dev_info(&card->gdev->dev, | 1211 | dev_info(&card->gdev->dev, |
1215 | "Inbound source address not supported on %s\n", | 1212 | "Inbound source MAC-address not supported on %s\n", |
1216 | QETH_CARD_IFNAME(card)); | 1213 | QETH_CARD_IFNAME(card)); |
1217 | return -EOPNOTSUPP; | 1214 | return -EOPNOTSUPP; |
1218 | } | 1215 | } |
@@ -1221,7 +1218,7 @@ static int qeth_l3_start_ipa_source_mac(struct qeth_card *card) | |||
1221 | IPA_CMD_ASS_START, 0); | 1218 | IPA_CMD_ASS_START, 0); |
1222 | if (rc) | 1219 | if (rc) |
1223 | dev_warn(&card->gdev->dev, | 1220 | dev_warn(&card->gdev->dev, |
1224 | "Starting proxy ARP support for %s failed\n", | 1221 | "Starting source MAC-address support for %s failed\n", |
1225 | QETH_CARD_IFNAME(card)); | 1222 | QETH_CARD_IFNAME(card)); |
1226 | return rc; | 1223 | return rc; |
1227 | } | 1224 | } |
@@ -1921,8 +1918,13 @@ static inline __u16 qeth_l3_rebuild_skb(struct qeth_card *card, | |||
1921 | memcpy(tg_addr, card->dev->dev_addr, | 1918 | memcpy(tg_addr, card->dev->dev_addr, |
1922 | card->dev->addr_len); | 1919 | card->dev->addr_len); |
1923 | } | 1920 | } |
1924 | card->dev->header_ops->create(skb, card->dev, prot, tg_addr, | 1921 | if (hdr->hdr.l3.ext_flags & QETH_HDR_EXT_SRC_MAC_ADDR) |
1925 | "FAKELL", card->dev->addr_len); | 1922 | card->dev->header_ops->create(skb, card->dev, prot, |
1923 | tg_addr, &hdr->hdr.l3.dest_addr[2], | ||
1924 | card->dev->addr_len); | ||
1925 | else | ||
1926 | card->dev->header_ops->create(skb, card->dev, prot, | ||
1927 | tg_addr, "FAKELL", card->dev->addr_len); | ||
1926 | } | 1928 | } |
1927 | 1929 | ||
1928 | #ifdef CONFIG_TR | 1930 | #ifdef CONFIG_TR |
@@ -2080,9 +2082,11 @@ static int qeth_l3_stop_card(struct qeth_card *card, int recovery_mode) | |||
2080 | if (recovery_mode) | 2082 | if (recovery_mode) |
2081 | qeth_l3_stop(card->dev); | 2083 | qeth_l3_stop(card->dev); |
2082 | else { | 2084 | else { |
2083 | rtnl_lock(); | 2085 | if (card->dev) { |
2084 | dev_close(card->dev); | 2086 | rtnl_lock(); |
2085 | rtnl_unlock(); | 2087 | dev_close(card->dev); |
2088 | rtnl_unlock(); | ||
2089 | } | ||
2086 | } | 2090 | } |
2087 | if (!card->use_hard_stop) { | 2091 | if (!card->use_hard_stop) { |
2088 | rc = qeth_send_stoplan(card); | 2092 | rc = qeth_send_stoplan(card); |