[kernel] r17922 - in dists/squeeze/linux-2.6/debian: . config patches/features/all patches/features/all/e1000e patches/features/all/igb patches/features/all/r8169 patches/features/all/tg3 patches/series
Ben Hutchings
benh at alioth.debian.org
Sun Aug 14 22:55:31 UTC 2011
Author: benh
Date: Sun Aug 14 22:55:28 2011
New Revision: 17922
Log:
Backport e1000e, igb, igbvf, r8169, tg3, broadcom from Linux 2.6.38
I backported these some time ago, but didn't commit the changes due to
lack of testing. Some of the drivers should be further updated to 3.0
now.
Added:
dists/squeeze/linux-2.6/debian/patches/features/all/PCI-Add-dummy-implementation-of-pci_dev_run_wake.patch
dists/squeeze/linux-2.6/debian/patches/features/all/dma-mapping-dma-mapping.h-add-dma_set_coherent_mask.patch
dists/squeeze/linux-2.6/debian/patches/features/all/dma-mapping.h-add-the-dma_unmap-state-API.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0001-e1000e-Use-the-instance-of-net_device_stats-from-net.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0002-net-Use-netdev_alloc_skb_ip_align.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0003-e1000e-Fix-erroneous-display-of-stats-by-ethtool-S.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0004-drivers-net-request_irq-Remove-unnecessary-leading-f.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0005-e1000e-check-WoL-mode-is-among-set-of-supported-mode.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0006-e1000e-add-missing-tests-for-82583-in-ethtool-functi.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0007-e1000e-clearing-interrupt-timers-causes-descriptors-.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0008-e1000e-function-pointers-for-ethtool-set-get-offload.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0009-e1000e-don-t-clean-Rx-ring-while-resetting.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0010-e1000e-link-reporting-problems.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0011-e1000e-improper-return-code-signage.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0012-e1000e-disable-K1-on-PCH-LOM-when-in-PHY-loopback-mo.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0013-e1000e-Incorrect-MII-Link-beat-reporting.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0014-e1000e-cleanup-redundant-include-s.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0015-e1000e-consolidate-two-dbug-macros-into-one-simpler-.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0016-e1000e-cleanup-ops-function-pointers.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0017-e1000e-update-copyright-information.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0018-e1000e-remove-comments-regarding-a-non-existent-api-.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0019-e1000e-provide-comment-for-82571-workaround.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0020-e1000e-set-bools-to-true-false-instead-of-1-0.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0021-e1000e-cleanup-shift-indentation-left-by-exiting-ear.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0022-e1000e-cleanup-functions-that-clear-hardware-statist.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0023-e1000e-set-pm_qos-DMA-latency-requirement-per-interf.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0024-e1000e-do-not-error-out-on-identification-LED-init-f.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0025-e1000e-remove-redundant-might_sleep.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0026-e1000e-cosmetic-group-local-variables-of-the-same-ty.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0027-e1000e-update-Tx-Unit-hang-detection-message.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0028-e1000e-provide-family-specific-functions-to-manage-V.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0029-e1000e-guard-against-buffer-overflow-in-cable-length.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0030-e1000e-provide-family-specific-PHY-power-up-down-ope.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0031-e1000e-ensure-the-link-state-is-correct-for-serdes-l.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0032-e1000e-comment-corrections.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0033-e1000e-add-debug-messages.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0034-e1000e-PHY-type-cleanups-in-e1000e_check_downshift.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0035-e1000e-Use-sizeof-struct-rather-than-pointer-in-e100.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0036-e1000e-remove-use-of-skb_dma_map-from-e1000e-driver.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0037-e1000e-check_polarity-function-pointers-not-set-for-.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0038-e1000e-refactor-PHY-ID-detection-workaround.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0039-e1000e-correct-ICH-PCH-PHY-operations-function-point.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0040-drivers-net-Move-and-to-end-of-previous-line.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0041-e1000e-minor-correction-to-name-of-bit-in-CTRL_EXT-r.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0042-e1000e-replace-incorrect-use-of-GG82563_REG-macro.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0043-e1000e-only-perform-ESB2-MDIC-workaround-on-certain-.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0044-e1000e-LED-settings-in-EEPROM-ignored-on-82571-and-8.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0045-drivers-net-use-DEFINE_PCI_DEVICE_TABLE.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0046-e1000e-call-pci_save_state-after-pci_restore_state.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0047-e1000e-don-t-accumulate-PHY-statistics-on-PHY-read-f.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0048-e1000e-perform-10-100-adaptive-IFS-only-on-parts-tha.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0049-e1000e-e1000e_enable_tx_pkt_filtering-returns-wrong-.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0050-e1000e-fix-and-commonize-code-for-setting-the-receiv.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0051-e1000e-MDIO-slow-mode-should-always-be-done-for-8257.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0052-e1000e-workaround-link-issues-on-busy-hub-in-half-du.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0053-e1000e-use-alternate-MAC-address-on-ESB2-if-availabl.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0054-e1000e-provide-MAC-family-specific-function-to-set-L.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0055-e1000e-genericize-the-update-multicast-address-list.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0056-e1000-e1000e-igb-igbvf-ixgb-ixgbe-Fix-tests-of-unsig.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0057-net-Fix-IPv6-GSO-type-checks-in-Intel-ethernet-drive.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0058-e1000e-Fix-namespace-conflicts-wrt.-e1000_has_link.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0059-net-e1000e-convert-to-use-mc-helpers.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0060-tree-wide-Assorted-spelling-fixes.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0061-e1000e-fix-packet-corruption-and-tx-hang-during-NFSv.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0062-e1000e-enable-disable-ASPM-L0s-and-L1-and-ERT-accord.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0063-e1000e-PCI-PM-Add-basic-runtime-PM-support-rev.-4.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0064-e1000e-Fix-build-with-CONFIG_PM-disabled.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0065-Net-e1000e-Fix-build-issue-introduced-by-runtime-PM-.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0066-e1000e-Disable-run-time-PM-support.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0067-e1000e-do-not-modify-tx_queue_len-on-link-speed-chan.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0068-e1000e-Use-pr_-level-and-netdev_-level.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0069-include-cleanup-Update-gfp.h-and-slab.h-includes-to-.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0070-e1000e-typo-corrections.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0071-e1000e-use-static-params-to-save-stack-space.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0072-drivers-net-use-skb_headlen.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0073-e1000e-use-DMA-API-instead-of-PCI-DMA-functions.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0074-e1000e-add-registers-etc.-printout-code-just-before-.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0075-e1000e-Fix-oops-caused-by-ASPM-patch.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0076-e1000e-save-skb-counts-in-TX-to-avoid-cache-misses.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0077-e1000e-reduce-writes-of-RX-producer-ptr.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0078-e1000e-Remove-unnessary-log-message.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0079-e1000e-Save-irq-into-netdev-structure.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0080-e1000e-increase-rx-fifo-size-to-36K-on-82574-and-825.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0081-e1000-e1000e-implement-a-simple-interrupt-moderation.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0082-e1000e-reset-MAC-PHY-interconnect-on-82577-82578-dur.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0083-e1000e-use-static-params-to-save-stack-space-part-2.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0084-e1000e-bad-state-after-running-ethtool-diagnostics-w.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0085-e1000e-initialize-manageability-IPMI-pass-through-in.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0086-e1000e-s-w-initiated-LSC-MSI-X-interrupts-not-genera.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0087-e1000e-cleanup-multiple-common-exit-points.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0088-e1000e-Remove-EN_MAC_ADDR_FILTER-check-from-enable_m.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0089-e1000e-Cleanup-e1000_sw_lcd_config_ich8lan.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0090-e1000e-Incorrect-function-pointer-set-for-force_spee.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0091-e1000e-fix-checks-for-manageability-enabled-and-mana.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0092-e1000e-move-settting-of-flow-control-refresh-timer-t.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0093-e1000e-Fix-cleanup-PHY-reset-code-for-ICHx-PCHx.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0094-e1000e-add-PCI-device-id-to-enable-support-for-82567.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0095-drivers-net-Remove-unnecessary-returns-from-void-fun.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0096-e1000e-change-logical-negate-to-bitwise.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0097-e1000e-cleanup-ethtool-loopback-setup-code.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0098-e1000e-cleanup-e1000_sw_lcd_config_ich8lan.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0099-e1000e-separate-out-PHY-statistics-register-updates.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0100-e1000e-fix-check-for-manageability-on-ICHx-PCH.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0101-e1000e-initial-support-for-82579-LOMs.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0102-e1000e-enable-support-for-EEE-on-82579.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0103-e1000e-update-copyright-information.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0104-e1000e-update-driver-version-number.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0105-e1000e-avoid-polling-h-w-registers-during-link-negot.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0106-e1000e-do-not-touch-PHY-page-800-registers-when-link.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0107-e1000e-packet-split-should-not-be-used-with-early-re.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0108-e1000e-disable-gig-speed-when-in-S0-Sx-transition.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0109-e1000e-fail-when-try-to-setup-unsupported-features.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0110-e1000e-suppress-compile-warnings-on-certain-archs.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0111-e1000e-remove-EEE-module-parameter.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0112-e1000e-disable-EEE-support-by-default.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0113-e1000e-Drop-a-useless-statement.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0114-e1000e-Fix-irq_synchronize-in-MSI-X-case.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0115-e1000e-correct-MAC-PHY-interconnect-register-offset-.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0116-e100-e1000-igb-ixgb-Add-missing-read-memory-barrier.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0117-e1000e-disable-ASPM-L1-on-82573.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0118-e1000e-don-t-check-for-alternate-MAC-addr-on-parts-t.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0119-drivers-net-Remove-address-use-from-assignments-of-f.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0120-e1000e-Simplify-MSI-interrupt-testing.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0121-e1000e-82577-8-9-issues-with-device-in-Sx.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0122-e1000e-82579-SMBus-address-and-LEDs-incorrect-after-.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0123-e1000e-82566DC-fails-to-get-link.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0124-e1000e-82579-unaccounted-missed-packets.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0125-e1000e-82579-jumbo-frame-workaround-causing-CRC-erro.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0126-e1000e-82579-do-not-gate-auto-config-of-PHY-by-hardw.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0127-e1000-e1000e-igb-ixgb-ixgbe-set-NETIF_F_HIGHDMA-for-.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0128-drivers-net-return-operator-cleanup.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0129-e1000e-use-hardware-writeback-batching.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0130-e1000e-Fix-for-offline-diag-test-failure-at-first-ca.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0131-e1000e-82579-performance-improvements.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0132-e1000e-reset-PHY-after-errors-detected.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0133-e1000e-Add-check-for-reset-flags-before-displaying-r.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0134-tree-wide-fix-comment-printk-typos.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0135-drivers-net-e1000e-Remove-unnecessary-semicolons.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0136-e1000e-82571-SerDes-link-handle-null-code-word-from-.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0137-e1000e-82574-intermittently-fails-to-initialize-with.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0138-e1000e-add-netpoll-support-for-MSI-MSI-X-IRQ-modes.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0139-Intel-Wired-LAN-drivers-Use-static-const.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0140-e1000e-fix-double-initialization-in-blink-path.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0141-e1000e-82571-based-mezzanine-card-can-fail-ethtool-l.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0142-e1000e-82574-82583-performance-improvement.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0143-e1000e-82577-8-must-acquire-h-w-semaphore-before-wor.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0144-e1000e-82571-Serdes-can-fail-to-get-link.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0145-e1000e-82577-8-9-mis-configured-OEM-bits-during-S0-S.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0146-e1000e-82579-PHY-incorrectly-identified-during-init.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0147-e1000e-support-new-PBA-format-from-EEPROM.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0148-e1000e-prevent-null-ptr-dereference-in-e1000_tx_queu.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0149-e1000e-minor-error-message-corrections.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0150-e1000e-static-analysis-tools-complain-of-a-possible-.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0151-e1000e-increment-the-driver-version.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0152-e1000e-checkpatch-error-macro-panethesis.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0153-e1000e-checkpatch-error-trailing-statements.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0154-e1000e-checkpatch-error-open-braces.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0155-e1000e-checkpatch-warnings-braces.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0156-e1000e-cleanup-variables-set-but-not-used.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0157-e1000e-convert-calls-of-ops.-read-write-_reg-to-e1e_.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0158-e1000e-properly-bounds-check-string-functions.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0159-e1000e-use-either_crc_le-rather-than-re-write-it.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0160-e1000e-power-off-PHY-after-reset-when-interface-is-d.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0161-e1000e-add-custom-set_d-0-3-_lplu_state-function-poi.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0162-e1000e-update-Copyright-for-2011.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0163-e1000e-consistent-use-of-Rx-Tx-vs.-RX-TX-rx-tx-in-co.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0164-e1000e-tx_timeout-should-not-increment-for-non-hang-.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0165-e1000e-check-down-flag-in-tasks.patch
dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0166-e1000e-flush-all-writebacks-before-unload.patch
dists/squeeze/linux-2.6/debian/patches/features/all/etherdevice-Dummy-implementation-of-dev_hw_addr_rand.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0001-net-Convert-ethtool-get_stats-self_test-_count-ops-t.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0002-igb-remove-unused-temp-variable-from-stats-clearing-.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0003-igb-update-comments-for-serdes-config-and-update-to-.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0004-igb-update-the-approach-taken-to-acquiring-and-relea.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0005-igb-add-locking-to-reads-of-the-i2c-interface.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0006-igb-add-combined-function-for-setting-rar-and-pool-b.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0007-igb-make-use-of-the-uta-to-allow-for-promiscous-mode.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0008-igb-add-function-to-handle-mailbox-lock.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0009-igb-fix-a-few-items-where-weren-t-correctly-setup-fo.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0010-igb-remove-microwire-support-from-igb.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0011-igb-move-the-generic-copper-link-setup-code-into-e10.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0012-igb-add-code-to-retry-a-phy-read-in-the-event-of-fai.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0013-igb-add-additional-error-handling-to-the-phy-code.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0014-igb-add-flushes-between-RAR-writes-when-setting-mac-.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0015-igb-Use-the-instance-of-net_device_stats-from-net_de.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0016-net-Use-netdev_alloc_skb_ip_align.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0017-igb-Fix-erroneous-display-of-stats-by-ethtool-S.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0018-igb-add-new-data-structure-for-handling-interrupts-a.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0019-igb-remove-rx-checksum-good-counter.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0020-igb-increase-minimum-rx-buffer-size-to-1K.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0021-igb-move-the-tx-and-rx-ring-specific-config-into-sep.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0022-igb-remove-rx_ps_hdr_len.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0023-igb-move-SRRCTL-register-configuration-into-ring-spe.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0024-igb-change-the-head-and-tail-offsets-into-pointers.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0025-igb-add-pci-device-pointer-to-ring-structure.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0026-igb-move-rx_buffer_len-into-the-ring-structure.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0027-igb-move-alloc_failed-and-csum_err-stats-into-per-rx.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0028-igb-add-a-flags-value-to-the-ring.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0029-igb-place-a-pointer-to-the-netdev-struct-in-the-ring.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0030-igb-move-the-multiple-receive-queue-configuration-in.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0031-igb-delay-VF-reset-notification-until-after-interrup.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0032-igb-setup-vlan-tag-replication-stripping-in-igb_vmm_.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0033-igb-re-use-ring-configuration-code-in-ethtool-testin.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0034-igb-make-tx-ring-map-and-free-functionality-non-stat.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0035-igb-make-ethtool-use-core-xmit-map-and-free-function.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0036-igb-add-single-vector-msi-x-testing-to-interrupt-tes.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0037-igb-cleanup-todo-code-found-in-igb_ethtool.c.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0038-igb-add-support-for-seperate-tx-usecs-setting-in-eth.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0039-igb-cleanup-some-of-the-code-related-to-hw-timestamp.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0040-igb-misc-cleanups-within-igb_ethtool.c.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0041-igb-use-packet-buffer-sizes-from-RXPBS-register.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0042-igb-replace-the-VF-clear_to_send-with-a-flags-value.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0043-igb-rework-use-of-VMOLR-in-regards-to-PF-and-VFs.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0044-igb-rework-handling-of-the-vfta-and-vlvf-registers-i.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0045-igb-move-vf-init-into-a-seperate-function.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0046-igb-only-process-global-stats-in-igb_update_stats.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0047-igb-move-global_quad_port_a-from-global-into-local-s.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0048-igb-make-tx-hang-check-multiqueue-check-eop-descript.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0049-igb-cleanup-code-related-to-ring-resource-allocation.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0050-igb-change-queue-ordering-for-82576-based-adapters.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0051-igb-cleanup-interrupt-enablement-in-regards-to-msix_.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0052-igb-Remove-invalid-stats-counters.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0053-igb-cleanup-igb.h-header-whitespace-and-some-structu.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0054-igb-cleanup-igb-xmit-frame-path.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0055-igb-cleanup-clean_rx_irq_adv-and-alloc_rx_buffers_ad.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0056-igb-replace-unecessary-adapter-hw-with-just-hw-where.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0057-igb-add-pci_dev-in-few-spots-to-clean-up-use-of-dev_.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0058-igb-limit-minimum-mtu-to-68-to-keep-ip-bound-to-inte.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0059-igb-open-up-SCTP-checksum-offloads-to-all-MACs-82576.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0060-igb-cleanup-whitespace-issues-in-igb_main.c.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0061-igb-Fix-warnings-in-igb_set_ringparam.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0062-igb-change-type-for-ring-sizes-to-u16-in-igb_set_rin.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0063-igb-move-timesync-init-into-a-seperate-function.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0064-igb-when-number-of-CPUs-4-combine-tx-rx-queues-to-al.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0065-igb-Rework-how-netdev-stats-is-handled.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0066-igb-removed-unused-tx-rx-total-bytes-packets-from-ad.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0067-igb-check-for-packets-on-all-tx-rings-when-link-is-d.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0068-igb-only-recycle-page-if-it-is-on-our-numa-node.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0069-drivers-net-request_irq-Remove-unnecessary-leading-f.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0070-igb-add-support-for-the-82580-phy.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0071-igb-add-support-for-82580-MAC.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0072-igb-Add-full-support-for-82580-devices.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0073-igb-remove-use-of-skb_dma_map-from-driver.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0074-igbvf-remove-skb_dma_map-unmap-call-from-drivers.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0075-drivers-net-Move-and-to-end-of-previous-line.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0076-igb-fix-handling-of-mailbox-collisions-between-PF-VF.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0077-igbvf-avoid-reset-storms-due-to-mailbox-issues.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0078-igb-do-not-force-pcs-link-when-in-KX-mode.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0079-igb-do-not-force-retry-count-to-1-on-82580-phy.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0080-igb-correctly-offset-82575-flow-control-watermarks-b.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0081-igb-check-both-function-bits-in-status-register-in-w.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0082-igbvf-Make-igbvf-error-message-more-informative.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0083-drivers-net-igbvf-netdev.c-use-pM-to-shown-MAC-addre.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0084-drivers-net-use-DEFINE_PCI_DEVICE_TABLE.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0085-igb-add-support-for-device-reset-interrupt.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0086-e1000-e1000e-igb-igbvf-ixgb-ixgbe-Fix-tests-of-unsig.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0087-igb-igbvf-cleanup-exception-handling-in-tx_map_adv.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0088-net-Fix-IPv6-GSO-type-checks-in-Intel-ethernet-drive.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0089-igbvf-fix-issue-w-mapped_as_page-being-left-set-afte.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0090-igb-make-certain-to-reassign-legacy-interrupt-vector.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0091-tree-wide-Assorted-spelling-fixes.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0092-net-use-netdev_mc_count-and-netdev_mc_empty-when-app.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0093-igb-remove-unecessary-q_vector-declarations-and-remo.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0094-igb-add-support-for-wake-on-link.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0095-igb-Report-link-status-in-ethtool-when-interface-is-.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0096-igb-ignore-EEPROM-APME-check-when-shutting-down-serd.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0097-igb-Power-down-link-when-interface-is-down.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0098-igb-call-pci_save_state-after-pci_restore_state.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0099-igb-Allocate-rings-seperately-instead-of-as-a-block.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0100-igb-remove-adaptive-IFS-from-driver.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0101-igb-cap-interrupts-at-20K-per-queue-when-in-itr-mode.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0102-igb-only-support-SRRCTL_DROP_EN-when-using-multiple-.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0103-igb-only-read-phy-specific-stats-if-in-internal-phy-.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0104-igb-inline-igb_maybe_stop_tx.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0105-igb-move-gso_segs-into-buffer_info-structure.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0106-igb-minor-type-cleanups.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0107-igb-remove-unused-vmolr-value.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0108-igb-use-igb_free_q_vectors-to-cleanup-failure-in-igb.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0109-igb-change-descriptor-control-thresholds.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0110-igb-update-tx-DMA-mapping-error-handling.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0111-net-convert-multiple-drivers-to-use-netdev_for_each_.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0112-igb-Add-support-for-82576-ET2-Quad-Port-Server-Adapt.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0113-igb-Do-not-overwrite-mdicnfg-register-when-accessing.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0114-igb-cleanup-usage-of-virtualization-registers.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0115-igb-add-support-for-Intel-I350-Gigabit-Network-Conne.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0116-igb-count-Rx-FIFO-errors-correctly.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0117-igb-do-not-modify-tx_queue_len-on-link-speed-change.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0118-igbvf-do-not-modify-tx_queue_len-on-link-speed-chang.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0119-igb-use-correct-bits-to-identify-if-managability-is-.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0120-include-cleanup-Update-gfp.h-and-slab.h-includes-to-.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0121-igb-update-hw_debug-macro-to-make-use-of-netdev_dbg-.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0122-igb-add-per-packet-timestamping.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0123-igb-modify-register-test-for-i350-to-reflect-read-on.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0124-igb-restrict-WoL-for-82576-ET2-Quad-Port-Server-Adap.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0125-igb-double-increment-nr_frags.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0126-igbvf-double-increment-nr_frags.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0127-igb-add-support-for-reporting-5GT-s-during-probe-on-.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0128-igb-convert-igb-from-using-PCI-DMA-functions-to-usin.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0129-igbvf-use-DMA-API-instead-of-PCI-DMA-functions.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0130-igb-add-registers-etc.-printout-code-just-before-res.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0131-igb-Clean-up-left-over-prototype-of-igb_get_hw_dev_n.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0132-igb-reduce-cache-misses-on-tx-cleanup.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0133-drivers-net-Remove-unnecessary-returns-from-void-fun.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0134-igb-fix-PHY-config-access-on-82580.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0135-igb-Use-only-a-single-Tx-queue-in-SR-IOV-mode.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0136-igb-Fix-Tx-hangs-seen-when-loading-igb-with-max_vfs-.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0137-igb-correct-link-test-not-being-run-when-link-is-dow.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0138-igb-Add-comment.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0139-igb-drop-support-for-UDP-hashing-w-RSS.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0140-ixgbe-igb-catch-invalid-VF-settings.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0141-igb-add-support-for-SGMII-based-MDIO-PHYs.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0142-igb-restore-EEPROM-values-of-MDICNFG-on-reset-with-8.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0143-igbvf-ixgbevf-use-dev_hw_addr_random.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0144-igb-Use-irq_synchronize-per-vector-when-using-MSI-X.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0145-igb-Program-MDICNFG-register-prior-to-PHY-init.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0146-e100-e1000-igb-ixgb-Add-missing-read-memory-barrier.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0147-Fix-spelling-fuction-function-in-comments.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0148-drivers-net-Remove-address-use-from-assignments-of-f.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0149-igb-clear-VF_PROMISC-bits-instead-of-setting-all-oth.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0150-igb-Add-support-for-DH89xxCC.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0151-e1000-e1000e-igb-ixgb-ixgbe-set-NETIF_F_HIGHDMA-for-.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0152-drivers-net-return-operator-cleanup.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0153-igb-add-check-for-fiber-serdes-devices-to-igb_set_sp.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0154-igbvf-Remove-unneeded-pm_qos-calls.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0155-igbvf-fix-panic-on-load.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0156-igbvf-Update-version-and-Copyright.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0157-igbvf-Remove-some-dead-code-in-igbvf.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0158-Intel-Wired-LAN-drivers-Use-static-const.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0159-igb-Add-new-function-to-read-part-number-from-EEPROM.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0160-igb-Some-fine-tuning.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0161-igb-Add-Anti-spoofing-feature-support.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0162-igbvf-force-link-checking-when-mailbox-timeout-has-o.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0163-igbvf-add-support-for-i350-VF-device.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0164-igb-fix-sparse-warning.patch
dists/squeeze/linux-2.6/debian/patches/features/all/igb/0165-Revert-r8169-Fix-up-backport-of-r8169-keep-firmware-.patch
dists/squeeze/linux-2.6/debian/patches/features/all/net-Add-netdev_alloc_skb_ip_align-helper.patch
dists/squeeze/linux-2.6/debian/patches/features/all/pm-Define-SET_SYSTEM_SLEEP_PM_OPS.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0001-net-Use-netdev_alloc_skb_ip_align.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0002-r8169-move-PHY-regs-tables-to-.rodata.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0003-drivers-net-Move-and-to-end-of-previous-line.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0004-const-constify-remaining-dev_pm_ops.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0005-drivers-net-r8169.c-use-pM-to-shown-MAC-address.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0006-drivers-net-use-DEFINE_PCI_DEVICE_TABLE.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0007-net-use-netdev_mc_count-and-netdev_mc_empty-when-app.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0008-drivers-net-r8196.c-Use-netif_printk-macros.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0009-net-convert-multiple-drivers-to-use-netdev_for_each_.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0010-r8169-PCI-PM-Add-simplified-runtime-PM-support-rev.-.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0011-r8169-Fix-rtl8169_rx_interrupt.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0012-r8169-failure-to-enable-mwi-should-not-be-fatal.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0013-r8169-remove-unnecessary-cast-of-readl-s-return-valu.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0014-r8169-incorrect-identifier-for-a-8168dp.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0015-r8169-fix-rx-checksum-offload.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0016-r8169-add-gro-support.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0017-r8169-use-device-model-DMA-API.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0018-r8169-use-50-less-ram-for-RX-ring.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0019-r8169-check-dma-mapping-failures.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0020-r8169-init-rx-ring-cleanup.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0021-r8169-replace-PCI_DMA_-TO-FROM-DEVICE-to-DMA_-TO-FRO.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0022-r8169-use-pointer-to-struct-device-as-local-variable.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0023-r8169-do-not-account-fragments-as-packets.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0024-r8169-changing-mtu-clean-up.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0025-r8169-re-init-phy-on-resume.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0026-r8169-print-errors-when-dma-mapping-fail.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0027-r8169-fix-sleeping-while-holding-spinlock.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0028-r8169-fix-checksum-broken.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0029-r8169-Fix-runtime-power-management.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0030-drivers-net-.c-Use-static-const.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0031-r8169-remove-the-firmware-of-RTL8111D.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0032-r8169-identify-different-registers.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0033-r8169-use-device-dependent-methods-to-access-the-MII.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0034-r8169-8168DP-specific-MII-registers-access-methods.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0035-r8169-phy-power-ops.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0036-r8169-magic.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0037-r8169-rtl_csi_access_enable-rename.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0038-r8169-more-8168dp-support.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0039-r8169-delay-phy-init-until-device-opens.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0040-net-r8169-Update-the-function-of-parsing-firmware.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0041-r8169-keep-firmware-in-memory.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0042-r8169-RxFIFO-overflow-oddities-with-8168-chipsets.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0043-r8169-prevent-RxFIFO-induced-loops-in-the-irq-handle.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0044-drivers-net-Call-netif_carrier_off-at-the-end-of-the.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0045-r8169-fix-incorrect-args-to-oob-notify.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0046-r8169-correct-settings-of-rtl8102e.patch
dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0047-r8169-fix-RTL8168DP-power-off-issue.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0001-Revert-tg3-Fix-5906-transmit-hangs.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0002-tg3-Assign-flags-to-fixes-in-start_xmit_dma_bug.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0003-tg3-Fix-5906-transmit-hangs.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0004-tg3-Fix-disappearing-57780-devices.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0005-tg3-Convert-PHY_ADDR-TG3_PHY_MII_ADDR.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0006-tg3-Prevent-a-PCIe-tx-glitch.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0007-tg3-Add-more-PCI-DMA-map-error-checking.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0008-tg3-Improve-5785-PCIe-performance.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0009-tg3-Add-AC131-power-down-support.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0010-tg3-5785-Set-port-mode-to-MII-when-link-down.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0011-tg3-Extend-loopback-test-timeout.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0012-broadcom-Isolate-phy-dsp-accesses.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0013-broadcom-Fix-slow-link-problem.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0014-tg3-Add-50610M-phy-ID-for-5785.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0015-broadcom-Consolidate-dev_flags-definitions.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0016-tg3-broadcom-Add-PHY_BRCM_CLEAR_RGMII_MODE-flag.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0017-tg3-broadcom-Refine-AC131-APD-support.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0018-tg3-broadcom-Add-code-to-disable-rxc-refclk.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0019-tg3-broadcom-Add-APD-support-for-GPHYs.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0020-tg3-broadcom-Optionally-disable-TXC-if-no-link.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0021-tg3-Update-version-to-3.103.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0022-tg3-Add-5717-phy-ID.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0023-tg3-Don-t-touch-RCB-nic-addresses.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0024-tg3-Napify-tg3_start_xmit_dma_bug.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0025-tg3-Move-TG3_FLG2_PROTECTED_NVRAM-to-tg3_flags3.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0026-tg3-Refine-TSO-and-MSI-discovery.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0027-tg3-Add-new-HW_TSO_3-flag-for-5717.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0028-tg3-Use-tg3_start_xmit_dma_bug-for-5717-A0.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0029-tg3-Allow-DMAs-to-cross-cacheline-boundaries.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0030-tg3-Create-tg3_poll_msix-for-non-zero-MSIX-vecs.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0031-tg3-Move-napi_add-calls-below-tg3_get_invariants.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0032-tg3-Make-tg3_alloc_rx_skb-a-dst-only-operation.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0033-tg3-Add-prodring-parameter-to-tg3_alloc_rx_skb.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0034-tg3-tg3_alloc_rx_skb-tnapi-tp.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0035-tg3-rename-rx_-std-jmb-_ptr.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0036-tg3-Consider-rx_std_prod_idx-a-hw-mailbox.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0037-tg3-Lay-proucer-ring-handling-groundwork.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0038-tg3-Create-aliases-for-rx-producer-mailbox-regs.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0039-tg3-Add-rx-prod-ring-consolidation.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0040-tg3-Fix-DIDs-Enable-5717-support.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0041-tg3-Update-version-to-3.104.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0042-tg3-remove-use-of-skb_dma_map-unmap.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0043-drivers-net-Move-and-to-end-of-previous-line.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0044-tg3-Make-TSS-enable-independent-of-MSI-X-enable.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0045-tg3-Add-57765-asic-rev.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0046-tg3-Add-some-VPD-preprocessor-constants.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0047-tg3-Use-pci_read_vpd-instead-of-private-method.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0048-tg3-Clean-tg3_init_one.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0049-tg3-Update-version-to-3.105.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0050-broadcom-bcm54xx_shadow_read-errors-ignored-in-bcm54.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0051-broadcom-Fix-confusion-in-bcm54xx_adjust_rxrefclk.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0052-drivers-net-use-DEFINE_PCI_DEVICE_TABLE.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0053-tg3-Fix-std-prod-ring-nicaddr-for-5787-and-57765.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0054-tg3-Fix-std-rx-prod-ring-handling.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0055-tg3-Add-reliable-serdes-detection-for-5717-A0.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0056-tg3-Disable-5717-serdes-and-B0-support.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0057-tg3-Update-copyright-and-driver-version.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0058-tg3-Enable-PLL-PD-when-CLKREQ-disabled-for-5717A0.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0059-tg3-Improve-internal-resource-allocations.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0060-tg3-Add-5717-serdes-phy-ID.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0061-tg3-Abort-phy-init-for-5717-serdes-devices.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0062-tg3-Fix-5717-and-57765-memory-selftests.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0063-tg3-Supply-a-nicaddr-for-57765-jumbo-RCB.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0064-tg3-Fix-tx-mailbox-initialization.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0065-tg3-Turn-off-the-debug-UART-for-57765.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0066-tg3-Bypass-power-source-switching-for-57765.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0067-tg3-Add-57765-phy-ID-and-enable-devices.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0068-net-use-netdev_mc_count-and-netdev_mc_empty-when-app.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0069-tg3-Give-MSI-X-vec-1-rx-backlog-space.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0070-tg3-Prevent-rx-producer-ring-overruns.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0071-tg3-Unwedge-stuck-MSI-X-vectors.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0072-tg3-Fix-57765-A0-bootcode-race-condition.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0073-tg3-Turn-off-multiple-DMA-reads-for-5717.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0074-tg3-Reset-phy-during-bringup-when-using-phylib.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0075-tg3-Fix-napi-assignments-in-loopback-test.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0076-tg3-Fix-AC131-loopback-test-errors-for-5785.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0077-tg3-Update-driver-version-to-3.107.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0078-tg3-Enforce-DMA-mapping-skb-assignment-ordering.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0079-tg3-Make-57791-and-57795-10-100-only.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0080-tg3-Add-support-for-2-new-selfboot-formats.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0081-tg3-Allow-phylib-flowctrl-changes-anytime.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0082-tg3-Add-more-partno-entries-for-fallback-path.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0083-tg3-Rename-TG3_FLG3_RGMII_STD_IBND_DISABLE.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0084-tg3-Reduce-indent-level-of-tg3_rx_prodring_alloc.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0085-tg3-Discover-phy-address-once.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0086-tg3-Reformat-SSID-to-phy-ID-table.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0087-tg3-Rename-tg3-phy-ID-preprocessor-definitions.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0088-tg3-Push-phylib-definitions-to-phylib.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0089-tg3-Update-version-to-3.108.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0090-drivers-net-tg3.c-Use-pr-netdev-_-level-macro-helper.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0091-net-convert-multiple-drivers-to-use-netdev_for_each_.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0092-pci-Add-PCI-LRDT-tag-size-and-section-size.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0093-pci-Add-large-and-small-resource-data-type-code.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0094-pci-Add-helper-to-find-a-VPD-resource-data-type.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0095-pci-Add-VPD-information-field-helper-functions.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0096-pci-Add-helper-to-search-for-VPD-keywords.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0097-tg3-Remove-now-useless-VPD-code.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0098-drivers-net-tg3.c-change-the-field-used-with-the-TG3.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0099-tg3-Fix-MII_TG3_DSP_EXP8-offset.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0100-tg3-Restore-likely-check-in-tg3_poll_msix.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0101-tg3-Replace-pr_err-with-sensible-alternatives.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0102-tg3-netdev_err-dev_err.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0103-tg3-Fix-message-80-char-violations.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0104-tg3-Prepare-FW-version-code-for-VPD-versioning.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0105-tg3-Use-VPD-fw-version-when-present.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0106-tg3-Whitespace-constant-and-comment-updates.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0107-tg3-The-case-of-switches.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0108-tg3-Cleanup-if-codestyle.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0109-tg3-Remove-tg3_dump_state.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0110-tg3-Update-version-to-3.109.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0111-tg3-Disable-CLKREQ-in-L2.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0112-tg3-Set-card-57765-card-reader-MRRS-to-1024B.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0113-tg3-Reduce-57765-core-clock-when-link-at-10Mbps.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0114-tg3-Optimize-rx-double-copy-test.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0115-tg3-Re-inline-VLAN-tags-when-appropriate.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0116-tg3-Unify-max-pkt-size-preprocessor-constants.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0117-tg3-Remove-function-errors-flagged-by-checkpatch.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0118-tg3-Update-version-to-3.110.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0119-tg3-use-the-DMA-state-API-instead-of-the-pci-equival.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0120-tg3-Enable-GRO-by-default.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0121-tg3-Relocate-APE-mutex-regs-for-5717.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0122-tg3-Avoid-tx-lockups-on-5755-devices.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0123-tg3-Fix-a-memory-leak-on-5717-devices.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0124-tg3-Allow-single-MSI-X-vector-allocations.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0125-tg3-5717-Allow-serdes-link-via-parallel-detect.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0126-tg3-Use-devfn-to-determine-function-number.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0127-tg3-Add-5719-ASIC-rev.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0128-tg3-Add-5719-PCI-device-and-phy-IDs.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0129-tg3-Update-version-to-3.111.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0130-broadcom-move-all-PHY_ID-s-to-header.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0131-broadcom-Add-5241-support.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0132-tg3-allow-TSO-on-vlan-devices.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0133-tg3-Fix-single-MSI-X-vector-coalescing.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0134-tg3-Fix-IPv6-TSO-code-in-tg3_start_xmit_dma_bug.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0135-tg3-Relax-5717-serdes-restriction.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0136-tg3-Report-driver-version-to-firmware.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0137-tg3-Revert-PCIe-tx-glitch-fix.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0138-tg3-Fix-some-checkpatch-errors.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0139-tg3-Update-version-to-3.112.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0140-tg3-Add-5784-ASIC-rev-to-earlier-PCIe-MPS-fix.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0141-tg3-Disable-TSS-also-during-tg3_close.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0142-tg3-Create-TG3_FLG3_5717_PLUS-flag.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0143-tg3-Don-t-access-phy-test-ctrl-reg-for-5717.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0144-tg3-Manage-gphy-power-for-CPMU-less-devs-only.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0145-tg3-Restrict-ASPM-workaround-devlist.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0146-tg3-Detect-APE-firmware-types.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0147-tg3-Remove-5720-5750-and-5750M.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0148-tg3-Improve-small-packet-performance.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0149-tg3-Add-error-reporting-to-tg3_phydsp_write.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0150-tg3-Add-phy-related-preprocessor-constants.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0151-tg3-Create-phy_flags-and-migrate-phy_is_low_power.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0152-tg3-Migrate-tg3_flags-to-phy_flags.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0153-tg3-Update-version-to-3.113.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0154-tg3-Fix-read-DMA-FIFO-overruns-on-recent-devices.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0155-tg3-Disable-TSS.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0156-tg3-Don-t-send-APE-events-for-NCSI-firmware.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0157-tg3-Unlock-5717-B0-support.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0158-tg3-Clarify-semantics-of-TG3_IRQ_MAX_VECS.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0159-tg3-Move-producer-ring-struct-to-tg3_napi.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0160-tg3-Use-skb_is_gso_v6.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0161-tg3-Dynamically-allocate-VPD-data-memory.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0162-tg3-phy-tmp-variable-roundup.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0163-drivers-net-return-operator-cleanup.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0164-tg3-Fix-potential-netpoll-crash.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0165-tg3-5719-Prevent-tx-data-corruption.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0166-tg3-Remove-5724-device-ID.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0167-tg3-Cleanup-missing-VPD-partno-section.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0168-tg3-Futureproof-the-loopback-test.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0169-tg3-Prepare-for-larger-rx-ring-sizes.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0170-tg3-Add-extend-rx-ring-sizes-for-5717-and-5719.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0171-tg3-Update-version-to-3.114.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0172-net-tg3-simplify-conditional.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0173-tg3-Add-support-for-selfboot-format-1-v6.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0174-tg3-Disable-unused-transmit-rings.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0175-tg3-Add-clause-45-register-accessor-methods.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0176-tg3-Add-EEE-support.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0177-tg3-Cleanup-tg3_alloc_rx_skb.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0178-tg3-Don-t-allocate-jumbo-ring-for-5780-class-devs.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0179-tg3-Report-invalid-link-from-tg3_get_settings.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0180-tg3-Update-version-to-3.115.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0181-tg3-Do-not-call-device_set_wakeup_enable-under-spin_.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0182-tg3-Apply-10Mbps-fix-to-all-57765-revisions.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0183-tg3-Assign-correct-tx-margin-for-5719.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0184-tg3-Always-turn-on-APE-features-in-mac_mode-reg.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0185-tg3-Fix-5719-internal-FIFO-overflow-problem.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0186-tg3-Reorg-tg3_napi-members.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0187-tg3-Enable-mult-rd-DMA-engine-on-5719.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0188-tg3-Reenable-TSS-for-5719.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0189-tg3-use-dma_alloc_coherent-instead-of-pci_alloc_cons.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0190-tg3-Enable-phy-APD-for-5717-and-later-asic-revs.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0191-tg3-Remove-tg3_config_info-definition.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0192-tg3-Raise-the-jumbo-frame-BD-flag-threshold.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0193-tg3-Move-EEE-definitions-into-mdio.h.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0194-tg3-Fix-57765-EEE-support.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0195-tg3-Minor-EEE-code-tweaks.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0196-tg3-Relax-EEE-thresholds.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0197-tg3-Update-version-to-3.116.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0198-tg3-Use-DEFINE_PCI_DEVICE_TABLE.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0199-tg3-Do-not-use-legacy-PCI-power-management.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0200-tg3-fix-return-value-check-in-tg3_read_vpd.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0201-tg3-fix-warnings.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0202-tg3-Restrict-phy-ioctl-access.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0203-tg3-Fix-loopback-tests.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0204-tg3-Disable-MAC-loopback-test-for-CPMU-devices.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0205-tg3-Fix-NVRAM-selftest.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0206-tg3-Only-allow-phy-ioctls-while-netif_running.patch
dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0207-tg3-Set-tx-bug-flags-for-more-devices.patch
Modified:
dists/squeeze/linux-2.6/debian/changelog
dists/squeeze/linux-2.6/debian/config/defines
dists/squeeze/linux-2.6/debian/patches/series/36
Modified: dists/squeeze/linux-2.6/debian/changelog
==============================================================================
--- dists/squeeze/linux-2.6/debian/changelog Sun Aug 14 20:10:24 2011 (r17921)
+++ dists/squeeze/linux-2.6/debian/changelog Sun Aug 14 22:55:28 2011 (r17922)
@@ -37,6 +37,17 @@
and the bug report which this closes: #631465.
* [vserver] Update patch to 2.6.32.41-vs2.3.0.36.29.7
- Apply sched changes deferred from 2.6.32.29
+ * e1000e: Backport changes up to Linux 2.6.38 (Closes: #627700)
+ - Add support for i82567V-4 and i82579
+ - Fix support for i82577, i82578 and i82583
+ * igb,igbvf: Backport changes up to Linux 2.6.38 (Closes: #627702)
+ - Add support for i82576-ET2, i82580, DH89xxCC and i350
+ * r8169: Backport changes up to Linux 2.6.38 (Closes: #627704)
+ - Fix support for RTL8102E and RTL8168DP
+ * tg3,broadcom: Backport changes up to Linux 2.6.38 (Closes: #627705)
+ - Add support for BCM5717, BCM5719, BCM57765
+ - Add support for BCM50610M and BCM5241 PHYs
+ - Fix support for BCM5755
[ Moritz Muehlenhoff ]
* ksm: fix NULL pointer dereference in scan_get_next_rmap_item() (CVE-2011-2183)
Modified: dists/squeeze/linux-2.6/debian/config/defines
==============================================================================
--- dists/squeeze/linux-2.6/debian/config/defines Sun Aug 14 20:10:24 2011 (r17921)
+++ dists/squeeze/linux-2.6/debian/config/defines Sun Aug 14 22:55:28 2011 (r17922)
@@ -73,9 +73,14 @@
drivers/scsi/3w-sas.h: 2.6.33
drivers/staging/ramzswap/: 2.6.33
drivers/media/dvb/mantis/: 2.6.34
+drivers/net/e1000e/: 2.6.38
+drivers/net/igb/: 2.6.38
drivers/net/macvtap.c: 2.6.34
+drivers/net/r8169.c: 2.6.38
drivers/net/sky2.c: 2.6.35
drivers/net/sky2.h: 2.6.35
+drivers/net/tg3.c: 2.6.38
+drivers/net/tg3.h: 2.6.38
drivers/net/usb/ipheth.c: 2.6.34
drivers/staging/brcm80211/: 2.6.37
drivers/staging/rt2860/: 2.6.34
Added: dists/squeeze/linux-2.6/debian/patches/features/all/PCI-Add-dummy-implementation-of-pci_dev_run_wake.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/PCI-Add-dummy-implementation-of-pci_dev_run_wake.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,24 @@
+From: Ben Hutchings <ben at decadent.org.uk>
+Date: Thu, 19 May 2011 04:29:25 +0100
+Subject: [PATCH 2/6] PCI: Add dummy implementation of pci_dev_run_wake()
+
+---
+ include/linux/pci.h | 2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/include/linux/pci.h b/include/linux/pci.h
+index e07d194..d67702a 100644
+--- a/include/linux/pci.h
++++ b/include/linux/pci.h
+@@ -745,6 +745,8 @@ int pci_wake_from_d3(struct pci_dev *dev, bool enable);
+ pci_power_t pci_target_state(struct pci_dev *dev);
+ int pci_prepare_to_sleep(struct pci_dev *dev);
+ int pci_back_from_sleep(struct pci_dev *dev);
++/* Dummy for 2.6.32 */
++static inline bool pci_dev_run_wake(struct pci_dev *dev) { return false; }
+
+ /* Functions for PCI Hotplug drivers to use */
+ int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/dma-mapping-dma-mapping.h-add-dma_set_coherent_mask.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/dma-mapping-dma-mapping.h-add-dma_set_coherent_mask.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,90 @@
+From: FUJITA Tomonori <fujita.tomonori at lab.ntt.co.jp>
+Date: Wed, 10 Mar 2010 15:23:39 -0800
+Subject: [PATCH 4/6] dma-mapping: dma-mapping.h: add dma_set_coherent_mask
+
+dma_set_coherent_mask corresponds to pci_set_consistent_dma_mask. This is
+necessary to move to the generic device model DMA API from the PCI bus
+specific API in the long term.
+
+dma_set_coherent_mask works in the exact same way that
+pci_set_consistent_dma_mask does. So this patch also changes
+pci_set_consistent_dma_mask to call dma_set_coherent_mask.
+
+Signed-off-by: FUJITA Tomonori <fujita.tomonori at lab.ntt.co.jp>
+Cc: James Bottomley <James.Bottomley at suse.de>
+Cc: David S. Miller <davem at davemloft.net>
+Cc: Jesse Barnes <jbarnes at virtuousgeek.org>
+Cc: Benjamin Herrenschmidt <benh at kernel.crashing.org>
+Cc: Russell King <linux at arm.linux.org.uk>
+Cc: Greg KH <greg at kroah.com>
+Cc: Kay Sievers <kay.sievers at vrfy.org>
+Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
+[bwh: Adjust context for 2.6.32]
+---
+ Documentation/DMA-API.txt | 10 ++++++++++
+ drivers/pci/pci.c | 7 +++----
+ include/linux/dma-mapping.h | 8 ++++++++
+ 3 files changed, 21 insertions(+), 4 deletions(-)
+
+diff --git a/Documentation/DMA-API.txt b/Documentation/DMA-API.txt
+index 5aceb88..d8b693a 100644
+--- a/Documentation/DMA-API.txt
++++ b/Documentation/DMA-API.txt
+@@ -167,6 +167,16 @@ parameters if it is.
+
+ Returns: 0 if successful and a negative error if not.
+
++int
++dma_set_coherent_mask(struct device *dev, u64 mask)
++int
++pci_set_consistent_dma_mask(struct pci_device *dev, u64 mask)
++
++Checks to see if the mask is possible and updates the device
++parameters if it is.
++
++Returns: 0 if successful and a negative error if not.
++
+ u64
+ dma_get_required_mask(struct device *dev)
+
+diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
+index 812d4ac..a42bc35 100644
+--- a/drivers/pci/pci.c
++++ b/drivers/pci/pci.c
+@@ -2066,10 +2066,9 @@ pci_set_dma_mask(struct pci_dev *dev, u64 mask)
+ int
+ pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask)
+ {
+- if (!pci_dma_supported(dev, mask))
+- return -EIO;
+-
+- dev->dev.coherent_dma_mask = mask;
++ int ret = dma_set_coherent_mask(&dev->dev, mask);
++ if (ret)
++ return ret;
+
+ return 0;
+ }
+diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
+index 91b7618..8357721 100644
+--- a/include/linux/dma-mapping.h
++++ b/include/linux/dma-mapping.h
+@@ -127,6 +127,14 @@ static inline u64 dma_get_mask(struct device *dev)
+ return DMA_BIT_MASK(32);
+ }
+
++static inline int dma_set_coherent_mask(struct device *dev, u64 mask)
++{
++ if (!dma_supported(dev, mask))
++ return -EIO;
++ dev->coherent_dma_mask = mask;
++ return 0;
++}
++
+ extern u64 dma_get_required_mask(struct device *dev);
+
+ static inline unsigned int dma_get_max_seg_size(struct device *dev)
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/dma-mapping.h-add-the-dma_unmap-state-API.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/dma-mapping.h-add-the-dma_unmap-state-API.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,29 @@
+From: Ben Hutchings <ben at decadent.org.uk>
+Date: Sat, 21 May 2011 18:12:37 +0100
+Subject: [PATCH 5/6] dma-mapping.h: add the dma_unmap state API
+
+For 2.6.32, define the generic API using the PCI API instead of the
+other way around as in 0acedc124aca35f5cce9d4ee288dc372bf517e09.
+---
+ include/linux/dma-mapping.h | 7 +++++++
+ 1 files changed, 7 insertions(+), 0 deletions(-)
+
+diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
+index 8357721..78211a0 100644
+--- a/include/linux/dma-mapping.h
++++ b/include/linux/dma-mapping.h
+@@ -240,4 +240,11 @@ struct dma_attrs;
+
+ #endif /* CONFIG_HAVE_DMA_ATTRS */
+
++#define DEFINE_DMA_UNMAP_ADDR(ADDR_NAME) DECLARE_PCI_UNMAP_ADDR(ADDR_NAME);
++#define DEFINE_DMA_UNMAP_LEN(LEN_NAME) DECLARE_PCI_UNMAP_LEN(LEN_NAME);
++#define dma_unmap_addr pci_unmap_addr
++#define dma_unmap_addr_set pci_unmap_addr_set
++#define dma_unmap_len pci_unmap_len
++#define dma_unmap_len_set pci_unmap_len_set
++
+ #endif
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0001-e1000e-Use-the-instance-of-net_device_stats-from-net.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0001-e1000e-Use-the-instance-of-net_device_stats-from-net.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,187 @@
+From: Ajit Khaparde <ajitkhaparde at gmail.com>
+Date: Wed, 7 Oct 2009 02:44:26 +0000
+Subject: [PATCH 001/166] e1000e: Use the instance of net_device_stats from
+ net_device.
+
+commit 7274c20f7b6a7bd6e3e8441e1727bf9cfd8235bb upstream.
+
+Since net_device has an instance of net_device_stats,
+we can remove the instance of this from the private adapter structure.
+
+Signed-off-by: Ajit Khaparde <ajitk at serverengines.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/e1000.h | 1 -
+ drivers/net/e1000e/ethtool.c | 18 +++++++++-------
+ drivers/net/e1000e/netdev.c | 43 ++++++++++++++++++++---------------------
+ 3 files changed, 31 insertions(+), 31 deletions(-)
+
+diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
+index 47db9bd..88bc455 100644
+--- a/drivers/net/e1000e/e1000.h
++++ b/drivers/net/e1000e/e1000.h
+@@ -331,7 +331,6 @@ struct e1000_adapter {
+ /* OS defined structs */
+ struct net_device *netdev;
+ struct pci_dev *pdev;
+- struct net_device_stats net_stats;
+
+ /* structs defined in e1000_hw.h */
+ struct e1000_hw hw;
+diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
+index e82638e..e9c3181 100644
+--- a/drivers/net/e1000e/ethtool.c
++++ b/drivers/net/e1000e/ethtool.c
+@@ -43,6 +43,8 @@ struct e1000_stats {
+
+ #define E1000_STAT(m) sizeof(((struct e1000_adapter *)0)->m), \
+ offsetof(struct e1000_adapter, m)
++#define E1000_NETDEV_STAT(m) sizeof(((struct net_device *)0)->m), \
++ offsetof(struct net_device, m)
+ static const struct e1000_stats e1000_gstrings_stats[] = {
+ { "rx_packets", E1000_STAT(stats.gprc) },
+ { "tx_packets", E1000_STAT(stats.gptc) },
+@@ -52,21 +54,21 @@ static const struct e1000_stats e1000_gstrings_stats[] = {
+ { "tx_broadcast", E1000_STAT(stats.bptc) },
+ { "rx_multicast", E1000_STAT(stats.mprc) },
+ { "tx_multicast", E1000_STAT(stats.mptc) },
+- { "rx_errors", E1000_STAT(net_stats.rx_errors) },
+- { "tx_errors", E1000_STAT(net_stats.tx_errors) },
+- { "tx_dropped", E1000_STAT(net_stats.tx_dropped) },
++ { "rx_errors", E1000_NETDEV_STAT(stats.rx_errors) },
++ { "tx_errors", E1000_NETDEV_STAT(stats.tx_errors) },
++ { "tx_dropped", E1000_NETDEV_STAT(stats.tx_dropped) },
+ { "multicast", E1000_STAT(stats.mprc) },
+ { "collisions", E1000_STAT(stats.colc) },
+- { "rx_length_errors", E1000_STAT(net_stats.rx_length_errors) },
+- { "rx_over_errors", E1000_STAT(net_stats.rx_over_errors) },
++ { "rx_length_errors", E1000_NETDEV_STAT(stats.rx_length_errors) },
++ { "rx_over_errors", E1000_NETDEV_STAT(stats.rx_over_errors) },
+ { "rx_crc_errors", E1000_STAT(stats.crcerrs) },
+- { "rx_frame_errors", E1000_STAT(net_stats.rx_frame_errors) },
++ { "rx_frame_errors", E1000_NETDEV_STAT(stats.rx_frame_errors) },
+ { "rx_no_buffer_count", E1000_STAT(stats.rnbc) },
+ { "rx_missed_errors", E1000_STAT(stats.mpc) },
+ { "tx_aborted_errors", E1000_STAT(stats.ecol) },
+ { "tx_carrier_errors", E1000_STAT(stats.tncrs) },
+- { "tx_fifo_errors", E1000_STAT(net_stats.tx_fifo_errors) },
+- { "tx_heartbeat_errors", E1000_STAT(net_stats.tx_heartbeat_errors) },
++ { "tx_fifo_errors", E1000_NETDEV_STAT(stats.tx_fifo_errors) },
++ { "tx_heartbeat_errors", E1000_NETDEV_STAT(stats.tx_heartbeat_errors) },
+ { "tx_window_errors", E1000_STAT(stats.latecol) },
+ { "tx_abort_late_coll", E1000_STAT(stats.latecol) },
+ { "tx_deferred_ok", E1000_STAT(stats.dc) },
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 4920a4e..40c9702 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -570,8 +570,8 @@ next_desc:
+
+ adapter->total_rx_bytes += total_rx_bytes;
+ adapter->total_rx_packets += total_rx_packets;
+- adapter->net_stats.rx_bytes += total_rx_bytes;
+- adapter->net_stats.rx_packets += total_rx_packets;
++ netdev->stats.rx_bytes += total_rx_bytes;
++ netdev->stats.rx_packets += total_rx_packets;
+ return cleaned;
+ }
+
+@@ -702,8 +702,8 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter)
+ }
+ adapter->total_tx_bytes += total_tx_bytes;
+ adapter->total_tx_packets += total_tx_packets;
+- adapter->net_stats.tx_bytes += total_tx_bytes;
+- adapter->net_stats.tx_packets += total_tx_packets;
++ netdev->stats.tx_bytes += total_tx_bytes;
++ netdev->stats.tx_packets += total_tx_packets;
+ return (count < tx_ring->count);
+ }
+
+@@ -889,8 +889,8 @@ next_desc:
+
+ adapter->total_rx_bytes += total_rx_bytes;
+ adapter->total_rx_packets += total_rx_packets;
+- adapter->net_stats.rx_bytes += total_rx_bytes;
+- adapter->net_stats.rx_packets += total_rx_packets;
++ netdev->stats.rx_bytes += total_rx_bytes;
++ netdev->stats.rx_packets += total_rx_packets;
+ return cleaned;
+ }
+
+@@ -1069,8 +1069,8 @@ next_desc:
+
+ adapter->total_rx_bytes += total_rx_bytes;
+ adapter->total_rx_packets += total_rx_packets;
+- adapter->net_stats.rx_bytes += total_rx_bytes;
+- adapter->net_stats.rx_packets += total_rx_packets;
++ netdev->stats.rx_bytes += total_rx_bytes;
++ netdev->stats.rx_packets += total_rx_packets;
+ return cleaned;
+ }
+
+@@ -3316,6 +3316,7 @@ static void e1000_update_phy_info(unsigned long data)
+ **/
+ void e1000e_update_stats(struct e1000_adapter *adapter)
+ {
++ struct net_device *netdev = adapter->netdev;
+ struct e1000_hw *hw = &adapter->hw;
+ struct pci_dev *pdev = adapter->pdev;
+ u16 phy_data;
+@@ -3410,8 +3411,8 @@ void e1000e_update_stats(struct e1000_adapter *adapter)
+ adapter->stats.tsctfc += er32(TSCTFC);
+
+ /* Fill out the OS statistics structure */
+- adapter->net_stats.multicast = adapter->stats.mprc;
+- adapter->net_stats.collisions = adapter->stats.colc;
++ netdev->stats.multicast = adapter->stats.mprc;
++ netdev->stats.collisions = adapter->stats.colc;
+
+ /* Rx Errors */
+
+@@ -3419,22 +3420,22 @@ void e1000e_update_stats(struct e1000_adapter *adapter)
+ * RLEC on some newer hardware can be incorrect so build
+ * our own version based on RUC and ROC
+ */
+- adapter->net_stats.rx_errors = adapter->stats.rxerrc +
++ netdev->stats.rx_errors = adapter->stats.rxerrc +
+ adapter->stats.crcerrs + adapter->stats.algnerrc +
+ adapter->stats.ruc + adapter->stats.roc +
+ adapter->stats.cexterr;
+- adapter->net_stats.rx_length_errors = adapter->stats.ruc +
++ netdev->stats.rx_length_errors = adapter->stats.ruc +
+ adapter->stats.roc;
+- adapter->net_stats.rx_crc_errors = adapter->stats.crcerrs;
+- adapter->net_stats.rx_frame_errors = adapter->stats.algnerrc;
+- adapter->net_stats.rx_missed_errors = adapter->stats.mpc;
++ netdev->stats.rx_crc_errors = adapter->stats.crcerrs;
++ netdev->stats.rx_frame_errors = adapter->stats.algnerrc;
++ netdev->stats.rx_missed_errors = adapter->stats.mpc;
+
+ /* Tx Errors */
+- adapter->net_stats.tx_errors = adapter->stats.ecol +
++ netdev->stats.tx_errors = adapter->stats.ecol +
+ adapter->stats.latecol;
+- adapter->net_stats.tx_aborted_errors = adapter->stats.ecol;
+- adapter->net_stats.tx_window_errors = adapter->stats.latecol;
+- adapter->net_stats.tx_carrier_errors = adapter->stats.tncrs;
++ netdev->stats.tx_aborted_errors = adapter->stats.ecol;
++ netdev->stats.tx_window_errors = adapter->stats.latecol;
++ netdev->stats.tx_carrier_errors = adapter->stats.tncrs;
+
+ /* Tx Dropped needs to be maintained elsewhere */
+
+@@ -4283,10 +4284,8 @@ static void e1000_reset_task(struct work_struct *work)
+ **/
+ static struct net_device_stats *e1000_get_stats(struct net_device *netdev)
+ {
+- struct e1000_adapter *adapter = netdev_priv(netdev);
+-
+ /* only return the current stats */
+- return &adapter->net_stats;
++ return &netdev->stats;
+ }
+
+ /**
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0002-net-Use-netdev_alloc_skb_ip_align.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0002-net-Use-netdev_alloc_skb_ip_align.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,118 @@
+From: Eric Dumazet <eric.dumazet at gmail.com>
+Date: Tue, 13 Oct 2009 05:34:20 +0000
+Subject: [PATCH 002/166] net: Use netdev_alloc_skb_ip_align()
+
+commit 89d71a66c40d629e3b1285def543ab1425558cd5 upstream.
+
+Signed-off-by: Eric Dumazet <eric.dumazet at gmail.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Restricted to drivers/net/e1000e]
+---
+ drivers/net/e1000e/netdev.c | 37 +++++++------------------------------
+ 1 files changed, 7 insertions(+), 30 deletions(-)
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 40c9702..7aecc68 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -167,7 +167,7 @@ static void e1000_alloc_rx_buffers(struct e1000_adapter *adapter,
+ struct e1000_buffer *buffer_info;
+ struct sk_buff *skb;
+ unsigned int i;
+- unsigned int bufsz = adapter->rx_buffer_len + NET_IP_ALIGN;
++ unsigned int bufsz = adapter->rx_buffer_len;
+
+ i = rx_ring->next_to_use;
+ buffer_info = &rx_ring->buffer_info[i];
+@@ -179,20 +179,13 @@ static void e1000_alloc_rx_buffers(struct e1000_adapter *adapter,
+ goto map_skb;
+ }
+
+- skb = netdev_alloc_skb(netdev, bufsz);
++ skb = netdev_alloc_skb_ip_align(netdev, bufsz);
+ if (!skb) {
+ /* Better luck next round */
+ adapter->alloc_rx_buff_failed++;
+ break;
+ }
+
+- /*
+- * Make buffer alignment 2 beyond a 16 byte boundary
+- * this will result in a 16 byte aligned IP header after
+- * the 14 byte MAC header is removed
+- */
+- skb_reserve(skb, NET_IP_ALIGN);
+-
+ buffer_info->skb = skb;
+ map_skb:
+ buffer_info->dma = pci_map_single(pdev, skb->data,
+@@ -284,21 +277,14 @@ static void e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter,
+ cpu_to_le64(ps_page->dma);
+ }
+
+- skb = netdev_alloc_skb(netdev,
+- adapter->rx_ps_bsize0 + NET_IP_ALIGN);
++ skb = netdev_alloc_skb_ip_align(netdev,
++ adapter->rx_ps_bsize0);
+
+ if (!skb) {
+ adapter->alloc_rx_buff_failed++;
+ break;
+ }
+
+- /*
+- * Make buffer alignment 2 beyond a 16 byte boundary
+- * this will result in a 16 byte aligned IP header after
+- * the 14 byte MAC header is removed
+- */
+- skb_reserve(skb, NET_IP_ALIGN);
+-
+ buffer_info->skb = skb;
+ buffer_info->dma = pci_map_single(pdev, skb->data,
+ adapter->rx_ps_bsize0,
+@@ -359,9 +345,7 @@ static void e1000_alloc_jumbo_rx_buffers(struct e1000_adapter *adapter,
+ struct e1000_buffer *buffer_info;
+ struct sk_buff *skb;
+ unsigned int i;
+- unsigned int bufsz = 256 -
+- 16 /* for skb_reserve */ -
+- NET_IP_ALIGN;
++ unsigned int bufsz = 256 - 16 /* for skb_reserve */;
+
+ i = rx_ring->next_to_use;
+ buffer_info = &rx_ring->buffer_info[i];
+@@ -373,19 +357,13 @@ static void e1000_alloc_jumbo_rx_buffers(struct e1000_adapter *adapter,
+ goto check_page;
+ }
+
+- skb = netdev_alloc_skb(netdev, bufsz);
++ skb = netdev_alloc_skb_ip_align(netdev, bufsz);
+ if (unlikely(!skb)) {
+ /* Better luck next round */
+ adapter->alloc_rx_buff_failed++;
+ break;
+ }
+
+- /* Make buffer alignment 2 beyond a 16 byte boundary
+- * this will result in a 16 byte aligned IP header after
+- * the 14 byte MAC header is removed
+- */
+- skb_reserve(skb, NET_IP_ALIGN);
+-
+ buffer_info->skb = skb;
+ check_page:
+ /* allocate a new page if necessary */
+@@ -523,9 +501,8 @@ static bool e1000_clean_rx_irq(struct e1000_adapter *adapter,
+ */
+ if (length < copybreak) {
+ struct sk_buff *new_skb =
+- netdev_alloc_skb(netdev, length + NET_IP_ALIGN);
++ netdev_alloc_skb_ip_align(netdev, length);
+ if (new_skb) {
+- skb_reserve(new_skb, NET_IP_ALIGN);
+ skb_copy_to_linear_data_offset(new_skb,
+ -NET_IP_ALIGN,
+ (skb->data -
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0003-e1000e-Fix-erroneous-display-of-stats-by-ethtool-S.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0003-e1000e-Fix-erroneous-display-of-stats-by-ethtool-S.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,73 @@
+From: Ajit Khaparde <ajitk at serverengines.com>
+Date: Tue, 13 Oct 2009 01:45:09 +0000
+Subject: [PATCH 003/166] e1000e: Fix erroneous display of stats by ethtool -S
+
+commit e0f36a95c7adb6551188cdcc5a7031ce106fccbf upstream.
+
+Commit fd8235bb overlooked the way offsets for netdev stats were considered.
+Because of this some of the stats shown by ethtool -S were wrong.
+This patch fixes it.
+
+Signed-off-by: Ajit Khaparde <ajitk at serverengines.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/ethtool.c | 27 ++++++++++++++++++++++-----
+ 1 files changed, 22 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
+index e9c3181..0364b91 100644
+--- a/drivers/net/e1000e/ethtool.c
++++ b/drivers/net/e1000e/ethtool.c
+@@ -35,16 +35,22 @@
+
+ #include "e1000.h"
+
++enum {NETDEV_STATS, E1000_STATS};
++
+ struct e1000_stats {
+ char stat_string[ETH_GSTRING_LEN];
++ int type;
+ int sizeof_stat;
+ int stat_offset;
+ };
+
+-#define E1000_STAT(m) sizeof(((struct e1000_adapter *)0)->m), \
+- offsetof(struct e1000_adapter, m)
+-#define E1000_NETDEV_STAT(m) sizeof(((struct net_device *)0)->m), \
+- offsetof(struct net_device, m)
++#define E1000_STAT(m) E1000_STATS, \
++ sizeof(((struct e1000_adapter *)0)->m), \
++ offsetof(struct e1000_adapter, m)
++#define E1000_NETDEV_STAT(m) NETDEV_STATS, \
++ sizeof(((struct net_device *)0)->m), \
++ offsetof(struct net_device, m)
++
+ static const struct e1000_stats e1000_gstrings_stats[] = {
+ { "rx_packets", E1000_STAT(stats.gprc) },
+ { "tx_packets", E1000_STAT(stats.gptc) },
+@@ -1914,10 +1920,21 @@ static void e1000_get_ethtool_stats(struct net_device *netdev,
+ {
+ struct e1000_adapter *adapter = netdev_priv(netdev);
+ int i;
++ char *p = NULL;
+
+ e1000e_update_stats(adapter);
+ for (i = 0; i < E1000_GLOBAL_STATS_LEN; i++) {
+- char *p = (char *)adapter+e1000_gstrings_stats[i].stat_offset;
++ switch (e1000_gstrings_stats[i].type) {
++ case NETDEV_STATS:
++ p = (char *) netdev +
++ e1000_gstrings_stats[i].stat_offset;
++ break;
++ case E1000_STATS:
++ p = (char *) adapter +
++ e1000_gstrings_stats[i].stat_offset;
++ break;
++ }
++
+ data[i] = (e1000_gstrings_stats[i].sizeof_stat ==
+ sizeof(u64)) ? *(u64 *)p : *(u32 *)p;
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0004-drivers-net-request_irq-Remove-unnecessary-leading-f.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0004-drivers-net-request_irq-Remove-unnecessary-leading-f.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,100 @@
+From: Joe Perches <joe at perches.com>
+Date: Wed, 18 Nov 2009 23:29:17 -0800
+Subject: [PATCH 004/166] drivers/net: request_irq - Remove unnecessary
+ leading & from second arg
+
+commit a0607fd3a25ba1848a63a0d925e36d914735ab47 upstream.
+
+Not as fancy as coccinelle. Checkpatch errors ignored.
+Compile tested allyesconfig x86, not all files compiled.
+
+grep -rPl --include=*.[ch] "\brequest_irq\s*\([^,\)]+,\s*\&" drivers/net | while read file ; do \
+ perl -i -e 'local $/; while (<>) { s@(\brequest_irq\s*\([^,\)]+,\s*)\&@\1 at g ; print ; }' $file ;\
+done
+
+Signed-off-by: Joe Perches <joe at perches.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Restricted to drivers/net/e1000e]
+---
+ drivers/net/e1000e/ethtool.c | 4 ++--
+ drivers/net/e1000e/netdev.c | 12 ++++++------
+ 2 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
+index 0364b91..c430dc8 100644
+--- a/drivers/net/e1000e/ethtool.c
++++ b/drivers/net/e1000e/ethtool.c
+@@ -937,10 +937,10 @@ static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data)
+ e1000e_set_interrupt_capability(adapter);
+ }
+ /* Hook up test interrupt handler just for this test */
+- if (!request_irq(irq, &e1000_test_intr, IRQF_PROBE_SHARED, netdev->name,
++ if (!request_irq(irq, e1000_test_intr, IRQF_PROBE_SHARED, netdev->name,
+ netdev)) {
+ shared_int = 0;
+- } else if (request_irq(irq, &e1000_test_intr, IRQF_SHARED,
++ } else if (request_irq(irq, e1000_test_intr, IRQF_SHARED,
+ netdev->name, netdev)) {
+ *data = 1;
+ ret_val = -1;
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 7aecc68..6406d6e 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -1477,7 +1477,7 @@ static int e1000_request_msix(struct e1000_adapter *adapter)
+ else
+ memcpy(adapter->rx_ring->name, netdev->name, IFNAMSIZ);
+ err = request_irq(adapter->msix_entries[vector].vector,
+- &e1000_intr_msix_rx, 0, adapter->rx_ring->name,
++ e1000_intr_msix_rx, 0, adapter->rx_ring->name,
+ netdev);
+ if (err)
+ goto out;
+@@ -1490,7 +1490,7 @@ static int e1000_request_msix(struct e1000_adapter *adapter)
+ else
+ memcpy(adapter->tx_ring->name, netdev->name, IFNAMSIZ);
+ err = request_irq(adapter->msix_entries[vector].vector,
+- &e1000_intr_msix_tx, 0, adapter->tx_ring->name,
++ e1000_intr_msix_tx, 0, adapter->tx_ring->name,
+ netdev);
+ if (err)
+ goto out;
+@@ -1499,7 +1499,7 @@ static int e1000_request_msix(struct e1000_adapter *adapter)
+ vector++;
+
+ err = request_irq(adapter->msix_entries[vector].vector,
+- &e1000_msix_other, 0, netdev->name, netdev);
++ e1000_msix_other, 0, netdev->name, netdev);
+ if (err)
+ goto out;
+
+@@ -1530,7 +1530,7 @@ static int e1000_request_irq(struct e1000_adapter *adapter)
+ e1000e_set_interrupt_capability(adapter);
+ }
+ if (adapter->flags & FLAG_MSI_ENABLED) {
+- err = request_irq(adapter->pdev->irq, &e1000_intr_msi, 0,
++ err = request_irq(adapter->pdev->irq, e1000_intr_msi, 0,
+ netdev->name, netdev);
+ if (!err)
+ return err;
+@@ -1540,7 +1540,7 @@ static int e1000_request_irq(struct e1000_adapter *adapter)
+ adapter->int_mode = E1000E_INT_MODE_LEGACY;
+ }
+
+- err = request_irq(adapter->pdev->irq, &e1000_intr, IRQF_SHARED,
++ err = request_irq(adapter->pdev->irq, e1000_intr, IRQF_SHARED,
+ netdev->name, netdev);
+ if (err)
+ e_err("Unable to allocate interrupt, Error: %d\n", err);
+@@ -2994,7 +2994,7 @@ static int e1000_test_msi_interrupt(struct e1000_adapter *adapter)
+ if (err)
+ goto msi_test_failed;
+
+- err = request_irq(adapter->pdev->irq, &e1000_intr_msi_test, 0,
++ err = request_irq(adapter->pdev->irq, e1000_intr_msi_test, 0,
+ netdev->name, netdev);
+ if (err) {
+ pci_disable_msi(adapter->pdev);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0005-e1000e-check-WoL-mode-is-among-set-of-supported-mode.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0005-e1000e-check-WoL-mode-is-among-set-of-supported-mode.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,43 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Fri, 20 Nov 2009 23:22:01 +0000
+Subject: [PATCH 005/166] e1000e: check WoL mode is among set of supported
+ modes
+
+commit 1fbfca3211ce50d992d66bcda71fc47bf5e268c9 upstream.
+
+When setting WoL feature, check the supplied modes are all supported rather
+than checking for no support. This way, if any new modes are added the
+driver does not default to not complaining about it if we don't really
+support it.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/ethtool.c | 9 ++++-----
+ 1 files changed, 4 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
+index c430dc8..3af5ee4 100644
+--- a/drivers/net/e1000e/ethtool.c
++++ b/drivers/net/e1000e/ethtool.c
+@@ -1777,12 +1777,11 @@ static int e1000_set_wol(struct net_device *netdev,
+ {
+ struct e1000_adapter *adapter = netdev_priv(netdev);
+
+- if (wol->wolopts & WAKE_MAGICSECURE)
+- return -EOPNOTSUPP;
+-
+ if (!(adapter->flags & FLAG_HAS_WOL) ||
+- !device_can_wakeup(&adapter->pdev->dev))
+- return wol->wolopts ? -EOPNOTSUPP : 0;
++ !device_can_wakeup(&adapter->pdev->dev) ||
++ (wol->wolopts & ~(WAKE_UCAST | WAKE_MCAST | WAKE_BCAST |
++ WAKE_MAGIC | WAKE_PHY | WAKE_ARP)))
++ return -EOPNOTSUPP;
+
+ /* these settings will always override what we currently have */
+ adapter->wol = 0;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0006-e1000e-add-missing-tests-for-82583-in-ethtool-functi.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0006-e1000e-add-missing-tests-for-82583-in-ethtool-functi.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,43 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Fri, 20 Nov 2009 23:22:20 +0000
+Subject: [PATCH 006/166] e1000e: add missing tests for 82583 in ethtool
+ functions
+
+commit f89271dda9431b432dad7505ccdcb57666233c1d upstream.
+
+Add tests for 82583 in a couple ethtool functions that were missed from the
+initial hardware enablement submission.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/ethtool.c | 5 ++++-
+ 1 files changed, 4 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
+index 3af5ee4..1ff43b4 100644
+--- a/drivers/net/e1000e/ethtool.c
++++ b/drivers/net/e1000e/ethtool.c
+@@ -604,7 +604,9 @@ static int e1000_set_eeprom(struct net_device *netdev,
+ * and flush shadow RAM for applicable controllers
+ */
+ if ((first_word <= NVM_CHECKSUM_REG) ||
+- (hw->mac.type == e1000_82574) || (hw->mac.type == e1000_82573))
++ (hw->mac.type == e1000_82583) ||
++ (hw->mac.type == e1000_82574) ||
++ (hw->mac.type == e1000_82573))
+ ret_val = e1000e_update_nvm_checksum(hw);
+
+ out:
+@@ -1839,6 +1841,7 @@ static int e1000_phys_id(struct net_device *netdev, u32 data)
+
+ if ((hw->phy.type == e1000_phy_ife) ||
+ (hw->mac.type == e1000_pchlan) ||
++ (hw->mac.type == e1000_82583) ||
+ (hw->mac.type == e1000_82574)) {
+ INIT_WORK(&adapter->led_blink_task, e1000e_led_blink_task);
+ if (!adapter->blink_timer.function) {
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0007-e1000e-clearing-interrupt-timers-causes-descriptors-.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0007-e1000e-clearing-interrupt-timers-causes-descriptors-.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,34 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Fri, 20 Nov 2009 23:22:39 +0000
+Subject: [PATCH 007/166] e1000e: clearing interrupt timers causes descriptors
+ to get flushed
+
+commit f4e2c6db7f4453ed5fb2e4342128d0ee3cfcf6bd upstream.
+
+Clearing the interrupt timers following an IMS clear has the unwanted
+side-effect of flushing all descriptors immediately following a partial
+write when interrupts are disabled.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/netdev.c | 2 --
+ 1 files changed, 0 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 6406d6e..46c75a5 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -2448,8 +2448,6 @@ static void e1000_configure_rx(struct e1000_adapter *adapter)
+ ew32(ITR, 1000000000 / (adapter->itr * 256));
+
+ ctrl_ext = er32(CTRL_EXT);
+- /* Reset delay timers after every interrupt */
+- ctrl_ext |= E1000_CTRL_EXT_INT_TIMER_CLR;
+ /* Auto-Mask interrupts upon ICR access */
+ ctrl_ext |= E1000_CTRL_EXT_IAME;
+ ew32(IAM, 0xffffffff);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0008-e1000e-function-pointers-for-ethtool-set-get-offload.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0008-e1000e-function-pointers-for-ethtool-set-get-offload.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,32 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Fri, 20 Nov 2009 23:22:57 +0000
+Subject: [PATCH 008/166] e1000e: function pointers for ethtool set/get
+ offloads
+
+commit e7d906f714994885b4889d02d6478e7a9418dcbe upstream.
+
+Provide missing function pointers for ethtool set/get offloads.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/ethtool.c | 2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
+index 1ff43b4..3d73f20 100644
+--- a/drivers/net/e1000e/ethtool.c
++++ b/drivers/net/e1000e/ethtool.c
+@@ -1996,6 +1996,8 @@ static const struct ethtool_ops e1000_ethtool_ops = {
+ .get_sset_count = e1000e_get_sset_count,
+ .get_coalesce = e1000_get_coalesce,
+ .set_coalesce = e1000_set_coalesce,
++ .get_flags = ethtool_op_get_flags,
++ .set_flags = ethtool_op_set_flags,
+ };
+
+ void e1000e_set_ethtool_ops(struct net_device *netdev)
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0009-e1000e-don-t-clean-Rx-ring-while-resetting.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0009-e1000e-don-t-clean-Rx-ring-while-resetting.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,32 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Fri, 20 Nov 2009 23:23:16 +0000
+Subject: [PATCH 009/166] e1000e: don't clean Rx ring while resetting
+
+commit a68ea775ad24ff403437c967628d2b9ce531ce48 upstream.
+
+When using legacy interrupts, do not clean the Rx ring while resetting
+otherwise traffic will not pass.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/netdev.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 46c75a5..28fd3a1 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -1195,7 +1195,7 @@ static irqreturn_t e1000_intr(int irq, void *data)
+ struct e1000_hw *hw = &adapter->hw;
+ u32 rctl, icr = er32(ICR);
+
+- if (!icr)
++ if (!icr || test_bit(__E1000_DOWN, &adapter->state))
+ return IRQ_NONE; /* Not our interrupt */
+
+ /*
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0010-e1000e-link-reporting-problems.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0010-e1000e-link-reporting-problems.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,47 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Fri, 20 Nov 2009 23:23:34 +0000
+Subject: [PATCH 010/166] e1000e: link reporting problems
+
+commit 7ea9655f8a4ccefcd8fdea7eb4fc5dab98e1a7ba upstream.
+
+Copper links with WoL or management enabled (any condition which prevents
+the phy from being powered down when the interface is taken down) were
+always reporting link-up when the interface had been taken down. This
+is because when the interface is taken down (ifconfig ethx down),
+interrupts are disabled. With no interrupts, there is no LSC interrupt,
+which is normally required to set "get_link_status", which instructs the
+driver to query the device for link state. The fix is to force
+get_link_status to true if the interface is not up.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/ethtool.c | 11 +++++++++++
+ 1 files changed, 11 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
+index 3d73f20..67e06fd 100644
+--- a/drivers/net/e1000e/ethtool.c
++++ b/drivers/net/e1000e/ethtool.c
+@@ -190,6 +190,17 @@ static int e1000_get_settings(struct net_device *netdev,
+ static u32 e1000_get_link(struct net_device *netdev)
+ {
+ struct e1000_adapter *adapter = netdev_priv(netdev);
++ struct e1000_mac_info *mac = &adapter->hw.mac;
++
++ /*
++ * If the link is not reported up to netdev, interrupts are disabled,
++ * and so the physical link state may have changed since we last
++ * looked. Set get_link_status to make sure that the true link
++ * state is interrogated, rather than pulling a cached and possibly
++ * stale link state from the driver.
++ */
++ if (!netif_carrier_ok(netdev))
++ mac->get_link_status = 1;
+
+ return e1000_has_link(adapter);
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0011-e1000e-improper-return-code-signage.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0011-e1000e-improper-return-code-signage.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,32 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Fri, 20 Nov 2009 23:23:53 +0000
+Subject: [PATCH 011/166] e1000e: improper return code signage
+
+commit 98086a954a75152f8b09c131fa443205bae5fde1 upstream.
+
+The e1000_get_cable_length_82577() should return a negative value upon
+error.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/phy.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c
+index 85f955f..77038e6 100644
+--- a/drivers/net/e1000e/phy.c
++++ b/drivers/net/e1000e/phy.c
+@@ -3125,7 +3125,7 @@ s32 e1000_get_cable_length_82577(struct e1000_hw *hw)
+ I82577_DSTATUS_CABLE_LENGTH_SHIFT;
+
+ if (length == E1000_CABLE_LENGTH_UNDEFINED)
+- ret_val = E1000_ERR_PHY;
++ ret_val = -E1000_ERR_PHY;
+
+ phy->cable_length = length;
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0012-e1000e-disable-K1-on-PCH-LOM-when-in-PHY-loopback-mo.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0012-e1000e-disable-K1-on-PCH-LOM-when-in-PHY-loopback-mo.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,71 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Fri, 20 Nov 2009 23:24:11 +0000
+Subject: [PATCH 012/166] e1000e: disable K1 on PCH LOM when in PHY loopback
+ mode
+
+commit bb436b20fe0ea4231a233aae7f0f7de3a3f2f5c3 upstream.
+
+When performing the ethtool PHY loopback test on PCH-based LOMs (82577 and
+82578), disable K1 (a MAC-PHY interconnect low power mode) otherwise
+packets might get corrupted.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/e1000.h | 1 +
+ drivers/net/e1000e/ethtool.c | 4 ++++
+ drivers/net/e1000e/ich8lan.c | 3 +--
+ 3 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
+index 88bc455..33792ba 100644
+--- a/drivers/net/e1000e/e1000.h
++++ b/drivers/net/e1000e/e1000.h
+@@ -488,6 +488,7 @@ extern void e1000e_set_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw,
+ extern void e1000e_igp3_phy_powerdown_workaround_ich8lan(struct e1000_hw *hw);
+ extern void e1000e_gig_downshift_workaround_ich8lan(struct e1000_hw *hw);
+ extern void e1000e_disable_gig_wol_ich8lan(struct e1000_hw *hw);
++extern s32 e1000_configure_k1_ich8lan(struct e1000_hw *hw, bool k1_enable);
+
+ extern s32 e1000e_check_for_copper_link(struct e1000_hw *hw);
+ extern s32 e1000e_check_for_fiber_link(struct e1000_hw *hw);
+diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
+index 67e06fd..fd79214 100644
+--- a/drivers/net/e1000e/ethtool.c
++++ b/drivers/net/e1000e/ethtool.c
+@@ -1260,6 +1260,10 @@ static int e1000_integrated_phy_loopback(struct e1000_adapter *adapter)
+
+ hw->mac.autoneg = 0;
+
++ /* Workaround: K1 must be disabled for stable 1Gbps operation */
++ if (hw->mac.type == e1000_pchlan)
++ e1000_configure_k1_ich8lan(hw, false);
++
+ if (hw->phy.type == e1000_phy_m88) {
+ /* Auto-MDI/MDIX Off */
+ e1e_wphy(hw, M88E1000_PHY_SPEC_CTRL, 0x0808);
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index de39f9a..4cc9bef 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -224,7 +224,6 @@ static s32 e1000_led_off_pchlan(struct e1000_hw *hw);
+ static s32 e1000_set_lplu_state_pchlan(struct e1000_hw *hw, bool active);
+ static void e1000_lan_init_done_ich8lan(struct e1000_hw *hw);
+ static s32 e1000_k1_gig_workaround_hv(struct e1000_hw *hw, bool link);
+-static s32 e1000_configure_k1_ich8lan(struct e1000_hw *hw, bool k1_enable);
+
+ static inline u16 __er16flash(struct e1000_hw *hw, unsigned long reg)
+ {
+@@ -1034,7 +1033,7 @@ out:
+ *
+ * Success returns 0, Failure returns -E1000_ERR_PHY (-2)
+ **/
+-static s32 e1000_configure_k1_ich8lan(struct e1000_hw *hw, bool k1_enable)
++s32 e1000_configure_k1_ich8lan(struct e1000_hw *hw, bool k1_enable)
+ {
+ s32 ret_val = 0;
+ u32 ctrl_reg = 0;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0013-e1000e-Incorrect-MII-Link-beat-reporting.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0013-e1000e-Incorrect-MII-Link-beat-reporting.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,38 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Fri, 20 Nov 2009 23:24:30 +0000
+Subject: [PATCH 013/166] e1000e: Incorrect MII Link beat reporting.
+
+commit b16a002e3da0357771433aa58a2521da00aa792a upstream.
+
+The driver was only updating MII stats when an LSC up was detected and
+the interface had not already been reported up to netdev. This meant
+MII stats returned in response to an SIOCGMIIREG ioctl would always
+show a link up if it had ever been up. This was misleading the networking
+daemon guessnet, which uses this ioctl, into making improper network port
+selections.
+This fix adds a call to e1000_phy_read_status() to actively read the
+mii stats before responding to the SIOCGMIIREG ioctl.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/netdev.c | 2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 28fd3a1..6e33db3 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -4342,6 +4342,8 @@ static int e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr,
+ data->phy_id = adapter->hw.phy.addr;
+ break;
+ case SIOCGMIIREG:
++ e1000_phy_read_status(adapter);
++
+ switch (data->reg_num & 0x1F) {
+ case MII_BMCR:
+ data->val_out = adapter->phy_regs.bmcr;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0014-e1000e-cleanup-redundant-include-s.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0014-e1000e-cleanup-redundant-include-s.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,95 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Fri, 20 Nov 2009 23:24:48 +0000
+Subject: [PATCH 014/166] e1000e: cleanup redundant #include's
+
+commit d8014dbca7f5d2d6f0fdb47e5286bd2d887f7065 upstream.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/82571.c | 4 ----
+ drivers/net/e1000e/e1000.h | 1 +
+ drivers/net/e1000e/es2lan.c | 5 -----
+ drivers/net/e1000e/ich8lan.c | 5 -----
+ drivers/net/e1000e/lib.c | 5 -----
+ 5 files changed, 1 insertions(+), 19 deletions(-)
+
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+index d1e0563..407637f 100644
+--- a/drivers/net/e1000e/82571.c
++++ b/drivers/net/e1000e/82571.c
+@@ -43,10 +43,6 @@
+ * 82583V Gigabit Network Connection
+ */
+
+-#include <linux/netdevice.h>
+-#include <linux/delay.h>
+-#include <linux/pci.h>
+-
+ #include "e1000.h"
+
+ #define ID_LED_RESERVED_F746 0xF746
+diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
+index 33792ba..c0f00f7 100644
+--- a/drivers/net/e1000e/e1000.h
++++ b/drivers/net/e1000e/e1000.h
+@@ -36,6 +36,7 @@
+ #include <linux/workqueue.h>
+ #include <linux/io.h>
+ #include <linux/netdevice.h>
++#include <linux/pci.h>
+
+ #include "hw.h"
+
+diff --git a/drivers/net/e1000e/es2lan.c b/drivers/net/e1000e/es2lan.c
+index ae5d736..6fd46f5 100644
+--- a/drivers/net/e1000e/es2lan.c
++++ b/drivers/net/e1000e/es2lan.c
+@@ -31,11 +31,6 @@
+ * 80003ES2LAN Gigabit Ethernet Controller (Serdes)
+ */
+
+-#include <linux/netdevice.h>
+-#include <linux/ethtool.h>
+-#include <linux/delay.h>
+-#include <linux/pci.h>
+-
+ #include "e1000.h"
+
+ #define E1000_KMRNCTRLSTA_OFFSET_FIFO_CTRL 0x00
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index 4cc9bef..c2962a2 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -54,11 +54,6 @@
+ * 82578DC Gigabit Network Connection
+ */
+
+-#include <linux/netdevice.h>
+-#include <linux/ethtool.h>
+-#include <linux/delay.h>
+-#include <linux/pci.h>
+-
+ #include "e1000.h"
+
+ #define ICH_FLASH_GFPREG 0x0000
+diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c
+index 99ba2b8..5a670a2 100644
+--- a/drivers/net/e1000e/lib.c
++++ b/drivers/net/e1000e/lib.c
+@@ -26,11 +26,6 @@
+
+ *******************************************************************************/
+
+-#include <linux/netdevice.h>
+-#include <linux/ethtool.h>
+-#include <linux/delay.h>
+-#include <linux/pci.h>
+-
+ #include "e1000.h"
+
+ enum e1000_mng_mode {
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0015-e1000e-consolidate-two-dbug-macros-into-one-simpler-.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0015-e1000e-consolidate-two-dbug-macros-into-one-simpler-.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,1588 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Fri, 20 Nov 2009 23:25:07 +0000
+Subject: [PATCH 015/166] e1000e: consolidate two dbug macros into one simpler
+ one
+
+commit 3bb99fe226ead584a4db674dab546689f705201f upstream.
+
+This patch depends on a previous one that cleans up redundant #includes.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Adjust to apply on top of cherry-picked fixes in 2.6.32.y]
+---
+ drivers/net/e1000e/82571.c | 40 +++++++-------
+ drivers/net/e1000e/e1000.h | 4 +-
+ drivers/net/e1000e/es2lan.c | 23 ++++----
+ drivers/net/e1000e/hw.h | 11 ----
+ drivers/net/e1000e/ich8lan.c | 69 ++++++++++++------------
+ drivers/net/e1000e/lib.c | 122 +++++++++++++++++++++---------------------
+ drivers/net/e1000e/netdev.c | 28 +++-------
+ drivers/net/e1000e/phy.c | 92 ++++++++++++++++----------------
+ 8 files changed, 183 insertions(+), 206 deletions(-)
+
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+index 407637f..680b7c7 100644
+--- a/drivers/net/e1000e/82571.c
++++ b/drivers/net/e1000e/82571.c
+@@ -309,7 +309,7 @@ static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter)
+ * indicates that the bootagent or EFI code has
+ * improperly left this bit enabled
+ */
+- hw_dbg(hw, "Please update your 82571 Bootagent\n");
++ e_dbg("Please update your 82571 Bootagent\n");
+ }
+ ew32(SWSM, swsm & ~E1000_SWSM_SMBI);
+ }
+@@ -483,7 +483,7 @@ static s32 e1000_get_hw_semaphore_82571(struct e1000_hw *hw)
+ }
+
+ if (i == sw_timeout) {
+- hw_dbg(hw, "Driver can't access device - SMBI bit is set.\n");
++ e_dbg("Driver can't access device - SMBI bit is set.\n");
+ hw->dev_spec.e82571.smb_counter++;
+ }
+ /* Get the FW semaphore. */
+@@ -501,7 +501,7 @@ static s32 e1000_get_hw_semaphore_82571(struct e1000_hw *hw)
+ if (i == fw_timeout) {
+ /* Release semaphores */
+ e1000_put_hw_semaphore_82571(hw);
+- hw_dbg(hw, "Driver can't access the NVM\n");
++ e_dbg("Driver can't access the NVM\n");
+ return -E1000_ERR_NVM;
+ }
+
+@@ -708,7 +708,7 @@ static s32 e1000_write_nvm_eewr_82571(struct e1000_hw *hw, u16 offset,
+ */
+ if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) ||
+ (words == 0)) {
+- hw_dbg(hw, "nvm parameter(s) out of bounds\n");
++ e_dbg("nvm parameter(s) out of bounds\n");
+ return -E1000_ERR_NVM;
+ }
+
+@@ -749,7 +749,7 @@ static s32 e1000_get_cfg_done_82571(struct e1000_hw *hw)
+ timeout--;
+ }
+ if (!timeout) {
+- hw_dbg(hw, "MNG configuration cycle has not completed.\n");
++ e_dbg("MNG configuration cycle has not completed.\n");
+ return -E1000_ERR_RESET;
+ }
+
+@@ -848,9 +848,9 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
+ */
+ ret_val = e1000e_disable_pcie_master(hw);
+ if (ret_val)
+- hw_dbg(hw, "PCI-E Master disable polling has failed.\n");
++ e_dbg("PCI-E Master disable polling has failed.\n");
+
+- hw_dbg(hw, "Masking off all interrupts\n");
++ e_dbg("Masking off all interrupts\n");
+ ew32(IMC, 0xffffffff);
+
+ ew32(RCTL, 0);
+@@ -889,7 +889,7 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
+
+ ctrl = er32(CTRL);
+
+- hw_dbg(hw, "Issuing a global reset to MAC\n");
++ e_dbg("Issuing a global reset to MAC\n");
+ ew32(CTRL, ctrl | E1000_CTRL_RST);
+
+ if (hw->nvm.type == e1000_nvm_flash_hw) {
+@@ -955,12 +955,12 @@ static s32 e1000_init_hw_82571(struct e1000_hw *hw)
+ /* Initialize identification LED */
+ ret_val = e1000e_id_led_init(hw);
+ if (ret_val) {
+- hw_dbg(hw, "Error initializing identification LED\n");
++ e_dbg("Error initializing identification LED\n");
+ return ret_val;
+ }
+
+ /* Disabling VLAN filtering */
+- hw_dbg(hw, "Initializing the IEEE VLAN\n");
++ e_dbg("Initializing the IEEE VLAN\n");
+ e1000e_clear_vfta(hw);
+
+ /* Setup the receive address. */
+@@ -974,7 +974,7 @@ static s32 e1000_init_hw_82571(struct e1000_hw *hw)
+ e1000e_init_rx_addrs(hw, rar_count);
+
+ /* Zero out the Multicast HASH table */
+- hw_dbg(hw, "Zeroing the MTA\n");
++ e_dbg("Zeroing the MTA\n");
+ for (i = 0; i < mac->mta_reg_count; i++)
+ E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, 0);
+
+@@ -1383,7 +1383,7 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw)
+ */
+ mac->serdes_link_state =
+ e1000_serdes_link_autoneg_progress;
+- hw_dbg(hw, "AN_UP -> AN_PROG\n");
++ e_dbg("AN_UP -> AN_PROG\n");
+ }
+ break;
+
+@@ -1401,7 +1401,7 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw)
+ (ctrl & ~E1000_CTRL_SLU));
+ mac->serdes_link_state =
+ e1000_serdes_link_autoneg_progress;
+- hw_dbg(hw, "FORCED_UP -> AN_PROG\n");
++ e_dbg("FORCED_UP -> AN_PROG\n");
+ }
+ break;
+
+@@ -1415,7 +1415,7 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw)
+ if (status & E1000_STATUS_LU) {
+ mac->serdes_link_state =
+ e1000_serdes_link_autoneg_complete;
+- hw_dbg(hw, "AN_PROG -> AN_UP\n");
++ e_dbg("AN_PROG -> AN_UP\n");
+ } else {
+ /*
+ * Disable autoneg, force link up and
+@@ -1430,12 +1430,12 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw)
+ ret_val =
+ e1000e_config_fc_after_link_up(hw);
+ if (ret_val) {
+- hw_dbg(hw, "Error config flow control\n");
++ e_dbg("Error config flow control\n");
+ break;
+ }
+ mac->serdes_link_state =
+ e1000_serdes_link_forced_up;
+- hw_dbg(hw, "AN_PROG -> FORCED_UP\n");
++ e_dbg("AN_PROG -> FORCED_UP\n");
+ }
+ mac->serdes_has_link = true;
+ break;
+@@ -1450,14 +1450,14 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw)
+ (ctrl & ~E1000_CTRL_SLU));
+ mac->serdes_link_state =
+ e1000_serdes_link_autoneg_progress;
+- hw_dbg(hw, "DOWN -> AN_PROG\n");
++ e_dbg("DOWN -> AN_PROG\n");
+ break;
+ }
+ } else {
+ if (!(rxcw & E1000_RXCW_SYNCH)) {
+ mac->serdes_has_link = false;
+ mac->serdes_link_state = e1000_serdes_link_down;
+- hw_dbg(hw, "ANYSTATE -> DOWN\n");
++ e_dbg("ANYSTATE -> DOWN\n");
+ } else {
+ /*
+ * We have sync, and can tolerate one
+@@ -1469,7 +1469,7 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw)
+ if (rxcw & E1000_RXCW_IV) {
+ mac->serdes_link_state = e1000_serdes_link_down;
+ mac->serdes_has_link = false;
+- hw_dbg(hw, "ANYSTATE -> DOWN\n");
++ e_dbg("ANYSTATE -> DOWN\n");
+ }
+ }
+ }
+@@ -1491,7 +1491,7 @@ static s32 e1000_valid_led_default_82571(struct e1000_hw *hw, u16 *data)
+
+ ret_val = e1000_read_nvm(hw, NVM_ID_LED_SETTINGS, 1, data);
+ if (ret_val) {
+- hw_dbg(hw, "NVM Read Error\n");
++ e_dbg("NVM Read Error\n");
+ return ret_val;
+ }
+
+diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
+index c0f00f7..f1af1ed 100644
+--- a/drivers/net/e1000e/e1000.h
++++ b/drivers/net/e1000e/e1000.h
+@@ -48,9 +48,9 @@ struct e1000_info;
+
+ #ifdef DEBUG
+ #define e_dbg(format, arg...) \
+- e_printk(KERN_DEBUG , adapter, format, ## arg)
++ e_printk(KERN_DEBUG , hw->adapter, format, ## arg)
+ #else
+-#define e_dbg(format, arg...) do { (void)(adapter); } while (0)
++#define e_dbg(format, arg...) do { (void)(hw); } while (0)
+ #endif
+
+ #define e_err(format, arg...) \
+diff --git a/drivers/net/e1000e/es2lan.c b/drivers/net/e1000e/es2lan.c
+index 6fd46f5..f5601c5 100644
+--- a/drivers/net/e1000e/es2lan.c
++++ b/drivers/net/e1000e/es2lan.c
+@@ -394,8 +394,7 @@ static s32 e1000_acquire_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask)
+ }
+
+ if (i == timeout) {
+- hw_dbg(hw,
+- "Driver can't access resource, SW_FW_SYNC timeout.\n");
++ e_dbg("Driver can't access resource, SW_FW_SYNC timeout.\n");
+ return -E1000_ERR_SWFW_SYNC;
+ }
+
+@@ -597,7 +596,7 @@ static s32 e1000_get_cfg_done_80003es2lan(struct e1000_hw *hw)
+ timeout--;
+ }
+ if (!timeout) {
+- hw_dbg(hw, "MNG configuration cycle has not completed.\n");
++ e_dbg("MNG configuration cycle has not completed.\n");
+ return -E1000_ERR_RESET;
+ }
+
+@@ -630,7 +629,7 @@ static s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw)
+ if (ret_val)
+ return ret_val;
+
+- hw_dbg(hw, "GG82563 PSCR: %X\n", phy_data);
++ e_dbg("GG82563 PSCR: %X\n", phy_data);
+
+ ret_val = e1e_rphy(hw, PHY_CONTROL, &phy_data);
+ if (ret_val)
+@@ -648,7 +647,7 @@ static s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw)
+ udelay(1);
+
+ if (hw->phy.autoneg_wait_to_complete) {
+- hw_dbg(hw, "Waiting for forced speed/duplex link "
++ e_dbg("Waiting for forced speed/duplex link "
+ "on GG82563 phy.\n");
+
+ ret_val = e1000e_phy_has_link_generic(hw, PHY_FORCE_LIMIT,
+@@ -771,9 +770,9 @@ static s32 e1000_reset_hw_80003es2lan(struct e1000_hw *hw)
+ */
+ ret_val = e1000e_disable_pcie_master(hw);
+ if (ret_val)
+- hw_dbg(hw, "PCI-E Master disable polling has failed.\n");
++ e_dbg("PCI-E Master disable polling has failed.\n");
+
+- hw_dbg(hw, "Masking off all interrupts\n");
++ e_dbg("Masking off all interrupts\n");
+ ew32(IMC, 0xffffffff);
+
+ ew32(RCTL, 0);
+@@ -785,7 +784,7 @@ static s32 e1000_reset_hw_80003es2lan(struct e1000_hw *hw)
+ ctrl = er32(CTRL);
+
+ ret_val = e1000_acquire_phy_80003es2lan(hw);
+- hw_dbg(hw, "Issuing a global reset to MAC\n");
++ e_dbg("Issuing a global reset to MAC\n");
+ ew32(CTRL, ctrl | E1000_CTRL_RST);
+ e1000_release_phy_80003es2lan(hw);
+
+@@ -820,19 +819,19 @@ static s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw)
+ /* Initialize identification LED */
+ ret_val = e1000e_id_led_init(hw);
+ if (ret_val) {
+- hw_dbg(hw, "Error initializing identification LED\n");
++ e_dbg("Error initializing identification LED\n");
+ return ret_val;
+ }
+
+ /* Disabling VLAN filtering */
+- hw_dbg(hw, "Initializing the IEEE VLAN\n");
++ e_dbg("Initializing the IEEE VLAN\n");
+ e1000e_clear_vfta(hw);
+
+ /* Setup the receive address. */
+ e1000e_init_rx_addrs(hw, mac->rar_entry_count);
+
+ /* Zero out the Multicast HASH table */
+- hw_dbg(hw, "Zeroing the MTA\n");
++ e_dbg("Zeroing the MTA\n");
+ for (i = 0; i < mac->mta_reg_count; i++)
+ E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, 0);
+
+@@ -989,7 +988,7 @@ static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw)
+ /* SW Reset the PHY so all changes take effect */
+ ret_val = e1000e_commit_phy(hw);
+ if (ret_val) {
+- hw_dbg(hw, "Error Resetting the PHY\n");
++ e_dbg("Error Resetting the PHY\n");
+ return ret_val;
+ }
+
+diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h
+index 11f3b7c..d9e85d6 100644
+--- a/drivers/net/e1000e/hw.h
++++ b/drivers/net/e1000e/hw.h
+@@ -926,15 +926,4 @@ struct e1000_hw {
+ } dev_spec;
+ };
+
+-#ifdef DEBUG
+-#define hw_dbg(hw, format, arg...) \
+- printk(KERN_DEBUG "%s: " format, e1000e_get_hw_dev_name(hw), ##arg)
+-#else
+-static inline int __attribute__ ((format (printf, 2, 3)))
+-hw_dbg(struct e1000_hw *hw, const char *format, ...)
+-{
+- return 0;
+-}
+-#endif
+-
+ #endif
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index c2962a2..448e099 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -379,7 +379,7 @@ static s32 e1000_init_nvm_params_ich8lan(struct e1000_hw *hw)
+
+ /* Can't read flash registers if the register set isn't mapped. */
+ if (!hw->flash_address) {
+- hw_dbg(hw, "ERROR: Flash registers not mapped\n");
++ e_dbg("ERROR: Flash registers not mapped\n");
+ return -E1000_ERR_CONFIG;
+ }
+
+@@ -561,7 +561,7 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
+ */
+ ret_val = e1000e_config_fc_after_link_up(hw);
+ if (ret_val)
+- hw_dbg(hw, "Error configuring flow control\n");
++ e_dbg("Error configuring flow control\n");
+
+ out:
+ return ret_val;
+@@ -655,7 +655,7 @@ static s32 e1000_acquire_swflag_ich8lan(struct e1000_hw *hw)
+ }
+
+ if (!timeout) {
+- hw_dbg(hw, "SW/FW/HW has locked the resource for too long.\n");
++ e_dbg("SW/FW/HW has locked the resource for too long.\n");
+ ret_val = -E1000_ERR_CONFIG;
+ goto out;
+ }
+@@ -675,7 +675,7 @@ static s32 e1000_acquire_swflag_ich8lan(struct e1000_hw *hw)
+ }
+
+ if (!timeout) {
+- hw_dbg(hw, "Failed to acquire the semaphore.\n");
++ e_dbg("Failed to acquire the semaphore.\n");
+ extcnf_ctrl &= ~E1000_EXTCNF_CTRL_SWFLAG;
+ ew32(EXTCNF_CTRL, extcnf_ctrl);
+ ret_val = -E1000_ERR_CONFIG;
+@@ -784,12 +784,12 @@ static s32 e1000_phy_force_speed_duplex_ich8lan(struct e1000_hw *hw)
+ if (ret_val)
+ return ret_val;
+
+- hw_dbg(hw, "IFE PMC: %X\n", data);
++ e_dbg("IFE PMC: %X\n", data);
+
+ udelay(1);
+
+ if (phy->autoneg_wait_to_complete) {
+- hw_dbg(hw, "Waiting for forced speed/duplex link on IFE phy.\n");
++ e_dbg("Waiting for forced speed/duplex link on IFE phy.\n");
+
+ ret_val = e1000e_phy_has_link_generic(hw,
+ PHY_FORCE_LIMIT,
+@@ -799,7 +799,7 @@ static s32 e1000_phy_force_speed_duplex_ich8lan(struct e1000_hw *hw)
+ return ret_val;
+
+ if (!link)
+- hw_dbg(hw, "Link taking longer than expected.\n");
++ e_dbg("Link taking longer than expected.\n");
+
+ /* Try once more */
+ ret_val = e1000e_phy_has_link_generic(hw,
+@@ -1215,7 +1215,7 @@ static void e1000_lan_init_done_ich8lan(struct e1000_hw *hw)
+ * leave the PHY in a bad state possibly resulting in no link.
+ */
+ if (loop == 0)
+- hw_dbg(hw, "LAN_INIT_DONE not set, increase timeout\n");
++ e_dbg("LAN_INIT_DONE not set, increase timeout\n");
+
+ /* Clear the Init Done bit for the next init event */
+ data = er32(STATUS);
+@@ -1286,7 +1286,7 @@ static s32 e1000_get_phy_info_ife_ich8lan(struct e1000_hw *hw)
+ return ret_val;
+
+ if (!link) {
+- hw_dbg(hw, "Phy info is only valid if link is up\n");
++ e_dbg("Phy info is only valid if link is up\n");
+ return -E1000_ERR_CONFIG;
+ }
+
+@@ -1616,7 +1616,7 @@ static s32 e1000_valid_nvm_bank_detect_ich8lan(struct e1000_hw *hw, u32 *bank)
+
+ return 0;
+ }
+- hw_dbg(hw, "Unable to determine valid NVM bank via EEC - "
++ e_dbg("Unable to determine valid NVM bank via EEC - "
+ "reading flash signature\n");
+ /* fall-thru */
+ default:
+@@ -1646,7 +1646,7 @@ static s32 e1000_valid_nvm_bank_detect_ich8lan(struct e1000_hw *hw, u32 *bank)
+ return 0;
+ }
+
+- hw_dbg(hw, "ERROR: No valid NVM bank present\n");
++ e_dbg("ERROR: No valid NVM bank present\n");
+ return -E1000_ERR_NVM;
+ }
+
+@@ -1674,7 +1674,7 @@ static s32 e1000_read_nvm_ich8lan(struct e1000_hw *hw, u16 offset, u16 words,
+
+ if ((offset >= nvm->word_size) || (words > nvm->word_size - offset) ||
+ (words == 0)) {
+- hw_dbg(hw, "nvm parameter(s) out of bounds\n");
++ e_dbg("nvm parameter(s) out of bounds\n");
+ ret_val = -E1000_ERR_NVM;
+ goto out;
+ }
+@@ -1683,7 +1683,7 @@ static s32 e1000_read_nvm_ich8lan(struct e1000_hw *hw, u16 offset, u16 words,
+
+ ret_val = e1000_valid_nvm_bank_detect_ich8lan(hw, &bank);
+ if (ret_val) {
+- hw_dbg(hw, "Could not detect valid bank, assuming bank 0\n");
++ e_dbg("Could not detect valid bank, assuming bank 0\n");
+ bank = 0;
+ }
+
+@@ -1709,7 +1709,7 @@ static s32 e1000_read_nvm_ich8lan(struct e1000_hw *hw, u16 offset, u16 words,
+
+ out:
+ if (ret_val)
+- hw_dbg(hw, "NVM read error: %d\n", ret_val);
++ e_dbg("NVM read error: %d\n", ret_val);
+
+ return ret_val;
+ }
+@@ -1731,7 +1731,7 @@ static s32 e1000_flash_cycle_init_ich8lan(struct e1000_hw *hw)
+
+ /* Check if the flash descriptor is valid */
+ if (hsfsts.hsf_status.fldesvalid == 0) {
+- hw_dbg(hw, "Flash descriptor invalid. "
++ e_dbg("Flash descriptor invalid. "
+ "SW Sequencing must be used.");
+ return -E1000_ERR_NVM;
+ }
+@@ -1781,7 +1781,7 @@ static s32 e1000_flash_cycle_init_ich8lan(struct e1000_hw *hw)
+ hsfsts.hsf_status.flcdone = 1;
+ ew16flash(ICH_FLASH_HSFSTS, hsfsts.regval);
+ } else {
+- hw_dbg(hw, "Flash controller busy, cannot get access");
++ e_dbg("Flash controller busy, cannot get access");
+ }
+ }
+
+@@ -1931,7 +1931,7 @@ static s32 e1000_read_flash_data_ich8lan(struct e1000_hw *hw, u32 offset,
+ /* Repeat for some time before giving up. */
+ continue;
+ } else if (hsfsts.hsf_status.flcdone == 0) {
+- hw_dbg(hw, "Timeout error - flash cycle "
++ e_dbg("Timeout error - flash cycle "
+ "did not complete.");
+ break;
+ }
+@@ -1959,7 +1959,7 @@ static s32 e1000_write_nvm_ich8lan(struct e1000_hw *hw, u16 offset, u16 words,
+
+ if ((offset >= nvm->word_size) || (words > nvm->word_size - offset) ||
+ (words == 0)) {
+- hw_dbg(hw, "nvm parameter(s) out of bounds\n");
++ e_dbg("nvm parameter(s) out of bounds\n");
+ return -E1000_ERR_NVM;
+ }
+
+@@ -2010,7 +2010,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)
+ */
+ ret_val = e1000_valid_nvm_bank_detect_ich8lan(hw, &bank);
+ if (ret_val) {
+- hw_dbg(hw, "Could not detect valid bank, assuming bank 0\n");
++ e_dbg("Could not detect valid bank, assuming bank 0\n");
+ bank = 0;
+ }
+
+@@ -2084,7 +2084,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)
+ */
+ if (ret_val) {
+ /* Possibly read-only, see e1000e_write_protect_nvm_ich8lan() */
+- hw_dbg(hw, "Flash commit failed.\n");
++ e_dbg("Flash commit failed.\n");
+ nvm->ops.release_nvm(hw);
+ goto out;
+ }
+@@ -2140,7 +2140,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)
+
+ out:
+ if (ret_val)
+- hw_dbg(hw, "NVM update error: %d\n", ret_val);
++ e_dbg("NVM update error: %d\n", ret_val);
+
+ return ret_val;
+ }
+@@ -2290,7 +2290,7 @@ static s32 e1000_write_flash_data_ich8lan(struct e1000_hw *hw, u32 offset,
+ /* Repeat for some time before giving up. */
+ continue;
+ if (hsfsts.hsf_status.flcdone == 0) {
+- hw_dbg(hw, "Timeout error - flash cycle "
++ e_dbg("Timeout error - flash cycle "
+ "did not complete.");
+ break;
+ }
+@@ -2335,7 +2335,7 @@ static s32 e1000_retry_write_flash_byte_ich8lan(struct e1000_hw *hw,
+ return ret_val;
+
+ for (program_retries = 0; program_retries < 100; program_retries++) {
+- hw_dbg(hw, "Retrying Byte %2.2X at offset %u\n", byte, offset);
++ e_dbg("Retrying Byte %2.2X at offset %u\n", byte, offset);
+ udelay(100);
+ ret_val = e1000_write_flash_byte_ich8lan(hw, offset, byte);
+ if (!ret_val)
+@@ -2470,7 +2470,7 @@ static s32 e1000_valid_led_default_ich8lan(struct e1000_hw *hw, u16 *data)
+
+ ret_val = e1000_read_nvm(hw, NVM_ID_LED_SETTINGS, 1, data);
+ if (ret_val) {
+- hw_dbg(hw, "NVM Read Error\n");
++ e_dbg("NVM Read Error\n");
+ return ret_val;
+ }
+
+@@ -2600,10 +2600,10 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
+ */
+ ret_val = e1000e_disable_pcie_master(hw);
+ if (ret_val) {
+- hw_dbg(hw, "PCI-E Master disable polling has failed.\n");
++ e_dbg("PCI-E Master disable polling has failed.\n");
+ }
+
+- hw_dbg(hw, "Masking off all interrupts\n");
++ e_dbg("Masking off all interrupts\n");
+ ew32(IMC, 0xffffffff);
+
+ /*
+@@ -2655,7 +2655,7 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
+ }
+ ret_val = e1000_acquire_swflag_ich8lan(hw);
+ /* Whether or not the swflag was acquired, we need to reset the part */
+- hw_dbg(hw, "Issuing a global reset to ich8lan\n");
++ e_dbg("Issuing a global reset to ich8lan\n");
+ ew32(CTRL, (ctrl | E1000_CTRL_RST));
+ msleep(20);
+
+@@ -2675,7 +2675,7 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
+ * return with an error. This can happen in situations
+ * where there is no eeprom and prevents getting link.
+ */
+- hw_dbg(hw, "Auto Read Done did not complete\n");
++ e_dbg("Auto Read Done did not complete\n");
+ }
+ }
+ /* Dummy read to clear the phy wakeup bit after lcd reset */
+@@ -2737,7 +2737,7 @@ static s32 e1000_init_hw_ich8lan(struct e1000_hw *hw)
+ /* Initialize identification LED */
+ ret_val = mac->ops.id_led_init(hw);
+ if (ret_val) {
+- hw_dbg(hw, "Error initializing identification LED\n");
++ e_dbg("Error initializing identification LED\n");
+ return ret_val;
+ }
+
+@@ -2745,7 +2745,7 @@ static s32 e1000_init_hw_ich8lan(struct e1000_hw *hw)
+ e1000e_init_rx_addrs(hw, mac->rar_entry_count);
+
+ /* Zero out the Multicast HASH table */
+- hw_dbg(hw, "Zeroing the MTA\n");
++ e_dbg("Zeroing the MTA\n");
+ for (i = 0; i < mac->mta_reg_count; i++)
+ E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, 0);
+
+@@ -2891,7 +2891,7 @@ static s32 e1000_setup_link_ich8lan(struct e1000_hw *hw)
+ */
+ hw->fc.current_mode = hw->fc.requested_mode;
+
+- hw_dbg(hw, "After fix-ups FlowControl is now = %x\n",
++ e_dbg("After fix-ups FlowControl is now = %x\n",
+ hw->fc.current_mode);
+
+ /* Continue to configure the copper link. */
+@@ -3106,7 +3106,7 @@ void e1000e_set_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw,
+ struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan;
+
+ if (hw->mac.type != e1000_ich8lan) {
+- hw_dbg(hw, "Workaround applies to ICH8 only.\n");
++ e_dbg("Workaround applies to ICH8 only.\n");
+ return;
+ }
+
+@@ -3385,8 +3385,7 @@ static s32 e1000_get_cfg_done_ich8lan(struct e1000_hw *hw)
+ if (status & E1000_STATUS_PHYRA)
+ ew32(STATUS, status & ~E1000_STATUS_PHYRA);
+ else
+- hw_dbg(hw,
+- "PHY Reset Asserted not set - needs delay\n");
++ e_dbg("PHY Reset Asserted not set - needs delay\n");
+ }
+
+ e1000e_get_cfg_done(hw);
+@@ -3401,7 +3400,7 @@ static s32 e1000_get_cfg_done_ich8lan(struct e1000_hw *hw)
+ } else {
+ if (e1000_valid_nvm_bank_detect_ich8lan(hw, &bank)) {
+ /* Maybe we should do a basic PHY config */
+- hw_dbg(hw, "EEPROM not present\n");
++ e_dbg("EEPROM not present\n");
+ return -E1000_ERR_CONFIG;
+ }
+ }
+diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c
+index 5a670a2..fa31c51 100644
+--- a/drivers/net/e1000e/lib.c
++++ b/drivers/net/e1000e/lib.c
+@@ -110,12 +110,12 @@ void e1000e_init_rx_addrs(struct e1000_hw *hw, u16 rar_count)
+ u32 i;
+
+ /* Setup the receive address */
+- hw_dbg(hw, "Programming MAC Address into RAR[0]\n");
++ e_dbg("Programming MAC Address into RAR[0]\n");
+
+ e1000e_rar_set(hw, hw->mac.addr, 0);
+
+ /* Zero out the other (rar_entry_count - 1) receive addresses */
+- hw_dbg(hw, "Clearing RAR[1-%u]\n", rar_count-1);
++ e_dbg("Clearing RAR[1-%u]\n", rar_count-1);
+ for (i = 1; i < rar_count; i++) {
+ E1000_WRITE_REG_ARRAY(hw, E1000_RA, (i << 1), 0);
+ e1e_flush();
+@@ -271,7 +271,7 @@ void e1000e_update_mc_addr_list_generic(struct e1000_hw *hw,
+ for (; mc_addr_count > 0; mc_addr_count--) {
+ u32 hash_value, hash_reg, hash_bit, mta;
+ hash_value = e1000_hash_mc_addr(hw, mc_addr_list);
+- hw_dbg(hw, "Hash value = 0x%03X\n", hash_value);
++ e_dbg("Hash value = 0x%03X\n", hash_value);
+ hash_reg = (hash_value >> 5) & (hw->mac.mta_reg_count - 1);
+ hash_bit = hash_value & 0x1F;
+ mta = (1 << hash_bit);
+@@ -403,7 +403,7 @@ s32 e1000e_check_for_copper_link(struct e1000_hw *hw)
+ */
+ ret_val = e1000e_config_fc_after_link_up(hw);
+ if (ret_val) {
+- hw_dbg(hw, "Error configuring flow control\n");
++ e_dbg("Error configuring flow control\n");
+ }
+
+ return ret_val;
+@@ -443,7 +443,7 @@ s32 e1000e_check_for_fiber_link(struct e1000_hw *hw)
+ mac->autoneg_failed = 1;
+ return 0;
+ }
+- hw_dbg(hw, "NOT RXing /C/, disable AutoNeg and force link.\n");
++ e_dbg("NOT RXing /C/, disable AutoNeg and force link.\n");
+
+ /* Disable auto-negotiation in the TXCW register */
+ ew32(TXCW, (mac->txcw & ~E1000_TXCW_ANE));
+@@ -456,7 +456,7 @@ s32 e1000e_check_for_fiber_link(struct e1000_hw *hw)
+ /* Configure Flow Control after forcing link up. */
+ ret_val = e1000e_config_fc_after_link_up(hw);
+ if (ret_val) {
+- hw_dbg(hw, "Error configuring flow control\n");
++ e_dbg("Error configuring flow control\n");
+ return ret_val;
+ }
+ } else if ((ctrl & E1000_CTRL_SLU) && (rxcw & E1000_RXCW_C)) {
+@@ -466,7 +466,7 @@ s32 e1000e_check_for_fiber_link(struct e1000_hw *hw)
+ * and disable forced link in the Device Control register
+ * in an attempt to auto-negotiate with our link partner.
+ */
+- hw_dbg(hw, "RXing /C/, enable AutoNeg and stop forcing link.\n");
++ e_dbg("RXing /C/, enable AutoNeg and stop forcing link.\n");
+ ew32(TXCW, mac->txcw);
+ ew32(CTRL, (ctrl & ~E1000_CTRL_SLU));
+
+@@ -508,7 +508,7 @@ s32 e1000e_check_for_serdes_link(struct e1000_hw *hw)
+ mac->autoneg_failed = 1;
+ return 0;
+ }
+- hw_dbg(hw, "NOT RXing /C/, disable AutoNeg and force link.\n");
++ e_dbg("NOT RXing /C/, disable AutoNeg and force link.\n");
+
+ /* Disable auto-negotiation in the TXCW register */
+ ew32(TXCW, (mac->txcw & ~E1000_TXCW_ANE));
+@@ -521,7 +521,7 @@ s32 e1000e_check_for_serdes_link(struct e1000_hw *hw)
+ /* Configure Flow Control after forcing link up. */
+ ret_val = e1000e_config_fc_after_link_up(hw);
+ if (ret_val) {
+- hw_dbg(hw, "Error configuring flow control\n");
++ e_dbg("Error configuring flow control\n");
+ return ret_val;
+ }
+ } else if ((ctrl & E1000_CTRL_SLU) && (rxcw & E1000_RXCW_C)) {
+@@ -531,7 +531,7 @@ s32 e1000e_check_for_serdes_link(struct e1000_hw *hw)
+ * and disable forced link in the Device Control register
+ * in an attempt to auto-negotiate with our link partner.
+ */
+- hw_dbg(hw, "RXing /C/, enable AutoNeg and stop forcing link.\n");
++ e_dbg("RXing /C/, enable AutoNeg and stop forcing link.\n");
+ ew32(TXCW, mac->txcw);
+ ew32(CTRL, (ctrl & ~E1000_CTRL_SLU));
+
+@@ -548,11 +548,11 @@ s32 e1000e_check_for_serdes_link(struct e1000_hw *hw)
+ if (rxcw & E1000_RXCW_SYNCH) {
+ if (!(rxcw & E1000_RXCW_IV)) {
+ mac->serdes_has_link = true;
+- hw_dbg(hw, "SERDES: Link up - forced.\n");
++ e_dbg("SERDES: Link up - forced.\n");
+ }
+ } else {
+ mac->serdes_has_link = false;
+- hw_dbg(hw, "SERDES: Link down - force failed.\n");
++ e_dbg("SERDES: Link down - force failed.\n");
+ }
+ }
+
+@@ -565,20 +565,20 @@ s32 e1000e_check_for_serdes_link(struct e1000_hw *hw)
+ if (rxcw & E1000_RXCW_SYNCH) {
+ if (!(rxcw & E1000_RXCW_IV)) {
+ mac->serdes_has_link = true;
+- hw_dbg(hw, "SERDES: Link up - autoneg "
++ e_dbg("SERDES: Link up - autoneg "
+ "completed sucessfully.\n");
+ } else {
+ mac->serdes_has_link = false;
+- hw_dbg(hw, "SERDES: Link down - invalid"
++ e_dbg("SERDES: Link down - invalid"
+ "codewords detected in autoneg.\n");
+ }
+ } else {
+ mac->serdes_has_link = false;
+- hw_dbg(hw, "SERDES: Link down - no sync.\n");
++ e_dbg("SERDES: Link down - no sync.\n");
+ }
+ } else {
+ mac->serdes_has_link = false;
+- hw_dbg(hw, "SERDES: Link down - autoneg failed\n");
++ e_dbg("SERDES: Link down - autoneg failed\n");
+ }
+ }
+
+@@ -609,7 +609,7 @@ static s32 e1000_set_default_fc_generic(struct e1000_hw *hw)
+ ret_val = e1000_read_nvm(hw, NVM_INIT_CONTROL2_REG, 1, &nvm_data);
+
+ if (ret_val) {
+- hw_dbg(hw, "NVM Read Error\n");
++ e_dbg("NVM Read Error\n");
+ return ret_val;
+ }
+
+@@ -662,7 +662,7 @@ s32 e1000e_setup_link(struct e1000_hw *hw)
+ */
+ hw->fc.current_mode = hw->fc.requested_mode;
+
+- hw_dbg(hw, "After fix-ups FlowControl is now = %x\n",
++ e_dbg("After fix-ups FlowControl is now = %x\n",
+ hw->fc.current_mode);
+
+ /* Call the necessary media_type subroutine to configure the link. */
+@@ -676,7 +676,7 @@ s32 e1000e_setup_link(struct e1000_hw *hw)
+ * control is disabled, because it does not hurt anything to
+ * initialize these registers.
+ */
+- hw_dbg(hw, "Initializing the Flow Control address, type and timer regs\n");
++ e_dbg("Initializing the Flow Control address, type and timer regs\n");
+ ew32(FCT, FLOW_CONTROL_TYPE);
+ ew32(FCAH, FLOW_CONTROL_ADDRESS_HIGH);
+ ew32(FCAL, FLOW_CONTROL_ADDRESS_LOW);
+@@ -746,7 +746,7 @@ static s32 e1000_commit_fc_settings_generic(struct e1000_hw *hw)
+ txcw = (E1000_TXCW_ANE | E1000_TXCW_FD | E1000_TXCW_PAUSE_MASK);
+ break;
+ default:
+- hw_dbg(hw, "Flow control param set incorrectly\n");
++ e_dbg("Flow control param set incorrectly\n");
+ return -E1000_ERR_CONFIG;
+ break;
+ }
+@@ -784,7 +784,7 @@ static s32 e1000_poll_fiber_serdes_link_generic(struct e1000_hw *hw)
+ break;
+ }
+ if (i == FIBER_LINK_UP_LIMIT) {
+- hw_dbg(hw, "Never got a valid link from auto-neg!!!\n");
++ e_dbg("Never got a valid link from auto-neg!!!\n");
+ mac->autoneg_failed = 1;
+ /*
+ * AutoNeg failed to achieve a link, so we'll call
+@@ -794,13 +794,13 @@ static s32 e1000_poll_fiber_serdes_link_generic(struct e1000_hw *hw)
+ */
+ ret_val = mac->ops.check_for_link(hw);
+ if (ret_val) {
+- hw_dbg(hw, "Error while checking for link\n");
++ e_dbg("Error while checking for link\n");
+ return ret_val;
+ }
+ mac->autoneg_failed = 0;
+ } else {
+ mac->autoneg_failed = 0;
+- hw_dbg(hw, "Valid Link Found\n");
++ e_dbg("Valid Link Found\n");
+ }
+
+ return 0;
+@@ -836,7 +836,7 @@ s32 e1000e_setup_fiber_serdes_link(struct e1000_hw *hw)
+ * then the link-up status bit will be set and the flow control enable
+ * bits (RFCE and TFCE) will be set according to their negotiated value.
+ */
+- hw_dbg(hw, "Auto-negotiation enabled\n");
++ e_dbg("Auto-negotiation enabled\n");
+
+ ew32(CTRL, ctrl);
+ e1e_flush();
+@@ -851,7 +851,7 @@ s32 e1000e_setup_fiber_serdes_link(struct e1000_hw *hw)
+ (er32(CTRL) & E1000_CTRL_SWDPIN1)) {
+ ret_val = e1000_poll_fiber_serdes_link_generic(hw);
+ } else {
+- hw_dbg(hw, "No signal detected\n");
++ e_dbg("No signal detected\n");
+ }
+
+ return 0;
+@@ -947,7 +947,7 @@ s32 e1000e_force_mac_fc(struct e1000_hw *hw)
+ * 3: Both Rx and Tx flow control (symmetric) is enabled.
+ * other: No other values should be possible at this point.
+ */
+- hw_dbg(hw, "hw->fc.current_mode = %u\n", hw->fc.current_mode);
++ e_dbg("hw->fc.current_mode = %u\n", hw->fc.current_mode);
+
+ switch (hw->fc.current_mode) {
+ case e1000_fc_none:
+@@ -965,7 +965,7 @@ s32 e1000e_force_mac_fc(struct e1000_hw *hw)
+ ctrl |= (E1000_CTRL_TFCE | E1000_CTRL_RFCE);
+ break;
+ default:
+- hw_dbg(hw, "Flow control param set incorrectly\n");
++ e_dbg("Flow control param set incorrectly\n");
+ return -E1000_ERR_CONFIG;
+ }
+
+@@ -1006,7 +1006,7 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw)
+ }
+
+ if (ret_val) {
+- hw_dbg(hw, "Error forcing flow control settings\n");
++ e_dbg("Error forcing flow control settings\n");
+ return ret_val;
+ }
+
+@@ -1030,7 +1030,7 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw)
+ return ret_val;
+
+ if (!(mii_status_reg & MII_SR_AUTONEG_COMPLETE)) {
+- hw_dbg(hw, "Copper PHY and Auto Neg "
++ e_dbg("Copper PHY and Auto Neg "
+ "has not completed.\n");
+ return ret_val;
+ }
+@@ -1095,10 +1095,10 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw)
+ */
+ if (hw->fc.requested_mode == e1000_fc_full) {
+ hw->fc.current_mode = e1000_fc_full;
+- hw_dbg(hw, "Flow Control = FULL.\r\n");
++ e_dbg("Flow Control = FULL.\r\n");
+ } else {
+ hw->fc.current_mode = e1000_fc_rx_pause;
+- hw_dbg(hw, "Flow Control = "
++ e_dbg("Flow Control = "
+ "RX PAUSE frames only.\r\n");
+ }
+ }
+@@ -1116,7 +1116,7 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw)
+ (mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) &&
+ (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) {
+ hw->fc.current_mode = e1000_fc_tx_pause;
+- hw_dbg(hw, "Flow Control = Tx PAUSE frames only.\r\n");
++ e_dbg("Flow Control = Tx PAUSE frames only.\r\n");
+ }
+ /*
+ * For transmitting PAUSE frames ONLY.
+@@ -1132,14 +1132,14 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw)
+ !(mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) &&
+ (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) {
+ hw->fc.current_mode = e1000_fc_rx_pause;
+- hw_dbg(hw, "Flow Control = Rx PAUSE frames only.\r\n");
++ e_dbg("Flow Control = Rx PAUSE frames only.\r\n");
+ } else {
+ /*
+ * Per the IEEE spec, at this point flow control
+ * should be disabled.
+ */
+ hw->fc.current_mode = e1000_fc_none;
+- hw_dbg(hw, "Flow Control = NONE.\r\n");
++ e_dbg("Flow Control = NONE.\r\n");
+ }
+
+ /*
+@@ -1149,7 +1149,7 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw)
+ */
+ ret_val = mac->ops.get_link_up_info(hw, &speed, &duplex);
+ if (ret_val) {
+- hw_dbg(hw, "Error getting link speed and duplex\n");
++ e_dbg("Error getting link speed and duplex\n");
+ return ret_val;
+ }
+
+@@ -1162,7 +1162,7 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw)
+ */
+ ret_val = e1000e_force_mac_fc(hw);
+ if (ret_val) {
+- hw_dbg(hw, "Error forcing flow control settings\n");
++ e_dbg("Error forcing flow control settings\n");
+ return ret_val;
+ }
+ }
+@@ -1186,21 +1186,21 @@ s32 e1000e_get_speed_and_duplex_copper(struct e1000_hw *hw, u16 *speed, u16 *dup
+ status = er32(STATUS);
+ if (status & E1000_STATUS_SPEED_1000) {
+ *speed = SPEED_1000;
+- hw_dbg(hw, "1000 Mbs, ");
++ e_dbg("1000 Mbs, ");
+ } else if (status & E1000_STATUS_SPEED_100) {
+ *speed = SPEED_100;
+- hw_dbg(hw, "100 Mbs, ");
++ e_dbg("100 Mbs, ");
+ } else {
+ *speed = SPEED_10;
+- hw_dbg(hw, "10 Mbs, ");
++ e_dbg("10 Mbs, ");
+ }
+
+ if (status & E1000_STATUS_FD) {
+ *duplex = FULL_DUPLEX;
+- hw_dbg(hw, "Full Duplex\n");
++ e_dbg("Full Duplex\n");
+ } else {
+ *duplex = HALF_DUPLEX;
+- hw_dbg(hw, "Half Duplex\n");
++ e_dbg("Half Duplex\n");
+ }
+
+ return 0;
+@@ -1246,7 +1246,7 @@ s32 e1000e_get_hw_semaphore(struct e1000_hw *hw)
+ }
+
+ if (i == timeout) {
+- hw_dbg(hw, "Driver can't access device - SMBI bit is set.\n");
++ e_dbg("Driver can't access device - SMBI bit is set.\n");
+ return -E1000_ERR_NVM;
+ }
+
+@@ -1265,7 +1265,7 @@ s32 e1000e_get_hw_semaphore(struct e1000_hw *hw)
+ if (i == timeout) {
+ /* Release semaphores */
+ e1000e_put_hw_semaphore(hw);
+- hw_dbg(hw, "Driver can't access the NVM\n");
++ e_dbg("Driver can't access the NVM\n");
+ return -E1000_ERR_NVM;
+ }
+
+@@ -1305,7 +1305,7 @@ s32 e1000e_get_auto_rd_done(struct e1000_hw *hw)
+ }
+
+ if (i == AUTO_READ_DONE_TIMEOUT) {
+- hw_dbg(hw, "Auto read by HW from NVM has not completed.\n");
++ e_dbg("Auto read by HW from NVM has not completed.\n");
+ return -E1000_ERR_RESET;
+ }
+
+@@ -1326,7 +1326,7 @@ s32 e1000e_valid_led_default(struct e1000_hw *hw, u16 *data)
+
+ ret_val = e1000_read_nvm(hw, NVM_ID_LED_SETTINGS, 1, data);
+ if (ret_val) {
+- hw_dbg(hw, "NVM Read Error\n");
++ e_dbg("NVM Read Error\n");
+ return ret_val;
+ }
+
+@@ -1580,7 +1580,7 @@ s32 e1000e_disable_pcie_master(struct e1000_hw *hw)
+ }
+
+ if (!timeout) {
+- hw_dbg(hw, "Master requests are pending.\n");
++ e_dbg("Master requests are pending.\n");
+ return -E1000_ERR_MASTER_REQUESTS_PENDING;
+ }
+
+@@ -1804,7 +1804,7 @@ s32 e1000e_acquire_nvm(struct e1000_hw *hw)
+ if (!timeout) {
+ eecd &= ~E1000_EECD_REQ;
+ ew32(EECD, eecd);
+- hw_dbg(hw, "Could not acquire NVM grant\n");
++ e_dbg("Could not acquire NVM grant\n");
+ return -E1000_ERR_NVM;
+ }
+
+@@ -1909,7 +1909,7 @@ static s32 e1000_ready_nvm_eeprom(struct e1000_hw *hw)
+ }
+
+ if (!timeout) {
+- hw_dbg(hw, "SPI NVM Status error\n");
++ e_dbg("SPI NVM Status error\n");
+ return -E1000_ERR_NVM;
+ }
+ }
+@@ -1938,7 +1938,7 @@ s32 e1000e_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
+ */
+ if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) ||
+ (words == 0)) {
+- hw_dbg(hw, "nvm parameter(s) out of bounds\n");
++ e_dbg("nvm parameter(s) out of bounds\n");
+ return -E1000_ERR_NVM;
+ }
+
+@@ -1981,7 +1981,7 @@ s32 e1000e_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
+ */
+ if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) ||
+ (words == 0)) {
+- hw_dbg(hw, "nvm parameter(s) out of bounds\n");
++ e_dbg("nvm parameter(s) out of bounds\n");
+ return -E1000_ERR_NVM;
+ }
+
+@@ -2061,7 +2061,7 @@ s32 e1000e_read_mac_addr(struct e1000_hw *hw)
+ ret_val = e1000_read_nvm(hw, NVM_ALT_MAC_ADDR_PTR, 1,
+ &mac_addr_offset);
+ if (ret_val) {
+- hw_dbg(hw, "NVM Read Error\n");
++ e_dbg("NVM Read Error\n");
+ return ret_val;
+ }
+ if (mac_addr_offset == 0xFFFF)
+@@ -2076,7 +2076,7 @@ s32 e1000e_read_mac_addr(struct e1000_hw *hw)
+ ret_val = e1000_read_nvm(hw, mac_addr_offset, 1,
+ &nvm_data);
+ if (ret_val) {
+- hw_dbg(hw, "NVM Read Error\n");
++ e_dbg("NVM Read Error\n");
+ return ret_val;
+ }
+ if (nvm_data & 0x0001)
+@@ -2091,7 +2091,7 @@ s32 e1000e_read_mac_addr(struct e1000_hw *hw)
+ offset = mac_addr_offset + (i >> 1);
+ ret_val = e1000_read_nvm(hw, offset, 1, &nvm_data);
+ if (ret_val) {
+- hw_dbg(hw, "NVM Read Error\n");
++ e_dbg("NVM Read Error\n");
+ return ret_val;
+ }
+ hw->mac.perm_addr[i] = (u8)(nvm_data & 0xFF);
+@@ -2124,14 +2124,14 @@ s32 e1000e_validate_nvm_checksum_generic(struct e1000_hw *hw)
+ for (i = 0; i < (NVM_CHECKSUM_REG + 1); i++) {
+ ret_val = e1000_read_nvm(hw, i, 1, &nvm_data);
+ if (ret_val) {
+- hw_dbg(hw, "NVM Read Error\n");
++ e_dbg("NVM Read Error\n");
+ return ret_val;
+ }
+ checksum += nvm_data;
+ }
+
+ if (checksum != (u16) NVM_SUM) {
+- hw_dbg(hw, "NVM Checksum Invalid\n");
++ e_dbg("NVM Checksum Invalid\n");
+ return -E1000_ERR_NVM;
+ }
+
+@@ -2155,7 +2155,7 @@ s32 e1000e_update_nvm_checksum_generic(struct e1000_hw *hw)
+ for (i = 0; i < NVM_CHECKSUM_REG; i++) {
+ ret_val = e1000_read_nvm(hw, i, 1, &nvm_data);
+ if (ret_val) {
+- hw_dbg(hw, "NVM Read Error while updating checksum.\n");
++ e_dbg("NVM Read Error while updating checksum.\n");
+ return ret_val;
+ }
+ checksum += nvm_data;
+@@ -2163,7 +2163,7 @@ s32 e1000e_update_nvm_checksum_generic(struct e1000_hw *hw)
+ checksum = (u16) NVM_SUM - checksum;
+ ret_val = e1000_write_nvm(hw, NVM_CHECKSUM_REG, 1, &checksum);
+ if (ret_val)
+- hw_dbg(hw, "NVM Write Error while updating checksum.\n");
++ e_dbg("NVM Write Error while updating checksum.\n");
+
+ return ret_val;
+ }
+@@ -2226,7 +2226,7 @@ static s32 e1000_mng_enable_host_if(struct e1000_hw *hw)
+ /* Check that the host interface is enabled. */
+ hicr = er32(HICR);
+ if ((hicr & E1000_HICR_EN) == 0) {
+- hw_dbg(hw, "E1000_HOST_EN bit disabled.\n");
++ e_dbg("E1000_HOST_EN bit disabled.\n");
+ return -E1000_ERR_HOST_INTERFACE_COMMAND;
+ }
+ /* check the previous command is completed */
+@@ -2238,7 +2238,7 @@ static s32 e1000_mng_enable_host_if(struct e1000_hw *hw)
+ }
+
+ if (i == E1000_MNG_DHCP_COMMAND_TIMEOUT) {
+- hw_dbg(hw, "Previous command timeout failed .\n");
++ e_dbg("Previous command timeout failed .\n");
+ return -E1000_ERR_HOST_INTERFACE_COMMAND;
+ }
+
+@@ -2509,14 +2509,14 @@ s32 e1000e_read_pba_num(struct e1000_hw *hw, u32 *pba_num)
+
+ ret_val = e1000_read_nvm(hw, NVM_PBA_OFFSET_0, 1, &nvm_data);
+ if (ret_val) {
+- hw_dbg(hw, "NVM Read Error\n");
++ e_dbg("NVM Read Error\n");
+ return ret_val;
+ }
+ *pba_num = (u32)(nvm_data << 16);
+
+ ret_val = e1000_read_nvm(hw, NVM_PBA_OFFSET_1, 1, &nvm_data);
+ if (ret_val) {
+- hw_dbg(hw, "NVM Read Error\n");
++ e_dbg("NVM Read Error\n");
+ return ret_val;
+ }
+ *pba_num |= nvm_data;
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 6e33db3..eb25674 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -65,17 +65,6 @@ static const struct e1000_info *e1000_info_tbl[] = {
+ [board_pchlan] = &e1000_pch_info,
+ };
+
+-#ifdef DEBUG
+-/**
+- * e1000_get_hw_dev_name - return device name string
+- * used by hardware layer to print debugging information
+- **/
+-char *e1000e_get_hw_dev_name(struct e1000_hw *hw)
+-{
+- return hw->adapter->netdev->name;
+-}
+-#endif
+-
+ /**
+ * e1000_desc_unused - calculate if we have unused descriptors
+ **/
+@@ -415,6 +404,7 @@ static bool e1000_clean_rx_irq(struct e1000_adapter *adapter,
+ {
+ struct net_device *netdev = adapter->netdev;
+ struct pci_dev *pdev = adapter->pdev;
++ struct e1000_hw *hw = &adapter->hw;
+ struct e1000_ring *rx_ring = adapter->rx_ring;
+ struct e1000_rx_desc *rx_desc, *next_rxd;
+ struct e1000_buffer *buffer_info, *next_buffer;
+@@ -472,8 +462,7 @@ static bool e1000_clean_rx_irq(struct e1000_adapter *adapter,
+
+ if (adapter->flags2 & FLAG2_IS_DISCARDING) {
+ /* All receives must fit into a single buffer */
+- e_dbg("%s: Receive packet consumed multiple buffers\n",
+- netdev->name);
++ e_dbg("Receive packet consumed multiple buffers\n");
+ /* recycle */
+ buffer_info->skb = skb;
+ if (status & E1000_RXD_STAT_EOP)
+@@ -694,6 +683,7 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter)
+ static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
+ int *work_done, int work_to_do)
+ {
++ struct e1000_hw *hw = &adapter->hw;
+ union e1000_rx_desc_packet_split *rx_desc, *next_rxd;
+ struct net_device *netdev = adapter->netdev;
+ struct pci_dev *pdev = adapter->pdev;
+@@ -741,8 +731,8 @@ static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
+ adapter->flags2 |= FLAG2_IS_DISCARDING;
+
+ if (adapter->flags2 & FLAG2_IS_DISCARDING) {
+- e_dbg("%s: Packet Split buffers didn't pick up the "
+- "full packet\n", netdev->name);
++ e_dbg("Packet Split buffers didn't pick up the full "
++ "packet\n");
+ dev_kfree_skb_irq(skb);
+ if (staterr & E1000_RXD_STAT_EOP)
+ adapter->flags2 &= ~FLAG2_IS_DISCARDING;
+@@ -757,8 +747,8 @@ static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
+ length = le16_to_cpu(rx_desc->wb.middle.length0);
+
+ if (!length) {
+- e_dbg("%s: Last part of the packet spanning multiple "
+- "descriptors\n", netdev->name);
++ e_dbg("Last part of the packet spanning multiple "
++ "descriptors\n");
+ dev_kfree_skb_irq(skb);
+ goto next_desc;
+ }
+@@ -2955,7 +2945,7 @@ static irqreturn_t e1000_intr_msi_test(int irq, void *data)
+ struct e1000_hw *hw = &adapter->hw;
+ u32 icr = er32(ICR);
+
+- e_dbg("%s: icr is %08X\n", netdev->name, icr);
++ e_dbg("icr is %08X\n", icr);
+ if (icr & E1000_ICR_RXSEQ) {
+ adapter->flags &= ~FLAG_MSI_TEST_FAILED;
+ wmb();
+@@ -3025,7 +3015,7 @@ static int e1000_test_msi_interrupt(struct e1000_adapter *adapter)
+ goto msi_test_failed;
+
+ /* okay so the test worked, restore settings */
+- e_dbg("%s: MSI interrupt test succeeded!\n", netdev->name);
++ e_dbg("MSI interrupt test succeeded!\n");
+ msi_test_failed:
+ e1000e_set_interrupt_capability(adapter);
+ e1000_request_irq(adapter);
+diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c
+index 77038e6..5fcfc16 100644
+--- a/drivers/net/e1000e/phy.c
++++ b/drivers/net/e1000e/phy.c
+@@ -211,7 +211,7 @@ s32 e1000e_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data)
+ u32 i, mdic = 0;
+
+ if (offset > MAX_PHY_REG_ADDRESS) {
+- hw_dbg(hw, "PHY Address %d is out of range\n", offset);
++ e_dbg("PHY Address %d is out of range\n", offset);
+ return -E1000_ERR_PARAM;
+ }
+
+@@ -238,11 +238,11 @@ s32 e1000e_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data)
+ break;
+ }
+ if (!(mdic & E1000_MDIC_READY)) {
+- hw_dbg(hw, "MDI Read did not complete\n");
++ e_dbg("MDI Read did not complete\n");
+ return -E1000_ERR_PHY;
+ }
+ if (mdic & E1000_MDIC_ERROR) {
+- hw_dbg(hw, "MDI Error\n");
++ e_dbg("MDI Error\n");
+ return -E1000_ERR_PHY;
+ }
+ *data = (u16) mdic;
+@@ -264,7 +264,7 @@ s32 e1000e_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data)
+ u32 i, mdic = 0;
+
+ if (offset > MAX_PHY_REG_ADDRESS) {
+- hw_dbg(hw, "PHY Address %d is out of range\n", offset);
++ e_dbg("PHY Address %d is out of range\n", offset);
+ return -E1000_ERR_PARAM;
+ }
+
+@@ -292,11 +292,11 @@ s32 e1000e_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data)
+ break;
+ }
+ if (!(mdic & E1000_MDIC_READY)) {
+- hw_dbg(hw, "MDI Write did not complete\n");
++ e_dbg("MDI Write did not complete\n");
+ return -E1000_ERR_PHY;
+ }
+ if (mdic & E1000_MDIC_ERROR) {
+- hw_dbg(hw, "MDI Error\n");
++ e_dbg("MDI Error\n");
+ return -E1000_ERR_PHY;
+ }
+
+@@ -776,7 +776,7 @@ s32 e1000e_copper_link_setup_m88(struct e1000_hw *hw)
+ /* Commit the changes. */
+ ret_val = e1000e_commit_phy(hw);
+ if (ret_val) {
+- hw_dbg(hw, "Error committing the PHY changes\n");
++ e_dbg("Error committing the PHY changes\n");
+ return ret_val;
+ }
+
+@@ -813,7 +813,7 @@ s32 e1000e_copper_link_setup_igp(struct e1000_hw *hw)
+
+ ret_val = e1000_phy_hw_reset(hw);
+ if (ret_val) {
+- hw_dbg(hw, "Error resetting the PHY.\n");
++ e_dbg("Error resetting the PHY.\n");
+ return ret_val;
+ }
+
+@@ -826,7 +826,7 @@ s32 e1000e_copper_link_setup_igp(struct e1000_hw *hw)
+ /* disable lplu d0 during driver init */
+ ret_val = e1000_set_d0_lplu_state(hw, 0);
+ if (ret_val) {
+- hw_dbg(hw, "Error Disabling LPLU D0\n");
++ e_dbg("Error Disabling LPLU D0\n");
+ return ret_val;
+ }
+ /* Configure mdi-mdix settings */
+@@ -962,39 +962,39 @@ static s32 e1000_phy_setup_autoneg(struct e1000_hw *hw)
+ NWAY_AR_10T_HD_CAPS);
+ mii_1000t_ctrl_reg &= ~(CR_1000T_HD_CAPS | CR_1000T_FD_CAPS);
+
+- hw_dbg(hw, "autoneg_advertised %x\n", phy->autoneg_advertised);
++ e_dbg("autoneg_advertised %x\n", phy->autoneg_advertised);
+
+ /* Do we want to advertise 10 Mb Half Duplex? */
+ if (phy->autoneg_advertised & ADVERTISE_10_HALF) {
+- hw_dbg(hw, "Advertise 10mb Half duplex\n");
++ e_dbg("Advertise 10mb Half duplex\n");
+ mii_autoneg_adv_reg |= NWAY_AR_10T_HD_CAPS;
+ }
+
+ /* Do we want to advertise 10 Mb Full Duplex? */
+ if (phy->autoneg_advertised & ADVERTISE_10_FULL) {
+- hw_dbg(hw, "Advertise 10mb Full duplex\n");
++ e_dbg("Advertise 10mb Full duplex\n");
+ mii_autoneg_adv_reg |= NWAY_AR_10T_FD_CAPS;
+ }
+
+ /* Do we want to advertise 100 Mb Half Duplex? */
+ if (phy->autoneg_advertised & ADVERTISE_100_HALF) {
+- hw_dbg(hw, "Advertise 100mb Half duplex\n");
++ e_dbg("Advertise 100mb Half duplex\n");
+ mii_autoneg_adv_reg |= NWAY_AR_100TX_HD_CAPS;
+ }
+
+ /* Do we want to advertise 100 Mb Full Duplex? */
+ if (phy->autoneg_advertised & ADVERTISE_100_FULL) {
+- hw_dbg(hw, "Advertise 100mb Full duplex\n");
++ e_dbg("Advertise 100mb Full duplex\n");
+ mii_autoneg_adv_reg |= NWAY_AR_100TX_FD_CAPS;
+ }
+
+ /* We do not allow the Phy to advertise 1000 Mb Half Duplex */
+ if (phy->autoneg_advertised & ADVERTISE_1000_HALF)
+- hw_dbg(hw, "Advertise 1000mb Half duplex request denied!\n");
++ e_dbg("Advertise 1000mb Half duplex request denied!\n");
+
+ /* Do we want to advertise 1000 Mb Full Duplex? */
+ if (phy->autoneg_advertised & ADVERTISE_1000_FULL) {
+- hw_dbg(hw, "Advertise 1000mb Full duplex\n");
++ e_dbg("Advertise 1000mb Full duplex\n");
+ mii_1000t_ctrl_reg |= CR_1000T_FD_CAPS;
+ }
+
+@@ -1053,7 +1053,7 @@ static s32 e1000_phy_setup_autoneg(struct e1000_hw *hw)
+ mii_autoneg_adv_reg |= (NWAY_AR_ASM_DIR | NWAY_AR_PAUSE);
+ break;
+ default:
+- hw_dbg(hw, "Flow control param set incorrectly\n");
++ e_dbg("Flow control param set incorrectly\n");
+ ret_val = -E1000_ERR_CONFIG;
+ return ret_val;
+ }
+@@ -1062,7 +1062,7 @@ static s32 e1000_phy_setup_autoneg(struct e1000_hw *hw)
+ if (ret_val)
+ return ret_val;
+
+- hw_dbg(hw, "Auto-Neg Advertising %x\n", mii_autoneg_adv_reg);
++ e_dbg("Auto-Neg Advertising %x\n", mii_autoneg_adv_reg);
+
+ if (phy->autoneg_mask & ADVERTISE_1000_FULL) {
+ ret_val = e1e_wphy(hw, PHY_1000T_CTRL, mii_1000t_ctrl_reg);
+@@ -1099,13 +1099,13 @@ static s32 e1000_copper_link_autoneg(struct e1000_hw *hw)
+ if (phy->autoneg_advertised == 0)
+ phy->autoneg_advertised = phy->autoneg_mask;
+
+- hw_dbg(hw, "Reconfiguring auto-neg advertisement params\n");
++ e_dbg("Reconfiguring auto-neg advertisement params\n");
+ ret_val = e1000_phy_setup_autoneg(hw);
+ if (ret_val) {
+- hw_dbg(hw, "Error Setting up Auto-Negotiation\n");
++ e_dbg("Error Setting up Auto-Negotiation\n");
+ return ret_val;
+ }
+- hw_dbg(hw, "Restarting Auto-Neg\n");
++ e_dbg("Restarting Auto-Neg\n");
+
+ /*
+ * Restart auto-negotiation by setting the Auto Neg Enable bit and
+@@ -1127,7 +1127,7 @@ static s32 e1000_copper_link_autoneg(struct e1000_hw *hw)
+ if (phy->autoneg_wait_to_complete) {
+ ret_val = e1000_wait_autoneg(hw);
+ if (ret_val) {
+- hw_dbg(hw, "Error while waiting for "
++ e_dbg("Error while waiting for "
+ "autoneg to complete\n");
+ return ret_val;
+ }
+@@ -1165,10 +1165,10 @@ s32 e1000e_setup_copper_link(struct e1000_hw *hw)
+ * PHY will be set to 10H, 10F, 100H or 100F
+ * depending on user settings.
+ */
+- hw_dbg(hw, "Forcing Speed and Duplex\n");
++ e_dbg("Forcing Speed and Duplex\n");
+ ret_val = e1000_phy_force_speed_duplex(hw);
+ if (ret_val) {
+- hw_dbg(hw, "Error Forcing Speed and Duplex\n");
++ e_dbg("Error Forcing Speed and Duplex\n");
+ return ret_val;
+ }
+ }
+@@ -1185,11 +1185,11 @@ s32 e1000e_setup_copper_link(struct e1000_hw *hw)
+ return ret_val;
+
+ if (link) {
+- hw_dbg(hw, "Valid link established!!!\n");
++ e_dbg("Valid link established!!!\n");
+ e1000e_config_collision_dist(hw);
+ ret_val = e1000e_config_fc_after_link_up(hw);
+ } else {
+- hw_dbg(hw, "Unable to establish link!!!\n");
++ e_dbg("Unable to establish link!!!\n");
+ }
+
+ return ret_val;
+@@ -1235,12 +1235,12 @@ s32 e1000e_phy_force_speed_duplex_igp(struct e1000_hw *hw)
+ if (ret_val)
+ return ret_val;
+
+- hw_dbg(hw, "IGP PSCR: %X\n", phy_data);
++ e_dbg("IGP PSCR: %X\n", phy_data);
+
+ udelay(1);
+
+ if (phy->autoneg_wait_to_complete) {
+- hw_dbg(hw, "Waiting for forced speed/duplex link on IGP phy.\n");
++ e_dbg("Waiting for forced speed/duplex link on IGP phy.\n");
+
+ ret_val = e1000e_phy_has_link_generic(hw,
+ PHY_FORCE_LIMIT,
+@@ -1250,7 +1250,7 @@ s32 e1000e_phy_force_speed_duplex_igp(struct e1000_hw *hw)
+ return ret_val;
+
+ if (!link)
+- hw_dbg(hw, "Link taking longer than expected.\n");
++ e_dbg("Link taking longer than expected.\n");
+
+ /* Try once more */
+ ret_val = e1000e_phy_has_link_generic(hw,
+@@ -1294,7 +1294,7 @@ s32 e1000e_phy_force_speed_duplex_m88(struct e1000_hw *hw)
+ if (ret_val)
+ return ret_val;
+
+- hw_dbg(hw, "M88E1000 PSCR: %X\n", phy_data);
++ e_dbg("M88E1000 PSCR: %X\n", phy_data);
+
+ ret_val = e1e_rphy(hw, PHY_CONTROL, &phy_data);
+ if (ret_val)
+@@ -1312,7 +1312,7 @@ s32 e1000e_phy_force_speed_duplex_m88(struct e1000_hw *hw)
+ return ret_val;
+
+ if (phy->autoneg_wait_to_complete) {
+- hw_dbg(hw, "Waiting for forced speed/duplex link on M88 phy.\n");
++ e_dbg("Waiting for forced speed/duplex link on M88 phy.\n");
+
+ ret_val = e1000e_phy_has_link_generic(hw, PHY_FORCE_LIMIT,
+ 100000, &link);
+@@ -1403,11 +1403,11 @@ void e1000e_phy_force_speed_duplex_setup(struct e1000_hw *hw, u16 *phy_ctrl)
+ if (mac->forced_speed_duplex & E1000_ALL_HALF_DUPLEX) {
+ ctrl &= ~E1000_CTRL_FD;
+ *phy_ctrl &= ~MII_CR_FULL_DUPLEX;
+- hw_dbg(hw, "Half Duplex\n");
++ e_dbg("Half Duplex\n");
+ } else {
+ ctrl |= E1000_CTRL_FD;
+ *phy_ctrl |= MII_CR_FULL_DUPLEX;
+- hw_dbg(hw, "Full Duplex\n");
++ e_dbg("Full Duplex\n");
+ }
+
+ /* Forcing 10mb or 100mb? */
+@@ -1415,12 +1415,12 @@ void e1000e_phy_force_speed_duplex_setup(struct e1000_hw *hw, u16 *phy_ctrl)
+ ctrl |= E1000_CTRL_SPD_100;
+ *phy_ctrl |= MII_CR_SPEED_100;
+ *phy_ctrl &= ~(MII_CR_SPEED_1000 | MII_CR_SPEED_10);
+- hw_dbg(hw, "Forcing 100mb\n");
++ e_dbg("Forcing 100mb\n");
+ } else {
+ ctrl &= ~(E1000_CTRL_SPD_1000 | E1000_CTRL_SPD_100);
+ *phy_ctrl |= MII_CR_SPEED_10;
+ *phy_ctrl &= ~(MII_CR_SPEED_1000 | MII_CR_SPEED_100);
+- hw_dbg(hw, "Forcing 10mb\n");
++ e_dbg("Forcing 10mb\n");
+ }
+
+ e1000e_config_collision_dist(hw);
+@@ -1816,7 +1816,7 @@ s32 e1000e_get_phy_info_m88(struct e1000_hw *hw)
+ bool link;
+
+ if (hw->phy.media_type != e1000_media_type_copper) {
+- hw_dbg(hw, "Phy info is only valid for copper media\n");
++ e_dbg("Phy info is only valid for copper media\n");
+ return -E1000_ERR_CONFIG;
+ }
+
+@@ -1825,7 +1825,7 @@ s32 e1000e_get_phy_info_m88(struct e1000_hw *hw)
+ return ret_val;
+
+ if (!link) {
+- hw_dbg(hw, "Phy info is only valid if link is up\n");
++ e_dbg("Phy info is only valid if link is up\n");
+ return -E1000_ERR_CONFIG;
+ }
+
+@@ -1893,7 +1893,7 @@ s32 e1000e_get_phy_info_igp(struct e1000_hw *hw)
+ return ret_val;
+
+ if (!link) {
+- hw_dbg(hw, "Phy info is only valid if link is up\n");
++ e_dbg("Phy info is only valid if link is up\n");
+ return -E1000_ERR_CONFIG;
+ }
+
+@@ -2021,7 +2021,7 @@ s32 e1000e_get_cfg_done(struct e1000_hw *hw)
+ **/
+ s32 e1000e_phy_init_script_igp3(struct e1000_hw *hw)
+ {
+- hw_dbg(hw, "Running IGP 3 PHY init script\n");
++ e_dbg("Running IGP 3 PHY init script\n");
+
+ /* PHY init IGP 3 */
+ /* Enable rise/fall, 10-mode work in class-A */
+@@ -2464,7 +2464,7 @@ static s32 e1000_access_phy_wakeup_reg_bm(struct e1000_hw *hw, u32 offset,
+ /* Gig must be disabled for MDIO accesses to page 800 */
+ if ((hw->mac.type == e1000_pchlan) &&
+ (!(er32(PHY_CTRL) & E1000_PHY_CTRL_GBE_DISABLE)))
+- hw_dbg(hw, "Attempting to access page 800 while gig enabled\n");
++ e_dbg("Attempting to access page 800 while gig enabled\n");
+
+ /* All operations in this function are phy address 1 */
+ hw->phy.addr = 1;
+@@ -2872,7 +2872,7 @@ static s32 e1000_access_phy_debug_regs_hv(struct e1000_hw *hw, u32 offset,
+ /* masking with 0x3F to remove the page from offset */
+ ret_val = e1000e_write_phy_reg_mdic(hw, addr_reg, (u16)offset & 0x3F);
+ if (ret_val) {
+- hw_dbg(hw, "Could not write PHY the HV address register\n");
++ e_dbg("Could not write PHY the HV address register\n");
+ goto out;
+ }
+
+@@ -2883,7 +2883,7 @@ static s32 e1000_access_phy_debug_regs_hv(struct e1000_hw *hw, u32 offset,
+ ret_val = e1000e_write_phy_reg_mdic(hw, data_reg, *data);
+
+ if (ret_val) {
+- hw_dbg(hw, "Could not read data value from HV data register\n");
++ e_dbg("Could not read data value from HV data register\n");
+ goto out;
+ }
+
+@@ -3009,12 +3009,12 @@ s32 e1000_phy_force_speed_duplex_82577(struct e1000_hw *hw)
+ if (ret_val)
+ goto out;
+
+- hw_dbg(hw, "I82577_PHY_CTRL_2: %X\n", phy_data);
++ e_dbg("I82577_PHY_CTRL_2: %X\n", phy_data);
+
+ udelay(1);
+
+ if (phy->autoneg_wait_to_complete) {
+- hw_dbg(hw, "Waiting for forced speed/duplex link on 82577 phy\n");
++ e_dbg("Waiting for forced speed/duplex link on 82577 phy\n");
+
+ ret_val = e1000e_phy_has_link_generic(hw,
+ PHY_FORCE_LIMIT,
+@@ -3024,7 +3024,7 @@ s32 e1000_phy_force_speed_duplex_82577(struct e1000_hw *hw)
+ goto out;
+
+ if (!link)
+- hw_dbg(hw, "Link taking longer than expected.\n");
++ e_dbg("Link taking longer than expected.\n");
+
+ /* Try once more */
+ ret_val = e1000e_phy_has_link_generic(hw,
+@@ -3060,7 +3060,7 @@ s32 e1000_get_phy_info_82577(struct e1000_hw *hw)
+ goto out;
+
+ if (!link) {
+- hw_dbg(hw, "Phy info is only valid if link is up\n");
++ e_dbg("Phy info is only valid if link is up\n");
+ ret_val = -E1000_ERR_CONFIG;
+ goto out;
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0016-e1000e-cleanup-ops-function-pointers.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0016-e1000e-cleanup-ops-function-pointers.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,1250 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Fri, 20 Nov 2009 23:25:26 +0000
+Subject: [PATCH 016/166] e1000e: cleanup ops function pointers
+
+commit 94d8186a693284344ee5cb9734086c7a2370241a upstream.
+
+The phy and nvm operations structures have function pointers that contain
+"phy" and "nvm" in the pointer names which are redundant since the
+structures are already obviously in phy and nvm structures.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Adjust to apply on top of cherry-picked fixes in 2.6.32.y]
+---
+ drivers/net/e1000e/82571.c | 54 +++++++-------
+ drivers/net/e1000e/e1000.h | 16 ++--
+ drivers/net/e1000e/es2lan.c | 26 ++++----
+ drivers/net/e1000e/hw.h | 32 ++++----
+ drivers/net/e1000e/ich8lan.c | 156 +++++++++++++++++++++---------------------
+ drivers/net/e1000e/lib.c | 6 +-
+ drivers/net/e1000e/netdev.c | 4 +-
+ drivers/net/e1000e/phy.c | 106 ++++++++++++++--------------
+ 8 files changed, 199 insertions(+), 201 deletions(-)
+
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+index 680b7c7..6fe1b3c 100644
+--- a/drivers/net/e1000e/82571.c
++++ b/drivers/net/e1000e/82571.c
+@@ -1671,64 +1671,64 @@ static struct e1000_mac_operations e82571_mac_ops = {
+ };
+
+ static struct e1000_phy_operations e82_phy_ops_igp = {
+- .acquire_phy = e1000_get_hw_semaphore_82571,
++ .acquire = e1000_get_hw_semaphore_82571,
+ .check_reset_block = e1000e_check_reset_block_generic,
+- .commit_phy = NULL,
++ .commit = NULL,
+ .force_speed_duplex = e1000e_phy_force_speed_duplex_igp,
+ .get_cfg_done = e1000_get_cfg_done_82571,
+ .get_cable_length = e1000e_get_cable_length_igp_2,
+- .get_phy_info = e1000e_get_phy_info_igp,
+- .read_phy_reg = e1000e_read_phy_reg_igp,
+- .release_phy = e1000_put_hw_semaphore_82571,
+- .reset_phy = e1000e_phy_hw_reset_generic,
++ .get_info = e1000e_get_phy_info_igp,
++ .read_reg = e1000e_read_phy_reg_igp,
++ .release = e1000_put_hw_semaphore_82571,
++ .reset = e1000e_phy_hw_reset_generic,
+ .set_d0_lplu_state = e1000_set_d0_lplu_state_82571,
+ .set_d3_lplu_state = e1000e_set_d3_lplu_state,
+- .write_phy_reg = e1000e_write_phy_reg_igp,
++ .write_reg = e1000e_write_phy_reg_igp,
+ .cfg_on_link_up = NULL,
+ };
+
+ static struct e1000_phy_operations e82_phy_ops_m88 = {
+- .acquire_phy = e1000_get_hw_semaphore_82571,
++ .acquire = e1000_get_hw_semaphore_82571,
+ .check_reset_block = e1000e_check_reset_block_generic,
+- .commit_phy = e1000e_phy_sw_reset,
++ .commit = e1000e_phy_sw_reset,
+ .force_speed_duplex = e1000e_phy_force_speed_duplex_m88,
+ .get_cfg_done = e1000e_get_cfg_done,
+ .get_cable_length = e1000e_get_cable_length_m88,
+- .get_phy_info = e1000e_get_phy_info_m88,
+- .read_phy_reg = e1000e_read_phy_reg_m88,
+- .release_phy = e1000_put_hw_semaphore_82571,
+- .reset_phy = e1000e_phy_hw_reset_generic,
++ .get_info = e1000e_get_phy_info_m88,
++ .read_reg = e1000e_read_phy_reg_m88,
++ .release = e1000_put_hw_semaphore_82571,
++ .reset = e1000e_phy_hw_reset_generic,
+ .set_d0_lplu_state = e1000_set_d0_lplu_state_82571,
+ .set_d3_lplu_state = e1000e_set_d3_lplu_state,
+- .write_phy_reg = e1000e_write_phy_reg_m88,
++ .write_reg = e1000e_write_phy_reg_m88,
+ .cfg_on_link_up = NULL,
+ };
+
+ static struct e1000_phy_operations e82_phy_ops_bm = {
+- .acquire_phy = e1000_get_hw_semaphore_82571,
++ .acquire = e1000_get_hw_semaphore_82571,
+ .check_reset_block = e1000e_check_reset_block_generic,
+- .commit_phy = e1000e_phy_sw_reset,
++ .commit = e1000e_phy_sw_reset,
+ .force_speed_duplex = e1000e_phy_force_speed_duplex_m88,
+ .get_cfg_done = e1000e_get_cfg_done,
+ .get_cable_length = e1000e_get_cable_length_m88,
+- .get_phy_info = e1000e_get_phy_info_m88,
+- .read_phy_reg = e1000e_read_phy_reg_bm2,
+- .release_phy = e1000_put_hw_semaphore_82571,
+- .reset_phy = e1000e_phy_hw_reset_generic,
++ .get_info = e1000e_get_phy_info_m88,
++ .read_reg = e1000e_read_phy_reg_bm2,
++ .release = e1000_put_hw_semaphore_82571,
++ .reset = e1000e_phy_hw_reset_generic,
+ .set_d0_lplu_state = e1000_set_d0_lplu_state_82571,
+ .set_d3_lplu_state = e1000e_set_d3_lplu_state,
+- .write_phy_reg = e1000e_write_phy_reg_bm2,
++ .write_reg = e1000e_write_phy_reg_bm2,
+ .cfg_on_link_up = NULL,
+ };
+
+ static struct e1000_nvm_operations e82571_nvm_ops = {
+- .acquire_nvm = e1000_acquire_nvm_82571,
+- .read_nvm = e1000e_read_nvm_eerd,
+- .release_nvm = e1000_release_nvm_82571,
+- .update_nvm = e1000_update_nvm_checksum_82571,
++ .acquire = e1000_acquire_nvm_82571,
++ .read = e1000e_read_nvm_eerd,
++ .release = e1000_release_nvm_82571,
++ .update = e1000_update_nvm_checksum_82571,
+ .valid_led_default = e1000_valid_led_default_82571,
+- .validate_nvm = e1000_validate_nvm_checksum_82571,
+- .write_nvm = e1000_write_nvm_82571,
++ .validate = e1000_validate_nvm_checksum_82571,
++ .write = e1000_write_nvm_82571,
+ };
+
+ struct e1000_info e1000_82571_info = {
+diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
+index f1af1ed..a0e948f 100644
+--- a/drivers/net/e1000e/e1000.h
++++ b/drivers/net/e1000e/e1000.h
+@@ -587,7 +587,7 @@ extern s32 e1000_get_cable_length_82577(struct e1000_hw *hw);
+
+ static inline s32 e1000_phy_hw_reset(struct e1000_hw *hw)
+ {
+- return hw->phy.ops.reset_phy(hw);
++ return hw->phy.ops.reset(hw);
+ }
+
+ static inline s32 e1000_check_reset_block(struct e1000_hw *hw)
+@@ -597,12 +597,12 @@ static inline s32 e1000_check_reset_block(struct e1000_hw *hw)
+
+ static inline s32 e1e_rphy(struct e1000_hw *hw, u32 offset, u16 *data)
+ {
+- return hw->phy.ops.read_phy_reg(hw, offset, data);
++ return hw->phy.ops.read_reg(hw, offset, data);
+ }
+
+ static inline s32 e1e_wphy(struct e1000_hw *hw, u32 offset, u16 data)
+ {
+- return hw->phy.ops.write_phy_reg(hw, offset, data);
++ return hw->phy.ops.write_reg(hw, offset, data);
+ }
+
+ static inline s32 e1000_get_cable_length(struct e1000_hw *hw)
+@@ -622,27 +622,27 @@ extern s32 e1000e_read_mac_addr(struct e1000_hw *hw);
+
+ static inline s32 e1000_validate_nvm_checksum(struct e1000_hw *hw)
+ {
+- return hw->nvm.ops.validate_nvm(hw);
++ return hw->nvm.ops.validate(hw);
+ }
+
+ static inline s32 e1000e_update_nvm_checksum(struct e1000_hw *hw)
+ {
+- return hw->nvm.ops.update_nvm(hw);
++ return hw->nvm.ops.update(hw);
+ }
+
+ static inline s32 e1000_read_nvm(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
+ {
+- return hw->nvm.ops.read_nvm(hw, offset, words, data);
++ return hw->nvm.ops.read(hw, offset, words, data);
+ }
+
+ static inline s32 e1000_write_nvm(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
+ {
+- return hw->nvm.ops.write_nvm(hw, offset, words, data);
++ return hw->nvm.ops.write(hw, offset, words, data);
+ }
+
+ static inline s32 e1000_get_phy_info(struct e1000_hw *hw)
+ {
+- return hw->phy.ops.get_phy_info(hw);
++ return hw->phy.ops.get_info(hw);
+ }
+
+ static inline s32 e1000e_check_mng_mode(struct e1000_hw *hw)
+diff --git a/drivers/net/e1000e/es2lan.c b/drivers/net/e1000e/es2lan.c
+index f5601c5..d024e20 100644
+--- a/drivers/net/e1000e/es2lan.c
++++ b/drivers/net/e1000e/es2lan.c
+@@ -1378,30 +1378,30 @@ static struct e1000_mac_operations es2_mac_ops = {
+ };
+
+ static struct e1000_phy_operations es2_phy_ops = {
+- .acquire_phy = e1000_acquire_phy_80003es2lan,
++ .acquire = e1000_acquire_phy_80003es2lan,
+ .check_reset_block = e1000e_check_reset_block_generic,
+- .commit_phy = e1000e_phy_sw_reset,
++ .commit = e1000e_phy_sw_reset,
+ .force_speed_duplex = e1000_phy_force_speed_duplex_80003es2lan,
+ .get_cfg_done = e1000_get_cfg_done_80003es2lan,
+ .get_cable_length = e1000_get_cable_length_80003es2lan,
+- .get_phy_info = e1000e_get_phy_info_m88,
+- .read_phy_reg = e1000_read_phy_reg_gg82563_80003es2lan,
+- .release_phy = e1000_release_phy_80003es2lan,
+- .reset_phy = e1000e_phy_hw_reset_generic,
++ .get_info = e1000e_get_phy_info_m88,
++ .read_reg = e1000_read_phy_reg_gg82563_80003es2lan,
++ .release = e1000_release_phy_80003es2lan,
++ .reset = e1000e_phy_hw_reset_generic,
+ .set_d0_lplu_state = NULL,
+ .set_d3_lplu_state = e1000e_set_d3_lplu_state,
+- .write_phy_reg = e1000_write_phy_reg_gg82563_80003es2lan,
++ .write_reg = e1000_write_phy_reg_gg82563_80003es2lan,
+ .cfg_on_link_up = e1000_cfg_on_link_up_80003es2lan,
+ };
+
+ static struct e1000_nvm_operations es2_nvm_ops = {
+- .acquire_nvm = e1000_acquire_nvm_80003es2lan,
+- .read_nvm = e1000e_read_nvm_eerd,
+- .release_nvm = e1000_release_nvm_80003es2lan,
+- .update_nvm = e1000e_update_nvm_checksum_generic,
++ .acquire = e1000_acquire_nvm_80003es2lan,
++ .read = e1000e_read_nvm_eerd,
++ .release = e1000_release_nvm_80003es2lan,
++ .update = e1000e_update_nvm_checksum_generic,
+ .valid_led_default = e1000e_valid_led_default,
+- .validate_nvm = e1000e_validate_nvm_checksum_generic,
+- .write_nvm = e1000_write_nvm_80003es2lan,
++ .validate = e1000e_validate_nvm_checksum_generic,
++ .write = e1000_write_nvm_80003es2lan,
+ };
+
+ struct e1000_info e1000_es2_info = {
+diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h
+index d9e85d6..06d4f0a 100644
+--- a/drivers/net/e1000e/hw.h
++++ b/drivers/net/e1000e/hw.h
+@@ -756,34 +756,34 @@ struct e1000_mac_operations {
+
+ /* Function pointers for the PHY. */
+ struct e1000_phy_operations {
+- s32 (*acquire_phy)(struct e1000_hw *);
++ s32 (*acquire)(struct e1000_hw *);
++ s32 (*cfg_on_link_up)(struct e1000_hw *);
+ s32 (*check_polarity)(struct e1000_hw *);
+ s32 (*check_reset_block)(struct e1000_hw *);
+- s32 (*commit_phy)(struct e1000_hw *);
++ s32 (*commit)(struct e1000_hw *);
+ s32 (*force_speed_duplex)(struct e1000_hw *);
+ s32 (*get_cfg_done)(struct e1000_hw *hw);
+ s32 (*get_cable_length)(struct e1000_hw *);
+- s32 (*get_phy_info)(struct e1000_hw *);
+- s32 (*read_phy_reg)(struct e1000_hw *, u32, u16 *);
+- s32 (*read_phy_reg_locked)(struct e1000_hw *, u32, u16 *);
+- void (*release_phy)(struct e1000_hw *);
+- s32 (*reset_phy)(struct e1000_hw *);
++ s32 (*get_info)(struct e1000_hw *);
++ s32 (*read_reg)(struct e1000_hw *, u32, u16 *);
++ s32 (*read_reg_locked)(struct e1000_hw *, u32, u16 *);
++ void (*release)(struct e1000_hw *);
++ s32 (*reset)(struct e1000_hw *);
+ s32 (*set_d0_lplu_state)(struct e1000_hw *, bool);
+ s32 (*set_d3_lplu_state)(struct e1000_hw *, bool);
+- s32 (*write_phy_reg)(struct e1000_hw *, u32, u16);
+- s32 (*write_phy_reg_locked)(struct e1000_hw *, u32, u16);
+- s32 (*cfg_on_link_up)(struct e1000_hw *);
++ s32 (*write_reg)(struct e1000_hw *, u32, u16);
++ s32 (*write_reg_locked)(struct e1000_hw *, u32, u16);
+ };
+
+ /* Function pointers for the NVM. */
+ struct e1000_nvm_operations {
+- s32 (*acquire_nvm)(struct e1000_hw *);
+- s32 (*read_nvm)(struct e1000_hw *, u16, u16, u16 *);
+- void (*release_nvm)(struct e1000_hw *);
+- s32 (*update_nvm)(struct e1000_hw *);
++ s32 (*acquire)(struct e1000_hw *);
++ s32 (*read)(struct e1000_hw *, u16, u16, u16 *);
++ void (*release)(struct e1000_hw *);
++ s32 (*update)(struct e1000_hw *);
+ s32 (*valid_led_default)(struct e1000_hw *, u16 *);
+- s32 (*validate_nvm)(struct e1000_hw *);
+- s32 (*write_nvm)(struct e1000_hw *, u16, u16, u16 *);
++ s32 (*validate)(struct e1000_hw *);
++ s32 (*write)(struct e1000_hw *, u16, u16, u16 *);
+ };
+
+ struct e1000_mac_info {
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index 448e099..4657b11 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -260,12 +260,12 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw)
+ phy->reset_delay_us = 100;
+
+ phy->ops.check_polarity = e1000_check_polarity_ife_ich8lan;
+- phy->ops.read_phy_reg = e1000_read_phy_reg_hv;
+- phy->ops.read_phy_reg_locked = e1000_read_phy_reg_hv_locked;
++ phy->ops.read_reg = e1000_read_phy_reg_hv;
++ phy->ops.read_reg_locked = e1000_read_phy_reg_hv_locked;
+ phy->ops.set_d0_lplu_state = e1000_set_lplu_state_pchlan;
+ phy->ops.set_d3_lplu_state = e1000_set_lplu_state_pchlan;
+- phy->ops.write_phy_reg = e1000_write_phy_reg_hv;
+- phy->ops.write_phy_reg_locked = e1000_write_phy_reg_hv_locked;
++ phy->ops.write_reg = e1000_write_phy_reg_hv;
++ phy->ops.write_reg_locked = e1000_write_phy_reg_hv_locked;
+ phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT;
+
+ /*
+@@ -287,8 +287,8 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw)
+ phy->ops.force_speed_duplex =
+ e1000_phy_force_speed_duplex_82577;
+ phy->ops.get_cable_length = e1000_get_cable_length_82577;
+- phy->ops.get_phy_info = e1000_get_phy_info_82577;
+- phy->ops.commit_phy = e1000e_phy_sw_reset;
++ phy->ops.get_info = e1000_get_phy_info_82577;
++ phy->ops.commit = e1000e_phy_sw_reset;
+ }
+
+ out:
+@@ -316,8 +316,8 @@ static s32 e1000_init_phy_params_ich8lan(struct e1000_hw *hw)
+ */
+ ret_val = e1000e_determine_phy_address(hw);
+ if (ret_val) {
+- hw->phy.ops.write_phy_reg = e1000e_write_phy_reg_bm;
+- hw->phy.ops.read_phy_reg = e1000e_read_phy_reg_bm;
++ phy->ops.write_reg = e1000e_write_phy_reg_bm;
++ phy->ops.read_reg = e1000e_read_phy_reg_bm;
+ ret_val = e1000e_determine_phy_address(hw);
+ if (ret_val)
+ return ret_val;
+@@ -337,8 +337,8 @@ static s32 e1000_init_phy_params_ich8lan(struct e1000_hw *hw)
+ case IGP03E1000_E_PHY_ID:
+ phy->type = e1000_phy_igp_3;
+ phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT;
+- phy->ops.read_phy_reg_locked = e1000e_read_phy_reg_igp_locked;
+- phy->ops.write_phy_reg_locked = e1000e_write_phy_reg_igp_locked;
++ phy->ops.read_reg_locked = e1000e_read_phy_reg_igp_locked;
++ phy->ops.write_reg_locked = e1000e_write_phy_reg_igp_locked;
+ break;
+ case IFE_E_PHY_ID:
+ case IFE_PLUS_E_PHY_ID:
+@@ -349,9 +349,9 @@ static s32 e1000_init_phy_params_ich8lan(struct e1000_hw *hw)
+ case BME1000_E_PHY_ID:
+ phy->type = e1000_phy_bm;
+ phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT;
+- hw->phy.ops.read_phy_reg = e1000e_read_phy_reg_bm;
+- hw->phy.ops.write_phy_reg = e1000e_write_phy_reg_bm;
+- hw->phy.ops.commit_phy = e1000e_phy_sw_reset;
++ phy->ops.read_reg = e1000e_read_phy_reg_bm;
++ phy->ops.write_reg = e1000e_write_phy_reg_bm;
++ phy->ops.commit = e1000e_phy_sw_reset;
+ break;
+ default:
+ return -E1000_ERR_PHY;
+@@ -827,7 +827,7 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw)
+ s32 ret_val;
+ u16 word_addr, reg_data, reg_addr, phy_page = 0;
+
+- ret_val = hw->phy.ops.acquire_phy(hw);
++ ret_val = hw->phy.ops.acquire(hw);
+ if (ret_val)
+ return ret_val;
+
+@@ -923,7 +923,7 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw)
+ reg_addr &= PHY_REG_MASK;
+ reg_addr |= phy_page;
+
+- ret_val = phy->ops.write_phy_reg_locked(hw,
++ ret_val = phy->ops.write_reg_locked(hw,
+ (u32)reg_addr,
+ reg_data);
+ if (ret_val)
+@@ -932,7 +932,7 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw)
+ }
+
+ out:
+- hw->phy.ops.release_phy(hw);
++ hw->phy.ops.release(hw);
+ return ret_val;
+ }
+
+@@ -956,15 +956,14 @@ static s32 e1000_k1_gig_workaround_hv(struct e1000_hw *hw, bool link)
+ goto out;
+
+ /* Wrap the whole flow with the sw flag */
+- ret_val = hw->phy.ops.acquire_phy(hw);
++ ret_val = hw->phy.ops.acquire(hw);
+ if (ret_val)
+ goto out;
+
+ /* Disable K1 when link is 1Gbps, otherwise use the NVM setting */
+ if (link) {
+ if (hw->phy.type == e1000_phy_82578) {
+- ret_val = hw->phy.ops.read_phy_reg_locked(hw,
+- BM_CS_STATUS,
++ ret_val = hw->phy.ops.read_reg_locked(hw, BM_CS_STATUS,
+ &status_reg);
+ if (ret_val)
+ goto release;
+@@ -980,8 +979,7 @@ static s32 e1000_k1_gig_workaround_hv(struct e1000_hw *hw, bool link)
+ }
+
+ if (hw->phy.type == e1000_phy_82577) {
+- ret_val = hw->phy.ops.read_phy_reg_locked(hw,
+- HV_M_STATUS,
++ ret_val = hw->phy.ops.read_reg_locked(hw, HV_M_STATUS,
+ &status_reg);
+ if (ret_val)
+ goto release;
+@@ -997,14 +995,14 @@ static s32 e1000_k1_gig_workaround_hv(struct e1000_hw *hw, bool link)
+ }
+
+ /* Link stall fix for link up */
+- ret_val = hw->phy.ops.write_phy_reg_locked(hw, PHY_REG(770, 19),
++ ret_val = hw->phy.ops.write_reg_locked(hw, PHY_REG(770, 19),
+ 0x0100);
+ if (ret_val)
+ goto release;
+
+ } else {
+ /* Link stall fix for link down */
+- ret_val = hw->phy.ops.write_phy_reg_locked(hw, PHY_REG(770, 19),
++ ret_val = hw->phy.ops.write_reg_locked(hw, PHY_REG(770, 19),
+ 0x4100);
+ if (ret_val)
+ goto release;
+@@ -1013,7 +1011,7 @@ static s32 e1000_k1_gig_workaround_hv(struct e1000_hw *hw, bool link)
+ ret_val = e1000_configure_k1_ich8lan(hw, k1_enable);
+
+ release:
+- hw->phy.ops.release_phy(hw);
++ hw->phy.ops.release(hw);
+ out:
+ return ret_val;
+ }
+@@ -1089,7 +1087,7 @@ static s32 e1000_oem_bits_config_ich8lan(struct e1000_hw *hw, bool d0_state)
+ if (hw->mac.type != e1000_pchlan)
+ return ret_val;
+
+- ret_val = hw->phy.ops.acquire_phy(hw);
++ ret_val = hw->phy.ops.acquire(hw);
+ if (ret_val)
+ return ret_val;
+
+@@ -1103,7 +1101,7 @@ static s32 e1000_oem_bits_config_ich8lan(struct e1000_hw *hw, bool d0_state)
+
+ mac_reg = er32(PHY_CTRL);
+
+- ret_val = hw->phy.ops.read_phy_reg_locked(hw, HV_OEM_BITS, &oem_reg);
++ ret_val = hw->phy.ops.read_reg_locked(hw, HV_OEM_BITS, &oem_reg);
+ if (ret_val)
+ goto out;
+
+@@ -1125,10 +1123,10 @@ static s32 e1000_oem_bits_config_ich8lan(struct e1000_hw *hw, bool d0_state)
+ /* Restart auto-neg to activate the bits */
+ if (!e1000_check_reset_block(hw))
+ oem_reg |= HV_OEM_BITS_RESTART_AN;
+- ret_val = hw->phy.ops.write_phy_reg_locked(hw, HV_OEM_BITS, oem_reg);
++ ret_val = hw->phy.ops.write_reg_locked(hw, HV_OEM_BITS, oem_reg);
+
+ out:
+- hw->phy.ops.release_phy(hw);
++ hw->phy.ops.release(hw);
+
+ return ret_val;
+ }
+@@ -1171,7 +1169,7 @@ static s32 e1000_hv_phy_workarounds_ich8lan(struct e1000_hw *hw)
+ }
+
+ /* Select page 0 */
+- ret_val = hw->phy.ops.acquire_phy(hw);
++ ret_val = hw->phy.ops.acquire(hw);
+ if (ret_val)
+ return ret_val;
+
+@@ -1179,7 +1177,7 @@ static s32 e1000_hv_phy_workarounds_ich8lan(struct e1000_hw *hw)
+ ret_val = e1000e_write_phy_reg_mdic(hw, IGP01E1000_PHY_PAGE_SELECT, 0);
+ if (ret_val)
+ goto out;
+- hw->phy.ops.release_phy(hw);
++ hw->phy.ops.release(hw);
+
+ /*
+ * Configure the K1 Si workaround during phy reset assuming there is
+@@ -1679,7 +1677,7 @@ static s32 e1000_read_nvm_ich8lan(struct e1000_hw *hw, u16 offset, u16 words,
+ goto out;
+ }
+
+- nvm->ops.acquire_nvm(hw);
++ nvm->ops.acquire(hw);
+
+ ret_val = e1000_valid_nvm_bank_detect_ich8lan(hw, &bank);
+ if (ret_val) {
+@@ -1705,7 +1703,7 @@ static s32 e1000_read_nvm_ich8lan(struct e1000_hw *hw, u16 offset, u16 words,
+ }
+ }
+
+- nvm->ops.release_nvm(hw);
++ nvm->ops.release(hw);
+
+ out:
+ if (ret_val)
+@@ -1963,14 +1961,14 @@ static s32 e1000_write_nvm_ich8lan(struct e1000_hw *hw, u16 offset, u16 words,
+ return -E1000_ERR_NVM;
+ }
+
+- nvm->ops.acquire_nvm(hw);
++ nvm->ops.acquire(hw);
+
+ for (i = 0; i < words; i++) {
+ dev_spec->shadow_ram[offset+i].modified = 1;
+ dev_spec->shadow_ram[offset+i].value = data[i];
+ }
+
+- nvm->ops.release_nvm(hw);
++ nvm->ops.release(hw);
+
+ return 0;
+ }
+@@ -2001,7 +1999,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)
+ if (nvm->type != e1000_nvm_flash_sw)
+ goto out;
+
+- nvm->ops.acquire_nvm(hw);
++ nvm->ops.acquire(hw);
+
+ /*
+ * We're writing to the opposite bank so if we're on bank 1,
+@@ -2019,7 +2017,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)
+ old_bank_offset = 0;
+ ret_val = e1000_erase_flash_bank_ich8lan(hw, 1);
+ if (ret_val) {
+- nvm->ops.release_nvm(hw);
++ nvm->ops.release(hw);
+ goto out;
+ }
+ } else {
+@@ -2027,7 +2025,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)
+ new_bank_offset = 0;
+ ret_val = e1000_erase_flash_bank_ich8lan(hw, 0);
+ if (ret_val) {
+- nvm->ops.release_nvm(hw);
++ nvm->ops.release(hw);
+ goto out;
+ }
+ }
+@@ -2085,7 +2083,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)
+ if (ret_val) {
+ /* Possibly read-only, see e1000e_write_protect_nvm_ich8lan() */
+ e_dbg("Flash commit failed.\n");
+- nvm->ops.release_nvm(hw);
++ nvm->ops.release(hw);
+ goto out;
+ }
+
+@@ -2098,7 +2096,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)
+ act_offset = new_bank_offset + E1000_ICH_NVM_SIG_WORD;
+ ret_val = e1000_read_flash_word_ich8lan(hw, act_offset, &data);
+ if (ret_val) {
+- nvm->ops.release_nvm(hw);
++ nvm->ops.release(hw);
+ goto out;
+ }
+ data &= 0xBFFF;
+@@ -2106,7 +2104,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)
+ act_offset * 2 + 1,
+ (u8)(data >> 8));
+ if (ret_val) {
+- nvm->ops.release_nvm(hw);
++ nvm->ops.release(hw);
+ goto out;
+ }
+
+@@ -2119,7 +2117,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)
+ act_offset = (old_bank_offset + E1000_ICH_NVM_SIG_WORD) * 2 + 1;
+ ret_val = e1000_retry_write_flash_byte_ich8lan(hw, act_offset, 0);
+ if (ret_val) {
+- nvm->ops.release_nvm(hw);
++ nvm->ops.release(hw);
+ goto out;
+ }
+
+@@ -2129,7 +2127,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)
+ dev_spec->shadow_ram[i].value = 0xFFFF;
+ }
+
+- nvm->ops.release_nvm(hw);
++ nvm->ops.release(hw);
+
+ /*
+ * Reload the EEPROM, or else modifications will not appear
+@@ -2198,7 +2196,7 @@ void e1000e_write_protect_nvm_ich8lan(struct e1000_hw *hw)
+ union ich8_hws_flash_status hsfsts;
+ u32 gfpreg;
+
+- nvm->ops.acquire_nvm(hw);
++ nvm->ops.acquire(hw);
+
+ gfpreg = er32flash(ICH_FLASH_GFPREG);
+
+@@ -2219,7 +2217,7 @@ void e1000e_write_protect_nvm_ich8lan(struct e1000_hw *hw)
+ hsfsts.hsf_status.flockdn = true;
+ ew32flash(ICH_FLASH_HSFSTS, hsfsts.regval);
+
+- nvm->ops.release_nvm(hw);
++ nvm->ops.release(hw);
+ }
+
+ /**
+@@ -2755,7 +2753,7 @@ static s32 e1000_init_hw_ich8lan(struct e1000_hw *hw)
+ * Reset the phy after disabling host wakeup to reset the Rx buffer.
+ */
+ if (hw->phy.type == e1000_phy_82578) {
+- hw->phy.ops.read_phy_reg(hw, BM_WUC, &i);
++ hw->phy.ops.read_reg(hw, BM_WUC, &i);
+ ret_val = e1000_phy_hw_reset_ich8lan(hw);
+ if (ret_val)
+ return ret_val;
+@@ -2902,7 +2900,7 @@ static s32 e1000_setup_link_ich8lan(struct e1000_hw *hw)
+ ew32(FCTTV, hw->fc.pause_time);
+ if ((hw->phy.type == e1000_phy_82578) ||
+ (hw->phy.type == e1000_phy_82577)) {
+- ret_val = hw->phy.ops.write_phy_reg(hw,
++ ret_val = hw->phy.ops.write_reg(hw,
+ PHY_REG(BM_PORT_CTRL_PAGE, 27),
+ hw->fc.pause_time);
+ if (ret_val)
+@@ -2965,7 +2963,7 @@ static s32 e1000_setup_copper_link_ich8lan(struct e1000_hw *hw)
+ return ret_val;
+ break;
+ case e1000_phy_ife:
+- ret_val = hw->phy.ops.read_phy_reg(hw, IFE_PHY_MDIX_CONTROL,
++ ret_val = hw->phy.ops.read_reg(hw, IFE_PHY_MDIX_CONTROL,
+ ®_data);
+ if (ret_val)
+ return ret_val;
+@@ -2984,7 +2982,7 @@ static s32 e1000_setup_copper_link_ich8lan(struct e1000_hw *hw)
+ reg_data |= IFE_PMC_AUTO_MDIX;
+ break;
+ }
+- ret_val = hw->phy.ops.write_phy_reg(hw, IFE_PHY_MDIX_CONTROL,
++ ret_val = hw->phy.ops.write_reg(hw, IFE_PHY_MDIX_CONTROL,
+ reg_data);
+ if (ret_val)
+ return ret_val;
+@@ -3287,7 +3285,7 @@ static s32 e1000_led_off_ich8lan(struct e1000_hw *hw)
+ **/
+ static s32 e1000_setup_led_pchlan(struct e1000_hw *hw)
+ {
+- return hw->phy.ops.write_phy_reg(hw, HV_LED_CONFIG,
++ return hw->phy.ops.write_reg(hw, HV_LED_CONFIG,
+ (u16)hw->mac.ledctl_mode1);
+ }
+
+@@ -3299,7 +3297,7 @@ static s32 e1000_setup_led_pchlan(struct e1000_hw *hw)
+ **/
+ static s32 e1000_cleanup_led_pchlan(struct e1000_hw *hw)
+ {
+- return hw->phy.ops.write_phy_reg(hw, HV_LED_CONFIG,
++ return hw->phy.ops.write_reg(hw, HV_LED_CONFIG,
+ (u16)hw->mac.ledctl_default);
+ }
+
+@@ -3331,7 +3329,7 @@ static s32 e1000_led_on_pchlan(struct e1000_hw *hw)
+ }
+ }
+
+- return hw->phy.ops.write_phy_reg(hw, HV_LED_CONFIG, data);
++ return hw->phy.ops.write_reg(hw, HV_LED_CONFIG, data);
+ }
+
+ /**
+@@ -3362,7 +3360,7 @@ static s32 e1000_led_off_pchlan(struct e1000_hw *hw)
+ }
+ }
+
+- return hw->phy.ops.write_phy_reg(hw, HV_LED_CONFIG, data);
++ return hw->phy.ops.write_reg(hw, HV_LED_CONFIG, data);
+ }
+
+ /**
+@@ -3439,20 +3437,20 @@ static void e1000_clear_hw_cntrs_ich8lan(struct e1000_hw *hw)
+ /* Clear PHY statistics registers */
+ if ((hw->phy.type == e1000_phy_82578) ||
+ (hw->phy.type == e1000_phy_82577)) {
+- hw->phy.ops.read_phy_reg(hw, HV_SCC_UPPER, &phy_data);
+- hw->phy.ops.read_phy_reg(hw, HV_SCC_LOWER, &phy_data);
+- hw->phy.ops.read_phy_reg(hw, HV_ECOL_UPPER, &phy_data);
+- hw->phy.ops.read_phy_reg(hw, HV_ECOL_LOWER, &phy_data);
+- hw->phy.ops.read_phy_reg(hw, HV_MCC_UPPER, &phy_data);
+- hw->phy.ops.read_phy_reg(hw, HV_MCC_LOWER, &phy_data);
+- hw->phy.ops.read_phy_reg(hw, HV_LATECOL_UPPER, &phy_data);
+- hw->phy.ops.read_phy_reg(hw, HV_LATECOL_LOWER, &phy_data);
+- hw->phy.ops.read_phy_reg(hw, HV_COLC_UPPER, &phy_data);
+- hw->phy.ops.read_phy_reg(hw, HV_COLC_LOWER, &phy_data);
+- hw->phy.ops.read_phy_reg(hw, HV_DC_UPPER, &phy_data);
+- hw->phy.ops.read_phy_reg(hw, HV_DC_LOWER, &phy_data);
+- hw->phy.ops.read_phy_reg(hw, HV_TNCRS_UPPER, &phy_data);
+- hw->phy.ops.read_phy_reg(hw, HV_TNCRS_LOWER, &phy_data);
++ hw->phy.ops.read_reg(hw, HV_SCC_UPPER, &phy_data);
++ hw->phy.ops.read_reg(hw, HV_SCC_LOWER, &phy_data);
++ hw->phy.ops.read_reg(hw, HV_ECOL_UPPER, &phy_data);
++ hw->phy.ops.read_reg(hw, HV_ECOL_LOWER, &phy_data);
++ hw->phy.ops.read_reg(hw, HV_MCC_UPPER, &phy_data);
++ hw->phy.ops.read_reg(hw, HV_MCC_LOWER, &phy_data);
++ hw->phy.ops.read_reg(hw, HV_LATECOL_UPPER, &phy_data);
++ hw->phy.ops.read_reg(hw, HV_LATECOL_LOWER, &phy_data);
++ hw->phy.ops.read_reg(hw, HV_COLC_UPPER, &phy_data);
++ hw->phy.ops.read_reg(hw, HV_COLC_LOWER, &phy_data);
++ hw->phy.ops.read_reg(hw, HV_DC_UPPER, &phy_data);
++ hw->phy.ops.read_reg(hw, HV_DC_LOWER, &phy_data);
++ hw->phy.ops.read_reg(hw, HV_TNCRS_UPPER, &phy_data);
++ hw->phy.ops.read_reg(hw, HV_TNCRS_LOWER, &phy_data);
+ }
+ }
+
+@@ -3475,29 +3473,29 @@ static struct e1000_mac_operations ich8_mac_ops = {
+ };
+
+ static struct e1000_phy_operations ich8_phy_ops = {
+- .acquire_phy = e1000_acquire_swflag_ich8lan,
++ .acquire = e1000_acquire_swflag_ich8lan,
+ .check_reset_block = e1000_check_reset_block_ich8lan,
+- .commit_phy = NULL,
++ .commit = NULL,
+ .force_speed_duplex = e1000_phy_force_speed_duplex_ich8lan,
+ .get_cfg_done = e1000_get_cfg_done_ich8lan,
+ .get_cable_length = e1000e_get_cable_length_igp_2,
+- .get_phy_info = e1000_get_phy_info_ich8lan,
+- .read_phy_reg = e1000e_read_phy_reg_igp,
+- .release_phy = e1000_release_swflag_ich8lan,
+- .reset_phy = e1000_phy_hw_reset_ich8lan,
++ .get_info = e1000_get_phy_info_ich8lan,
++ .read_reg = e1000e_read_phy_reg_igp,
++ .release = e1000_release_swflag_ich8lan,
++ .reset = e1000_phy_hw_reset_ich8lan,
+ .set_d0_lplu_state = e1000_set_d0_lplu_state_ich8lan,
+ .set_d3_lplu_state = e1000_set_d3_lplu_state_ich8lan,
+- .write_phy_reg = e1000e_write_phy_reg_igp,
++ .write_reg = e1000e_write_phy_reg_igp,
+ };
+
+ static struct e1000_nvm_operations ich8_nvm_ops = {
+- .acquire_nvm = e1000_acquire_nvm_ich8lan,
+- .read_nvm = e1000_read_nvm_ich8lan,
+- .release_nvm = e1000_release_nvm_ich8lan,
+- .update_nvm = e1000_update_nvm_checksum_ich8lan,
++ .acquire = e1000_acquire_nvm_ich8lan,
++ .read = e1000_read_nvm_ich8lan,
++ .release = e1000_release_nvm_ich8lan,
++ .update = e1000_update_nvm_checksum_ich8lan,
+ .valid_led_default = e1000_valid_led_default_ich8lan,
+- .validate_nvm = e1000_validate_nvm_checksum_ich8lan,
+- .write_nvm = e1000_write_nvm_ich8lan,
++ .validate = e1000_validate_nvm_checksum_ich8lan,
++ .write = e1000_write_nvm_ich8lan,
+ };
+
+ struct e1000_info e1000_ich8_info = {
+diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c
+index fa31c51..f664fc0 100644
+--- a/drivers/net/e1000e/lib.c
++++ b/drivers/net/e1000e/lib.c
+@@ -1985,7 +1985,7 @@ s32 e1000e_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
+ return -E1000_ERR_NVM;
+ }
+
+- ret_val = nvm->ops.acquire_nvm(hw);
++ ret_val = nvm->ops.acquire(hw);
+ if (ret_val)
+ return ret_val;
+
+@@ -1996,7 +1996,7 @@ s32 e1000e_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
+
+ ret_val = e1000_ready_nvm_eeprom(hw);
+ if (ret_val) {
+- nvm->ops.release_nvm(hw);
++ nvm->ops.release(hw);
+ return ret_val;
+ }
+
+@@ -2035,7 +2035,7 @@ s32 e1000e_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
+ }
+
+ msleep(10);
+- nvm->ops.release_nvm(hw);
++ nvm->ops.release(hw);
+ return 0;
+ }
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index eb25674..efa1159 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -4441,7 +4441,7 @@ static int e1000_init_phy_wakeup(struct e1000_adapter *adapter, u32 wufc)
+ e1e_wphy(&adapter->hw, BM_WUC, E1000_WUC_PME_EN);
+
+ /* activate PHY wakeup */
+- retval = hw->phy.ops.acquire_phy(hw);
++ retval = hw->phy.ops.acquire(hw);
+ if (retval) {
+ e_err("Could not acquire PHY\n");
+ return retval;
+@@ -4458,7 +4458,7 @@ static int e1000_init_phy_wakeup(struct e1000_adapter *adapter, u32 wufc)
+ if (retval)
+ e_err("Could not set PHY Host Wakeup bit\n");
+ out:
+- hw->phy.ops.release_phy(hw);
++ hw->phy.ops.release(hw);
+
+ return retval;
+ }
+diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c
+index 5fcfc16..0413840 100644
+--- a/drivers/net/e1000e/phy.c
++++ b/drivers/net/e1000e/phy.c
+@@ -130,7 +130,7 @@ s32 e1000e_get_phy_id(struct e1000_hw *hw)
+ u16 phy_id;
+ u16 retry_count = 0;
+
+- if (!(phy->ops.read_phy_reg))
++ if (!(phy->ops.read_reg))
+ goto out;
+
+ while (retry_count < 2) {
+@@ -156,24 +156,24 @@ s32 e1000e_get_phy_id(struct e1000_hw *hw)
+ * MDIC mode. No harm in trying again in this case since
+ * the PHY ID is unknown at this point anyway
+ */
+- ret_val = phy->ops.acquire_phy(hw);
++ ret_val = phy->ops.acquire(hw);
+ if (ret_val)
+ goto out;
+ ret_val = e1000_set_mdio_slow_mode_hv(hw, true);
+ if (ret_val)
+ goto out;
+- phy->ops.release_phy(hw);
++ phy->ops.release(hw);
+
+ retry_count++;
+ }
+ out:
+ /* Revert to MDIO fast mode, if applicable */
+ if (retry_count) {
+- ret_val = phy->ops.acquire_phy(hw);
++ ret_val = phy->ops.acquire(hw);
+ if (ret_val)
+ return ret_val;
+ ret_val = e1000_set_mdio_slow_mode_hv(hw, false);
+- phy->ops.release_phy(hw);
++ phy->ops.release(hw);
+ }
+
+ return ret_val;
+@@ -317,14 +317,14 @@ s32 e1000e_read_phy_reg_m88(struct e1000_hw *hw, u32 offset, u16 *data)
+ {
+ s32 ret_val;
+
+- ret_val = hw->phy.ops.acquire_phy(hw);
++ ret_val = hw->phy.ops.acquire(hw);
+ if (ret_val)
+ return ret_val;
+
+ ret_val = e1000e_read_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset,
+ data);
+
+- hw->phy.ops.release_phy(hw);
++ hw->phy.ops.release(hw);
+
+ return ret_val;
+ }
+@@ -342,14 +342,14 @@ s32 e1000e_write_phy_reg_m88(struct e1000_hw *hw, u32 offset, u16 data)
+ {
+ s32 ret_val;
+
+- ret_val = hw->phy.ops.acquire_phy(hw);
++ ret_val = hw->phy.ops.acquire(hw);
+ if (ret_val)
+ return ret_val;
+
+ ret_val = e1000e_write_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset,
+ data);
+
+- hw->phy.ops.release_phy(hw);
++ hw->phy.ops.release(hw);
+
+ return ret_val;
+ }
+@@ -371,10 +371,10 @@ static s32 __e1000e_read_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 *data,
+ s32 ret_val = 0;
+
+ if (!locked) {
+- if (!(hw->phy.ops.acquire_phy))
++ if (!(hw->phy.ops.acquire))
+ goto out;
+
+- ret_val = hw->phy.ops.acquire_phy(hw);
++ ret_val = hw->phy.ops.acquire(hw);
+ if (ret_val)
+ goto out;
+ }
+@@ -392,7 +392,7 @@ static s32 __e1000e_read_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 *data,
+
+ release:
+ if (!locked)
+- hw->phy.ops.release_phy(hw);
++ hw->phy.ops.release(hw);
+ out:
+ return ret_val;
+ }
+@@ -442,10 +442,10 @@ static s32 __e1000e_write_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 data,
+ s32 ret_val = 0;
+
+ if (!locked) {
+- if (!(hw->phy.ops.acquire_phy))
++ if (!(hw->phy.ops.acquire))
+ goto out;
+
+- ret_val = hw->phy.ops.acquire_phy(hw);
++ ret_val = hw->phy.ops.acquire(hw);
+ if (ret_val)
+ goto out;
+ }
+@@ -463,7 +463,7 @@ static s32 __e1000e_write_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 data,
+
+ release:
+ if (!locked)
+- hw->phy.ops.release_phy(hw);
++ hw->phy.ops.release(hw);
+
+ out:
+ return ret_val;
+@@ -515,10 +515,10 @@ static s32 __e1000_read_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 *data,
+ s32 ret_val = 0;
+
+ if (!locked) {
+- if (!(hw->phy.ops.acquire_phy))
++ if (!(hw->phy.ops.acquire))
+ goto out;
+
+- ret_val = hw->phy.ops.acquire_phy(hw);
++ ret_val = hw->phy.ops.acquire(hw);
+ if (ret_val)
+ goto out;
+ }
+@@ -533,7 +533,7 @@ static s32 __e1000_read_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 *data,
+ *data = (u16)kmrnctrlsta;
+
+ if (!locked)
+- hw->phy.ops.release_phy(hw);
++ hw->phy.ops.release(hw);
+
+ out:
+ return ret_val;
+@@ -587,10 +587,10 @@ static s32 __e1000_write_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 data,
+ s32 ret_val = 0;
+
+ if (!locked) {
+- if (!(hw->phy.ops.acquire_phy))
++ if (!(hw->phy.ops.acquire))
+ goto out;
+
+- ret_val = hw->phy.ops.acquire_phy(hw);
++ ret_val = hw->phy.ops.acquire(hw);
+ if (ret_val)
+ goto out;
+ }
+@@ -602,7 +602,7 @@ static s32 __e1000_write_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 data,
+ udelay(2);
+
+ if (!locked)
+- hw->phy.ops.release_phy(hw);
++ hw->phy.ops.release(hw);
+
+ out:
+ return ret_val;
+@@ -649,7 +649,7 @@ s32 e1000_copper_link_setup_82577(struct e1000_hw *hw)
+ u16 phy_data;
+
+ /* Enable CRS on TX. This must be set for half-duplex operation. */
+- ret_val = phy->ops.read_phy_reg(hw, I82577_CFG_REG, &phy_data);
++ ret_val = phy->ops.read_reg(hw, I82577_CFG_REG, &phy_data);
+ if (ret_val)
+ goto out;
+
+@@ -658,7 +658,7 @@ s32 e1000_copper_link_setup_82577(struct e1000_hw *hw)
+ /* Enable downshift */
+ phy_data |= I82577_CFG_ENABLE_DOWNSHIFT;
+
+- ret_val = phy->ops.write_phy_reg(hw, I82577_CFG_REG, phy_data);
++ ret_val = phy->ops.write_reg(hw, I82577_CFG_REG, phy_data);
+
+ out:
+ return ret_val;
+@@ -781,7 +781,7 @@ s32 e1000e_copper_link_setup_m88(struct e1000_hw *hw)
+ }
+
+ if (phy->type == e1000_phy_82578) {
+- ret_val = phy->ops.read_phy_reg(hw, M88E1000_EXT_PHY_SPEC_CTRL,
++ ret_val = phy->ops.read_reg(hw, M88E1000_EXT_PHY_SPEC_CTRL,
+ &phy_data);
+ if (ret_val)
+ return ret_val;
+@@ -789,7 +789,7 @@ s32 e1000e_copper_link_setup_m88(struct e1000_hw *hw)
+ /* 82578 PHY - set the downshift count to 1x. */
+ phy_data |= I82578_EPSCR_DOWNSHIFT_ENABLE;
+ phy_data &= ~I82578_EPSCR_DOWNSHIFT_COUNTER_MASK;
+- ret_val = phy->ops.write_phy_reg(hw, M88E1000_EXT_PHY_SPEC_CTRL,
++ ret_val = phy->ops.write_reg(hw, M88E1000_EXT_PHY_SPEC_CTRL,
+ phy_data);
+ if (ret_val)
+ return ret_val;
+@@ -1980,7 +1980,7 @@ s32 e1000e_phy_hw_reset_generic(struct e1000_hw *hw)
+ if (ret_val)
+ return 0;
+
+- ret_val = phy->ops.acquire_phy(hw);
++ ret_val = phy->ops.acquire(hw);
+ if (ret_val)
+ return ret_val;
+
+@@ -1995,7 +1995,7 @@ s32 e1000e_phy_hw_reset_generic(struct e1000_hw *hw)
+
+ udelay(150);
+
+- phy->ops.release_phy(hw);
++ phy->ops.release(hw);
+
+ return e1000_get_phy_cfg_done(hw);
+ }
+@@ -2246,7 +2246,7 @@ s32 e1000e_write_phy_reg_bm(struct e1000_hw *hw, u32 offset, u16 data)
+ u32 page = offset >> IGP_PAGE_SHIFT;
+ u32 page_shift = 0;
+
+- ret_val = hw->phy.ops.acquire_phy(hw);
++ ret_val = hw->phy.ops.acquire(hw);
+ if (ret_val)
+ return ret_val;
+
+@@ -2284,7 +2284,7 @@ s32 e1000e_write_phy_reg_bm(struct e1000_hw *hw, u32 offset, u16 data)
+ data);
+
+ out:
+- hw->phy.ops.release_phy(hw);
++ hw->phy.ops.release(hw);
+ return ret_val;
+ }
+
+@@ -2305,7 +2305,7 @@ s32 e1000e_read_phy_reg_bm(struct e1000_hw *hw, u32 offset, u16 *data)
+ u32 page = offset >> IGP_PAGE_SHIFT;
+ u32 page_shift = 0;
+
+- ret_val = hw->phy.ops.acquire_phy(hw);
++ ret_val = hw->phy.ops.acquire(hw);
+ if (ret_val)
+ return ret_val;
+
+@@ -2342,7 +2342,7 @@ s32 e1000e_read_phy_reg_bm(struct e1000_hw *hw, u32 offset, u16 *data)
+ ret_val = e1000e_read_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset,
+ data);
+ out:
+- hw->phy.ops.release_phy(hw);
++ hw->phy.ops.release(hw);
+ return ret_val;
+ }
+
+@@ -2361,7 +2361,7 @@ s32 e1000e_read_phy_reg_bm2(struct e1000_hw *hw, u32 offset, u16 *data)
+ s32 ret_val;
+ u16 page = (u16)(offset >> IGP_PAGE_SHIFT);
+
+- ret_val = hw->phy.ops.acquire_phy(hw);
++ ret_val = hw->phy.ops.acquire(hw);
+ if (ret_val)
+ return ret_val;
+
+@@ -2387,7 +2387,7 @@ s32 e1000e_read_phy_reg_bm2(struct e1000_hw *hw, u32 offset, u16 *data)
+ ret_val = e1000e_read_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset,
+ data);
+ out:
+- hw->phy.ops.release_phy(hw);
++ hw->phy.ops.release(hw);
+ return ret_val;
+ }
+
+@@ -2405,7 +2405,7 @@ s32 e1000e_write_phy_reg_bm2(struct e1000_hw *hw, u32 offset, u16 data)
+ s32 ret_val;
+ u16 page = (u16)(offset >> IGP_PAGE_SHIFT);
+
+- ret_val = hw->phy.ops.acquire_phy(hw);
++ ret_val = hw->phy.ops.acquire(hw);
+ if (ret_val)
+ return ret_val;
+
+@@ -2431,7 +2431,7 @@ s32 e1000e_write_phy_reg_bm2(struct e1000_hw *hw, u32 offset, u16 data)
+ data);
+
+ out:
+- hw->phy.ops.release_phy(hw);
++ hw->phy.ops.release(hw);
+ return ret_val;
+ }
+
+@@ -2534,8 +2534,8 @@ out:
+ **/
+ s32 e1000e_commit_phy(struct e1000_hw *hw)
+ {
+- if (hw->phy.ops.commit_phy)
+- return hw->phy.ops.commit_phy(hw);
++ if (hw->phy.ops.commit)
++ return hw->phy.ops.commit(hw);
+
+ return 0;
+ }
+@@ -2614,7 +2614,7 @@ static s32 __e1000_read_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 *data,
+ bool in_slow_mode = false;
+
+ if (!locked) {
+- ret_val = hw->phy.ops.acquire_phy(hw);
++ ret_val = hw->phy.ops.acquire(hw);
+ if (ret_val)
+ return ret_val;
+ }
+@@ -2670,7 +2670,7 @@ out:
+ ret_val |= e1000_set_mdio_slow_mode_hv(hw, false);
+
+ if (!locked)
+- hw->phy.ops.release_phy(hw);
++ hw->phy.ops.release(hw);
+
+ return ret_val;
+ }
+@@ -2723,7 +2723,7 @@ static s32 __e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data,
+ bool in_slow_mode = false;
+
+ if (!locked) {
+- ret_val = hw->phy.ops.acquire_phy(hw);
++ ret_val = hw->phy.ops.acquire(hw);
+ if (ret_val)
+ return ret_val;
+ }
+@@ -2796,7 +2796,7 @@ out:
+ ret_val |= e1000_set_mdio_slow_mode_hv(hw, false);
+
+ if (!locked)
+- hw->phy.ops.release_phy(hw);
++ hw->phy.ops.release(hw);
+
+ return ret_val;
+ }
+@@ -2911,12 +2911,12 @@ s32 e1000_link_stall_workaround_hv(struct e1000_hw *hw)
+ goto out;
+
+ /* Do not apply workaround if in PHY loopback bit 14 set */
+- hw->phy.ops.read_phy_reg(hw, PHY_CONTROL, &data);
++ hw->phy.ops.read_reg(hw, PHY_CONTROL, &data);
+ if (data & PHY_CONTROL_LB)
+ goto out;
+
+ /* check if link is up and at 1Gbps */
+- ret_val = hw->phy.ops.read_phy_reg(hw, BM_CS_STATUS, &data);
++ ret_val = hw->phy.ops.read_reg(hw, BM_CS_STATUS, &data);
+ if (ret_val)
+ goto out;
+
+@@ -2932,13 +2932,13 @@ s32 e1000_link_stall_workaround_hv(struct e1000_hw *hw)
+ mdelay(200);
+
+ /* flush the packets in the fifo buffer */
+- ret_val = hw->phy.ops.write_phy_reg(hw, HV_MUX_DATA_CTRL,
++ ret_val = hw->phy.ops.write_reg(hw, HV_MUX_DATA_CTRL,
+ HV_MUX_DATA_CTRL_GEN_TO_MAC |
+ HV_MUX_DATA_CTRL_FORCE_SPEED);
+ if (ret_val)
+ goto out;
+
+- ret_val = hw->phy.ops.write_phy_reg(hw, HV_MUX_DATA_CTRL,
++ ret_val = hw->phy.ops.write_reg(hw, HV_MUX_DATA_CTRL,
+ HV_MUX_DATA_CTRL_GEN_TO_MAC);
+
+ out:
+@@ -2959,7 +2959,7 @@ s32 e1000_check_polarity_82577(struct e1000_hw *hw)
+ s32 ret_val;
+ u16 data;
+
+- ret_val = phy->ops.read_phy_reg(hw, I82577_PHY_STATUS_2, &data);
++ ret_val = phy->ops.read_reg(hw, I82577_PHY_STATUS_2, &data);
+
+ if (!ret_val)
+ phy->cable_polarity = (data & I82577_PHY_STATUS2_REV_POLARITY)
+@@ -2984,13 +2984,13 @@ s32 e1000_phy_force_speed_duplex_82577(struct e1000_hw *hw)
+ u16 phy_data;
+ bool link;
+
+- ret_val = phy->ops.read_phy_reg(hw, PHY_CONTROL, &phy_data);
++ ret_val = phy->ops.read_reg(hw, PHY_CONTROL, &phy_data);
+ if (ret_val)
+ goto out;
+
+ e1000e_phy_force_speed_duplex_setup(hw, &phy_data);
+
+- ret_val = phy->ops.write_phy_reg(hw, PHY_CONTROL, phy_data);
++ ret_val = phy->ops.write_reg(hw, PHY_CONTROL, phy_data);
+ if (ret_val)
+ goto out;
+
+@@ -2998,14 +2998,14 @@ s32 e1000_phy_force_speed_duplex_82577(struct e1000_hw *hw)
+ * Clear Auto-Crossover to force MDI manually. 82577 requires MDI
+ * forced whenever speed and duplex are forced.
+ */
+- ret_val = phy->ops.read_phy_reg(hw, I82577_PHY_CTRL_2, &phy_data);
++ ret_val = phy->ops.read_reg(hw, I82577_PHY_CTRL_2, &phy_data);
+ if (ret_val)
+ goto out;
+
+ phy_data &= ~I82577_PHY_CTRL2_AUTO_MDIX;
+ phy_data &= ~I82577_PHY_CTRL2_FORCE_MDI_MDIX;
+
+- ret_val = phy->ops.write_phy_reg(hw, I82577_PHY_CTRL_2, phy_data);
++ ret_val = phy->ops.write_reg(hw, I82577_PHY_CTRL_2, phy_data);
+ if (ret_val)
+ goto out;
+
+@@ -3071,7 +3071,7 @@ s32 e1000_get_phy_info_82577(struct e1000_hw *hw)
+ if (ret_val)
+ goto out;
+
+- ret_val = phy->ops.read_phy_reg(hw, I82577_PHY_STATUS_2, &data);
++ ret_val = phy->ops.read_reg(hw, I82577_PHY_STATUS_2, &data);
+ if (ret_val)
+ goto out;
+
+@@ -3083,7 +3083,7 @@ s32 e1000_get_phy_info_82577(struct e1000_hw *hw)
+ if (ret_val)
+ goto out;
+
+- ret_val = phy->ops.read_phy_reg(hw, PHY_1000T_STATUS, &data);
++ ret_val = phy->ops.read_reg(hw, PHY_1000T_STATUS, &data);
+ if (ret_val)
+ goto out;
+
+@@ -3117,7 +3117,7 @@ s32 e1000_get_cable_length_82577(struct e1000_hw *hw)
+ s32 ret_val;
+ u16 phy_data, length;
+
+- ret_val = phy->ops.read_phy_reg(hw, I82577_PHY_DIAG_STATUS, &phy_data);
++ ret_val = phy->ops.read_reg(hw, I82577_PHY_DIAG_STATUS, &phy_data);
+ if (ret_val)
+ goto out;
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0017-e1000e-update-copyright-information.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0017-e1000e-update-copyright-information.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,178 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Fri, 20 Nov 2009 23:25:45 +0000
+Subject: [PATCH 017/166] e1000e: update copyright information
+
+commit c7e54b1bf90480ca4bdfd1491ac6c4b7bfe07c03 upstream.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/82571.c | 2 +-
+ drivers/net/e1000e/defines.h | 2 +-
+ drivers/net/e1000e/e1000.h | 2 +-
+ drivers/net/e1000e/es2lan.c | 2 +-
+ drivers/net/e1000e/ethtool.c | 2 +-
+ drivers/net/e1000e/hw.h | 2 +-
+ drivers/net/e1000e/ich8lan.c | 2 +-
+ drivers/net/e1000e/lib.c | 2 +-
+ drivers/net/e1000e/netdev.c | 4 ++--
+ drivers/net/e1000e/param.c | 2 +-
+ drivers/net/e1000e/phy.c | 2 +-
+ 11 files changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+index 6fe1b3c..a984bc3 100644
+--- a/drivers/net/e1000e/82571.c
++++ b/drivers/net/e1000e/82571.c
+@@ -1,7 +1,7 @@
+ /*******************************************************************************
+
+ Intel PRO/1000 Linux driver
+- Copyright(c) 1999 - 2008 Intel Corporation.
++ Copyright(c) 1999 - 2009 Intel Corporation.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+diff --git a/drivers/net/e1000e/defines.h b/drivers/net/e1000e/defines.h
+index 1190167..86d2809 100644
+--- a/drivers/net/e1000e/defines.h
++++ b/drivers/net/e1000e/defines.h
+@@ -1,7 +1,7 @@
+ /*******************************************************************************
+
+ Intel PRO/1000 Linux driver
+- Copyright(c) 1999 - 2008 Intel Corporation.
++ Copyright(c) 1999 - 2009 Intel Corporation.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
+index a0e948f..7f15703 100644
+--- a/drivers/net/e1000e/e1000.h
++++ b/drivers/net/e1000e/e1000.h
+@@ -1,7 +1,7 @@
+ /*******************************************************************************
+
+ Intel PRO/1000 Linux driver
+- Copyright(c) 1999 - 2008 Intel Corporation.
++ Copyright(c) 1999 - 2009 Intel Corporation.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+diff --git a/drivers/net/e1000e/es2lan.c b/drivers/net/e1000e/es2lan.c
+index d024e20..103dc64 100644
+--- a/drivers/net/e1000e/es2lan.c
++++ b/drivers/net/e1000e/es2lan.c
+@@ -1,7 +1,7 @@
+ /*******************************************************************************
+
+ Intel PRO/1000 Linux driver
+- Copyright(c) 1999 - 2008 Intel Corporation.
++ Copyright(c) 1999 - 2009 Intel Corporation.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
+index fd79214..b6243ca 100644
+--- a/drivers/net/e1000e/ethtool.c
++++ b/drivers/net/e1000e/ethtool.c
+@@ -1,7 +1,7 @@
+ /*******************************************************************************
+
+ Intel PRO/1000 Linux driver
+- Copyright(c) 1999 - 2008 Intel Corporation.
++ Copyright(c) 1999 - 2009 Intel Corporation.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h
+index 06d4f0a..90bd7f0 100644
+--- a/drivers/net/e1000e/hw.h
++++ b/drivers/net/e1000e/hw.h
+@@ -1,7 +1,7 @@
+ /*******************************************************************************
+
+ Intel PRO/1000 Linux driver
+- Copyright(c) 1999 - 2008 Intel Corporation.
++ Copyright(c) 1999 - 2009 Intel Corporation.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index 4657b11..759bd20 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -1,7 +1,7 @@
+ /*******************************************************************************
+
+ Intel PRO/1000 Linux driver
+- Copyright(c) 1999 - 2008 Intel Corporation.
++ Copyright(c) 1999 - 2009 Intel Corporation.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c
+index f664fc0..0c6ad0e 100644
+--- a/drivers/net/e1000e/lib.c
++++ b/drivers/net/e1000e/lib.c
+@@ -1,7 +1,7 @@
+ /*******************************************************************************
+
+ Intel PRO/1000 Linux driver
+- Copyright(c) 1999 - 2008 Intel Corporation.
++ Copyright(c) 1999 - 2009 Intel Corporation.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index efa1159..c7660e5 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -1,7 +1,7 @@
+ /*******************************************************************************
+
+ Intel PRO/1000 Linux driver
+- Copyright(c) 1999 - 2008 Intel Corporation.
++ Copyright(c) 1999 - 2009 Intel Corporation.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+@@ -5388,7 +5388,7 @@ static int __init e1000_init_module(void)
+ int ret;
+ printk(KERN_INFO "%s: Intel(R) PRO/1000 Network Driver - %s\n",
+ e1000e_driver_name, e1000e_driver_version);
+- printk(KERN_INFO "%s: Copyright (c) 1999-2008 Intel Corporation.\n",
++ printk(KERN_INFO "%s: Copyright (c) 1999 - 2009 Intel Corporation.\n",
+ e1000e_driver_name);
+ ret = pci_register_driver(&e1000_driver);
+ pm_qos_add_requirement(PM_QOS_CPU_DMA_LATENCY, e1000e_driver_name,
+diff --git a/drivers/net/e1000e/param.c b/drivers/net/e1000e/param.c
+index 1342e0b..2e39977 100644
+--- a/drivers/net/e1000e/param.c
++++ b/drivers/net/e1000e/param.c
+@@ -1,7 +1,7 @@
+ /*******************************************************************************
+
+ Intel PRO/1000 Linux driver
+- Copyright(c) 1999 - 2008 Intel Corporation.
++ Copyright(c) 1999 - 2009 Intel Corporation.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c
+index 0413840..38536ef 100644
+--- a/drivers/net/e1000e/phy.c
++++ b/drivers/net/e1000e/phy.c
+@@ -1,7 +1,7 @@
+ /*******************************************************************************
+
+ Intel PRO/1000 Linux driver
+- Copyright(c) 1999 - 2008 Intel Corporation.
++ Copyright(c) 1999 - 2009 Intel Corporation.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0018-e1000e-remove-comments-regarding-a-non-existent-api-.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0018-e1000e-remove-comments-regarding-a-non-existent-api-.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,184 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Fri, 20 Nov 2009 23:26:05 +0000
+Subject: [PATCH 018/166] e1000e: remove comments regarding a non-existent api
+ module
+
+commit fe4016746d2c0b3b690f5d1921c826d14008b118 upstream.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/82571.c | 9 +--------
+ drivers/net/e1000e/es2lan.c | 30 +++++++-----------------------
+ 2 files changed, 8 insertions(+), 31 deletions(-)
+
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+index a984bc3..7cdf176 100644
+--- a/drivers/net/e1000e/82571.c
++++ b/drivers/net/e1000e/82571.c
+@@ -72,8 +72,6 @@ static void e1000_put_hw_semaphore_82571(struct e1000_hw *hw);
+ /**
+ * e1000_init_phy_params_82571 - Init PHY func ptrs.
+ * @hw: pointer to the HW structure
+- *
+- * This is a function pointer entry point called by the api module.
+ **/
+ static s32 e1000_init_phy_params_82571(struct e1000_hw *hw)
+ {
+@@ -136,8 +134,6 @@ static s32 e1000_init_phy_params_82571(struct e1000_hw *hw)
+ /**
+ * e1000_init_nvm_params_82571 - Init NVM func ptrs.
+ * @hw: pointer to the HW structure
+- *
+- * This is a function pointer entry point called by the api module.
+ **/
+ static s32 e1000_init_nvm_params_82571(struct e1000_hw *hw)
+ {
+@@ -201,8 +197,6 @@ static s32 e1000_init_nvm_params_82571(struct e1000_hw *hw)
+ /**
+ * e1000_init_mac_params_82571 - Init MAC func ptrs.
+ * @hw: pointer to the HW structure
+- *
+- * This is a function pointer entry point called by the api module.
+ **/
+ static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter)
+ {
+@@ -830,8 +824,7 @@ static s32 e1000_set_d0_lplu_state_82571(struct e1000_hw *hw, bool active)
+ * e1000_reset_hw_82571 - Reset hardware
+ * @hw: pointer to the HW structure
+ *
+- * This resets the hardware into a known state. This is a
+- * function pointer entry point called by the api module.
++ * This resets the hardware into a known state.
+ **/
+ static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
+ {
+diff --git a/drivers/net/e1000e/es2lan.c b/drivers/net/e1000e/es2lan.c
+index 103dc64..2d14156 100644
+--- a/drivers/net/e1000e/es2lan.c
++++ b/drivers/net/e1000e/es2lan.c
+@@ -116,8 +116,6 @@ static s32 e1000_write_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
+ /**
+ * e1000_init_phy_params_80003es2lan - Init ESB2 PHY func ptrs.
+ * @hw: pointer to the HW structure
+- *
+- * This is a function pointer entry point called by the api module.
+ **/
+ static s32 e1000_init_phy_params_80003es2lan(struct e1000_hw *hw)
+ {
+@@ -147,8 +145,6 @@ static s32 e1000_init_phy_params_80003es2lan(struct e1000_hw *hw)
+ /**
+ * e1000_init_nvm_params_80003es2lan - Init ESB2 NVM func ptrs.
+ * @hw: pointer to the HW structure
+- *
+- * This is a function pointer entry point called by the api module.
+ **/
+ static s32 e1000_init_nvm_params_80003es2lan(struct e1000_hw *hw)
+ {
+@@ -195,8 +191,6 @@ static s32 e1000_init_nvm_params_80003es2lan(struct e1000_hw *hw)
+ /**
+ * e1000_init_mac_params_80003es2lan - Init ESB2 MAC func ptrs.
+ * @hw: pointer to the HW structure
+- *
+- * This is a function pointer entry point called by the api module.
+ **/
+ static s32 e1000_init_mac_params_80003es2lan(struct e1000_adapter *adapter)
+ {
+@@ -267,8 +261,7 @@ static s32 e1000_get_variants_80003es2lan(struct e1000_adapter *adapter)
+ * e1000_acquire_phy_80003es2lan - Acquire rights to access PHY
+ * @hw: pointer to the HW structure
+ *
+- * A wrapper to acquire access rights to the correct PHY. This is a
+- * function pointer entry point called by the api module.
++ * A wrapper to acquire access rights to the correct PHY.
+ **/
+ static s32 e1000_acquire_phy_80003es2lan(struct e1000_hw *hw)
+ {
+@@ -282,8 +275,7 @@ static s32 e1000_acquire_phy_80003es2lan(struct e1000_hw *hw)
+ * e1000_release_phy_80003es2lan - Release rights to access PHY
+ * @hw: pointer to the HW structure
+ *
+- * A wrapper to release access rights to the correct PHY. This is a
+- * function pointer entry point called by the api module.
++ * A wrapper to release access rights to the correct PHY.
+ **/
+ static void e1000_release_phy_80003es2lan(struct e1000_hw *hw)
+ {
+@@ -328,8 +320,7 @@ static void e1000_release_mac_csr_80003es2lan(struct e1000_hw *hw)
+ * e1000_acquire_nvm_80003es2lan - Acquire rights to access NVM
+ * @hw: pointer to the HW structure
+ *
+- * Acquire the semaphore to access the EEPROM. This is a function
+- * pointer entry point called by the api module.
++ * Acquire the semaphore to access the EEPROM.
+ **/
+ static s32 e1000_acquire_nvm_80003es2lan(struct e1000_hw *hw)
+ {
+@@ -351,8 +342,7 @@ static s32 e1000_acquire_nvm_80003es2lan(struct e1000_hw *hw)
+ * e1000_release_nvm_80003es2lan - Relinquish rights to access NVM
+ * @hw: pointer to the HW structure
+ *
+- * Release the semaphore used to access the EEPROM. This is a
+- * function pointer entry point called by the api module.
++ * Release the semaphore used to access the EEPROM.
+ **/
+ static void e1000_release_nvm_80003es2lan(struct e1000_hw *hw)
+ {
+@@ -434,8 +424,7 @@ static void e1000_release_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask)
+ * @offset: offset of the register to read
+ * @data: pointer to the data returned from the operation
+ *
+- * Read the GG82563 PHY register. This is a function pointer entry
+- * point called by the api module.
++ * Read the GG82563 PHY register.
+ **/
+ static s32 e1000_read_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
+ u32 offset, u16 *data)
+@@ -499,8 +488,7 @@ static s32 e1000_read_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
+ * @offset: offset of the register to read
+ * @data: value to write to the register
+ *
+- * Write to the GG82563 PHY register. This is a function pointer entry
+- * point called by the api module.
++ * Write to the GG82563 PHY register.
+ **/
+ static s32 e1000_write_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
+ u32 offset, u16 data)
+@@ -565,8 +553,7 @@ static s32 e1000_write_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
+ * @words: number of words to write
+ * @data: buffer of data to write to the NVM
+ *
+- * Write "words" of data to the ESB2 NVM. This is a function
+- * pointer entry point called by the api module.
++ * Write "words" of data to the ESB2 NVM.
+ **/
+ static s32 e1000_write_nvm_80003es2lan(struct e1000_hw *hw, u16 offset,
+ u16 words, u16 *data)
+@@ -730,7 +717,6 @@ static s32 e1000_get_cable_length_80003es2lan(struct e1000_hw *hw)
+ * @duplex: pointer to duplex buffer
+ *
+ * Retrieve the current speed and duplex configuration.
+- * This is a function pointer entry point called by the api module.
+ **/
+ static s32 e1000_get_link_up_info_80003es2lan(struct e1000_hw *hw, u16 *speed,
+ u16 *duplex)
+@@ -756,7 +742,6 @@ static s32 e1000_get_link_up_info_80003es2lan(struct e1000_hw *hw, u16 *speed,
+ * @hw: pointer to the HW structure
+ *
+ * Perform a global reset to the ESB2 controller.
+- * This is a function pointer entry point called by the api module.
+ **/
+ static s32 e1000_reset_hw_80003es2lan(struct e1000_hw *hw)
+ {
+@@ -805,7 +790,6 @@ static s32 e1000_reset_hw_80003es2lan(struct e1000_hw *hw)
+ * @hw: pointer to the HW structure
+ *
+ * Initialize the hw bits, LED, VFTA, MTA, link and hw counters.
+- * This is a function pointer entry point called by the api module.
+ **/
+ static s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw)
+ {
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0019-e1000e-provide-comment-for-82571-workaround.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0019-e1000e-provide-comment-for-82571-workaround.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,34 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Fri, 20 Nov 2009 23:26:24 +0000
+Subject: [PATCH 019/166] e1000e: provide comment for 82571 workaround
+
+commit 84efb7b968ab91d0099620865b3f563eb0ddf5a6 upstream.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/82571.c | 7 +++++++
+ 1 files changed, 7 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+index 7cdf176..0e8aa34 100644
+--- a/drivers/net/e1000e/82571.c
++++ b/drivers/net/e1000e/82571.c
+@@ -1114,6 +1114,13 @@ static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw)
+ reg |= (1 << 22);
+ ew32(GCR, reg);
+
++ /*
++ * Workaround for hardware errata.
++ * apply workaround for hardware errata documented in errata
++ * docs Fixes issue where some error prone or unreliable PCIe
++ * completions are occurring, particularly with ASPM enabled.
++ * Without fix, issue can cause tx timeouts.
++ */
+ reg = er32(GCR2);
+ reg |= 1;
+ ew32(GCR2, reg);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0020-e1000e-set-bools-to-true-false-instead-of-1-0.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0020-e1000e-set-bools-to-true-false-instead-of-1-0.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,282 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Fri, 20 Nov 2009 23:26:44 +0000
+Subject: [PATCH 020/166] e1000e: set bools to true/false instead of 1/0
+
+commit 564ea9bba1a1380d5474504bcd943ee84075534f upstream.
+
+Set booleans to 'true' or 'false' to make it clear it is a boolean. Also
+change instances of TRUE/FALSE in comments to lowercase true/false.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/82571.c | 7 ++++---
+ drivers/net/e1000e/es2lan.c | 3 ++-
+ drivers/net/e1000e/ich8lan.c | 18 +++++++++---------
+ drivers/net/e1000e/lib.c | 24 ++++++++++++------------
+ drivers/net/e1000e/phy.c | 6 +++---
+ 5 files changed, 30 insertions(+), 28 deletions(-)
+
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+index 0e8aa34..468dd7d 100644
+--- a/drivers/net/e1000e/82571.c
++++ b/drivers/net/e1000e/82571.c
+@@ -230,7 +230,8 @@ static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter)
+ /* Set rar entry count */
+ mac->rar_entry_count = E1000_RAR_ENTRIES;
+ /* Set if manageability features are enabled. */
+- mac->arc_subsystem_valid = (er32(FWSM) & E1000_FWSM_MODE_MASK) ? 1 : 0;
++ mac->arc_subsystem_valid = (er32(FWSM) & E1000_FWSM_MODE_MASK)
++ ? true : false;
+
+ /* check for link */
+ switch (hw->phy.media_type) {
+@@ -753,7 +754,7 @@ static s32 e1000_get_cfg_done_82571(struct e1000_hw *hw)
+ /**
+ * e1000_set_d0_lplu_state_82571 - Set Low Power Linkup D0 state
+ * @hw: pointer to the HW structure
+- * @active: TRUE to enable LPLU, FALSE to disable
++ * @active: true to enable LPLU, false to disable
+ *
+ * Sets the LPLU D0 state according to the active flag. When activating LPLU
+ * this function also disables smart speed and vice versa. LPLU will not be
+@@ -1521,7 +1522,7 @@ static s32 e1000_valid_led_default_82571(struct e1000_hw *hw, u16 *data)
+ bool e1000e_get_laa_state_82571(struct e1000_hw *hw)
+ {
+ if (hw->mac.type != e1000_82571)
+- return 0;
++ return false;
+
+ return hw->dev_spec.e82571.laa_is_present;
+ }
+diff --git a/drivers/net/e1000e/es2lan.c b/drivers/net/e1000e/es2lan.c
+index 2d14156..795d433 100644
+--- a/drivers/net/e1000e/es2lan.c
++++ b/drivers/net/e1000e/es2lan.c
+@@ -213,7 +213,8 @@ static s32 e1000_init_mac_params_80003es2lan(struct e1000_adapter *adapter)
+ /* Set rar entry count */
+ mac->rar_entry_count = E1000_RAR_ENTRIES;
+ /* Set if manageability features are enabled. */
+- mac->arc_subsystem_valid = (er32(FWSM) & E1000_FWSM_MODE_MASK) ? 1 : 0;
++ mac->arc_subsystem_valid = (er32(FWSM) & E1000_FWSM_MODE_MASK)
++ ? true : false;
+
+ /* check for link */
+ switch (hw->phy.media_type) {
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index 759bd20..b2745cb 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -412,7 +412,7 @@ static s32 e1000_init_nvm_params_ich8lan(struct e1000_hw *hw)
+
+ /* Clear shadow ram */
+ for (i = 0; i < nvm->word_size; i++) {
+- dev_spec->shadow_ram[i].modified = 0;
++ dev_spec->shadow_ram[i].modified = false;
+ dev_spec->shadow_ram[i].value = 0xFFFF;
+ }
+
+@@ -441,7 +441,7 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_adapter *adapter)
+ if (mac->type == e1000_ich8lan)
+ mac->rar_entry_count--;
+ /* Set if manageability features are enabled. */
+- mac->arc_subsystem_valid = 1;
++ mac->arc_subsystem_valid = true;
+
+ /* LED operations */
+ switch (mac->type) {
+@@ -475,7 +475,7 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_adapter *adapter)
+
+ /* Enable PCS Lock-loss workaround for ICH8 */
+ if (mac->type == e1000_ich8lan)
+- e1000e_set_kmrn_lock_loss_workaround_ich8lan(hw, 1);
++ e1000e_set_kmrn_lock_loss_workaround_ich8lan(hw, true);
+
+ return 0;
+ }
+@@ -1415,7 +1415,7 @@ out:
+ /**
+ * e1000_set_d0_lplu_state_ich8lan - Set Low Power Linkup D0 state
+ * @hw: pointer to the HW structure
+- * @active: TRUE to enable LPLU, FALSE to disable
++ * @active: true to enable LPLU, false to disable
+ *
+ * Sets the LPLU D0 state according to the active flag. When
+ * activating LPLU this function also disables smart speed
+@@ -1501,7 +1501,7 @@ static s32 e1000_set_d0_lplu_state_ich8lan(struct e1000_hw *hw, bool active)
+ /**
+ * e1000_set_d3_lplu_state_ich8lan - Set Low Power Linkup D3 state
+ * @hw: pointer to the HW structure
+- * @active: TRUE to enable LPLU, FALSE to disable
++ * @active: true to enable LPLU, false to disable
+ *
+ * Sets the LPLU D3 state according to the active flag. When
+ * activating LPLU this function also disables smart speed
+@@ -1964,7 +1964,7 @@ static s32 e1000_write_nvm_ich8lan(struct e1000_hw *hw, u16 offset, u16 words,
+ nvm->ops.acquire(hw);
+
+ for (i = 0; i < words; i++) {
+- dev_spec->shadow_ram[offset+i].modified = 1;
++ dev_spec->shadow_ram[offset+i].modified = true;
+ dev_spec->shadow_ram[offset+i].value = data[i];
+ }
+
+@@ -2123,7 +2123,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)
+
+ /* Great! Everything worked, we can now clear the cached entries. */
+ for (i = 0; i < E1000_ICH8_SHADOW_RAM_WORDS; i++) {
+- dev_spec->shadow_ram[i].modified = 0;
++ dev_spec->shadow_ram[i].modified = false;
+ dev_spec->shadow_ram[i].value = 0xFFFF;
+ }
+
+@@ -3095,8 +3095,8 @@ static s32 e1000_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw)
+ * @hw: pointer to the HW structure
+ * @state: boolean value used to set the current Kumeran workaround state
+ *
+- * If ICH8, set the current Kumeran workaround state (enabled - TRUE
+- * /disabled - FALSE).
++ * If ICH8, set the current Kumeran workaround state (enabled - true
++ * /disabled - false).
+ **/
+ void e1000e_set_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw,
+ bool state)
+diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c
+index 0c6ad0e..d173bf8 100644
+--- a/drivers/net/e1000e/lib.c
++++ b/drivers/net/e1000e/lib.c
+@@ -371,7 +371,7 @@ s32 e1000e_check_for_copper_link(struct e1000_hw *hw)
+ if (!link)
+ return ret_val; /* No link detected */
+
+- mac->get_link_status = 0;
++ mac->get_link_status = false;
+
+ /*
+ * Check if there was DownShift, must be checked
+@@ -1603,7 +1603,7 @@ void e1000e_reset_adaptive(struct e1000_hw *hw)
+ mac->ifs_step_size = IFS_STEP;
+ mac->ifs_ratio = IFS_RATIO;
+
+- mac->in_ifs_mode = 0;
++ mac->in_ifs_mode = false;
+ ew32(AIT, 0);
+ }
+
+@@ -1620,7 +1620,7 @@ void e1000e_update_adaptive(struct e1000_hw *hw)
+
+ if ((mac->collision_delta * mac->ifs_ratio) > mac->tx_packet_delta) {
+ if (mac->tx_packet_delta > MIN_NUM_XMITS) {
+- mac->in_ifs_mode = 1;
++ mac->in_ifs_mode = true;
+ if (mac->current_ifs_val < mac->ifs_max_val) {
+ if (!mac->current_ifs_val)
+ mac->current_ifs_val = mac->ifs_min_val;
+@@ -1634,7 +1634,7 @@ void e1000e_update_adaptive(struct e1000_hw *hw)
+ if (mac->in_ifs_mode &&
+ (mac->tx_packet_delta <= MIN_NUM_XMITS)) {
+ mac->current_ifs_val = 0;
+- mac->in_ifs_mode = 0;
++ mac->in_ifs_mode = false;
+ ew32(AIT, 0);
+ }
+ }
+@@ -2277,7 +2277,7 @@ bool e1000e_enable_tx_pkt_filtering(struct e1000_hw *hw)
+
+ /* No manageability, no filtering */
+ if (!e1000e_check_mng_mode(hw)) {
+- hw->mac.tx_pkt_filtering = 0;
++ hw->mac.tx_pkt_filtering = false;
+ return 0;
+ }
+
+@@ -2287,7 +2287,7 @@ bool e1000e_enable_tx_pkt_filtering(struct e1000_hw *hw)
+ */
+ ret_val = e1000_mng_enable_host_if(hw);
+ if (ret_val != 0) {
+- hw->mac.tx_pkt_filtering = 0;
++ hw->mac.tx_pkt_filtering = false;
+ return ret_val;
+ }
+
+@@ -2306,17 +2306,17 @@ bool e1000e_enable_tx_pkt_filtering(struct e1000_hw *hw)
+ * take the safe route of assuming Tx filtering is enabled.
+ */
+ if ((hdr_csum != csum) || (hdr->signature != E1000_IAMT_SIGNATURE)) {
+- hw->mac.tx_pkt_filtering = 1;
++ hw->mac.tx_pkt_filtering = true;
+ return 1;
+ }
+
+ /* Cookie area is valid, make the final check for filtering. */
+ if (!(hdr->status & E1000_MNG_DHCP_COOKIE_STATUS_PARSING)) {
+- hw->mac.tx_pkt_filtering = 0;
++ hw->mac.tx_pkt_filtering = false;
+ return 0;
+ }
+
+- hw->mac.tx_pkt_filtering = 1;
++ hw->mac.tx_pkt_filtering = true;
+ return 1;
+ }
+
+@@ -2473,7 +2473,7 @@ bool e1000e_enable_mng_pass_thru(struct e1000_hw *hw)
+ {
+ u32 manc;
+ u32 fwsm, factps;
+- bool ret_val = 0;
++ bool ret_val = false;
+
+ manc = er32(MANC);
+
+@@ -2488,13 +2488,13 @@ bool e1000e_enable_mng_pass_thru(struct e1000_hw *hw)
+ if (!(factps & E1000_FACTPS_MNGCG) &&
+ ((fwsm & E1000_FWSM_MODE_MASK) ==
+ (e1000_mng_mode_pt << E1000_FWSM_MODE_SHIFT))) {
+- ret_val = 1;
++ ret_val = true;
+ return ret_val;
+ }
+ } else {
+ if ((manc & E1000_MANC_SMBUS_EN) &&
+ !(manc & E1000_MANC_ASF_EN)) {
+- ret_val = 1;
++ ret_val = true;
+ return ret_val;
+ }
+ }
+diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c
+index 38536ef..5cd01c6 100644
+--- a/drivers/net/e1000e/phy.c
++++ b/drivers/net/e1000e/phy.c
+@@ -824,7 +824,7 @@ s32 e1000e_copper_link_setup_igp(struct e1000_hw *hw)
+ msleep(100);
+
+ /* disable lplu d0 during driver init */
+- ret_val = e1000_set_d0_lplu_state(hw, 0);
++ ret_val = e1000_set_d0_lplu_state(hw, false);
+ if (ret_val) {
+ e_dbg("Error Disabling LPLU D0\n");
+ return ret_val;
+@@ -1535,7 +1535,7 @@ s32 e1000e_check_downshift(struct e1000_hw *hw)
+ break;
+ default:
+ /* speed downshift not supported */
+- phy->speed_downgraded = 0;
++ phy->speed_downgraded = false;
+ return 0;
+ }
+
+@@ -1897,7 +1897,7 @@ s32 e1000e_get_phy_info_igp(struct e1000_hw *hw)
+ return -E1000_ERR_CONFIG;
+ }
+
+- phy->polarity_correction = 1;
++ phy->polarity_correction = true;
+
+ ret_val = e1000_check_polarity_igp(hw);
+ if (ret_val)
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0021-e1000e-cleanup-shift-indentation-left-by-exiting-ear.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0021-e1000e-cleanup-shift-indentation-left-by-exiting-ear.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,140 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Fri, 20 Nov 2009 23:27:03 +0000
+Subject: [PATCH 021/166] e1000e: cleanup - shift indentation left by exiting
+ early in e1000_tso
+
+commit 3d5e33c9783d3e911e9aef0339663e887044f0df upstream.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/netdev.c | 114 +++++++++++++++++++++----------------------
+ 1 files changed, 55 insertions(+), 59 deletions(-)
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index c7660e5..c86a0d5 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -3754,68 +3754,64 @@ static int e1000_tso(struct e1000_adapter *adapter,
+ u8 ipcss, ipcso, tucss, tucso, hdr_len;
+ int err;
+
+- if (skb_is_gso(skb)) {
+- if (skb_header_cloned(skb)) {
+- err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC);
+- if (err)
+- return err;
+- }
++ if (!skb_is_gso(skb))
++ return 0;
+
+- hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb);
+- mss = skb_shinfo(skb)->gso_size;
+- if (skb->protocol == htons(ETH_P_IP)) {
+- struct iphdr *iph = ip_hdr(skb);
+- iph->tot_len = 0;
+- iph->check = 0;
+- tcp_hdr(skb)->check = ~csum_tcpudp_magic(iph->saddr,
+- iph->daddr, 0,
+- IPPROTO_TCP,
+- 0);
+- cmd_length = E1000_TXD_CMD_IP;
+- ipcse = skb_transport_offset(skb) - 1;
+- } else if (skb_shinfo(skb)->gso_type == SKB_GSO_TCPV6) {
+- ipv6_hdr(skb)->payload_len = 0;
+- tcp_hdr(skb)->check =
+- ~csum_ipv6_magic(&ipv6_hdr(skb)->saddr,
+- &ipv6_hdr(skb)->daddr,
+- 0, IPPROTO_TCP, 0);
+- ipcse = 0;
+- }
+- ipcss = skb_network_offset(skb);
+- ipcso = (void *)&(ip_hdr(skb)->check) - (void *)skb->data;
+- tucss = skb_transport_offset(skb);
+- tucso = (void *)&(tcp_hdr(skb)->check) - (void *)skb->data;
+- tucse = 0;
++ if (skb_header_cloned(skb)) {
++ err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC);
++ if (err)
++ return err;
++ }
+
+- cmd_length |= (E1000_TXD_CMD_DEXT | E1000_TXD_CMD_TSE |
+- E1000_TXD_CMD_TCP | (skb->len - (hdr_len)));
++ hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb);
++ mss = skb_shinfo(skb)->gso_size;
++ if (skb->protocol == htons(ETH_P_IP)) {
++ struct iphdr *iph = ip_hdr(skb);
++ iph->tot_len = 0;
++ iph->check = 0;
++ tcp_hdr(skb)->check = ~csum_tcpudp_magic(iph->saddr, iph->daddr,
++ 0, IPPROTO_TCP, 0);
++ cmd_length = E1000_TXD_CMD_IP;
++ ipcse = skb_transport_offset(skb) - 1;
++ } else if (skb_shinfo(skb)->gso_type == SKB_GSO_TCPV6) {
++ ipv6_hdr(skb)->payload_len = 0;
++ tcp_hdr(skb)->check = ~csum_ipv6_magic(&ipv6_hdr(skb)->saddr,
++ &ipv6_hdr(skb)->daddr,
++ 0, IPPROTO_TCP, 0);
++ ipcse = 0;
++ }
++ ipcss = skb_network_offset(skb);
++ ipcso = (void *)&(ip_hdr(skb)->check) - (void *)skb->data;
++ tucss = skb_transport_offset(skb);
++ tucso = (void *)&(tcp_hdr(skb)->check) - (void *)skb->data;
++ tucse = 0;
+
+- i = tx_ring->next_to_use;
+- context_desc = E1000_CONTEXT_DESC(*tx_ring, i);
+- buffer_info = &tx_ring->buffer_info[i];
++ cmd_length |= (E1000_TXD_CMD_DEXT | E1000_TXD_CMD_TSE |
++ E1000_TXD_CMD_TCP | (skb->len - (hdr_len)));
+
+- context_desc->lower_setup.ip_fields.ipcss = ipcss;
+- context_desc->lower_setup.ip_fields.ipcso = ipcso;
+- context_desc->lower_setup.ip_fields.ipcse = cpu_to_le16(ipcse);
+- context_desc->upper_setup.tcp_fields.tucss = tucss;
+- context_desc->upper_setup.tcp_fields.tucso = tucso;
+- context_desc->upper_setup.tcp_fields.tucse = cpu_to_le16(tucse);
+- context_desc->tcp_seg_setup.fields.mss = cpu_to_le16(mss);
+- context_desc->tcp_seg_setup.fields.hdr_len = hdr_len;
+- context_desc->cmd_and_length = cpu_to_le32(cmd_length);
++ i = tx_ring->next_to_use;
++ context_desc = E1000_CONTEXT_DESC(*tx_ring, i);
++ buffer_info = &tx_ring->buffer_info[i];
+
+- buffer_info->time_stamp = jiffies;
+- buffer_info->next_to_watch = i;
++ context_desc->lower_setup.ip_fields.ipcss = ipcss;
++ context_desc->lower_setup.ip_fields.ipcso = ipcso;
++ context_desc->lower_setup.ip_fields.ipcse = cpu_to_le16(ipcse);
++ context_desc->upper_setup.tcp_fields.tucss = tucss;
++ context_desc->upper_setup.tcp_fields.tucso = tucso;
++ context_desc->upper_setup.tcp_fields.tucse = cpu_to_le16(tucse);
++ context_desc->tcp_seg_setup.fields.mss = cpu_to_le16(mss);
++ context_desc->tcp_seg_setup.fields.hdr_len = hdr_len;
++ context_desc->cmd_and_length = cpu_to_le32(cmd_length);
+
+- i++;
+- if (i == tx_ring->count)
+- i = 0;
+- tx_ring->next_to_use = i;
++ buffer_info->time_stamp = jiffies;
++ buffer_info->next_to_watch = i;
+
+- return 1;
+- }
++ i++;
++ if (i == tx_ring->count)
++ i = 0;
++ tx_ring->next_to_use = i;
+
+- return 0;
++ return 1;
+ }
+
+ static bool e1000_tx_csum(struct e1000_adapter *adapter, struct sk_buff *skb)
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0022-e1000e-cleanup-functions-that-clear-hardware-statist.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0022-e1000e-cleanup-functions-that-clear-hardware-statist.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,317 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Fri, 20 Nov 2009 23:27:21 +0000
+Subject: [PATCH 022/166] e1000e: cleanup functions that clear hardware
+ statistics
+
+commit 99673d9b5d48c81f2e9fe094c0d9e42815c60b3f upstream.
+
+The e1000_clear_hw_cntrs_*() functions read the registers to clear them.
+There is no reason to save the register contents so the temp variable can
+be removed.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/82571.c | 70 +++++++++++++++++++--------------------
+ drivers/net/e1000e/es2lan.c | 70 +++++++++++++++++++--------------------
+ drivers/net/e1000e/ich8lan.c | 23 ++++++-------
+ drivers/net/e1000e/lib.c | 76 ++++++++++++++++++++---------------------
+ 4 files changed, 116 insertions(+), 123 deletions(-)
+
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+index 468dd7d..c5dc1b3 100644
+--- a/drivers/net/e1000e/82571.c
++++ b/drivers/net/e1000e/82571.c
+@@ -1613,44 +1613,42 @@ static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw)
+ **/
+ static void e1000_clear_hw_cntrs_82571(struct e1000_hw *hw)
+ {
+- u32 temp;
+-
+ e1000e_clear_hw_cntrs_base(hw);
+
+- temp = er32(PRC64);
+- temp = er32(PRC127);
+- temp = er32(PRC255);
+- temp = er32(PRC511);
+- temp = er32(PRC1023);
+- temp = er32(PRC1522);
+- temp = er32(PTC64);
+- temp = er32(PTC127);
+- temp = er32(PTC255);
+- temp = er32(PTC511);
+- temp = er32(PTC1023);
+- temp = er32(PTC1522);
+-
+- temp = er32(ALGNERRC);
+- temp = er32(RXERRC);
+- temp = er32(TNCRS);
+- temp = er32(CEXTERR);
+- temp = er32(TSCTC);
+- temp = er32(TSCTFC);
+-
+- temp = er32(MGTPRC);
+- temp = er32(MGTPDC);
+- temp = er32(MGTPTC);
+-
+- temp = er32(IAC);
+- temp = er32(ICRXOC);
+-
+- temp = er32(ICRXPTC);
+- temp = er32(ICRXATC);
+- temp = er32(ICTXPTC);
+- temp = er32(ICTXATC);
+- temp = er32(ICTXQEC);
+- temp = er32(ICTXQMTC);
+- temp = er32(ICRXDMTC);
++ er32(PRC64);
++ er32(PRC127);
++ er32(PRC255);
++ er32(PRC511);
++ er32(PRC1023);
++ er32(PRC1522);
++ er32(PTC64);
++ er32(PTC127);
++ er32(PTC255);
++ er32(PTC511);
++ er32(PTC1023);
++ er32(PTC1522);
++
++ er32(ALGNERRC);
++ er32(RXERRC);
++ er32(TNCRS);
++ er32(CEXTERR);
++ er32(TSCTC);
++ er32(TSCTFC);
++
++ er32(MGTPRC);
++ er32(MGTPDC);
++ er32(MGTPTC);
++
++ er32(IAC);
++ er32(ICRXOC);
++
++ er32(ICRXPTC);
++ er32(ICRXATC);
++ er32(ICTXPTC);
++ er32(ICTXATC);
++ er32(ICTXQEC);
++ er32(ICTXQMTC);
++ er32(ICRXDMTC);
+ }
+
+ static struct e1000_mac_operations e82571_mac_ops = {
+diff --git a/drivers/net/e1000e/es2lan.c b/drivers/net/e1000e/es2lan.c
+index 795d433..8a08956 100644
+--- a/drivers/net/e1000e/es2lan.c
++++ b/drivers/net/e1000e/es2lan.c
+@@ -1304,44 +1304,42 @@ static s32 e1000_write_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
+ **/
+ static void e1000_clear_hw_cntrs_80003es2lan(struct e1000_hw *hw)
+ {
+- u32 temp;
+-
+ e1000e_clear_hw_cntrs_base(hw);
+
+- temp = er32(PRC64);
+- temp = er32(PRC127);
+- temp = er32(PRC255);
+- temp = er32(PRC511);
+- temp = er32(PRC1023);
+- temp = er32(PRC1522);
+- temp = er32(PTC64);
+- temp = er32(PTC127);
+- temp = er32(PTC255);
+- temp = er32(PTC511);
+- temp = er32(PTC1023);
+- temp = er32(PTC1522);
+-
+- temp = er32(ALGNERRC);
+- temp = er32(RXERRC);
+- temp = er32(TNCRS);
+- temp = er32(CEXTERR);
+- temp = er32(TSCTC);
+- temp = er32(TSCTFC);
+-
+- temp = er32(MGTPRC);
+- temp = er32(MGTPDC);
+- temp = er32(MGTPTC);
+-
+- temp = er32(IAC);
+- temp = er32(ICRXOC);
+-
+- temp = er32(ICRXPTC);
+- temp = er32(ICRXATC);
+- temp = er32(ICTXPTC);
+- temp = er32(ICTXATC);
+- temp = er32(ICTXQEC);
+- temp = er32(ICTXQMTC);
+- temp = er32(ICRXDMTC);
++ er32(PRC64);
++ er32(PRC127);
++ er32(PRC255);
++ er32(PRC511);
++ er32(PRC1023);
++ er32(PRC1522);
++ er32(PTC64);
++ er32(PTC127);
++ er32(PTC255);
++ er32(PTC511);
++ er32(PTC1023);
++ er32(PTC1522);
++
++ er32(ALGNERRC);
++ er32(RXERRC);
++ er32(TNCRS);
++ er32(CEXTERR);
++ er32(TSCTC);
++ er32(TSCTFC);
++
++ er32(MGTPRC);
++ er32(MGTPDC);
++ er32(MGTPTC);
++
++ er32(IAC);
++ er32(ICRXOC);
++
++ er32(ICRXPTC);
++ er32(ICRXATC);
++ er32(ICTXPTC);
++ er32(ICTXATC);
++ er32(ICTXQEC);
++ er32(ICTXQMTC);
++ er32(ICRXDMTC);
+ }
+
+ static struct e1000_mac_operations es2_mac_ops = {
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index b2745cb..7b3f0ae 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -3415,24 +3415,23 @@ static s32 e1000_get_cfg_done_ich8lan(struct e1000_hw *hw)
+ **/
+ static void e1000_clear_hw_cntrs_ich8lan(struct e1000_hw *hw)
+ {
+- u32 temp;
+ u16 phy_data;
+
+ e1000e_clear_hw_cntrs_base(hw);
+
+- temp = er32(ALGNERRC);
+- temp = er32(RXERRC);
+- temp = er32(TNCRS);
+- temp = er32(CEXTERR);
+- temp = er32(TSCTC);
+- temp = er32(TSCTFC);
++ er32(ALGNERRC);
++ er32(RXERRC);
++ er32(TNCRS);
++ er32(CEXTERR);
++ er32(TSCTC);
++ er32(TSCTFC);
+
+- temp = er32(MGTPRC);
+- temp = er32(MGTPDC);
+- temp = er32(MGTPTC);
++ er32(MGTPRC);
++ er32(MGTPDC);
++ er32(MGTPTC);
+
+- temp = er32(IAC);
+- temp = er32(ICRXOC);
++ er32(IAC);
++ er32(ICRXOC);
+
+ /* Clear PHY statistics registers */
+ if ((hw->phy.type == e1000_phy_82578) ||
+diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c
+index d173bf8..f690a10 100644
+--- a/drivers/net/e1000e/lib.c
++++ b/drivers/net/e1000e/lib.c
+@@ -295,45 +295,43 @@ void e1000e_update_mc_addr_list_generic(struct e1000_hw *hw,
+ **/
+ void e1000e_clear_hw_cntrs_base(struct e1000_hw *hw)
+ {
+- u32 temp;
+-
+- temp = er32(CRCERRS);
+- temp = er32(SYMERRS);
+- temp = er32(MPC);
+- temp = er32(SCC);
+- temp = er32(ECOL);
+- temp = er32(MCC);
+- temp = er32(LATECOL);
+- temp = er32(COLC);
+- temp = er32(DC);
+- temp = er32(SEC);
+- temp = er32(RLEC);
+- temp = er32(XONRXC);
+- temp = er32(XONTXC);
+- temp = er32(XOFFRXC);
+- temp = er32(XOFFTXC);
+- temp = er32(FCRUC);
+- temp = er32(GPRC);
+- temp = er32(BPRC);
+- temp = er32(MPRC);
+- temp = er32(GPTC);
+- temp = er32(GORCL);
+- temp = er32(GORCH);
+- temp = er32(GOTCL);
+- temp = er32(GOTCH);
+- temp = er32(RNBC);
+- temp = er32(RUC);
+- temp = er32(RFC);
+- temp = er32(ROC);
+- temp = er32(RJC);
+- temp = er32(TORL);
+- temp = er32(TORH);
+- temp = er32(TOTL);
+- temp = er32(TOTH);
+- temp = er32(TPR);
+- temp = er32(TPT);
+- temp = er32(MPTC);
+- temp = er32(BPTC);
++ er32(CRCERRS);
++ er32(SYMERRS);
++ er32(MPC);
++ er32(SCC);
++ er32(ECOL);
++ er32(MCC);
++ er32(LATECOL);
++ er32(COLC);
++ er32(DC);
++ er32(SEC);
++ er32(RLEC);
++ er32(XONRXC);
++ er32(XONTXC);
++ er32(XOFFRXC);
++ er32(XOFFTXC);
++ er32(FCRUC);
++ er32(GPRC);
++ er32(BPRC);
++ er32(MPRC);
++ er32(GPTC);
++ er32(GORCL);
++ er32(GORCH);
++ er32(GOTCL);
++ er32(GOTCH);
++ er32(RNBC);
++ er32(RUC);
++ er32(RFC);
++ er32(ROC);
++ er32(RJC);
++ er32(TORL);
++ er32(TORH);
++ er32(TOTL);
++ er32(TOTH);
++ er32(TPR);
++ er32(TPT);
++ er32(MPTC);
++ er32(BPTC);
+ }
+
+ /**
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0023-e1000e-set-pm_qos-DMA-latency-requirement-per-interf.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0023-e1000e-set-pm_qos-DMA-latency-requirement-per-interf.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,110 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Fri, 20 Nov 2009 23:27:40 +0000
+Subject: [PATCH 023/166] e1000e: set pm_qos DMA latency requirement per
+ interface when needed
+
+commit 53ec5498d107a61b84944351d32324ce52788b74 upstream.
+
+It was pointed out a pm_qos DMA latency requirement set when the driver is
+loaded when parts that support early receive of jumbo frames are probed
+could have that requirement overidden if another part supported by the
+driver (one that does not support early receive of jumbo frames) is probed
+later. Change the DMA latency requirement to be per-interface if needed
+instead of per driver.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/netdev.c | 47 +++++++++++++++++++++++++-----------------
+ 1 files changed, 28 insertions(+), 19 deletions(-)
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index c86a0d5..817bb81 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -2479,21 +2479,23 @@ static void e1000_configure_rx(struct e1000_adapter *adapter)
+ * packet size is equal or larger than the specified value (in 8 byte
+ * units), e.g. using jumbo frames when setting to E1000_ERT_2048
+ */
+- if ((adapter->flags & FLAG_HAS_ERT) &&
+- (adapter->netdev->mtu > ETH_DATA_LEN)) {
+- u32 rxdctl = er32(RXDCTL(0));
+- ew32(RXDCTL(0), rxdctl | 0x3);
+- ew32(ERT, E1000_ERT_2048 | (1 << 13));
+- /*
+- * With jumbo frames and early-receive enabled, excessive
+- * C4->C2 latencies result in dropped transactions.
+- */
+- pm_qos_update_requirement(PM_QOS_CPU_DMA_LATENCY,
+- e1000e_driver_name, 55);
+- } else {
+- pm_qos_update_requirement(PM_QOS_CPU_DMA_LATENCY,
+- e1000e_driver_name,
+- PM_QOS_DEFAULT_VALUE);
++ if (adapter->flags & FLAG_HAS_ERT) {
++ if (adapter->netdev->mtu > ETH_DATA_LEN) {
++ u32 rxdctl = er32(RXDCTL(0));
++ ew32(RXDCTL(0), rxdctl | 0x3);
++ ew32(ERT, E1000_ERT_2048 | (1 << 13));
++ /*
++ * With jumbo frames and early-receive enabled,
++ * excessive C-state transition latencies result in
++ * dropped transactions.
++ */
++ pm_qos_update_requirement(PM_QOS_CPU_DMA_LATENCY,
++ adapter->netdev->name, 55);
++ } else {
++ pm_qos_update_requirement(PM_QOS_CPU_DMA_LATENCY,
++ adapter->netdev->name,
++ PM_QOS_DEFAULT_VALUE);
++ }
+ }
+
+ /* Enable Receives */
+@@ -2828,6 +2830,12 @@ int e1000e_up(struct e1000_adapter *adapter)
+ {
+ struct e1000_hw *hw = &adapter->hw;
+
++ /* DMA latency requirement to workaround early-receive/jumbo issue */
++ if (adapter->flags & FLAG_HAS_ERT)
++ pm_qos_add_requirement(PM_QOS_CPU_DMA_LATENCY,
++ adapter->netdev->name,
++ PM_QOS_DEFAULT_VALUE);
++
+ /* hardware has been reset, we need to reload some things */
+ e1000_configure(adapter);
+
+@@ -2888,6 +2896,10 @@ void e1000e_down(struct e1000_adapter *adapter)
+ e1000_clean_tx_ring(adapter);
+ e1000_clean_rx_ring(adapter);
+
++ if (adapter->flags & FLAG_HAS_ERT)
++ pm_qos_remove_requirement(PM_QOS_CPU_DMA_LATENCY,
++ adapter->netdev->name);
++
+ /*
+ * TODO: for power management, we could drop the link and
+ * pci_disable_device here.
+@@ -5387,9 +5399,7 @@ static int __init e1000_init_module(void)
+ printk(KERN_INFO "%s: Copyright (c) 1999 - 2009 Intel Corporation.\n",
+ e1000e_driver_name);
+ ret = pci_register_driver(&e1000_driver);
+- pm_qos_add_requirement(PM_QOS_CPU_DMA_LATENCY, e1000e_driver_name,
+- PM_QOS_DEFAULT_VALUE);
+-
++
+ return ret;
+ }
+ module_init(e1000_init_module);
+@@ -5403,7 +5413,6 @@ module_init(e1000_init_module);
+ static void __exit e1000_exit_module(void)
+ {
+ pci_unregister_driver(&e1000_driver);
+- pm_qos_remove_requirement(PM_QOS_CPU_DMA_LATENCY, e1000e_driver_name);
+ }
+ module_exit(e1000_exit_module);
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0024-e1000e-do-not-error-out-on-identification-LED-init-f.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0024-e1000e-do-not-error-out-on-identification-LED-init-f.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,73 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Fri, 20 Nov 2009 23:27:59 +0000
+Subject: [PATCH 024/166] e1000e: do not error out on identification LED init
+ failure
+
+commit de39b7523348640f4c0e662e430c67594d858a08 upstream.
+
+A failure to initialize the identification LED is not a fatal condition and
+should allow the init path to continue.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/82571.c | 5 ++---
+ drivers/net/e1000e/es2lan.c | 5 ++---
+ drivers/net/e1000e/ich8lan.c | 5 ++---
+ 3 files changed, 6 insertions(+), 9 deletions(-)
+
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+index c5dc1b3..474f4e4 100644
+--- a/drivers/net/e1000e/82571.c
++++ b/drivers/net/e1000e/82571.c
+@@ -948,10 +948,9 @@ static s32 e1000_init_hw_82571(struct e1000_hw *hw)
+
+ /* Initialize identification LED */
+ ret_val = e1000e_id_led_init(hw);
+- if (ret_val) {
++ if (ret_val)
+ e_dbg("Error initializing identification LED\n");
+- return ret_val;
+- }
++ /* This is not fatal and we should not stop init due to this */
+
+ /* Disabling VLAN filtering */
+ e_dbg("Initializing the IEEE VLAN\n");
+diff --git a/drivers/net/e1000e/es2lan.c b/drivers/net/e1000e/es2lan.c
+index 8a08956..6ba1228 100644
+--- a/drivers/net/e1000e/es2lan.c
++++ b/drivers/net/e1000e/es2lan.c
+@@ -803,10 +803,9 @@ static s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw)
+
+ /* Initialize identification LED */
+ ret_val = e1000e_id_led_init(hw);
+- if (ret_val) {
++ if (ret_val)
+ e_dbg("Error initializing identification LED\n");
+- return ret_val;
+- }
++ /* This is not fatal and we should not stop init due to this */
+
+ /* Disabling VLAN filtering */
+ e_dbg("Initializing the IEEE VLAN\n");
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index 7b3f0ae..5d69e59 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -2734,10 +2734,9 @@ static s32 e1000_init_hw_ich8lan(struct e1000_hw *hw)
+
+ /* Initialize identification LED */
+ ret_val = mac->ops.id_led_init(hw);
+- if (ret_val) {
++ if (ret_val)
+ e_dbg("Error initializing identification LED\n");
+- return ret_val;
+- }
++ /* This is not fatal and we should not stop init due to this */
+
+ /* Setup the receive address. */
+ e1000e_init_rx_addrs(hw, mac->rar_entry_count);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0025-e1000e-remove-redundant-might_sleep.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0025-e1000e-remove-redundant-might_sleep.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,31 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Fri, 20 Nov 2009 23:28:17 +0000
+Subject: [PATCH 025/166] e1000e: remove redundant might_sleep()
+
+commit 9b724613c91ce60806ffc689f5032ff258644c6c upstream.
+
+Now that mutex_lock() calls might_sleep() the driver doesn't have to here.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/ich8lan.c | 2 --
+ 1 files changed, 0 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index 5d69e59..f5b9855 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -641,8 +641,6 @@ static s32 e1000_acquire_swflag_ich8lan(struct e1000_hw *hw)
+ u32 extcnf_ctrl, timeout = PHY_CFG_TIMEOUT;
+ s32 ret_val = 0;
+
+- might_sleep();
+-
+ mutex_lock(&swflag_mutex);
+
+ while (timeout) {
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0026-e1000e-cosmetic-group-local-variables-of-the-same-ty.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0026-e1000e-cosmetic-group-local-variables-of-the-same-ty.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,105 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Fri, 20 Nov 2009 23:28:37 +0000
+Subject: [PATCH 026/166] e1000e: cosmetic - group local variables of the same
+ type
+
+commit a708dd88a014a8fd78713adbd19bc61046eaac7f upstream.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/82571.c | 11 +++--------
+ drivers/net/e1000e/es2lan.c | 6 ++----
+ drivers/net/e1000e/ich8lan.c | 8 ++++----
+ 3 files changed, 9 insertions(+), 16 deletions(-)
+
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+index 474f4e4..62bbc6e 100644
+--- a/drivers/net/e1000e/82571.c
++++ b/drivers/net/e1000e/82571.c
+@@ -693,8 +693,7 @@ static s32 e1000_write_nvm_eewr_82571(struct e1000_hw *hw, u16 offset,
+ u16 words, u16 *data)
+ {
+ struct e1000_nvm_info *nvm = &hw->nvm;
+- u32 i;
+- u32 eewr = 0;
++ u32 i, eewr = 0;
+ s32 ret_val = 0;
+
+ /*
+@@ -829,10 +828,7 @@ static s32 e1000_set_d0_lplu_state_82571(struct e1000_hw *hw, bool active)
+ **/
+ static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
+ {
+- u32 ctrl;
+- u32 extcnf_ctrl;
+- u32 ctrl_ext;
+- u32 icr;
++ u32 ctrl, extcnf_ctrl, ctrl_ext, icr;
+ s32 ret_val;
+ u16 i = 0;
+
+@@ -941,8 +937,7 @@ static s32 e1000_init_hw_82571(struct e1000_hw *hw)
+ struct e1000_mac_info *mac = &hw->mac;
+ u32 reg_data;
+ s32 ret_val;
+- u16 i;
+- u16 rar_count = mac->rar_entry_count;
++ u16 i, rar_count = mac->rar_entry_count;
+
+ e1000_initialize_hw_bits_82571(hw);
+
+diff --git a/drivers/net/e1000e/es2lan.c b/drivers/net/e1000e/es2lan.c
+index 6ba1228..e505798 100644
+--- a/drivers/net/e1000e/es2lan.c
++++ b/drivers/net/e1000e/es2lan.c
+@@ -695,8 +695,7 @@ static s32 e1000_get_cable_length_80003es2lan(struct e1000_hw *hw)
+ {
+ struct e1000_phy_info *phy = &hw->phy;
+ s32 ret_val;
+- u16 phy_data;
+- u16 index;
++ u16 phy_data, index;
+
+ ret_val = e1e_rphy(hw, GG82563_PHY_DSP_DISTANCE, &phy_data);
+ if (ret_val)
+@@ -746,8 +745,7 @@ static s32 e1000_get_link_up_info_80003es2lan(struct e1000_hw *hw, u16 *speed,
+ **/
+ static s32 e1000_reset_hw_80003es2lan(struct e1000_hw *hw)
+ {
+- u32 ctrl;
+- u32 icr;
++ u32 ctrl, icr;
+ s32 ret_val;
+
+ /*
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index f5b9855..08a942e 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -717,7 +717,9 @@ static void e1000_release_swflag_ich8lan(struct e1000_hw *hw)
+ **/
+ static bool e1000_check_mng_mode_ich8lan(struct e1000_hw *hw)
+ {
+- u32 fwsm = er32(FWSM);
++ u32 fwsm;
++
++ fwsm = er32(FWSM);
+
+ return (fwsm & E1000_FWSM_MODE_MASK) ==
+ (E1000_ICH_MNG_IAMT_MODE << E1000_FWSM_MODE_SHIFT);
+@@ -2361,9 +2363,7 @@ static s32 e1000_erase_flash_bank_ich8lan(struct e1000_hw *hw, u32 bank)
+ u32 flash_bank_size = nvm->flash_bank_size * 2;
+ s32 ret_val;
+ s32 count = 0;
+- s32 iteration;
+- s32 sector_size;
+- s32 j;
++ s32 j, iteration, sector_size;
+
+ hsfsts.regval = er16flash(ICH_FLASH_HSFSTS);
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0027-e1000e-update-Tx-Unit-hang-detection-message.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0027-e1000e-update-Tx-Unit-hang-detection-message.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,141 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Fri, 20 Nov 2009 23:28:56 +0000
+Subject: [PATCH 027/166] e1000e: update Tx Unit hang detection message
+
+commit 41cec6f1160c110bd69597c2a5611b46e8287801 upstream.
+
+The Tx unit hang detection code in e1000e detects other hangs caused by
+hardware components (e.g. Rx, DMA units), but it is not possible to detect
+exactly which component is hung so it has always assumed a Tx unit hang.
+When dumping a message to the system log because of a hang, this patch adds
+more data to help narrow the cause of the issue and makes the message
+non-Tx-specific. Because this new code reads PHY registers which can
+sleep, move it off to a workqueue. This and all previously existing work
+tasks in the driver are now cancelled when the driver is removed.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/e1000.h | 1 +
+ drivers/net/e1000e/netdev.c | 46 +++++++++++++++++++++++++++++++++++-------
+ 2 files changed, 39 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
+index 7f15703..462e387 100644
+--- a/drivers/net/e1000e/e1000.h
++++ b/drivers/net/e1000e/e1000.h
+@@ -366,6 +366,7 @@ struct e1000_adapter {
+ struct work_struct downshift_task;
+ struct work_struct update_phy_task;
+ struct work_struct led_blink_task;
++ struct work_struct print_hang_task;
+ };
+
+ struct e1000_info {
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 817bb81..80a3983 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -554,15 +554,27 @@ static void e1000_put_txbuf(struct e1000_adapter *adapter,
+ buffer_info->time_stamp = 0;
+ }
+
+-static void e1000_print_tx_hang(struct e1000_adapter *adapter)
++static void e1000_print_hw_hang(struct work_struct *work)
+ {
++ struct e1000_adapter *adapter = container_of(work,
++ struct e1000_adapter,
++ print_hang_task);
+ struct e1000_ring *tx_ring = adapter->tx_ring;
+ unsigned int i = tx_ring->next_to_clean;
+ unsigned int eop = tx_ring->buffer_info[i].next_to_watch;
+ struct e1000_tx_desc *eop_desc = E1000_TX_DESC(*tx_ring, eop);
++ struct e1000_hw *hw = &adapter->hw;
++ u16 phy_status, phy_1000t_status, phy_ext_status;
++ u16 pci_status;
++
++ e1e_rphy(hw, PHY_STATUS, &phy_status);
++ e1e_rphy(hw, PHY_1000T_STATUS, &phy_1000t_status);
++ e1e_rphy(hw, PHY_EXT_STATUS, &phy_ext_status);
+
+- /* detected Tx unit hang */
+- e_err("Detected Tx Unit Hang:\n"
++ pci_read_config_word(adapter->pdev, PCI_STATUS, &pci_status);
++
++ /* detected Hardware unit hang */
++ e_err("Detected Hardware Unit Hang:\n"
+ " TDH <%x>\n"
+ " TDT <%x>\n"
+ " next_to_use <%x>\n"
+@@ -571,7 +583,12 @@ static void e1000_print_tx_hang(struct e1000_adapter *adapter)
+ " time_stamp <%lx>\n"
+ " next_to_watch <%x>\n"
+ " jiffies <%lx>\n"
+- " next_to_watch.status <%x>\n",
++ " next_to_watch.status <%x>\n"
++ "MAC Status <%x>\n"
++ "PHY Status <%x>\n"
++ "PHY 1000BASE-T Status <%x>\n"
++ "PHY Extended Status <%x>\n"
++ "PCI Status <%x>\n",
+ readl(adapter->hw.hw_addr + tx_ring->head),
+ readl(adapter->hw.hw_addr + tx_ring->tail),
+ tx_ring->next_to_use,
+@@ -579,7 +596,12 @@ static void e1000_print_tx_hang(struct e1000_adapter *adapter)
+ tx_ring->buffer_info[eop].time_stamp,
+ eop,
+ jiffies,
+- eop_desc->upper.fields.status);
++ eop_desc->upper.fields.status,
++ er32(STATUS),
++ phy_status,
++ phy_1000t_status,
++ phy_ext_status,
++ pci_status);
+ }
+
+ /**
+@@ -655,14 +677,16 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter)
+ }
+
+ if (adapter->detect_tx_hung) {
+- /* Detect a transmit hang in hardware, this serializes the
+- * check with the clearing of time_stamp and movement of i */
++ /*
++ * Detect a transmit hang in hardware, this serializes the
++ * check with the clearing of time_stamp and movement of i
++ */
+ adapter->detect_tx_hung = 0;
+ if (tx_ring->buffer_info[i].time_stamp &&
+ time_after(jiffies, tx_ring->buffer_info[i].time_stamp
+ + (adapter->tx_timeout_factor * HZ))
+ && !(er32(STATUS) & E1000_STATUS_TXOFF)) {
+- e1000_print_tx_hang(adapter);
++ schedule_work(&adapter->print_hang_task);
+ netif_stop_queue(netdev);
+ }
+ }
+@@ -5140,6 +5164,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
+ INIT_WORK(&adapter->watchdog_task, e1000_watchdog_task);
+ INIT_WORK(&adapter->downshift_task, e1000e_downshift_workaround);
+ INIT_WORK(&adapter->update_phy_task, e1000e_update_phy_task);
++ INIT_WORK(&adapter->print_hang_task, e1000_print_hw_hang);
+
+ /* Initialize link parameters. User can change them with ethtool */
+ adapter->hw.mac.autoneg = 1;
+@@ -5264,6 +5289,11 @@ static void __devexit e1000_remove(struct pci_dev *pdev)
+ del_timer_sync(&adapter->watchdog_timer);
+ del_timer_sync(&adapter->phy_info_timer);
+
++ cancel_work_sync(&adapter->reset_task);
++ cancel_work_sync(&adapter->watchdog_task);
++ cancel_work_sync(&adapter->downshift_task);
++ cancel_work_sync(&adapter->update_phy_task);
++ cancel_work_sync(&adapter->print_hang_task);
+ flush_scheduled_work();
+
+ /*
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0028-e1000e-provide-family-specific-functions-to-manage-V.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0028-e1000e-provide-family-specific-functions-to-manage-V.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,217 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Tue, 1 Dec 2009 15:46:43 +0000
+Subject: [PATCH 028/166] e1000e: provide family-specific functions to manage
+ VLAN filter arrays
+
+commit caaddaf83501c79fe11b183c8972e60d8b7d5d56 upstream.
+
+The two MAC-families that have VLAN filter table register arrays manage
+each a bit differently from one another, so provide family-specific
+functions for managing the register arrays and function pointers to access
+the appropriate function. Also make sure attempts to access these
+register arrays are not done on parts not supporting that feature.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/82571.c | 9 ++++++---
+ drivers/net/e1000e/e1000.h | 4 ++--
+ drivers/net/e1000e/es2lan.c | 4 +++-
+ drivers/net/e1000e/hw.h | 2 ++
+ drivers/net/e1000e/lib.c | 21 +++++++++++++++++++--
+ drivers/net/e1000e/netdev.c | 21 +++++++++++++--------
+ 6 files changed, 45 insertions(+), 16 deletions(-)
+
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+index 62bbc6e..8ea3ed7 100644
+--- a/drivers/net/e1000e/82571.c
++++ b/drivers/net/e1000e/82571.c
+@@ -65,6 +65,7 @@ static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw);
+ static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw);
+ static s32 e1000_setup_link_82571(struct e1000_hw *hw);
+ static void e1000_clear_hw_cntrs_82571(struct e1000_hw *hw);
++static void e1000_clear_vfta_82571(struct e1000_hw *hw);
+ static bool e1000_check_mng_mode_82574(struct e1000_hw *hw);
+ static s32 e1000_led_on_82574(struct e1000_hw *hw);
+ static void e1000_put_hw_semaphore_82571(struct e1000_hw *hw);
+@@ -949,7 +950,7 @@ static s32 e1000_init_hw_82571(struct e1000_hw *hw)
+
+ /* Disabling VLAN filtering */
+ e_dbg("Initializing the IEEE VLAN\n");
+- e1000e_clear_vfta(hw);
++ mac->ops.clear_vfta(hw);
+
+ /* Setup the receive address. */
+ /*
+@@ -1128,13 +1129,13 @@ static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw)
+ }
+
+ /**
+- * e1000e_clear_vfta - Clear VLAN filter table
++ * e1000_clear_vfta_82571 - Clear VLAN filter table
+ * @hw: pointer to the HW structure
+ *
+ * Clears the register array which contains the VLAN filter table by
+ * setting all the values to 0.
+ **/
+-void e1000e_clear_vfta(struct e1000_hw *hw)
++static void e1000_clear_vfta_82571(struct e1000_hw *hw)
+ {
+ u32 offset;
+ u32 vfta_value = 0;
+@@ -1656,6 +1657,8 @@ static struct e1000_mac_operations e82571_mac_ops = {
+ /* .led_on: mac type dependent */
+ .led_off = e1000e_led_off_generic,
+ .update_mc_addr_list = e1000_update_mc_addr_list_82571,
++ .write_vfta = e1000_write_vfta_generic,
++ .clear_vfta = e1000_clear_vfta_82571,
+ .reset_hw = e1000_reset_hw_82571,
+ .init_hw = e1000_init_hw_82571,
+ .setup_link = e1000_setup_link_82571,
+diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
+index 462e387..4706b7e 100644
+--- a/drivers/net/e1000e/e1000.h
++++ b/drivers/net/e1000e/e1000.h
+@@ -510,7 +510,7 @@ extern s32 e1000e_setup_fiber_serdes_link(struct e1000_hw *hw);
+ extern s32 e1000e_copper_link_setup_m88(struct e1000_hw *hw);
+ extern s32 e1000e_copper_link_setup_igp(struct e1000_hw *hw);
+ extern s32 e1000e_setup_link(struct e1000_hw *hw);
+-extern void e1000e_clear_vfta(struct e1000_hw *hw);
++extern void e1000_clear_vfta_generic(struct e1000_hw *hw);
+ extern void e1000e_init_rx_addrs(struct e1000_hw *hw, u16 rar_count);
+ extern void e1000e_update_mc_addr_list_generic(struct e1000_hw *hw,
+ u8 *mc_addr_list,
+@@ -526,7 +526,7 @@ extern void e1000e_config_collision_dist(struct e1000_hw *hw);
+ extern s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw);
+ extern s32 e1000e_force_mac_fc(struct e1000_hw *hw);
+ extern s32 e1000e_blink_led(struct e1000_hw *hw);
+-extern void e1000e_write_vfta(struct e1000_hw *hw, u32 offset, u32 value);
++extern void e1000_write_vfta_generic(struct e1000_hw *hw, u32 offset, u32 value);
+ extern void e1000e_reset_adaptive(struct e1000_hw *hw);
+ extern void e1000e_update_adaptive(struct e1000_hw *hw);
+
+diff --git a/drivers/net/e1000e/es2lan.c b/drivers/net/e1000e/es2lan.c
+index e505798..3ff932f 100644
+--- a/drivers/net/e1000e/es2lan.c
++++ b/drivers/net/e1000e/es2lan.c
+@@ -807,7 +807,7 @@ static s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw)
+
+ /* Disabling VLAN filtering */
+ e_dbg("Initializing the IEEE VLAN\n");
+- e1000e_clear_vfta(hw);
++ mac->ops.clear_vfta(hw);
+
+ /* Setup the receive address. */
+ e1000e_init_rx_addrs(hw, mac->rar_entry_count);
+@@ -1350,6 +1350,8 @@ static struct e1000_mac_operations es2_mac_ops = {
+ .led_on = e1000e_led_on_generic,
+ .led_off = e1000e_led_off_generic,
+ .update_mc_addr_list = e1000e_update_mc_addr_list_generic,
++ .write_vfta = e1000_write_vfta_generic,
++ .clear_vfta = e1000_clear_vfta_generic,
+ .reset_hw = e1000_reset_hw_80003es2lan,
+ .init_hw = e1000_init_hw_80003es2lan,
+ .setup_link = e1000e_setup_link,
+diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h
+index 90bd7f0..b4fb883 100644
+--- a/drivers/net/e1000e/hw.h
++++ b/drivers/net/e1000e/hw.h
+@@ -742,6 +742,7 @@ struct e1000_mac_operations {
+ s32 (*check_for_link)(struct e1000_hw *);
+ s32 (*cleanup_led)(struct e1000_hw *);
+ void (*clear_hw_cntrs)(struct e1000_hw *);
++ void (*clear_vfta)(struct e1000_hw *);
+ s32 (*get_bus_info)(struct e1000_hw *);
+ s32 (*get_link_up_info)(struct e1000_hw *, u16 *, u16 *);
+ s32 (*led_on)(struct e1000_hw *);
+@@ -752,6 +753,7 @@ struct e1000_mac_operations {
+ s32 (*setup_link)(struct e1000_hw *);
+ s32 (*setup_physical_interface)(struct e1000_hw *);
+ s32 (*setup_led)(struct e1000_hw *);
++ void (*write_vfta)(struct e1000_hw *, u32, u32);
+ };
+
+ /* Function pointers for the PHY. */
+diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c
+index f690a10..e3976ea 100644
+--- a/drivers/net/e1000e/lib.c
++++ b/drivers/net/e1000e/lib.c
+@@ -82,7 +82,24 @@ s32 e1000e_get_bus_info_pcie(struct e1000_hw *hw)
+ }
+
+ /**
+- * e1000e_write_vfta - Write value to VLAN filter table
++ * e1000_clear_vfta_generic - Clear VLAN filter table
++ * @hw: pointer to the HW structure
++ *
++ * Clears the register array which contains the VLAN filter table by
++ * setting all the values to 0.
++ **/
++void e1000_clear_vfta_generic(struct e1000_hw *hw)
++{
++ u32 offset;
++
++ for (offset = 0; offset < E1000_VLAN_FILTER_TBL_SIZE; offset++) {
++ E1000_WRITE_REG_ARRAY(hw, E1000_VFTA, offset, 0);
++ e1e_flush();
++ }
++}
++
++/**
++ * e1000_write_vfta_generic - Write value to VLAN filter table
+ * @hw: pointer to the HW structure
+ * @offset: register offset in VLAN filter table
+ * @value: register value written to VLAN filter table
+@@ -90,7 +107,7 @@ s32 e1000e_get_bus_info_pcie(struct e1000_hw *hw)
+ * Writes value at the given offset in the register array which stores
+ * the VLAN filter table.
+ **/
+-void e1000e_write_vfta(struct e1000_hw *hw, u32 offset, u32 value)
++void e1000_write_vfta_generic(struct e1000_hw *hw, u32 offset, u32 value)
+ {
+ E1000_WRITE_REG_ARRAY(hw, E1000_VFTA, offset, value);
+ e1e_flush();
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 80a3983..3c46ee0 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -2050,11 +2050,14 @@ static void e1000_vlan_rx_add_vid(struct net_device *netdev, u16 vid)
+ E1000_MNG_DHCP_COOKIE_STATUS_VLAN) &&
+ (vid == adapter->mng_vlan_id))
+ return;
++
+ /* add VID to filter table */
+- index = (vid >> 5) & 0x7F;
+- vfta = E1000_READ_REG_ARRAY(hw, E1000_VFTA, index);
+- vfta |= (1 << (vid & 0x1F));
+- e1000e_write_vfta(hw, index, vfta);
++ if (adapter->flags & FLAG_HAS_HW_VLAN_FILTER) {
++ index = (vid >> 5) & 0x7F;
++ vfta = E1000_READ_REG_ARRAY(hw, E1000_VFTA, index);
++ vfta |= (1 << (vid & 0x1F));
++ hw->mac.ops.write_vfta(hw, index, vfta);
++ }
+ }
+
+ static void e1000_vlan_rx_kill_vid(struct net_device *netdev, u16 vid)
+@@ -2079,10 +2082,12 @@ static void e1000_vlan_rx_kill_vid(struct net_device *netdev, u16 vid)
+ }
+
+ /* remove VID from filter table */
+- index = (vid >> 5) & 0x7F;
+- vfta = E1000_READ_REG_ARRAY(hw, E1000_VFTA, index);
+- vfta &= ~(1 << (vid & 0x1F));
+- e1000e_write_vfta(hw, index, vfta);
++ if (adapter->flags & FLAG_HAS_HW_VLAN_FILTER) {
++ index = (vid >> 5) & 0x7F;
++ vfta = E1000_READ_REG_ARRAY(hw, E1000_VFTA, index);
++ vfta &= ~(1 << (vid & 0x1F));
++ hw->mac.ops.write_vfta(hw, index, vfta);
++ }
+ }
+
+ static void e1000_update_mng_vlan(struct e1000_adapter *adapter)
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0029-e1000e-guard-against-buffer-overflow-in-cable-length.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0029-e1000e-guard-against-buffer-overflow-in-cable-length.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,101 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Tue, 1 Dec 2009 15:47:02 +0000
+Subject: [PATCH 029/166] e1000e: guard against buffer overflow in cable
+ length tables
+
+commit eb656d4552a6c9de5fdcee4a376b171f57b8a4a2 upstream.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/es2lan.c | 17 +++++++++++++----
+ drivers/net/e1000e/phy.c | 14 +++++++++++---
+ 2 files changed, 24 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/net/e1000e/es2lan.c b/drivers/net/e1000e/es2lan.c
+index 3ff932f..3f435c1 100644
+--- a/drivers/net/e1000e/es2lan.c
++++ b/drivers/net/e1000e/es2lan.c
+@@ -99,6 +99,8 @@
+ */
+ static const u16 e1000_gg82563_cable_length_table[] =
+ { 0, 60, 115, 150, 150, 60, 115, 150, 180, 180, 0xFF };
++#define GG82563_CABLE_LENGTH_TABLE_SIZE \
++ ARRAY_SIZE(e1000_gg82563_cable_length_table)
+
+ static s32 e1000_setup_copper_link_80003es2lan(struct e1000_hw *hw);
+ static s32 e1000_acquire_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask);
+@@ -694,20 +696,27 @@ static s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw)
+ static s32 e1000_get_cable_length_80003es2lan(struct e1000_hw *hw)
+ {
+ struct e1000_phy_info *phy = &hw->phy;
+- s32 ret_val;
++ s32 ret_val = 0;
+ u16 phy_data, index;
+
+ ret_val = e1e_rphy(hw, GG82563_PHY_DSP_DISTANCE, &phy_data);
+ if (ret_val)
+- return ret_val;
++ goto out;
+
+ index = phy_data & GG82563_DSPD_CABLE_LENGTH;
++
++ if (index >= GG82563_CABLE_LENGTH_TABLE_SIZE - 5) {
++ ret_val = -E1000_ERR_PHY;
++ goto out;
++ }
++
+ phy->min_cable_length = e1000_gg82563_cable_length_table[index];
+- phy->max_cable_length = e1000_gg82563_cable_length_table[index+5];
++ phy->max_cable_length = e1000_gg82563_cable_length_table[index + 5];
+
+ phy->cable_length = (phy->min_cable_length + phy->max_cable_length) / 2;
+
+- return 0;
++out:
++ return ret_val;
+ }
+
+ /**
+diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c
+index 5cd01c6..9ce4997 100644
+--- a/drivers/net/e1000e/phy.c
++++ b/drivers/net/e1000e/phy.c
+@@ -44,6 +44,8 @@ static s32 e1000_access_phy_debug_regs_hv(struct e1000_hw *hw, u32 offset,
+ /* Cable length tables */
+ static const u16 e1000_m88_cable_length_table[] =
+ { 0, 50, 80, 110, 140, 140, E1000_CABLE_LENGTH_UNDEFINED };
++#define M88E1000_CABLE_LENGTH_TABLE_SIZE \
++ ARRAY_SIZE(e1000_m88_cable_length_table)
+
+ static const u16 e1000_igp_2_cable_length_table[] =
+ { 0, 0, 0, 0, 0, 0, 0, 0, 3, 5, 8, 11, 13, 16, 18, 21, 0, 0, 0, 3,
+@@ -1717,15 +1719,21 @@ s32 e1000e_get_cable_length_m88(struct e1000_hw *hw)
+
+ ret_val = e1e_rphy(hw, M88E1000_PHY_SPEC_STATUS, &phy_data);
+ if (ret_val)
+- return ret_val;
++ goto out;
+
+ index = (phy_data & M88E1000_PSSR_CABLE_LENGTH) >>
+- M88E1000_PSSR_CABLE_LENGTH_SHIFT;
++ M88E1000_PSSR_CABLE_LENGTH_SHIFT;
++ if (index >= M88E1000_CABLE_LENGTH_TABLE_SIZE - 1) {
++ ret_val = -E1000_ERR_PHY;
++ goto out;
++ }
++
+ phy->min_cable_length = e1000_m88_cable_length_table[index];
+- phy->max_cable_length = e1000_m88_cable_length_table[index+1];
++ phy->max_cable_length = e1000_m88_cable_length_table[index + 1];
+
+ phy->cable_length = (phy->min_cable_length + phy->max_cable_length) / 2;
+
++out:
+ return ret_val;
+ }
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0030-e1000e-provide-family-specific-PHY-power-up-down-ope.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0030-e1000e-provide-family-specific-PHY-power-up-down-ope.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,345 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Tue, 1 Dec 2009 15:47:22 +0000
+Subject: [PATCH 030/166] e1000e: provide family-specific PHY power up/down
+ operations
+
+commit 17f208deb9bf88315aa72c08c866a235c399fb9a upstream.
+
+The different families (80003es2lan, 8257x, ICHx/PCH) supported by the
+driver each have their own conditions when the PHY can be powered down.
+This patch rewrites the PHY power up/down code to fit with the family-
+specific style used in the driver. All pre-existing calls to power up or
+down the PHY remain untouched. A new call to power down the PHY when
+removing the driver when the interface is down replaces the current call
+to reset the PHY in order to reduce power consumption.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/82571.c | 26 +++++++++++++++++++++
+ drivers/net/e1000e/e1000.h | 2 +
+ drivers/net/e1000e/es2lan.c | 21 +++++++++++++++++
+ drivers/net/e1000e/hw.h | 2 +
+ drivers/net/e1000e/ich8lan.c | 23 +++++++++++++++++++
+ drivers/net/e1000e/netdev.c | 50 +++++++++--------------------------------
+ drivers/net/e1000e/phy.c | 37 +++++++++++++++++++++++++++++++
+ 7 files changed, 122 insertions(+), 39 deletions(-)
+
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+index 8ea3ed7..26ea5d5 100644
+--- a/drivers/net/e1000e/82571.c
++++ b/drivers/net/e1000e/82571.c
+@@ -69,6 +69,7 @@ static void e1000_clear_vfta_82571(struct e1000_hw *hw);
+ static bool e1000_check_mng_mode_82574(struct e1000_hw *hw);
+ static s32 e1000_led_on_82574(struct e1000_hw *hw);
+ static void e1000_put_hw_semaphore_82571(struct e1000_hw *hw);
++static void e1000_power_down_phy_copper_82571(struct e1000_hw *hw);
+
+ /**
+ * e1000_init_phy_params_82571 - Init PHY func ptrs.
+@@ -88,6 +89,9 @@ static s32 e1000_init_phy_params_82571(struct e1000_hw *hw)
+ phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT;
+ phy->reset_delay_us = 100;
+
++ phy->ops.power_up = e1000_power_up_phy_copper;
++ phy->ops.power_down = e1000_power_down_phy_copper_82571;
++
+ switch (hw->mac.type) {
+ case e1000_82571:
+ case e1000_82572:
+@@ -1601,6 +1605,28 @@ static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw)
+ }
+
+ /**
++ * e1000_power_down_phy_copper_82571 - Remove link during PHY power down
++ * @hw: pointer to the HW structure
++ *
++ * In the case of a PHY power down to save power, or to turn off link during a
++ * driver unload, or wake on lan is not enabled, remove the link.
++ **/
++static void e1000_power_down_phy_copper_82571(struct e1000_hw *hw)
++{
++ struct e1000_phy_info *phy = &hw->phy;
++ struct e1000_mac_info *mac = &hw->mac;
++
++ if (!(phy->ops.check_reset_block))
++ return;
++
++ /* If the management interface is not enabled, then power down */
++ if (!(mac->ops.check_mng_mode(hw) || phy->ops.check_reset_block(hw)))
++ e1000_power_down_phy_copper(hw);
++
++ return;
++}
++
++/**
+ * e1000_clear_hw_cntrs_82571 - Clear device specific hardware counters
+ * @hw: pointer to the HW structure
+ *
+diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
+index 4706b7e..2291c77 100644
+--- a/drivers/net/e1000e/e1000.h
++++ b/drivers/net/e1000e/e1000.h
+@@ -569,6 +569,8 @@ extern s32 e1000e_read_kmrn_reg_locked(struct e1000_hw *hw, u32 offset,
+ extern s32 e1000e_phy_has_link_generic(struct e1000_hw *hw, u32 iterations,
+ u32 usec_interval, bool *success);
+ extern s32 e1000e_phy_reset_dsp(struct e1000_hw *hw);
++extern void e1000_power_up_phy_copper(struct e1000_hw *hw);
++extern void e1000_power_down_phy_copper(struct e1000_hw *hw);
+ extern s32 e1000e_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data);
+ extern s32 e1000e_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data);
+ extern s32 e1000e_check_downshift(struct e1000_hw *hw);
+diff --git a/drivers/net/e1000e/es2lan.c b/drivers/net/e1000e/es2lan.c
+index 3f435c1..c7bc657 100644
+--- a/drivers/net/e1000e/es2lan.c
++++ b/drivers/net/e1000e/es2lan.c
+@@ -114,6 +114,7 @@ static s32 e1000_read_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
+ u16 *data);
+ static s32 e1000_write_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
+ u16 data);
++static void e1000_power_down_phy_copper_80003es2lan(struct e1000_hw *hw);
+
+ /**
+ * e1000_init_phy_params_80003es2lan - Init ESB2 PHY func ptrs.
+@@ -127,6 +128,9 @@ static s32 e1000_init_phy_params_80003es2lan(struct e1000_hw *hw)
+ if (hw->phy.media_type != e1000_media_type_copper) {
+ phy->type = e1000_phy_none;
+ return 0;
++ } else {
++ phy->ops.power_up = e1000_power_up_phy_copper;
++ phy->ops.power_down = e1000_power_down_phy_copper_80003es2lan;
+ }
+
+ phy->addr = 1;
+@@ -1303,6 +1307,23 @@ static s32 e1000_write_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
+ }
+
+ /**
++ * e1000_power_down_phy_copper_80003es2lan - Remove link during PHY power down
++ * @hw: pointer to the HW structure
++ *
++ * In the case of a PHY power down to save power, or to turn off link during a
++ * driver unload, or wake on lan is not enabled, remove the link.
++ **/
++static void e1000_power_down_phy_copper_80003es2lan(struct e1000_hw *hw)
++{
++ /* If the management interface is not enabled, then power down */
++ if (!(hw->mac.ops.check_mng_mode(hw) ||
++ hw->phy.ops.check_reset_block(hw)))
++ e1000_power_down_phy_copper(hw);
++
++ return;
++}
++
++/**
+ * e1000_clear_hw_cntrs_80003es2lan - Clear device specific hardware counters
+ * @hw: pointer to the HW structure
+ *
+diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h
+index b4fb883..163e10e 100644
+--- a/drivers/net/e1000e/hw.h
++++ b/drivers/net/e1000e/hw.h
+@@ -775,6 +775,8 @@ struct e1000_phy_operations {
+ s32 (*set_d3_lplu_state)(struct e1000_hw *, bool);
+ s32 (*write_reg)(struct e1000_hw *, u32, u16);
+ s32 (*write_reg_locked)(struct e1000_hw *, u32, u16);
++ void (*power_up)(struct e1000_hw *);
++ void (*power_down)(struct e1000_hw *);
+ };
+
+ /* Function pointers for the NVM. */
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index 08a942e..1147c40 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -217,6 +217,7 @@ static s32 e1000_cleanup_led_pchlan(struct e1000_hw *hw);
+ static s32 e1000_led_on_pchlan(struct e1000_hw *hw);
+ static s32 e1000_led_off_pchlan(struct e1000_hw *hw);
+ static s32 e1000_set_lplu_state_pchlan(struct e1000_hw *hw, bool active);
++static void e1000_power_down_phy_copper_ich8lan(struct e1000_hw *hw);
+ static void e1000_lan_init_done_ich8lan(struct e1000_hw *hw);
+ static s32 e1000_k1_gig_workaround_hv(struct e1000_hw *hw, bool link);
+
+@@ -266,6 +267,8 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw)
+ phy->ops.set_d3_lplu_state = e1000_set_lplu_state_pchlan;
+ phy->ops.write_reg = e1000_write_phy_reg_hv;
+ phy->ops.write_reg_locked = e1000_write_phy_reg_hv_locked;
++ phy->ops.power_up = e1000_power_up_phy_copper;
++ phy->ops.power_down = e1000_power_down_phy_copper_ich8lan;
+ phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT;
+
+ /*
+@@ -310,6 +313,9 @@ static s32 e1000_init_phy_params_ich8lan(struct e1000_hw *hw)
+ phy->addr = 1;
+ phy->reset_delay_us = 100;
+
++ phy->ops.power_up = e1000_power_up_phy_copper;
++ phy->ops.power_down = e1000_power_down_phy_copper_ich8lan;
++
+ /*
+ * We may need to do this twice - once for IGP and if that fails,
+ * we'll set BM func pointers and try again
+@@ -3404,6 +3410,23 @@ static s32 e1000_get_cfg_done_ich8lan(struct e1000_hw *hw)
+ }
+
+ /**
++ * e1000_power_down_phy_copper_ich8lan - Remove link during PHY power down
++ * @hw: pointer to the HW structure
++ *
++ * In the case of a PHY power down to save power, or to turn off link during a
++ * driver unload, or wake on lan is not enabled, remove the link.
++ **/
++static void e1000_power_down_phy_copper_ich8lan(struct e1000_hw *hw)
++{
++ /* If the management interface is not enabled, then power down */
++ if (!(hw->mac.ops.check_mng_mode(hw) ||
++ hw->phy.ops.check_reset_block(hw)))
++ e1000_power_down_phy_copper(hw);
++
++ return;
++}
++
++/**
+ * e1000_clear_hw_cntrs_ich8lan - Clear statistical counters
+ * @hw: pointer to the HW structure
+ *
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 3c46ee0..7e55649 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -2648,18 +2648,8 @@ static void e1000_configure(struct e1000_adapter *adapter)
+ **/
+ void e1000e_power_up_phy(struct e1000_adapter *adapter)
+ {
+- u16 mii_reg = 0;
+-
+- /* Just clear the power down bit to wake the phy back up */
+- if (adapter->hw.phy.media_type == e1000_media_type_copper) {
+- /*
+- * According to the manual, the phy will retain its
+- * settings across a power-down/up cycle
+- */
+- e1e_rphy(&adapter->hw, PHY_CONTROL, &mii_reg);
+- mii_reg &= ~MII_CR_POWER_DOWN;
+- e1e_wphy(&adapter->hw, PHY_CONTROL, mii_reg);
+- }
++ if (adapter->hw.phy.ops.power_up)
++ adapter->hw.phy.ops.power_up(&adapter->hw);
+
+ adapter->hw.mac.ops.setup_link(&adapter->hw);
+ }
+@@ -2667,35 +2657,17 @@ void e1000e_power_up_phy(struct e1000_adapter *adapter)
+ /**
+ * e1000_power_down_phy - Power down the PHY
+ *
+- * Power down the PHY so no link is implied when interface is down
+- * The PHY cannot be powered down is management or WoL is active
++ * Power down the PHY so no link is implied when interface is down.
++ * The PHY cannot be powered down if management or WoL is active.
+ */
+ static void e1000_power_down_phy(struct e1000_adapter *adapter)
+ {
+- struct e1000_hw *hw = &adapter->hw;
+- u16 mii_reg;
+-
+ /* WoL is enabled */
+ if (adapter->wol)
+ return;
+
+- /* non-copper PHY? */
+- if (adapter->hw.phy.media_type != e1000_media_type_copper)
+- return;
+-
+- /* reset is blocked because of a SoL/IDER session */
+- if (e1000e_check_mng_mode(hw) || e1000_check_reset_block(hw))
+- return;
+-
+- /* manageability (AMT) is enabled */
+- if (er32(MANC) & E1000_MANC_SMBUS_EN)
+- return;
+-
+- /* power down the PHY */
+- e1e_rphy(hw, PHY_CONTROL, &mii_reg);
+- mii_reg |= MII_CR_POWER_DOWN;
+- e1e_wphy(hw, PHY_CONTROL, mii_reg);
+- mdelay(1);
++ if (adapter->hw.phy.ops.power_down)
++ adapter->hw.phy.ops.power_down(&adapter->hw);
+ }
+
+ /**
+@@ -5301,17 +5273,17 @@ static void __devexit e1000_remove(struct pci_dev *pdev)
+ cancel_work_sync(&adapter->print_hang_task);
+ flush_scheduled_work();
+
++ if (!(netdev->flags & IFF_UP))
++ e1000_power_down_phy(adapter);
++
++ unregister_netdev(netdev);
++
+ /*
+ * Release control of h/w to f/w. If f/w is AMT enabled, this
+ * would have already happened in close and is redundant.
+ */
+ e1000_release_hw_control(adapter);
+
+- unregister_netdev(netdev);
+-
+- if (!e1000_check_reset_block(&adapter->hw))
+- e1000_phy_hw_reset(&adapter->hw);
+-
+ e1000e_reset_interrupt_capability(adapter);
+ kfree(adapter->tx_ring);
+ kfree(adapter->rx_ring);
+diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c
+index 9ce4997..140b23b 100644
+--- a/drivers/net/e1000e/phy.c
++++ b/drivers/net/e1000e/phy.c
+@@ -2534,6 +2534,43 @@ out:
+ }
+
+ /**
++ * e1000_power_up_phy_copper - Restore copper link in case of PHY power down
++ * @hw: pointer to the HW structure
++ *
++ * In the case of a PHY power down to save power, or to turn off link during a
++ * driver unload, or wake on lan is not enabled, restore the link to previous
++ * settings.
++ **/
++void e1000_power_up_phy_copper(struct e1000_hw *hw)
++{
++ u16 mii_reg = 0;
++
++ /* The PHY will retain its settings across a power down/up cycle */
++ e1e_rphy(hw, PHY_CONTROL, &mii_reg);
++ mii_reg &= ~MII_CR_POWER_DOWN;
++ e1e_wphy(hw, PHY_CONTROL, mii_reg);
++}
++
++/**
++ * e1000_power_down_phy_copper - Restore copper link in case of PHY power down
++ * @hw: pointer to the HW structure
++ *
++ * In the case of a PHY power down to save power, or to turn off link during a
++ * driver unload, or wake on lan is not enabled, restore the link to previous
++ * settings.
++ **/
++void e1000_power_down_phy_copper(struct e1000_hw *hw)
++{
++ u16 mii_reg = 0;
++
++ /* The PHY will retain its settings across a power down/up cycle */
++ e1e_rphy(hw, PHY_CONTROL, &mii_reg);
++ mii_reg |= MII_CR_POWER_DOWN;
++ e1e_wphy(hw, PHY_CONTROL, mii_reg);
++ msleep(1);
++}
++
++/**
+ * e1000e_commit_phy - Soft PHY reset
+ * @hw: pointer to the HW structure
+ *
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0031-e1000e-ensure-the-link-state-is-correct-for-serdes-l.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0031-e1000e-ensure-the-link-state-is-correct-for-serdes-l.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,157 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Tue, 1 Dec 2009 15:49:51 +0000
+Subject: [PATCH 031/166] e1000e: ensure the link state is correct for serdes
+ links
+
+commit 1a40d5c170f472d541844cb5b4292efbe02ef89c upstream.
+
+This patch ensures that the link state (as reported in
+mac->serdes_has_link) will transition to false when autoneg fails to
+complete but valid codewords were detected.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/82571.c | 76 +++++++++++++++++++++++++++----------------
+ 1 files changed, 48 insertions(+), 28 deletions(-)
+
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+index 26ea5d5..227f3d0 100644
+--- a/drivers/net/e1000e/82571.c
++++ b/drivers/net/e1000e/82571.c
+@@ -1356,8 +1356,20 @@ static s32 e1000_setup_fiber_serdes_link_82571(struct e1000_hw *hw)
+ * e1000_check_for_serdes_link_82571 - Check for link (Serdes)
+ * @hw: pointer to the HW structure
+ *
+- * Checks for link up on the hardware. If link is not up and we have
+- * a signal, then we need to force link up.
++ * Reports the link state as up or down.
++ *
++ * If autonegotiation is supported by the link partner, the link state is
++ * determined by the result of autonegotiation. This is the most likely case.
++ * If autonegotiation is not supported by the link partner, and the link
++ * has a valid signal, force the link up.
++ *
++ * The link state is represented internally here by 4 states:
++ *
++ * 1) down
++ * 2) autoneg_progress
++ * 3) autoneg_complete (the link sucessfully autonegotiated)
++ * 4) forced_up (the link has been forced up, it did not autonegotiate)
++ *
+ **/
+ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw)
+ {
+@@ -1383,6 +1395,7 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw)
+ */
+ mac->serdes_link_state =
+ e1000_serdes_link_autoneg_progress;
++ mac->serdes_has_link = false;
+ e_dbg("AN_UP -> AN_PROG\n");
+ }
+ break;
+@@ -1397,57 +1410,64 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw)
+ if (rxcw & E1000_RXCW_C) {
+ /* Enable autoneg, and unforce link up */
+ ew32(TXCW, mac->txcw);
+- ew32(CTRL,
+- (ctrl & ~E1000_CTRL_SLU));
++ ew32(CTRL, (ctrl & ~E1000_CTRL_SLU));
+ mac->serdes_link_state =
+ e1000_serdes_link_autoneg_progress;
++ mac->serdes_has_link = false;
+ e_dbg("FORCED_UP -> AN_PROG\n");
+ }
+ break;
+
+ case e1000_serdes_link_autoneg_progress:
+- /*
+- * If the LU bit is set in the STATUS register,
+- * autoneg has completed sucessfully. If not,
+- * try foring the link because the far end may be
+- * available but not capable of autonegotiation.
+- */
+- if (status & E1000_STATUS_LU) {
+- mac->serdes_link_state =
+- e1000_serdes_link_autoneg_complete;
+- e_dbg("AN_PROG -> AN_UP\n");
++ if (rxcw & E1000_RXCW_C) {
++ /*
++ * We received /C/ ordered sets, meaning the
++ * link partner has autonegotiated, and we can
++ * trust the Link Up (LU) status bit.
++ */
++ if (status & E1000_STATUS_LU) {
++ mac->serdes_link_state =
++ e1000_serdes_link_autoneg_complete;
++ e_dbg("AN_PROG -> AN_UP\n");
++ mac->serdes_has_link = true;
++ } else {
++ /* Autoneg completed, but failed. */
++ mac->serdes_link_state =
++ e1000_serdes_link_down;
++ e_dbg("AN_PROG -> DOWN\n");
++ }
+ } else {
+ /*
+- * Disable autoneg, force link up and
+- * full duplex, and change state to forced
++ * The link partner did not autoneg.
++ * Force link up and full duplex, and change
++ * state to forced.
+ */
+- ew32(TXCW,
+- (mac->txcw & ~E1000_TXCW_ANE));
++ ew32(TXCW, (mac->txcw & ~E1000_TXCW_ANE));
+ ctrl |= (E1000_CTRL_SLU | E1000_CTRL_FD);
+ ew32(CTRL, ctrl);
+
+ /* Configure Flow Control after link up. */
+- ret_val =
+- e1000e_config_fc_after_link_up(hw);
++ ret_val = e1000e_config_fc_after_link_up(hw);
+ if (ret_val) {
+ e_dbg("Error config flow control\n");
+ break;
+ }
+ mac->serdes_link_state =
+ e1000_serdes_link_forced_up;
++ mac->serdes_has_link = true;
+ e_dbg("AN_PROG -> FORCED_UP\n");
+ }
+- mac->serdes_has_link = true;
+ break;
+
+ case e1000_serdes_link_down:
+ default:
+- /* The link was down but the receiver has now gained
++ /*
++ * The link was down but the receiver has now gained
+ * valid sync, so lets see if we can bring the link
+- * up. */
++ * up.
++ */
+ ew32(TXCW, mac->txcw);
+- ew32(CTRL,
+- (ctrl & ~E1000_CTRL_SLU));
++ ew32(CTRL, (ctrl & ~E1000_CTRL_SLU));
+ mac->serdes_link_state =
+ e1000_serdes_link_autoneg_progress;
+ e_dbg("DOWN -> AN_PROG\n");
+@@ -1460,9 +1480,9 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw)
+ e_dbg("ANYSTATE -> DOWN\n");
+ } else {
+ /*
+- * We have sync, and can tolerate one
+- * invalid (IV) codeword before declaring
+- * link down, so reread to look again
++ * We have sync, and can tolerate one invalid (IV)
++ * codeword before declaring link down, so reread
++ * to look again.
+ */
+ udelay(10);
+ rxcw = er32(RXCW);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0032-e1000e-comment-corrections.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0032-e1000e-comment-corrections.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,145 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Tue, 1 Dec 2009 15:51:11 +0000
+Subject: [PATCH 032/166] e1000e: comment corrections
+
+commit 5ff5b664351a94754031c1e5783f0cea6b3000ed upstream.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/82571.c | 2 +-
+ drivers/net/e1000e/ich8lan.c | 5 ++---
+ drivers/net/e1000e/lib.c | 5 +----
+ drivers/net/e1000e/phy.c | 14 +++++++-------
+ 4 files changed, 11 insertions(+), 15 deletions(-)
+
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+index 227f3d0..f6f3a22 100644
+--- a/drivers/net/e1000e/82571.c
++++ b/drivers/net/e1000e/82571.c
+@@ -1551,7 +1551,7 @@ bool e1000e_get_laa_state_82571(struct e1000_hw *hw)
+ * @hw: pointer to the HW structure
+ * @state: enable/disable locally administered address
+ *
+- * Enable/Disable the current locally administers address state.
++ * Enable/Disable the current locally administered address state.
+ **/
+ void e1000e_set_laa_state_82571(struct e1000_hw *hw, bool state)
+ {
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index 1147c40..6641759 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -1758,7 +1758,7 @@ static s32 e1000_flash_cycle_init_ich8lan(struct e1000_hw *hw)
+ if (hsfsts.hsf_status.flcinprog == 0) {
+ /*
+ * There is no cycle running at present,
+- * so we can start a cycle
++ * so we can start a cycle.
+ * Begin by setting Flash Cycle Done.
+ */
+ hsfsts.hsf_status.flcdone = 1;
+@@ -1766,7 +1766,7 @@ static s32 e1000_flash_cycle_init_ich8lan(struct e1000_hw *hw)
+ ret_val = 0;
+ } else {
+ /*
+- * otherwise poll for sometime so the current
++ * Otherwise poll for sometime so the current
+ * cycle has a chance to end before giving up.
+ */
+ for (i = 0; i < ICH_FLASH_READ_COMMAND_TIMEOUT; i++) {
+@@ -2656,7 +2656,6 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
+ ctrl |= E1000_CTRL_PHY_RST;
+ }
+ ret_val = e1000_acquire_swflag_ich8lan(hw);
+- /* Whether or not the swflag was acquired, we need to reset the part */
+ e_dbg("Issuing a global reset to ich8lan\n");
+ ew32(CTRL, (ctrl | E1000_CTRL_RST));
+ msleep(20);
+diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c
+index e3976ea..a86c175 100644
+--- a/drivers/net/e1000e/lib.c
++++ b/drivers/net/e1000e/lib.c
+@@ -1086,7 +1086,6 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw)
+ * 1 | 1 | 0 | 0 | e1000_fc_none
+ * 1 | 1 | 0 | 1 | e1000_fc_rx_pause
+ *
+- *
+ * Are both PAUSE bits set to 1? If so, this implies
+ * Symmetric Flow Control is enabled at both ends. The
+ * ASM_DIR bits are irrelevant per the spec.
+@@ -1124,7 +1123,6 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw)
+ * PAUSE | ASM_DIR | PAUSE | ASM_DIR | Result
+ *-------|---------|-------|---------|--------------------
+ * 0 | 1 | 1 | 1 | e1000_fc_tx_pause
+- *
+ */
+ else if (!(mii_nway_adv_reg & NWAY_AR_PAUSE) &&
+ (mii_nway_adv_reg & NWAY_AR_ASM_DIR) &&
+@@ -1140,7 +1138,6 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw)
+ * PAUSE | ASM_DIR | PAUSE | ASM_DIR | Result
+ *-------|---------|-------|---------|--------------------
+ * 1 | 1 | 0 | 1 | e1000_fc_rx_pause
+- *
+ */
+ else if ((mii_nway_adv_reg & NWAY_AR_PAUSE) &&
+ (mii_nway_adv_reg & NWAY_AR_ASM_DIR) &&
+@@ -2363,7 +2360,7 @@ static s32 e1000_mng_write_cmd_header(struct e1000_hw *hw,
+ }
+
+ /**
+- * e1000_mng_host_if_write - Writes to the manageability host interface
++ * e1000_mng_host_if_write - Write to the manageability host interface
+ * @hw: pointer to the HW structure
+ * @buffer: pointer to the host interface buffer
+ * @length: size of the buffer
+diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c
+index 140b23b..1bc09b2 100644
+--- a/drivers/net/e1000e/phy.c
++++ b/drivers/net/e1000e/phy.c
+@@ -153,10 +153,10 @@ s32 e1000e_get_phy_id(struct e1000_hw *hw)
+ goto out;
+
+ /*
+- * If the PHY ID is still unknown, we may have an 82577i
+- * without link. We will try again after setting Slow
+- * MDIC mode. No harm in trying again in this case since
+- * the PHY ID is unknown at this point anyway
++ * If the PHY ID is still unknown, we may have an 82577
++ * without link. We will try again after setting Slow MDIC
++ * mode. No harm in trying again in this case since the PHY
++ * ID is unknown at this point anyway.
+ */
+ ret_val = phy->ops.acquire(hw);
+ if (ret_val)
+@@ -1744,7 +1744,7 @@ out:
+ * The automatic gain control (agc) normalizes the amplitude of the
+ * received signal, adjusting for the attenuation produced by the
+ * cable. By reading the AGC registers, which represent the
+- * combination of course and fine gain value, the value can be put
++ * combination of coarse and fine gain value, the value can be put
+ * into a lookup table to obtain the approximate cable length
+ * for each channel.
+ **/
+@@ -1769,7 +1769,7 @@ s32 e1000e_get_cable_length_igp_2(struct e1000_hw *hw)
+
+ /*
+ * Getting bits 15:9, which represent the combination of
+- * course and fine gain values. The result is a number
++ * coarse and fine gain values. The result is a number
+ * that can be put into the lookup table to obtain the
+ * approximate cable length.
+ */
+@@ -2511,7 +2511,7 @@ static s32 e1000_access_phy_wakeup_reg_bm(struct e1000_hw *hw, u32 offset,
+ ret_val = e1000e_read_phy_reg_mdic(hw, BM_WUC_DATA_OPCODE,
+ data);
+ } else {
+- /* Read the page 800 value using opcode 0x12 */
++ /* Write the page 800 value using opcode 0x12 */
+ ret_val = e1000e_write_phy_reg_mdic(hw, BM_WUC_DATA_OPCODE,
+ *data);
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0033-e1000e-add-debug-messages.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0033-e1000e-add-debug-messages.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,113 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Tue, 1 Dec 2009 15:53:07 +0000
+Subject: [PATCH 033/166] e1000e: add debug messages
+
+commit 9b71b419a60d200f553658a97c9f49a46f58e8bb upstream.
+
+Add some helpful debug messages.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/ich8lan.c | 4 +++-
+ drivers/net/e1000e/phy.c | 26 ++++++++++++++++++++------
+ 2 files changed, 23 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index 6641759..a9bdfd4 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -325,8 +325,10 @@ static s32 e1000_init_phy_params_ich8lan(struct e1000_hw *hw)
+ phy->ops.write_reg = e1000e_write_phy_reg_bm;
+ phy->ops.read_reg = e1000e_read_phy_reg_bm;
+ ret_val = e1000e_determine_phy_address(hw);
+- if (ret_val)
++ if (ret_val) {
++ e_dbg("Cannot determine PHY addr. Erroring out\n");
+ return ret_val;
++ }
+ }
+
+ phy->id = 0;
+diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c
+index 1bc09b2..3e5940a 100644
+--- a/drivers/net/e1000e/phy.c
++++ b/drivers/net/e1000e/phy.c
+@@ -2472,7 +2472,7 @@ static s32 e1000_access_phy_wakeup_reg_bm(struct e1000_hw *hw, u32 offset,
+ /* Gig must be disabled for MDIO accesses to page 800 */
+ if ((hw->mac.type == e1000_pchlan) &&
+ (!(er32(PHY_CTRL) & E1000_PHY_CTRL_GBE_DISABLE)))
+- e_dbg("Attempting to access page 800 while gig enabled\n");
++ e_dbg("Attempting to access page 800 while gig enabled.\n");
+
+ /* All operations in this function are phy address 1 */
+ hw->phy.addr = 1;
+@@ -2482,20 +2482,26 @@ static s32 e1000_access_phy_wakeup_reg_bm(struct e1000_hw *hw, u32 offset,
+ (BM_WUC_ENABLE_PAGE << IGP_PAGE_SHIFT));
+
+ ret_val = e1000e_read_phy_reg_mdic(hw, BM_WUC_ENABLE_REG, &phy_reg);
+- if (ret_val)
++ if (ret_val) {
++ e_dbg("Could not read PHY page 769\n");
+ goto out;
++ }
+
+ /* First clear bit 4 to avoid a power state change */
+ phy_reg &= ~(BM_WUC_HOST_WU_BIT);
+ ret_val = e1000e_write_phy_reg_mdic(hw, BM_WUC_ENABLE_REG, phy_reg);
+- if (ret_val)
++ if (ret_val) {
++ e_dbg("Could not clear PHY page 769 bit 4\n");
+ goto out;
++ }
+
+ /* Write bit 2 = 1, and clear bit 4 to 769_17 */
+ ret_val = e1000e_write_phy_reg_mdic(hw, BM_WUC_ENABLE_REG,
+ phy_reg | BM_WUC_ENABLE_BIT);
+- if (ret_val)
++ if (ret_val) {
++ e_dbg("Could not write PHY page 769 bit 2\n");
+ goto out;
++ }
+
+ /* Select page 800 */
+ ret_val = e1000e_write_phy_reg_mdic(hw, IGP01E1000_PHY_PAGE_SELECT,
+@@ -2503,8 +2509,10 @@ static s32 e1000_access_phy_wakeup_reg_bm(struct e1000_hw *hw, u32 offset,
+
+ /* Write the page 800 offset value using opcode 0x11 */
+ ret_val = e1000e_write_phy_reg_mdic(hw, BM_WUC_ADDRESS_OPCODE, reg);
+- if (ret_val)
++ if (ret_val) {
++ e_dbg("Could not write address opcode to page 800\n");
+ goto out;
++ }
+
+ if (read) {
+ /* Read the page 800 value using opcode 0x12 */
+@@ -2516,8 +2524,10 @@ static s32 e1000_access_phy_wakeup_reg_bm(struct e1000_hw *hw, u32 offset,
+ *data);
+ }
+
+- if (ret_val)
++ if (ret_val) {
++ e_dbg("Could not access data value from page 800\n");
+ goto out;
++ }
+
+ /*
+ * Restore 769_17.2 to its original value
+@@ -2528,6 +2538,10 @@ static s32 e1000_access_phy_wakeup_reg_bm(struct e1000_hw *hw, u32 offset,
+
+ /* Clear 769_17.2 */
+ ret_val = e1000e_write_phy_reg_mdic(hw, BM_WUC_ENABLE_REG, phy_reg);
++ if (ret_val) {
++ e_dbg("Could not clear PHY page 769 bit 2\n");
++ goto out;
++ }
+
+ out:
+ return ret_val;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0034-e1000e-PHY-type-cleanups-in-e1000e_check_downshift.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0034-e1000e-PHY-type-cleanups-in-e1000e_check_downshift.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,34 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Tue, 1 Dec 2009 15:53:48 +0000
+Subject: [PATCH 034/166] e1000e: PHY type cleanups in
+ e1000e_check_downshift()
+
+commit 07f025e6bad7292af3904b8f49cd33e7b5fe3467 upstream.
+
+Remove the case for 82577 because it does not support the ability to check
+for downshift. Add case for e1000_phy_bm which can do this.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/phy.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c
+index 3e5940a..0c69649 100644
+--- a/drivers/net/e1000e/phy.c
++++ b/drivers/net/e1000e/phy.c
+@@ -1525,8 +1525,8 @@ s32 e1000e_check_downshift(struct e1000_hw *hw)
+ switch (phy->type) {
+ case e1000_phy_m88:
+ case e1000_phy_gg82563:
++ case e1000_phy_bm:
+ case e1000_phy_82578:
+- case e1000_phy_82577:
+ offset = M88E1000_PHY_SPEC_STATUS;
+ mask = M88E1000_PSSR_DOWNSHIFT;
+ break;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0035-e1000e-Use-sizeof-struct-rather-than-pointer-in-e100.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0035-e1000e-Use-sizeof-struct-rather-than-pointer-in-e100.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,33 @@
+From: Roel Kluin <roel.kluin at gmail.com>
+Date: Tue, 1 Dec 2009 15:54:24 +0000
+Subject: [PATCH 035/166] e1000e: Use sizeof struct rather than pointer in
+ e1000_get_eeprom()
+
+commit 8528b016d64a7c1c97ba6540ab53a538348d5026 upstream.
+
+Don't use the sizeof the pointer to clear the result
+
+Signed-off-by: Roel Kluin <roel.kluin at gmail.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/ethtool.c | 3 ++-
+ 1 files changed, 2 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
+index b6243ca..0aa50c2 100644
+--- a/drivers/net/e1000e/ethtool.c
++++ b/drivers/net/e1000e/ethtool.c
+@@ -535,7 +535,8 @@ static int e1000_get_eeprom(struct net_device *netdev,
+
+ if (ret_val) {
+ /* a read error occurred, throw away the result */
+- memset(eeprom_buff, 0xff, sizeof(eeprom_buff));
++ memset(eeprom_buff, 0xff, sizeof(u16) *
++ (last_word - first_word + 1));
+ } else {
+ /* Device's eeprom is always little-endian, word addressable */
+ for (i = 0; i < last_word - first_word + 1; i++)
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0036-e1000e-remove-use-of-skb_dma_map-from-e1000e-driver.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0036-e1000e-remove-use-of-skb_dma_map-from-e1000e-driver.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,160 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Wed, 2 Dec 2009 16:45:31 +0000
+Subject: [PATCH 036/166] e1000e: remove use of skb_dma_map from e1000e driver
+
+commit 03b1320dfceeb093890cdd7433e910dca6225ddb upstream.
+
+In testing we have found that skb_dma_map/unmap is incompatible with HW
+IOMMU due to the fact that multiple mappings will return different results.
+In order to correct this we need to remove skb_dma_map/unmap calls from the
+e1000e driver.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/e1000.h | 9 ++++--
+ drivers/net/e1000e/netdev.c | 59 +++++++++++++++++++++++++++++-------------
+ 2 files changed, 47 insertions(+), 21 deletions(-)
+
+diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
+index 2291c77..870ea64 100644
+--- a/drivers/net/e1000e/e1000.h
++++ b/drivers/net/e1000e/e1000.h
+@@ -194,12 +194,15 @@ struct e1000_buffer {
+ unsigned long time_stamp;
+ u16 length;
+ u16 next_to_watch;
++ u16 mapped_as_page;
+ };
+ /* Rx */
+- /* arrays of page information for packet split */
+- struct e1000_ps_page *ps_pages;
++ struct {
++ /* arrays of page information for packet split */
++ struct e1000_ps_page *ps_pages;
++ struct page *page;
++ };
+ };
+- struct page *page;
+ };
+
+ struct e1000_ring {
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 7e55649..27a1c25 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -544,10 +544,17 @@ next_desc:
+ static void e1000_put_txbuf(struct e1000_adapter *adapter,
+ struct e1000_buffer *buffer_info)
+ {
+- buffer_info->dma = 0;
++ if (buffer_info->dma) {
++ if (buffer_info->mapped_as_page)
++ pci_unmap_page(adapter->pdev, buffer_info->dma,
++ buffer_info->length, PCI_DMA_TODEVICE);
++ else
++ pci_unmap_single(adapter->pdev, buffer_info->dma,
++ buffer_info->length,
++ PCI_DMA_TODEVICE);
++ buffer_info->dma = 0;
++ }
+ if (buffer_info->skb) {
+- skb_dma_unmap(&adapter->pdev->dev, buffer_info->skb,
+- DMA_TO_DEVICE);
+ dev_kfree_skb_any(buffer_info->skb);
+ buffer_info->skb = NULL;
+ }
+@@ -3896,23 +3903,14 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
+ unsigned int mss)
+ {
+ struct e1000_ring *tx_ring = adapter->tx_ring;
++ struct pci_dev *pdev = adapter->pdev;
+ struct e1000_buffer *buffer_info;
+ unsigned int len = skb_headlen(skb);
+- unsigned int offset, size, count = 0, i;
++ unsigned int offset = 0, size, count = 0, i;
+ unsigned int f;
+- dma_addr_t *map;
+
+ i = tx_ring->next_to_use;
+
+- if (skb_dma_map(&adapter->pdev->dev, skb, DMA_TO_DEVICE)) {
+- dev_err(&adapter->pdev->dev, "TX DMA map failed\n");
+- adapter->tx_dma_failed++;
+- return 0;
+- }
+-
+- map = skb_shinfo(skb)->dma_maps;
+- offset = 0;
+-
+ while (len) {
+ buffer_info = &tx_ring->buffer_info[i];
+ size = min(len, max_per_txd);
+@@ -3920,11 +3918,15 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
+ buffer_info->length = size;
+ buffer_info->time_stamp = jiffies;
+ buffer_info->next_to_watch = i;
+- buffer_info->dma = skb_shinfo(skb)->dma_head + offset;
+- count++;
++ buffer_info->dma = pci_map_single(pdev, skb->data + offset,
++ size, PCI_DMA_TODEVICE);
++ buffer_info->mapped_as_page = false;
++ if (pci_dma_mapping_error(pdev, buffer_info->dma))
++ goto dma_error;
+
+ len -= size;
+ offset += size;
++ count++;
+
+ if (len) {
+ i++;
+@@ -3938,7 +3940,7 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
+
+ frag = &skb_shinfo(skb)->frags[f];
+ len = frag->size;
+- offset = 0;
++ offset = frag->page_offset;
+
+ while (len) {
+ i++;
+@@ -3951,7 +3953,12 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
+ buffer_info->length = size;
+ buffer_info->time_stamp = jiffies;
+ buffer_info->next_to_watch = i;
+- buffer_info->dma = map[f] + offset;
++ buffer_info->dma = pci_map_page(pdev, frag->page,
++ offset, size,
++ PCI_DMA_TODEVICE);
++ buffer_info->mapped_as_page = true;
++ if (pci_dma_mapping_error(pdev, buffer_info->dma))
++ goto dma_error;
+
+ len -= size;
+ offset += size;
+@@ -3963,6 +3970,22 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
+ tx_ring->buffer_info[first].next_to_watch = i;
+
+ return count;
++
++dma_error:
++ dev_err(&pdev->dev, "TX DMA map failed\n");
++ buffer_info->dma = 0;
++ count--;
++
++ while (count >= 0) {
++ count--;
++ i--;
++ if (i < 0)
++ i += tx_ring->count;
++ buffer_info = &tx_ring->buffer_info[i];
++ e1000_put_txbuf(adapter, buffer_info);;
++ }
++
++ return 0;
+ }
+
+ static void e1000_tx_queue(struct e1000_adapter *adapter,
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0037-e1000e-check_polarity-function-pointers-not-set-for-.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0037-e1000e-check_polarity-function-pointers-not-set-for-.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,64 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Wed, 2 Dec 2009 17:02:14 +0000
+Subject: [PATCH 037/166] e1000e: check_polarity function pointers not set for
+ 8257x
+
+commit 94e5b651595a8eb77665787f7559a6a7c916c195 upstream.
+
+The function pointers for 8257x devices are not set. This is not really a
+problem now because there is nothing in the driver that references the
+pointers for this particular MAC-family (the appropriate functions are
+called directly), but the pointers should be set in case they are used in
+the future.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/82571.c | 3 +++
+ drivers/net/e1000e/es2lan.c | 1 +
+ 2 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+index f6f3a22..c1a42cf 100644
+--- a/drivers/net/e1000e/82571.c
++++ b/drivers/net/e1000e/82571.c
+@@ -1714,6 +1714,7 @@ static struct e1000_mac_operations e82571_mac_ops = {
+
+ static struct e1000_phy_operations e82_phy_ops_igp = {
+ .acquire = e1000_get_hw_semaphore_82571,
++ .check_polarity = e1000_check_polarity_igp,
+ .check_reset_block = e1000e_check_reset_block_generic,
+ .commit = NULL,
+ .force_speed_duplex = e1000e_phy_force_speed_duplex_igp,
+@@ -1731,6 +1732,7 @@ static struct e1000_phy_operations e82_phy_ops_igp = {
+
+ static struct e1000_phy_operations e82_phy_ops_m88 = {
+ .acquire = e1000_get_hw_semaphore_82571,
++ .check_polarity = e1000_check_polarity_m88,
+ .check_reset_block = e1000e_check_reset_block_generic,
+ .commit = e1000e_phy_sw_reset,
+ .force_speed_duplex = e1000e_phy_force_speed_duplex_m88,
+@@ -1748,6 +1750,7 @@ static struct e1000_phy_operations e82_phy_ops_m88 = {
+
+ static struct e1000_phy_operations e82_phy_ops_bm = {
+ .acquire = e1000_get_hw_semaphore_82571,
++ .check_polarity = e1000_check_polarity_m88,
+ .check_reset_block = e1000e_check_reset_block_generic,
+ .commit = e1000e_phy_sw_reset,
+ .force_speed_duplex = e1000e_phy_force_speed_duplex_m88,
+diff --git a/drivers/net/e1000e/es2lan.c b/drivers/net/e1000e/es2lan.c
+index c7bc657..d2a1047 100644
+--- a/drivers/net/e1000e/es2lan.c
++++ b/drivers/net/e1000e/es2lan.c
+@@ -1391,6 +1391,7 @@ static struct e1000_mac_operations es2_mac_ops = {
+
+ static struct e1000_phy_operations es2_phy_ops = {
+ .acquire = e1000_acquire_phy_80003es2lan,
++ .check_polarity = e1000_check_polarity_m88,
+ .check_reset_block = e1000e_check_reset_block_generic,
+ .commit = e1000e_phy_sw_reset,
+ .force_speed_duplex = e1000_phy_force_speed_duplex_80003es2lan,
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0038-e1000e-refactor-PHY-ID-detection-workaround.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0038-e1000e-refactor-PHY-ID-detection-workaround.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,85 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Wed, 2 Dec 2009 17:02:43 +0000
+Subject: [PATCH 038/166] e1000e: refactor PHY ID detection workaround
+
+commit 5eb6f3c70fcc0fb19b9087863e6e29f96a76f3bd upstream.
+
+The workaround that detects the correct PHY ID when an initial read of the
+PHY ID registers returns an invalid one should retry up to ten times with
+a small delay between attempts using a single PHY address and then repeat
+using the remaining possible PHY addresses. Do this instead of trying each
+possible PHY address repeating that up to 100 times.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/hw.h | 2 +-
+ drivers/net/e1000e/phy.c | 26 ++++++++++++++++----------
+ 2 files changed, 17 insertions(+), 11 deletions(-)
+
+diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h
+index 163e10e..4fef7ea 100644
+--- a/drivers/net/e1000e/hw.h
++++ b/drivers/net/e1000e/hw.h
+@@ -219,7 +219,7 @@ enum e1e_registers {
+ E1000_HICR = 0x08F00, /* Host Interface Control */
+ };
+
+-/* RSS registers */
++#define E1000_MAX_PHY_ADDR 4
+
+ /* IGP01E1000 Specific Registers */
+ #define IGP01E1000_PHY_PORT_CONFIG 0x10 /* Port Config */
+diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c
+index 0c69649..67a7188 100644
+--- a/drivers/net/e1000e/phy.c
++++ b/drivers/net/e1000e/phy.c
+@@ -2197,28 +2197,34 @@ enum e1000_phy_type e1000e_get_phy_type_from_id(u32 phy_id)
+ s32 e1000e_determine_phy_address(struct e1000_hw *hw)
+ {
+ s32 ret_val = -E1000_ERR_PHY_TYPE;
+- u32 phy_addr= 0;
+- u32 i = 0;
++ u32 phy_addr = 0;
++ u32 i;
+ enum e1000_phy_type phy_type = e1000_phy_unknown;
+
+- do {
+- for (phy_addr = 0; phy_addr < 4; phy_addr++) {
+- hw->phy.addr = phy_addr;
++ hw->phy.id = phy_type;
++
++ for (phy_addr = 0; phy_addr < E1000_MAX_PHY_ADDR; phy_addr++) {
++ hw->phy.addr = phy_addr;
++ i = 0;
++
++ do {
+ e1000e_get_phy_id(hw);
+ phy_type = e1000e_get_phy_type_from_id(hw->phy.id);
+
+- /*
++ /*
+ * If phy_type is valid, break - we found our
+ * PHY address
+ */
+ if (phy_type != e1000_phy_unknown) {
+ ret_val = 0;
+- break;
++ goto out;
+ }
+- }
+- i++;
+- } while ((ret_val != 0) && (i < 100));
++ msleep(1);
++ i++;
++ } while (i < 10);
++ }
+
++out:
+ return ret_val;
+ }
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0039-e1000e-correct-ICH-PCH-PHY-operations-function-point.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0039-e1000e-correct-ICH-PCH-PHY-operations-function-point.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,588 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Wed, 2 Dec 2009 17:03:18 +0000
+Subject: [PATCH 039/166] e1000e: correct ICH/PCH PHY operations function
+ pointers
+
+commit 0be8401051c716be4533272e983b7eed3d83946d upstream.
+
+Some function pointers for a few PHY operations (for 82578 and 82567) and
+were set incorrectly causing functions to be executed that were accessing
+incorrect PHY register offsets for that particular device. This patch also
+moves a few PHY-specific functions from ich8lan.c to the more appropriate
+phy.c.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/e1000.h | 6 +
+ drivers/net/e1000e/ich8lan.c | 216 ++++-------------------------------------
+ drivers/net/e1000e/phy.c | 191 ++++++++++++++++++++++++++++++++++---
+ 3 files changed, 204 insertions(+), 209 deletions(-)
+
+diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
+index 870ea64..79a9603 100644
+--- a/drivers/net/e1000e/e1000.h
++++ b/drivers/net/e1000e/e1000.h
+@@ -591,6 +591,12 @@ extern s32 e1000_get_phy_info_82577(struct e1000_hw *hw);
+ extern s32 e1000_phy_force_speed_duplex_82577(struct e1000_hw *hw);
+ extern s32 e1000_get_cable_length_82577(struct e1000_hw *hw);
+
++extern s32 e1000_check_polarity_m88(struct e1000_hw *hw);
++extern s32 e1000_get_phy_info_ife(struct e1000_hw *hw);
++extern s32 e1000_check_polarity_ife(struct e1000_hw *hw);
++extern s32 e1000_phy_force_speed_duplex_ife(struct e1000_hw *hw);
++extern s32 e1000_check_polarity_igp(struct e1000_hw *hw);
++
+ static inline s32 e1000_phy_hw_reset(struct e1000_hw *hw)
+ {
+ return hw->phy.ops.reset(hw);
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index a9bdfd4..84946e4 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -195,7 +195,6 @@ union ich8_flash_protected_range {
+ static s32 e1000_setup_link_ich8lan(struct e1000_hw *hw);
+ static void e1000_clear_hw_cntrs_ich8lan(struct e1000_hw *hw);
+ static void e1000_initialize_hw_bits_ich8lan(struct e1000_hw *hw);
+-static s32 e1000_check_polarity_ife_ich8lan(struct e1000_hw *hw);
+ static s32 e1000_erase_flash_bank_ich8lan(struct e1000_hw *hw, u32 bank);
+ static s32 e1000_retry_write_flash_byte_ich8lan(struct e1000_hw *hw,
+ u32 offset, u8 byte);
+@@ -260,7 +259,6 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw)
+ phy->addr = 1;
+ phy->reset_delay_us = 100;
+
+- phy->ops.check_polarity = e1000_check_polarity_ife_ich8lan;
+ phy->ops.read_reg = e1000_read_phy_reg_hv;
+ phy->ops.read_reg_locked = e1000_read_phy_reg_hv_locked;
+ phy->ops.set_d0_lplu_state = e1000_set_lplu_state_pchlan;
+@@ -285,13 +283,23 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw)
+ e1000e_get_phy_id(hw);
+ phy->type = e1000e_get_phy_type_from_id(phy->id);
+
+- if (phy->type == e1000_phy_82577) {
++ switch (phy->type) {
++ case e1000_phy_82577:
+ phy->ops.check_polarity = e1000_check_polarity_82577;
+ phy->ops.force_speed_duplex =
+ e1000_phy_force_speed_duplex_82577;
+- phy->ops.get_cable_length = e1000_get_cable_length_82577;
++ phy->ops.get_cable_length = e1000_get_cable_length_82577;
+ phy->ops.get_info = e1000_get_phy_info_82577;
+ phy->ops.commit = e1000e_phy_sw_reset;
++ case e1000_phy_82578:
++ phy->ops.check_polarity = e1000_check_polarity_m88;
++ phy->ops.force_speed_duplex = e1000e_phy_force_speed_duplex_m88;
++ phy->ops.get_cable_length = e1000e_get_cable_length_m88;
++ phy->ops.get_info = e1000e_get_phy_info_m88;
++ break;
++ default:
++ ret_val = -E1000_ERR_PHY;
++ break;
+ }
+
+ out:
+@@ -347,12 +355,18 @@ static s32 e1000_init_phy_params_ich8lan(struct e1000_hw *hw)
+ phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT;
+ phy->ops.read_reg_locked = e1000e_read_phy_reg_igp_locked;
+ phy->ops.write_reg_locked = e1000e_write_phy_reg_igp_locked;
++ phy->ops.get_info = e1000e_get_phy_info_igp;
++ phy->ops.check_polarity = e1000_check_polarity_igp;
++ phy->ops.force_speed_duplex = e1000e_phy_force_speed_duplex_igp;
+ break;
+ case IFE_E_PHY_ID:
+ case IFE_PLUS_E_PHY_ID:
+ case IFE_C_E_PHY_ID:
+ phy->type = e1000_phy_ife;
+ phy->autoneg_mask = E1000_ALL_NOT_GIG;
++ phy->ops.get_info = e1000_get_phy_info_ife;
++ phy->ops.check_polarity = e1000_check_polarity_ife;
++ phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_ife;
+ break;
+ case BME1000_E_PHY_ID:
+ phy->type = e1000_phy_bm;
+@@ -360,14 +374,15 @@ static s32 e1000_init_phy_params_ich8lan(struct e1000_hw *hw)
+ phy->ops.read_reg = e1000e_read_phy_reg_bm;
+ phy->ops.write_reg = e1000e_write_phy_reg_bm;
+ phy->ops.commit = e1000e_phy_sw_reset;
++ phy->ops.get_info = e1000e_get_phy_info_m88;
++ phy->ops.check_polarity = e1000_check_polarity_m88;
++ phy->ops.force_speed_duplex = e1000e_phy_force_speed_duplex_m88;
+ break;
+ default:
+ return -E1000_ERR_PHY;
+ break;
+ }
+
+- phy->ops.check_polarity = e1000_check_polarity_ife_ich8lan;
+-
+ return 0;
+ }
+
+@@ -751,77 +766,6 @@ static s32 e1000_check_reset_block_ich8lan(struct e1000_hw *hw)
+ }
+
+ /**
+- * e1000_phy_force_speed_duplex_ich8lan - Force PHY speed & duplex
+- * @hw: pointer to the HW structure
+- *
+- * Forces the speed and duplex settings of the PHY.
+- * This is a function pointer entry point only called by
+- * PHY setup routines.
+- **/
+-static s32 e1000_phy_force_speed_duplex_ich8lan(struct e1000_hw *hw)
+-{
+- struct e1000_phy_info *phy = &hw->phy;
+- s32 ret_val;
+- u16 data;
+- bool link;
+-
+- if (phy->type != e1000_phy_ife) {
+- ret_val = e1000e_phy_force_speed_duplex_igp(hw);
+- return ret_val;
+- }
+-
+- ret_val = e1e_rphy(hw, PHY_CONTROL, &data);
+- if (ret_val)
+- return ret_val;
+-
+- e1000e_phy_force_speed_duplex_setup(hw, &data);
+-
+- ret_val = e1e_wphy(hw, PHY_CONTROL, data);
+- if (ret_val)
+- return ret_val;
+-
+- /* Disable MDI-X support for 10/100 */
+- ret_val = e1e_rphy(hw, IFE_PHY_MDIX_CONTROL, &data);
+- if (ret_val)
+- return ret_val;
+-
+- data &= ~IFE_PMC_AUTO_MDIX;
+- data &= ~IFE_PMC_FORCE_MDIX;
+-
+- ret_val = e1e_wphy(hw, IFE_PHY_MDIX_CONTROL, data);
+- if (ret_val)
+- return ret_val;
+-
+- e_dbg("IFE PMC: %X\n", data);
+-
+- udelay(1);
+-
+- if (phy->autoneg_wait_to_complete) {
+- e_dbg("Waiting for forced speed/duplex link on IFE phy.\n");
+-
+- ret_val = e1000e_phy_has_link_generic(hw,
+- PHY_FORCE_LIMIT,
+- 100000,
+- &link);
+- if (ret_val)
+- return ret_val;
+-
+- if (!link)
+- e_dbg("Link taking longer than expected.\n");
+-
+- /* Try once more */
+- ret_val = e1000e_phy_has_link_generic(hw,
+- PHY_FORCE_LIMIT,
+- 100000,
+- &link);
+- if (ret_val)
+- return ret_val;
+- }
+-
+- return 0;
+-}
+-
+-/**
+ * e1000_sw_lcd_config_ich8lan - SW-based LCD Configuration
+ * @hw: pointer to the HW structure
+ *
+@@ -1273,122 +1217,6 @@ out:
+ }
+
+ /**
+- * e1000_get_phy_info_ife_ich8lan - Retrieves various IFE PHY states
+- * @hw: pointer to the HW structure
+- *
+- * Populates "phy" structure with various feature states.
+- * This function is only called by other family-specific
+- * routines.
+- **/
+-static s32 e1000_get_phy_info_ife_ich8lan(struct e1000_hw *hw)
+-{
+- struct e1000_phy_info *phy = &hw->phy;
+- s32 ret_val;
+- u16 data;
+- bool link;
+-
+- ret_val = e1000e_phy_has_link_generic(hw, 1, 0, &link);
+- if (ret_val)
+- return ret_val;
+-
+- if (!link) {
+- e_dbg("Phy info is only valid if link is up\n");
+- return -E1000_ERR_CONFIG;
+- }
+-
+- ret_val = e1e_rphy(hw, IFE_PHY_SPECIAL_CONTROL, &data);
+- if (ret_val)
+- return ret_val;
+- phy->polarity_correction = (!(data & IFE_PSC_AUTO_POLARITY_DISABLE));
+-
+- if (phy->polarity_correction) {
+- ret_val = phy->ops.check_polarity(hw);
+- if (ret_val)
+- return ret_val;
+- } else {
+- /* Polarity is forced */
+- phy->cable_polarity = (data & IFE_PSC_FORCE_POLARITY)
+- ? e1000_rev_polarity_reversed
+- : e1000_rev_polarity_normal;
+- }
+-
+- ret_val = e1e_rphy(hw, IFE_PHY_MDIX_CONTROL, &data);
+- if (ret_val)
+- return ret_val;
+-
+- phy->is_mdix = (data & IFE_PMC_MDIX_STATUS);
+-
+- /* The following parameters are undefined for 10/100 operation. */
+- phy->cable_length = E1000_CABLE_LENGTH_UNDEFINED;
+- phy->local_rx = e1000_1000t_rx_status_undefined;
+- phy->remote_rx = e1000_1000t_rx_status_undefined;
+-
+- return 0;
+-}
+-
+-/**
+- * e1000_get_phy_info_ich8lan - Calls appropriate PHY type get_phy_info
+- * @hw: pointer to the HW structure
+- *
+- * Wrapper for calling the get_phy_info routines for the appropriate phy type.
+- * This is a function pointer entry point called by drivers
+- * or other shared routines.
+- **/
+-static s32 e1000_get_phy_info_ich8lan(struct e1000_hw *hw)
+-{
+- switch (hw->phy.type) {
+- case e1000_phy_ife:
+- return e1000_get_phy_info_ife_ich8lan(hw);
+- break;
+- case e1000_phy_igp_3:
+- case e1000_phy_bm:
+- case e1000_phy_82578:
+- case e1000_phy_82577:
+- return e1000e_get_phy_info_igp(hw);
+- break;
+- default:
+- break;
+- }
+-
+- return -E1000_ERR_PHY_TYPE;
+-}
+-
+-/**
+- * e1000_check_polarity_ife_ich8lan - Check cable polarity for IFE PHY
+- * @hw: pointer to the HW structure
+- *
+- * Polarity is determined on the polarity reversal feature being enabled.
+- * This function is only called by other family-specific
+- * routines.
+- **/
+-static s32 e1000_check_polarity_ife_ich8lan(struct e1000_hw *hw)
+-{
+- struct e1000_phy_info *phy = &hw->phy;
+- s32 ret_val;
+- u16 phy_data, offset, mask;
+-
+- /*
+- * Polarity is determined based on the reversal feature being enabled.
+- */
+- if (phy->polarity_correction) {
+- offset = IFE_PHY_EXTENDED_STATUS_CONTROL;
+- mask = IFE_PESC_POLARITY_REVERSED;
+- } else {
+- offset = IFE_PHY_SPECIAL_CONTROL;
+- mask = IFE_PSC_FORCE_POLARITY;
+- }
+-
+- ret_val = e1e_rphy(hw, offset, &phy_data);
+-
+- if (!ret_val)
+- phy->cable_polarity = (phy_data & mask)
+- ? e1000_rev_polarity_reversed
+- : e1000_rev_polarity_normal;
+-
+- return ret_val;
+-}
+-
+-/**
+ * e1000_set_lplu_state_pchlan - Set Low Power Link Up state
+ * @hw: pointer to the HW structure
+ * @active: true to enable LPLU, false to disable
+@@ -3496,10 +3324,8 @@ static struct e1000_phy_operations ich8_phy_ops = {
+ .acquire = e1000_acquire_swflag_ich8lan,
+ .check_reset_block = e1000_check_reset_block_ich8lan,
+ .commit = NULL,
+- .force_speed_duplex = e1000_phy_force_speed_duplex_ich8lan,
+ .get_cfg_done = e1000_get_cfg_done_ich8lan,
+ .get_cable_length = e1000e_get_cable_length_igp_2,
+- .get_info = e1000_get_phy_info_ich8lan,
+ .read_reg = e1000e_read_phy_reg_igp,
+ .release = e1000_release_swflag_ich8lan,
+ .reset = e1000_phy_hw_reset_ich8lan,
+diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c
+index 67a7188..55a2c0a 100644
+--- a/drivers/net/e1000e/phy.c
++++ b/drivers/net/e1000e/phy.c
+@@ -1322,17 +1322,22 @@ s32 e1000e_phy_force_speed_duplex_m88(struct e1000_hw *hw)
+ return ret_val;
+
+ if (!link) {
+- /*
+- * We didn't get link.
+- * Reset the DSP and cross our fingers.
+- */
+- ret_val = e1e_wphy(hw, M88E1000_PHY_PAGE_SELECT,
+- 0x001d);
+- if (ret_val)
+- return ret_val;
+- ret_val = e1000e_phy_reset_dsp(hw);
+- if (ret_val)
+- return ret_val;
++ if (hw->phy.type != e1000_phy_m88) {
++ e_dbg("Link taking longer than expected.\n");
++ } else {
++ /*
++ * We didn't get link.
++ * Reset the DSP and cross our fingers.
++ */
++ ret_val = e1e_wphy(hw,
++ M88E1000_PHY_PAGE_SELECT,
++ 0x001d);
++ if (ret_val)
++ return ret_val;
++ ret_val = e1000e_phy_reset_dsp(hw);
++ if (ret_val)
++ return ret_val;
++ }
+ }
+
+ /* Try once more */
+@@ -1342,6 +1347,9 @@ s32 e1000e_phy_force_speed_duplex_m88(struct e1000_hw *hw)
+ return ret_val;
+ }
+
++ if (hw->phy.type != e1000_phy_m88)
++ return 0;
++
+ ret_val = e1e_rphy(hw, M88E1000_EXT_PHY_SPEC_CTRL, &phy_data);
+ if (ret_val)
+ return ret_val;
+@@ -1371,6 +1379,73 @@ s32 e1000e_phy_force_speed_duplex_m88(struct e1000_hw *hw)
+ }
+
+ /**
++ * e1000_phy_force_speed_duplex_ife - Force PHY speed & duplex
++ * @hw: pointer to the HW structure
++ *
++ * Forces the speed and duplex settings of the PHY.
++ * This is a function pointer entry point only called by
++ * PHY setup routines.
++ **/
++s32 e1000_phy_force_speed_duplex_ife(struct e1000_hw *hw)
++{
++ struct e1000_phy_info *phy = &hw->phy;
++ s32 ret_val;
++ u16 data;
++ bool link;
++
++ ret_val = e1e_rphy(hw, PHY_CONTROL, &data);
++ if (ret_val)
++ goto out;
++
++ e1000e_phy_force_speed_duplex_setup(hw, &data);
++
++ ret_val = e1e_wphy(hw, PHY_CONTROL, data);
++ if (ret_val)
++ goto out;
++
++ /* Disable MDI-X support for 10/100 */
++ ret_val = e1e_rphy(hw, IFE_PHY_MDIX_CONTROL, &data);
++ if (ret_val)
++ goto out;
++
++ data &= ~IFE_PMC_AUTO_MDIX;
++ data &= ~IFE_PMC_FORCE_MDIX;
++
++ ret_val = e1e_wphy(hw, IFE_PHY_MDIX_CONTROL, data);
++ if (ret_val)
++ goto out;
++
++ e_dbg("IFE PMC: %X\n", data);
++
++ udelay(1);
++
++ if (phy->autoneg_wait_to_complete) {
++ e_dbg("Waiting for forced speed/duplex link on IFE phy.\n");
++
++ ret_val = e1000e_phy_has_link_generic(hw,
++ PHY_FORCE_LIMIT,
++ 100000,
++ &link);
++ if (ret_val)
++ goto out;
++
++ if (!link)
++ e_dbg("Link taking longer than expected.\n");
++
++ /* Try once more */
++ ret_val = e1000e_phy_has_link_generic(hw,
++ PHY_FORCE_LIMIT,
++ 100000,
++ &link);
++ if (ret_val)
++ goto out;
++ }
++
++out:
++ return ret_val;
++}
++
++/**
+ * e1000e_phy_force_speed_duplex_setup - Configure forced PHY speed/duplex
+ * @hw: pointer to the HW structure
+ * @phy_ctrl: pointer to current value of PHY_CONTROL
+@@ -1557,7 +1632,7 @@ s32 e1000e_check_downshift(struct e1000_hw *hw)
+ *
+ * Polarity is determined based on the PHY specific status register.
+ **/
+-static s32 e1000_check_polarity_m88(struct e1000_hw *hw)
++s32 e1000_check_polarity_m88(struct e1000_hw *hw)
+ {
+ struct e1000_phy_info *phy = &hw->phy;
+ s32 ret_val;
+@@ -1582,7 +1657,7 @@ static s32 e1000_check_polarity_m88(struct e1000_hw *hw)
+ * Polarity is determined based on the PHY port status register, and the
+ * current speed (since there is no polarity at 100Mbps).
+ **/
+-static s32 e1000_check_polarity_igp(struct e1000_hw *hw)
++s32 e1000_check_polarity_igp(struct e1000_hw *hw)
+ {
+ struct e1000_phy_info *phy = &hw->phy;
+ s32 ret_val;
+@@ -1620,6 +1695,39 @@ static s32 e1000_check_polarity_igp(struct e1000_hw *hw)
+ }
+
+ /**
++ * e1000_check_polarity_ife - Check cable polarity for IFE PHY
++ * @hw: pointer to the HW structure
++ *
++ * Polarity is determined on the polarity reversal feature being enabled.
++ **/
++s32 e1000_check_polarity_ife(struct e1000_hw *hw)
++{
++ struct e1000_phy_info *phy = &hw->phy;
++ s32 ret_val;
++ u16 phy_data, offset, mask;
++
++ /*
++ * Polarity is determined based on the reversal feature being enabled.
++ */
++ if (phy->polarity_correction) {
++ offset = IFE_PHY_EXTENDED_STATUS_CONTROL;
++ mask = IFE_PESC_POLARITY_REVERSED;
++ } else {
++ offset = IFE_PHY_SPECIAL_CONTROL;
++ mask = IFE_PSC_FORCE_POLARITY;
++ }
++
++ ret_val = e1e_rphy(hw, offset, &phy_data);
++
++ if (!ret_val)
++ phy->cable_polarity = (phy_data & mask)
++ ? e1000_rev_polarity_reversed
++ : e1000_rev_polarity_normal;
++
++ return ret_val;
++}
++
++/**
+ * e1000_wait_autoneg - Wait for auto-neg completion
+ * @hw: pointer to the HW structure
+ *
+@@ -1823,7 +1931,7 @@ s32 e1000e_get_phy_info_m88(struct e1000_hw *hw)
+ u16 phy_data;
+ bool link;
+
+- if (hw->phy.media_type != e1000_media_type_copper) {
++ if (phy->media_type != e1000_media_type_copper) {
+ e_dbg("Phy info is only valid for copper media\n");
+ return -E1000_ERR_CONFIG;
+ }
+@@ -1944,6 +2052,61 @@ s32 e1000e_get_phy_info_igp(struct e1000_hw *hw)
+ }
+
+ /**
++ * e1000_get_phy_info_ife - Retrieves various IFE PHY states
++ * @hw: pointer to the HW structure
++ *
++ * Populates "phy" structure with various feature states.
++ **/
++s32 e1000_get_phy_info_ife(struct e1000_hw *hw)
++{
++ struct e1000_phy_info *phy = &hw->phy;
++ s32 ret_val;
++ u16 data;
++ bool link;
++
++ ret_val = e1000e_phy_has_link_generic(hw, 1, 0, &link);
++ if (ret_val)
++ goto out;
++
++ if (!link) {
++ e_dbg("Phy info is only valid if link is up\n");
++ ret_val = -E1000_ERR_CONFIG;
++ goto out;
++ }
++
++ ret_val = e1e_rphy(hw, IFE_PHY_SPECIAL_CONTROL, &data);
++ if (ret_val)
++ goto out;
++ phy->polarity_correction = (data & IFE_PSC_AUTO_POLARITY_DISABLE)
++ ? false : true;
++
++ if (phy->polarity_correction) {
++ ret_val = e1000_check_polarity_ife(hw);
++ if (ret_val)
++ goto out;
++ } else {
++ /* Polarity is forced */
++ phy->cable_polarity = (data & IFE_PSC_FORCE_POLARITY)
++ ? e1000_rev_polarity_reversed
++ : e1000_rev_polarity_normal;
++ }
++
++ ret_val = e1e_rphy(hw, IFE_PHY_MDIX_CONTROL, &data);
++ if (ret_val)
++ goto out;
++
++ phy->is_mdix = (data & IFE_PMC_MDIX_STATUS) ? true : false;
++
++ /* The following parameters are undefined for 10/100 operation. */
++ phy->cable_length = E1000_CABLE_LENGTH_UNDEFINED;
++ phy->local_rx = e1000_1000t_rx_status_undefined;
++ phy->remote_rx = e1000_1000t_rx_status_undefined;
++
++out:
++ return ret_val;
++}
++
++/**
+ * e1000e_phy_sw_reset - PHY software reset
+ * @hw: pointer to the HW structure
+ *
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0040-drivers-net-Move-and-to-end-of-previous-line.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0040-drivers-net-Move-and-to-end-of-previous-line.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,51 @@
+From: Joe Perches <joe at perches.com>
+Date: Thu, 3 Dec 2009 07:58:21 +0000
+Subject: [PATCH 040/166] drivers/net: Move && and || to end of previous line
+
+commit 8e95a2026f3b43f7c3d676adaccd2de9532e8dcc upstream.
+
+Only files where David Miller is the primary git-signer.
+wireless, wimax, ixgbe, etc are not modified.
+
+Compile tested x86 allyesconfig only
+Not all files compiled (not x86 compatible)
+
+Added a few > 80 column lines, which I ignored.
+Existing checkpatch complaints ignored.
+
+Signed-off-by: Joe Perches <joe at perches.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Restricted to drivers/net/e1000e]
+---
+ drivers/net/e1000e/netdev.c | 8 ++++----
+ 1 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 27a1c25..76dad54 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -691,8 +691,8 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter)
+ adapter->detect_tx_hung = 0;
+ if (tx_ring->buffer_info[i].time_stamp &&
+ time_after(jiffies, tx_ring->buffer_info[i].time_stamp
+- + (adapter->tx_timeout_factor * HZ))
+- && !(er32(STATUS) & E1000_STATUS_TXOFF)) {
++ + (adapter->tx_timeout_factor * HZ)) &&
++ !(er32(STATUS) & E1000_STATUS_TXOFF)) {
+ schedule_work(&adapter->print_hang_task);
+ netif_stop_queue(netdev);
+ }
+@@ -4058,8 +4058,8 @@ static int e1000_transfer_dhcp_info(struct e1000_adapter *adapter,
+ u16 length, offset;
+
+ if (vlan_tx_tag_present(skb)) {
+- if (!((vlan_tx_tag_get(skb) == adapter->hw.mng_cookie.vlan_id)
+- && (adapter->hw.mng_cookie.status &
++ if (!((vlan_tx_tag_get(skb) == adapter->hw.mng_cookie.vlan_id) &&
++ (adapter->hw.mng_cookie.status &
+ E1000_MNG_DHCP_COOKIE_STATUS_VLAN)))
+ return 0;
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0041-e1000e-minor-correction-to-name-of-bit-in-CTRL_EXT-r.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0041-e1000e-minor-correction-to-name-of-bit-in-CTRL_EXT-r.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,47 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Tue, 8 Dec 2009 07:27:41 +0000
+Subject: [PATCH 041/166] e1000e: minor correction to name of bit in CTRL_EXT
+ register
+
+commit 93a23f48df9c0111283302acd2a4ed2ef1d86453 upstream.
+
+Bit 7 in the CTRL_REG register is actually the Software Definable Pin 3,
+not the Software Definable Pin 7.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/defines.h | 2 +-
+ drivers/net/e1000e/netdev.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/e1000e/defines.h b/drivers/net/e1000e/defines.h
+index 86d2809..e02e382 100644
+--- a/drivers/net/e1000e/defines.h
++++ b/drivers/net/e1000e/defines.h
+@@ -74,7 +74,7 @@
+ #define E1000_WUS_BC E1000_WUFC_BC
+
+ /* Extended Device Control */
+-#define E1000_CTRL_EXT_SDP7_DATA 0x00000080 /* Value of SW Definable Pin 7 */
++#define E1000_CTRL_EXT_SDP3_DATA 0x00000080 /* Value of SW Definable Pin 3 */
+ #define E1000_CTRL_EXT_EE_RST 0x00002000 /* Reinitialize from EEPROM */
+ #define E1000_CTRL_EXT_SPD_BYPS 0x00008000 /* Speed Select Bypass */
+ #define E1000_CTRL_EXT_RO_DIS 0x00020000 /* Relaxed Ordering disable */
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 76dad54..85974a9 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -4547,7 +4547,7 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool *enable_wake)
+ e1000_media_type_internal_serdes) {
+ /* keep the laser running in D3 */
+ ctrl_ext = er32(CTRL_EXT);
+- ctrl_ext |= E1000_CTRL_EXT_SDP7_DATA;
++ ctrl_ext |= E1000_CTRL_EXT_SDP3_DATA;
+ ew32(CTRL_EXT, ctrl_ext);
+ }
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0042-e1000e-replace-incorrect-use-of-GG82563_REG-macro.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0042-e1000e-replace-incorrect-use-of-GG82563_REG-macro.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,60 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Tue, 8 Dec 2009 07:28:01 +0000
+Subject: [PATCH 042/166] e1000e: replace incorrect use of GG82563_REG macro
+
+commit 0781895067444db98050a1537bafbc7a0235ec9f upstream.
+
+The GG82563_REG() macro should not be used to determine the offset provided
+to the e1000e_[read|write]_kmrn_reg() functions since the first argument to
+the macro is already implied and gets masked off anyway in the functions.
+The resultant register reads/writes with this patch are functionally the
+same as before.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/hw.h | 2 ++
+ drivers/net/e1000e/ich8lan.c | 8 +++++---
+ 2 files changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h
+index 4fef7ea..8462dbd 100644
+--- a/drivers/net/e1000e/hw.h
++++ b/drivers/net/e1000e/hw.h
+@@ -302,6 +302,8 @@ enum e1e_registers {
+ #define E1000_KMRNCTRLSTA_OFFSET_SHIFT 16
+ #define E1000_KMRNCTRLSTA_REN 0x00200000
+ #define E1000_KMRNCTRLSTA_DIAG_OFFSET 0x3 /* Kumeran Diagnostic */
++#define E1000_KMRNCTRLSTA_TIMEOUTS 0x4 /* Kumeran Timeouts */
++#define E1000_KMRNCTRLSTA_INBAND_PARAM 0x9 /* Kumeran InBand Parameters */
+ #define E1000_KMRNCTRLSTA_DIAG_NELPBK 0x1000 /* Nearend Loopback mode */
+ #define E1000_KMRNCTRLSTA_K1_CONFIG 0x7
+ #define E1000_KMRNCTRLSTA_K1_ENABLE 0x0002
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index 84946e4..642925e 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -2766,14 +2766,16 @@ static s32 e1000_setup_copper_link_ich8lan(struct e1000_hw *hw)
+ * and increase the max iterations when polling the phy;
+ * this fixes erroneous timeouts at 10Mbps.
+ */
+- ret_val = e1000e_write_kmrn_reg(hw, GG82563_REG(0x34, 4), 0xFFFF);
++ ret_val = e1000e_write_kmrn_reg(hw, E1000_KMRNCTRLSTA_TIMEOUTS, 0xFFFF);
+ if (ret_val)
+ return ret_val;
+- ret_val = e1000e_read_kmrn_reg(hw, GG82563_REG(0x34, 9), ®_data);
++ ret_val = e1000e_read_kmrn_reg(hw, E1000_KMRNCTRLSTA_INBAND_PARAM,
++ ®_data);
+ if (ret_val)
+ return ret_val;
+ reg_data |= 0x3F;
+- ret_val = e1000e_write_kmrn_reg(hw, GG82563_REG(0x34, 9), reg_data);
++ ret_val = e1000e_write_kmrn_reg(hw, E1000_KMRNCTRLSTA_INBAND_PARAM,
++ reg_data);
+ if (ret_val)
+ return ret_val;
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0043-e1000e-only-perform-ESB2-MDIC-workaround-on-certain-.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0043-e1000e-only-perform-ESB2-MDIC-workaround-on-certain-.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,187 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Tue, 8 Dec 2009 07:28:20 +0000
+Subject: [PATCH 043/166] e1000e: only perform ESB2 MDIC workaround on certain
+ configurations
+
+commit 3421eecdee750bafc78b12ac25b3e980195265eb upstream.
+
+A workaround added for all ESB2 devices (adds a delay for all MDIC accesses
+which resolves an issue with the MDIC ready bit being set prematurely) is
+applicable only to devices in which the MAC-PHY interconnect is not
+operating in a certain mode with in-band MDIO. Check the control register
+for the operating mode and enable the workaround accordingly.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/es2lan.c | 97 ++++++++++++++++++++++++++++---------------
+ drivers/net/e1000e/hw.h | 5 ++
+ 2 files changed, 69 insertions(+), 33 deletions(-)
+
+diff --git a/drivers/net/e1000e/es2lan.c b/drivers/net/e1000e/es2lan.c
+index d2a1047..3028f23 100644
+--- a/drivers/net/e1000e/es2lan.c
++++ b/drivers/net/e1000e/es2lan.c
+@@ -46,6 +46,9 @@
+ #define E1000_KMRNCTRLSTA_HD_CTRL_1000_DEFAULT 0x0000
+ #define E1000_KMRNCTRLSTA_OPMODE_E_IDLE 0x2000
+
++#define E1000_KMRNCTRLSTA_OPMODE_MASK 0x000C
++#define E1000_KMRNCTRLSTA_OPMODE_INBAND_MDIO 0x0004
++
+ #define E1000_TCTL_EXT_GCEX_MASK 0x000FFC00 /* Gigabit Carry Extend Padding */
+ #define DEFAULT_TCTL_EXT_GCEX_80003ES2LAN 0x00010000
+
+@@ -462,28 +465,36 @@ static s32 e1000_read_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
+ return ret_val;
+ }
+
+- /*
+- * The "ready" bit in the MDIC register may be incorrectly set
+- * before the device has completed the "Page Select" MDI
+- * transaction. So we wait 200us after each MDI command...
+- */
+- udelay(200);
++ if (hw->dev_spec.e80003es2lan.mdic_wa_enable == true) {
++ /*
++ * The "ready" bit in the MDIC register may be incorrectly set
++ * before the device has completed the "Page Select" MDI
++ * transaction. So we wait 200us after each MDI command...
++ */
++ udelay(200);
+
+- /* ...and verify the command was successful. */
+- ret_val = e1000e_read_phy_reg_mdic(hw, page_select, &temp);
++ /* ...and verify the command was successful. */
++ ret_val = e1000e_read_phy_reg_mdic(hw, page_select, &temp);
+
+- if (((u16)offset >> GG82563_PAGE_SHIFT) != temp) {
+- ret_val = -E1000_ERR_PHY;
+- e1000_release_phy_80003es2lan(hw);
+- return ret_val;
+- }
++ if (((u16)offset >> GG82563_PAGE_SHIFT) != temp) {
++ ret_val = -E1000_ERR_PHY;
++ e1000_release_phy_80003es2lan(hw);
++ return ret_val;
++ }
+
+- udelay(200);
++ udelay(200);
+
+- ret_val = e1000e_read_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset,
+- data);
++ ret_val = e1000e_read_phy_reg_mdic(hw,
++ MAX_PHY_REG_ADDRESS & offset,
++ data);
++
++ udelay(200);
++ } else {
++ ret_val = e1000e_read_phy_reg_mdic(hw,
++ MAX_PHY_REG_ADDRESS & offset,
++ data);
++ }
+
+- udelay(200);
+ e1000_release_phy_80003es2lan(hw);
+
+ return ret_val;
+@@ -526,28 +537,35 @@ static s32 e1000_write_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
+ return ret_val;
+ }
+
++ if (hw->dev_spec.e80003es2lan.mdic_wa_enable == true) {
++ /*
++ * The "ready" bit in the MDIC register may be incorrectly set
++ * before the device has completed the "Page Select" MDI
++ * transaction. So we wait 200us after each MDI command...
++ */
++ udelay(200);
+
+- /*
+- * The "ready" bit in the MDIC register may be incorrectly set
+- * before the device has completed the "Page Select" MDI
+- * transaction. So we wait 200us after each MDI command...
+- */
+- udelay(200);
++ /* ...and verify the command was successful. */
++ ret_val = e1000e_read_phy_reg_mdic(hw, page_select, &temp);
+
+- /* ...and verify the command was successful. */
+- ret_val = e1000e_read_phy_reg_mdic(hw, page_select, &temp);
++ if (((u16)offset >> GG82563_PAGE_SHIFT) != temp) {
++ e1000_release_phy_80003es2lan(hw);
++ return -E1000_ERR_PHY;
++ }
+
+- if (((u16)offset >> GG82563_PAGE_SHIFT) != temp) {
+- e1000_release_phy_80003es2lan(hw);
+- return -E1000_ERR_PHY;
+- }
++ udelay(200);
+
+- udelay(200);
++ ret_val = e1000e_write_phy_reg_mdic(hw,
++ MAX_PHY_REG_ADDRESS & offset,
++ data);
+
+- ret_val = e1000e_write_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset,
+- data);
++ udelay(200);
++ } else {
++ ret_val = e1000e_write_phy_reg_mdic(hw,
++ MAX_PHY_REG_ADDRESS & offset,
++ data);
++ }
+
+- udelay(200);
+ e1000_release_phy_80003es2lan(hw);
+
+ return ret_val;
+@@ -866,6 +884,19 @@ static s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw)
+ reg_data &= ~0x00100000;
+ E1000_WRITE_REG_ARRAY(hw, E1000_FFLT, 0x0001, reg_data);
+
++ /* default to true to enable the MDIC W/A */
++ hw->dev_spec.e80003es2lan.mdic_wa_enable = true;
++
++ ret_val = e1000_read_kmrn_reg_80003es2lan(hw,
++ E1000_KMRNCTRLSTA_OFFSET >>
++ E1000_KMRNCTRLSTA_OFFSET_SHIFT,
++ &i);
++ if (!ret_val) {
++ if ((i & E1000_KMRNCTRLSTA_OPMODE_MASK) ==
++ E1000_KMRNCTRLSTA_OPMODE_INBAND_MDIO)
++ hw->dev_spec.e80003es2lan.mdic_wa_enable = false;
++ }
++
+ /*
+ * Clear all of the statistics registers (clear on read). It is
+ * important that we do this after we have tried to establish link
+diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h
+index 8462dbd..f78c537 100644
+--- a/drivers/net/e1000e/hw.h
++++ b/drivers/net/e1000e/hw.h
+@@ -900,6 +900,10 @@ struct e1000_dev_spec_82571 {
+ u32 smb_counter;
+ };
+
++struct e1000_dev_spec_80003es2lan {
++ bool mdic_wa_enable;
++};
++
+ struct e1000_shadow_ram {
+ u16 value;
+ bool modified;
+@@ -928,6 +932,7 @@ struct e1000_hw {
+
+ union {
+ struct e1000_dev_spec_82571 e82571;
++ struct e1000_dev_spec_80003es2lan e80003es2lan;
+ struct e1000_dev_spec_ich8lan ich8lan;
+ } dev_spec;
+ };
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0044-e1000e-LED-settings-in-EEPROM-ignored-on-82571-and-8.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0044-e1000e-LED-settings-in-EEPROM-ignored-on-82571-and-8.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,43 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Fri, 18 Dec 2009 20:14:59 -0800
+Subject: [PATCH 044/166] e1000e: LED settings in EEPROM ignored on 82571 and
+ 82572
+
+commit db94ce90d3d571c11637a912cc39cfb80df3879c upstream.
+
+Do not override the customizable LED configuration set in the EEPROM.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/82571.c | 6 ------
+ 1 files changed, 0 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+index c1a42cf..b979464 100644
+--- a/drivers/net/e1000e/82571.c
++++ b/drivers/net/e1000e/82571.c
+@@ -1290,7 +1290,6 @@ static s32 e1000_setup_link_82571(struct e1000_hw *hw)
+ static s32 e1000_setup_copper_link_82571(struct e1000_hw *hw)
+ {
+ u32 ctrl;
+- u32 led_ctrl;
+ s32 ret_val;
+
+ ctrl = er32(CTRL);
+@@ -1305,11 +1304,6 @@ static s32 e1000_setup_copper_link_82571(struct e1000_hw *hw)
+ break;
+ case e1000_phy_igp_2:
+ ret_val = e1000e_copper_link_setup_igp(hw);
+- /* Setup activity LED */
+- led_ctrl = er32(LEDCTL);
+- led_ctrl &= IGP_ACTIVITY_LED_MASK;
+- led_ctrl |= (IGP_ACTIVITY_LED_ENABLE | IGP_LED3_MODE);
+- ew32(LEDCTL, led_ctrl);
+ break;
+ default:
+ return -E1000_ERR_PHY;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0045-drivers-net-use-DEFINE_PCI_DEVICE_TABLE.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0045-drivers-net-use-DEFINE_PCI_DEVICE_TABLE.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,32 @@
+From: Alexey Dobriyan <adobriyan at gmail.com>
+Date: Thu, 7 Jan 2010 11:58:11 +0000
+Subject: [PATCH 045/166] drivers/net/: use DEFINE_PCI_DEVICE_TABLE()
+
+commit a3aa18842a5303fc28fcc4d57dbd16618bd830a0 upstream.
+
+Use DEFINE_PCI_DEVICE_TABLE() so we get place PCI ids table into correct section
+in every case.
+
+Signed-off-by: Alexey Dobriyan <adobriyan at gmail.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Restricted to drivers/net/e1000e]
+---
+ drivers/net/e1000e/netdev.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 85974a9..43ca9a8 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -5332,7 +5332,7 @@ static struct pci_error_handlers e1000_err_handler = {
+ .resume = e1000_io_resume,
+ };
+
+-static struct pci_device_id e1000_pci_tbl[] = {
++static DEFINE_PCI_DEVICE_TABLE(e1000_pci_tbl) = {
+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_82571EB_COPPER), board_82571 },
+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_82571EB_FIBER), board_82571 },
+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_82571EB_QUAD_COPPER), board_82571 },
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0046-e1000e-call-pci_save_state-after-pci_restore_state.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0046-e1000e-call-pci_save_state-after-pci_restore_state.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,43 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Thu, 7 Jan 2010 16:30:56 +0000
+Subject: [PATCH 046/166] e1000e: call pci_save_state() after
+ pci_restore_state()
+
+commit 28b8f04a5256ca5ec0781b06ee9353c37c650980 upstream.
+
+Due to a change in pci_restore_state()[1] which clears the saved_state
+flag, the driver should call pci_save_state() to set the flag once again
+to avoid issues with EEH (same fix that recently was submitted for ixgbe).
+
+[1] commmit 4b77b0a2ba27d64f58f16d8d4d48d8319dda36ff
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/netdev.c | 2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 43ca9a8..b9b39c5 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -4680,6 +4680,7 @@ static int e1000_resume(struct pci_dev *pdev)
+
+ pci_set_power_state(pdev, PCI_D0);
+ pci_restore_state(pdev);
++ pci_save_state(pdev);
+ e1000e_disable_l1aspm(pdev);
+
+ err = pci_enable_device_mem(pdev);
+@@ -4831,6 +4832,7 @@ static pci_ers_result_t e1000_io_slot_reset(struct pci_dev *pdev)
+ } else {
+ pci_set_master(pdev);
+ pci_restore_state(pdev);
++ pci_save_state(pdev);
+
+ pci_enable_wake(pdev, PCI_D3hot, 0);
+ pci_enable_wake(pdev, PCI_D3cold, 0);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0047-e1000e-don-t-accumulate-PHY-statistics-on-PHY-read-f.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0047-e1000e-don-t-accumulate-PHY-statistics-on-PHY-read-f.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,78 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Thu, 7 Jan 2010 16:31:16 +0000
+Subject: [PATCH 047/166] e1000e: don't accumulate PHY statistics on PHY read
+ failure
+
+commit 29477e249f5a28444c556bbb816f3af2b6f84412 upstream.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/netdev.c | 28 ++++++++++++++--------------
+ 1 files changed, 14 insertions(+), 14 deletions(-)
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index b9b39c5..28f1333 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -3327,24 +3327,24 @@ void e1000e_update_stats(struct e1000_adapter *adapter)
+ if ((hw->phy.type == e1000_phy_82578) ||
+ (hw->phy.type == e1000_phy_82577)) {
+ e1e_rphy(hw, HV_SCC_UPPER, &phy_data);
+- e1e_rphy(hw, HV_SCC_LOWER, &phy_data);
+- adapter->stats.scc += phy_data;
++ if (!e1e_rphy(hw, HV_SCC_LOWER, &phy_data))
++ adapter->stats.scc += phy_data;
+
+ e1e_rphy(hw, HV_ECOL_UPPER, &phy_data);
+- e1e_rphy(hw, HV_ECOL_LOWER, &phy_data);
+- adapter->stats.ecol += phy_data;
++ if (!e1e_rphy(hw, HV_ECOL_LOWER, &phy_data))
++ adapter->stats.ecol += phy_data;
+
+ e1e_rphy(hw, HV_MCC_UPPER, &phy_data);
+- e1e_rphy(hw, HV_MCC_LOWER, &phy_data);
+- adapter->stats.mcc += phy_data;
++ if (!e1e_rphy(hw, HV_MCC_LOWER, &phy_data))
++ adapter->stats.mcc += phy_data;
+
+ e1e_rphy(hw, HV_LATECOL_UPPER, &phy_data);
+- e1e_rphy(hw, HV_LATECOL_LOWER, &phy_data);
+- adapter->stats.latecol += phy_data;
++ if (!e1e_rphy(hw, HV_LATECOL_LOWER, &phy_data))
++ adapter->stats.latecol += phy_data;
+
+ e1e_rphy(hw, HV_DC_UPPER, &phy_data);
+- e1e_rphy(hw, HV_DC_LOWER, &phy_data);
+- adapter->stats.dc += phy_data;
++ if (!e1e_rphy(hw, HV_DC_LOWER, &phy_data))
++ adapter->stats.dc += phy_data;
+ } else {
+ adapter->stats.scc += er32(SCC);
+ adapter->stats.ecol += er32(ECOL);
+@@ -3372,8 +3372,8 @@ void e1000e_update_stats(struct e1000_adapter *adapter)
+ if ((hw->phy.type == e1000_phy_82578) ||
+ (hw->phy.type == e1000_phy_82577)) {
+ e1e_rphy(hw, HV_COLC_UPPER, &phy_data);
+- e1e_rphy(hw, HV_COLC_LOWER, &phy_data);
+- hw->mac.collision_delta = phy_data;
++ if (!e1e_rphy(hw, HV_COLC_LOWER, &phy_data))
++ hw->mac.collision_delta = phy_data;
+ } else {
+ hw->mac.collision_delta = er32(COLC);
+ }
+@@ -3384,8 +3384,8 @@ void e1000e_update_stats(struct e1000_adapter *adapter)
+ if ((hw->phy.type == e1000_phy_82578) ||
+ (hw->phy.type == e1000_phy_82577)) {
+ e1e_rphy(hw, HV_TNCRS_UPPER, &phy_data);
+- e1e_rphy(hw, HV_TNCRS_LOWER, &phy_data);
+- adapter->stats.tncrs += phy_data;
++ if (!e1e_rphy(hw, HV_TNCRS_LOWER, &phy_data))
++ adapter->stats.tncrs += phy_data;
+ } else {
+ if ((hw->mac.type != e1000_82574) &&
+ (hw->mac.type != e1000_82583))
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0048-e1000e-perform-10-100-adaptive-IFS-only-on-parts-tha.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0048-e1000e-perform-10-100-adaptive-IFS-only-on-parts-tha.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,124 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Thu, 7 Jan 2010 16:31:35 +0000
+Subject: [PATCH 048/166] e1000e: perform 10/100 adaptive IFS only on parts
+ that support it
+
+commit f464ba87fe7f346e270239354eb0d38f7a3b3e6b upstream.
+
+Adaptive IFS which involves writing to the Adaptive IFS Throttle register
+was being done for all devices supported by the driver even though it is
+not supported (i.e. the register doesn't even exist) on some devices. The
+feature is supported on 8257x/82583 and ICH/PCH based devices, but not
+on ESB2.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/82571.c | 2 ++
+ drivers/net/e1000e/es2lan.c | 2 ++
+ drivers/net/e1000e/hw.h | 1 +
+ drivers/net/e1000e/ich8lan.c | 2 ++
+ drivers/net/e1000e/lib.c | 14 ++++++++++++++
+ 5 files changed, 21 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+index b979464..02d67d0 100644
+--- a/drivers/net/e1000e/82571.c
++++ b/drivers/net/e1000e/82571.c
+@@ -237,6 +237,8 @@ static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter)
+ /* Set if manageability features are enabled. */
+ mac->arc_subsystem_valid = (er32(FWSM) & E1000_FWSM_MODE_MASK)
+ ? true : false;
++ /* Adaptive IFS supported */
++ mac->adaptive_ifs = true;
+
+ /* check for link */
+ switch (hw->phy.media_type) {
+diff --git a/drivers/net/e1000e/es2lan.c b/drivers/net/e1000e/es2lan.c
+index 3028f23..e2aa3b7 100644
+--- a/drivers/net/e1000e/es2lan.c
++++ b/drivers/net/e1000e/es2lan.c
+@@ -224,6 +224,8 @@ static s32 e1000_init_mac_params_80003es2lan(struct e1000_adapter *adapter)
+ /* Set if manageability features are enabled. */
+ mac->arc_subsystem_valid = (er32(FWSM) & E1000_FWSM_MODE_MASK)
+ ? true : false;
++ /* Adaptive IFS not supported */
++ mac->adaptive_ifs = false;
+
+ /* check for link */
+ switch (hw->phy.media_type) {
+diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h
+index f78c537..606c4da 100644
+--- a/drivers/net/e1000e/hw.h
++++ b/drivers/net/e1000e/hw.h
+@@ -818,6 +818,7 @@ struct e1000_mac_info {
+
+ u8 forced_speed_duplex;
+
++ bool adaptive_ifs;
+ bool arc_subsystem_valid;
+ bool autoneg;
+ bool autoneg_failed;
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index 642925e..1124f5a 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -465,6 +465,8 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_adapter *adapter)
+ mac->rar_entry_count--;
+ /* Set if manageability features are enabled. */
+ mac->arc_subsystem_valid = true;
++ /* Adaptive IFS supported */
++ mac->adaptive_ifs = true;
+
+ /* LED operations */
+ switch (mac->type) {
+diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c
+index a86c175..56b59e4 100644
+--- a/drivers/net/e1000e/lib.c
++++ b/drivers/net/e1000e/lib.c
+@@ -1609,6 +1609,11 @@ void e1000e_reset_adaptive(struct e1000_hw *hw)
+ {
+ struct e1000_mac_info *mac = &hw->mac;
+
++ if (!mac->adaptive_ifs) {
++ e_dbg("Not in Adaptive IFS mode!\n");
++ goto out;
++ }
++
+ mac->current_ifs_val = 0;
+ mac->ifs_min_val = IFS_MIN;
+ mac->ifs_max_val = IFS_MAX;
+@@ -1617,6 +1622,8 @@ void e1000e_reset_adaptive(struct e1000_hw *hw)
+
+ mac->in_ifs_mode = false;
+ ew32(AIT, 0);
++out:
++ return;
+ }
+
+ /**
+@@ -1630,6 +1637,11 @@ void e1000e_update_adaptive(struct e1000_hw *hw)
+ {
+ struct e1000_mac_info *mac = &hw->mac;
+
++ if (!mac->adaptive_ifs) {
++ e_dbg("Not in Adaptive IFS mode!\n");
++ goto out;
++ }
++
+ if ((mac->collision_delta * mac->ifs_ratio) > mac->tx_packet_delta) {
+ if (mac->tx_packet_delta > MIN_NUM_XMITS) {
+ mac->in_ifs_mode = true;
+@@ -1650,6 +1662,8 @@ void e1000e_update_adaptive(struct e1000_hw *hw)
+ ew32(AIT, 0);
+ }
+ }
++out:
++ return;
+ }
+
+ /**
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0049-e1000e-e1000e_enable_tx_pkt_filtering-returns-wrong-.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0049-e1000e-e1000e_enable_tx_pkt_filtering-returns-wrong-.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,74 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Thu, 7 Jan 2010 16:31:54 +0000
+Subject: [PATCH 049/166] e1000e: e1000e_enable_tx_pkt_filtering() returns
+ wrong value
+
+commit ca777f9c098f1ea1c9ec61318cc909d0c8f465e1 upstream.
+
+e1000e_enable_tx_pkt_filtering() will return a non-zero value if the
+driver fails to enable the manageability interface on the host for
+any reason; instead it should retun zero to indicate filtering has been
+disabled. Also provide a single exit point for the function.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/lib.c | 16 +++++++++-------
+ 1 files changed, 9 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c
+index 56b59e4..97649bf 100644
+--- a/drivers/net/e1000e/lib.c
++++ b/drivers/net/e1000e/lib.c
+@@ -2301,10 +2301,12 @@ bool e1000e_enable_tx_pkt_filtering(struct e1000_hw *hw)
+ s32 ret_val, hdr_csum, csum;
+ u8 i, len;
+
++ hw->mac.tx_pkt_filtering = true;
++
+ /* No manageability, no filtering */
+ if (!e1000e_check_mng_mode(hw)) {
+ hw->mac.tx_pkt_filtering = false;
+- return 0;
++ goto out;
+ }
+
+ /*
+@@ -2312,9 +2314,9 @@ bool e1000e_enable_tx_pkt_filtering(struct e1000_hw *hw)
+ * reason, disable filtering.
+ */
+ ret_val = e1000_mng_enable_host_if(hw);
+- if (ret_val != 0) {
++ if (ret_val) {
+ hw->mac.tx_pkt_filtering = false;
+- return ret_val;
++ goto out;
+ }
+
+ /* Read in the header. Length and offset are in dwords. */
+@@ -2333,17 +2335,17 @@ bool e1000e_enable_tx_pkt_filtering(struct e1000_hw *hw)
+ */
+ if ((hdr_csum != csum) || (hdr->signature != E1000_IAMT_SIGNATURE)) {
+ hw->mac.tx_pkt_filtering = true;
+- return 1;
++ goto out;
+ }
+
+ /* Cookie area is valid, make the final check for filtering. */
+ if (!(hdr->status & E1000_MNG_DHCP_COOKIE_STATUS_PARSING)) {
+ hw->mac.tx_pkt_filtering = false;
+- return 0;
++ goto out;
+ }
+
+- hw->mac.tx_pkt_filtering = true;
+- return 1;
++out:
++ return hw->mac.tx_pkt_filtering;
+ }
+
+ /**
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0050-e1000e-fix-and-commonize-code-for-setting-the-receiv.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0050-e1000e-fix-and-commonize-code-for-setting-the-receiv.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,74 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Thu, 7 Jan 2010 16:32:13 +0000
+Subject: [PATCH 050/166] e1000e: fix and commonize code for setting the
+ receive address registers
+
+commit b7a9216c5a3205a6d721972bfd012c4eb5950e9c upstream.
+
+Fix e1000e_rar_set() to flush consecutive register writes to avoid write
+combining which some parts cannot handle. Update e1000e_init_rx_addrs()
+to call the fixed e1000e_rar_set() instead of duplicating code.
+
+Also change e1000e_rar_set() to _not_ set the Address Valid bit if the MAC
+address is all zeros.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/lib.c | 24 +++++++++++++++---------
+ 1 files changed, 15 insertions(+), 9 deletions(-)
+
+diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c
+index 97649bf..2fa9b36 100644
+--- a/drivers/net/e1000e/lib.c
++++ b/drivers/net/e1000e/lib.c
+@@ -125,6 +125,7 @@ void e1000_write_vfta_generic(struct e1000_hw *hw, u32 offset, u32 value)
+ void e1000e_init_rx_addrs(struct e1000_hw *hw, u16 rar_count)
+ {
+ u32 i;
++ u8 mac_addr[ETH_ALEN] = {0};
+
+ /* Setup the receive address */
+ e_dbg("Programming MAC Address into RAR[0]\n");
+@@ -133,12 +134,8 @@ void e1000e_init_rx_addrs(struct e1000_hw *hw, u16 rar_count)
+
+ /* Zero out the other (rar_entry_count - 1) receive addresses */
+ e_dbg("Clearing RAR[1-%u]\n", rar_count-1);
+- for (i = 1; i < rar_count; i++) {
+- E1000_WRITE_REG_ARRAY(hw, E1000_RA, (i << 1), 0);
+- e1e_flush();
+- E1000_WRITE_REG_ARRAY(hw, E1000_RA, ((i << 1) + 1), 0);
+- e1e_flush();
+- }
++ for (i = 1; i < rar_count; i++)
++ e1000e_rar_set(hw, mac_addr, i);
+ }
+
+ /**
+@@ -164,10 +161,19 @@ void e1000e_rar_set(struct e1000_hw *hw, u8 *addr, u32 index)
+
+ rar_high = ((u32) addr[4] | ((u32) addr[5] << 8));
+
+- rar_high |= E1000_RAH_AV;
++ /* If MAC address zero, no need to set the AV bit */
++ if (rar_low || rar_high)
++ rar_high |= E1000_RAH_AV;
+
+- E1000_WRITE_REG_ARRAY(hw, E1000_RA, (index << 1), rar_low);
+- E1000_WRITE_REG_ARRAY(hw, E1000_RA, ((index << 1) + 1), rar_high);
++ /*
++ * Some bridges will combine consecutive 32-bit writes into
++ * a single burst write, which will malfunction on some parts.
++ * The flushes avoid this.
++ */
++ ew32(RAL(index), rar_low);
++ e1e_flush();
++ ew32(RAH(index), rar_high);
++ e1e_flush();
+ }
+
+ /**
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0051-e1000e-MDIO-slow-mode-should-always-be-done-for-8257.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0051-e1000e-MDIO-slow-mode-should-always-be-done-for-8257.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,311 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Wed, 13 Jan 2010 01:52:49 +0000
+Subject: [PATCH 051/166] e1000e: MDIO slow mode should always be done for
+ 82577
+
+commit fddaa1aff881c98f524221236af98ce70dcd04cf upstream.
+
+A previous 82577 workaround that set the MDIO access speed to slow mode for
+every PHY register read/write when the cable is unplugged should instead
+set the access mode to always be slow before any PHY register access.
+Since the mode bit gets cleared when the PHY is reset, set the mode after
+every PHY reset.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Adjust to apply on top of cherry-picked fixes in 2.6.32.y]
+---
+ drivers/net/e1000e/e1000.h | 1 -
+ drivers/net/e1000e/ich8lan.c | 58 ++++++++++++++++++++++++++--
+ drivers/net/e1000e/phy.c | 85 ------------------------------------------
+ 3 files changed, 53 insertions(+), 91 deletions(-)
+
+diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
+index 79a9603..d236efa 100644
+--- a/drivers/net/e1000e/e1000.h
++++ b/drivers/net/e1000e/e1000.h
+@@ -583,7 +583,6 @@ extern s32 e1000_read_phy_reg_hv_locked(struct e1000_hw *hw, u32 offset,
+ extern s32 e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data);
+ extern s32 e1000_write_phy_reg_hv_locked(struct e1000_hw *hw, u32 offset,
+ u16 data);
+-extern s32 e1000_set_mdio_slow_mode_hv(struct e1000_hw *hw, bool slow);
+ extern s32 e1000_link_stall_workaround_hv(struct e1000_hw *hw);
+ extern s32 e1000_copper_link_setup_82577(struct e1000_hw *hw);
+ extern s32 e1000_check_polarity_82577(struct e1000_hw *hw);
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index 1124f5a..db67d35 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -138,6 +138,10 @@
+ #define E1000_NVM_K1_CONFIG 0x1B /* NVM K1 Config Word */
+ #define E1000_NVM_K1_ENABLE 0x1 /* NVM Enable K1 bit */
+
++/* KMRN Mode Control */
++#define HV_KMRN_MODE_CTRL PHY_REG(769, 16)
++#define HV_KMRN_MDIO_SLOW 0x0400
++
+ /* ICH GbE Flash Hardware Sequencing Flash Status Register bit breakdown */
+ /* Offset 04h HSFSTS */
+ union ich8_hws_flash_status {
+@@ -219,6 +223,7 @@ static s32 e1000_set_lplu_state_pchlan(struct e1000_hw *hw, bool active);
+ static void e1000_power_down_phy_copper_ich8lan(struct e1000_hw *hw);
+ static void e1000_lan_init_done_ich8lan(struct e1000_hw *hw);
+ static s32 e1000_k1_gig_workaround_hv(struct e1000_hw *hw, bool link);
++static s32 e1000_set_mdio_slow_mode_hv(struct e1000_hw *hw);
+
+ static inline u16 __er16flash(struct e1000_hw *hw, unsigned long reg)
+ {
+@@ -280,7 +285,21 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw)
+ goto out;
+
+ phy->id = e1000_phy_unknown;
+- e1000e_get_phy_id(hw);
++ ret_val = e1000e_get_phy_id(hw);
++ if (ret_val)
++ goto out;
++ if ((phy->id == 0) || (phy->id == PHY_REVISION_MASK)) {
++ /*
++ * In case the PHY needs to be in mdio slow mode (eg. 82577),
++ * set slow mode and try to get the PHY id again.
++ */
++ ret_val = e1000_set_mdio_slow_mode_hv(hw);
++ if (ret_val)
++ goto out;
++ ret_val = e1000e_get_phy_id(hw);
++ if (ret_val)
++ goto out;
++ }
+ phy->type = e1000e_get_phy_type_from_id(phy->id);
+
+ switch (phy->type) {
+@@ -302,7 +321,7 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw)
+ break;
+ }
+
+- out:
++out:
+ return ret_val;
+ }
+
+@@ -1087,6 +1106,26 @@ out:
+
+
+ /**
++ * e1000_set_mdio_slow_mode_hv - Set slow MDIO access mode
++ * @hw: pointer to the HW structure
++ **/
++static s32 e1000_set_mdio_slow_mode_hv(struct e1000_hw *hw)
++{
++ s32 ret_val;
++ u16 data;
++
++ ret_val = e1e_rphy(hw, HV_KMRN_MODE_CTRL, &data);
++ if (ret_val)
++ return ret_val;
++
++ data |= HV_KMRN_MDIO_SLOW;
++
++ ret_val = e1e_wphy(hw, HV_KMRN_MODE_CTRL, data);
++
++ return ret_val;
++}
++
++/**
+ * e1000_hv_phy_workarounds_ich8lan - A series of Phy workarounds to be
+ * done after every PHY reset.
+ **/
+@@ -1097,6 +1136,13 @@ static s32 e1000_hv_phy_workarounds_ich8lan(struct e1000_hw *hw)
+ if (hw->mac.type != e1000_pchlan)
+ return ret_val;
+
++ /* Set MDIO slow mode before any other MDIO access */
++ if (hw->phy.type == e1000_phy_82577) {
++ ret_val = e1000_set_mdio_slow_mode_hv(hw);
++ if (ret_val)
++ goto out;
++ }
++
+ if (((hw->phy.type == e1000_phy_82577) &&
+ ((hw->phy.revision == 1) || (hw->phy.revision == 2))) ||
+ ((hw->phy.type == e1000_phy_82578) && (hw->phy.revision == 1))) {
+@@ -1195,6 +1241,7 @@ static s32 e1000_phy_hw_reset_ich8lan(struct e1000_hw *hw)
+ /* Allow time for h/w to get to a quiescent state after reset */
+ mdelay(10);
+
++ /* Perform any necessary post-reset workarounds */
+ if (hw->mac.type == e1000_pchlan) {
+ ret_val = e1000_hv_phy_workarounds_ich8lan(hw);
+ if (ret_val)
+@@ -2495,6 +2542,10 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
+ if (!ret_val)
+ e1000_release_swflag_ich8lan(hw);
+
++ /* Perform any necessary post-reset workarounds */
++ if (hw->mac.type == e1000_pchlan)
++ ret_val = e1000_hv_phy_workarounds_ich8lan(hw);
++
+ if (ctrl & E1000_CTRL_PHY_RST)
+ ret_val = hw->phy.ops.get_cfg_done(hw);
+
+@@ -2539,9 +2590,6 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
+ kab |= E1000_KABGTXD_BGSQLBIAS;
+ ew32(KABGTXD, kab);
+
+- if (hw->mac.type == e1000_pchlan)
+- ret_val = e1000_hv_phy_workarounds_ich8lan(hw);
+-
+ out:
+ return ret_val;
+ }
+diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c
+index 55a2c0a..7f3ceb9 100644
+--- a/drivers/net/e1000e/phy.c
++++ b/drivers/net/e1000e/phy.c
+@@ -152,32 +152,9 @@ s32 e1000e_get_phy_id(struct e1000_hw *hw)
+ if (phy->id != 0 && phy->id != PHY_REVISION_MASK)
+ goto out;
+
+- /*
+- * If the PHY ID is still unknown, we may have an 82577
+- * without link. We will try again after setting Slow MDIC
+- * mode. No harm in trying again in this case since the PHY
+- * ID is unknown at this point anyway.
+- */
+- ret_val = phy->ops.acquire(hw);
+- if (ret_val)
+- goto out;
+- ret_val = e1000_set_mdio_slow_mode_hv(hw, true);
+- if (ret_val)
+- goto out;
+- phy->ops.release(hw);
+-
+ retry_count++;
+ }
+ out:
+- /* Revert to MDIO fast mode, if applicable */
+- if (retry_count) {
+- ret_val = phy->ops.acquire(hw);
+- if (ret_val)
+- return ret_val;
+- ret_val = e1000_set_mdio_slow_mode_hv(hw, false);
+- phy->ops.release(hw);
+- }
+-
+ return ret_val;
+ }
+
+@@ -2791,38 +2768,6 @@ static s32 e1000_set_d0_lplu_state(struct e1000_hw *hw, bool active)
+ }
+
+ /**
+- * e1000_set_mdio_slow_mode_hv - Set slow MDIO access mode
+- * @hw: pointer to the HW structure
+- * @slow: true for slow mode, false for normal mode
+- *
+- * Assumes semaphore already acquired.
+- **/
+-s32 e1000_set_mdio_slow_mode_hv(struct e1000_hw *hw, bool slow)
+-{
+- s32 ret_val = 0;
+- u16 data = 0;
+-
+- /* Set MDIO mode - page 769, register 16: 0x2580==slow, 0x2180==fast */
+- hw->phy.addr = 1;
+- ret_val = e1000e_write_phy_reg_mdic(hw, IGP01E1000_PHY_PAGE_SELECT,
+- (BM_PORT_CTRL_PAGE << IGP_PAGE_SHIFT));
+- if (ret_val)
+- goto out;
+-
+- ret_val = e1000e_write_phy_reg_mdic(hw, BM_CS_CTRL1,
+- (0x2180 | (slow << 10)));
+- if (ret_val)
+- goto out;
+-
+- /* dummy read when reverting to fast mode - throw away result */
+- if (!slow)
+- ret_val = e1000e_read_phy_reg_mdic(hw, BM_CS_CTRL1, &data);
+-
+-out:
+- return ret_val;
+-}
+-
+-/**
+ * __e1000_read_phy_reg_hv - Read HV PHY register
+ * @hw: pointer to the HW structure
+ * @offset: register offset to be read
+@@ -2839,7 +2784,6 @@ static s32 __e1000_read_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 *data,
+ s32 ret_val;
+ u16 page = BM_PHY_REG_PAGE(offset);
+ u16 reg = BM_PHY_REG_NUM(offset);
+- bool in_slow_mode = false;
+
+ if (!locked) {
+ ret_val = hw->phy.ops.acquire(hw);
+@@ -2847,16 +2791,6 @@ static s32 __e1000_read_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 *data,
+ return ret_val;
+ }
+
+- /* Workaround failure in MDIO access while cable is disconnected */
+- if ((hw->phy.type == e1000_phy_82577) &&
+- !(er32(STATUS) & E1000_STATUS_LU)) {
+- ret_val = e1000_set_mdio_slow_mode_hv(hw, true);
+- if (ret_val)
+- goto out;
+-
+- in_slow_mode = true;
+- }
+-
+ /* Page 800 works differently than the rest so it has its own func */
+ if (page == BM_WUC_PAGE) {
+ ret_val = e1000_access_phy_wakeup_reg_bm(hw, offset,
+@@ -2893,10 +2827,6 @@ static s32 __e1000_read_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 *data,
+ ret_val = e1000e_read_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & reg,
+ data);
+ out:
+- /* Revert to MDIO fast mode, if applicable */
+- if ((hw->phy.type == e1000_phy_82577) && in_slow_mode)
+- ret_val |= e1000_set_mdio_slow_mode_hv(hw, false);
+-
+ if (!locked)
+ hw->phy.ops.release(hw);
+
+@@ -2948,7 +2878,6 @@ static s32 __e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data,
+ s32 ret_val;
+ u16 page = BM_PHY_REG_PAGE(offset);
+ u16 reg = BM_PHY_REG_NUM(offset);
+- bool in_slow_mode = false;
+
+ if (!locked) {
+ ret_val = hw->phy.ops.acquire(hw);
+@@ -2956,16 +2885,6 @@ static s32 __e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data,
+ return ret_val;
+ }
+
+- /* Workaround failure in MDIO access while cable is disconnected */
+- if ((hw->phy.type == e1000_phy_82577) &&
+- !(er32(STATUS) & E1000_STATUS_LU)) {
+- ret_val = e1000_set_mdio_slow_mode_hv(hw, true);
+- if (ret_val)
+- goto out;
+-
+- in_slow_mode = true;
+- }
+-
+ /* Page 800 works differently than the rest so it has its own func */
+ if (page == BM_WUC_PAGE) {
+ ret_val = e1000_access_phy_wakeup_reg_bm(hw, offset,
+@@ -3019,10 +2938,6 @@ static s32 __e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data,
+ data);
+
+ out:
+- /* Revert to MDIO fast mode, if applicable */
+- if ((hw->phy.type == e1000_phy_82577) && in_slow_mode)
+- ret_val |= e1000_set_mdio_slow_mode_hv(hw, false);
+-
+ if (!locked)
+ hw->phy.ops.release(hw);
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0052-e1000e-workaround-link-issues-on-busy-hub-in-half-du.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0052-e1000e-workaround-link-issues-on-busy-hub-in-half-du.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,67 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Wed, 13 Jan 2010 01:53:08 +0000
+Subject: [PATCH 052/166] e1000e: workaround link issues on busy hub in half
+ duplex on 82577/82578
+
+commit baf86c9d36826fab0160251bbc87dfab3af48a21 upstream.
+
+This patch removes a delay in hardware after every received packet allowing
+more time for transmitted packets to go out in between received packets in
+half duplex.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/ich8lan.c | 19 ++++++++++++++++++-
+ 1 files changed, 18 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index db67d35..324c323 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -1132,6 +1132,7 @@ static s32 e1000_set_mdio_slow_mode_hv(struct e1000_hw *hw)
+ static s32 e1000_hv_phy_workarounds_ich8lan(struct e1000_hw *hw)
+ {
+ s32 ret_val = 0;
++ u16 phy_data;
+
+ if (hw->mac.type != e1000_pchlan)
+ return ret_val;
+@@ -1175,16 +1176,32 @@ static s32 e1000_hv_phy_workarounds_ich8lan(struct e1000_hw *hw)
+
+ hw->phy.addr = 1;
+ ret_val = e1000e_write_phy_reg_mdic(hw, IGP01E1000_PHY_PAGE_SELECT, 0);
++ hw->phy.ops.release(hw);
+ if (ret_val)
+ goto out;
+- hw->phy.ops.release(hw);
+
+ /*
+ * Configure the K1 Si workaround during phy reset assuming there is
+ * link so that it disables K1 if link is in 1Gbps.
+ */
+ ret_val = e1000_k1_gig_workaround_hv(hw, true);
++ if (ret_val)
++ goto out;
+
++ /* Workaround for link disconnects on a busy hub in half duplex */
++ ret_val = hw->phy.ops.acquire(hw);
++ if (ret_val)
++ goto out;
++ ret_val = hw->phy.ops.read_reg_locked(hw,
++ PHY_REG(BM_PORT_CTRL_PAGE, 17),
++ &phy_data);
++ if (ret_val)
++ goto release;
++ ret_val = hw->phy.ops.write_reg_locked(hw,
++ PHY_REG(BM_PORT_CTRL_PAGE, 17),
++ phy_data & 0x00FF);
++release:
++ hw->phy.ops.release(hw);
+ out:
+ return ret_val;
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0053-e1000e-use-alternate-MAC-address-on-ESB2-if-availabl.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0053-e1000e-use-alternate-MAC-address-on-ESB2-if-availabl.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,376 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Wed, 13 Jan 2010 02:04:58 +0000
+Subject: [PATCH 053/166] e1000e: use alternate MAC address on ESB2 if
+ available
+
+commit 608f8a0d014db6cd18d4f535934d4b5d556e3013 upstream.
+
+Similar to 82571/2/3 parts that already do this, if ESB2/80003es2lan parts
+have an alternate MAC address provided in the EEPROM use it instead of the
+default MAC address. This patch makes the the actual code that does this
+generic so that it can be better used by both MAC families.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/82571.c | 33 ++++++++++-
+ drivers/net/e1000e/defines.h | 2 +
+ drivers/net/e1000e/e1000.h | 11 ++++-
+ drivers/net/e1000e/es2lan.c | 28 +++++++++-
+ drivers/net/e1000e/hw.h | 5 ++-
+ drivers/net/e1000e/lib.c | 124 +++++++++++++++++++++++++-----------------
+ drivers/net/e1000e/netdev.c | 2 +-
+ 7 files changed, 147 insertions(+), 58 deletions(-)
+
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+index 02d67d0..d1a4514 100644
+--- a/drivers/net/e1000e/82571.c
++++ b/drivers/net/e1000e/82571.c
+@@ -922,9 +922,12 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
+ ew32(IMC, 0xffffffff);
+ icr = er32(ICR);
+
+- if (hw->mac.type == e1000_82571 &&
+- hw->dev_spec.e82571.alt_mac_addr_is_present)
+- e1000e_set_laa_state_82571(hw, true);
++ /* Install any alternate MAC address into RAR0 */
++ ret_val = e1000_check_alt_mac_addr_generic(hw);
++ if (ret_val)
++ return ret_val;
++
++ e1000e_set_laa_state_82571(hw, true);
+
+ /* Reinitialize the 82571 serdes link state machine */
+ if (hw->phy.media_type == e1000_media_type_internal_serdes)
+@@ -1621,6 +1624,29 @@ static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw)
+ }
+
+ /**
++ * e1000_read_mac_addr_82571 - Read device MAC address
++ * @hw: pointer to the HW structure
++ **/
++static s32 e1000_read_mac_addr_82571(struct e1000_hw *hw)
++{
++ s32 ret_val = 0;
++
++ /*
++ * If there's an alternate MAC address place it in RAR0
++ * so that it will override the Si installed default perm
++ * address.
++ */
++ ret_val = e1000_check_alt_mac_addr_generic(hw);
++ if (ret_val)
++ goto out;
++
++ ret_val = e1000_read_mac_addr_generic(hw);
++
++out:
++ return ret_val;
++}
++
++/**
+ * e1000_power_down_phy_copper_82571 - Remove link during PHY power down
+ * @hw: pointer to the HW structure
+ *
+@@ -1706,6 +1732,7 @@ static struct e1000_mac_operations e82571_mac_ops = {
+ .setup_link = e1000_setup_link_82571,
+ /* .setup_physical_interface: media type dependent */
+ .setup_led = e1000e_setup_led_generic,
++ .read_mac_addr = e1000_read_mac_addr_82571,
+ };
+
+ static struct e1000_phy_operations e82_phy_ops_igp = {
+diff --git a/drivers/net/e1000e/defines.h b/drivers/net/e1000e/defines.h
+index e02e382..db05ec3 100644
+--- a/drivers/net/e1000e/defines.h
++++ b/drivers/net/e1000e/defines.h
+@@ -460,6 +460,8 @@
+ */
+ #define E1000_RAR_ENTRIES 15
+ #define E1000_RAH_AV 0x80000000 /* Receive descriptor valid */
++#define E1000_RAL_MAC_ADDR_LEN 4
++#define E1000_RAH_MAC_ADDR_LEN 2
+
+ /* Error Codes */
+ #define E1000_ERR_NVM 1
+diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
+index d236efa..0e44719 100644
+--- a/drivers/net/e1000e/e1000.h
++++ b/drivers/net/e1000e/e1000.h
+@@ -530,6 +530,7 @@ extern s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw);
+ extern s32 e1000e_force_mac_fc(struct e1000_hw *hw);
+ extern s32 e1000e_blink_led(struct e1000_hw *hw);
+ extern void e1000_write_vfta_generic(struct e1000_hw *hw, u32 offset, u32 value);
++extern s32 e1000_check_alt_mac_addr_generic(struct e1000_hw *hw);
+ extern void e1000e_reset_adaptive(struct e1000_hw *hw);
+ extern void e1000e_update_adaptive(struct e1000_hw *hw);
+
+@@ -629,7 +630,15 @@ extern s32 e1000e_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16
+ extern s32 e1000e_validate_nvm_checksum_generic(struct e1000_hw *hw);
+ extern void e1000e_release_nvm(struct e1000_hw *hw);
+ extern void e1000e_reload_nvm(struct e1000_hw *hw);
+-extern s32 e1000e_read_mac_addr(struct e1000_hw *hw);
++extern s32 e1000_read_mac_addr_generic(struct e1000_hw *hw);
++
++static inline s32 e1000e_read_mac_addr(struct e1000_hw *hw)
++{
++ if (hw->mac.ops.read_mac_addr)
++ return hw->mac.ops.read_mac_addr(hw);
++
++ return e1000_read_mac_addr_generic(hw);
++}
+
+ static inline s32 e1000_validate_nvm_checksum(struct e1000_hw *hw)
+ {
+diff --git a/drivers/net/e1000e/es2lan.c b/drivers/net/e1000e/es2lan.c
+index e2aa3b7..4bb9d88 100644
+--- a/drivers/net/e1000e/es2lan.c
++++ b/drivers/net/e1000e/es2lan.c
+@@ -814,7 +814,9 @@ static s32 e1000_reset_hw_80003es2lan(struct e1000_hw *hw)
+ ew32(IMC, 0xffffffff);
+ icr = er32(ICR);
+
+- return 0;
++ ret_val = e1000_check_alt_mac_addr_generic(hw);
++
++ return ret_val;
+ }
+
+ /**
+@@ -1340,6 +1342,29 @@ static s32 e1000_write_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
+ }
+
+ /**
++ * e1000_read_mac_addr_80003es2lan - Read device MAC address
++ * @hw: pointer to the HW structure
++ **/
++static s32 e1000_read_mac_addr_80003es2lan(struct e1000_hw *hw)
++{
++ s32 ret_val = 0;
++
++ /*
++ * If there's an alternate MAC address place it in RAR0
++ * so that it will override the Si installed default perm
++ * address.
++ */
++ ret_val = e1000_check_alt_mac_addr_generic(hw);
++ if (ret_val)
++ goto out;
++
++ ret_val = e1000_read_mac_addr_generic(hw);
++
++out:
++ return ret_val;
++}
++
++/**
+ * e1000_power_down_phy_copper_80003es2lan - Remove link during PHY power down
+ * @hw: pointer to the HW structure
+ *
+@@ -1403,6 +1428,7 @@ static void e1000_clear_hw_cntrs_80003es2lan(struct e1000_hw *hw)
+ }
+
+ static struct e1000_mac_operations es2_mac_ops = {
++ .read_mac_addr = e1000_read_mac_addr_80003es2lan,
+ .id_led_init = e1000e_id_led_init,
+ .check_mng_mode = e1000e_check_mng_mode_generic,
+ /* check_for_link dependent on media type */
+diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h
+index 606c4da..38c1cec 100644
+--- a/drivers/net/e1000e/hw.h
++++ b/drivers/net/e1000e/hw.h
+@@ -389,6 +389,9 @@ enum e1e_registers {
+
+ #define E1000_FUNC_1 1
+
++#define E1000_ALT_MAC_ADDRESS_OFFSET_LAN0 0
++#define E1000_ALT_MAC_ADDRESS_OFFSET_LAN1 3
++
+ enum e1000_mac_type {
+ e1000_82571,
+ e1000_82572,
+@@ -756,6 +759,7 @@ struct e1000_mac_operations {
+ s32 (*setup_physical_interface)(struct e1000_hw *);
+ s32 (*setup_led)(struct e1000_hw *);
+ void (*write_vfta)(struct e1000_hw *, u32, u32);
++ s32 (*read_mac_addr)(struct e1000_hw *);
+ };
+
+ /* Function pointers for the PHY. */
+@@ -897,7 +901,6 @@ struct e1000_fc_info {
+
+ struct e1000_dev_spec_82571 {
+ bool laa_is_present;
+- bool alt_mac_addr_is_present;
+ u32 smb_counter;
+ };
+
+diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c
+index 2fa9b36..5475424 100644
+--- a/drivers/net/e1000e/lib.c
++++ b/drivers/net/e1000e/lib.c
+@@ -139,6 +139,68 @@ void e1000e_init_rx_addrs(struct e1000_hw *hw, u16 rar_count)
+ }
+
+ /**
++ * e1000_check_alt_mac_addr_generic - Check for alternate MAC addr
++ * @hw: pointer to the HW structure
++ *
++ * Checks the nvm for an alternate MAC address. An alternate MAC address
++ * can be setup by pre-boot software and must be treated like a permanent
++ * address and must override the actual permanent MAC address. If an
++ * alternate MAC address is found it is programmed into RAR0, replacing
++ * the permanent address that was installed into RAR0 by the Si on reset.
++ * This function will return SUCCESS unless it encounters an error while
++ * reading the EEPROM.
++ **/
++s32 e1000_check_alt_mac_addr_generic(struct e1000_hw *hw)
++{
++ u32 i;
++ s32 ret_val = 0;
++ u16 offset, nvm_alt_mac_addr_offset, nvm_data;
++ u8 alt_mac_addr[ETH_ALEN];
++
++ ret_val = e1000_read_nvm(hw, NVM_ALT_MAC_ADDR_PTR, 1,
++ &nvm_alt_mac_addr_offset);
++ if (ret_val) {
++ e_dbg("NVM Read Error\n");
++ goto out;
++ }
++
++ if (nvm_alt_mac_addr_offset == 0xFFFF) {
++ /* There is no Alternate MAC Address */
++ goto out;
++ }
++
++ if (hw->bus.func == E1000_FUNC_1)
++ nvm_alt_mac_addr_offset += E1000_ALT_MAC_ADDRESS_OFFSET_LAN1;
++ for (i = 0; i < ETH_ALEN; i += 2) {
++ offset = nvm_alt_mac_addr_offset + (i >> 1);
++ ret_val = e1000_read_nvm(hw, offset, 1, &nvm_data);
++ if (ret_val) {
++ e_dbg("NVM Read Error\n");
++ goto out;
++ }
++
++ alt_mac_addr[i] = (u8)(nvm_data & 0xFF);
++ alt_mac_addr[i + 1] = (u8)(nvm_data >> 8);
++ }
++
++ /* if multicast bit is set, the alternate address will not be used */
++ if (alt_mac_addr[0] & 0x01) {
++ e_dbg("Ignoring Alternate Mac Address with MC bit set\n");
++ goto out;
++ }
++
++ /*
++ * We have a valid alternate MAC address, and we want to treat it the
++ * same as the normal permanent MAC address stored by the HW into the
++ * RAR. Do this by mapping this address into RAR0.
++ */
++ e1000e_rar_set(hw, alt_mac_addr, 0);
++
++out:
++ return ret_val;
++}
++
++/**
+ * e1000e_rar_set - Set receive address register
+ * @hw: pointer to the HW structure
+ * @addr: pointer to the receive address
+@@ -2072,67 +2134,27 @@ s32 e1000e_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
+ }
+
+ /**
+- * e1000e_read_mac_addr - Read device MAC address
++ * e1000_read_mac_addr_generic - Read device MAC address
+ * @hw: pointer to the HW structure
+ *
+ * Reads the device MAC address from the EEPROM and stores the value.
+ * Since devices with two ports use the same EEPROM, we increment the
+ * last bit in the MAC address for the second port.
+ **/
+-s32 e1000e_read_mac_addr(struct e1000_hw *hw)
++s32 e1000_read_mac_addr_generic(struct e1000_hw *hw)
+ {
+- s32 ret_val;
+- u16 offset, nvm_data, i;
+- u16 mac_addr_offset = 0;
+-
+- if (hw->mac.type == e1000_82571) {
+- /* Check for an alternate MAC address. An alternate MAC
+- * address can be setup by pre-boot software and must be
+- * treated like a permanent address and must override the
+- * actual permanent MAC address.*/
+- ret_val = e1000_read_nvm(hw, NVM_ALT_MAC_ADDR_PTR, 1,
+- &mac_addr_offset);
+- if (ret_val) {
+- e_dbg("NVM Read Error\n");
+- return ret_val;
+- }
+- if (mac_addr_offset == 0xFFFF)
+- mac_addr_offset = 0;
+-
+- if (mac_addr_offset) {
+- if (hw->bus.func == E1000_FUNC_1)
+- mac_addr_offset += ETH_ALEN/sizeof(u16);
+-
+- /* make sure we have a valid mac address here
+- * before using it */
+- ret_val = e1000_read_nvm(hw, mac_addr_offset, 1,
+- &nvm_data);
+- if (ret_val) {
+- e_dbg("NVM Read Error\n");
+- return ret_val;
+- }
+- if (nvm_data & 0x0001)
+- mac_addr_offset = 0;
+- }
++ u32 rar_high;
++ u32 rar_low;
++ u16 i;
+
+- if (mac_addr_offset)
+- hw->dev_spec.e82571.alt_mac_addr_is_present = 1;
+- }
++ rar_high = er32(RAH(0));
++ rar_low = er32(RAL(0));
+
+- for (i = 0; i < ETH_ALEN; i += 2) {
+- offset = mac_addr_offset + (i >> 1);
+- ret_val = e1000_read_nvm(hw, offset, 1, &nvm_data);
+- if (ret_val) {
+- e_dbg("NVM Read Error\n");
+- return ret_val;
+- }
+- hw->mac.perm_addr[i] = (u8)(nvm_data & 0xFF);
+- hw->mac.perm_addr[i+1] = (u8)(nvm_data >> 8);
+- }
++ for (i = 0; i < E1000_RAL_MAC_ADDR_LEN; i++)
++ hw->mac.perm_addr[i] = (u8)(rar_low >> (i*8));
+
+- /* Flip last bit of mac address if we're on second port */
+- if (!mac_addr_offset && hw->bus.func == E1000_FUNC_1)
+- hw->mac.perm_addr[5] ^= 1;
++ for (i = 0; i < E1000_RAH_MAC_ADDR_LEN; i++)
++ hw->mac.perm_addr[i+4] = (u8)(rar_high >> (i*8));
+
+ for (i = 0; i < ETH_ALEN; i++)
+ hw->mac.addr[i] = hw->mac.perm_addr[i];
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 28f1333..a8b4cc7 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -5141,7 +5141,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
+
+ e1000_eeprom_checks(adapter);
+
+- /* copy the MAC address out of the NVM */
++ /* copy the MAC address */
+ if (e1000e_read_mac_addr(&adapter->hw))
+ e_err("NVM Read Error while reading MAC address\n");
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0054-e1000e-provide-MAC-family-specific-function-to-set-L.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0054-e1000e-provide-MAC-family-specific-function-to-set-L.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,186 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Wed, 13 Jan 2010 02:05:18 +0000
+Subject: [PATCH 054/166] e1000e: provide MAC-family-specific function to set
+ LAN ID
+
+commit f4d2dd4cd4d001f5dc20fc76c780c0c20c000c23 upstream.
+
+Provide MAC-specific function pointer to determine the LAN ID (PCI func).
+The LAN ID is used internally by the driver to determine which h/w lock
+to use to protect accessing the PHY on ESB2 as well as help to determine
+the alternate MAC address on some parts.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/82571.c | 7 ++++++
+ drivers/net/e1000e/e1000.h | 2 +
+ drivers/net/e1000e/es2lan.c | 4 +++
+ drivers/net/e1000e/hw.h | 1 +
+ drivers/net/e1000e/ich8lan.c | 1 +
+ drivers/net/e1000e/lib.c | 48 ++++++++++++++++++++++++++++++++---------
+ 6 files changed, 52 insertions(+), 11 deletions(-)
+
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+index d1a4514..7674a91 100644
+--- a/drivers/net/e1000e/82571.c
++++ b/drivers/net/e1000e/82571.c
+@@ -267,8 +267,14 @@ static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter)
+ }
+
+ switch (hw->mac.type) {
++ case e1000_82573:
++ func->set_lan_id = e1000_set_lan_id_single_port;
++ func->check_mng_mode = e1000e_check_mng_mode_generic;
++ func->led_on = e1000e_led_on_generic;
++ break;
+ case e1000_82574:
+ case e1000_82583:
++ func->set_lan_id = e1000_set_lan_id_single_port;
+ func->check_mng_mode = e1000_check_mng_mode_82574;
+ func->led_on = e1000_led_on_82574;
+ break;
+@@ -1721,6 +1727,7 @@ static struct e1000_mac_operations e82571_mac_ops = {
+ .cleanup_led = e1000e_cleanup_led_generic,
+ .clear_hw_cntrs = e1000_clear_hw_cntrs_82571,
+ .get_bus_info = e1000e_get_bus_info_pcie,
++ .set_lan_id = e1000_set_lan_id_multi_port_pcie,
+ /* .get_link_up_info: media type dependent */
+ /* .led_on: mac type dependent */
+ .led_off = e1000e_led_off_generic,
+diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
+index 0e44719..b6eba39 100644
+--- a/drivers/net/e1000e/e1000.h
++++ b/drivers/net/e1000e/e1000.h
+@@ -503,6 +503,8 @@ extern s32 e1000e_cleanup_led_generic(struct e1000_hw *hw);
+ extern s32 e1000e_led_on_generic(struct e1000_hw *hw);
+ extern s32 e1000e_led_off_generic(struct e1000_hw *hw);
+ extern s32 e1000e_get_bus_info_pcie(struct e1000_hw *hw);
++extern void e1000_set_lan_id_multi_port_pcie(struct e1000_hw *hw);
++extern void e1000_set_lan_id_single_port(struct e1000_hw *hw);
+ extern s32 e1000e_get_speed_and_duplex_copper(struct e1000_hw *hw, u16 *speed, u16 *duplex);
+ extern s32 e1000e_get_speed_and_duplex_fiber_serdes(struct e1000_hw *hw, u16 *speed, u16 *duplex);
+ extern s32 e1000e_disable_pcie_master(struct e1000_hw *hw);
+diff --git a/drivers/net/e1000e/es2lan.c b/drivers/net/e1000e/es2lan.c
+index 4bb9d88..27d2158 100644
+--- a/drivers/net/e1000e/es2lan.c
++++ b/drivers/net/e1000e/es2lan.c
+@@ -246,6 +246,9 @@ static s32 e1000_init_mac_params_80003es2lan(struct e1000_adapter *adapter)
+ break;
+ }
+
++ /* set lan id for port to determine which phy lock to use */
++ hw->mac.ops.set_lan_id(hw);
++
+ return 0;
+ }
+
+@@ -1435,6 +1438,7 @@ static struct e1000_mac_operations es2_mac_ops = {
+ .cleanup_led = e1000e_cleanup_led_generic,
+ .clear_hw_cntrs = e1000_clear_hw_cntrs_80003es2lan,
+ .get_bus_info = e1000e_get_bus_info_pcie,
++ .set_lan_id = e1000_set_lan_id_multi_port_pcie,
+ .get_link_up_info = e1000_get_link_up_info_80003es2lan,
+ .led_on = e1000e_led_on_generic,
+ .led_off = e1000e_led_off_generic,
+diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h
+index 38c1cec..c39534f 100644
+--- a/drivers/net/e1000e/hw.h
++++ b/drivers/net/e1000e/hw.h
+@@ -749,6 +749,7 @@ struct e1000_mac_operations {
+ void (*clear_hw_cntrs)(struct e1000_hw *);
+ void (*clear_vfta)(struct e1000_hw *);
+ s32 (*get_bus_info)(struct e1000_hw *);
++ void (*set_lan_id)(struct e1000_hw *);
+ s32 (*get_link_up_info)(struct e1000_hw *, u16 *, u16 *);
+ s32 (*led_on)(struct e1000_hw *);
+ s32 (*led_off)(struct e1000_hw *);
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index 324c323..0cd1beb 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -3378,6 +3378,7 @@ static struct e1000_mac_operations ich8_mac_ops = {
+ /* cleanup_led dependent on mac type */
+ .clear_hw_cntrs = e1000_clear_hw_cntrs_ich8lan,
+ .get_bus_info = e1000_get_bus_info_ich8lan,
++ .set_lan_id = e1000_set_lan_id_single_port,
+ .get_link_up_info = e1000_get_link_up_info_ich8lan,
+ /* led_on dependent on mac type */
+ /* led_off dependent on mac type */
+diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c
+index 5475424..5f6b171 100644
+--- a/drivers/net/e1000e/lib.c
++++ b/drivers/net/e1000e/lib.c
+@@ -51,10 +51,10 @@ enum e1000_mng_mode {
+ **/
+ s32 e1000e_get_bus_info_pcie(struct e1000_hw *hw)
+ {
++ struct e1000_mac_info *mac = &hw->mac;
+ struct e1000_bus_info *bus = &hw->bus;
+ struct e1000_adapter *adapter = hw->adapter;
+- u32 status;
+- u16 pcie_link_status, pci_header_type, cap_offset;
++ u16 pcie_link_status, cap_offset;
+
+ cap_offset = pci_find_capability(adapter->pdev, PCI_CAP_ID_EXP);
+ if (!cap_offset) {
+@@ -68,20 +68,46 @@ s32 e1000e_get_bus_info_pcie(struct e1000_hw *hw)
+ PCIE_LINK_WIDTH_SHIFT);
+ }
+
+- pci_read_config_word(adapter->pdev, PCI_HEADER_TYPE_REGISTER,
+- &pci_header_type);
+- if (pci_header_type & PCI_HEADER_TYPE_MULTIFUNC) {
+- status = er32(STATUS);
+- bus->func = (status & E1000_STATUS_FUNC_MASK)
+- >> E1000_STATUS_FUNC_SHIFT;
+- } else {
+- bus->func = 0;
+- }
++ mac->ops.set_lan_id(hw);
+
+ return 0;
+ }
+
+ /**
++ * e1000_set_lan_id_multi_port_pcie - Set LAN id for PCIe multiple port devices
++ *
++ * @hw: pointer to the HW structure
++ *
++ * Determines the LAN function id by reading memory-mapped registers
++ * and swaps the port value if requested.
++ **/
++void e1000_set_lan_id_multi_port_pcie(struct e1000_hw *hw)
++{
++ struct e1000_bus_info *bus = &hw->bus;
++ u32 reg;
++
++ /*
++ * The status register reports the correct function number
++ * for the device regardless of function swap state.
++ */
++ reg = er32(STATUS);
++ bus->func = (reg & E1000_STATUS_FUNC_MASK) >> E1000_STATUS_FUNC_SHIFT;
++}
++
++/**
++ * e1000_set_lan_id_single_port - Set LAN id for a single port device
++ * @hw: pointer to the HW structure
++ *
++ * Sets the LAN function id to zero for a single port device.
++ **/
++void e1000_set_lan_id_single_port(struct e1000_hw *hw)
++{
++ struct e1000_bus_info *bus = &hw->bus;
++
++ bus->func = 0;
++}
++
++/**
+ * e1000_clear_vfta_generic - Clear VLAN filter table
+ * @hw: pointer to the HW structure
+ *
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0055-e1000e-genericize-the-update-multicast-address-list.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0055-e1000e-genericize-the-update-multicast-address-list.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,247 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Wed, 13 Jan 2010 02:05:38 +0000
+Subject: [PATCH 055/166] e1000e: genericize the update multicast address list
+
+commit ab8932f3e8e07df92d6ce3fa41f5af0dda865429 upstream.
+
+Make updating the multicast address list generic for all families and
+enforce the requirement to update the entire multicast table array all at
+once instead of piecemeal which causes problems on some parts.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/82571.c | 28 +--------------------
+ drivers/net/e1000e/e1000.h | 4 +--
+ drivers/net/e1000e/hw.h | 6 +++-
+ drivers/net/e1000e/lib.c | 58 +++++++++++-------------------------------
+ drivers/net/e1000e/netdev.c | 20 +++-----------
+ 5 files changed, 27 insertions(+), 89 deletions(-)
+
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+index 7674a91..3c95acb 100644
+--- a/drivers/net/e1000e/82571.c
++++ b/drivers/net/e1000e/82571.c
+@@ -1234,32 +1234,6 @@ static s32 e1000_led_on_82574(struct e1000_hw *hw)
+ }
+
+ /**
+- * e1000_update_mc_addr_list_82571 - Update Multicast addresses
+- * @hw: pointer to the HW structure
+- * @mc_addr_list: array of multicast addresses to program
+- * @mc_addr_count: number of multicast addresses to program
+- * @rar_used_count: the first RAR register free to program
+- * @rar_count: total number of supported Receive Address Registers
+- *
+- * Updates the Receive Address Registers and Multicast Table Array.
+- * The caller must have a packed mc_addr_list of multicast addresses.
+- * The parameter rar_count will usually be hw->mac.rar_entry_count
+- * unless there are workarounds that change this.
+- **/
+-static void e1000_update_mc_addr_list_82571(struct e1000_hw *hw,
+- u8 *mc_addr_list,
+- u32 mc_addr_count,
+- u32 rar_used_count,
+- u32 rar_count)
+-{
+- if (e1000e_get_laa_state_82571(hw))
+- rar_count--;
+-
+- e1000e_update_mc_addr_list_generic(hw, mc_addr_list, mc_addr_count,
+- rar_used_count, rar_count);
+-}
+-
+-/**
+ * e1000_setup_link_82571 - Setup flow control and link settings
+ * @hw: pointer to the HW structure
+ *
+@@ -1731,7 +1705,7 @@ static struct e1000_mac_operations e82571_mac_ops = {
+ /* .get_link_up_info: media type dependent */
+ /* .led_on: mac type dependent */
+ .led_off = e1000e_led_off_generic,
+- .update_mc_addr_list = e1000_update_mc_addr_list_82571,
++ .update_mc_addr_list = e1000e_update_mc_addr_list_generic,
+ .write_vfta = e1000_write_vfta_generic,
+ .clear_vfta = e1000_clear_vfta_82571,
+ .reset_hw = e1000_reset_hw_82571,
+diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
+index b6eba39..318bdb2 100644
+--- a/drivers/net/e1000e/e1000.h
++++ b/drivers/net/e1000e/e1000.h
+@@ -519,9 +519,7 @@ extern void e1000_clear_vfta_generic(struct e1000_hw *hw);
+ extern void e1000e_init_rx_addrs(struct e1000_hw *hw, u16 rar_count);
+ extern void e1000e_update_mc_addr_list_generic(struct e1000_hw *hw,
+ u8 *mc_addr_list,
+- u32 mc_addr_count,
+- u32 rar_used_count,
+- u32 rar_count);
++ u32 mc_addr_count);
+ extern void e1000e_rar_set(struct e1000_hw *hw, u8 *addr, u32 index);
+ extern s32 e1000e_set_fc_watermarks(struct e1000_hw *hw);
+ extern void e1000e_set_pcie_no_snoop(struct e1000_hw *hw, u32 no_snoop);
+diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h
+index c39534f..4fc3147 100644
+--- a/drivers/net/e1000e/hw.h
++++ b/drivers/net/e1000e/hw.h
+@@ -753,7 +753,7 @@ struct e1000_mac_operations {
+ s32 (*get_link_up_info)(struct e1000_hw *, u16 *, u16 *);
+ s32 (*led_on)(struct e1000_hw *);
+ s32 (*led_off)(struct e1000_hw *);
+- void (*update_mc_addr_list)(struct e1000_hw *, u8 *, u32, u32, u32);
++ void (*update_mc_addr_list)(struct e1000_hw *, u8 *, u32);
+ s32 (*reset_hw)(struct e1000_hw *);
+ s32 (*init_hw)(struct e1000_hw *);
+ s32 (*setup_link)(struct e1000_hw *);
+@@ -819,6 +819,10 @@ struct e1000_mac_info {
+ u16 ifs_ratio;
+ u16 ifs_step_size;
+ u16 mta_reg_count;
++
++ /* Maximum size of the MTA register table in all supported adapters */
++ #define MAX_MTA_REG 128
++ u32 mta_shadow[MAX_MTA_REG];
+ u16 rar_entry_count;
+
+ u8 forced_speed_duplex;
+diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c
+index 5f6b171..2425ed1 100644
+--- a/drivers/net/e1000e/lib.c
++++ b/drivers/net/e1000e/lib.c
+@@ -340,62 +340,34 @@ static u32 e1000_hash_mc_addr(struct e1000_hw *hw, u8 *mc_addr)
+ * @hw: pointer to the HW structure
+ * @mc_addr_list: array of multicast addresses to program
+ * @mc_addr_count: number of multicast addresses to program
+- * @rar_used_count: the first RAR register free to program
+- * @rar_count: total number of supported Receive Address Registers
+ *
+- * Updates the Receive Address Registers and Multicast Table Array.
++ * Updates entire Multicast Table Array.
+ * The caller must have a packed mc_addr_list of multicast addresses.
+- * The parameter rar_count will usually be hw->mac.rar_entry_count
+- * unless there are workarounds that change this.
+ **/
+ void e1000e_update_mc_addr_list_generic(struct e1000_hw *hw,
+- u8 *mc_addr_list, u32 mc_addr_count,
+- u32 rar_used_count, u32 rar_count)
++ u8 *mc_addr_list, u32 mc_addr_count)
+ {
+- u32 i;
+- u32 *mcarray = kzalloc(hw->mac.mta_reg_count * sizeof(u32), GFP_ATOMIC);
++ u32 hash_value, hash_bit, hash_reg;
++ int i;
+
+- if (!mcarray) {
+- printk(KERN_ERR "multicast array memory allocation failed\n");
+- return;
+- }
++ /* clear mta_shadow */
++ memset(&hw->mac.mta_shadow, 0, sizeof(hw->mac.mta_shadow));
+
+- /*
+- * Load the first set of multicast addresses into the exact
+- * filters (RAR). If there are not enough to fill the RAR
+- * array, clear the filters.
+- */
+- for (i = rar_used_count; i < rar_count; i++) {
+- if (mc_addr_count) {
+- e1000e_rar_set(hw, mc_addr_list, i);
+- mc_addr_count--;
+- mc_addr_list += ETH_ALEN;
+- } else {
+- E1000_WRITE_REG_ARRAY(hw, E1000_RA, i << 1, 0);
+- e1e_flush();
+- E1000_WRITE_REG_ARRAY(hw, E1000_RA, (i << 1) + 1, 0);
+- e1e_flush();
+- }
+- }
+-
+- /* Load any remaining multicast addresses into the hash table. */
+- for (; mc_addr_count > 0; mc_addr_count--) {
+- u32 hash_value, hash_reg, hash_bit, mta;
++ /* update mta_shadow from mc_addr_list */
++ for (i = 0; (u32) i < mc_addr_count; i++) {
+ hash_value = e1000_hash_mc_addr(hw, mc_addr_list);
+- e_dbg("Hash value = 0x%03X\n", hash_value);
++
+ hash_reg = (hash_value >> 5) & (hw->mac.mta_reg_count - 1);
+ hash_bit = hash_value & 0x1F;
+- mta = (1 << hash_bit);
+- mcarray[hash_reg] |= mta;
+- mc_addr_list += ETH_ALEN;
+- }
+
+- /* write the hash table completely */
+- for (i = 0; i < hw->mac.mta_reg_count; i++)
+- E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, mcarray[i]);
++ hw->mac.mta_shadow[hash_reg] |= (1 << hash_bit);
++ mc_addr_list += (ETH_ALEN);
++ }
+
++ /* replace the entire MTA table */
++ for (i = hw->mac.mta_reg_count - 1; i >= 0; i--)
++ E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, hw->mac.mta_shadow[i]);
+ e1e_flush();
+- kfree(mcarray);
+ }
+
+ /**
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index a8b4cc7..2b46c67 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -2543,22 +2543,14 @@ static void e1000_configure_rx(struct e1000_adapter *adapter)
+ * @hw: pointer to the HW structure
+ * @mc_addr_list: array of multicast addresses to program
+ * @mc_addr_count: number of multicast addresses to program
+- * @rar_used_count: the first RAR register free to program
+- * @rar_count: total number of supported Receive Address Registers
+ *
+- * Updates the Receive Address Registers and Multicast Table Array.
++ * Updates the Multicast Table Array.
+ * The caller must have a packed mc_addr_list of multicast addresses.
+- * The parameter rar_count will usually be hw->mac.rar_entry_count
+- * unless there are workarounds that change this. Currently no func pointer
+- * exists and all implementations are handled in the generic version of this
+- * function.
+ **/
+ static void e1000_update_mc_addr_list(struct e1000_hw *hw, u8 *mc_addr_list,
+- u32 mc_addr_count, u32 rar_used_count,
+- u32 rar_count)
++ u32 mc_addr_count)
+ {
+- hw->mac.ops.update_mc_addr_list(hw, mc_addr_list, mc_addr_count,
+- rar_used_count, rar_count);
++ hw->mac.ops.update_mc_addr_list(hw, mc_addr_list, mc_addr_count);
+ }
+
+ /**
+@@ -2574,7 +2566,6 @@ static void e1000_set_multi(struct net_device *netdev)
+ {
+ struct e1000_adapter *adapter = netdev_priv(netdev);
+ struct e1000_hw *hw = &adapter->hw;
+- struct e1000_mac_info *mac = &hw->mac;
+ struct dev_mc_list *mc_ptr;
+ u8 *mta_list;
+ u32 rctl;
+@@ -2616,15 +2607,14 @@ static void e1000_set_multi(struct net_device *netdev)
+ mc_ptr = mc_ptr->next;
+ }
+
+- e1000_update_mc_addr_list(hw, mta_list, i, 1,
+- mac->rar_entry_count);
++ e1000_update_mc_addr_list(hw, mta_list, i);
+ kfree(mta_list);
+ } else {
+ /*
+ * if we're called from probe, we might not have
+ * anything to do here, so clear out the list
+ */
+- e1000_update_mc_addr_list(hw, NULL, 0, 1, mac->rar_entry_count);
++ e1000_update_mc_addr_list(hw, NULL, 0);
+ }
+ }
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0056-e1000-e1000e-igb-igbvf-ixgb-ixgbe-Fix-tests-of-unsig.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0056-e1000-e1000e-igb-igbvf-ixgb-ixgbe-Fix-tests-of-unsig.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,43 @@
+From: Roel Kluin <roel.kluin at gmail.com>
+Date: Tue, 19 Jan 2010 14:21:45 +0000
+Subject: [PATCH 056/166] e1000/e1000e/igb/igbvf/ixgb/ixgbe: Fix tests of
+ unsigned in *_tx_map()
+
+commit c1fa347f20f17f14a4a1575727fa24340e8a9117 upstream.
+
+The variable count and i are unsigned so the (<|>=)0 tests do not work.
+
+Signed-off-by: Roel Kluin <roel.kluin at gmail.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Restricted to drivers/net/e1000e]
+---
+ drivers/net/e1000e/netdev.c | 10 +++++-----
+ 1 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 2b46c67..c9af1fa 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -3964,13 +3964,13 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
+ dma_error:
+ dev_err(&pdev->dev, "TX DMA map failed\n");
+ buffer_info->dma = 0;
+- count--;
+-
+- while (count >= 0) {
++ if (count)
+ count--;
+- i--;
+- if (i < 0)
++
++ while (count--) {
++ if (i==0)
+ i += tx_ring->count;
++ i--;
+ buffer_info = &tx_ring->buffer_info[i];
+ e1000_put_txbuf(adapter, buffer_info);;
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0057-net-Fix-IPv6-GSO-type-checks-in-Intel-ethernet-drive.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0057-net-Fix-IPv6-GSO-type-checks-in-Intel-ethernet-drive.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,37 @@
+From: Sridhar Samudrala <sri at us.ibm.com>
+Date: Sat, 23 Jan 2010 02:02:21 -0800
+Subject: [PATCH 057/166] net: Fix IPv6 GSO type checks in Intel ethernet
+ drivers
+
+commit 8e1e8a4779cb23c1d9f51e9223795e07ec54d77a upstream.
+
+Found this problem when testing IPv6 from a KVM guest to a remote
+host via e1000e device on the host.
+The following patch fixes the check for IPv6 GSO packet in Intel
+ethernet drivers to use skb_is_gso_v6(). SKB_GSO_DODGY is also set
+when packets are forwarded from a guest.
+
+Signed-off-by: Sridhar Samudrala <sri at us.ibm.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Restricted to drivers/net/e1000e]
+---
+ drivers/net/e1000e/netdev.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index c9af1fa..ba7f89b 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -3783,7 +3783,7 @@ static int e1000_tso(struct e1000_adapter *adapter,
+ 0, IPPROTO_TCP, 0);
+ cmd_length = E1000_TXD_CMD_IP;
+ ipcse = skb_transport_offset(skb) - 1;
+- } else if (skb_shinfo(skb)->gso_type == SKB_GSO_TCPV6) {
++ } else if (skb_is_gso_v6(skb)) {
+ ipv6_hdr(skb)->payload_len = 0;
+ tcp_hdr(skb)->check = ~csum_ipv6_magic(&ipv6_hdr(skb)->saddr,
+ &ipv6_hdr(skb)->daddr,
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0058-e1000e-Fix-namespace-conflicts-wrt.-e1000_has_link.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0058-e1000e-Fix-namespace-conflicts-wrt.-e1000_has_link.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,66 @@
+From: "David S. Miller" <davem at davemloft.net>
+Date: Thu, 4 Feb 2010 22:31:41 -0800
+Subject: [PATCH 058/166] e1000e: Fix namespace conflicts wrt. e1000_has_link
+
+commit b405e8df26dfe4c56ab3f88f5cc1dfab0d220289 upstream.
+
+Reported by Stephen Rothwell.
+
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/e1000.h | 2 +-
+ drivers/net/e1000e/ethtool.c | 2 +-
+ drivers/net/e1000e/netdev.c | 4 ++--
+ 3 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
+index 318bdb2..c2ec095 100644
+--- a/drivers/net/e1000e/e1000.h
++++ b/drivers/net/e1000e/e1000.h
+@@ -459,7 +459,7 @@ extern int e1000e_setup_tx_resources(struct e1000_adapter *adapter);
+ extern void e1000e_free_rx_resources(struct e1000_adapter *adapter);
+ extern void e1000e_free_tx_resources(struct e1000_adapter *adapter);
+ extern void e1000e_update_stats(struct e1000_adapter *adapter);
+-extern bool e1000_has_link(struct e1000_adapter *adapter);
++extern bool e1000e_has_link(struct e1000_adapter *adapter);
+ extern void e1000e_set_interrupt_capability(struct e1000_adapter *adapter);
+ extern void e1000e_reset_interrupt_capability(struct e1000_adapter *adapter);
+
+diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
+index 0aa50c2..b33e3cb 100644
+--- a/drivers/net/e1000e/ethtool.c
++++ b/drivers/net/e1000e/ethtool.c
+@@ -202,7 +202,7 @@ static u32 e1000_get_link(struct net_device *netdev)
+ if (!netif_carrier_ok(netdev))
+ mac->get_link_status = 1;
+
+- return e1000_has_link(adapter);
++ return e1000e_has_link(adapter);
+ }
+
+ static int e1000_set_spd_dplx(struct e1000_adapter *adapter, u16 spddplx)
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index ba7f89b..1ad96ef 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -3479,7 +3479,7 @@ static void e1000_print_link_info(struct e1000_adapter *adapter)
+ ((ctrl & E1000_CTRL_TFCE) ? "TX" : "None" )));
+ }
+
+-bool e1000_has_link(struct e1000_adapter *adapter)
++bool e1000e_has_link(struct e1000_adapter *adapter)
+ {
+ struct e1000_hw *hw = &adapter->hw;
+ bool link_active = 0;
+@@ -3560,7 +3560,7 @@ static void e1000_watchdog_task(struct work_struct *work)
+ u32 link, tctl;
+ int tx_pending = 0;
+
+- link = e1000_has_link(adapter);
++ link = e1000e_has_link(adapter);
+ if ((netif_carrier_ok(netdev)) && link) {
+ e1000e_enable_receives(adapter);
+ goto link_up;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0059-net-e1000e-convert-to-use-mc-helpers.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0059-net-e1000e-convert-to-use-mc-helpers.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,47 @@
+From: Jiri Pirko <jpirko at redhat.com>
+Date: Fri, 5 Feb 2010 02:52:39 +0000
+Subject: [PATCH 059/166] net: e1000e: convert to use mc helpers
+
+commit 7aeef972cce30b0ab04047e07918b04d867e7a29 upstream.
+
+Signed-off-by: Jiri Pirko <jpirko at redhat.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/netdev.c | 17 ++++++-----------
+ 1 files changed, 6 insertions(+), 11 deletions(-)
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 1ad96ef..e1079fd 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -2591,21 +2591,16 @@ static void e1000_set_multi(struct net_device *netdev)
+
+ ew32(RCTL, rctl);
+
+- if (netdev->mc_count) {
+- mta_list = kmalloc(netdev->mc_count * 6, GFP_ATOMIC);
++ if (!netdev_mc_empty(netdev)) {
++ mta_list = kmalloc(netdev_mc_count(netdev) * 6, GFP_ATOMIC);
+ if (!mta_list)
+ return;
+
+ /* prepare a packed array of only addresses. */
+- mc_ptr = netdev->mc_list;
+-
+- for (i = 0; i < netdev->mc_count; i++) {
+- if (!mc_ptr)
+- break;
+- memcpy(mta_list + (i*ETH_ALEN), mc_ptr->dmi_addr,
+- ETH_ALEN);
+- mc_ptr = mc_ptr->next;
+- }
++ i = 0;
++ netdev_for_each_mc_addr(mc_ptr, netdev)
++ memcpy(mta_list + (i++ * ETH_ALEN),
++ mc_ptr->dmi_addr, ETH_ALEN);
+
+ e1000_update_mc_addr_list(hw, mta_list, i);
+ kfree(mta_list);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0060-tree-wide-Assorted-spelling-fixes.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0060-tree-wide-Assorted-spelling-fixes.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,49 @@
+From: Daniel Mack <daniel at caiaq.de>
+Date: Wed, 3 Feb 2010 08:01:28 +0800
+Subject: [PATCH 060/166] tree-wide: Assorted spelling fixes
+
+commit 3ad2f3fbb961429d2aa627465ae4829758bc7e07 upstream.
+
+In particular, several occurances of funny versions of 'success',
+'unknown', 'therefore', 'acknowledge', 'argument', 'achieve', 'address',
+'beginning', 'desirable', 'separate' and 'necessary' are fixed.
+
+Signed-off-by: Daniel Mack <daniel at caiaq.de>
+Cc: Joe Perches <joe at perches.com>
+Cc: Junio C Hamano <gitster at pobox.com>
+Signed-off-by: Jiri Kosina <jkosina at suse.cz>
+[bwh: Restricted to drivers/net/e1000e]
+---
+ drivers/net/e1000e/82571.c | 2 +-
+ drivers/net/e1000e/lib.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+index 3c95acb..712ccc6 100644
+--- a/drivers/net/e1000e/82571.c
++++ b/drivers/net/e1000e/82571.c
+@@ -1346,7 +1346,7 @@ static s32 e1000_setup_fiber_serdes_link_82571(struct e1000_hw *hw)
+ *
+ * 1) down
+ * 2) autoneg_progress
+- * 3) autoneg_complete (the link sucessfully autonegotiated)
++ * 3) autoneg_complete (the link successfully autonegotiated)
+ * 4) forced_up (the link has been forced up, it did not autonegotiate)
+ *
+ **/
+diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c
+index 2425ed1..a8b2c0d 100644
+--- a/drivers/net/e1000e/lib.c
++++ b/drivers/net/e1000e/lib.c
+@@ -647,7 +647,7 @@ s32 e1000e_check_for_serdes_link(struct e1000_hw *hw)
+ if (!(rxcw & E1000_RXCW_IV)) {
+ mac->serdes_has_link = true;
+ e_dbg("SERDES: Link up - autoneg "
+- "completed sucessfully.\n");
++ "completed successfully.\n");
+ } else {
+ mac->serdes_has_link = false;
+ e_dbg("SERDES: Link down - invalid"
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0061-e1000e-fix-packet-corruption-and-tx-hang-during-NFSv.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0061-e1000e-fix-packet-corruption-and-tx-hang-during-NFSv.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,60 @@
+From: Jesse Brandeburg <jesse.brandeburg at intel.com>
+Date: Fri, 5 Mar 2010 02:21:44 +0000
+Subject: [PATCH 061/166] e1000e: fix packet corruption and tx hang during
+ NFSv2
+
+commit a80483d3722b603dae8a52495f8d88a7d4b1bf1c upstream.
+
+when receiving a particular type of NFS v2 UDP traffic, the hardware could
+DMA some bad data and then hang, possibly corrupting memory.
+
+Disable the NFS parsing in this hardware, verified to fix the bug.
+
+Originally reported and reproduced by RedHat's Neil Horman
+CC: nhorman at tuxdriver.com
+Signed-off-by: Jesse Brandeburg <jesse.brandeburg at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Acked-by: Neil Horman <nhorman at tuxdriver.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/defines.h | 2 ++
+ drivers/net/e1000e/ich8lan.c | 10 ++++++++++
+ 2 files changed, 12 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/e1000e/defines.h b/drivers/net/e1000e/defines.h
+index db05ec3..e301e26 100644
+--- a/drivers/net/e1000e/defines.h
++++ b/drivers/net/e1000e/defines.h
+@@ -320,6 +320,8 @@
+ #define E1000_RXCSUM_IPPCSE 0x00001000 /* IP payload checksum enable */
+
+ /* Header split receive */
++#define E1000_RFCTL_NFSW_DIS 0x00000040
++#define E1000_RFCTL_NFSR_DIS 0x00000080
+ #define E1000_RFCTL_ACK_DIS 0x00001000
+ #define E1000_RFCTL_EXTEN 0x00008000
+ #define E1000_RFCTL_IPV6_EX_DIS 0x00010000
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index 0cd1beb..a626012 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -2750,6 +2750,16 @@ static void e1000_initialize_hw_bits_ich8lan(struct e1000_hw *hw)
+ reg &= ~(1 << 31);
+ ew32(STATUS, reg);
+ }
++
++ /*
++ * work-around descriptor data corruption issue during nfs v2 udp
++ * traffic, just disable the nfs filtering capability
++ */
++ reg = er32(RFCTL);
++ reg |= (E1000_RFCTL_NFSW_DIS | E1000_RFCTL_NFSR_DIS);
++ ew32(RFCTL, reg);
++
++ return;
+ }
+
+ /**
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0062-e1000e-enable-disable-ASPM-L0s-and-L1-and-ERT-accord.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0062-e1000e-enable-disable-ASPM-L0s-and-L1-and-ERT-accord.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,256 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Tue, 27 Apr 2010 03:33:04 +0000
+Subject: [PATCH 062/166] e1000e: enable/disable ASPM L0s and L1 and ERT
+ according to hardware errata
+
+commit 6f461f6c7c961f0b1b73c0f27becf472a0ac606b upstream.
+
+Prompted by a previous patch submitted by Matthew Garret <mjg at redhat.com>,
+further digging into errata documentation reveals the current enabling or
+disabling of ASPM L0s and L1 states for certain parts supported by this
+driver are incorrect. 82571 and 82572 should always disable L1. For
+standard frames, 82573/82574/82583 can enable L1 but L0s must be disabled,
+and for jumbo frames 82573/82574 must disable L1. This allows for some
+parts to enable L1 in certain configurations leading to better power
+savings.
+
+Also according to the same errata, Early Receive (ERT) should be disabled
+on 82573 when using jumbo frames.
+
+Cc: Matthew Garret <mjg at redhat.com>
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/82571.c | 20 +++++-------
+ drivers/net/e1000e/e1000.h | 5 ++-
+ drivers/net/e1000e/netdev.c | 70 +++++++++++++++++++++++++-----------------
+ 3 files changed, 55 insertions(+), 40 deletions(-)
+
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+index 712ccc6..9015555 100644
+--- a/drivers/net/e1000e/82571.c
++++ b/drivers/net/e1000e/82571.c
+@@ -336,7 +336,6 @@ static s32 e1000_get_variants_82571(struct e1000_adapter *adapter)
+ struct e1000_hw *hw = &adapter->hw;
+ static int global_quad_port_a; /* global port a indication */
+ struct pci_dev *pdev = adapter->pdev;
+- u16 eeprom_data = 0;
+ int is_port_b = er32(STATUS) & E1000_STATUS_FUNC_1;
+ s32 rc;
+
+@@ -387,16 +386,15 @@ static s32 e1000_get_variants_82571(struct e1000_adapter *adapter)
+ if (pdev->device == E1000_DEV_ID_82571EB_SERDES_QUAD)
+ adapter->flags &= ~FLAG_HAS_WOL;
+ break;
+-
+ case e1000_82573:
++ case e1000_82574:
++ case e1000_82583:
++ /* Disable ASPM L0s due to hardware errata */
++ e1000e_disable_aspm(adapter->pdev, PCIE_LINK_STATE_L0S);
++
+ if (pdev->device == E1000_DEV_ID_82573L) {
+- if (e1000_read_nvm(&adapter->hw, NVM_INIT_3GIO_3, 1,
+- &eeprom_data) < 0)
+- break;
+- if (!(eeprom_data & NVM_WORD1A_ASPM_MASK)) {
+- adapter->flags |= FLAG_HAS_JUMBO_FRAMES;
+- adapter->max_hw_frame_size = DEFAULT_JUMBO;
+- }
++ adapter->flags |= FLAG_HAS_JUMBO_FRAMES;
++ adapter->max_hw_frame_size = DEFAULT_JUMBO;
+ }
+ break;
+ default:
+@@ -1792,6 +1790,7 @@ struct e1000_info e1000_82571_info = {
+ | FLAG_RESET_OVERWRITES_LAA /* errata */
+ | FLAG_TARC_SPEED_MODE_BIT /* errata */
+ | FLAG_APME_CHECK_PORT_B,
++ .flags2 = FLAG2_DISABLE_ASPM_L1, /* errata 13 */
+ .pba = 38,
+ .max_hw_frame_size = DEFAULT_JUMBO,
+ .get_variants = e1000_get_variants_82571,
+@@ -1809,6 +1808,7 @@ struct e1000_info e1000_82572_info = {
+ | FLAG_RX_CSUM_ENABLED
+ | FLAG_HAS_CTRLEXT_ON_LOAD
+ | FLAG_TARC_SPEED_MODE_BIT, /* errata */
++ .flags2 = FLAG2_DISABLE_ASPM_L1, /* errata 13 */
+ .pba = 38,
+ .max_hw_frame_size = DEFAULT_JUMBO,
+ .get_variants = e1000_get_variants_82571,
+@@ -1820,13 +1820,11 @@ struct e1000_info e1000_82572_info = {
+ struct e1000_info e1000_82573_info = {
+ .mac = e1000_82573,
+ .flags = FLAG_HAS_HW_VLAN_FILTER
+- | FLAG_HAS_JUMBO_FRAMES
+ | FLAG_HAS_WOL
+ | FLAG_APME_IN_CTRL3
+ | FLAG_RX_CSUM_ENABLED
+ | FLAG_HAS_SMART_POWER_DOWN
+ | FLAG_HAS_AMT
+- | FLAG_HAS_ERT
+ | FLAG_HAS_SWSM_ON_LOAD,
+ .pba = 20,
+ .max_hw_frame_size = ETH_FRAME_LEN + ETH_FCS_LEN,
+diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
+index c2ec095..13eaf76 100644
+--- a/drivers/net/e1000e/e1000.h
++++ b/drivers/net/e1000e/e1000.h
+@@ -37,6 +37,7 @@
+ #include <linux/io.h>
+ #include <linux/netdevice.h>
+ #include <linux/pci.h>
++#include <linux/pci-aspm.h>
+
+ #include "hw.h"
+
+@@ -375,7 +376,7 @@ struct e1000_adapter {
+ struct e1000_info {
+ enum e1000_mac_type mac;
+ unsigned int flags;
+- unsigned int flags2;
++ unsigned int flags2;
+ u32 pba;
+ u32 max_hw_frame_size;
+ s32 (*get_variants)(struct e1000_adapter *);
+@@ -422,6 +423,7 @@ struct e1000_info {
+ #define FLAG2_CRC_STRIPPING (1 << 0)
+ #define FLAG2_HAS_PHY_WAKEUP (1 << 1)
+ #define FLAG2_IS_DISCARDING (1 << 2)
++#define FLAG2_DISABLE_ASPM_L1 (1 << 3)
+
+ #define E1000_RX_DESC_PS(R, i) \
+ (&(((union e1000_rx_desc_packet_split *)((R).desc))[i]))
+@@ -462,6 +464,7 @@ extern void e1000e_update_stats(struct e1000_adapter *adapter);
+ extern bool e1000e_has_link(struct e1000_adapter *adapter);
+ extern void e1000e_set_interrupt_capability(struct e1000_adapter *adapter);
+ extern void e1000e_reset_interrupt_capability(struct e1000_adapter *adapter);
++extern void e1000e_disable_aspm(struct pci_dev *pdev, u16 state);
+
+ extern unsigned int copybreak;
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index e1079fd..da87f33 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -4296,6 +4296,14 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu)
+ return -EINVAL;
+ }
+
++ /* 82573 Errata 17 */
++ if (((adapter->hw.mac.type == e1000_82573) ||
++ (adapter->hw.mac.type == e1000_82574)) &&
++ (max_frame > ETH_FRAME_LEN + ETH_FCS_LEN)) {
++ adapter->flags2 |= FLAG2_DISABLE_ASPM_L1;
++ e1000e_disable_aspm(adapter->pdev, PCIE_LINK_STATE_L1);
++ }
++
+ while (test_and_set_bit(__E1000_RESETTING, &adapter->state))
+ msleep(1);
+ /* e1000e_down -> e1000e_reset dependent on max_frame_size & mtu */
+@@ -4618,29 +4626,39 @@ static void e1000_complete_shutdown(struct pci_dev *pdev, bool sleep,
+ }
+ }
+
+-static void e1000e_disable_l1aspm(struct pci_dev *pdev)
++#ifdef CONFIG_PCIEASPM
++static void __e1000e_disable_aspm(struct pci_dev *pdev, u16 state)
++{
++ pci_disable_link_state(pdev, state);
++}
++#else
++static void __e1000e_disable_aspm(struct pci_dev *pdev, u16 state)
+ {
+ int pos;
+- u16 val;
++ u16 reg16;
+
+ /*
+- * 82573 workaround - disable L1 ASPM on mobile chipsets
+- *
+- * L1 ASPM on various mobile (ich7) chipsets do not behave properly
+- * resulting in lost data or garbage information on the pci-e link
+- * level. This could result in (false) bad EEPROM checksum errors,
+- * long ping times (up to 2s) or even a system freeze/hang.
+- *
+- * Unfortunately this feature saves about 1W power consumption when
+- * active.
++ * Both device and parent should have the same ASPM setting.
++ * Disable ASPM in downstream component first and then upstream.
+ */
+- pos = pci_find_capability(pdev, PCI_CAP_ID_EXP);
+- pci_read_config_word(pdev, pos + PCI_EXP_LNKCTL, &val);
+- if (val & 0x2) {
+- dev_warn(&pdev->dev, "Disabling L1 ASPM\n");
+- val &= ~0x2;
+- pci_write_config_word(pdev, pos + PCI_EXP_LNKCTL, val);
+- }
++ pos = pci_pcie_cap(pdev);
++ pci_read_config_word(pdev, pos + PCI_EXP_LNKCTL, ®16);
++ reg16 &= ~state;
++ pci_write_config_word(pdev, pos + PCI_EXP_LNKCTL, reg16);
++
++ pos = pci_pcie_cap(pdev->bus->self);
++ pci_read_config_word(pdev->bus->self, pos + PCI_EXP_LNKCTL, ®16);
++ reg16 &= ~state;
++ pci_write_config_word(pdev->bus->self, pos + PCI_EXP_LNKCTL, reg16);
++}
++#endif
++void e1000e_disable_aspm(struct pci_dev *pdev, u16 state)
++{
++ dev_info(&pdev->dev, "Disabling ASPM %s %s\n",
++ (state & PCIE_LINK_STATE_L0S) ? "L0s" : "",
++ (state & PCIE_LINK_STATE_L1) ? "L1" : "");
++
++ __e1000e_disable_aspm(pdev, state);
+ }
+
+ #ifdef CONFIG_PM
+@@ -4666,7 +4684,8 @@ static int e1000_resume(struct pci_dev *pdev)
+ pci_set_power_state(pdev, PCI_D0);
+ pci_restore_state(pdev);
+ pci_save_state(pdev);
+- e1000e_disable_l1aspm(pdev);
++ if (adapter->flags2 & FLAG2_DISABLE_ASPM_L1)
++ e1000e_disable_aspm(pdev, PCIE_LINK_STATE_L1);
+
+ err = pci_enable_device_mem(pdev);
+ if (err) {
+@@ -4808,7 +4827,8 @@ static pci_ers_result_t e1000_io_slot_reset(struct pci_dev *pdev)
+ int err;
+ pci_ers_result_t result;
+
+- e1000e_disable_l1aspm(pdev);
++ if (adapter->flags2 & FLAG2_DISABLE_ASPM_L1)
++ e1000e_disable_aspm(pdev, PCIE_LINK_STATE_L1);
+ err = pci_enable_device_mem(pdev);
+ if (err) {
+ dev_err(&pdev->dev,
+@@ -4902,13 +4922,6 @@ static void e1000_eeprom_checks(struct e1000_adapter *adapter)
+ dev_warn(&adapter->pdev->dev,
+ "Warning: detected DSPD enabled in EEPROM\n");
+ }
+-
+- ret_val = e1000_read_nvm(hw, NVM_INIT_3GIO_3, 1, &buf);
+- if (!ret_val && (le16_to_cpu(buf) & (3 << 2))) {
+- /* ASPM enable */
+- dev_warn(&adapter->pdev->dev,
+- "Warning: detected ASPM enabled in EEPROM\n");
+- }
+ }
+
+ static const struct net_device_ops e1000e_netdev_ops = {
+@@ -4957,7 +4970,8 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
+ u16 eeprom_data = 0;
+ u16 eeprom_apme_mask = E1000_EEPROM_APME;
+
+- e1000e_disable_l1aspm(pdev);
++ if (ei->flags2 & FLAG2_DISABLE_ASPM_L1)
++ e1000e_disable_aspm(pdev, PCIE_LINK_STATE_L1);
+
+ err = pci_enable_device_mem(pdev);
+ if (err)
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0063-e1000e-PCI-PM-Add-basic-runtime-PM-support-rev.-4.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0063-e1000e-PCI-PM-Add-basic-runtime-PM-support-rev.-4.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,386 @@
+From: "Rafael J. Wysocki" <rjw at sisk.pl>
+Date: Sun, 14 Mar 2010 14:35:17 +0000
+Subject: [PATCH 063/166] e1000e / PCI / PM: Add basic runtime PM support
+ (rev. 4)
+
+commit 23606cf5d1192c2b17912cb2ef6e62f9b11de133 upstream.
+
+Use the PCI runtime power management framework to add basic PCI
+runtime PM support to the e1000e driver. Namely, make the driver
+suspend the device when the link is off and set it up for generating
+a wakeup event after the link has been detected again. [This
+feature is disabled until the user space enables it with the help of
+the /sys/devices/.../power/contol device attribute.]
+
+Based on a patch from Matthew Garrett.
+
+Signed-off-by: Rafael J. Wysocki <rjw at sisk.pl>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Resolve conflict with commit
+ 6f461f6c7c961f0b1b73c0f27becf472a0ac606b ('e1000e: enable/disable
+ ASPM L0s and L1 and ERT according to hardware errata')]
+---
+ drivers/net/e1000e/e1000.h | 5 ++
+ drivers/net/e1000e/netdev.c | 159 ++++++++++++++++++++++++++++++++++++-------
+ 2 files changed, 139 insertions(+), 25 deletions(-)
+
+diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
+index 13eaf76..a99c240 100644
+--- a/drivers/net/e1000e/e1000.h
++++ b/drivers/net/e1000e/e1000.h
+@@ -159,6 +159,9 @@ struct e1000_info;
+ #define HV_M_STATUS_SPEED_1000 0x0200
+ #define HV_M_STATUS_LINK_UP 0x0040
+
++/* Time to wait before putting the device into D3 if there's no link (in ms). */
++#define LINK_TIMEOUT 100
++
+ enum e1000_boards {
+ board_82571,
+ board_82572,
+@@ -371,6 +374,8 @@ struct e1000_adapter {
+ struct work_struct update_phy_task;
+ struct work_struct led_blink_task;
+ struct work_struct print_hang_task;
++
++ bool idle_check;
+ };
+
+ struct e1000_info {
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index da87f33..f57413b 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -44,6 +44,7 @@
+ #include <linux/cpu.h>
+ #include <linux/smp.h>
+ #include <linux/pm_qos_params.h>
++#include <linux/pm_runtime.h>
+ #include <linux/aer.h>
+
+ #include "e1000.h"
+@@ -3090,12 +3091,15 @@ static int e1000_open(struct net_device *netdev)
+ {
+ struct e1000_adapter *adapter = netdev_priv(netdev);
+ struct e1000_hw *hw = &adapter->hw;
++ struct pci_dev *pdev = adapter->pdev;
+ int err;
+
+ /* disallow open during test */
+ if (test_bit(__E1000_TESTING, &adapter->state))
+ return -EBUSY;
+
++ pm_runtime_get_sync(&pdev->dev);
++
+ netif_carrier_off(netdev);
+
+ /* allocate transmit descriptors */
+@@ -3156,6 +3160,9 @@ static int e1000_open(struct net_device *netdev)
+
+ netif_start_queue(netdev);
+
++ adapter->idle_check = true;
++ pm_runtime_put(&pdev->dev);
++
+ /* fire a link status change interrupt to start the watchdog */
+ ew32(ICS, E1000_ICS_LSC);
+
+@@ -3169,6 +3176,7 @@ err_setup_rx:
+ e1000e_free_tx_resources(adapter);
+ err_setup_tx:
+ e1000e_reset(adapter);
++ pm_runtime_put_sync(&pdev->dev);
+
+ return err;
+ }
+@@ -3187,11 +3195,17 @@ err_setup_tx:
+ static int e1000_close(struct net_device *netdev)
+ {
+ struct e1000_adapter *adapter = netdev_priv(netdev);
++ struct pci_dev *pdev = adapter->pdev;
+
+ WARN_ON(test_bit(__E1000_RESETTING, &adapter->state));
+- e1000e_down(adapter);
++
++ pm_runtime_get_sync(&pdev->dev);
++
++ if (!test_bit(__E1000_DOWN, &adapter->state)) {
++ e1000e_down(adapter);
++ e1000_free_irq(adapter);
++ }
+ e1000_power_down_phy(adapter);
+- e1000_free_irq(adapter);
+
+ e1000e_free_tx_resources(adapter);
+ e1000e_free_rx_resources(adapter);
+@@ -3213,6 +3227,8 @@ static int e1000_close(struct net_device *netdev)
+ if (adapter->flags & FLAG_HAS_AMT)
+ e1000_release_hw_control(adapter);
+
++ pm_runtime_put_sync(&pdev->dev);
++
+ return 0;
+ }
+ /**
+@@ -3557,6 +3573,9 @@ static void e1000_watchdog_task(struct work_struct *work)
+
+ link = e1000e_has_link(adapter);
+ if ((netif_carrier_ok(netdev)) && link) {
++ /* Cancel scheduled suspend requests. */
++ pm_runtime_resume(netdev->dev.parent);
++
+ e1000e_enable_receives(adapter);
+ goto link_up;
+ }
+@@ -3568,6 +3587,10 @@ static void e1000_watchdog_task(struct work_struct *work)
+ if (link) {
+ if (!netif_carrier_ok(netdev)) {
+ bool txb2b = 1;
++
++ /* Cancel scheduled suspend requests. */
++ pm_runtime_resume(netdev->dev.parent);
++
+ /* update snapshot of PHY registers on LSC */
+ e1000_phy_read_status(adapter);
+ mac->ops.get_link_up_info(&adapter->hw,
+@@ -3683,6 +3706,9 @@ static void e1000_watchdog_task(struct work_struct *work)
+
+ if (adapter->flags & FLAG_RX_NEEDS_RESTART)
+ schedule_work(&adapter->reset_task);
++ else
++ pm_schedule_suspend(netdev->dev.parent,
++ LINK_TIMEOUT);
+ }
+ }
+
+@@ -4488,13 +4514,15 @@ out:
+ return retval;
+ }
+
+-static int __e1000_shutdown(struct pci_dev *pdev, bool *enable_wake)
++static int __e1000_shutdown(struct pci_dev *pdev, bool *enable_wake,
++ bool runtime)
+ {
+ struct net_device *netdev = pci_get_drvdata(pdev);
+ struct e1000_adapter *adapter = netdev_priv(netdev);
+ struct e1000_hw *hw = &adapter->hw;
+ u32 ctrl, ctrl_ext, rctl, status;
+- u32 wufc = adapter->wol;
++ /* Runtime suspend should only enable wakeup for link changes */
++ u32 wufc = runtime ? E1000_WUFC_LNKC : adapter->wol;
+ int retval = 0;
+
+ netif_device_detach(netdev);
+@@ -4662,19 +4690,58 @@ void e1000e_disable_aspm(struct pci_dev *pdev, u16 state)
+ }
+
+ #ifdef CONFIG_PM
+-static int e1000_suspend(struct pci_dev *pdev, pm_message_t state)
++static bool e1000e_pm_ready(struct e1000_adapter *adapter)
++{
++ return !!adapter->tx_ring->buffer_info;
++}
++
++static int e1000_idle(struct device *dev)
+ {
++ struct pci_dev *pdev = to_pci_dev(dev);
++ struct net_device *netdev = pci_get_drvdata(pdev);
++ struct e1000_adapter *adapter = netdev_priv(netdev);
++
++ if (!e1000e_pm_ready(adapter))
++ return 0;
++
++ if (adapter->idle_check) {
++ adapter->idle_check = false;
++ if (!e1000e_has_link(adapter))
++ pm_schedule_suspend(dev, MSEC_PER_SEC);
++ }
++
++ return -EBUSY;
++}
++
++static int e1000_suspend(struct device *dev)
++{
++ struct pci_dev *pdev = to_pci_dev(dev);
+ int retval;
+ bool wake;
+
+- retval = __e1000_shutdown(pdev, &wake);
++ retval = __e1000_shutdown(pdev, &wake, false);
+ if (!retval)
+ e1000_complete_shutdown(pdev, true, wake);
+
+ return retval;
+ }
+
+-static int e1000_resume(struct pci_dev *pdev)
++static int e1000_runtime_suspend(struct device *dev)
++{
++ struct pci_dev *pdev = to_pci_dev(dev);
++ struct net_device *netdev = pci_get_drvdata(pdev);
++ struct e1000_adapter *adapter = netdev_priv(netdev);
++
++ if (e1000e_pm_ready(adapter)) {
++ bool wake;
++
++ __e1000_shutdown(pdev, &wake, true);
++ }
++
++ return 0;
++}
++
++static int __e1000_resume(struct pci_dev *pdev)
+ {
+ struct net_device *netdev = pci_get_drvdata(pdev);
+ struct e1000_adapter *adapter = netdev_priv(netdev);
+@@ -4687,18 +4754,6 @@ static int e1000_resume(struct pci_dev *pdev)
+ if (adapter->flags2 & FLAG2_DISABLE_ASPM_L1)
+ e1000e_disable_aspm(pdev, PCIE_LINK_STATE_L1);
+
+- err = pci_enable_device_mem(pdev);
+- if (err) {
+- dev_err(&pdev->dev,
+- "Cannot enable PCI device from suspend\n");
+- return err;
+- }
+-
+- pci_set_master(pdev);
+-
+- pci_enable_wake(pdev, PCI_D3hot, 0);
+- pci_enable_wake(pdev, PCI_D3cold, 0);
+-
+ e1000e_set_interrupt_capability(adapter);
+ if (netif_running(netdev)) {
+ err = e1000_request_irq(adapter);
+@@ -4756,13 +4811,38 @@ static int e1000_resume(struct pci_dev *pdev)
+
+ return 0;
+ }
++
++static int e1000_resume(struct device *dev)
++{
++ struct pci_dev *pdev = to_pci_dev(dev);
++ struct net_device *netdev = pci_get_drvdata(pdev);
++ struct e1000_adapter *adapter = netdev_priv(netdev);
++
++ if (e1000e_pm_ready(adapter))
++ adapter->idle_check = true;
++
++ return __e1000_resume(pdev);
++}
++
++static int e1000_runtime_resume(struct device *dev)
++{
++ struct pci_dev *pdev = to_pci_dev(dev);
++ struct net_device *netdev = pci_get_drvdata(pdev);
++ struct e1000_adapter *adapter = netdev_priv(netdev);
++
++ if (!e1000e_pm_ready(adapter))
++ return 0;
++
++ adapter->idle_check = !dev->power.runtime_auto;
++ return __e1000_resume(pdev);
++}
+ #endif
+
+ static void e1000_shutdown(struct pci_dev *pdev)
+ {
+ bool wake = false;
+
+- __e1000_shutdown(pdev, &wake);
++ __e1000_shutdown(pdev, &wake, false);
+
+ if (system_state == SYSTEM_POWER_OFF)
+ e1000_complete_shutdown(pdev, false, wake);
+@@ -4836,8 +4916,8 @@ static pci_ers_result_t e1000_io_slot_reset(struct pci_dev *pdev)
+ result = PCI_ERS_RESULT_DISCONNECT;
+ } else {
+ pci_set_master(pdev);
++ pdev->state_saved = true;
+ pci_restore_state(pdev);
+- pci_save_state(pdev);
+
+ pci_enable_wake(pdev, PCI_D3hot, 0);
+ pci_enable_wake(pdev, PCI_D3cold, 0);
+@@ -5239,6 +5319,12 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
+
+ e1000_print_device_info(adapter);
+
++ if (pci_dev_run_wake(pdev)) {
++ pm_runtime_set_active(&pdev->dev);
++ pm_runtime_enable(&pdev->dev);
++ }
++ pm_schedule_suspend(&pdev->dev, MSEC_PER_SEC);
++
+ return 0;
+
+ err_register:
+@@ -5281,12 +5367,16 @@ static void __devexit e1000_remove(struct pci_dev *pdev)
+ {
+ struct net_device *netdev = pci_get_drvdata(pdev);
+ struct e1000_adapter *adapter = netdev_priv(netdev);
++ bool down = test_bit(__E1000_DOWN, &adapter->state);
++
++ pm_runtime_get_sync(&pdev->dev);
+
+ /*
+ * flush_scheduled work may reschedule our watchdog task, so
+ * explicitly disable watchdog tasks from being rescheduled
+ */
+- set_bit(__E1000_DOWN, &adapter->state);
++ if (!down)
++ set_bit(__E1000_DOWN, &adapter->state);
+ del_timer_sync(&adapter->watchdog_timer);
+ del_timer_sync(&adapter->phy_info_timer);
+
+@@ -5300,8 +5390,17 @@ static void __devexit e1000_remove(struct pci_dev *pdev)
+ if (!(netdev->flags & IFF_UP))
+ e1000_power_down_phy(adapter);
+
++ /* Don't lie to e1000_close() down the road. */
++ if (!down)
++ clear_bit(__E1000_DOWN, &adapter->state);
+ unregister_netdev(netdev);
+
++ if (pci_dev_run_wake(pdev)) {
++ pm_runtime_disable(&pdev->dev);
++ pm_runtime_set_suspended(&pdev->dev);
++ }
++ pm_runtime_put_noidle(&pdev->dev);
++
+ /*
+ * Release control of h/w to f/w. If f/w is AMT enabled, this
+ * would have already happened in close and is redundant.
+@@ -5401,6 +5500,18 @@ static DEFINE_PCI_DEVICE_TABLE(e1000_pci_tbl) = {
+ };
+ MODULE_DEVICE_TABLE(pci, e1000_pci_tbl);
+
++static const struct dev_pm_ops e1000_pm_ops = {
++ .suspend = e1000_suspend,
++ .resume = e1000_resume,
++ .freeze = e1000_suspend,
++ .thaw = e1000_resume,
++ .poweroff = e1000_suspend,
++ .restore = e1000_resume,
++ .runtime_suspend = e1000_runtime_suspend,
++ .runtime_resume = e1000_runtime_resume,
++ .runtime_idle = e1000_idle,
++};
++
+ /* PCI Device API Driver */
+ static struct pci_driver e1000_driver = {
+ .name = e1000e_driver_name,
+@@ -5408,9 +5519,7 @@ static struct pci_driver e1000_driver = {
+ .probe = e1000_probe,
+ .remove = __devexit_p(e1000_remove),
+ #ifdef CONFIG_PM
+- /* Power Management Hooks */
+- .suspend = e1000_suspend,
+- .resume = e1000_resume,
++ .driver.pm = &e1000_pm_ops,
+ #endif
+ .shutdown = e1000_shutdown,
+ .err_handler = &e1000_err_handler
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0064-e1000e-Fix-build-with-CONFIG_PM-disabled.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0064-e1000e-Fix-build-with-CONFIG_PM-disabled.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,34 @@
+From: "David S. Miller" <davem at davemloft.net>
+Date: Tue, 16 Mar 2010 23:36:24 -0700
+Subject: [PATCH 064/166] e1000e: Fix build with CONFIG_PM disabled.
+
+commit e50208a080a8abdfa6c85865362a1cf329e9fe31 upstream.
+
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/netdev.c | 2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index f57413b..2c337f7 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -5500,6 +5500,7 @@ static DEFINE_PCI_DEVICE_TABLE(e1000_pci_tbl) = {
+ };
+ MODULE_DEVICE_TABLE(pci, e1000_pci_tbl);
+
++#ifdef CONFIG_PM
+ static const struct dev_pm_ops e1000_pm_ops = {
+ .suspend = e1000_suspend,
+ .resume = e1000_resume,
+@@ -5511,6 +5512,7 @@ static const struct dev_pm_ops e1000_pm_ops = {
+ .runtime_resume = e1000_runtime_resume,
+ .runtime_idle = e1000_idle,
+ };
++#endif
+
+ /* PCI Device API Driver */
+ static struct pci_driver e1000_driver = {
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0065-Net-e1000e-Fix-build-issue-introduced-by-runtime-PM-.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0065-Net-e1000e-Fix-build-issue-introduced-by-runtime-PM-.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,170 @@
+From: "Rafael J. Wysocki" <rjw at sisk.pl>
+Date: Wed, 17 Mar 2010 23:12:24 -0700
+Subject: [PATCH 065/166] Net / e1000e: Fix build issue introduced by runtime
+ PM patch
+
+commit a034016287236f435dbb8f1f57aee906f22b4598 upstream.
+
+The recent PCI runtime PM patch broke build for CONFIG_PM_RUNTIME
+and CONFIG_PM_SLEEP undefined. Fix that by moving the PM callbacks
+under suitable #ifdefs.
+
+Signed-off-by: Rafael J. Wysocki <rjw at sisk.pl>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Adjust for 2.6.32: test CONFIG_PM not CONFIG_PM_OPS]
+---
+ drivers/net/e1000e/netdev.c | 110 +++++++++++++++++++++----------------------
+ 1 files changed, 54 insertions(+), 56 deletions(-)
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 2c337f7..c10c019 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -4695,52 +4695,6 @@ static bool e1000e_pm_ready(struct e1000_adapter *adapter)
+ return !!adapter->tx_ring->buffer_info;
+ }
+
+-static int e1000_idle(struct device *dev)
+-{
+- struct pci_dev *pdev = to_pci_dev(dev);
+- struct net_device *netdev = pci_get_drvdata(pdev);
+- struct e1000_adapter *adapter = netdev_priv(netdev);
+-
+- if (!e1000e_pm_ready(adapter))
+- return 0;
+-
+- if (adapter->idle_check) {
+- adapter->idle_check = false;
+- if (!e1000e_has_link(adapter))
+- pm_schedule_suspend(dev, MSEC_PER_SEC);
+- }
+-
+- return -EBUSY;
+-}
+-
+-static int e1000_suspend(struct device *dev)
+-{
+- struct pci_dev *pdev = to_pci_dev(dev);
+- int retval;
+- bool wake;
+-
+- retval = __e1000_shutdown(pdev, &wake, false);
+- if (!retval)
+- e1000_complete_shutdown(pdev, true, wake);
+-
+- return retval;
+-}
+-
+-static int e1000_runtime_suspend(struct device *dev)
+-{
+- struct pci_dev *pdev = to_pci_dev(dev);
+- struct net_device *netdev = pci_get_drvdata(pdev);
+- struct e1000_adapter *adapter = netdev_priv(netdev);
+-
+- if (e1000e_pm_ready(adapter)) {
+- bool wake;
+-
+- __e1000_shutdown(pdev, &wake, true);
+- }
+-
+- return 0;
+-}
+-
+ static int __e1000_resume(struct pci_dev *pdev)
+ {
+ struct net_device *netdev = pci_get_drvdata(pdev);
+@@ -4812,6 +4766,20 @@ static int __e1000_resume(struct pci_dev *pdev)
+ return 0;
+ }
+
++#ifdef CONFIG_PM_SLEEP
++static int e1000_suspend(struct device *dev)
++{
++ struct pci_dev *pdev = to_pci_dev(dev);
++ int retval;
++ bool wake;
++
++ retval = __e1000_shutdown(pdev, &wake, false);
++ if (!retval)
++ e1000_complete_shutdown(pdev, true, wake);
++
++ return retval;
++}
++
+ static int e1000_resume(struct device *dev)
+ {
+ struct pci_dev *pdev = to_pci_dev(dev);
+@@ -4823,6 +4791,41 @@ static int e1000_resume(struct device *dev)
+
+ return __e1000_resume(pdev);
+ }
++#endif /* CONFIG_PM_SLEEP */
++
++#ifdef CONFIG_PM_RUNTIME
++static int e1000_runtime_suspend(struct device *dev)
++{
++ struct pci_dev *pdev = to_pci_dev(dev);
++ struct net_device *netdev = pci_get_drvdata(pdev);
++ struct e1000_adapter *adapter = netdev_priv(netdev);
++
++ if (e1000e_pm_ready(adapter)) {
++ bool wake;
++
++ __e1000_shutdown(pdev, &wake, true);
++ }
++
++ return 0;
++}
++
++static int e1000_idle(struct device *dev)
++{
++ struct pci_dev *pdev = to_pci_dev(dev);
++ struct net_device *netdev = pci_get_drvdata(pdev);
++ struct e1000_adapter *adapter = netdev_priv(netdev);
++
++ if (!e1000e_pm_ready(adapter))
++ return 0;
++
++ if (adapter->idle_check) {
++ adapter->idle_check = false;
++ if (!e1000e_has_link(adapter))
++ pm_schedule_suspend(dev, MSEC_PER_SEC);
++ }
++
++ return -EBUSY;
++}
+
+ static int e1000_runtime_resume(struct device *dev)
+ {
+@@ -4836,7 +4839,8 @@ static int e1000_runtime_resume(struct device *dev)
+ adapter->idle_check = !dev->power.runtime_auto;
+ return __e1000_resume(pdev);
+ }
+-#endif
++#endif /* CONFIG_PM_RUNTIME */
++#endif /* CONFIG_PM */
+
+ static void e1000_shutdown(struct pci_dev *pdev)
+ {
+@@ -5502,15 +5506,9 @@ MODULE_DEVICE_TABLE(pci, e1000_pci_tbl);
+
+ #ifdef CONFIG_PM
+ static const struct dev_pm_ops e1000_pm_ops = {
+- .suspend = e1000_suspend,
+- .resume = e1000_resume,
+- .freeze = e1000_suspend,
+- .thaw = e1000_resume,
+- .poweroff = e1000_suspend,
+- .restore = e1000_resume,
+- .runtime_suspend = e1000_runtime_suspend,
+- .runtime_resume = e1000_runtime_resume,
+- .runtime_idle = e1000_idle,
++ SET_SYSTEM_SLEEP_PM_OPS(e1000_suspend, e1000_resume)
++ SET_RUNTIME_PM_OPS(e1000_runtime_suspend,
++ e1000_runtime_resume, e1000_idle)
+ };
+ #endif
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0066-e1000e-Disable-run-time-PM-support.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0066-e1000e-Disable-run-time-PM-support.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,47 @@
+From: Ben Hutchings <ben at decadent.org.uk>
+Date: Thu, 19 May 2011 04:36:41 +0100
+Subject: [PATCH 066/166] e1000e: Disable run-time PM support
+
+Run-time PM was not mature in 2.6.32, and there is no way for the
+user to override it. So disable the operations in e1000e to avoid
+the risk of regression.
+---
+ drivers/net/e1000e/netdev.c | 6 ++++--
+ 1 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index c10c019..a4f9292 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -4793,7 +4793,7 @@ static int e1000_resume(struct device *dev)
+ }
+ #endif /* CONFIG_PM_SLEEP */
+
+-#ifdef CONFIG_PM_RUNTIME
++#if 0 /* defined(CONFIG_PM_RUNTIME) */
+ static int e1000_runtime_suspend(struct device *dev)
+ {
+ struct pci_dev *pdev = to_pci_dev(dev);
+@@ -4839,7 +4839,7 @@ static int e1000_runtime_resume(struct device *dev)
+ adapter->idle_check = !dev->power.runtime_auto;
+ return __e1000_resume(pdev);
+ }
+-#endif /* CONFIG_PM_RUNTIME */
++#endif /* 0, was CONFIG_PM_RUNTIME */
+ #endif /* CONFIG_PM */
+
+ static void e1000_shutdown(struct pci_dev *pdev)
+@@ -5507,8 +5507,10 @@ MODULE_DEVICE_TABLE(pci, e1000_pci_tbl);
+ #ifdef CONFIG_PM
+ static const struct dev_pm_ops e1000_pm_ops = {
+ SET_SYSTEM_SLEEP_PM_OPS(e1000_suspend, e1000_resume)
++#if 0
+ SET_RUNTIME_PM_OPS(e1000_runtime_suspend,
+ e1000_runtime_resume, e1000_idle)
++#endif
+ };
+ #endif
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0067-e1000e-do-not-modify-tx_queue_len-on-link-speed-chan.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0067-e1000e-do-not-modify-tx_queue_len-on-link-speed-chan.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,82 @@
+From: Emil Tantilov <emil.s.tantilov at intel.com>
+Date: Wed, 24 Mar 2010 12:55:02 +0000
+Subject: [PATCH 067/166] e1000e: do not modify tx_queue_len on link speed
+ change
+
+commit f49c57e141c7f53353e4265a31dc2324e6215037 upstream.
+
+Previously the driver tweaked txqueuelen to avoid false Tx hang reports seen at half duplex.
+This had the effect of overriding user set values on link change/reset. Testing shows that
+adjusting only the timeout factor is sufficient to prevent Tx hang reports at half duplex.
+
+This patch removes all instances of tx_queue_len in the driver.
+
+Originally reported and patched by Franco Fichtner
+CC: Franco Fichtner <franco at lastsummer.de>
+Signed-off-by: Emil Tantilov <emil.s.tantilov at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/e1000.h | 1 -
+ drivers/net/e1000e/netdev.c | 11 +----------
+ 2 files changed, 1 insertions(+), 11 deletions(-)
+
+diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
+index a99c240..17debaa 100644
+--- a/drivers/net/e1000e/e1000.h
++++ b/drivers/net/e1000e/e1000.h
+@@ -283,7 +283,6 @@ struct e1000_adapter {
+
+ struct napi_struct napi;
+
+- unsigned long tx_queue_len;
+ unsigned int restart_queue;
+ u32 txd_cmd;
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index a4f9292..97a4658 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -2292,8 +2292,6 @@ static void e1000_configure_tx(struct e1000_adapter *adapter)
+ ew32(TCTL, tctl);
+
+ e1000e_config_collision_dist(hw);
+-
+- adapter->tx_queue_len = adapter->netdev->tx_queue_len;
+ }
+
+ /**
+@@ -2880,7 +2878,6 @@ void e1000e_down(struct e1000_adapter *adapter)
+ del_timer_sync(&adapter->watchdog_timer);
+ del_timer_sync(&adapter->phy_info_timer);
+
+- netdev->tx_queue_len = adapter->tx_queue_len;
+ netif_carrier_off(netdev);
+ adapter->link_speed = 0;
+ adapter->link_duplex = 0;
+@@ -3618,21 +3615,15 @@ static void e1000_watchdog_task(struct work_struct *work)
+ "link gets many collisions.\n");
+ }
+
+- /*
+- * tweak tx_queue_len according to speed/duplex
+- * and adjust the timeout factor
+- */
+- netdev->tx_queue_len = adapter->tx_queue_len;
++ /* adjust timeout factor according to speed/duplex */
+ adapter->tx_timeout_factor = 1;
+ switch (adapter->link_speed) {
+ case SPEED_10:
+ txb2b = 0;
+- netdev->tx_queue_len = 10;
+ adapter->tx_timeout_factor = 16;
+ break;
+ case SPEED_100:
+ txb2b = 0;
+- netdev->tx_queue_len = 100;
+ adapter->tx_timeout_factor = 10;
+ break;
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0068-e1000e-Use-pr_-level-and-netdev_-level.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0068-e1000e-Use-pr_-level-and-netdev_-level.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,88 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Wed, 24 Mar 2010 12:55:30 +0000
+Subject: [PATCH 068/166] e1000e: Use pr_<level> and netdev_<level>
+
+commit 8544b9f7371ec6a7a5c0f8701ddde9e98f52a37e upstream.
+
+As an alternative to a quite large patch previously submitted by Joe
+Perches to make use of kernel logging API, this patch is much less
+intrusive.
+
+Convert e_<level> to netdev_<level>
+Use #define pr_fmt
+Convert a few printks to pr_<level>
+
+Cc: Joe Perches <joe at perches.com>
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/e1000.h | 19 +++++--------------
+ drivers/net/e1000e/netdev.c | 9 +++++----
+ 2 files changed, 10 insertions(+), 18 deletions(-)
+
+diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
+index 17debaa..906c4da 100644
+--- a/drivers/net/e1000e/e1000.h
++++ b/drivers/net/e1000e/e1000.h
+@@ -43,25 +43,16 @@
+
+ struct e1000_info;
+
+-#define e_printk(level, adapter, format, arg...) \
+- printk(level "%s: %s: " format, pci_name(adapter->pdev), \
+- adapter->netdev->name, ## arg)
+-
+-#ifdef DEBUG
+ #define e_dbg(format, arg...) \
+- e_printk(KERN_DEBUG , hw->adapter, format, ## arg)
+-#else
+-#define e_dbg(format, arg...) do { (void)(hw); } while (0)
+-#endif
+-
++ netdev_dbg(hw->adapter->netdev, format, ## arg)
+ #define e_err(format, arg...) \
+- e_printk(KERN_ERR, adapter, format, ## arg)
++ netdev_err(adapter->netdev, format, ## arg)
+ #define e_info(format, arg...) \
+- e_printk(KERN_INFO, adapter, format, ## arg)
++ netdev_info(adapter->netdev, format, ## arg)
+ #define e_warn(format, arg...) \
+- e_printk(KERN_WARNING, adapter, format, ## arg)
++ netdev_warn(adapter->netdev, format, ## arg)
+ #define e_notice(format, arg...) \
+- e_printk(KERN_NOTICE, adapter, format, ## arg)
++ netdev_notice(adapter->netdev, format, ## arg)
+
+
+ /* Interrupt modes, as used by the IntMode parameter */
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 97a4658..ee537c8 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -26,6 +26,8 @@
+
+ *******************************************************************************/
+
++#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
++
+ #include <linux/module.h>
+ #include <linux/types.h>
+ #include <linux/init.h>
+@@ -5527,10 +5529,9 @@ static struct pci_driver e1000_driver = {
+ static int __init e1000_init_module(void)
+ {
+ int ret;
+- printk(KERN_INFO "%s: Intel(R) PRO/1000 Network Driver - %s\n",
+- e1000e_driver_name, e1000e_driver_version);
+- printk(KERN_INFO "%s: Copyright (c) 1999 - 2009 Intel Corporation.\n",
+- e1000e_driver_name);
++ pr_info("Intel(R) PRO/1000 Network Driver - %s\n",
++ e1000e_driver_version);
++ pr_info("Copyright (c) 1999 - 2009 Intel Corporation.\n");
+ ret = pci_register_driver(&e1000_driver);
+
+ return ret;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0069-include-cleanup-Update-gfp.h-and-slab.h-includes-to-.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0069-include-cleanup-Update-gfp.h-and-slab.h-includes-to-.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,128 @@
+From: Tejun Heo <tj at kernel.org>
+Date: Wed, 24 Mar 2010 17:04:11 +0900
+Subject: [PATCH 069/166] include cleanup: Update gfp.h and slab.h includes to
+ prepare for breaking implicit slab.h inclusion from
+ percpu.h
+
+commit 5a0e3ad6af8660be21ca98a971cd00f331318c05 upstream.
+
+percpu.h is included by sched.h and module.h and thus ends up being
+included when building most .c files. percpu.h includes slab.h which
+in turn includes gfp.h making everything defined by the two files
+universally available and complicating inclusion dependencies.
+
+percpu.h -> slab.h dependency is about to be removed. Prepare for
+this change by updating users of gfp and slab facilities include those
+headers directly instead of assuming availability. As this conversion
+needs to touch large number of source files, the following script is
+used as the basis of conversion.
+
+ http://userweb.kernel.org/~tj/misc/slabh-sweep.py
+
+The script does the followings.
+
+* Scan files for gfp and slab usages and update includes such that
+ only the necessary includes are there. ie. if only gfp is used,
+ gfp.h, if slab is used, slab.h.
+
+* When the script inserts a new include, it looks at the include
+ blocks and try to put the new include such that its order conforms
+ to its surrounding. It's put in the include block which contains
+ core kernel includes, in the same order that the rest are ordered -
+ alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
+ doesn't seem to be any matching order.
+
+* If the script can't find a place to put a new include (mostly
+ because the file doesn't have fitting include block), it prints out
+ an error message indicating which .h file needs to be added to the
+ file.
+
+The conversion was done in the following steps.
+
+1. The initial automatic conversion of all .c files updated slightly
+ over 4000 files, deleting around 700 includes and adding ~480 gfp.h
+ and ~3000 slab.h inclusions. The script emitted errors for ~400
+ files.
+
+2. Each error was manually checked. Some didn't need the inclusion,
+ some needed manual addition while adding it to implementation .h or
+ embedding .c file was more appropriate for others. This step added
+ inclusions to around 150 files.
+
+3. The script was run again and the output was compared to the edits
+ from #2 to make sure no file was left behind.
+
+4. Several build tests were done and a couple of problems were fixed.
+ e.g. lib/decompress_*.c used malloc/free() wrappers around slab
+ APIs requiring slab.h to be added manually.
+
+5. The script was run on all .h files but without automatically
+ editing them as sprinkling gfp.h and slab.h inclusions around .h
+ files could easily lead to inclusion dependency hell. Most gfp.h
+ inclusion directives were ignored as stuff from gfp.h was usually
+ wildly available and often used in preprocessor macros. Each
+ slab.h inclusion directive was examined and added manually as
+ necessary.
+
+6. percpu.h was updated not to include slab.h.
+
+7. Build test were done on the following configurations and failures
+ were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
+ distributed build env didn't work with gcov compiles) and a few
+ more options had to be turned off depending on archs to make things
+ build (like ipr on powerpc/64 which failed due to missing writeq).
+
+ * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
+ * powerpc and powerpc64 SMP allmodconfig
+ * sparc and sparc64 SMP allmodconfig
+ * ia64 SMP allmodconfig
+ * s390 SMP allmodconfig
+ * alpha SMP allmodconfig
+ * um on x86_64 SMP allmodconfig
+
+8. percpu.h modifications were reverted so that it could be applied as
+ a separate patch and serve as bisection point.
+
+Given the fact that I had only a couple of failures from tests on step
+6, I'm fairly confident about the coverage of this conversion patch.
+If there is a breakage, it's likely to be something in one of the arch
+headers which should be easily discoverable easily on most builds of
+the specific arch.
+
+Signed-off-by: Tejun Heo <tj at kernel.org>
+Guess-its-ok-by: Christoph Lameter <cl at linux-foundation.org>
+Cc: Ingo Molnar <mingo at redhat.com>
+Cc: Lee Schermerhorn <Lee.Schermerhorn at hp.com>
+[bwh: Restricted to drivers/net/e1000e]
+---
+ drivers/net/e1000e/ethtool.c | 1 +
+ drivers/net/e1000e/netdev.c | 1 +
+ 2 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
+index b33e3cb..983493f 100644
+--- a/drivers/net/e1000e/ethtool.c
++++ b/drivers/net/e1000e/ethtool.c
+@@ -31,6 +31,7 @@
+ #include <linux/netdevice.h>
+ #include <linux/ethtool.h>
+ #include <linux/pci.h>
++#include <linux/slab.h>
+ #include <linux/delay.h>
+
+ #include "e1000.h"
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index ee537c8..2fc2d73 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -38,6 +38,7 @@
+ #include <linux/netdevice.h>
+ #include <linux/tcp.h>
+ #include <linux/ipv6.h>
++#include <linux/slab.h>
+ #include <net/checksum.h>
+ #include <net/ip6_checksum.h>
+ #include <linux/mii.h>
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0070-e1000e-typo-corrections.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0070-e1000e-typo-corrections.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,107 @@
+From: Joe Perches <joe at perches.com>
+Date: Fri, 26 Mar 2010 20:16:59 +0000
+Subject: [PATCH 070/166] e1000e: typo corrections
+
+commit 2c73e1fe94b1962ae5df7618519c18526e9d9072 upstream.
+
+Here are the other miscellaneous corrections
+done by an earlier larger suggested patch now
+made unnecessary by a less invasive change.
+
+Correct a few missing newlines from logging
+messages and a typo fix. Fix speed/duplex
+logging message.
+
+Signed-off-by: Joe Perches <joe at perches.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/82571.c | 2 +-
+ drivers/net/e1000e/ich8lan.c | 6 +++---
+ drivers/net/e1000e/lib.c | 21 +++++++++------------
+ 3 files changed, 13 insertions(+), 16 deletions(-)
+
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+index 9015555..17a25e1 100644
+--- a/drivers/net/e1000e/82571.c
++++ b/drivers/net/e1000e/82571.c
+@@ -323,7 +323,7 @@ static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter)
+ }
+
+ /*
+- * Initialze device specific counter of SMBI acquisition
++ * Initialize device specific counter of SMBI acquisition
+ * timeouts.
+ */
+ hw->dev_spec.e82571.smb_counter = 0;
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index a626012..d619cf5 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -1632,7 +1632,7 @@ static s32 e1000_flash_cycle_init_ich8lan(struct e1000_hw *hw)
+ /* Check if the flash descriptor is valid */
+ if (hsfsts.hsf_status.fldesvalid == 0) {
+ e_dbg("Flash descriptor invalid. "
+- "SW Sequencing must be used.");
++ "SW Sequencing must be used.\n");
+ return -E1000_ERR_NVM;
+ }
+
+@@ -1681,7 +1681,7 @@ static s32 e1000_flash_cycle_init_ich8lan(struct e1000_hw *hw)
+ hsfsts.hsf_status.flcdone = 1;
+ ew16flash(ICH_FLASH_HSFSTS, hsfsts.regval);
+ } else {
+- e_dbg("Flash controller busy, cannot get access");
++ e_dbg("Flash controller busy, cannot get access\n");
+ }
+ }
+
+@@ -1832,7 +1832,7 @@ static s32 e1000_read_flash_data_ich8lan(struct e1000_hw *hw, u32 offset,
+ continue;
+ } else if (hsfsts.hsf_status.flcdone == 0) {
+ e_dbg("Timeout error - flash cycle "
+- "did not complete.");
++ "did not complete.\n");
+ break;
+ }
+ }
+diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c
+index a8b2c0d..b0d2a60 100644
+--- a/drivers/net/e1000e/lib.c
++++ b/drivers/net/e1000e/lib.c
+@@ -1262,24 +1262,21 @@ s32 e1000e_get_speed_and_duplex_copper(struct e1000_hw *hw, u16 *speed, u16 *dup
+ u32 status;
+
+ status = er32(STATUS);
+- if (status & E1000_STATUS_SPEED_1000) {
++ if (status & E1000_STATUS_SPEED_1000)
+ *speed = SPEED_1000;
+- e_dbg("1000 Mbs, ");
+- } else if (status & E1000_STATUS_SPEED_100) {
++ else if (status & E1000_STATUS_SPEED_100)
+ *speed = SPEED_100;
+- e_dbg("100 Mbs, ");
+- } else {
++ else
+ *speed = SPEED_10;
+- e_dbg("10 Mbs, ");
+- }
+
+- if (status & E1000_STATUS_FD) {
++ if (status & E1000_STATUS_FD)
+ *duplex = FULL_DUPLEX;
+- e_dbg("Full Duplex\n");
+- } else {
++ else
+ *duplex = HALF_DUPLEX;
+- e_dbg("Half Duplex\n");
+- }
++
++ e_dbg("%u Mbps, %s Duplex\n",
++ *speed == SPEED_1000 ? 1000 : *speed == SPEED_100 ? 100 : 10,
++ *duplex == FULL_DUPLEX ? "Full" : "Half");
+
+ return 0;
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0071-e1000e-use-static-params-to-save-stack-space.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0071-e1000e-use-static-params-to-save-stack-space.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,101 @@
+From: Jesse Brandeburg <jesse.brandeburg at intel.com>
+Date: Fri, 9 Apr 2010 10:51:09 +0000
+Subject: [PATCH 071/166] e1000e: use static params to save stack space
+
+commit 6f59d6604d9361ef53a7721fb8aa1687ad6f8448 upstream.
+
+used a modified checkstack to get the 56 number
+(normally checkstack wouldn't show this low a value)
+
+checkstack before:
+0x0000012f e1000e_check_options [e1000e]: 272
+
+after:
+0x0000012f e1000e_check_options [e1000e]: 56
+
+Signed-off-by: Jesse Brandeburg <jesse.brandeburg at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/param.c | 16 ++++++++--------
+ 1 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/net/e1000e/param.c b/drivers/net/e1000e/param.c
+index 2e39977..f775a48 100644
+--- a/drivers/net/e1000e/param.c
++++ b/drivers/net/e1000e/param.c
+@@ -248,7 +248,7 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
+ }
+
+ { /* Transmit Interrupt Delay */
+- const struct e1000_option opt = {
++ static const struct e1000_option opt = {
+ .type = range_option,
+ .name = "Transmit Interrupt Delay",
+ .err = "using default of "
+@@ -267,7 +267,7 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
+ }
+ }
+ { /* Transmit Absolute Interrupt Delay */
+- const struct e1000_option opt = {
++ static const struct e1000_option opt = {
+ .type = range_option,
+ .name = "Transmit Absolute Interrupt Delay",
+ .err = "using default of "
+@@ -305,7 +305,7 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
+ }
+ }
+ { /* Receive Absolute Interrupt Delay */
+- const struct e1000_option opt = {
++ static const struct e1000_option opt = {
+ .type = range_option,
+ .name = "Receive Absolute Interrupt Delay",
+ .err = "using default of "
+@@ -324,7 +324,7 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
+ }
+ }
+ { /* Interrupt Throttling Rate */
+- const struct e1000_option opt = {
++ static const struct e1000_option opt = {
+ .type = range_option,
+ .name = "Interrupt Throttling Rate (ints/sec)",
+ .err = "using default of "
+@@ -399,7 +399,7 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
+ }
+ }
+ { /* Smart Power Down */
+- const struct e1000_option opt = {
++ static const struct e1000_option opt = {
+ .type = enable_option,
+ .name = "PHY Smart Power Down",
+ .err = "defaulting to Disabled",
+@@ -415,7 +415,7 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
+ }
+ }
+ { /* CRC Stripping */
+- const struct e1000_option opt = {
++ static const struct e1000_option opt = {
+ .type = enable_option,
+ .name = "CRC Stripping",
+ .err = "defaulting to enabled",
+@@ -432,7 +432,7 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
+ }
+ }
+ { /* Kumeran Lock Loss Workaround */
+- const struct e1000_option opt = {
++ static const struct e1000_option opt = {
+ .type = enable_option,
+ .name = "Kumeran Lock Loss Workaround",
+ .err = "defaulting to Enabled",
+@@ -452,7 +452,7 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
+ }
+ }
+ { /* Write-protect NVM */
+- const struct e1000_option opt = {
++ static const struct e1000_option opt = {
+ .type = enable_option,
+ .name = "Write-protect NVM",
+ .err = "defaulting to Enabled",
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0072-drivers-net-use-skb_headlen.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0072-drivers-net-use-skb_headlen.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,40 @@
+From: Eric Dumazet <eric.dumazet at gmail.com>
+Date: Wed, 14 Apr 2010 15:59:40 -0700
+Subject: [PATCH 072/166] drivers: net: use skb_headlen()
+
+commit e743d31312d00932391b123dfac3324d2b9e8c81 upstream.
+
+replaces (skb->len - skb->data_len) occurrences by skb_headlen(skb)
+
+Signed-off-by: Eric Dumazet <eric.dumazet at gmail.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Restricted to drivers/net/e1000e]
+---
+ drivers/net/e1000e/netdev.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 2fc2d73..780081b 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -4138,7 +4138,7 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb,
+ unsigned int max_per_txd = E1000_MAX_PER_TXD;
+ unsigned int max_txd_pwr = E1000_MAX_TXD_PWR;
+ unsigned int tx_flags = 0;
+- unsigned int len = skb->len - skb->data_len;
++ unsigned int len = skb_headlen(skb);
+ unsigned int nr_frags;
+ unsigned int mss;
+ int count = 0;
+@@ -4188,7 +4188,7 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb,
+ dev_kfree_skb_any(skb);
+ return NETDEV_TX_OK;
+ }
+- len = skb->len - skb->data_len;
++ len = skb_headlen(skb);
+ }
+ }
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0073-e1000e-use-DMA-API-instead-of-PCI-DMA-functions.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0073-e1000e-use-DMA-API-instead-of-PCI-DMA-functions.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,331 @@
+From: Nick Nunley <nicholasx.d.nunley at intel.com>
+Date: Tue, 27 Apr 2010 13:09:05 +0000
+Subject: [PATCH 073/166] e1000e: use DMA API instead of PCI DMA functions
+
+commit 0be3f55f8aa5f9d1882255128bd79d4885b0cbe4 upstream.
+
+Signed-off-by: Nicholas Nunley <nicholasx.d.nunley at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/ethtool.c | 30 +++++++------
+ drivers/net/e1000e/netdev.c | 99 +++++++++++++++++++++---------------------
+ 2 files changed, 66 insertions(+), 63 deletions(-)
+
+diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
+index 983493f..7f9915c 100644
+--- a/drivers/net/e1000e/ethtool.c
++++ b/drivers/net/e1000e/ethtool.c
+@@ -1069,10 +1069,10 @@ static void e1000_free_desc_rings(struct e1000_adapter *adapter)
+ if (tx_ring->desc && tx_ring->buffer_info) {
+ for (i = 0; i < tx_ring->count; i++) {
+ if (tx_ring->buffer_info[i].dma)
+- pci_unmap_single(pdev,
++ dma_unmap_single(&pdev->dev,
+ tx_ring->buffer_info[i].dma,
+ tx_ring->buffer_info[i].length,
+- PCI_DMA_TODEVICE);
++ DMA_TO_DEVICE);
+ if (tx_ring->buffer_info[i].skb)
+ dev_kfree_skb(tx_ring->buffer_info[i].skb);
+ }
+@@ -1081,9 +1081,9 @@ static void e1000_free_desc_rings(struct e1000_adapter *adapter)
+ if (rx_ring->desc && rx_ring->buffer_info) {
+ for (i = 0; i < rx_ring->count; i++) {
+ if (rx_ring->buffer_info[i].dma)
+- pci_unmap_single(pdev,
++ dma_unmap_single(&pdev->dev,
+ rx_ring->buffer_info[i].dma,
+- 2048, PCI_DMA_FROMDEVICE);
++ 2048, DMA_FROM_DEVICE);
+ if (rx_ring->buffer_info[i].skb)
+ dev_kfree_skb(rx_ring->buffer_info[i].skb);
+ }
+@@ -1163,9 +1163,10 @@ static int e1000_setup_desc_rings(struct e1000_adapter *adapter)
+ tx_ring->buffer_info[i].skb = skb;
+ tx_ring->buffer_info[i].length = skb->len;
+ tx_ring->buffer_info[i].dma =
+- pci_map_single(pdev, skb->data, skb->len,
+- PCI_DMA_TODEVICE);
+- if (pci_dma_mapping_error(pdev, tx_ring->buffer_info[i].dma)) {
++ dma_map_single(&pdev->dev, skb->data, skb->len,
++ DMA_TO_DEVICE);
++ if (dma_mapping_error(&pdev->dev,
++ tx_ring->buffer_info[i].dma)) {
+ ret_val = 4;
+ goto err_nomem;
+ }
+@@ -1226,9 +1227,10 @@ static int e1000_setup_desc_rings(struct e1000_adapter *adapter)
+ skb_reserve(skb, NET_IP_ALIGN);
+ rx_ring->buffer_info[i].skb = skb;
+ rx_ring->buffer_info[i].dma =
+- pci_map_single(pdev, skb->data, 2048,
+- PCI_DMA_FROMDEVICE);
+- if (pci_dma_mapping_error(pdev, rx_ring->buffer_info[i].dma)) {
++ dma_map_single(&pdev->dev, skb->data, 2048,
++ DMA_FROM_DEVICE);
++ if (dma_mapping_error(&pdev->dev,
++ rx_ring->buffer_info[i].dma)) {
+ ret_val = 8;
+ goto err_nomem;
+ }
+@@ -1556,10 +1558,10 @@ static int e1000_run_loopback_test(struct e1000_adapter *adapter)
+ for (i = 0; i < 64; i++) { /* send the packets */
+ e1000_create_lbtest_frame(tx_ring->buffer_info[k].skb,
+ 1024);
+- pci_dma_sync_single_for_device(pdev,
++ dma_sync_single_for_device(&pdev->dev,
+ tx_ring->buffer_info[k].dma,
+ tx_ring->buffer_info[k].length,
+- PCI_DMA_TODEVICE);
++ DMA_TO_DEVICE);
+ k++;
+ if (k == tx_ring->count)
+ k = 0;
+@@ -1569,9 +1571,9 @@ static int e1000_run_loopback_test(struct e1000_adapter *adapter)
+ time = jiffies; /* set the start time for the receive */
+ good_cnt = 0;
+ do { /* receive the sent packets */
+- pci_dma_sync_single_for_cpu(pdev,
++ dma_sync_single_for_cpu(&pdev->dev,
+ rx_ring->buffer_info[l].dma, 2048,
+- PCI_DMA_FROMDEVICE);
++ DMA_FROM_DEVICE);
+
+ ret_val = e1000_check_lbtest_frame(
+ rx_ring->buffer_info[l].skb, 1024);
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 780081b..ef1e49f 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -181,10 +181,10 @@ static void e1000_alloc_rx_buffers(struct e1000_adapter *adapter,
+
+ buffer_info->skb = skb;
+ map_skb:
+- buffer_info->dma = pci_map_single(pdev, skb->data,
++ buffer_info->dma = dma_map_single(&pdev->dev, skb->data,
+ adapter->rx_buffer_len,
+- PCI_DMA_FROMDEVICE);
+- if (pci_dma_mapping_error(pdev, buffer_info->dma)) {
++ DMA_FROM_DEVICE);
++ if (dma_mapping_error(&pdev->dev, buffer_info->dma)) {
+ dev_err(&pdev->dev, "RX DMA map failed\n");
+ adapter->rx_dma_failed++;
+ break;
+@@ -250,11 +250,12 @@ static void e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter,
+ adapter->alloc_rx_buff_failed++;
+ goto no_buffers;
+ }
+- ps_page->dma = pci_map_page(pdev,
+- ps_page->page,
+- 0, PAGE_SIZE,
+- PCI_DMA_FROMDEVICE);
+- if (pci_dma_mapping_error(pdev, ps_page->dma)) {
++ ps_page->dma = dma_map_page(&pdev->dev,
++ ps_page->page,
++ 0, PAGE_SIZE,
++ DMA_FROM_DEVICE);
++ if (dma_mapping_error(&pdev->dev,
++ ps_page->dma)) {
+ dev_err(&adapter->pdev->dev,
+ "RX DMA page map failed\n");
+ adapter->rx_dma_failed++;
+@@ -279,10 +280,10 @@ static void e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter,
+ }
+
+ buffer_info->skb = skb;
+- buffer_info->dma = pci_map_single(pdev, skb->data,
++ buffer_info->dma = dma_map_single(&pdev->dev, skb->data,
+ adapter->rx_ps_bsize0,
+- PCI_DMA_FROMDEVICE);
+- if (pci_dma_mapping_error(pdev, buffer_info->dma)) {
++ DMA_FROM_DEVICE);
++ if (dma_mapping_error(&pdev->dev, buffer_info->dma)) {
+ dev_err(&pdev->dev, "RX DMA map failed\n");
+ adapter->rx_dma_failed++;
+ /* cleanup skb */
+@@ -369,10 +370,10 @@ check_page:
+ }
+
+ if (!buffer_info->dma)
+- buffer_info->dma = pci_map_page(pdev,
++ buffer_info->dma = dma_map_page(&pdev->dev,
+ buffer_info->page, 0,
+ PAGE_SIZE,
+- PCI_DMA_FROMDEVICE);
++ DMA_FROM_DEVICE);
+
+ rx_desc = E1000_RX_DESC(*rx_ring, i);
+ rx_desc->buffer_addr = cpu_to_le64(buffer_info->dma);
+@@ -446,10 +447,10 @@ static bool e1000_clean_rx_irq(struct e1000_adapter *adapter,
+
+ cleaned = 1;
+ cleaned_count++;
+- pci_unmap_single(pdev,
++ dma_unmap_single(&pdev->dev,
+ buffer_info->dma,
+ adapter->rx_buffer_len,
+- PCI_DMA_FROMDEVICE);
++ DMA_FROM_DEVICE);
+ buffer_info->dma = 0;
+
+ length = le16_to_cpu(rx_desc->length);
+@@ -550,12 +551,11 @@ static void e1000_put_txbuf(struct e1000_adapter *adapter,
+ {
+ if (buffer_info->dma) {
+ if (buffer_info->mapped_as_page)
+- pci_unmap_page(adapter->pdev, buffer_info->dma,
+- buffer_info->length, PCI_DMA_TODEVICE);
++ dma_unmap_page(&adapter->pdev->dev, buffer_info->dma,
++ buffer_info->length, DMA_TO_DEVICE);
+ else
+- pci_unmap_single(adapter->pdev, buffer_info->dma,
+- buffer_info->length,
+- PCI_DMA_TODEVICE);
++ dma_unmap_single(&adapter->pdev->dev, buffer_info->dma,
++ buffer_info->length, DMA_TO_DEVICE);
+ buffer_info->dma = 0;
+ }
+ if (buffer_info->skb) {
+@@ -756,9 +756,9 @@ static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
+
+ cleaned = 1;
+ cleaned_count++;
+- pci_unmap_single(pdev, buffer_info->dma,
++ dma_unmap_single(&pdev->dev, buffer_info->dma,
+ adapter->rx_ps_bsize0,
+- PCI_DMA_FROMDEVICE);
++ DMA_FROM_DEVICE);
+ buffer_info->dma = 0;
+
+ /* see !EOP comment in other rx routine */
+@@ -814,13 +814,13 @@ static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
+ * kmap_atomic, so we can't hold the mapping
+ * very long
+ */
+- pci_dma_sync_single_for_cpu(pdev, ps_page->dma,
+- PAGE_SIZE, PCI_DMA_FROMDEVICE);
++ dma_sync_single_for_cpu(&pdev->dev, ps_page->dma,
++ PAGE_SIZE, DMA_FROM_DEVICE);
+ vaddr = kmap_atomic(ps_page->page, KM_SKB_DATA_SOFTIRQ);
+ memcpy(skb_tail_pointer(skb), vaddr, l1);
+ kunmap_atomic(vaddr, KM_SKB_DATA_SOFTIRQ);
+- pci_dma_sync_single_for_device(pdev, ps_page->dma,
+- PAGE_SIZE, PCI_DMA_FROMDEVICE);
++ dma_sync_single_for_device(&pdev->dev, ps_page->dma,
++ PAGE_SIZE, DMA_FROM_DEVICE);
+
+ /* remove the CRC */
+ if (!(adapter->flags2 & FLAG2_CRC_STRIPPING))
+@@ -837,8 +837,8 @@ static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
+ break;
+
+ ps_page = &buffer_info->ps_pages[j];
+- pci_unmap_page(pdev, ps_page->dma, PAGE_SIZE,
+- PCI_DMA_FROMDEVICE);
++ dma_unmap_page(&pdev->dev, ps_page->dma, PAGE_SIZE,
++ DMA_FROM_DEVICE);
+ ps_page->dma = 0;
+ skb_fill_page_desc(skb, j, ps_page->page, 0, length);
+ ps_page->page = NULL;
+@@ -956,8 +956,8 @@ static bool e1000_clean_jumbo_rx_irq(struct e1000_adapter *adapter,
+
+ cleaned = true;
+ cleaned_count++;
+- pci_unmap_page(pdev, buffer_info->dma, PAGE_SIZE,
+- PCI_DMA_FROMDEVICE);
++ dma_unmap_page(&pdev->dev, buffer_info->dma, PAGE_SIZE,
++ DMA_FROM_DEVICE);
+ buffer_info->dma = 0;
+
+ length = le16_to_cpu(rx_desc->length);
+@@ -1093,17 +1093,17 @@ static void e1000_clean_rx_ring(struct e1000_adapter *adapter)
+ buffer_info = &rx_ring->buffer_info[i];
+ if (buffer_info->dma) {
+ if (adapter->clean_rx == e1000_clean_rx_irq)
+- pci_unmap_single(pdev, buffer_info->dma,
++ dma_unmap_single(&pdev->dev, buffer_info->dma,
+ adapter->rx_buffer_len,
+- PCI_DMA_FROMDEVICE);
++ DMA_FROM_DEVICE);
+ else if (adapter->clean_rx == e1000_clean_jumbo_rx_irq)
+- pci_unmap_page(pdev, buffer_info->dma,
++ dma_unmap_page(&pdev->dev, buffer_info->dma,
+ PAGE_SIZE,
+- PCI_DMA_FROMDEVICE);
++ DMA_FROM_DEVICE);
+ else if (adapter->clean_rx == e1000_clean_rx_irq_ps)
+- pci_unmap_single(pdev, buffer_info->dma,
++ dma_unmap_single(&pdev->dev, buffer_info->dma,
+ adapter->rx_ps_bsize0,
+- PCI_DMA_FROMDEVICE);
++ DMA_FROM_DEVICE);
+ buffer_info->dma = 0;
+ }
+
+@@ -1121,8 +1121,8 @@ static void e1000_clean_rx_ring(struct e1000_adapter *adapter)
+ ps_page = &buffer_info->ps_pages[j];
+ if (!ps_page->page)
+ break;
+- pci_unmap_page(pdev, ps_page->dma, PAGE_SIZE,
+- PCI_DMA_FROMDEVICE);
++ dma_unmap_page(&pdev->dev, ps_page->dma, PAGE_SIZE,
++ DMA_FROM_DEVICE);
+ ps_page->dma = 0;
+ put_page(ps_page->page);
+ ps_page->page = NULL;
+@@ -3923,10 +3923,11 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
+ buffer_info->length = size;
+ buffer_info->time_stamp = jiffies;
+ buffer_info->next_to_watch = i;
+- buffer_info->dma = pci_map_single(pdev, skb->data + offset,
+- size, PCI_DMA_TODEVICE);
++ buffer_info->dma = dma_map_single(&pdev->dev,
++ skb->data + offset,
++ size, DMA_TO_DEVICE);
+ buffer_info->mapped_as_page = false;
+- if (pci_dma_mapping_error(pdev, buffer_info->dma))
++ if (dma_mapping_error(&pdev->dev, buffer_info->dma))
+ goto dma_error;
+
+ len -= size;
+@@ -3958,11 +3959,11 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
+ buffer_info->length = size;
+ buffer_info->time_stamp = jiffies;
+ buffer_info->next_to_watch = i;
+- buffer_info->dma = pci_map_page(pdev, frag->page,
++ buffer_info->dma = dma_map_page(&pdev->dev, frag->page,
+ offset, size,
+- PCI_DMA_TODEVICE);
++ DMA_TO_DEVICE);
+ buffer_info->mapped_as_page = true;
+- if (pci_dma_mapping_error(pdev, buffer_info->dma))
++ if (dma_mapping_error(&pdev->dev, buffer_info->dma))
+ goto dma_error;
+
+ len -= size;
+@@ -5056,16 +5057,16 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
+ return err;
+
+ pci_using_dac = 0;
+- err = pci_set_dma_mask(pdev, DMA_BIT_MASK(64));
++ err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(64));
+ if (!err) {
+- err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
++ err = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64));
+ if (!err)
+ pci_using_dac = 1;
+ } else {
+- err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
++ err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
+ if (err) {
+- err = pci_set_consistent_dma_mask(pdev,
+- DMA_BIT_MASK(32));
++ err = dma_set_coherent_mask(&pdev->dev,
++ DMA_BIT_MASK(32));
+ if (err) {
+ dev_err(&pdev->dev, "No usable DMA "
+ "configuration, aborting\n");
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0074-e1000e-add-registers-etc.-printout-code-just-before-.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0074-e1000e-add-registers-etc.-printout-code-just-before-.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,397 @@
+From: Taku Izumi <izumi.taku at jp.fujitsu.com>
+Date: Tue, 27 Apr 2010 14:39:08 +0000
+Subject: [PATCH 074/166] e1000e: add registers etc. printout code just before
+ resetting adapters
+
+commit 84f4ee902ad3ee964b7b3a13d5b7cf9c086e9916 upstream.
+
+This patch adds registers (,tx/rx rings' status and so on) printout
+code just before resetting adapters. This will be helpful for detecting
+the root cause of adapters reset.
+
+Signed-off-by: Taku Izumi <izumi.taku at jp.fujitsu.com>
+Signed-off-by: Koki Sanagi <sanagi.koki at jp.fujitsu.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/netdev.c | 357 +++++++++++++++++++++++++++++++++++++++++++
+ 1 files changed, 357 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index ef1e49f..e485a7d 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -69,6 +69,361 @@ static const struct e1000_info *e1000_info_tbl[] = {
+ [board_pchlan] = &e1000_pch_info,
+ };
+
++struct e1000_reg_info {
++ u32 ofs;
++ char *name;
++};
++
++#define E1000_RDFH 0x02410 /* Rx Data FIFO Head - RW */
++#define E1000_RDFT 0x02418 /* Rx Data FIFO Tail - RW */
++#define E1000_RDFHS 0x02420 /* Rx Data FIFO Head Saved - RW */
++#define E1000_RDFTS 0x02428 /* Rx Data FIFO Tail Saved - RW */
++#define E1000_RDFPC 0x02430 /* Rx Data FIFO Packet Count - RW */
++
++#define E1000_TDFH 0x03410 /* Tx Data FIFO Head - RW */
++#define E1000_TDFT 0x03418 /* Tx Data FIFO Tail - RW */
++#define E1000_TDFHS 0x03420 /* Tx Data FIFO Head Saved - RW */
++#define E1000_TDFTS 0x03428 /* Tx Data FIFO Tail Saved - RW */
++#define E1000_TDFPC 0x03430 /* Tx Data FIFO Packet Count - RW */
++
++static const struct e1000_reg_info e1000_reg_info_tbl[] = {
++
++ /* General Registers */
++ {E1000_CTRL, "CTRL"},
++ {E1000_STATUS, "STATUS"},
++ {E1000_CTRL_EXT, "CTRL_EXT"},
++
++ /* Interrupt Registers */
++ {E1000_ICR, "ICR"},
++
++ /* RX Registers */
++ {E1000_RCTL, "RCTL"},
++ {E1000_RDLEN, "RDLEN"},
++ {E1000_RDH, "RDH"},
++ {E1000_RDT, "RDT"},
++ {E1000_RDTR, "RDTR"},
++ {E1000_RXDCTL(0), "RXDCTL"},
++ {E1000_ERT, "ERT"},
++ {E1000_RDBAL, "RDBAL"},
++ {E1000_RDBAH, "RDBAH"},
++ {E1000_RDFH, "RDFH"},
++ {E1000_RDFT, "RDFT"},
++ {E1000_RDFHS, "RDFHS"},
++ {E1000_RDFTS, "RDFTS"},
++ {E1000_RDFPC, "RDFPC"},
++
++ /* TX Registers */
++ {E1000_TCTL, "TCTL"},
++ {E1000_TDBAL, "TDBAL"},
++ {E1000_TDBAH, "TDBAH"},
++ {E1000_TDLEN, "TDLEN"},
++ {E1000_TDH, "TDH"},
++ {E1000_TDT, "TDT"},
++ {E1000_TIDV, "TIDV"},
++ {E1000_TXDCTL(0), "TXDCTL"},
++ {E1000_TADV, "TADV"},
++ {E1000_TARC(0), "TARC"},
++ {E1000_TDFH, "TDFH"},
++ {E1000_TDFT, "TDFT"},
++ {E1000_TDFHS, "TDFHS"},
++ {E1000_TDFTS, "TDFTS"},
++ {E1000_TDFPC, "TDFPC"},
++
++ /* List Terminator */
++ {}
++};
++
++/*
++ * e1000_regdump - register printout routine
++ */
++static void e1000_regdump(struct e1000_hw *hw, struct e1000_reg_info *reginfo)
++{
++ int n = 0;
++ char rname[16];
++ u32 regs[8];
++
++ switch (reginfo->ofs) {
++ case E1000_RXDCTL(0):
++ for (n = 0; n < 2; n++)
++ regs[n] = __er32(hw, E1000_RXDCTL(n));
++ break;
++ case E1000_TXDCTL(0):
++ for (n = 0; n < 2; n++)
++ regs[n] = __er32(hw, E1000_TXDCTL(n));
++ break;
++ case E1000_TARC(0):
++ for (n = 0; n < 2; n++)
++ regs[n] = __er32(hw, E1000_TARC(n));
++ break;
++ default:
++ printk(KERN_INFO "%-15s %08x\n",
++ reginfo->name, __er32(hw, reginfo->ofs));
++ return;
++ }
++
++ snprintf(rname, 16, "%s%s", reginfo->name, "[0-1]");
++ printk(KERN_INFO "%-15s ", rname);
++ for (n = 0; n < 2; n++)
++ printk(KERN_CONT "%08x ", regs[n]);
++ printk(KERN_CONT "\n");
++}
++
++
++/*
++ * e1000e_dump - Print registers, tx-ring and rx-ring
++ */
++static void e1000e_dump(struct e1000_adapter *adapter)
++{
++ struct net_device *netdev = adapter->netdev;
++ struct e1000_hw *hw = &adapter->hw;
++ struct e1000_reg_info *reginfo;
++ struct e1000_ring *tx_ring = adapter->tx_ring;
++ struct e1000_tx_desc *tx_desc;
++ struct my_u0 { u64 a; u64 b; } *u0;
++ struct e1000_buffer *buffer_info;
++ struct e1000_ring *rx_ring = adapter->rx_ring;
++ union e1000_rx_desc_packet_split *rx_desc_ps;
++ struct e1000_rx_desc *rx_desc;
++ struct my_u1 { u64 a; u64 b; u64 c; u64 d; } *u1;
++ u32 staterr;
++ int i = 0;
++
++ if (!netif_msg_hw(adapter))
++ return;
++
++ /* Print netdevice Info */
++ if (netdev) {
++ dev_info(&adapter->pdev->dev, "Net device Info\n");
++ printk(KERN_INFO "Device Name state "
++ "trans_start last_rx\n");
++ printk(KERN_INFO "%-15s %016lX %016lX %016lX\n",
++ netdev->name,
++ netdev->state,
++ netdev->trans_start,
++ netdev->last_rx);
++ }
++
++ /* Print Registers */
++ dev_info(&adapter->pdev->dev, "Register Dump\n");
++ printk(KERN_INFO " Register Name Value\n");
++ for (reginfo = (struct e1000_reg_info *)e1000_reg_info_tbl;
++ reginfo->name; reginfo++) {
++ e1000_regdump(hw, reginfo);
++ }
++
++ /* Print TX Ring Summary */
++ if (!netdev || !netif_running(netdev))
++ goto exit;
++
++ dev_info(&adapter->pdev->dev, "TX Rings Summary\n");
++ printk(KERN_INFO "Queue [NTU] [NTC] [bi(ntc)->dma ]"
++ " leng ntw timestamp\n");
++ buffer_info = &tx_ring->buffer_info[tx_ring->next_to_clean];
++ printk(KERN_INFO " %5d %5X %5X %016llX %04X %3X %016llX\n",
++ 0, tx_ring->next_to_use, tx_ring->next_to_clean,
++ (u64)buffer_info->dma,
++ buffer_info->length,
++ buffer_info->next_to_watch,
++ (u64)buffer_info->time_stamp);
++
++ /* Print TX Rings */
++ if (!netif_msg_tx_done(adapter))
++ goto rx_ring_summary;
++
++ dev_info(&adapter->pdev->dev, "TX Rings Dump\n");
++
++ /* Transmit Descriptor Formats - DEXT[29] is 0 (Legacy) or 1 (Extended)
++ *
++ * Legacy Transmit Descriptor
++ * +--------------------------------------------------------------+
++ * 0 | Buffer Address [63:0] (Reserved on Write Back) |
++ * +--------------------------------------------------------------+
++ * 8 | Special | CSS | Status | CMD | CSO | Length |
++ * +--------------------------------------------------------------+
++ * 63 48 47 36 35 32 31 24 23 16 15 0
++ *
++ * Extended Context Descriptor (DTYP=0x0) for TSO or checksum offload
++ * 63 48 47 40 39 32 31 16 15 8 7 0
++ * +----------------------------------------------------------------+
++ * 0 | TUCSE | TUCS0 | TUCSS | IPCSE | IPCS0 | IPCSS |
++ * +----------------------------------------------------------------+
++ * 8 | MSS | HDRLEN | RSV | STA | TUCMD | DTYP | PAYLEN |
++ * +----------------------------------------------------------------+
++ * 63 48 47 40 39 36 35 32 31 24 23 20 19 0
++ *
++ * Extended Data Descriptor (DTYP=0x1)
++ * +----------------------------------------------------------------+
++ * 0 | Buffer Address [63:0] |
++ * +----------------------------------------------------------------+
++ * 8 | VLAN tag | POPTS | Rsvd | Status | Command | DTYP | DTALEN |
++ * +----------------------------------------------------------------+
++ * 63 48 47 40 39 36 35 32 31 24 23 20 19 0
++ */
++ printk(KERN_INFO "Tl[desc] [address 63:0 ] [SpeCssSCmCsLen]"
++ " [bi->dma ] leng ntw timestamp bi->skb "
++ "<-- Legacy format\n");
++ printk(KERN_INFO "Tc[desc] [Ce CoCsIpceCoS] [MssHlRSCm0Plen]"
++ " [bi->dma ] leng ntw timestamp bi->skb "
++ "<-- Ext Context format\n");
++ printk(KERN_INFO "Td[desc] [address 63:0 ] [VlaPoRSCm1Dlen]"
++ " [bi->dma ] leng ntw timestamp bi->skb "
++ "<-- Ext Data format\n");
++ for (i = 0; tx_ring->desc && (i < tx_ring->count); i++) {
++ tx_desc = E1000_TX_DESC(*tx_ring, i);
++ buffer_info = &tx_ring->buffer_info[i];
++ u0 = (struct my_u0 *)tx_desc;
++ printk(KERN_INFO "T%c[0x%03X] %016llX %016llX %016llX "
++ "%04X %3X %016llX %p",
++ (!(le64_to_cpu(u0->b) & (1<<29)) ? 'l' :
++ ((le64_to_cpu(u0->b) & (1<<20)) ? 'd' : 'c')), i,
++ le64_to_cpu(u0->a), le64_to_cpu(u0->b),
++ (u64)buffer_info->dma, buffer_info->length,
++ buffer_info->next_to_watch, (u64)buffer_info->time_stamp,
++ buffer_info->skb);
++ if (i == tx_ring->next_to_use && i == tx_ring->next_to_clean)
++ printk(KERN_CONT " NTC/U\n");
++ else if (i == tx_ring->next_to_use)
++ printk(KERN_CONT " NTU\n");
++ else if (i == tx_ring->next_to_clean)
++ printk(KERN_CONT " NTC\n");
++ else
++ printk(KERN_CONT "\n");
++
++ if (netif_msg_pktdata(adapter) && buffer_info->dma != 0)
++ print_hex_dump(KERN_INFO, "", DUMP_PREFIX_ADDRESS,
++ 16, 1, phys_to_virt(buffer_info->dma),
++ buffer_info->length, true);
++ }
++
++ /* Print RX Rings Summary */
++rx_ring_summary:
++ dev_info(&adapter->pdev->dev, "RX Rings Summary\n");
++ printk(KERN_INFO "Queue [NTU] [NTC]\n");
++ printk(KERN_INFO " %5d %5X %5X\n", 0,
++ rx_ring->next_to_use, rx_ring->next_to_clean);
++
++ /* Print RX Rings */
++ if (!netif_msg_rx_status(adapter))
++ goto exit;
++
++ dev_info(&adapter->pdev->dev, "RX Rings Dump\n");
++ switch (adapter->rx_ps_pages) {
++ case 1:
++ case 2:
++ case 3:
++ /* [Extended] Packet Split Receive Descriptor Format
++ *
++ * +-----------------------------------------------------+
++ * 0 | Buffer Address 0 [63:0] |
++ * +-----------------------------------------------------+
++ * 8 | Buffer Address 1 [63:0] |
++ * +-----------------------------------------------------+
++ * 16 | Buffer Address 2 [63:0] |
++ * +-----------------------------------------------------+
++ * 24 | Buffer Address 3 [63:0] |
++ * +-----------------------------------------------------+
++ */
++ printk(KERN_INFO "R [desc] [buffer 0 63:0 ] "
++ "[buffer 1 63:0 ] "
++ "[buffer 2 63:0 ] [buffer 3 63:0 ] [bi->dma ] "
++ "[bi->skb] <-- Ext Pkt Split format\n");
++ /* [Extended] Receive Descriptor (Write-Back) Format
++ *
++ * 63 48 47 32 31 13 12 8 7 4 3 0
++ * +------------------------------------------------------+
++ * 0 | Packet | IP | Rsvd | MRQ | Rsvd | MRQ RSS |
++ * | Checksum | Ident | | Queue | | Type |
++ * +------------------------------------------------------+
++ * 8 | VLAN Tag | Length | Extended Error | Extended Status |
++ * +------------------------------------------------------+
++ * 63 48 47 32 31 20 19 0
++ */
++ printk(KERN_INFO "RWB[desc] [ck ipid mrqhsh] "
++ "[vl l0 ee es] "
++ "[ l3 l2 l1 hs] [reserved ] ---------------- "
++ "[bi->skb] <-- Ext Rx Write-Back format\n");
++ for (i = 0; i < rx_ring->count; i++) {
++ buffer_info = &rx_ring->buffer_info[i];
++ rx_desc_ps = E1000_RX_DESC_PS(*rx_ring, i);
++ u1 = (struct my_u1 *)rx_desc_ps;
++ staterr =
++ le32_to_cpu(rx_desc_ps->wb.middle.status_error);
++ if (staterr & E1000_RXD_STAT_DD) {
++ /* Descriptor Done */
++ printk(KERN_INFO "RWB[0x%03X] %016llX "
++ "%016llX %016llX %016llX "
++ "---------------- %p", i,
++ le64_to_cpu(u1->a),
++ le64_to_cpu(u1->b),
++ le64_to_cpu(u1->c),
++ le64_to_cpu(u1->d),
++ buffer_info->skb);
++ } else {
++ printk(KERN_INFO "R [0x%03X] %016llX "
++ "%016llX %016llX %016llX %016llX %p", i,
++ le64_to_cpu(u1->a),
++ le64_to_cpu(u1->b),
++ le64_to_cpu(u1->c),
++ le64_to_cpu(u1->d),
++ (u64)buffer_info->dma,
++ buffer_info->skb);
++
++ if (netif_msg_pktdata(adapter))
++ print_hex_dump(KERN_INFO, "",
++ DUMP_PREFIX_ADDRESS, 16, 1,
++ phys_to_virt(buffer_info->dma),
++ adapter->rx_ps_bsize0, true);
++ }
++
++ if (i == rx_ring->next_to_use)
++ printk(KERN_CONT " NTU\n");
++ else if (i == rx_ring->next_to_clean)
++ printk(KERN_CONT " NTC\n");
++ else
++ printk(KERN_CONT "\n");
++ }
++ break;
++ default:
++ case 0:
++ /* Legacy Receive Descriptor Format
++ *
++ * +-----------------------------------------------------+
++ * | Buffer Address [63:0] |
++ * +-----------------------------------------------------+
++ * | VLAN Tag | Errors | Status 0 | Packet csum | Length |
++ * +-----------------------------------------------------+
++ * 63 48 47 40 39 32 31 16 15 0
++ */
++ printk(KERN_INFO "Rl[desc] [address 63:0 ] "
++ "[vl er S cks ln] [bi->dma ] [bi->skb] "
++ "<-- Legacy format\n");
++ for (i = 0; rx_ring->desc && (i < rx_ring->count); i++) {
++ rx_desc = E1000_RX_DESC(*rx_ring, i);
++ buffer_info = &rx_ring->buffer_info[i];
++ u0 = (struct my_u0 *)rx_desc;
++ printk(KERN_INFO "Rl[0x%03X] %016llX %016llX "
++ "%016llX %p",
++ i, le64_to_cpu(u0->a), le64_to_cpu(u0->b),
++ (u64)buffer_info->dma, buffer_info->skb);
++ if (i == rx_ring->next_to_use)
++ printk(KERN_CONT " NTU\n");
++ else if (i == rx_ring->next_to_clean)
++ printk(KERN_CONT " NTC\n");
++ else
++ printk(KERN_CONT "\n");
++
++ if (netif_msg_pktdata(adapter))
++ print_hex_dump(KERN_INFO, "",
++ DUMP_PREFIX_ADDRESS,
++ 16, 1, phys_to_virt(buffer_info->dma),
++ adapter->rx_buffer_len, true);
++ }
++ }
++
++exit:
++ return;
++}
++
+ /**
+ * e1000_desc_unused - calculate if we have unused descriptors
+ **/
+@@ -4275,6 +4630,8 @@ static void e1000_reset_task(struct work_struct *work)
+ struct e1000_adapter *adapter;
+ adapter = container_of(work, struct e1000_adapter, reset_task);
+
++ e1000e_dump(adapter);
++ e_err("Reset adapter\n");
+ e1000e_reinit_locked(adapter);
+ }
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0075-e1000e-Fix-oops-caused-by-ASPM-patch.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0075-e1000e-Fix-oops-caused-by-ASPM-patch.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,57 @@
+From: Anton Blanchard <anton at samba.org>
+Date: Wed, 28 Apr 2010 21:46:06 +0000
+Subject: [PATCH 075/166] e1000e: Fix oops caused by ASPM patch.
+
+commit 0c75ba22541ccea88e89782373991109a7ec2a54 upstream.
+
+Commit 6f461f6c7c961f0b1b73c0f27becf472a0ac606b
+("e1000e: enable/disable ASPM L0s and L1 and ERT according to hardware errata")
+oopses on one of my ppc64 boxes with a NULL pointer (0x4a):
+
+Unable to handle kernel paging request for data at address 0x0000004a
+Faulting instruction address: 0xc0000000004d2f1c
+cpu 0xe: Vector: 300 (Data Access) at [c000000bec1833a0]
+ pc: c0000000004d2f1c: .e1000e_disable_aspm+0xe0/0x150
+ lr: c0000000004d2f0c: .e1000e_disable_aspm+0xd0/0x150
+ dar: 4a
+
+[c000000bec1836d0] c00000000069b9d8 .e1000_probe+0x84/0xe8c
+[c000000bec1837b0] c000000000386d90 .local_pci_probe+0x4c/0x68
+[c000000bec183840] c0000000003872ac .pci_device_probe+0xfc/0x148
+[c000000bec183900] c000000000409e8c .driver_probe_device+0xe4/0x1d0
+[c000000bec1839a0] c00000000040a024 .__driver_attach+0xac/0xf4
+[c000000bec183a40] c000000000409124 .bus_for_each_dev+0x9c/0x10c
+[c000000bec183b00] c000000000409c1c .driver_attach+0x40/0x60
+[c000000bec183b90] c0000000004085dc .bus_add_driver+0x150/0x328
+[c000000bec183c40] c00000000040a58c .driver_register+0x100/0x1c4
+[c000000bec183cf0] c00000000038764c .__pci_register_driver+0x78/0x128
+
+Seems like pdev->bus->self == NULL. I haven't touched pci in a long time
+so I'm trying to remember what this means (no pcie bridge perhaps?)
+
+The patch below fixes the oops for me.
+
+Signed-off-by: Anton Blanchard <anton at samba.org>
+Reviewed-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/netdev.c | 3 +++
+ 1 files changed, 3 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index e485a7d..5722fa6 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -5026,6 +5026,9 @@ static void __e1000e_disable_aspm(struct pci_dev *pdev, u16 state)
+ reg16 &= ~state;
+ pci_write_config_word(pdev, pos + PCI_EXP_LNKCTL, reg16);
+
++ if (!pdev->bus->self)
++ return;
++
+ pos = pci_pcie_cap(pdev->bus->self);
+ pci_read_config_word(pdev->bus->self, pos + PCI_EXP_LNKCTL, ®16);
+ reg16 &= ~state;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0076-e1000e-save-skb-counts-in-TX-to-avoid-cache-misses.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0076-e1000e-save-skb-counts-in-TX-to-avoid-cache-misses.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,81 @@
+From: Tom Herbert <therbert at google.com>
+Date: Wed, 5 May 2010 14:02:27 +0000
+Subject: [PATCH 076/166] e1000e: save skb counts in TX to avoid cache misses
+
+commit 9ed318d546a29d7a591dbe648fd1a2efe3be1180 upstream.
+
+In e1000_tx_map, precompute number of segements and bytecounts which
+are derived from fields in skb; these are stored in buffer_info. When
+cleaning tx in e1000_clean_tx_irq use the values in the associated
+buffer_info for statistics counting, this eliminates cache misses
+on skb fields.
+
+Signed-off-by: Tom Herbert <therbert at google.com>
+Acked-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/e1000.h | 2 ++
+ drivers/net/e1000e/netdev.c | 18 +++++++++---------
+ 2 files changed, 11 insertions(+), 9 deletions(-)
+
+diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
+index 906c4da..c0b3db4 100644
+--- a/drivers/net/e1000e/e1000.h
++++ b/drivers/net/e1000e/e1000.h
+@@ -189,6 +189,8 @@ struct e1000_buffer {
+ unsigned long time_stamp;
+ u16 length;
+ u16 next_to_watch;
++ unsigned int segs;
++ unsigned int bytecount;
+ u16 mapped_as_page;
+ };
+ /* Rx */
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 5722fa6..38940a3 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -1001,14 +1001,8 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter)
+ cleaned = (i == eop);
+
+ if (cleaned) {
+- struct sk_buff *skb = buffer_info->skb;
+- unsigned int segs, bytecount;
+- segs = skb_shinfo(skb)->gso_segs ?: 1;
+- /* multiply data chunks by size of headers */
+- bytecount = ((segs - 1) * skb_headlen(skb)) +
+- skb->len;
+- total_tx_packets += segs;
+- total_tx_bytes += bytecount;
++ total_tx_packets += buffer_info->segs;
++ total_tx_bytes += buffer_info->bytecount;
+ }
+
+ e1000_put_txbuf(adapter, buffer_info);
+@@ -4267,7 +4261,7 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
+ struct e1000_buffer *buffer_info;
+ unsigned int len = skb_headlen(skb);
+ unsigned int offset = 0, size, count = 0, i;
+- unsigned int f;
++ unsigned int f, bytecount, segs;
+
+ i = tx_ring->next_to_use;
+
+@@ -4327,7 +4321,13 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
+ }
+ }
+
++ segs = skb_shinfo(skb)->gso_segs ?: 1;
++ /* multiply data chunks by size of headers */
++ bytecount = ((segs - 1) * skb_headlen(skb)) + skb->len;
++
+ tx_ring->buffer_info[i].skb = skb;
++ tx_ring->buffer_info[i].segs = segs;
++ tx_ring->buffer_info[i].bytecount = bytecount;
+ tx_ring->buffer_info[first].next_to_watch = i;
+
+ return count;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0077-e1000e-reduce-writes-of-RX-producer-ptr.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0077-e1000e-reduce-writes-of-RX-producer-ptr.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,109 @@
+From: Tom Herbert <therbert at google.com>
+Date: Wed, 5 May 2010 14:02:49 +0000
+Subject: [PATCH 077/166] e1000e: reduce writes of RX producer ptr
+
+commit 50849d792b97c546c45a6652a16ba9be7d635c69 upstream.
+
+Reduce number of writes to RX producer pointer. When alloc'ing RX
+buffers, only write the RX producer pointer once every
+E1000_RX_BUFFER_WRITE (16) buffers created.
+
+Signed-off-by: Tom Herbert <therbert at google.com>
+Acked-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/netdev.c | 57 +++++++++++++++++-------------------------
+ 1 files changed, 23 insertions(+), 34 deletions(-)
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 38940a3..8556d85 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -548,26 +548,23 @@ map_skb:
+ rx_desc = E1000_RX_DESC(*rx_ring, i);
+ rx_desc->buffer_addr = cpu_to_le64(buffer_info->dma);
+
++ if (unlikely(!(i & (E1000_RX_BUFFER_WRITE - 1)))) {
++ /*
++ * Force memory writes to complete before letting h/w
++ * know there are new descriptors to fetch. (Only
++ * applicable for weak-ordered memory model archs,
++ * such as IA-64).
++ */
++ wmb();
++ writel(i, adapter->hw.hw_addr + rx_ring->tail);
++ }
+ i++;
+ if (i == rx_ring->count)
+ i = 0;
+ buffer_info = &rx_ring->buffer_info[i];
+ }
+
+- if (rx_ring->next_to_use != i) {
+- rx_ring->next_to_use = i;
+- if (i-- == 0)
+- i = (rx_ring->count - 1);
+-
+- /*
+- * Force memory writes to complete before letting h/w
+- * know there are new descriptors to fetch. (Only
+- * applicable for weak-ordered memory model archs,
+- * such as IA-64).
+- */
+- wmb();
+- writel(i, adapter->hw.hw_addr + rx_ring->tail);
+- }
++ rx_ring->next_to_use = i;
+ }
+
+ /**
+@@ -649,6 +646,17 @@ static void e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter,
+
+ rx_desc->read.buffer_addr[0] = cpu_to_le64(buffer_info->dma);
+
++ if (unlikely(!(i & (E1000_RX_BUFFER_WRITE - 1)))) {
++ /*
++ * Force memory writes to complete before letting h/w
++ * know there are new descriptors to fetch. (Only
++ * applicable for weak-ordered memory model archs,
++ * such as IA-64).
++ */
++ wmb();
++ writel(i<<1, adapter->hw.hw_addr + rx_ring->tail);
++ }
++
+ i++;
+ if (i == rx_ring->count)
+ i = 0;
+@@ -656,26 +664,7 @@ static void e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter,
+ }
+
+ no_buffers:
+- if (rx_ring->next_to_use != i) {
+- rx_ring->next_to_use = i;
+-
+- if (!(i--))
+- i = (rx_ring->count - 1);
+-
+- /*
+- * Force memory writes to complete before letting h/w
+- * know there are new descriptors to fetch. (Only
+- * applicable for weak-ordered memory model archs,
+- * such as IA-64).
+- */
+- wmb();
+- /*
+- * Hardware increments by 16 bytes, but packet split
+- * descriptors are 32 bytes...so we increment tail
+- * twice as much.
+- */
+- writel(i<<1, adapter->hw.hw_addr + rx_ring->tail);
+- }
++ rx_ring->next_to_use = i;
+ }
+
+ /**
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0078-e1000e-Remove-unnessary-log-message.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0078-e1000e-Remove-unnessary-log-message.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,32 @@
+From: Tom Herbert <therbert at google.com>
+Date: Wed, 5 May 2010 14:03:11 +0000
+Subject: [PATCH 078/166] e1000e: Remove unnessary log message
+
+commit c72ea83d39efa71bf0e3fc1125e780071a79f1bc upstream.
+
+Remove e_info message printed whenever TSO is enabled or disabled.
+This is not very useful and just clutters dmesg.
+
+Signed-off-by: Tom Herbert <therbert at google.com>
+Acked-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/ethtool.c | 1 -
+ 1 files changed, 0 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
+index 7f9915c..b72c1c0 100644
+--- a/drivers/net/e1000e/ethtool.c
++++ b/drivers/net/e1000e/ethtool.c
+@@ -412,7 +412,6 @@ static int e1000_set_tso(struct net_device *netdev, u32 data)
+ netdev->features &= ~NETIF_F_TSO6;
+ }
+
+- e_info("TSO is %s\n", data ? "Enabled" : "Disabled");
+ adapter->flags |= FLAG_TSO_FORCE;
+ return 0;
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0079-e1000e-Save-irq-into-netdev-structure.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0079-e1000e-Save-irq-into-netdev-structure.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,33 @@
+From: Tom Herbert <therbert at google.com>
+Date: Wed, 5 May 2010 14:03:32 +0000
+Subject: [PATCH 079/166] e1000e: Save irq into netdev structure
+
+commit f85e4dfac666e41b91e2b77fa563398e9379d5eb upstream.
+
+Set net->devirq to pdev->irq. This should be consistent with other
+drivers.
+
+Signed-off-by: Tom Herbert <therbert at google.com>
+Acked-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/netdev.c | 2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 8556d85..0b5ea23 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -5446,6 +5446,8 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
+
+ SET_NETDEV_DEV(netdev, &pdev->dev);
+
++ netdev->irq = pdev->irq;
++
+ pci_set_drvdata(pdev, netdev);
+ adapter = netdev_priv(netdev);
+ hw = &adapter->hw;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0080-e1000e-increase-rx-fifo-size-to-36K-on-82574-and-825.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0080-e1000e-increase-rx-fifo-size-to-36K-on-82574-and-825.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,45 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 4 May 2010 22:25:42 +0000
+Subject: [PATCH 080/166] e1000e: increase rx fifo size to 36K on 82574 and
+ 82583
+
+commit edf15c17420fed108046da50b3d3ae53dfa0e0ae upstream.
+
+This change increases the RX fifo size to 36K for standard frames and
+decreases the TX fifo size to 4K. The reason for this change is that on
+slower systems the RX is much more likely to backfill and need space than
+the TX is. As long as the TX fifo is twice the size of the MTU we should
+have more than enough TX fifo.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/82571.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+index 17a25e1..1e73edd 100644
+--- a/drivers/net/e1000e/82571.c
++++ b/drivers/net/e1000e/82571.c
+@@ -1845,7 +1845,7 @@ struct e1000_info e1000_82574_info = {
+ | FLAG_HAS_SMART_POWER_DOWN
+ | FLAG_HAS_AMT
+ | FLAG_HAS_CTRLEXT_ON_LOAD,
+- .pba = 20,
++ .pba = 36,
+ .max_hw_frame_size = DEFAULT_JUMBO,
+ .get_variants = e1000_get_variants_82571,
+ .mac_ops = &e82571_mac_ops,
+@@ -1862,7 +1862,7 @@ struct e1000_info e1000_82583_info = {
+ | FLAG_HAS_SMART_POWER_DOWN
+ | FLAG_HAS_AMT
+ | FLAG_HAS_CTRLEXT_ON_LOAD,
+- .pba = 20,
++ .pba = 36,
+ .max_hw_frame_size = ETH_FRAME_LEN + ETH_FCS_LEN,
+ .get_variants = e1000_get_variants_82571,
+ .mac_ops = &e82571_mac_ops,
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0081-e1000-e1000e-implement-a-simple-interrupt-moderation.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0081-e1000-e1000e-implement-a-simple-interrupt-moderation.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,112 @@
+From: Jesse Brandeburg <jesse.brandeburg at intel.com>
+Date: Tue, 4 May 2010 22:26:03 +0000
+Subject: [PATCH 081/166] e1000/e1000e: implement a simple interrupt
+ moderation
+
+commit eab2abf5826b78b126826cc70e564c44816396da upstream.
+
+Back before e1000-7.3.20, the e1000 driver had a simple algorithm that
+managed interrupt moderation. The driver was updated in 7.3.20 to
+have the new "adaptive" interrupt moderation but we have customer
+requests to redeploy the old way as an option. This patch adds the
+old functionality back. The new functionality can be enabled via
+module parameter or at runtime via ethtool.
+Module parameter: (InterruptThrottleRate=4) to use this new
+moderation method.
+Ethtool method: ethtool -C ethX rx-usecs 4
+
+Signed-off-by: Jesse Brandeburg <jesse.brandeburg at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Restricted to drivers/net/e1000e]
+---
+ drivers/net/e1000e/ethtool.c | 8 +++++---
+ drivers/net/e1000e/netdev.c | 18 +++++++++++++++++-
+ drivers/net/e1000e/param.c | 5 +++++
+ 3 files changed, 27 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
+index b72c1c0..6ff376c 100644
+--- a/drivers/net/e1000e/ethtool.c
++++ b/drivers/net/e1000e/ethtool.c
+@@ -1890,7 +1890,7 @@ static int e1000_get_coalesce(struct net_device *netdev,
+ {
+ struct e1000_adapter *adapter = netdev_priv(netdev);
+
+- if (adapter->itr_setting <= 3)
++ if (adapter->itr_setting <= 4)
+ ec->rx_coalesce_usecs = adapter->itr_setting;
+ else
+ ec->rx_coalesce_usecs = 1000000 / adapter->itr_setting;
+@@ -1905,12 +1905,14 @@ static int e1000_set_coalesce(struct net_device *netdev,
+ struct e1000_hw *hw = &adapter->hw;
+
+ if ((ec->rx_coalesce_usecs > E1000_MAX_ITR_USECS) ||
+- ((ec->rx_coalesce_usecs > 3) &&
++ ((ec->rx_coalesce_usecs > 4) &&
+ (ec->rx_coalesce_usecs < E1000_MIN_ITR_USECS)) ||
+ (ec->rx_coalesce_usecs == 2))
+ return -EINVAL;
+
+- if (ec->rx_coalesce_usecs <= 3) {
++ if (ec->rx_coalesce_usecs == 4) {
++ adapter->itr = adapter->itr_setting = 4;
++ } else if (ec->rx_coalesce_usecs <= 3) {
+ adapter->itr = 20000;
+ adapter->itr_setting = ec->rx_coalesce_usecs;
+ } else {
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 0b5ea23..71307b3 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -52,7 +52,7 @@
+
+ #include "e1000.h"
+
+-#define DRV_VERSION "1.0.2-k2"
++#define DRV_VERSION "1.0.2-k4"
+ char e1000e_driver_name[] = "e1000e";
+ const char e1000e_driver_version[] = DRV_VERSION;
+
+@@ -4076,6 +4076,22 @@ link_up:
+ }
+ }
+
++ /* Simple mode for Interrupt Throttle Rate (ITR) */
++ if (adapter->itr_setting == 4) {
++ /*
++ * Symmetric Tx/Rx gets a reduced ITR=2000;
++ * Total asymmetrical Tx or Rx gets ITR=8000;
++ * everyone else is between 2000-8000.
++ */
++ u32 goc = (adapter->gotc + adapter->gorc) / 10000;
++ u32 dif = (adapter->gotc > adapter->gorc ?
++ adapter->gotc - adapter->gorc :
++ adapter->gorc - adapter->gotc) / 10000;
++ u32 itr = goc > 0 ? (dif * 6000 / goc + 2000) : 8000;
++
++ ew32(ITR, 1000000000 / (itr * 256));
++ }
++
+ /* Cause software interrupt to ensure Rx ring is cleaned */
+ if (adapter->msix_entries)
+ ew32(ICS, adapter->rx_ring->ims_val);
+diff --git a/drivers/net/e1000e/param.c b/drivers/net/e1000e/param.c
+index f775a48..0f4077c 100644
+--- a/drivers/net/e1000e/param.c
++++ b/drivers/net/e1000e/param.c
+@@ -351,6 +351,11 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
+ adapter->itr_setting = adapter->itr;
+ adapter->itr = 20000;
+ break;
++ case 4:
++ e_info("%s set to simplified (2000-8000 ints) "
++ "mode\n", opt.name);
++ adapter->itr_setting = 4;
++ break;
+ default:
+ /*
+ * Save the setting, because the dynamic bits
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0082-e1000e-reset-MAC-PHY-interconnect-on-82577-82578-dur.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0082-e1000e-reset-MAC-PHY-interconnect-on-82577-82578-dur.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,82 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Wed, 5 May 2010 22:00:06 +0000
+Subject: [PATCH 082/166] e1000e: reset MAC-PHY interconnect on 82577/82578
+ during Sx->S0
+
+commit 6dfaa76994e5d49a82afb415bbe1362e901b2b95 upstream.
+
+During Sx->S0 transitions, the interconnect between the MAC and PHY on
+82577/82578 can remain in SMBus mode instead of transitioning to the
+PCIe-like mode required during normal operation. Toggling the LANPHYPC
+Value bit essentially resets the interconnect forcing it to the correct
+mode.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/defines.h | 2 ++
+ drivers/net/e1000e/ich8lan.c | 20 ++++++++++++++++++++
+ 2 files changed, 22 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/e1000e/defines.h b/drivers/net/e1000e/defines.h
+index e301e26..7f760aa 100644
+--- a/drivers/net/e1000e/defines.h
++++ b/drivers/net/e1000e/defines.h
+@@ -214,6 +214,8 @@
+ #define E1000_CTRL_SPD_1000 0x00000200 /* Force 1Gb */
+ #define E1000_CTRL_FRCSPD 0x00000800 /* Force Speed */
+ #define E1000_CTRL_FRCDPX 0x00001000 /* Force Duplex */
++#define E1000_CTRL_LANPHYPC_OVERRIDE 0x00010000 /* SW control of LANPHYPC */
++#define E1000_CTRL_LANPHYPC_VALUE 0x00020000 /* SW value of LANPHYPC */
+ #define E1000_CTRL_SWDPIN0 0x00040000 /* SWDPIN 0 value */
+ #define E1000_CTRL_SWDPIN1 0x00080000 /* SWDPIN 1 value */
+ #define E1000_CTRL_SWDPIO0 0x00400000 /* SWDPIN 0 Input or output */
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index d619cf5..b8c4dce 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -83,6 +83,8 @@
+
+
+ #define E1000_ICH_FWSM_RSPCIPHY 0x00000040 /* Reset PHY on PCI Reset */
++/* FW established a valid mode */
++#define E1000_ICH_FWSM_FW_VALID 0x00008000
+
+ #define E1000_ICH_MNG_IAMT_MODE 0x2
+
+@@ -259,6 +261,7 @@ static inline void __ew32flash(struct e1000_hw *hw, unsigned long reg, u32 val)
+ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw)
+ {
+ struct e1000_phy_info *phy = &hw->phy;
++ u32 ctrl;
+ s32 ret_val = 0;
+
+ phy->addr = 1;
+@@ -274,6 +277,23 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw)
+ phy->ops.power_down = e1000_power_down_phy_copper_ich8lan;
+ phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT;
+
++ if (!(er32(FWSM) & E1000_ICH_FWSM_FW_VALID)) {
++ /*
++ * The MAC-PHY interconnect may still be in SMBus mode
++ * after Sx->S0. Toggle the LANPHYPC Value bit to force
++ * the interconnect to PCIe mode, but only if there is no
++ * firmware present otherwise firmware will have done it.
++ */
++ ctrl = er32(CTRL);
++ ctrl |= E1000_CTRL_LANPHYPC_OVERRIDE;
++ ctrl &= ~E1000_CTRL_LANPHYPC_VALUE;
++ ew32(CTRL, ctrl);
++ udelay(10);
++ ctrl &= ~E1000_CTRL_LANPHYPC_OVERRIDE;
++ ew32(CTRL, ctrl);
++ msleep(50);
++ }
++
+ /*
+ * Reset the PHY before any acccess to it. Doing so, ensures that
+ * the PHY is in a known good state before we read/write PHY registers.
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0083-e1000e-use-static-params-to-save-stack-space-part-2.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0083-e1000e-use-static-params-to-save-stack-space-part-2.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,42 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Mon, 10 May 2010 14:59:10 +0000
+Subject: [PATCH 083/166] e1000e: use static params to save stack space (part
+ 2)
+
+commit 4fe4491fc5578019174d0f02d1ae740fce78deac upstream.
+
+A couple stack cleanups missed in an earlier patch from Jesse.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Cc: Jesse Brandeburg <jesse.brandeburg at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/param.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/e1000e/param.c b/drivers/net/e1000e/param.c
+index 0f4077c..a150e48 100644
+--- a/drivers/net/e1000e/param.c
++++ b/drivers/net/e1000e/param.c
+@@ -286,7 +286,7 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
+ }
+ }
+ { /* Receive Interrupt Delay */
+- struct e1000_option opt = {
++ static struct e1000_option opt = {
+ .type = range_option,
+ .name = "Receive Interrupt Delay",
+ .err = "using default of "
+@@ -386,7 +386,7 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
+ }
+ }
+ { /* Interrupt Mode */
+- struct e1000_option opt = {
++ static struct e1000_option opt = {
+ .type = range_option,
+ .name = "Interrupt Mode",
+ .err = "defaulting to 2 (MSI-X)",
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0084-e1000e-bad-state-after-running-ethtool-diagnostics-w.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0084-e1000e-bad-state-after-running-ethtool-diagnostics-w.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,86 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Mon, 10 May 2010 14:59:31 +0000
+Subject: [PATCH 084/166] e1000e: bad state after running ethtool diagnostics
+ with AMT enabled
+
+commit 11b08be830078c1cc4af484d0f85c3a010319c97 upstream.
+
+When running ethtool online diagnostics with no open interface, there is a
+short period of time where the driver relinquishes control of the adapter
+during which time AMT (manageability firmware) can put the adapter into an
+unknown state resulting in such things as link test failure, hardware hang,
+reporting an incorrect link speed, etc. Resetting the adapter during an
+open() resolves this by putting the adapter into a quiescent state.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/ethtool.c | 9 +++++++++
+ drivers/net/e1000e/netdev.c | 16 +++++++++-------
+ 2 files changed, 18 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
+index 6ff376c..2c52121 100644
+--- a/drivers/net/e1000e/ethtool.c
++++ b/drivers/net/e1000e/ethtool.c
+@@ -1737,6 +1737,12 @@ static void e1000_diag_test(struct net_device *netdev,
+ if (if_running)
+ dev_open(netdev);
+ } else {
++ if (!if_running && (adapter->flags & FLAG_HAS_AMT)) {
++ clear_bit(__E1000_TESTING, &adapter->state);
++ dev_open(netdev);
++ set_bit(__E1000_TESTING, &adapter->state);
++ }
++
+ e_info("online testing starting\n");
+ /* Online tests */
+ if (e1000_link_test(adapter, &data[4]))
+@@ -1748,6 +1754,9 @@ static void e1000_diag_test(struct net_device *netdev,
+ data[2] = 0;
+ data[3] = 0;
+
++ if (!if_running && (adapter->flags & FLAG_HAS_AMT))
++ dev_close(netdev);
++
+ clear_bit(__E1000_TESTING, &adapter->state);
+ }
+ msleep_interruptible(4 * 1000);
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 71307b3..2404022 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -3450,6 +3450,15 @@ static int e1000_open(struct net_device *netdev)
+ if (err)
+ goto err_setup_rx;
+
++ /*
++ * If AMT is enabled, let the firmware know that the network
++ * interface is now open and reset the part to a known state.
++ */
++ if (adapter->flags & FLAG_HAS_AMT) {
++ e1000_get_hw_control(adapter);
++ e1000e_reset(adapter);
++ }
++
+ e1000e_power_up_phy(adapter);
+
+ adapter->mng_vlan_id = E1000_MNG_VLAN_NONE;
+@@ -3458,13 +3467,6 @@ static int e1000_open(struct net_device *netdev)
+ e1000_update_mng_vlan(adapter);
+
+ /*
+- * If AMT is enabled, let the firmware know that the network
+- * interface is now open
+- */
+- if (adapter->flags & FLAG_HAS_AMT)
+- e1000_get_hw_control(adapter);
+-
+- /*
+ * before we allocate an interrupt, we must be ready to handle it.
+ * Setting DEBUG_SHIRQ in the kernel makes it fire an interrupt
+ * as soon as we call pci_request_irq, so we have to setup our
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0085-e1000e-initialize-manageability-IPMI-pass-through-in.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0085-e1000e-initialize-manageability-IPMI-pass-through-in.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,150 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Mon, 10 May 2010 14:59:51 +0000
+Subject: [PATCH 085/166] e1000e: initialize manageability (IPMI) pass-through
+ in 82574/82583
+
+commit cd791618c28f524598bcfa941d948b1126a2394a upstream.
+
+82574/82583 uses different registers/bits to setup manageability filters
+than all other parts supported by e1000e; set them accordingly for IPMI
+pass-through. Rename the function to better reflect what it does.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/defines.h | 5 +++
+ drivers/net/e1000e/hw.h | 2 +
+ drivers/net/e1000e/netdev.c | 57 +++++++++++++++++++++++++++++++++++------
+ 3 files changed, 55 insertions(+), 9 deletions(-)
+
+diff --git a/drivers/net/e1000e/defines.h b/drivers/net/e1000e/defines.h
+index 7f760aa..227147f 100644
+--- a/drivers/net/e1000e/defines.h
++++ b/drivers/net/e1000e/defines.h
+@@ -138,6 +138,11 @@
+ /* Enable MNG packets to host memory */
+ #define E1000_MANC_EN_MNG2HOST 0x00200000
+
++#define E1000_MANC2H_PORT_623 0x00000020 /* Port 0x26f */
++#define E1000_MANC2H_PORT_664 0x00000040 /* Port 0x298 */
++#define E1000_MDEF_PORT_623 0x00000800 /* Port 0x26f */
++#define E1000_MDEF_PORT_664 0x00000400 /* Port 0x298 */
++
+ /* Receive Control */
+ #define E1000_RCTL_EN 0x00000002 /* enable */
+ #define E1000_RCTL_SBP 0x00000004 /* store bad packet */
+diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h
+index 4fc3147..49d19d8 100644
+--- a/drivers/net/e1000e/hw.h
++++ b/drivers/net/e1000e/hw.h
+@@ -208,6 +208,8 @@ enum e1e_registers {
+
+ E1000_KMRNCTRLSTA = 0x00034, /* MAC-PHY interface - RW */
+ E1000_MANC2H = 0x05860, /* Management Control To Host - RW */
++ E1000_MDEF_BASE = 0x05890, /* Management Decision Filters */
++#define E1000_MDEF(_n) (E1000_MDEF_BASE + ((_n) * 4))
+ E1000_SW_FW_SYNC = 0x05B5C, /* Software-Firmware Synchronization - RW */
+ E1000_GCR = 0x05B00, /* PCI-Ex Control */
+ E1000_GCR2 = 0x05B64, /* PCI-Ex Control #2 */
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 2404022..6c0ac82 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -2526,10 +2526,10 @@ static void e1000_restore_vlan(struct e1000_adapter *adapter)
+ }
+ }
+
+-static void e1000_init_manageability(struct e1000_adapter *adapter)
++static void e1000_init_manageability_pt(struct e1000_adapter *adapter)
+ {
+ struct e1000_hw *hw = &adapter->hw;
+- u32 manc, manc2h;
++ u32 manc, manc2h, mdef, i, j;
+
+ if (!(adapter->flags & FLAG_MNG_PT_ENABLED))
+ return;
+@@ -2543,10 +2543,49 @@ static void e1000_init_manageability(struct e1000_adapter *adapter)
+ */
+ manc |= E1000_MANC_EN_MNG2HOST;
+ manc2h = er32(MANC2H);
+-#define E1000_MNG2HOST_PORT_623 (1 << 5)
+-#define E1000_MNG2HOST_PORT_664 (1 << 6)
+- manc2h |= E1000_MNG2HOST_PORT_623;
+- manc2h |= E1000_MNG2HOST_PORT_664;
++
++ switch (hw->mac.type) {
++ default:
++ manc2h |= (E1000_MANC2H_PORT_623 | E1000_MANC2H_PORT_664);
++ break;
++ case e1000_82574:
++ case e1000_82583:
++ /*
++ * Check if IPMI pass-through decision filter already exists;
++ * if so, enable it.
++ */
++ for (i = 0, j = 0; i < 8; i++) {
++ mdef = er32(MDEF(i));
++
++ /* Ignore filters with anything other than IPMI ports */
++ if (mdef & !(E1000_MDEF_PORT_623 | E1000_MDEF_PORT_664))
++ continue;
++
++ /* Enable this decision filter in MANC2H */
++ if (mdef)
++ manc2h |= (1 << i);
++
++ j |= mdef;
++ }
++
++ if (j == (E1000_MDEF_PORT_623 | E1000_MDEF_PORT_664))
++ break;
++
++ /* Create new decision filter in an empty filter */
++ for (i = 0, j = 0; i < 8; i++)
++ if (er32(MDEF(i)) == 0) {
++ ew32(MDEF(i), (E1000_MDEF_PORT_623 |
++ E1000_MDEF_PORT_664));
++ manc2h |= (1 << 1);
++ j++;
++ break;
++ }
++
++ if (!j)
++ e_warn("Unable to create IPMI pass-through filter\n");
++ break;
++ }
++
+ ew32(MANC2H, manc2h);
+ ew32(MANC, manc);
+ }
+@@ -2962,7 +3001,7 @@ static void e1000_configure(struct e1000_adapter *adapter)
+ e1000_set_multi(adapter->netdev);
+
+ e1000_restore_vlan(adapter);
+- e1000_init_manageability(adapter);
++ e1000_init_manageability_pt(adapter);
+
+ e1000_configure_tx(adapter);
+ e1000_setup_rctl(adapter);
+@@ -5110,7 +5149,7 @@ static int __e1000_resume(struct pci_dev *pdev)
+
+ e1000e_reset(adapter);
+
+- e1000_init_manageability(adapter);
++ e1000_init_manageability_pt(adapter);
+
+ if (netif_running(netdev))
+ e1000e_up(adapter);
+@@ -5311,7 +5350,7 @@ static void e1000_io_resume(struct pci_dev *pdev)
+ struct net_device *netdev = pci_get_drvdata(pdev);
+ struct e1000_adapter *adapter = netdev_priv(netdev);
+
+- e1000_init_manageability(adapter);
++ e1000_init_manageability_pt(adapter);
+
+ if (netif_running(netdev)) {
+ if (e1000e_up(adapter)) {
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0086-e1000e-s-w-initiated-LSC-MSI-X-interrupts-not-genera.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0086-e1000e-s-w-initiated-LSC-MSI-X-interrupts-not-genera.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,52 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Mon, 10 May 2010 15:00:10 +0000
+Subject: [PATCH 086/166] e1000e: s/w initiated LSC MSI-X interrupts not
+ generated; no transmit
+
+commit 52a9b2319628e2cbbff7abc4f1092f4597c75a4f upstream.
+
+In MSI-X mode when an IMPI SoL session was active (i.e. the PHY reset was
+blocked), the LSC interrupt generated by s/w to start the watchdog which
+started the transmitter was not getting fired by the hardware because bit
+24 (the 'other' cause bit) also needed to be set. Without an active SoL
+session, the PHY was reset which caused the h/w to fire the LSC interrupt.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/netdev.c | 11 +++++++++--
+ 1 files changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 6c0ac82..5a5ea42 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -3221,7 +3221,11 @@ int e1000e_up(struct e1000_adapter *adapter)
+ netif_wake_queue(adapter->netdev);
+
+ /* fire a link change interrupt to start the watchdog */
+- ew32(ICS, E1000_ICS_LSC);
++ if (adapter->msix_entries)
++ ew32(ICS, E1000_ICS_LSC | E1000_ICR_OTHER);
++ else
++ ew32(ICS, E1000_ICS_LSC);
++
+ return 0;
+ }
+
+@@ -3543,7 +3547,10 @@ static int e1000_open(struct net_device *netdev)
+ pm_runtime_put(&pdev->dev);
+
+ /* fire a link status change interrupt to start the watchdog */
+- ew32(ICS, E1000_ICS_LSC);
++ if (adapter->msix_entries)
++ ew32(ICS, E1000_ICS_LSC | E1000_ICR_OTHER);
++ else
++ ew32(ICS, E1000_ICS_LSC);
+
+ return 0;
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0087-e1000e-cleanup-multiple-common-exit-points.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0087-e1000e-cleanup-multiple-common-exit-points.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,112 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Mon, 10 May 2010 15:00:31 +0000
+Subject: [PATCH 087/166] e1000e: cleanup multiple common exit points
+
+commit 9c5e209d4ba00eb09922f0f56136474372395c2b upstream.
+
+...in e1000_update_nvm_checksum_ich8lan().
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/ich8lan.c | 41 +++++++++++++++++------------------------
+ 1 files changed, 17 insertions(+), 24 deletions(-)
+
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index b8c4dce..448e123 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -1938,18 +1938,14 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)
+ new_bank_offset = nvm->flash_bank_size;
+ old_bank_offset = 0;
+ ret_val = e1000_erase_flash_bank_ich8lan(hw, 1);
+- if (ret_val) {
+- nvm->ops.release(hw);
+- goto out;
+- }
++ if (ret_val)
++ goto release;
+ } else {
+ old_bank_offset = nvm->flash_bank_size;
+ new_bank_offset = 0;
+ ret_val = e1000_erase_flash_bank_ich8lan(hw, 0);
+- if (ret_val) {
+- nvm->ops.release(hw);
+- goto out;
+- }
++ if (ret_val)
++ goto release;
+ }
+
+ for (i = 0; i < E1000_ICH8_SHADOW_RAM_WORDS; i++) {
+@@ -2005,8 +2001,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)
+ if (ret_val) {
+ /* Possibly read-only, see e1000e_write_protect_nvm_ich8lan() */
+ e_dbg("Flash commit failed.\n");
+- nvm->ops.release(hw);
+- goto out;
++ goto release;
+ }
+
+ /*
+@@ -2017,18 +2012,15 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)
+ */
+ act_offset = new_bank_offset + E1000_ICH_NVM_SIG_WORD;
+ ret_val = e1000_read_flash_word_ich8lan(hw, act_offset, &data);
+- if (ret_val) {
+- nvm->ops.release(hw);
+- goto out;
+- }
++ if (ret_val)
++ goto release;
++
+ data &= 0xBFFF;
+ ret_val = e1000_retry_write_flash_byte_ich8lan(hw,
+ act_offset * 2 + 1,
+ (u8)(data >> 8));
+- if (ret_val) {
+- nvm->ops.release(hw);
+- goto out;
+- }
++ if (ret_val)
++ goto release;
+
+ /*
+ * And invalidate the previously valid segment by setting
+@@ -2038,10 +2030,8 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)
+ */
+ act_offset = (old_bank_offset + E1000_ICH_NVM_SIG_WORD) * 2 + 1;
+ ret_val = e1000_retry_write_flash_byte_ich8lan(hw, act_offset, 0);
+- if (ret_val) {
+- nvm->ops.release(hw);
+- goto out;
+- }
++ if (ret_val)
++ goto release;
+
+ /* Great! Everything worked, we can now clear the cached entries. */
+ for (i = 0; i < E1000_ICH8_SHADOW_RAM_WORDS; i++) {
+@@ -2049,14 +2039,17 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)
+ dev_spec->shadow_ram[i].value = 0xFFFF;
+ }
+
++release:
+ nvm->ops.release(hw);
+
+ /*
+ * Reload the EEPROM, or else modifications will not appear
+ * until after the next adapter reset.
+ */
+- e1000e_reload_nvm(hw);
+- msleep(10);
++ if (!ret_val) {
++ e1000e_reload_nvm(hw);
++ msleep(10);
++ }
+
+ out:
+ if (ret_val)
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0088-e1000e-Remove-EN_MAC_ADDR_FILTER-check-from-enable_m.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0088-e1000e-Remove-EN_MAC_ADDR_FILTER-check-from-enable_m.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,48 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Mon, 10 May 2010 15:00:50 +0000
+Subject: [PATCH 088/166] e1000e: Remove EN_MAC_ADDR_FILTER check from
+ enable_mng_pass_thru check
+
+commit 757c530407a92fd460d557af59ba86920cf025cb upstream.
+
+Patch addresses issues when manageability passthrough is enabled, but the
+MAC_ADDR_FILTER bit is not set in the MANC register.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/lib.c | 8 ++++----
+ 1 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c
+index b0d2a60..b32361d 100644
+--- a/drivers/net/e1000e/lib.c
++++ b/drivers/net/e1000e/lib.c
+@@ -2515,10 +2515,11 @@ s32 e1000e_mng_write_dhcp_info(struct e1000_hw *hw, u8 *buffer, u16 length)
+ }
+
+ /**
+- * e1000e_enable_mng_pass_thru - Enable processing of ARP's
++ * e1000e_enable_mng_pass_thru - Check if management passthrough is needed
+ * @hw: pointer to the HW structure
+ *
+- * Verifies the hardware needs to allow ARPs to be processed by the host.
++ * Verifies the hardware needs to leave interface enabled so that frames can
++ * be directed to and from the management interface.
+ **/
+ bool e1000e_enable_mng_pass_thru(struct e1000_hw *hw)
+ {
+@@ -2528,8 +2529,7 @@ bool e1000e_enable_mng_pass_thru(struct e1000_hw *hw)
+
+ manc = er32(MANC);
+
+- if (!(manc & E1000_MANC_RCV_TCO_EN) ||
+- !(manc & E1000_MANC_EN_MAC_ADDR_FILTER))
++ if (!(manc & E1000_MANC_RCV_TCO_EN))
+ return ret_val;
+
+ if (hw->mac.arc_subsystem_valid) {
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0089-e1000e-Cleanup-e1000_sw_lcd_config_ich8lan.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0089-e1000e-Cleanup-e1000_sw_lcd_config_ich8lan.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,213 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Mon, 10 May 2010 15:01:10 +0000
+Subject: [PATCH 089/166] e1000e: Cleanup e1000_sw_lcd_config_ich8lan()
+
+commit 8b802a7e94c2ed9c6032a88b3ab9860c55cd6378 upstream.
+
+After every reset all ICH/PCH parts call this function which acquires the
+swflag, performs a workaround on applicable parts and releases the swflag.
+There is no reason for parts for which this workaround is not applicable
+to acquire and release the swflag so the function should just return
+without doing anything for these parts. This also provides for the
+indentation of most of the function contents to be shifted left cleaning up
+the code.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/ich8lan.c | 164 +++++++++++++++++++++---------------------
+ 1 files changed, 81 insertions(+), 83 deletions(-)
+
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index 448e123..61f8927 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -815,11 +815,16 @@ static s32 e1000_check_reset_block_ich8lan(struct e1000_hw *hw)
+ **/
+ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw)
+ {
++ struct e1000_adapter *adapter = hw->adapter;
+ struct e1000_phy_info *phy = &hw->phy;
+ u32 i, data, cnf_size, cnf_base_addr, sw_cfg_mask;
+- s32 ret_val;
++ s32 ret_val = 0;
+ u16 word_addr, reg_data, reg_addr, phy_page = 0;
+
++ if (!(hw->mac.type == e1000_ich8lan && phy->type == e1000_phy_igp_3) &&
++ !(hw->mac.type == e1000_pchlan))
++ return ret_val;
++
+ ret_val = hw->phy.ops.acquire(hw);
+ if (ret_val)
+ return ret_val;
+@@ -831,97 +836,90 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw)
+ * Therefore, after each PHY reset, we will load the
+ * configuration data out of the NVM manually.
+ */
+- if ((hw->mac.type == e1000_ich8lan && phy->type == e1000_phy_igp_3) ||
+- (hw->mac.type == e1000_pchlan)) {
+- struct e1000_adapter *adapter = hw->adapter;
+-
+- /* Check if SW needs to configure the PHY */
+- if ((adapter->pdev->device == E1000_DEV_ID_ICH8_IGP_M_AMT) ||
+- (adapter->pdev->device == E1000_DEV_ID_ICH8_IGP_M) ||
+- (hw->mac.type == e1000_pchlan))
+- sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG_ICH8M;
+- else
+- sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG;
++ if ((adapter->pdev->device == E1000_DEV_ID_ICH8_IGP_M_AMT) ||
++ (adapter->pdev->device == E1000_DEV_ID_ICH8_IGP_M) ||
++ (hw->mac.type == e1000_pchlan))
++ sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG_ICH8M;
++ else
++ sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG;
+
+- data = er32(FEXTNVM);
+- if (!(data & sw_cfg_mask))
+- goto out;
++ data = er32(FEXTNVM);
++ if (!(data & sw_cfg_mask))
++ goto out;
+
+- /* Wait for basic configuration completes before proceeding */
+- e1000_lan_init_done_ich8lan(hw);
++ /* Wait for basic configuration completes before proceeding */
++ e1000_lan_init_done_ich8lan(hw);
+
++ /*
++ * Make sure HW does not configure LCD from PHY
++ * extended configuration before SW configuration
++ */
++ data = er32(EXTCNF_CTRL);
++ if (data & E1000_EXTCNF_CTRL_LCD_WRITE_ENABLE)
++ goto out;
++
++ cnf_size = er32(EXTCNF_SIZE);
++ cnf_size &= E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_MASK;
++ cnf_size >>= E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_SHIFT;
++ if (!cnf_size)
++ goto out;
++
++ cnf_base_addr = data & E1000_EXTCNF_CTRL_EXT_CNF_POINTER_MASK;
++ cnf_base_addr >>= E1000_EXTCNF_CTRL_EXT_CNF_POINTER_SHIFT;
++
++ if (!(data & E1000_EXTCNF_CTRL_OEM_WRITE_ENABLE) &&
++ (hw->mac.type == e1000_pchlan)) {
+ /*
+- * Make sure HW does not configure LCD from PHY
+- * extended configuration before SW configuration
++ * HW configures the SMBus address and LEDs when the
++ * OEM and LCD Write Enable bits are set in the NVM.
++ * When both NVM bits are cleared, SW will configure
++ * them instead.
+ */
+- data = er32(EXTCNF_CTRL);
+- if (data & E1000_EXTCNF_CTRL_LCD_WRITE_ENABLE)
++ data = er32(STRAP);
++ data &= E1000_STRAP_SMBUS_ADDRESS_MASK;
++ reg_data = data >> E1000_STRAP_SMBUS_ADDRESS_SHIFT;
++ reg_data |= HV_SMB_ADDR_PEC_EN | HV_SMB_ADDR_VALID;
++ ret_val = e1000_write_phy_reg_hv_locked(hw, HV_SMB_ADDR,
++ reg_data);
++ if (ret_val)
+ goto out;
+
+- cnf_size = er32(EXTCNF_SIZE);
+- cnf_size &= E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_MASK;
+- cnf_size >>= E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_SHIFT;
+- if (!cnf_size)
++ data = er32(LEDCTL);
++ ret_val = e1000_write_phy_reg_hv_locked(hw, HV_LED_CONFIG,
++ (u16)data);
++ if (ret_val)
+ goto out;
++ }
+
+- cnf_base_addr = data & E1000_EXTCNF_CTRL_EXT_CNF_POINTER_MASK;
+- cnf_base_addr >>= E1000_EXTCNF_CTRL_EXT_CNF_POINTER_SHIFT;
+-
+- if (!(data & E1000_EXTCNF_CTRL_OEM_WRITE_ENABLE) &&
+- (hw->mac.type == e1000_pchlan)) {
+- /*
+- * HW configures the SMBus address and LEDs when the
+- * OEM and LCD Write Enable bits are set in the NVM.
+- * When both NVM bits are cleared, SW will configure
+- * them instead.
+- */
+- data = er32(STRAP);
+- data &= E1000_STRAP_SMBUS_ADDRESS_MASK;
+- reg_data = data >> E1000_STRAP_SMBUS_ADDRESS_SHIFT;
+- reg_data |= HV_SMB_ADDR_PEC_EN | HV_SMB_ADDR_VALID;
+- ret_val = e1000_write_phy_reg_hv_locked(hw, HV_SMB_ADDR,
+- reg_data);
+- if (ret_val)
+- goto out;
+-
+- data = er32(LEDCTL);
+- ret_val = e1000_write_phy_reg_hv_locked(hw,
+- HV_LED_CONFIG,
+- (u16)data);
+- if (ret_val)
+- goto out;
+- }
+- /* Configure LCD from extended configuration region. */
++ /* Configure LCD from extended configuration region. */
+
+- /* cnf_base_addr is in DWORD */
+- word_addr = (u16)(cnf_base_addr << 1);
++ /* cnf_base_addr is in DWORD */
++ word_addr = (u16)(cnf_base_addr << 1);
+
+- for (i = 0; i < cnf_size; i++) {
+- ret_val = e1000_read_nvm(hw, (word_addr + i * 2), 1,
+- ®_data);
+- if (ret_val)
+- goto out;
++ for (i = 0; i < cnf_size; i++) {
++ ret_val = e1000_read_nvm(hw, (word_addr + i * 2), 1,
++ ®_data);
++ if (ret_val)
++ goto out;
+
+- ret_val = e1000_read_nvm(hw, (word_addr + i * 2 + 1),
+- 1, ®_addr);
+- if (ret_val)
+- goto out;
++ ret_val = e1000_read_nvm(hw, (word_addr + i * 2 + 1),
++ 1, ®_addr);
++ if (ret_val)
++ goto out;
+
+- /* Save off the PHY page for future writes. */
+- if (reg_addr == IGP01E1000_PHY_PAGE_SELECT) {
+- phy_page = reg_data;
+- continue;
+- }
++ /* Save off the PHY page for future writes. */
++ if (reg_addr == IGP01E1000_PHY_PAGE_SELECT) {
++ phy_page = reg_data;
++ continue;
++ }
+
+- reg_addr &= PHY_REG_MASK;
+- reg_addr |= phy_page;
++ reg_addr &= PHY_REG_MASK;
++ reg_addr |= phy_page;
+
+- ret_val = phy->ops.write_reg_locked(hw,
+- (u32)reg_addr,
+- reg_data);
+- if (ret_val)
+- goto out;
+- }
++ ret_val = phy->ops.write_reg_locked(hw, (u32)reg_addr,
++ reg_data);
++ if (ret_val)
++ goto out;
+ }
+
+ out:
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0090-e1000e-Incorrect-function-pointer-set-for-force_spee.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0090-e1000e-Incorrect-function-pointer-set-for-force_spee.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,76 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Mon, 10 May 2010 15:01:30 +0000
+Subject: [PATCH 090/166] e1000e: Incorrect function pointer set for
+ force_speed_duplex on 82577
+
+commit eab50ffb222808b5053a82325be3e5d26faa08df upstream.
+
+The force_speed_duplex function pointer was incorrectly set. Instead of
+calling the 82577-specific version it was calling the m88 version which,
+among other incorrect things, reset the PHY causing autonegotiation to be
+re-enabled in the PHY resulting in the link defaulting to half-duplex.
+The 82577-specific force_speed_duplex function also had an issue where
+it disabled Auto-MDI-X which caused the link to not come up.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/ich8lan.c | 1 +
+ drivers/net/e1000e/phy.c | 21 +--------------------
+ 2 files changed, 2 insertions(+), 20 deletions(-)
+
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index 61f8927..e1f244a 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -330,6 +330,7 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw)
+ phy->ops.get_cable_length = e1000_get_cable_length_82577;
+ phy->ops.get_info = e1000_get_phy_info_82577;
+ phy->ops.commit = e1000e_phy_sw_reset;
++ break;
+ case e1000_phy_82578:
+ phy->ops.check_polarity = e1000_check_polarity_m88;
+ phy->ops.force_speed_duplex = e1000e_phy_force_speed_duplex_m88;
+diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c
+index 7f3ceb9..b4ac82d 100644
+--- a/drivers/net/e1000e/phy.c
++++ b/drivers/net/e1000e/phy.c
+@@ -3116,9 +3116,7 @@ s32 e1000_check_polarity_82577(struct e1000_hw *hw)
+ * e1000_phy_force_speed_duplex_82577 - Force speed/duplex for I82577 PHY
+ * @hw: pointer to the HW structure
+ *
+- * Calls the PHY setup function to force speed and duplex. Clears the
+- * auto-crossover to force MDI manually. Waits for link and returns
+- * successful if link up is successful, else -E1000_ERR_PHY (-2).
++ * Calls the PHY setup function to force speed and duplex.
+ **/
+ s32 e1000_phy_force_speed_duplex_82577(struct e1000_hw *hw)
+ {
+@@ -3137,23 +3135,6 @@ s32 e1000_phy_force_speed_duplex_82577(struct e1000_hw *hw)
+ if (ret_val)
+ goto out;
+
+- /*
+- * Clear Auto-Crossover to force MDI manually. 82577 requires MDI
+- * forced whenever speed and duplex are forced.
+- */
+- ret_val = phy->ops.read_reg(hw, I82577_PHY_CTRL_2, &phy_data);
+- if (ret_val)
+- goto out;
+-
+- phy_data &= ~I82577_PHY_CTRL2_AUTO_MDIX;
+- phy_data &= ~I82577_PHY_CTRL2_FORCE_MDI_MDIX;
+-
+- ret_val = phy->ops.write_reg(hw, I82577_PHY_CTRL_2, phy_data);
+- if (ret_val)
+- goto out;
+-
+- e_dbg("I82577_PHY_CTRL_2: %X\n", phy_data);
+-
+ udelay(1);
+
+ if (phy->autoneg_wait_to_complete) {
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0091-e1000e-fix-checks-for-manageability-enabled-and-mana.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0091-e1000e-fix-checks-for-manageability-enabled-and-mana.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,220 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Mon, 10 May 2010 15:01:51 +0000
+Subject: [PATCH 091/166] e1000e: fix checks for manageability enabled and
+ management pass-through
+
+commit a65a4a0d51eaf9e5715dc24f8820c8689c3719a5 upstream.
+
+The mac->arc_subsystem was being incorrectly used to flag whether or not
+manageability was enabled when it should only be used to state whether the
+ARC (Host interface) subsystem is available on a particular MAC _and_ only
+valid when any manageability is enabled. The ARC subsystem is currently
+only available on 80003es2lan and 82573 parts supported by the driver.
+
+A new flag, has_fwsm, is introduced to be used when checking if
+manageability is enabled but only on parts that acutally have an FWSM
+register. While the above parts have an FWSM register, there are other
+parts that have FWSM but do not have support for the ARC subsystem,
+namely 82571/2 and ICHx/PCH.
+
+And then there are parts that have manageability, but do not have either
+FWSM register or support for the ARC subsystem - these are 82574 and 82583.
+
+For 80003es2lan, 82571/2/3 and ICH/PCH parts, this patch makes no
+functional changes, it only corrects the usage of the manageability flags.
+For 82574 and 82583, it fixes the incorrect accesses of the non-existent
+FWSM register and ARC subsystem as well as corrects the check for
+management pass-through.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/82571.c | 19 +++++++++++++++----
+ drivers/net/e1000e/defines.h | 2 ++
+ drivers/net/e1000e/es2lan.c | 9 ++++++---
+ drivers/net/e1000e/hw.h | 1 +
+ drivers/net/e1000e/ich8lan.c | 6 ++++--
+ drivers/net/e1000e/lib.c | 31 ++++++++++++++++++++++++-------
+ 6 files changed, 52 insertions(+), 16 deletions(-)
+
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+index 1e73edd..8bad24d 100644
+--- a/drivers/net/e1000e/82571.c
++++ b/drivers/net/e1000e/82571.c
+@@ -234,9 +234,6 @@ static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter)
+ mac->mta_reg_count = 128;
+ /* Set rar entry count */
+ mac->rar_entry_count = E1000_RAR_ENTRIES;
+- /* Set if manageability features are enabled. */
+- mac->arc_subsystem_valid = (er32(FWSM) & E1000_FWSM_MODE_MASK)
+- ? true : false;
+ /* Adaptive IFS supported */
+ mac->adaptive_ifs = true;
+
+@@ -271,6 +268,16 @@ static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter)
+ func->set_lan_id = e1000_set_lan_id_single_port;
+ func->check_mng_mode = e1000e_check_mng_mode_generic;
+ func->led_on = e1000e_led_on_generic;
++
++ /* FWSM register */
++ mac->has_fwsm = true;
++ /*
++ * ARC supported; valid only if manageability features are
++ * enabled.
++ */
++ mac->arc_subsystem_valid =
++ (er32(FWSM) & E1000_FWSM_MODE_MASK)
++ ? true : false;
+ break;
+ case e1000_82574:
+ case e1000_82583:
+@@ -281,6 +288,9 @@ static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter)
+ default:
+ func->check_mng_mode = e1000e_check_mng_mode_generic;
+ func->led_on = e1000e_led_on_generic;
++
++ /* FWSM register */
++ mac->has_fwsm = true;
+ break;
+ }
+
+@@ -993,9 +1003,10 @@ static s32 e1000_init_hw_82571(struct e1000_hw *hw)
+ /* ...for both queues. */
+ switch (mac->type) {
+ case e1000_82573:
++ e1000e_enable_tx_pkt_filtering(hw);
++ /* fall through */
+ case e1000_82574:
+ case e1000_82583:
+- e1000e_enable_tx_pkt_filtering(hw);
+ reg_data = er32(GCR);
+ reg_data |= E1000_GCR_L1_ACT_WITHOUT_L0S_RX;
+ ew32(GCR, reg_data);
+diff --git a/drivers/net/e1000e/defines.h b/drivers/net/e1000e/defines.h
+index 227147f..4dc02c7 100644
+--- a/drivers/net/e1000e/defines.h
++++ b/drivers/net/e1000e/defines.h
+@@ -629,6 +629,8 @@
+ #define NVM_ALT_MAC_ADDR_PTR 0x0037
+ #define NVM_CHECKSUM_REG 0x003F
+
++#define E1000_NVM_INIT_CTRL2_MNGM 0x6000 /* Manageability Operation Mode mask */
++
+ #define E1000_NVM_CFG_DONE_PORT_0 0x40000 /* MNG config cycle done */
+ #define E1000_NVM_CFG_DONE_PORT_1 0x80000 /* ...for second port */
+
+diff --git a/drivers/net/e1000e/es2lan.c b/drivers/net/e1000e/es2lan.c
+index 27d2158..7fcac78 100644
+--- a/drivers/net/e1000e/es2lan.c
++++ b/drivers/net/e1000e/es2lan.c
+@@ -221,9 +221,12 @@ static s32 e1000_init_mac_params_80003es2lan(struct e1000_adapter *adapter)
+ mac->mta_reg_count = 128;
+ /* Set rar entry count */
+ mac->rar_entry_count = E1000_RAR_ENTRIES;
+- /* Set if manageability features are enabled. */
+- mac->arc_subsystem_valid = (er32(FWSM) & E1000_FWSM_MODE_MASK)
+- ? true : false;
++ /* FWSM register */
++ mac->has_fwsm = true;
++ /* ARC supported; valid only if manageability features are enabled. */
++ mac->arc_subsystem_valid =
++ (er32(FWSM) & E1000_FWSM_MODE_MASK)
++ ? true : false;
+ /* Adaptive IFS not supported */
+ mac->adaptive_ifs = false;
+
+diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h
+index 49d19d8..405ef4d 100644
+--- a/drivers/net/e1000e/hw.h
++++ b/drivers/net/e1000e/hw.h
+@@ -830,6 +830,7 @@ struct e1000_mac_info {
+ u8 forced_speed_duplex;
+
+ bool adaptive_ifs;
++ bool has_fwsm;
+ bool arc_subsystem_valid;
+ bool autoneg;
+ bool autoneg_failed;
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index e1f244a..8efe9a7 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -503,8 +503,10 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_adapter *adapter)
+ mac->rar_entry_count = E1000_ICH_RAR_ENTRIES;
+ if (mac->type == e1000_ich8lan)
+ mac->rar_entry_count--;
+- /* Set if manageability features are enabled. */
+- mac->arc_subsystem_valid = true;
++ /* FWSM register */
++ mac->has_fwsm = true;
++ /* ARC subsystem not supported */
++ mac->arc_subsystem_valid = false;
+ /* Adaptive IFS supported */
+ mac->adaptive_ifs = true;
+
+diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c
+index b32361d..a968e3a 100644
+--- a/drivers/net/e1000e/lib.c
++++ b/drivers/net/e1000e/lib.c
+@@ -2272,6 +2272,11 @@ static s32 e1000_mng_enable_host_if(struct e1000_hw *hw)
+ u32 hicr;
+ u8 i;
+
++ if (!(hw->mac.arc_subsystem_valid)) {
++ e_dbg("ARC subsystem not valid.\n");
++ return -E1000_ERR_HOST_INTERFACE_COMMAND;
++ }
++
+ /* Check that the host interface is enabled. */
+ hicr = er32(HICR);
+ if ((hicr & E1000_HICR_EN) == 0) {
+@@ -2530,9 +2535,9 @@ bool e1000e_enable_mng_pass_thru(struct e1000_hw *hw)
+ manc = er32(MANC);
+
+ if (!(manc & E1000_MANC_RCV_TCO_EN))
+- return ret_val;
++ goto out;
+
+- if (hw->mac.arc_subsystem_valid) {
++ if (hw->mac.has_fwsm) {
+ fwsm = er32(FWSM);
+ factps = er32(FACTPS);
+
+@@ -2540,16 +2545,28 @@ bool e1000e_enable_mng_pass_thru(struct e1000_hw *hw)
+ ((fwsm & E1000_FWSM_MODE_MASK) ==
+ (e1000_mng_mode_pt << E1000_FWSM_MODE_SHIFT))) {
+ ret_val = true;
+- return ret_val;
++ goto out;
+ }
+- } else {
+- if ((manc & E1000_MANC_SMBUS_EN) &&
+- !(manc & E1000_MANC_ASF_EN)) {
++ } else if ((hw->mac.type == e1000_82574) ||
++ (hw->mac.type == e1000_82583)) {
++ u16 data;
++
++ factps = er32(FACTPS);
++ e1000_read_nvm(hw, NVM_INIT_CONTROL2_REG, 1, &data);
++
++ if (!(factps & E1000_FACTPS_MNGCG) &&
++ ((data & E1000_NVM_INIT_CTRL2_MNGM) ==
++ (e1000_mng_mode_pt << 13))) {
+ ret_val = true;
+- return ret_val;
++ goto out;
+ }
++ } else if ((manc & E1000_MANC_SMBUS_EN) &&
++ !(manc & E1000_MANC_ASF_EN)) {
++ ret_val = true;
++ goto out;
+ }
+
++out:
+ return ret_val;
+ }
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0092-e1000e-move-settting-of-flow-control-refresh-timer-t.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0092-e1000e-move-settting-of-flow-control-refresh-timer-t.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,71 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Mon, 10 May 2010 15:02:12 +0000
+Subject: [PATCH 092/166] e1000e: move settting of flow control refresh timer
+ to link setup code
+
+commit a305595b127fdbe7ab5ba458f7ee470a82a3b82c upstream.
+
+The flow control refresh timer value needs to be saved off so that it can
+be programmed into the approrpiate register when applicable but without a
+reset, e.g. when changing flow control parameters via ethtool.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/hw.h | 1 +
+ drivers/net/e1000e/ich8lan.c | 2 ++
+ drivers/net/e1000e/netdev.c | 5 +----
+ 3 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h
+index 405ef4d..6ea0225 100644
+--- a/drivers/net/e1000e/hw.h
++++ b/drivers/net/e1000e/hw.h
+@@ -901,6 +901,7 @@ struct e1000_fc_info {
+ u32 high_water; /* Flow control high-water mark */
+ u32 low_water; /* Flow control low-water mark */
+ u16 pause_time; /* Flow control pause timer */
++ u16 refresh_time; /* Flow control refresh timer */
+ bool send_xon; /* Flow control send XON */
+ bool strict_ieee; /* Strict IEEE mode */
+ enum e1000_fc_mode current_mode; /* FC mode in effect */
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index 8efe9a7..2b2cffc 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -2823,6 +2823,8 @@ static s32 e1000_setup_link_ich8lan(struct e1000_hw *hw)
+ ew32(FCTTV, hw->fc.pause_time);
+ if ((hw->phy.type == e1000_phy_82578) ||
+ (hw->phy.type == e1000_phy_82577)) {
++ ew32(FCRTV_PCH, hw->fc.refresh_time);
++
+ ret_val = hw->phy.ops.write_reg(hw,
+ PHY_REG(BM_PORT_CTRL_PAGE, 27),
+ hw->fc.pause_time);
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 5a5ea42..8be58f0 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -3135,6 +3135,7 @@ void e1000e_reset(struct e1000_adapter *adapter)
+ fc->high_water = 0x5000;
+ fc->low_water = 0x3000;
+ }
++ fc->refresh_time = 0x1000;
+ } else {
+ if ((adapter->flags & FLAG_HAS_ERT) &&
+ (adapter->netdev->mtu > ETH_DATA_LEN))
+@@ -3172,10 +3173,6 @@ void e1000e_reset(struct e1000_adapter *adapter)
+ if (mac->ops.init_hw(hw))
+ e_err("Hardware Error\n");
+
+- /* additional part of the flow-control workaround above */
+- if (hw->mac.type == e1000_pchlan)
+- ew32(FCRTV_PCH, 0x1000);
+-
+ e1000_update_mng_vlan(adapter);
+
+ /* Enable h/w to recognize an 802.1Q VLAN Ethernet packet */
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0093-e1000e-Fix-cleanup-PHY-reset-code-for-ICHx-PCHx.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0093-e1000e-Fix-cleanup-PHY-reset-code-for-ICHx-PCHx.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,279 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Mon, 10 May 2010 15:02:32 +0000
+Subject: [PATCH 093/166] e1000e: Fix/cleanup PHY reset code for ICHx/PCHx
+
+commit e98cac447cc1cc418dff1d610a5c79c4f2bdec7f upstream.
+
+i) Fixes a bug where e1000_sw_lcd_config_ich8lan() was calling
+e1000_lan_init_done_ich8lan() to poll the STATUS.LAN_INIT_DONE bit to
+make sure the MAC had completed the PHY configuration. However,
+e1000_lan_init_done_ich8lan() had already been called in one of the two
+places where PHY reset occurs for ICHx/PCHx parts, which caused the second
+call to busy-wait for 150 msec because the LAN_INIT_DONE bit had already
+been checked and cleared.
+
+ii) Cleanup the two separate PHY reset code paths, i.e. the full-chip reset
+in e1000_reset_hw_ich8lan() and the PHY-only reset in
+e1000_phy_hw_reset_ich8lan(). There was duplicate code in both paths to be
+performed post-reset that are now combined into one new function -
+e1000_post_phy_reset_ich8lan(). This cleanup also included moving the
+clearing of the PHY Reset Asserted bit in the STATUS register (now done for
+all ICH/PCH parts) and the check for the indication from h/w that basic
+configuration has completed back to where it previously was in
+e1000_get_cfg_done_ich8lan().
+
+iii) Corrected a few comments
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/ich8lan.c | 149 +++++++++++++++++++++---------------------
+ 1 files changed, 75 insertions(+), 74 deletions(-)
+
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index 2b2cffc..10360fb 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -850,9 +850,6 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw)
+ if (!(data & sw_cfg_mask))
+ goto out;
+
+- /* Wait for basic configuration completes before proceeding */
+- e1000_lan_init_done_ich8lan(hw);
+-
+ /*
+ * Make sure HW does not configure LCD from PHY
+ * extended configuration before SW configuration
+@@ -1260,30 +1257,26 @@ static void e1000_lan_init_done_ich8lan(struct e1000_hw *hw)
+ }
+
+ /**
+- * e1000_phy_hw_reset_ich8lan - Performs a PHY reset
++ * e1000_post_phy_reset_ich8lan - Perform steps required after a PHY reset
+ * @hw: pointer to the HW structure
+- *
+- * Resets the PHY
+- * This is a function pointer entry point called by drivers
+- * or other shared routines.
+ **/
+-static s32 e1000_phy_hw_reset_ich8lan(struct e1000_hw *hw)
++static s32 e1000_post_phy_reset_ich8lan(struct e1000_hw *hw)
+ {
+ s32 ret_val = 0;
+ u16 reg;
+
+- ret_val = e1000e_phy_hw_reset_generic(hw);
+- if (ret_val)
+- return ret_val;
+-
+- /* Allow time for h/w to get to a quiescent state after reset */
+- mdelay(10);
++ if (e1000_check_reset_block(hw))
++ goto out;
+
+ /* Perform any necessary post-reset workarounds */
+- if (hw->mac.type == e1000_pchlan) {
++ switch (hw->mac.type) {
++ case e1000_pchlan:
+ ret_val = e1000_hv_phy_workarounds_ich8lan(hw);
+ if (ret_val)
+- return ret_val;
++ goto out;
++ break;
++ default:
++ break;
+ }
+
+ /* Dummy read to clear the phy wakeup bit after lcd reset */
+@@ -1296,11 +1289,32 @@ static s32 e1000_phy_hw_reset_ich8lan(struct e1000_hw *hw)
+ goto out;
+
+ /* Configure the LCD with the OEM bits in NVM */
+- if (hw->mac.type == e1000_pchlan)
+- ret_val = e1000_oem_bits_config_ich8lan(hw, true);
++ ret_val = e1000_oem_bits_config_ich8lan(hw, true);
+
+ out:
+- return 0;
++ return ret_val;
++}
++
++/**
++ * e1000_phy_hw_reset_ich8lan - Performs a PHY reset
++ * @hw: pointer to the HW structure
++ *
++ * Resets the PHY
++ * This is a function pointer entry point called by drivers
++ * or other shared routines.
++ **/
++static s32 e1000_phy_hw_reset_ich8lan(struct e1000_hw *hw)
++{
++ s32 ret_val = 0;
++
++ ret_val = e1000e_phy_hw_reset_generic(hw);
++ if (ret_val)
++ goto out;
++
++ ret_val = e1000_post_phy_reset_ich8lan(hw);
++
++out:
++ return ret_val;
+ }
+
+ /**
+@@ -2511,9 +2525,8 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
+ * on the last TLP read/write transaction when MAC is reset.
+ */
+ ret_val = e1000e_disable_pcie_master(hw);
+- if (ret_val) {
++ if (ret_val)
+ e_dbg("PCI-E Master disable polling has failed.\n");
+- }
+
+ e_dbg("Masking off all interrupts\n");
+ ew32(IMC, 0xffffffff);
+@@ -2552,14 +2565,8 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
+ ctrl = er32(CTRL);
+
+ if (!e1000_check_reset_block(hw)) {
+- /* Clear PHY Reset Asserted bit */
+- if (hw->mac.type >= e1000_pchlan) {
+- u32 status = er32(STATUS);
+- ew32(STATUS, status & ~E1000_STATUS_PHYRA);
+- }
+-
+ /*
+- * PHY HW reset requires MAC CORE reset at the same
++ * Full-chip reset requires MAC and PHY reset at the same
+ * time to make sure the interface between MAC and the
+ * external PHY is reset.
+ */
+@@ -2573,39 +2580,16 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
+ if (!ret_val)
+ e1000_release_swflag_ich8lan(hw);
+
+- /* Perform any necessary post-reset workarounds */
+- if (hw->mac.type == e1000_pchlan)
+- ret_val = e1000_hv_phy_workarounds_ich8lan(hw);
+-
+- if (ctrl & E1000_CTRL_PHY_RST)
++ if (ctrl & E1000_CTRL_PHY_RST) {
+ ret_val = hw->phy.ops.get_cfg_done(hw);
++ if (ret_val)
++ goto out;
+
+- if (hw->mac.type >= e1000_ich10lan) {
+- e1000_lan_init_done_ich8lan(hw);
+- } else {
+- ret_val = e1000e_get_auto_rd_done(hw);
+- if (ret_val) {
+- /*
+- * When auto config read does not complete, do not
+- * return with an error. This can happen in situations
+- * where there is no eeprom and prevents getting link.
+- */
+- e_dbg("Auto Read Done did not complete\n");
+- }
+- }
+- /* Dummy read to clear the phy wakeup bit after lcd reset */
+- if (hw->mac.type == e1000_pchlan)
+- e1e_rphy(hw, BM_WUC, ®);
+-
+- ret_val = e1000_sw_lcd_config_ich8lan(hw);
+- if (ret_val)
+- goto out;
+-
+- if (hw->mac.type == e1000_pchlan) {
+- ret_val = e1000_oem_bits_config_ich8lan(hw, true);
++ ret_val = e1000_post_phy_reset_ich8lan(hw);
+ if (ret_val)
+ goto out;
+ }
++
+ /*
+ * For PCH, this write will make sure that any noise
+ * will be detected as a CRC error and be dropped rather than show up
+@@ -3291,33 +3275,50 @@ static s32 e1000_led_off_pchlan(struct e1000_hw *hw)
+ }
+
+ /**
+- * e1000_get_cfg_done_ich8lan - Read config done bit
++ * e1000_get_cfg_done_ich8lan - Read config done bit after Full or PHY reset
+ * @hw: pointer to the HW structure
+ *
+- * Read the management control register for the config done bit for
+- * completion status. NOTE: silicon which is EEPROM-less will fail trying
+- * to read the config done bit, so an error is *ONLY* logged and returns
+- * 0. If we were to return with error, EEPROM-less silicon
+- * would not be able to be reset or change link.
++ * Read appropriate register for the config done bit for completion status
++ * and configure the PHY through s/w for EEPROM-less parts.
++ *
++ * NOTE: some silicon which is EEPROM-less will fail trying to read the
++ * config done bit, so only an error is logged and continues. If we were
++ * to return with error, EEPROM-less silicon would not be able to be reset
++ * or change link.
+ **/
+ static s32 e1000_get_cfg_done_ich8lan(struct e1000_hw *hw)
+ {
++ s32 ret_val = 0;
+ u32 bank = 0;
++ u32 status;
+
+- if (hw->mac.type >= e1000_pchlan) {
+- u32 status = er32(STATUS);
++ e1000e_get_cfg_done(hw);
+
+- if (status & E1000_STATUS_PHYRA)
+- ew32(STATUS, status & ~E1000_STATUS_PHYRA);
+- else
+- e_dbg("PHY Reset Asserted not set - needs delay\n");
++ /* Wait for indication from h/w that it has completed basic config */
++ if (hw->mac.type >= e1000_ich10lan) {
++ e1000_lan_init_done_ich8lan(hw);
++ } else {
++ ret_val = e1000e_get_auto_rd_done(hw);
++ if (ret_val) {
++ /*
++ * When auto config read does not complete, do not
++ * return with an error. This can happen in situations
++ * where there is no eeprom and prevents getting link.
++ */
++ e_dbg("Auto Read Done did not complete\n");
++ ret_val = 0;
++ }
+ }
+
+- e1000e_get_cfg_done(hw);
++ /* Clear PHY Reset Asserted bit */
++ status = er32(STATUS);
++ if (status & E1000_STATUS_PHYRA)
++ ew32(STATUS, status & ~E1000_STATUS_PHYRA);
++ else
++ e_dbg("PHY Reset Asserted not set - needs delay\n");
+
+ /* If EEPROM is not marked present, init the IGP 3 PHY manually */
+- if ((hw->mac.type != e1000_ich10lan) &&
+- (hw->mac.type != e1000_pchlan)) {
++ if (hw->mac.type <= e1000_ich9lan) {
+ if (((er32(EECD) & E1000_EECD_PRES) == 0) &&
+ (hw->phy.type == e1000_phy_igp_3)) {
+ e1000e_phy_init_script_igp3(hw);
+@@ -3326,11 +3327,11 @@ static s32 e1000_get_cfg_done_ich8lan(struct e1000_hw *hw)
+ if (e1000_valid_nvm_bank_detect_ich8lan(hw, &bank)) {
+ /* Maybe we should do a basic PHY config */
+ e_dbg("EEPROM not present\n");
+- return -E1000_ERR_CONFIG;
++ ret_val = -E1000_ERR_CONFIG;
+ }
+ }
+
+- return 0;
++ return ret_val;
+ }
+
+ /**
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0094-e1000e-add-PCI-device-id-to-enable-support-for-82567.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0094-e1000e-add-PCI-device-id-to-enable-support-for-82567.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,42 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Mon, 10 May 2010 15:02:52 +0000
+Subject: [PATCH 094/166] e1000e: add PCI device id to enable support for
+ 82567V-4
+
+commit 10df0b9116e2039d5585a196753e5f36d7afcba2 upstream.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/hw.h | 1 +
+ drivers/net/e1000e/netdev.c | 1 +
+ 2 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h
+index 6ea0225..664ed58 100644
+--- a/drivers/net/e1000e/hw.h
++++ b/drivers/net/e1000e/hw.h
+@@ -382,6 +382,7 @@ enum e1e_registers {
+ #define E1000_DEV_ID_ICH10_R_BM_V 0x10CE
+ #define E1000_DEV_ID_ICH10_D_BM_LM 0x10DE
+ #define E1000_DEV_ID_ICH10_D_BM_LF 0x10DF
++#define E1000_DEV_ID_ICH10_D_BM_V 0x1525
+ #define E1000_DEV_ID_PCH_M_HV_LM 0x10EA
+ #define E1000_DEV_ID_PCH_M_HV_LC 0x10EB
+ #define E1000_DEV_ID_PCH_D_HV_DM 0x10EF
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 8be58f0..02a91ef 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -5901,6 +5901,7 @@ static DEFINE_PCI_DEVICE_TABLE(e1000_pci_tbl) = {
+
+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH10_D_BM_LM), board_ich10lan },
+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH10_D_BM_LF), board_ich10lan },
++ { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH10_D_BM_V), board_ich10lan },
+
+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_M_HV_LM), board_pchlan },
+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_M_HV_LC), board_pchlan },
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0095-drivers-net-Remove-unnecessary-returns-from-void-fun.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0095-drivers-net-Remove-unnecessary-returns-from-void-fun.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,143 @@
+From: Joe Perches <joe at perches.com>
+Date: Fri, 14 May 2010 00:19:28 -0700
+Subject: [PATCH 095/166] drivers/net: Remove unnecessary returns from void
+ function()s
+
+commit a4b770972b8f819e408d7cc3ae9637e15bff62f6 upstream.
+
+This patch removes from drivers/net/ all the unnecessary
+return; statements that precede the last closing brace of
+void functions.
+
+It does not remove the returns that are immediately
+preceded by a label as gcc doesn't like that.
+
+It also does not remove null void functions with return.
+
+Done via:
+$ grep -rP --include=*.[ch] -l "return;\n}" net/ | \
+ xargs perl -i -e 'local $/ ; while (<>) { s/\n[ \t\n]+return;\n}/\n}/g; print; }'
+
+with some cleanups by hand.
+
+Compile tested x86 allmodconfig only.
+
+Signed-off-by: Joe Perches <joe at perches.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Restricted to drivers/net/e1000e]
+---
+ drivers/net/e1000e/82571.c | 4 ----
+ drivers/net/e1000e/es2lan.c | 2 --
+ drivers/net/e1000e/ich8lan.c | 10 ----------
+ drivers/net/e1000e/netdev.c | 4 ----
+ 4 files changed, 0 insertions(+), 20 deletions(-)
+
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+index 8bad24d..f654db9 100644
+--- a/drivers/net/e1000e/82571.c
++++ b/drivers/net/e1000e/82571.c
+@@ -1148,8 +1148,6 @@ static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw)
+ default:
+ break;
+ }
+-
+- return;
+ }
+
+ /**
+@@ -1653,8 +1651,6 @@ static void e1000_power_down_phy_copper_82571(struct e1000_hw *hw)
+ /* If the management interface is not enabled, then power down */
+ if (!(mac->ops.check_mng_mode(hw) || phy->ops.check_reset_block(hw)))
+ e1000_power_down_phy_copper(hw);
+-
+- return;
+ }
+
+ /**
+diff --git a/drivers/net/e1000e/es2lan.c b/drivers/net/e1000e/es2lan.c
+index 7fcac78..38d79a6 100644
+--- a/drivers/net/e1000e/es2lan.c
++++ b/drivers/net/e1000e/es2lan.c
+@@ -1383,8 +1383,6 @@ static void e1000_power_down_phy_copper_80003es2lan(struct e1000_hw *hw)
+ if (!(hw->mac.ops.check_mng_mode(hw) ||
+ hw->phy.ops.check_reset_block(hw)))
+ e1000_power_down_phy_copper(hw);
+-
+- return;
+ }
+
+ /**
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index 10360fb..b2507d9 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -690,8 +690,6 @@ static s32 e1000_acquire_nvm_ich8lan(struct e1000_hw *hw)
+ static void e1000_release_nvm_ich8lan(struct e1000_hw *hw)
+ {
+ mutex_unlock(&nvm_mutex);
+-
+- return;
+ }
+
+ static DEFINE_MUTEX(swflag_mutex);
+@@ -770,8 +768,6 @@ static void e1000_release_swflag_ich8lan(struct e1000_hw *hw)
+ ew32(EXTCNF_CTRL, extcnf_ctrl);
+
+ mutex_unlock(&swflag_mutex);
+-
+- return;
+ }
+
+ /**
+@@ -2756,8 +2752,6 @@ static void e1000_initialize_hw_bits_ich8lan(struct e1000_hw *hw)
+ reg = er32(RFCTL);
+ reg |= (E1000_RFCTL_NFSW_DIS | E1000_RFCTL_NFSR_DIS);
+ ew32(RFCTL, reg);
+-
+- return;
+ }
+
+ /**
+@@ -3137,8 +3131,6 @@ void e1000e_disable_gig_wol_ich8lan(struct e1000_hw *hw)
+ default:
+ break;
+ }
+-
+- return;
+ }
+
+ /**
+@@ -3347,8 +3339,6 @@ static void e1000_power_down_phy_copper_ich8lan(struct e1000_hw *hw)
+ if (!(hw->mac.ops.check_mng_mode(hw) ||
+ hw->phy.ops.check_reset_block(hw)))
+ e1000_power_down_phy_copper(hw);
+-
+- return;
+ }
+
+ /**
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 02a91ef..d916b52 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -1767,8 +1767,6 @@ void e1000e_reset_interrupt_capability(struct e1000_adapter *adapter)
+ pci_disable_msi(adapter->pdev);
+ adapter->flags &= ~FLAG_MSI_ENABLED;
+ }
+-
+- return;
+ }
+
+ /**
+@@ -1820,8 +1818,6 @@ void e1000e_set_interrupt_capability(struct e1000_adapter *adapter)
+ /* Don't do anything; this is the system default */
+ break;
+ }
+-
+- return;
+ }
+
+ /**
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0096-e1000e-change-logical-negate-to-bitwise.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0096-e1000e-change-logical-negate-to-bitwise.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,33 @@
+From: Dan Carpenter <error27 at gmail.com>
+Date: Wed, 2 Jun 2010 13:43:15 +0000
+Subject: [PATCH 096/166] e1000e: change logical negate to bitwise
+
+commit 3b21b508ecc9e043839a5337563cfc77f9fcedb9 upstream.
+
+The bitwise negate is intended here. With the logical negate the
+condition is always false.
+
+Signed-off-by: Dan Carpenter <error27 at gmail.com>
+Acked-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/netdev.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index d916b52..2c112c7 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -2554,7 +2554,7 @@ static void e1000_init_manageability_pt(struct e1000_adapter *adapter)
+ mdef = er32(MDEF(i));
+
+ /* Ignore filters with anything other than IPMI ports */
+- if (mdef & !(E1000_MDEF_PORT_623 | E1000_MDEF_PORT_664))
++ if (mdef & ~(E1000_MDEF_PORT_623 | E1000_MDEF_PORT_664))
+ continue;
+
+ /* Enable this decision filter in MANC2H */
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0097-e1000e-cleanup-ethtool-loopback-setup-code.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0097-e1000e-cleanup-ethtool-loopback-setup-code.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,125 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Wed, 16 Jun 2010 13:25:55 +0000
+Subject: [PATCH 097/166] e1000e: cleanup ethtool loopback setup code
+
+commit 3af50481eee6bb278da9050266ff31804e7a57d6 upstream.
+
+Refactor the loopback setup code to first handle the only 10/100 PHY
+supported by the driver if applicable and then handle the 1Gig PHYs in a
+switch statement for PHY-specific setups.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Emil Tantilov <emil.s.tantilov at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/ethtool.c | 74 ++++++++++++++++++++++++------------------
+ 1 files changed, 42 insertions(+), 32 deletions(-)
+
+diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
+index 2c52121..86c6a26 100644
+--- a/drivers/net/e1000e/ethtool.c
++++ b/drivers/net/e1000e/ethtool.c
+@@ -1263,33 +1263,36 @@ static int e1000_integrated_phy_loopback(struct e1000_adapter *adapter)
+
+ hw->mac.autoneg = 0;
+
+- /* Workaround: K1 must be disabled for stable 1Gbps operation */
+- if (hw->mac.type == e1000_pchlan)
+- e1000_configure_k1_ich8lan(hw, false);
+-
+- if (hw->phy.type == e1000_phy_m88) {
+- /* Auto-MDI/MDIX Off */
+- e1e_wphy(hw, M88E1000_PHY_SPEC_CTRL, 0x0808);
+- /* reset to update Auto-MDI/MDIX */
+- e1e_wphy(hw, PHY_CONTROL, 0x9140);
+- /* autoneg off */
+- e1e_wphy(hw, PHY_CONTROL, 0x8140);
+- } else if (hw->phy.type == e1000_phy_gg82563)
+- e1e_wphy(hw, GG82563_PHY_KMRN_MODE_CTRL, 0x1CC);
+-
+- ctrl_reg = er32(CTRL);
+-
+- switch (hw->phy.type) {
+- case e1000_phy_ife:
++ if (hw->phy.type == e1000_phy_ife) {
+ /* force 100, set loopback */
+ e1e_wphy(hw, PHY_CONTROL, 0x6100);
+
+ /* Now set up the MAC to the same speed/duplex as the PHY. */
++ ctrl_reg = er32(CTRL);
+ ctrl_reg &= ~E1000_CTRL_SPD_SEL; /* Clear the speed sel bits */
+ ctrl_reg |= (E1000_CTRL_FRCSPD | /* Set the Force Speed Bit */
+ E1000_CTRL_FRCDPX | /* Set the Force Duplex Bit */
+ E1000_CTRL_SPD_100 |/* Force Speed to 100 */
+ E1000_CTRL_FD); /* Force Duplex to FULL */
++
++ ew32(CTRL, ctrl_reg);
++ udelay(500);
++
++ return 0;
++ }
++
++ /* Specific PHY configuration for loopback */
++ switch (hw->phy.type) {
++ case e1000_phy_m88:
++ /* Auto-MDI/MDIX Off */
++ e1e_wphy(hw, M88E1000_PHY_SPEC_CTRL, 0x0808);
++ /* reset to update Auto-MDI/MDIX */
++ e1e_wphy(hw, PHY_CONTROL, 0x9140);
++ /* autoneg off */
++ e1e_wphy(hw, PHY_CONTROL, 0x8140);
++ break;
++ case e1000_phy_gg82563:
++ e1e_wphy(hw, GG82563_PHY_KMRN_MODE_CTRL, 0x1CC);
+ break;
+ case e1000_phy_bm:
+ /* Set Default MAC Interface speed to 1GB */
+@@ -1312,23 +1315,30 @@ static int e1000_integrated_phy_loopback(struct e1000_adapter *adapter)
+ /* Set Early Link Enable */
+ e1e_rphy(hw, PHY_REG(769, 20), &phy_reg);
+ e1e_wphy(hw, PHY_REG(769, 20), phy_reg | 0x0400);
+- /* fall through */
++ break;
++ case e1000_phy_82577:
++ case e1000_phy_82578:
++ /* Workaround: K1 must be disabled for stable 1Gbps operation */
++ e1000_configure_k1_ich8lan(hw, false);
++ break;
+ default:
+- /* force 1000, set loopback */
+- e1e_wphy(hw, PHY_CONTROL, 0x4140);
+- mdelay(250);
++ break;
++ }
+
+- /* Now set up the MAC to the same speed/duplex as the PHY. */
+- ctrl_reg = er32(CTRL);
+- ctrl_reg &= ~E1000_CTRL_SPD_SEL; /* Clear the speed sel bits */
+- ctrl_reg |= (E1000_CTRL_FRCSPD | /* Set the Force Speed Bit */
+- E1000_CTRL_FRCDPX | /* Set the Force Duplex Bit */
+- E1000_CTRL_SPD_1000 |/* Force Speed to 1000 */
+- E1000_CTRL_FD); /* Force Duplex to FULL */
++ /* force 1000, set loopback */
++ e1e_wphy(hw, PHY_CONTROL, 0x4140);
++ mdelay(250);
+
+- if (adapter->flags & FLAG_IS_ICH)
+- ctrl_reg |= E1000_CTRL_SLU; /* Set Link Up */
+- }
++ /* Now set up the MAC to the same speed/duplex as the PHY. */
++ ctrl_reg = er32(CTRL);
++ ctrl_reg &= ~E1000_CTRL_SPD_SEL; /* Clear the speed sel bits */
++ ctrl_reg |= (E1000_CTRL_FRCSPD | /* Set the Force Speed Bit */
++ E1000_CTRL_FRCDPX | /* Set the Force Duplex Bit */
++ E1000_CTRL_SPD_1000 |/* Force Speed to 1000 */
++ E1000_CTRL_FD); /* Force Duplex to FULL */
++
++ if (adapter->flags & FLAG_IS_ICH)
++ ctrl_reg |= E1000_CTRL_SLU; /* Set Link Up */
+
+ if (hw->phy.media_type == e1000_media_type_copper &&
+ hw->phy.type == e1000_phy_m88) {
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0098-e1000e-cleanup-e1000_sw_lcd_config_ich8lan.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0098-e1000e-cleanup-e1000_sw_lcd_config_ich8lan.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,71 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Wed, 16 Jun 2010 13:26:17 +0000
+Subject: [PATCH 098/166] e1000e: cleanup e1000_sw_lcd_config_ich8lan()
+
+commit 3f0c16e84438d657d29446f85fe375794a93f159 upstream.
+
+Do not acquire and release the PHY unnecessarily for parts that return
+from this workaround without actually accessing the PHY registers.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Jeff Pieper <jeffrey.e.pieper at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/ich8lan.c | 32 +++++++++++++++++++-------------
+ 1 files changed, 19 insertions(+), 13 deletions(-)
+
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index b2507d9..5d8fad3 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -820,14 +820,6 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw)
+ s32 ret_val = 0;
+ u16 word_addr, reg_data, reg_addr, phy_page = 0;
+
+- if (!(hw->mac.type == e1000_ich8lan && phy->type == e1000_phy_igp_3) &&
+- !(hw->mac.type == e1000_pchlan))
+- return ret_val;
+-
+- ret_val = hw->phy.ops.acquire(hw);
+- if (ret_val)
+- return ret_val;
+-
+ /*
+ * Initialize the PHY from the NVM on ICH platforms. This
+ * is needed due to an issue where the NVM configuration is
+@@ -835,12 +827,26 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw)
+ * Therefore, after each PHY reset, we will load the
+ * configuration data out of the NVM manually.
+ */
+- if ((adapter->pdev->device == E1000_DEV_ID_ICH8_IGP_M_AMT) ||
+- (adapter->pdev->device == E1000_DEV_ID_ICH8_IGP_M) ||
+- (hw->mac.type == e1000_pchlan))
++ switch (hw->mac.type) {
++ case e1000_ich8lan:
++ if (phy->type != e1000_phy_igp_3)
++ return ret_val;
++
++ if (adapter->pdev->device == E1000_DEV_ID_ICH8_IGP_AMT) {
++ sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG;
++ break;
++ }
++ /* Fall-thru */
++ case e1000_pchlan:
+ sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG_ICH8M;
+- else
+- sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG;
++ break;
++ default:
++ return ret_val;
++ }
++
++ ret_val = hw->phy.ops.acquire(hw);
++ if (ret_val)
++ return ret_val;
+
+ data = er32(FEXTNVM);
+ if (!(data & sw_cfg_mask))
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0099-e1000e-separate-out-PHY-statistics-register-updates.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0099-e1000e-separate-out-PHY-statistics-register-updates.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,255 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Wed, 16 Jun 2010 13:26:41 +0000
+Subject: [PATCH 099/166] e1000e: separate out PHY statistics register updates
+
+commit 8c7bbb925337705dd1459070ac620aeec6a29666 upstream.
+
+The 82577/82578 parts have half-duplex statistics in PHY registers. These
+need only be read when in half-duplex and should all be read at once rather
+than one at a time to prevent excessive cycles of acquiring/releasing the
+PHY semaphore.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Jeff Pieper <jeffrey.e.pieper at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/e1000.h | 1 +
+ drivers/net/e1000e/ich8lan.c | 1 +
+ drivers/net/e1000e/netdev.c | 171 ++++++++++++++++++++++++++++++------------
+ 3 files changed, 126 insertions(+), 47 deletions(-)
+
+diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
+index c0b3db4..79e7c4c 100644
+--- a/drivers/net/e1000e/e1000.h
++++ b/drivers/net/e1000e/e1000.h
+@@ -421,6 +421,7 @@ struct e1000_info {
+ #define FLAG2_HAS_PHY_WAKEUP (1 << 1)
+ #define FLAG2_IS_DISCARDING (1 << 2)
+ #define FLAG2_DISABLE_ASPM_L1 (1 << 3)
++#define FLAG2_HAS_PHY_STATS (1 << 4)
+
+ #define E1000_RX_DESC_PS(R, i) \
+ (&(((union e1000_rx_desc_packet_split *)((R).desc))[i]))
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index 5d8fad3..70cd681 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -3503,6 +3503,7 @@ struct e1000_info e1000_pch_info = {
+ | FLAG_HAS_JUMBO_FRAMES
+ | FLAG_DISABLE_FC_PAUSE_TIME /* errata */
+ | FLAG_APME_IN_WUC,
++ .flags2 = FLAG2_HAS_PHY_STATS,
+ .pba = 26,
+ .max_hw_frame_size = 4096,
+ .get_variants = e1000_get_variants_ich8lan,
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 2c112c7..faa32e0 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -3676,6 +3676,110 @@ static void e1000_update_phy_info(unsigned long data)
+ }
+
+ /**
++ * e1000e_update_phy_stats - Update the PHY statistics counters
++ * @adapter: board private structure
++ **/
++static void e1000e_update_phy_stats(struct e1000_adapter *adapter)
++{
++ struct e1000_hw *hw = &adapter->hw;
++ s32 ret_val;
++ u16 phy_data;
++
++ ret_val = hw->phy.ops.acquire(hw);
++ if (ret_val)
++ return;
++
++ hw->phy.addr = 1;
++
++#define HV_PHY_STATS_PAGE 778
++ /*
++ * A page set is expensive so check if already on desired page.
++ * If not, set to the page with the PHY status registers.
++ */
++ ret_val = e1000e_read_phy_reg_mdic(hw, IGP01E1000_PHY_PAGE_SELECT,
++ &phy_data);
++ if (ret_val)
++ goto release;
++ if (phy_data != (HV_PHY_STATS_PAGE << IGP_PAGE_SHIFT)) {
++ ret_val = e1000e_write_phy_reg_mdic(hw,
++ IGP01E1000_PHY_PAGE_SELECT,
++ (HV_PHY_STATS_PAGE <<
++ IGP_PAGE_SHIFT));
++ if (ret_val)
++ goto release;
++ }
++
++ /* Read/clear the upper 16-bit registers and read/accumulate lower */
++
++ /* Single Collision Count */
++ e1000e_read_phy_reg_mdic(hw, HV_SCC_UPPER & MAX_PHY_REG_ADDRESS,
++ &phy_data);
++ ret_val = e1000e_read_phy_reg_mdic(hw,
++ HV_SCC_LOWER & MAX_PHY_REG_ADDRESS,
++ &phy_data);
++ if (!ret_val)
++ adapter->stats.scc += phy_data;
++
++ /* Excessive Collision Count */
++ e1000e_read_phy_reg_mdic(hw, HV_ECOL_UPPER & MAX_PHY_REG_ADDRESS,
++ &phy_data);
++ ret_val = e1000e_read_phy_reg_mdic(hw,
++ HV_ECOL_LOWER & MAX_PHY_REG_ADDRESS,
++ &phy_data);
++ if (!ret_val)
++ adapter->stats.ecol += phy_data;
++
++ /* Multiple Collision Count */
++ e1000e_read_phy_reg_mdic(hw, HV_MCC_UPPER & MAX_PHY_REG_ADDRESS,
++ &phy_data);
++ ret_val = e1000e_read_phy_reg_mdic(hw,
++ HV_MCC_LOWER & MAX_PHY_REG_ADDRESS,
++ &phy_data);
++ if (!ret_val)
++ adapter->stats.mcc += phy_data;
++
++ /* Late Collision Count */
++ e1000e_read_phy_reg_mdic(hw, HV_LATECOL_UPPER & MAX_PHY_REG_ADDRESS,
++ &phy_data);
++ ret_val = e1000e_read_phy_reg_mdic(hw,
++ HV_LATECOL_LOWER &
++ MAX_PHY_REG_ADDRESS,
++ &phy_data);
++ if (!ret_val)
++ adapter->stats.latecol += phy_data;
++
++ /* Collision Count - also used for adaptive IFS */
++ e1000e_read_phy_reg_mdic(hw, HV_COLC_UPPER & MAX_PHY_REG_ADDRESS,
++ &phy_data);
++ ret_val = e1000e_read_phy_reg_mdic(hw,
++ HV_COLC_LOWER & MAX_PHY_REG_ADDRESS,
++ &phy_data);
++ if (!ret_val)
++ hw->mac.collision_delta = phy_data;
++
++ /* Defer Count */
++ e1000e_read_phy_reg_mdic(hw, HV_DC_UPPER & MAX_PHY_REG_ADDRESS,
++ &phy_data);
++ ret_val = e1000e_read_phy_reg_mdic(hw,
++ HV_DC_LOWER & MAX_PHY_REG_ADDRESS,
++ &phy_data);
++ if (!ret_val)
++ adapter->stats.dc += phy_data;
++
++ /* Transmit with no CRS */
++ e1000e_read_phy_reg_mdic(hw, HV_TNCRS_UPPER & MAX_PHY_REG_ADDRESS,
++ &phy_data);
++ ret_val = e1000e_read_phy_reg_mdic(hw,
++ HV_TNCRS_LOWER & MAX_PHY_REG_ADDRESS,
++ &phy_data);
++ if (!ret_val)
++ adapter->stats.tncrs += phy_data;
++
++release:
++ hw->phy.ops.release(hw);
++}
++
++/**
+ * e1000e_update_stats - Update the board statistics counters
+ * @adapter: board private structure
+ **/
+@@ -3684,7 +3788,6 @@ void e1000e_update_stats(struct e1000_adapter *adapter)
+ struct net_device *netdev = adapter->netdev;
+ struct e1000_hw *hw = &adapter->hw;
+ struct pci_dev *pdev = adapter->pdev;
+- u16 phy_data;
+
+ /*
+ * Prevent stats update while adapter is being reset, or if the pci
+@@ -3704,34 +3807,27 @@ void e1000e_update_stats(struct e1000_adapter *adapter)
+ adapter->stats.roc += er32(ROC);
+
+ adapter->stats.mpc += er32(MPC);
+- if ((hw->phy.type == e1000_phy_82578) ||
+- (hw->phy.type == e1000_phy_82577)) {
+- e1e_rphy(hw, HV_SCC_UPPER, &phy_data);
+- if (!e1e_rphy(hw, HV_SCC_LOWER, &phy_data))
+- adapter->stats.scc += phy_data;
+-
+- e1e_rphy(hw, HV_ECOL_UPPER, &phy_data);
+- if (!e1e_rphy(hw, HV_ECOL_LOWER, &phy_data))
+- adapter->stats.ecol += phy_data;
+-
+- e1e_rphy(hw, HV_MCC_UPPER, &phy_data);
+- if (!e1e_rphy(hw, HV_MCC_LOWER, &phy_data))
+- adapter->stats.mcc += phy_data;
+-
+- e1e_rphy(hw, HV_LATECOL_UPPER, &phy_data);
+- if (!e1e_rphy(hw, HV_LATECOL_LOWER, &phy_data))
+- adapter->stats.latecol += phy_data;
+-
+- e1e_rphy(hw, HV_DC_UPPER, &phy_data);
+- if (!e1e_rphy(hw, HV_DC_LOWER, &phy_data))
+- adapter->stats.dc += phy_data;
+- } else {
+- adapter->stats.scc += er32(SCC);
+- adapter->stats.ecol += er32(ECOL);
+- adapter->stats.mcc += er32(MCC);
+- adapter->stats.latecol += er32(LATECOL);
+- adapter->stats.dc += er32(DC);
++
++ /* Half-duplex statistics */
++ if (adapter->link_duplex == HALF_DUPLEX) {
++ if (adapter->flags2 & FLAG2_HAS_PHY_STATS) {
++ e1000e_update_phy_stats(adapter);
++ } else {
++ adapter->stats.scc += er32(SCC);
++ adapter->stats.ecol += er32(ECOL);
++ adapter->stats.mcc += er32(MCC);
++ adapter->stats.latecol += er32(LATECOL);
++ adapter->stats.dc += er32(DC);
++
++ hw->mac.collision_delta = er32(COLC);
++
++ if ((hw->mac.type != e1000_82574) &&
++ (hw->mac.type != e1000_82583))
++ adapter->stats.tncrs += er32(TNCRS);
++ }
++ adapter->stats.colc += hw->mac.collision_delta;
+ }
++
+ adapter->stats.xonrxc += er32(XONRXC);
+ adapter->stats.xontxc += er32(XONTXC);
+ adapter->stats.xoffrxc += er32(XOFFRXC);
+@@ -3749,28 +3845,9 @@ void e1000e_update_stats(struct e1000_adapter *adapter)
+
+ hw->mac.tx_packet_delta = er32(TPT);
+ adapter->stats.tpt += hw->mac.tx_packet_delta;
+- if ((hw->phy.type == e1000_phy_82578) ||
+- (hw->phy.type == e1000_phy_82577)) {
+- e1e_rphy(hw, HV_COLC_UPPER, &phy_data);
+- if (!e1e_rphy(hw, HV_COLC_LOWER, &phy_data))
+- hw->mac.collision_delta = phy_data;
+- } else {
+- hw->mac.collision_delta = er32(COLC);
+- }
+- adapter->stats.colc += hw->mac.collision_delta;
+
+ adapter->stats.algnerrc += er32(ALGNERRC);
+ adapter->stats.rxerrc += er32(RXERRC);
+- if ((hw->phy.type == e1000_phy_82578) ||
+- (hw->phy.type == e1000_phy_82577)) {
+- e1e_rphy(hw, HV_TNCRS_UPPER, &phy_data);
+- if (!e1e_rphy(hw, HV_TNCRS_LOWER, &phy_data))
+- adapter->stats.tncrs += phy_data;
+- } else {
+- if ((hw->mac.type != e1000_82574) &&
+- (hw->mac.type != e1000_82583))
+- adapter->stats.tncrs += er32(TNCRS);
+- }
+ adapter->stats.cexterr += er32(CEXTERR);
+ adapter->stats.tsctc += er32(TSCTC);
+ adapter->stats.tsctfc += er32(TSCTFC);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0100-e1000e-fix-check-for-manageability-on-ICHx-PCH.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0100-e1000e-fix-check-for-manageability-on-ICHx-PCH.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,100 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Wed, 16 Jun 2010 13:27:05 +0000
+Subject: [PATCH 100/166] e1000e: fix check for manageability on ICHx/PCH
+
+commit eb7700dc0344564b0b9857d1f5e331a0dd629e92 upstream.
+
+Do not check for all the bits in E1000_FWSM_MODE_MASK when checking for
+manageability on 82577/82578; only check if iAMT is enabled. Both of the
+manageability checks (for 82577/82578 and ICHx) must check the firmware
+valid bit too since the other bits are only valid when the latter is set.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Jeff Pieper <jeffrey.e.pieper at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/ich8lan.c | 31 +++++++++++++++++++++++++++----
+ 1 files changed, 27 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index 70cd681..7e2f98c 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -226,6 +226,8 @@ static void e1000_power_down_phy_copper_ich8lan(struct e1000_hw *hw);
+ static void e1000_lan_init_done_ich8lan(struct e1000_hw *hw);
+ static s32 e1000_k1_gig_workaround_hv(struct e1000_hw *hw, bool link);
+ static s32 e1000_set_mdio_slow_mode_hv(struct e1000_hw *hw);
++static bool e1000_check_mng_mode_ich8lan(struct e1000_hw *hw);
++static bool e1000_check_mng_mode_pchlan(struct e1000_hw *hw);
+
+ static inline u16 __er16flash(struct e1000_hw *hw, unsigned long reg)
+ {
+@@ -515,6 +517,8 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_adapter *adapter)
+ case e1000_ich8lan:
+ case e1000_ich9lan:
+ case e1000_ich10lan:
++ /* check management mode */
++ mac->ops.check_mng_mode = e1000_check_mng_mode_ich8lan;
+ /* ID LED init */
+ mac->ops.id_led_init = e1000e_id_led_init;
+ /* setup LED */
+@@ -526,6 +530,8 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_adapter *adapter)
+ mac->ops.led_off = e1000_led_off_ich8lan;
+ break;
+ case e1000_pchlan:
++ /* check management mode */
++ mac->ops.check_mng_mode = e1000_check_mng_mode_pchlan;
+ /* ID LED init */
+ mac->ops.id_led_init = e1000_id_led_init_pchlan;
+ /* setup LED */
+@@ -774,7 +780,7 @@ static void e1000_release_swflag_ich8lan(struct e1000_hw *hw)
+ * e1000_check_mng_mode_ich8lan - Checks management mode
+ * @hw: pointer to the HW structure
+ *
+- * This checks if the adapter has manageability enabled.
++ * This checks if the adapter has any manageability enabled.
+ * This is a function pointer entry point only called by read/write
+ * routines for the PHY and NVM parts.
+ **/
+@@ -783,9 +789,26 @@ static bool e1000_check_mng_mode_ich8lan(struct e1000_hw *hw)
+ u32 fwsm;
+
+ fwsm = er32(FWSM);
++ return (fwsm & E1000_ICH_FWSM_FW_VALID) &&
++ ((fwsm & E1000_FWSM_MODE_MASK) ==
++ (E1000_ICH_MNG_IAMT_MODE << E1000_FWSM_MODE_SHIFT));
++}
+
+- return (fwsm & E1000_FWSM_MODE_MASK) ==
+- (E1000_ICH_MNG_IAMT_MODE << E1000_FWSM_MODE_SHIFT);
++/**
++ * e1000_check_mng_mode_pchlan - Checks management mode
++ * @hw: pointer to the HW structure
++ *
++ * This checks if the adapter has iAMT enabled.
++ * This is a function pointer entry point only called by read/write
++ * routines for the PHY and NVM parts.
++ **/
++static bool e1000_check_mng_mode_pchlan(struct e1000_hw *hw)
++{
++ u32 fwsm;
++
++ fwsm = er32(FWSM);
++ return (fwsm & E1000_ICH_FWSM_FW_VALID) &&
++ (fwsm & (E1000_ICH_MNG_IAMT_MODE << E1000_FWSM_MODE_SHIFT));
+ }
+
+ /**
+@@ -3396,7 +3419,7 @@ static void e1000_clear_hw_cntrs_ich8lan(struct e1000_hw *hw)
+
+ static struct e1000_mac_operations ich8_mac_ops = {
+ .id_led_init = e1000e_id_led_init,
+- .check_mng_mode = e1000_check_mng_mode_ich8lan,
++ /* check_mng_mode dependent on mac type */
+ .check_for_link = e1000_check_for_copper_link_ich8lan,
+ /* cleanup_led dependent on mac type */
+ .clear_hw_cntrs = e1000_clear_hw_cntrs_ich8lan,
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0101-e1000e-initial-support-for-82579-LOMs.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0101-e1000e-initial-support-for-82579-LOMs.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,761 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Wed, 16 Jun 2010 13:27:28 +0000
+Subject: [PATCH 101/166] e1000e: initial support for 82579 LOMs
+
+commit d3738bb8203acf8552c3ec8b3447133fc0938ddd upstream.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Jeff Pieper <jeffrey.e.pieper at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Adjust to apply on top of cherry-picked fixes in 2.6.32.y]
+---
+ drivers/net/e1000e/defines.h | 2 +
+ drivers/net/e1000e/e1000.h | 4 +
+ drivers/net/e1000e/ethtool.c | 13 ++
+ drivers/net/e1000e/hw.h | 12 ++-
+ drivers/net/e1000e/ich8lan.c | 328 +++++++++++++++++++++++++++++++++++++++---
+ drivers/net/e1000e/netdev.c | 70 ++++++----
+ drivers/net/e1000e/phy.c | 3 +
+ 7 files changed, 386 insertions(+), 46 deletions(-)
+
+diff --git a/drivers/net/e1000e/defines.h b/drivers/net/e1000e/defines.h
+index 4dc02c7..5a6de34 100644
+--- a/drivers/net/e1000e/defines.h
++++ b/drivers/net/e1000e/defines.h
+@@ -359,6 +359,7 @@
+ #define E1000_EXTCNF_CTRL_LCD_WRITE_ENABLE 0x00000001
+ #define E1000_EXTCNF_CTRL_OEM_WRITE_ENABLE 0x00000008
+ #define E1000_EXTCNF_CTRL_SWFLAG 0x00000020
++#define E1000_EXTCNF_CTRL_GATE_PHY_CFG 0x00000080
+ #define E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_MASK 0x00FF0000
+ #define E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_SHIFT 16
+ #define E1000_EXTCNF_CTRL_EXT_CNF_POINTER_MASK 0x0FFF0000
+@@ -714,6 +715,7 @@
+ #define BME1000_E_PHY_ID_R2 0x01410CB1
+ #define I82577_E_PHY_ID 0x01540050
+ #define I82578_E_PHY_ID 0x004DD040
++#define I82579_E_PHY_ID 0x01540090
+
+ /* M88E1000 Specific Registers */
+ #define M88E1000_PHY_SPEC_CTRL 0x10 /* PHY Specific Control Register */
+diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
+index 79e7c4c..0e59f15 100644
+--- a/drivers/net/e1000e/e1000.h
++++ b/drivers/net/e1000e/e1000.h
+@@ -164,6 +164,7 @@ enum e1000_boards {
+ board_ich9lan,
+ board_ich10lan,
+ board_pchlan,
++ board_pch2lan,
+ };
+
+ struct e1000_queue_stats {
+@@ -477,6 +478,7 @@ extern struct e1000_info e1000_ich8_info;
+ extern struct e1000_info e1000_ich9_info;
+ extern struct e1000_info e1000_ich10_info;
+ extern struct e1000_info e1000_pch_info;
++extern struct e1000_info e1000_pch2_info;
+ extern struct e1000_info e1000_es2_info;
+
+ extern s32 e1000e_read_pba_num(struct e1000_hw *hw, u32 *pba_num);
+@@ -495,6 +497,8 @@ extern void e1000e_igp3_phy_powerdown_workaround_ich8lan(struct e1000_hw *hw);
+ extern void e1000e_gig_downshift_workaround_ich8lan(struct e1000_hw *hw);
+ extern void e1000e_disable_gig_wol_ich8lan(struct e1000_hw *hw);
+ extern s32 e1000_configure_k1_ich8lan(struct e1000_hw *hw, bool k1_enable);
++extern s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable);
++extern void e1000_copy_rx_addrs_to_phy_ich8lan(struct e1000_hw *hw);
+
+ extern s32 e1000e_check_for_copper_link(struct e1000_hw *hw);
+ extern s32 e1000e_check_for_fiber_link(struct e1000_hw *hw);
+diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
+index 86c6a26..312c704 100644
+--- a/drivers/net/e1000e/ethtool.c
++++ b/drivers/net/e1000e/ethtool.c
+@@ -880,6 +880,7 @@ static int e1000_reg_test(struct e1000_adapter *adapter, u64 *data)
+ switch (mac->type) {
+ case e1000_ich10lan:
+ case e1000_pchlan:
++ case e1000_pch2lan:
+ mask |= (1 << 18);
+ break;
+ default:
+@@ -1321,6 +1322,17 @@ static int e1000_integrated_phy_loopback(struct e1000_adapter *adapter)
+ /* Workaround: K1 must be disabled for stable 1Gbps operation */
+ e1000_configure_k1_ich8lan(hw, false);
+ break;
++ case e1000_phy_82579:
++ /* Disable PHY energy detect power down */
++ e1e_rphy(hw, PHY_REG(0, 21), &phy_reg);
++ e1e_wphy(hw, PHY_REG(0, 21), phy_reg & ~(1 << 3));
++ /* Disable full chip energy detect */
++ e1e_rphy(hw, PHY_REG(776, 18), &phy_reg);
++ e1e_wphy(hw, PHY_REG(776, 18), phy_reg | 1);
++ /* Enable loopback on the PHY */
++#define I82577_PHY_LBK_CTRL 19
++ e1e_wphy(hw, I82577_PHY_LBK_CTRL, 0x8001);
++ break;
+ default:
+ break;
+ }
+@@ -1878,6 +1890,7 @@ static int e1000_phys_id(struct net_device *netdev, u32 data)
+
+ if ((hw->phy.type == e1000_phy_ife) ||
+ (hw->mac.type == e1000_pchlan) ||
++ (hw->mac.type == e1000_pch2lan) ||
+ (hw->mac.type == e1000_82583) ||
+ (hw->mac.type == e1000_82574)) {
+ INIT_WORK(&adapter->led_blink_task, e1000e_led_blink_task);
+diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h
+index 664ed58..deec3a4 100644
+--- a/drivers/net/e1000e/hw.h
++++ b/drivers/net/e1000e/hw.h
+@@ -217,7 +217,10 @@ enum e1e_registers {
+ E1000_SWSM = 0x05B50, /* SW Semaphore */
+ E1000_FWSM = 0x05B54, /* FW Semaphore */
+ E1000_SWSM2 = 0x05B58, /* Driver-only SW semaphore */
+- E1000_CRC_OFFSET = 0x05F50, /* CRC Offset register */
++ E1000_FFLT_DBG = 0x05F04, /* Debug Register */
++ E1000_PCH_RAICC_BASE = 0x05F50, /* Receive Address Initial CRC */
++#define E1000_PCH_RAICC(_n) (E1000_PCH_RAICC_BASE + ((_n) * 4))
++#define E1000_CRC_OFFSET E1000_PCH_RAICC_BASE
+ E1000_HICR = 0x08F00, /* Host Interface Control */
+ };
+
+@@ -303,13 +306,14 @@ enum e1e_registers {
+ #define E1000_KMRNCTRLSTA_OFFSET 0x001F0000
+ #define E1000_KMRNCTRLSTA_OFFSET_SHIFT 16
+ #define E1000_KMRNCTRLSTA_REN 0x00200000
++#define E1000_KMRNCTRLSTA_CTRL_OFFSET 0x1 /* Kumeran Control */
+ #define E1000_KMRNCTRLSTA_DIAG_OFFSET 0x3 /* Kumeran Diagnostic */
+ #define E1000_KMRNCTRLSTA_TIMEOUTS 0x4 /* Kumeran Timeouts */
+ #define E1000_KMRNCTRLSTA_INBAND_PARAM 0x9 /* Kumeran InBand Parameters */
+ #define E1000_KMRNCTRLSTA_DIAG_NELPBK 0x1000 /* Nearend Loopback mode */
+ #define E1000_KMRNCTRLSTA_K1_CONFIG 0x7
+ #define E1000_KMRNCTRLSTA_K1_ENABLE 0x0002
+-#define E1000_KMRNCTRLSTA_K1_DISABLE 0x1400
++#define E1000_KMRNCTRLSTA_HD_CTRL 0x0002
+
+ #define IFE_PHY_EXTENDED_STATUS_CONTROL 0x10
+ #define IFE_PHY_SPECIAL_CONTROL 0x11 /* 100BaseTx PHY Special Control */
+@@ -387,6 +391,8 @@ enum e1e_registers {
+ #define E1000_DEV_ID_PCH_M_HV_LC 0x10EB
+ #define E1000_DEV_ID_PCH_D_HV_DM 0x10EF
+ #define E1000_DEV_ID_PCH_D_HV_DC 0x10F0
++#define E1000_DEV_ID_PCH2_LV_LM 0x1502
++#define E1000_DEV_ID_PCH2_LV_V 0x1503
+
+ #define E1000_REVISION_4 4
+
+@@ -406,6 +412,7 @@ enum e1000_mac_type {
+ e1000_ich9lan,
+ e1000_ich10lan,
+ e1000_pchlan,
++ e1000_pch2lan,
+ };
+
+ enum e1000_media_type {
+@@ -442,6 +449,7 @@ enum e1000_phy_type {
+ e1000_phy_bm,
+ e1000_phy_82578,
+ e1000_phy_82577,
++ e1000_phy_82579,
+ };
+
+ enum e1000_bus_width {
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index 7e2f98c..8274499 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -52,6 +52,8 @@
+ * 82577LC Gigabit Network Connection
+ * 82578DM Gigabit Network Connection
+ * 82578DC Gigabit Network Connection
++ * 82579LM Gigabit Network Connection
++ * 82579V Gigabit Network Connection
+ */
+
+ #include "e1000.h"
+@@ -126,6 +128,9 @@
+ #define HV_SMB_ADDR_PEC_EN 0x0200
+ #define HV_SMB_ADDR_VALID 0x0080
+
++/* PHY Power Management Control */
++#define HV_PM_CTRL PHY_REG(770, 17)
++
+ /* Strapping Option Register - RO */
+ #define E1000_STRAP 0x0000C
+ #define E1000_STRAP_SMBUS_ADDRESS_MASK 0x00FE0000
+@@ -279,13 +284,13 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw)
+ phy->ops.power_down = e1000_power_down_phy_copper_ich8lan;
+ phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT;
+
++ /*
++ * The MAC-PHY interconnect may still be in SMBus mode
++ * after Sx->S0. If the manageability engine (ME) is
++ * disabled, then toggle the LANPHYPC Value bit to force
++ * the interconnect to PCIe mode.
++ */
+ if (!(er32(FWSM) & E1000_ICH_FWSM_FW_VALID)) {
+- /*
+- * The MAC-PHY interconnect may still be in SMBus mode
+- * after Sx->S0. Toggle the LANPHYPC Value bit to force
+- * the interconnect to PCIe mode, but only if there is no
+- * firmware present otherwise firmware will have done it.
+- */
+ ctrl = er32(CTRL);
+ ctrl |= E1000_CTRL_LANPHYPC_OVERRIDE;
+ ctrl &= ~E1000_CTRL_LANPHYPC_VALUE;
+@@ -326,6 +331,7 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw)
+
+ switch (phy->type) {
+ case e1000_phy_82577:
++ case e1000_phy_82579:
+ phy->ops.check_polarity = e1000_check_polarity_82577;
+ phy->ops.force_speed_duplex =
+ e1000_phy_force_speed_duplex_82577;
+@@ -530,6 +536,7 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_adapter *adapter)
+ mac->ops.led_off = e1000_led_off_ich8lan;
+ break;
+ case e1000_pchlan:
++ case e1000_pch2lan:
+ /* check management mode */
+ mac->ops.check_mng_mode = e1000_check_mng_mode_pchlan;
+ /* ID LED init */
+@@ -550,6 +557,14 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_adapter *adapter)
+ if (mac->type == e1000_ich8lan)
+ e1000e_set_kmrn_lock_loss_workaround_ich8lan(hw, true);
+
++ /* Disable PHY configuration by hardware, config by software */
++ if (mac->type == e1000_pch2lan) {
++ u32 extcnf_ctrl = er32(EXTCNF_CTRL);
++
++ extcnf_ctrl |= E1000_EXTCNF_CTRL_GATE_PHY_CFG;
++ ew32(EXTCNF_CTRL, extcnf_ctrl);
++ }
++
+ return 0;
+ }
+
+@@ -653,10 +668,19 @@ static s32 e1000_get_variants_ich8lan(struct e1000_adapter *adapter)
+ if (rc)
+ return rc;
+
+- if (hw->mac.type == e1000_pchlan)
+- rc = e1000_init_phy_params_pchlan(hw);
+- else
++ switch (hw->mac.type) {
++ case e1000_ich8lan:
++ case e1000_ich9lan:
++ case e1000_ich10lan:
+ rc = e1000_init_phy_params_ich8lan(hw);
++ break;
++ case e1000_pchlan:
++ case e1000_pch2lan:
++ rc = e1000_init_phy_params_pchlan(hw);
++ break;
++ default:
++ break;
++ }
+ if (rc)
+ return rc;
+
+@@ -861,6 +885,7 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw)
+ }
+ /* Fall-thru */
+ case e1000_pchlan:
++ case e1000_pch2lan:
+ sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG_ICH8M;
+ break;
+ default:
+@@ -880,8 +905,10 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw)
+ * extended configuration before SW configuration
+ */
+ data = er32(EXTCNF_CTRL);
+- if (data & E1000_EXTCNF_CTRL_LCD_WRITE_ENABLE)
+- goto out;
++ if (!(hw->mac.type == e1000_pch2lan)) {
++ if (data & E1000_EXTCNF_CTRL_LCD_WRITE_ENABLE)
++ goto out;
++ }
+
+ cnf_size = er32(EXTCNF_SIZE);
+ cnf_size &= E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_MASK;
+@@ -893,7 +920,8 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw)
+ cnf_base_addr >>= E1000_EXTCNF_CTRL_EXT_CNF_POINTER_SHIFT;
+
+ if (!(data & E1000_EXTCNF_CTRL_OEM_WRITE_ENABLE) &&
+- (hw->mac.type == e1000_pchlan)) {
++ ((hw->mac.type == e1000_pchlan) ||
++ (hw->mac.type == e1000_pch2lan))) {
+ /*
+ * HW configures the SMBus address and LEDs when the
+ * OEM and LCD Write Enable bits are set in the NVM.
+@@ -1100,16 +1128,18 @@ static s32 e1000_oem_bits_config_ich8lan(struct e1000_hw *hw, bool d0_state)
+ u32 mac_reg;
+ u16 oem_reg;
+
+- if (hw->mac.type != e1000_pchlan)
++ if ((hw->mac.type != e1000_pch2lan) && (hw->mac.type != e1000_pchlan))
+ return ret_val;
+
+ ret_val = hw->phy.ops.acquire(hw);
+ if (ret_val)
+ return ret_val;
+
+- mac_reg = er32(EXTCNF_CTRL);
+- if (mac_reg & E1000_EXTCNF_CTRL_OEM_WRITE_ENABLE)
+- goto out;
++ if (!(hw->mac.type == e1000_pch2lan)) {
++ mac_reg = er32(EXTCNF_CTRL);
++ if (mac_reg & E1000_EXTCNF_CTRL_OEM_WRITE_ENABLE)
++ goto out;
++ }
+
+ mac_reg = er32(FEXTNVM);
+ if (!(mac_reg & E1000_FEXTNVM_SW_CONFIG_ICH8M))
+@@ -1250,6 +1280,243 @@ out:
+ }
+
+ /**
++ * e1000_copy_rx_addrs_to_phy_ich8lan - Copy Rx addresses from MAC to PHY
++ * @hw: pointer to the HW structure
++ **/
++void e1000_copy_rx_addrs_to_phy_ich8lan(struct e1000_hw *hw)
++{
++ u32 mac_reg;
++ u16 i;
++
++ /* Copy both RAL/H (rar_entry_count) and SHRAL/H (+4) to PHY */
++ for (i = 0; i < (hw->mac.rar_entry_count + 4); i++) {
++ mac_reg = er32(RAL(i));
++ e1e_wphy(hw, BM_RAR_L(i), (u16)(mac_reg & 0xFFFF));
++ e1e_wphy(hw, BM_RAR_M(i), (u16)((mac_reg >> 16) & 0xFFFF));
++ mac_reg = er32(RAH(i));
++ e1e_wphy(hw, BM_RAR_H(i), (u16)(mac_reg & 0xFFFF));
++ e1e_wphy(hw, BM_RAR_CTRL(i), (u16)((mac_reg >> 16) & 0x8000));
++ }
++}
++
++static u32 e1000_calc_rx_da_crc(u8 mac[])
++{
++ u32 poly = 0xEDB88320; /* Polynomial for 802.3 CRC calculation */
++ u32 i, j, mask, crc;
++
++ crc = 0xffffffff;
++ for (i = 0; i < 6; i++) {
++ crc = crc ^ mac[i];
++ for (j = 8; j > 0; j--) {
++ mask = (crc & 1) * (-1);
++ crc = (crc >> 1) ^ (poly & mask);
++ }
++ }
++ return ~crc;
++}
++
++/**
++ * e1000_lv_jumbo_workaround_ich8lan - required for jumbo frame operation
++ * with 82579 PHY
++ * @hw: pointer to the HW structure
++ * @enable: flag to enable/disable workaround when enabling/disabling jumbos
++ **/
++s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable)
++{
++ s32 ret_val = 0;
++ u16 phy_reg, data;
++ u32 mac_reg;
++ u16 i;
++
++ if (hw->mac.type != e1000_pch2lan)
++ goto out;
++
++ /* disable Rx path while enabling/disabling workaround */
++ e1e_rphy(hw, PHY_REG(769, 20), &phy_reg);
++ ret_val = e1e_wphy(hw, PHY_REG(769, 20), phy_reg | (1 << 14));
++ if (ret_val)
++ goto out;
++
++ if (enable) {
++ /*
++ * Write Rx addresses (rar_entry_count for RAL/H, +4 for
++ * SHRAL/H) and initial CRC values to the MAC
++ */
++ for (i = 0; i < (hw->mac.rar_entry_count + 4); i++) {
++ u8 mac_addr[ETH_ALEN] = {0};
++ u32 addr_high, addr_low;
++
++ addr_high = er32(RAH(i));
++ if (!(addr_high & E1000_RAH_AV))
++ continue;
++ addr_low = er32(RAL(i));
++ mac_addr[0] = (addr_low & 0xFF);
++ mac_addr[1] = ((addr_low >> 8) & 0xFF);
++ mac_addr[2] = ((addr_low >> 16) & 0xFF);
++ mac_addr[3] = ((addr_low >> 24) & 0xFF);
++ mac_addr[4] = (addr_high & 0xFF);
++ mac_addr[5] = ((addr_high >> 8) & 0xFF);
++
++ ew32(PCH_RAICC(i),
++ e1000_calc_rx_da_crc(mac_addr));
++ }
++
++ /* Write Rx addresses to the PHY */
++ e1000_copy_rx_addrs_to_phy_ich8lan(hw);
++
++ /* Enable jumbo frame workaround in the MAC */
++ mac_reg = er32(FFLT_DBG);
++ mac_reg &= ~(1 << 14);
++ mac_reg |= (7 << 15);
++ ew32(FFLT_DBG, mac_reg);
++
++ mac_reg = er32(RCTL);
++ mac_reg |= E1000_RCTL_SECRC;
++ ew32(RCTL, mac_reg);
++
++ ret_val = e1000e_read_kmrn_reg(hw,
++ E1000_KMRNCTRLSTA_CTRL_OFFSET,
++ &data);
++ if (ret_val)
++ goto out;
++ ret_val = e1000e_write_kmrn_reg(hw,
++ E1000_KMRNCTRLSTA_CTRL_OFFSET,
++ data | (1 << 0));
++ if (ret_val)
++ goto out;
++ ret_val = e1000e_read_kmrn_reg(hw,
++ E1000_KMRNCTRLSTA_HD_CTRL,
++ &data);
++ if (ret_val)
++ goto out;
++ data &= ~(0xF << 8);
++ data |= (0xB << 8);
++ ret_val = e1000e_write_kmrn_reg(hw,
++ E1000_KMRNCTRLSTA_HD_CTRL,
++ data);
++ if (ret_val)
++ goto out;
++
++ /* Enable jumbo frame workaround in the PHY */
++ e1e_rphy(hw, PHY_REG(769, 20), &data);
++ ret_val = e1e_wphy(hw, PHY_REG(769, 20), data & ~(1 << 14));
++ if (ret_val)
++ goto out;
++ e1e_rphy(hw, PHY_REG(769, 23), &data);
++ data &= ~(0x7F << 5);
++ data |= (0x37 << 5);
++ ret_val = e1e_wphy(hw, PHY_REG(769, 23), data);
++ if (ret_val)
++ goto out;
++ e1e_rphy(hw, PHY_REG(769, 16), &data);
++ data &= ~(1 << 13);
++ data |= (1 << 12);
++ ret_val = e1e_wphy(hw, PHY_REG(769, 16), data);
++ if (ret_val)
++ goto out;
++ e1e_rphy(hw, PHY_REG(776, 20), &data);
++ data &= ~(0x3FF << 2);
++ data |= (0x1A << 2);
++ ret_val = e1e_wphy(hw, PHY_REG(776, 20), data);
++ if (ret_val)
++ goto out;
++ ret_val = e1e_wphy(hw, PHY_REG(776, 23), 0xFE00);
++ if (ret_val)
++ goto out;
++ e1e_rphy(hw, HV_PM_CTRL, &data);
++ ret_val = e1e_wphy(hw, HV_PM_CTRL, data | (1 << 10));
++ if (ret_val)
++ goto out;
++ } else {
++ /* Write MAC register values back to h/w defaults */
++ mac_reg = er32(FFLT_DBG);
++ mac_reg &= ~(0xF << 14);
++ ew32(FFLT_DBG, mac_reg);
++
++ mac_reg = er32(RCTL);
++ mac_reg &= ~E1000_RCTL_SECRC;
++ ew32(FFLT_DBG, mac_reg);
++
++ ret_val = e1000e_read_kmrn_reg(hw,
++ E1000_KMRNCTRLSTA_CTRL_OFFSET,
++ &data);
++ if (ret_val)
++ goto out;
++ ret_val = e1000e_write_kmrn_reg(hw,
++ E1000_KMRNCTRLSTA_CTRL_OFFSET,
++ data & ~(1 << 0));
++ if (ret_val)
++ goto out;
++ ret_val = e1000e_read_kmrn_reg(hw,
++ E1000_KMRNCTRLSTA_HD_CTRL,
++ &data);
++ if (ret_val)
++ goto out;
++ data &= ~(0xF << 8);
++ data |= (0xB << 8);
++ ret_val = e1000e_write_kmrn_reg(hw,
++ E1000_KMRNCTRLSTA_HD_CTRL,
++ data);
++ if (ret_val)
++ goto out;
++
++ /* Write PHY register values back to h/w defaults */
++ e1e_rphy(hw, PHY_REG(769, 20), &data);
++ ret_val = e1e_wphy(hw, PHY_REG(769, 20), data & ~(1 << 14));
++ if (ret_val)
++ goto out;
++ e1e_rphy(hw, PHY_REG(769, 23), &data);
++ data &= ~(0x7F << 5);
++ ret_val = e1e_wphy(hw, PHY_REG(769, 23), data);
++ if (ret_val)
++ goto out;
++ e1e_rphy(hw, PHY_REG(769, 16), &data);
++ data &= ~(1 << 12);
++ data |= (1 << 13);
++ ret_val = e1e_wphy(hw, PHY_REG(769, 16), data);
++ if (ret_val)
++ goto out;
++ e1e_rphy(hw, PHY_REG(776, 20), &data);
++ data &= ~(0x3FF << 2);
++ data |= (0x8 << 2);
++ ret_val = e1e_wphy(hw, PHY_REG(776, 20), data);
++ if (ret_val)
++ goto out;
++ ret_val = e1e_wphy(hw, PHY_REG(776, 23), 0x7E00);
++ if (ret_val)
++ goto out;
++ e1e_rphy(hw, HV_PM_CTRL, &data);
++ ret_val = e1e_wphy(hw, HV_PM_CTRL, data & ~(1 << 10));
++ if (ret_val)
++ goto out;
++ }
++
++ /* re-enable Rx path after enabling/disabling workaround */
++ ret_val = e1e_wphy(hw, PHY_REG(769, 20), phy_reg & ~(1 << 14));
++
++out:
++ return ret_val;
++}
++
++/**
++ * e1000_lv_phy_workarounds_ich8lan - A series of Phy workarounds to be
++ * done after every PHY reset.
++ **/
++static s32 e1000_lv_phy_workarounds_ich8lan(struct e1000_hw *hw)
++{
++ s32 ret_val = 0;
++
++ if (hw->mac.type != e1000_pch2lan)
++ goto out;
++
++ /* Set MDIO slow mode before any other MDIO access */
++ ret_val = e1000_set_mdio_slow_mode_hv(hw);
++
++out:
++ return ret_val;
++}
++
++/**
+ * e1000_lan_init_done_ich8lan - Check for PHY config completion
+ * @hw: pointer to the HW structure
+ *
+@@ -1300,12 +1567,17 @@ static s32 e1000_post_phy_reset_ich8lan(struct e1000_hw *hw)
+ if (ret_val)
+ goto out;
+ break;
++ case e1000_pch2lan:
++ ret_val = e1000_lv_phy_workarounds_ich8lan(hw);
++ if (ret_val)
++ goto out;
++ break;
+ default:
+ break;
+ }
+
+ /* Dummy read to clear the phy wakeup bit after lcd reset */
+- if (hw->mac.type == e1000_pchlan)
++ if (hw->mac.type >= e1000_pchlan)
+ e1e_rphy(hw, BM_WUC, ®);
+
+ /* Configure the LCD with the extended configuration region in NVM */
+@@ -2829,6 +3101,7 @@ static s32 e1000_setup_link_ich8lan(struct e1000_hw *hw)
+
+ ew32(FCTTV, hw->fc.pause_time);
+ if ((hw->phy.type == e1000_phy_82578) ||
++ (hw->phy.type == e1000_phy_82579) ||
+ (hw->phy.type == e1000_phy_82577)) {
+ ew32(FCRTV_PCH, hw->fc.refresh_time);
+
+@@ -2892,6 +3165,7 @@ static s32 e1000_setup_copper_link_ich8lan(struct e1000_hw *hw)
+ return ret_val;
+ break;
+ case e1000_phy_82577:
++ case e1000_phy_82579:
+ ret_val = e1000_copper_link_setup_82577(hw);
+ if (ret_val)
+ return ret_val;
+@@ -3399,6 +3673,7 @@ static void e1000_clear_hw_cntrs_ich8lan(struct e1000_hw *hw)
+
+ /* Clear PHY statistics registers */
+ if ((hw->phy.type == e1000_phy_82578) ||
++ (hw->phy.type == e1000_phy_82579) ||
+ (hw->phy.type == e1000_phy_82577)) {
+ hw->phy.ops.read_reg(hw, HV_SCC_UPPER, &phy_data);
+ hw->phy.ops.read_reg(hw, HV_SCC_LOWER, &phy_data);
+@@ -3534,3 +3809,22 @@ struct e1000_info e1000_pch_info = {
+ .phy_ops = &ich8_phy_ops,
+ .nvm_ops = &ich8_nvm_ops,
+ };
++
++struct e1000_info e1000_pch2_info = {
++ .mac = e1000_pch2lan,
++ .flags = FLAG_IS_ICH
++ | FLAG_HAS_WOL
++ | FLAG_RX_CSUM_ENABLED
++ | FLAG_HAS_CTRLEXT_ON_LOAD
++ | FLAG_HAS_AMT
++ | FLAG_HAS_FLASH
++ | FLAG_HAS_JUMBO_FRAMES
++ | FLAG_APME_IN_WUC,
++ .flags2 = FLAG2_HAS_PHY_STATS,
++ .pba = 18,
++ .max_hw_frame_size = DEFAULT_JUMBO,
++ .get_variants = e1000_get_variants_ich8lan,
++ .mac_ops = &ich8_mac_ops,
++ .phy_ops = &ich8_phy_ops,
++ .nvm_ops = &ich8_nvm_ops,
++};
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index faa32e0..d3d4fad 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -67,6 +67,7 @@ static const struct e1000_info *e1000_info_tbl[] = {
+ [board_ich9lan] = &e1000_ich9_info,
+ [board_ich10lan] = &e1000_ich10_info,
+ [board_pchlan] = &e1000_pch_info,
++ [board_pch2lan] = &e1000_pch2_info,
+ };
+
+ struct e1000_reg_info {
+@@ -2723,6 +2724,16 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter)
+ e1e_wphy(hw, 22, phy_data);
+ }
+
++ /* Workaround Si errata on 82579 - configure jumbo frame flow */
++ if (hw->mac.type == e1000_pch2lan) {
++ s32 ret_val;
++
++ if (rctl & E1000_RCTL_LPE)
++ ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, true);
++ else
++ ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, false);
++ }
++
+ /* Setup buffer sizes */
+ rctl &= ~E1000_RCTL_SZ_4096;
+ rctl |= E1000_RCTL_BSEX;
+@@ -3119,7 +3130,27 @@ void e1000e_reset(struct e1000_adapter *adapter)
+ * with ERT support assuming ERT set to E1000_ERT_2048), or
+ * - the full Rx FIFO size minus one full frame
+ */
+- if (hw->mac.type == e1000_pchlan) {
++ if (adapter->flags & FLAG_DISABLE_FC_PAUSE_TIME)
++ fc->pause_time = 0xFFFF;
++ else
++ fc->pause_time = E1000_FC_PAUSE_TIME;
++ fc->send_xon = 1;
++ fc->current_mode = fc->requested_mode;
++
++ switch (hw->mac.type) {
++ default:
++ if ((adapter->flags & FLAG_HAS_ERT) &&
++ (adapter->netdev->mtu > ETH_DATA_LEN))
++ hwm = min(((pba << 10) * 9 / 10),
++ ((pba << 10) - (E1000_ERT_2048 << 3)));
++ else
++ hwm = min(((pba << 10) * 9 / 10),
++ ((pba << 10) - adapter->max_frame_size));
++
++ fc->high_water = hwm & E1000_FCRTH_RTH; /* 8-byte granularity */
++ fc->low_water = fc->high_water - 8;
++ break;
++ case e1000_pchlan:
+ /*
+ * Workaround PCH LOM adapter hangs with certain network
+ * loads. If hangs persist, try disabling Tx flow control.
+@@ -3132,26 +3163,15 @@ void e1000e_reset(struct e1000_adapter *adapter)
+ fc->low_water = 0x3000;
+ }
+ fc->refresh_time = 0x1000;
+- } else {
+- if ((adapter->flags & FLAG_HAS_ERT) &&
+- (adapter->netdev->mtu > ETH_DATA_LEN))
+- hwm = min(((pba << 10) * 9 / 10),
+- ((pba << 10) - (E1000_ERT_2048 << 3)));
+- else
+- hwm = min(((pba << 10) * 9 / 10),
+- ((pba << 10) - adapter->max_frame_size));
+-
+- fc->high_water = hwm & E1000_FCRTH_RTH; /* 8-byte granularity */
+- fc->low_water = fc->high_water - 8;
++ break;
++ case e1000_pch2lan:
++ fc->high_water = 0x05C20;
++ fc->low_water = 0x05048;
++ fc->pause_time = 0x0650;
++ fc->refresh_time = 0x0400;
++ break;
+ }
+
+- if (adapter->flags & FLAG_DISABLE_FC_PAUSE_TIME)
+- fc->pause_time = 0xFFFF;
+- else
+- fc->pause_time = E1000_FC_PAUSE_TIME;
+- fc->send_xon = 1;
+- fc->current_mode = fc->requested_mode;
+-
+ /* Allow time for pending master requests to run */
+ mac->ops.reset_hw(hw);
+
+@@ -4922,14 +4942,7 @@ static int e1000_init_phy_wakeup(struct e1000_adapter *adapter, u32 wufc)
+ int retval = 0;
+
+ /* copy MAC RARs to PHY RARs */
+- for (i = 0; i < adapter->hw.mac.rar_entry_count; i++) {
+- mac_reg = er32(RAL(i));
+- e1e_wphy(hw, BM_RAR_L(i), (u16)(mac_reg & 0xFFFF));
+- e1e_wphy(hw, BM_RAR_M(i), (u16)((mac_reg >> 16) & 0xFFFF));
+- mac_reg = er32(RAH(i));
+- e1e_wphy(hw, BM_RAR_H(i), (u16)(mac_reg & 0xFFFF));
+- e1e_wphy(hw, BM_RAR_CTRL(i), (u16)((mac_reg >> 16) & 0xFFFF));
+- }
++ e1000_copy_rx_addrs_to_phy_ich8lan(hw);
+
+ /* copy MAC MTA to PHY MTA */
+ for (i = 0; i < adapter->hw.mac.mta_reg_count; i++) {
+@@ -5981,6 +5994,9 @@ static DEFINE_PCI_DEVICE_TABLE(e1000_pci_tbl) = {
+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_D_HV_DM), board_pchlan },
+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_D_HV_DC), board_pchlan },
+
++ { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH2_LV_LM), board_pch2lan },
++ { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH2_LV_V), board_pch2lan },
++
+ { } /* terminate list */
+ };
+ MODULE_DEVICE_TABLE(pci, e1000_pci_tbl);
+diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c
+index b4ac82d..e471357 100644
+--- a/drivers/net/e1000e/phy.c
++++ b/drivers/net/e1000e/phy.c
+@@ -2319,6 +2319,9 @@ enum e1000_phy_type e1000e_get_phy_type_from_id(u32 phy_id)
+ case I82577_E_PHY_ID:
+ phy_type = e1000_phy_82577;
+ break;
++ case I82579_E_PHY_ID:
++ phy_type = e1000_phy_82579;
++ break;
+ default:
+ phy_type = e1000_phy_unknown;
+ break;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0102-e1000e-enable-support-for-EEE-on-82579.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0102-e1000e-enable-support-for-EEE-on-82579.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,165 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Wed, 16 Jun 2010 13:27:49 +0000
+Subject: [PATCH 102/166] e1000e: enable support for EEE on 82579
+
+commit e52997f96008fda655d7ec3aa4297d1272e8a385 upstream.
+
+This patch enables IEEE802.3az (a.k.a. Energy Efficient Ethernet) on the
+new 82579 LOMs. An optional module parameter is provided to disable the
+feature if desired.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Jeff Pieper <jeffrey.e.pieper at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/e1000.h | 1 +
+ drivers/net/e1000e/hw.h | 1 +
+ drivers/net/e1000e/ich8lan.c | 41 ++++++++++++++++++++++++++++++++++++++++-
+ drivers/net/e1000e/param.c | 28 ++++++++++++++++++++++++++++
+ 4 files changed, 70 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
+index 0e59f15..c233496 100644
+--- a/drivers/net/e1000e/e1000.h
++++ b/drivers/net/e1000e/e1000.h
+@@ -423,6 +423,7 @@ struct e1000_info {
+ #define FLAG2_IS_DISCARDING (1 << 2)
+ #define FLAG2_DISABLE_ASPM_L1 (1 << 3)
+ #define FLAG2_HAS_PHY_STATS (1 << 4)
++#define FLAG2_HAS_EEE (1 << 5)
+
+ #define E1000_RX_DESC_PS(R, i) \
+ (&(((union e1000_rx_desc_packet_split *)((R).desc))[i]))
+diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h
+index deec3a4..c799545 100644
+--- a/drivers/net/e1000e/hw.h
++++ b/drivers/net/e1000e/hw.h
+@@ -937,6 +937,7 @@ struct e1000_dev_spec_ich8lan {
+ bool kmrn_lock_loss_workaround_enabled;
+ struct e1000_shadow_ram shadow_ram[E1000_ICH8_SHADOW_RAM_WORDS];
+ bool nvm_k1_enabled;
++ bool eee_disable;
+ };
+
+ struct e1000_hw {
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index 8274499..5e55de0 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -131,6 +131,10 @@
+ /* PHY Power Management Control */
+ #define HV_PM_CTRL PHY_REG(770, 17)
+
++/* PHY Low Power Idle Control */
++#define I82579_LPI_CTRL PHY_REG(772, 20)
++#define I82579_LPI_CTRL_ENABLE_MASK 0x6000
++
+ /* Strapping Option Register - RO */
+ #define E1000_STRAP 0x0000C
+ #define E1000_STRAP_SMBUS_ADDRESS_MASK 0x00FE0000
+@@ -569,6 +573,35 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_adapter *adapter)
+ }
+
+ /**
++ * e1000_set_eee_pchlan - Enable/disable EEE support
++ * @hw: pointer to the HW structure
++ *
++ * Enable/disable EEE based on setting in dev_spec structure. The bits in
++ * the LPI Control register will remain set only if/when link is up.
++ **/
++static s32 e1000_set_eee_pchlan(struct e1000_hw *hw)
++{
++ s32 ret_val = 0;
++ u16 phy_reg;
++
++ if (hw->phy.type != e1000_phy_82579)
++ goto out;
++
++ ret_val = e1e_rphy(hw, I82579_LPI_CTRL, &phy_reg);
++ if (ret_val)
++ goto out;
++
++ if (hw->dev_spec.ich8lan.eee_disable)
++ phy_reg &= ~I82579_LPI_CTRL_ENABLE_MASK;
++ else
++ phy_reg |= I82579_LPI_CTRL_ENABLE_MASK;
++
++ ret_val = e1e_wphy(hw, I82579_LPI_CTRL, phy_reg);
++out:
++ return ret_val;
++}
++
++/**
+ * e1000_check_for_copper_link_ich8lan - Check for link (Copper)
+ * @hw: pointer to the HW structure
+ *
+@@ -625,6 +658,11 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
+ */
+ e1000e_check_downshift(hw);
+
++ /* Enable/Disable EEE after link up */
++ ret_val = e1000_set_eee_pchlan(hw);
++ if (ret_val)
++ goto out;
++
+ /*
+ * If we are forcing speed/duplex, then we simply return since
+ * we have already determined whether we have link or not.
+@@ -3820,7 +3858,8 @@ struct e1000_info e1000_pch2_info = {
+ | FLAG_HAS_FLASH
+ | FLAG_HAS_JUMBO_FRAMES
+ | FLAG_APME_IN_WUC,
+- .flags2 = FLAG2_HAS_PHY_STATS,
++ .flags2 = FLAG2_HAS_PHY_STATS
++ | FLAG2_HAS_EEE,
+ .pba = 18,
+ .max_hw_frame_size = DEFAULT_JUMBO,
+ .get_variants = e1000_get_variants_ich8lan,
+diff --git a/drivers/net/e1000e/param.c b/drivers/net/e1000e/param.c
+index a150e48..a748460 100644
+--- a/drivers/net/e1000e/param.c
++++ b/drivers/net/e1000e/param.c
+@@ -161,6 +161,15 @@ E1000_PARAM(WriteProtectNVM, "Write-protect NVM [WARNING: disabling this can lea
+ E1000_PARAM(CrcStripping, "Enable CRC Stripping, disable if your BMC needs " \
+ "the CRC");
+
++/*
++ * Enable/disable EEE (a.k.a. IEEE802.3az)
++ *
++ * Valid Range: 0, 1
++ *
++ * Default Value: 1
++ */
++E1000_PARAM(EEE, "Enable/disable on parts that support the feature");
++
+ struct e1000_option {
+ enum { enable_option, range_option, list_option } type;
+ const char *name;
+@@ -477,4 +486,23 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
+ }
+ }
+ }
++ { /* EEE for parts supporting the feature */
++ static const struct e1000_option opt = {
++ .type = enable_option,
++ .name = "EEE Support",
++ .err = "defaulting to Enabled",
++ .def = OPTION_ENABLED
++ };
++
++ if (adapter->flags2 & FLAG2_HAS_EEE) {
++ /* Currently only supported on 82579 */
++ if (num_EEE > bd) {
++ unsigned int eee = EEE[bd];
++ e1000_validate_option(&eee, &opt, adapter);
++ hw->dev_spec.ich8lan.eee_disable = !eee;
++ } else {
++ hw->dev_spec.ich8lan.eee_disable = !opt.def;
++ }
++ }
++ }
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0103-e1000e-update-copyright-information.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0103-e1000e-update-copyright-information.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,179 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Wed, 16 Jun 2010 13:28:11 +0000
+Subject: [PATCH 103/166] e1000e: update copyright information
+
+commit 451152d97f3f4bababcb9c68b22c3d94bcdda67f upstream.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Jeff Pieper <jeffrey.e.pieper at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/82571.c | 2 +-
+ drivers/net/e1000e/defines.h | 2 +-
+ drivers/net/e1000e/e1000.h | 2 +-
+ drivers/net/e1000e/es2lan.c | 2 +-
+ drivers/net/e1000e/ethtool.c | 2 +-
+ drivers/net/e1000e/hw.h | 2 +-
+ drivers/net/e1000e/ich8lan.c | 2 +-
+ drivers/net/e1000e/lib.c | 2 +-
+ drivers/net/e1000e/netdev.c | 4 ++--
+ drivers/net/e1000e/param.c | 2 +-
+ drivers/net/e1000e/phy.c | 2 +-
+ 11 files changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+index f654db9..a4a0d2b 100644
+--- a/drivers/net/e1000e/82571.c
++++ b/drivers/net/e1000e/82571.c
+@@ -1,7 +1,7 @@
+ /*******************************************************************************
+
+ Intel PRO/1000 Linux driver
+- Copyright(c) 1999 - 2009 Intel Corporation.
++ Copyright(c) 1999 - 2010 Intel Corporation.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+diff --git a/drivers/net/e1000e/defines.h b/drivers/net/e1000e/defines.h
+index 5a6de34..307a72f 100644
+--- a/drivers/net/e1000e/defines.h
++++ b/drivers/net/e1000e/defines.h
+@@ -1,7 +1,7 @@
+ /*******************************************************************************
+
+ Intel PRO/1000 Linux driver
+- Copyright(c) 1999 - 2009 Intel Corporation.
++ Copyright(c) 1999 - 2010 Intel Corporation.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
+index c233496..328b7f4 100644
+--- a/drivers/net/e1000e/e1000.h
++++ b/drivers/net/e1000e/e1000.h
+@@ -1,7 +1,7 @@
+ /*******************************************************************************
+
+ Intel PRO/1000 Linux driver
+- Copyright(c) 1999 - 2009 Intel Corporation.
++ Copyright(c) 1999 - 2010 Intel Corporation.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+diff --git a/drivers/net/e1000e/es2lan.c b/drivers/net/e1000e/es2lan.c
+index 38d79a6..45aebb4 100644
+--- a/drivers/net/e1000e/es2lan.c
++++ b/drivers/net/e1000e/es2lan.c
+@@ -1,7 +1,7 @@
+ /*******************************************************************************
+
+ Intel PRO/1000 Linux driver
+- Copyright(c) 1999 - 2009 Intel Corporation.
++ Copyright(c) 1999 - 2010 Intel Corporation.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
+index 312c704..db86850 100644
+--- a/drivers/net/e1000e/ethtool.c
++++ b/drivers/net/e1000e/ethtool.c
+@@ -1,7 +1,7 @@
+ /*******************************************************************************
+
+ Intel PRO/1000 Linux driver
+- Copyright(c) 1999 - 2009 Intel Corporation.
++ Copyright(c) 1999 - 2010 Intel Corporation.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h
+index c799545..a419b07 100644
+--- a/drivers/net/e1000e/hw.h
++++ b/drivers/net/e1000e/hw.h
+@@ -1,7 +1,7 @@
+ /*******************************************************************************
+
+ Intel PRO/1000 Linux driver
+- Copyright(c) 1999 - 2009 Intel Corporation.
++ Copyright(c) 1999 - 2010 Intel Corporation.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index 5e55de0..c7292a1 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -1,7 +1,7 @@
+ /*******************************************************************************
+
+ Intel PRO/1000 Linux driver
+- Copyright(c) 1999 - 2009 Intel Corporation.
++ Copyright(c) 1999 - 2010 Intel Corporation.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c
+index a968e3a..df4a279 100644
+--- a/drivers/net/e1000e/lib.c
++++ b/drivers/net/e1000e/lib.c
+@@ -1,7 +1,7 @@
+ /*******************************************************************************
+
+ Intel PRO/1000 Linux driver
+- Copyright(c) 1999 - 2009 Intel Corporation.
++ Copyright(c) 1999 - 2010 Intel Corporation.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index d3d4fad..8daf0a3 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -1,7 +1,7 @@
+ /*******************************************************************************
+
+ Intel PRO/1000 Linux driver
+- Copyright(c) 1999 - 2009 Intel Corporation.
++ Copyright(c) 1999 - 2010 Intel Corporation.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+@@ -6035,7 +6035,7 @@ static int __init e1000_init_module(void)
+ int ret;
+ pr_info("Intel(R) PRO/1000 Network Driver - %s\n",
+ e1000e_driver_version);
+- pr_info("Copyright (c) 1999 - 2009 Intel Corporation.\n");
++ pr_info("Copyright (c) 1999 - 2010 Intel Corporation.\n");
+ ret = pci_register_driver(&e1000_driver);
+
+ return ret;
+diff --git a/drivers/net/e1000e/param.c b/drivers/net/e1000e/param.c
+index a748460..593251c 100644
+--- a/drivers/net/e1000e/param.c
++++ b/drivers/net/e1000e/param.c
+@@ -1,7 +1,7 @@
+ /*******************************************************************************
+
+ Intel PRO/1000 Linux driver
+- Copyright(c) 1999 - 2009 Intel Corporation.
++ Copyright(c) 1999 - 2010 Intel Corporation.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c
+index e471357..3d3dc0c 100644
+--- a/drivers/net/e1000e/phy.c
++++ b/drivers/net/e1000e/phy.c
+@@ -1,7 +1,7 @@
+ /*******************************************************************************
+
+ Intel PRO/1000 Linux driver
+- Copyright(c) 1999 - 2009 Intel Corporation.
++ Copyright(c) 1999 - 2010 Intel Corporation.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0104-e1000e-update-driver-version-number.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0104-e1000e-update-driver-version-number.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,34 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Wed, 16 Jun 2010 13:28:34 +0000
+Subject: [PATCH 104/166] e1000e: update driver version number
+
+commit c14c643b3d91cc741425c058968672228c310927 upstream.
+
+Also separate out an _EXTRAVERSION similar to the core kernel.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Jeff Pieper <jeffrey.e.pieper at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/netdev.c | 4 +++-
+ 1 files changed, 3 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 8daf0a3..8a2fe6c0 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -52,7 +52,9 @@
+
+ #include "e1000.h"
+
+-#define DRV_VERSION "1.0.2-k4"
++#define DRV_EXTRAVERSION "-k2"
++
++#define DRV_VERSION "1.2.7" DRV_EXTRAVERSION
+ char e1000e_driver_name[] = "e1000e";
+ const char e1000e_driver_version[] = DRV_VERSION;
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0105-e1000e-avoid-polling-h-w-registers-during-link-negot.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0105-e1000e-avoid-polling-h-w-registers-during-link-negot.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,141 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Thu, 17 Jun 2010 18:58:43 +0000
+Subject: [PATCH 105/166] e1000e: avoid polling h/w registers during link
+ negotiation
+
+commit 0c6bdb3084d015221270b418190b630553a38cf8 upstream.
+
+Avoid touching hardware registers when possible, otherwise link negotiation
+can get messed up when user-level scripts are rapidly polling the driver to
+see if/when link is up. Use the saved link state information instead when
+possible.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Jeff Pieper <jeffrey.e.pieper at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/e1000.h | 1 -
+ drivers/net/e1000e/ethtool.c | 56 +++++++++++++++++++++--------------------
+ drivers/net/e1000e/netdev.c | 2 +-
+ 3 files changed, 30 insertions(+), 29 deletions(-)
+
+diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
+index 328b7f4..9ee133f 100644
+--- a/drivers/net/e1000e/e1000.h
++++ b/drivers/net/e1000e/e1000.h
+@@ -461,7 +461,6 @@ extern int e1000e_setup_tx_resources(struct e1000_adapter *adapter);
+ extern void e1000e_free_rx_resources(struct e1000_adapter *adapter);
+ extern void e1000e_free_tx_resources(struct e1000_adapter *adapter);
+ extern void e1000e_update_stats(struct e1000_adapter *adapter);
+-extern bool e1000e_has_link(struct e1000_adapter *adapter);
+ extern void e1000e_set_interrupt_capability(struct e1000_adapter *adapter);
+ extern void e1000e_reset_interrupt_capability(struct e1000_adapter *adapter);
+ extern void e1000e_disable_aspm(struct pci_dev *pdev, u16 state);
+diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
+index db86850..77c5829 100644
+--- a/drivers/net/e1000e/ethtool.c
++++ b/drivers/net/e1000e/ethtool.c
+@@ -118,7 +118,6 @@ static int e1000_get_settings(struct net_device *netdev,
+ {
+ struct e1000_adapter *adapter = netdev_priv(netdev);
+ struct e1000_hw *hw = &adapter->hw;
+- u32 status;
+
+ if (hw->phy.media_type == e1000_media_type_copper) {
+
+@@ -156,22 +155,29 @@ static int e1000_get_settings(struct net_device *netdev,
+ ecmd->transceiver = XCVR_EXTERNAL;
+ }
+
+- status = er32(STATUS);
+- if (status & E1000_STATUS_LU) {
+- if (status & E1000_STATUS_SPEED_1000)
+- ecmd->speed = 1000;
+- else if (status & E1000_STATUS_SPEED_100)
+- ecmd->speed = 100;
+- else
+- ecmd->speed = 10;
++ ecmd->speed = -1;
++ ecmd->duplex = -1;
+
+- if (status & E1000_STATUS_FD)
+- ecmd->duplex = DUPLEX_FULL;
+- else
+- ecmd->duplex = DUPLEX_HALF;
++ if (netif_running(netdev)) {
++ if (netif_carrier_ok(netdev)) {
++ ecmd->speed = adapter->link_speed;
++ ecmd->duplex = adapter->link_duplex - 1;
++ }
+ } else {
+- ecmd->speed = -1;
+- ecmd->duplex = -1;
++ u32 status = er32(STATUS);
++ if (status & E1000_STATUS_LU) {
++ if (status & E1000_STATUS_SPEED_1000)
++ ecmd->speed = 1000;
++ else if (status & E1000_STATUS_SPEED_100)
++ ecmd->speed = 100;
++ else
++ ecmd->speed = 10;
++
++ if (status & E1000_STATUS_FD)
++ ecmd->duplex = DUPLEX_FULL;
++ else
++ ecmd->duplex = DUPLEX_HALF;
++ }
+ }
+
+ ecmd->autoneg = ((hw->phy.media_type == e1000_media_type_fiber) ||
+@@ -179,7 +185,7 @@ static int e1000_get_settings(struct net_device *netdev,
+
+ /* MDI-X => 2; MDI =>1; Invalid =>0 */
+ if ((hw->phy.media_type == e1000_media_type_copper) &&
+- !hw->mac.get_link_status)
++ netif_carrier_ok(netdev))
+ ecmd->eth_tp_mdix = hw->phy.is_mdix ? ETH_TP_MDI_X :
+ ETH_TP_MDI;
+ else
+@@ -191,19 +197,15 @@ static int e1000_get_settings(struct net_device *netdev,
+ static u32 e1000_get_link(struct net_device *netdev)
+ {
+ struct e1000_adapter *adapter = netdev_priv(netdev);
+- struct e1000_mac_info *mac = &adapter->hw.mac;
++ struct e1000_hw *hw = &adapter->hw;
+
+ /*
+- * If the link is not reported up to netdev, interrupts are disabled,
+- * and so the physical link state may have changed since we last
+- * looked. Set get_link_status to make sure that the true link
+- * state is interrogated, rather than pulling a cached and possibly
+- * stale link state from the driver.
++ * Avoid touching hardware registers when possible, otherwise
++ * link negotiation can get messed up when user-level scripts
++ * are rapidly polling the driver to see if link is up.
+ */
+- if (!netif_carrier_ok(netdev))
+- mac->get_link_status = 1;
+-
+- return e1000e_has_link(adapter);
++ return netif_running(netdev) ? netif_carrier_ok(netdev) :
++ !!(er32(STATUS) & E1000_STATUS_LU);
+ }
+
+ static int e1000_set_spd_dplx(struct e1000_adapter *adapter, u16 spddplx)
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 8a2fe6c0..70c3e86 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -3968,7 +3968,7 @@ static void e1000_print_link_info(struct e1000_adapter *adapter)
+ ((ctrl & E1000_CTRL_TFCE) ? "TX" : "None" )));
+ }
+
+-bool e1000e_has_link(struct e1000_adapter *adapter)
++static bool e1000e_has_link(struct e1000_adapter *adapter)
+ {
+ struct e1000_hw *hw = &adapter->hw;
+ bool link_active = 0;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0106-e1000e-do-not-touch-PHY-page-800-registers-when-link.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0106-e1000e-do-not-touch-PHY-page-800-registers-when-link.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,36 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Thu, 17 Jun 2010 18:59:06 +0000
+Subject: [PATCH 106/166] e1000e: do not touch PHY page 800 registers when
+ link speed is 1000Mbps
+
+commit f2e2b3abe4f491130cfda814a8547783b08f10c2 upstream.
+
+The PHY on 82577/82578 has issues when the registers on page 800 are
+accessed when in gigabit mode. Do not clear the Wakeup Control register
+when resetting the part since it is on page 800 (and will be cleared on
+reset anyway).
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Jeff Pieper <jeffrey.e.pieper at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/netdev.c | 2 --
+ 1 files changed, 0 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 70c3e86..a33b63c 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -3185,8 +3185,6 @@ void e1000e_reset(struct e1000_adapter *adapter)
+ e1000_get_hw_control(adapter);
+
+ ew32(WUC, 0);
+- if (adapter->flags2 & FLAG2_HAS_PHY_WAKEUP)
+- e1e_wphy(&adapter->hw, BM_WUC, 0);
+
+ if (mac->ops.init_hw(hw))
+ e_err("Hardware Error\n");
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0107-e1000e-packet-split-should-not-be-used-with-early-re.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0107-e1000e-packet-split-should-not-be-used-with-early-re.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,36 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Thu, 17 Jun 2010 18:59:27 +0000
+Subject: [PATCH 107/166] e1000e: packet split should not be used with early
+ receive
+
+commit dbcb9fec5c79780152e32282297de6ddb1f6a43b upstream.
+
+Originally it was thought there were issues with ICHx/PCH parts with packet
+split when jumbo frames were enabled but in fact it is really only when
+early-receive is enabled (via ERT register) on these parts. Use packet
+split with jumbos but only when early-receive is not enabled.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Jeff Pieper <jeffrey.e.pieper at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/netdev.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index a33b63c..509d281 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -2772,7 +2772,7 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter)
+ * per packet.
+ */
+ pages = PAGE_USE_COUNT(adapter->netdev->mtu);
+- if (!(adapter->flags & FLAG_IS_ICH) && (pages <= 3) &&
++ if (!(adapter->flags & FLAG_HAS_ERT) && (pages <= 3) &&
+ (PAGE_SIZE <= 16384) && (rctl & E1000_RCTL_LPE))
+ adapter->rx_ps_pages = pages;
+ else
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0108-e1000e-disable-gig-speed-when-in-S0-Sx-transition.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0108-e1000e-disable-gig-speed-when-in-S0-Sx-transition.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,51 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Thu, 17 Jun 2010 18:59:48 +0000
+Subject: [PATCH 108/166] e1000e: disable gig speed when in S0->Sx transition
+
+commit 17f085df92ba74a4dc88744cbc7a699c231f8728 upstream.
+
+Most of this workaround is necessary for all ICHx/PCH parts so one of
+the two MAC-type checks can be removed.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Jeff Pieper <jeffrey.e.pieper at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/ich8lan.c | 19 +++++--------------
+ 1 files changed, 5 insertions(+), 14 deletions(-)
+
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index c7292a1..6b5e108 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -3457,21 +3457,12 @@ void e1000e_disable_gig_wol_ich8lan(struct e1000_hw *hw)
+ {
+ u32 phy_ctrl;
+
+- switch (hw->mac.type) {
+- case e1000_ich8lan:
+- case e1000_ich9lan:
+- case e1000_ich10lan:
+- case e1000_pchlan:
+- phy_ctrl = er32(PHY_CTRL);
+- phy_ctrl |= E1000_PHY_CTRL_D0A_LPLU |
+- E1000_PHY_CTRL_GBE_DISABLE;
+- ew32(PHY_CTRL, phy_ctrl);
++ phy_ctrl = er32(PHY_CTRL);
++ phy_ctrl |= E1000_PHY_CTRL_D0A_LPLU | E1000_PHY_CTRL_GBE_DISABLE;
++ ew32(PHY_CTRL, phy_ctrl);
+
+- if (hw->mac.type == e1000_pchlan)
+- e1000_phy_hw_reset_ich8lan(hw);
+- default:
+- break;
+- }
++ if (hw->mac.type >= e1000_pchlan)
++ e1000_phy_hw_reset_ich8lan(hw);
+ }
+
+ /**
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0109-e1000e-fail-when-try-to-setup-unsupported-features.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0109-e1000e-fail-when-try-to-setup-unsupported-features.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,27 @@
+From: Stanislaw Gruszka <sgruszka at redhat.com>
+Date: Sun, 27 Jun 2010 23:26:23 +0000
+Subject: [PATCH 109/166] e1000e: fail when try to setup unsupported features
+
+commit 52b6dcfe59d73347a598ba0826a6191a1e497679 upstream.
+
+Signed-off-by: Stanislaw Gruszka <sgruszka at redhat.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/ethtool.c | 1 -
+ 1 files changed, 0 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
+index 77c5829..6355a1b 100644
+--- a/drivers/net/e1000e/ethtool.c
++++ b/drivers/net/e1000e/ethtool.c
+@@ -2051,7 +2051,6 @@ static const struct ethtool_ops e1000_ethtool_ops = {
+ .get_coalesce = e1000_get_coalesce,
+ .set_coalesce = e1000_set_coalesce,
+ .get_flags = ethtool_op_get_flags,
+- .set_flags = ethtool_op_set_flags,
+ };
+
+ void e1000e_set_ethtool_ops(struct net_device *netdev)
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0110-e1000e-suppress-compile-warnings-on-certain-archs.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0110-e1000e-suppress-compile-warnings-on-certain-archs.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,96 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Tue, 29 Jun 2010 18:12:30 +0000
+Subject: [PATCH 110/166] e1000e: suppress compile warnings on certain archs
+
+commit 8eb64e6b856437318ac3de9c73789c9ab54b1589 upstream.
+
+Commit 84f4ee902ad3ee964b7b3a13d5b7cf9c086e9916 causes compile warnings on
+architectures that have unsigned long long's that are not 64-bit, e.g.
+ia64.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/netdev.c | 38 +++++++++++++++++++++-----------------
+ 1 files changed, 21 insertions(+), 17 deletions(-)
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 509d281..d9bb1dd 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -224,10 +224,10 @@ static void e1000e_dump(struct e1000_adapter *adapter)
+ buffer_info = &tx_ring->buffer_info[tx_ring->next_to_clean];
+ printk(KERN_INFO " %5d %5X %5X %016llX %04X %3X %016llX\n",
+ 0, tx_ring->next_to_use, tx_ring->next_to_clean,
+- (u64)buffer_info->dma,
++ (unsigned long long)buffer_info->dma,
+ buffer_info->length,
+ buffer_info->next_to_watch,
+- (u64)buffer_info->time_stamp);
++ (unsigned long long)buffer_info->time_stamp);
+
+ /* Print TX Rings */
+ if (!netif_msg_tx_done(adapter))
+@@ -279,9 +279,11 @@ static void e1000e_dump(struct e1000_adapter *adapter)
+ "%04X %3X %016llX %p",
+ (!(le64_to_cpu(u0->b) & (1<<29)) ? 'l' :
+ ((le64_to_cpu(u0->b) & (1<<20)) ? 'd' : 'c')), i,
+- le64_to_cpu(u0->a), le64_to_cpu(u0->b),
+- (u64)buffer_info->dma, buffer_info->length,
+- buffer_info->next_to_watch, (u64)buffer_info->time_stamp,
++ (unsigned long long)le64_to_cpu(u0->a),
++ (unsigned long long)le64_to_cpu(u0->b),
++ (unsigned long long)buffer_info->dma,
++ buffer_info->length, buffer_info->next_to_watch,
++ (unsigned long long)buffer_info->time_stamp,
+ buffer_info->skb);
+ if (i == tx_ring->next_to_use && i == tx_ring->next_to_clean)
+ printk(KERN_CONT " NTC/U\n");
+@@ -356,19 +358,19 @@ rx_ring_summary:
+ printk(KERN_INFO "RWB[0x%03X] %016llX "
+ "%016llX %016llX %016llX "
+ "---------------- %p", i,
+- le64_to_cpu(u1->a),
+- le64_to_cpu(u1->b),
+- le64_to_cpu(u1->c),
+- le64_to_cpu(u1->d),
++ (unsigned long long)le64_to_cpu(u1->a),
++ (unsigned long long)le64_to_cpu(u1->b),
++ (unsigned long long)le64_to_cpu(u1->c),
++ (unsigned long long)le64_to_cpu(u1->d),
+ buffer_info->skb);
+ } else {
+ printk(KERN_INFO "R [0x%03X] %016llX "
+ "%016llX %016llX %016llX %016llX %p", i,
+- le64_to_cpu(u1->a),
+- le64_to_cpu(u1->b),
+- le64_to_cpu(u1->c),
+- le64_to_cpu(u1->d),
+- (u64)buffer_info->dma,
++ (unsigned long long)le64_to_cpu(u1->a),
++ (unsigned long long)le64_to_cpu(u1->b),
++ (unsigned long long)le64_to_cpu(u1->c),
++ (unsigned long long)le64_to_cpu(u1->d),
++ (unsigned long long)buffer_info->dma,
+ buffer_info->skb);
+
+ if (netif_msg_pktdata(adapter))
+@@ -405,9 +407,11 @@ rx_ring_summary:
+ buffer_info = &rx_ring->buffer_info[i];
+ u0 = (struct my_u0 *)rx_desc;
+ printk(KERN_INFO "Rl[0x%03X] %016llX %016llX "
+- "%016llX %p",
+- i, le64_to_cpu(u0->a), le64_to_cpu(u0->b),
+- (u64)buffer_info->dma, buffer_info->skb);
++ "%016llX %p", i,
++ (unsigned long long)le64_to_cpu(u0->a),
++ (unsigned long long)le64_to_cpu(u0->b),
++ (unsigned long long)buffer_info->dma,
++ buffer_info->skb);
+ if (i == rx_ring->next_to_use)
+ printk(KERN_CONT " NTU\n");
+ else if (i == rx_ring->next_to_clean)
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0111-e1000e-remove-EEE-module-parameter.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0111-e1000e-remove-EEE-module-parameter.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,64 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Tue, 29 Jun 2010 18:12:52 +0000
+Subject: [PATCH 111/166] e1000e: remove EEE module parameter
+
+commit cc40f57a76be05e6f17a6c83ec6c60e3fbcf4217 upstream.
+
+As requested by Dave Miller. A follow-on set of patches will allow for
+ethtool to enable/disable the feature instead.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Emil Tantilov <emil.s.tantilov at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/param.c | 28 ----------------------------
+ 1 files changed, 0 insertions(+), 28 deletions(-)
+
+diff --git a/drivers/net/e1000e/param.c b/drivers/net/e1000e/param.c
+index 593251c..34aeec1 100644
+--- a/drivers/net/e1000e/param.c
++++ b/drivers/net/e1000e/param.c
+@@ -161,15 +161,6 @@ E1000_PARAM(WriteProtectNVM, "Write-protect NVM [WARNING: disabling this can lea
+ E1000_PARAM(CrcStripping, "Enable CRC Stripping, disable if your BMC needs " \
+ "the CRC");
+
+-/*
+- * Enable/disable EEE (a.k.a. IEEE802.3az)
+- *
+- * Valid Range: 0, 1
+- *
+- * Default Value: 1
+- */
+-E1000_PARAM(EEE, "Enable/disable on parts that support the feature");
+-
+ struct e1000_option {
+ enum { enable_option, range_option, list_option } type;
+ const char *name;
+@@ -486,23 +477,4 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
+ }
+ }
+ }
+- { /* EEE for parts supporting the feature */
+- static const struct e1000_option opt = {
+- .type = enable_option,
+- .name = "EEE Support",
+- .err = "defaulting to Enabled",
+- .def = OPTION_ENABLED
+- };
+-
+- if (adapter->flags2 & FLAG2_HAS_EEE) {
+- /* Currently only supported on 82579 */
+- if (num_EEE > bd) {
+- unsigned int eee = EEE[bd];
+- e1000_validate_option(&eee, &opt, adapter);
+- hw->dev_spec.ich8lan.eee_disable = !eee;
+- } else {
+- hw->dev_spec.ich8lan.eee_disable = !opt.def;
+- }
+- }
+- }
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0112-e1000e-disable-EEE-support-by-default.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0112-e1000e-disable-EEE-support-by-default.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,36 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Tue, 29 Jun 2010 18:13:13 +0000
+Subject: [PATCH 112/166] e1000e: disable EEE support by default
+
+commit 5a86f28f954c3841d3a6df4d07d2ed17088c3711 upstream.
+
+Based on community feedback, EEE should be disabled by default until the
+IEEE802.3az specification has been finalized.
+
+Cc: bhutchings at solarflare.com
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Emil Tantilov <emil.s.tantilov at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/ich8lan.c | 4 ++++
+ 1 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index 6b5e108..63930d1 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -731,6 +731,10 @@ static s32 e1000_get_variants_ich8lan(struct e1000_adapter *adapter)
+ (adapter->hw.phy.type == e1000_phy_igp_3))
+ adapter->flags |= FLAG_LSC_GIG_SPEED_DROP;
+
++ /* Disable EEE by default until IEEE802.3az spec is finalized */
++ if (adapter->flags2 & FLAG2_HAS_EEE)
++ adapter->hw.dev_spec.ich8lan.eee_disable = true;
++
+ return 0;
+ }
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0113-e1000e-Drop-a-useless-statement.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0113-e1000e-Drop-a-useless-statement.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,33 @@
+From: Jean Delvare <jdelvare at suse.de>
+Date: Mon, 26 Jul 2010 12:20:43 +0000
+Subject: [PATCH 113/166] e1000e: Drop a useless statement
+
+commit ea7afd31fb45d2d5d1b1e4cf347a688370feee91 upstream.
+
+err is set again a few lines below.
+
+Cc: Jesse Brandeburg <jesse.brandeburg at intel.com>
+Signed-off-by: Jean Delvare <jdelvare at suse.de>
+Acked-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/netdev.c | 2 --
+ 1 files changed, 0 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index d9bb1dd..c8b83e9 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -5649,8 +5649,6 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
+ if (err)
+ goto err_sw_init;
+
+- err = -EIO;
+-
+ memcpy(&hw->mac.ops, ei->mac_ops, sizeof(hw->mac.ops));
+ memcpy(&hw->nvm.ops, ei->nvm_ops, sizeof(hw->nvm.ops));
+ memcpy(&hw->phy.ops, ei->phy_ops, sizeof(hw->phy.ops));
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0114-e1000e-Fix-irq_synchronize-in-MSI-X-case.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0114-e1000e-Fix-irq_synchronize-in-MSI-X-case.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,102 @@
+From: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Date: Mon, 2 Aug 2010 14:27:23 +0000
+Subject: [PATCH 114/166] e1000e: Fix irq_synchronize in MSI-X case
+
+commit 8e86acd7d5968e08b3e1604e685a8c45f6fd7f40 upstream.
+
+Based on original patch/work from Jean Delvare <jdelvare at suse.de>
+Synchronize all IRQs when in MSI-X IRQ mode.
+
+Jean's original patch hard coded the sync with the 3 possible vectors,
+this patch incorporates more flexibility for the future and aligns
+with how igb stores the number of vectors into the adapter structure.
+
+CC: Jean Delvare <jdelvare at suse.de>
+Cc: Jesse Brandeburg <jesse.brandeburg at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Tested-by: Jeff Pieper <jeffrey.e.pieper at intel.com>
+Acked-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/e1000.h | 1 +
+ drivers/net/e1000e/netdev.c | 26 ++++++++++++++++++--------
+ 2 files changed, 19 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
+index 9ee133f..f9a31c8 100644
+--- a/drivers/net/e1000e/e1000.h
++++ b/drivers/net/e1000e/e1000.h
+@@ -348,6 +348,7 @@ struct e1000_adapter {
+ u32 test_icr;
+
+ u32 msg_enable;
++ unsigned int num_vectors;
+ struct msix_entry *msix_entries;
+ int int_mode;
+ u32 eiac_mask;
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index c8b83e9..393ac11 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -1785,25 +1785,25 @@ void e1000e_reset_interrupt_capability(struct e1000_adapter *adapter)
+ void e1000e_set_interrupt_capability(struct e1000_adapter *adapter)
+ {
+ int err;
+- int numvecs, i;
+-
++ int i;
+
+ switch (adapter->int_mode) {
+ case E1000E_INT_MODE_MSIX:
+ if (adapter->flags & FLAG_HAS_MSIX) {
+- numvecs = 3; /* RxQ0, TxQ0 and other */
+- adapter->msix_entries = kcalloc(numvecs,
++ adapter->num_vectors = 3; /* RxQ0, TxQ0 and other */
++ adapter->msix_entries = kcalloc(adapter->num_vectors,
+ sizeof(struct msix_entry),
+ GFP_KERNEL);
+ if (adapter->msix_entries) {
+- for (i = 0; i < numvecs; i++)
++ for (i = 0; i < adapter->num_vectors; i++)
+ adapter->msix_entries[i].entry = i;
+
+ err = pci_enable_msix(adapter->pdev,
+ adapter->msix_entries,
+- numvecs);
+- if (err == 0)
++ adapter->num_vectors);
++ if (err == 0) {
+ return;
++ }
+ }
+ /* MSI-X failed, so fall through and try MSI */
+ e_err("Failed to initialize MSI-X interrupts. "
+@@ -1825,6 +1825,9 @@ void e1000e_set_interrupt_capability(struct e1000_adapter *adapter)
+ /* Don't do anything; this is the system default */
+ break;
+ }
++
++ /* store the number of vectors being used */
++ adapter->num_vectors = 1;
+ }
+
+ /**
+@@ -1946,7 +1949,14 @@ static void e1000_irq_disable(struct e1000_adapter *adapter)
+ if (adapter->msix_entries)
+ ew32(EIAC_82574, 0);
+ e1e_flush();
+- synchronize_irq(adapter->pdev->irq);
++
++ if (adapter->msix_entries) {
++ int i;
++ for (i = 0; i < adapter->num_vectors; i++)
++ synchronize_irq(adapter->msix_entries[i].vector);
++ } else {
++ synchronize_irq(adapter->pdev->irq);
++ }
+ }
+
+ /**
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0115-e1000e-correct-MAC-PHY-interconnect-register-offset-.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0115-e1000e-correct-MAC-PHY-interconnect-register-offset-.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,36 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Tue, 3 Aug 2010 11:48:35 +0000
+Subject: [PATCH 115/166] e1000e: correct MAC-PHY interconnect register offset
+ for 82579
+
+commit 96f2bd13bfb6df5beec7fe55405ad94b528b8b4c upstream.
+
+The MAC-PHY interconnect register set on ICH/PCH parts is accessed through
+a peephole mechanism by writing an offset to a CSR register. The offset
+for the interconnect's half-duplex control register (which is used in a
+jumbo frame workaround for 82579) is incorrect.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Jeff Pieper <jeffrey.e.pieper at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/hw.h | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h
+index a419b07..66ed08f 100644
+--- a/drivers/net/e1000e/hw.h
++++ b/drivers/net/e1000e/hw.h
+@@ -313,7 +313,7 @@ enum e1e_registers {
+ #define E1000_KMRNCTRLSTA_DIAG_NELPBK 0x1000 /* Nearend Loopback mode */
+ #define E1000_KMRNCTRLSTA_K1_CONFIG 0x7
+ #define E1000_KMRNCTRLSTA_K1_ENABLE 0x0002
+-#define E1000_KMRNCTRLSTA_HD_CTRL 0x0002
++#define E1000_KMRNCTRLSTA_HD_CTRL 0x10 /* Kumeran HD Control */
+
+ #define IFE_PHY_EXTENDED_STATUS_CONTROL 0x10
+ #define IFE_PHY_SPECIAL_CONTROL 0x11 /* 100BaseTx PHY Special Control */
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0116-e100-e1000-igb-ixgb-Add-missing-read-memory-barrier.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0116-e100-e1000-igb-ixgb-Add-missing-read-memory-barrier.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,89 @@
+From: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Date: Sun, 8 Aug 2010 16:02:31 +0000
+Subject: [PATCH 116/166] e100/e1000*/igb*/ixgb*: Add missing read memory
+ barrier
+
+commit 2d0bb1c1f4524befe9f0fcf0d0cd3081a451223f upstream.
+
+Based on patches from Sonny Rao and Milton Miller...
+
+Combined the patches to fix up clean_tx_irq and clean_rx_irq.
+
+The PowerPC architecture does not require loads to independent bytes
+to be ordered without adding an explicit barrier.
+
+In ixgbe_clean_rx_irq we load the status bit then load the packet data.
+With packet split disabled if these loads go out of order we get a
+stale packet, but we will notice the bad sequence numbers and drop it.
+
+The problem occurs with packet split enabled where the TCP/IP header
+and data are in different descriptors. If the reads go out of order
+we may have data that doesn't match the TCP/IP header. Since we use
+hardware checksumming this bad data is never verified and it makes it
+all the way to the application.
+
+This bug was found during stress testing and adding this barrier has
+been shown to fix it. The bug can manifest as a data integrity issue
+(bad payload data) or as a BUG in skb_pull().
+
+This was a nasty bug to hunt down, if people agree with the fix I think
+it's a candidate for stable.
+
+Previously Submitted to e1000-devel only for ixgbe
+
+http://marc.info/?l=e1000-devel&m=126593062701537&w=3
+
+We've now seen this problem hit with other device drivers (e1000e mostly)
+So I'm resubmitting with fixes for other Intel Device Drivers with
+similar issues.
+
+CC: Milton Miller <miltonm at bga.com>
+CC: Anton Blanchard <anton at samba.org>
+CC: Sonny Rao <sonnyrao at us.ibm.com>
+CC: stable <stable at kernel.org>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Restricted to drivers/net/e1000e]
+---
+ drivers/net/e1000e/netdev.c | 4 ++++
+ 1 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 393ac11..2a697d3 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -781,6 +781,7 @@ static bool e1000_clean_rx_irq(struct e1000_adapter *adapter,
+ if (*work_done >= work_to_do)
+ break;
+ (*work_done)++;
++ rmb(); /* read descriptor and rx_buffer_info after status DD */
+
+ status = rx_desc->status;
+ skb = buffer_info->skb;
+@@ -991,6 +992,7 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter)
+ while ((eop_desc->upper.data & cpu_to_le32(E1000_TXD_STAT_DD)) &&
+ (count < tx_ring->count)) {
+ bool cleaned = false;
++ rmb(); /* read buffer_info after eop_desc */
+ for (; !cleaned; count++) {
+ tx_desc = E1000_TX_DESC(*tx_ring, i);
+ buffer_info = &tx_ring->buffer_info[i];
+@@ -1087,6 +1089,7 @@ static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
+ break;
+ (*work_done)++;
+ skb = buffer_info->skb;
++ rmb(); /* read descriptor and rx_buffer_info after status DD */
+
+ /* in the packet split case this is header only */
+ prefetch(skb->data - NET_IP_ALIGN);
+@@ -1286,6 +1289,7 @@ static bool e1000_clean_jumbo_rx_irq(struct e1000_adapter *adapter,
+ if (*work_done >= work_to_do)
+ break;
+ (*work_done)++;
++ rmb(); /* read descriptor and rx_buffer_info after status DD */
+
+ status = rx_desc->status;
+ skb = buffer_info->skb;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0117-e1000e-disable-ASPM-L1-on-82573.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0117-e1000e-disable-ASPM-L1-on-82573.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,35 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Thu, 19 Aug 2010 15:48:30 -0700
+Subject: [PATCH 117/166] e1000e: disable ASPM L1 on 82573
+
+commit 19833b5dffe2f2e92a1b377f9aae9d5f32239512 upstream.
+
+On the e1000-devel mailing list, Nils Faerber reported latency issues with
+the 82573 LOM on a ThinkPad X60. It was found to be caused by ASPM L1;
+disabling it resolves the latency. The issue is present in kernels back
+to 2.6.34 and possibly 2.6.33.
+
+Reported-by: Nils Faerber <nils.faerber at kernelconcepts.de>
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Cc: stable at kernel.org
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/82571.c | 1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+index a4a0d2b..f844e6c 100644
+--- a/drivers/net/e1000e/82571.c
++++ b/drivers/net/e1000e/82571.c
+@@ -1833,6 +1833,7 @@ struct e1000_info e1000_82573_info = {
+ | FLAG_HAS_SMART_POWER_DOWN
+ | FLAG_HAS_AMT
+ | FLAG_HAS_SWSM_ON_LOAD,
++ .flags2 = FLAG2_DISABLE_ASPM_L1,
+ .pba = 20,
+ .max_hw_frame_size = ETH_FRAME_LEN + ETH_FCS_LEN,
+ .get_variants = e1000_get_variants_82571,
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0118-e1000e-don-t-check-for-alternate-MAC-addr-on-parts-t.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0118-e1000e-don-t-check-for-alternate-MAC-addr-on-parts-t.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,124 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Thu, 19 Aug 2010 15:48:52 -0700
+Subject: [PATCH 118/166] e1000e: don't check for alternate MAC addr on parts
+ that don't support it
+
+commit 1aef70ef125165e0114a8e475636eff242a52030 upstream.
+
+From: Bruce Allan <bruce.w.allan at intel.com>
+
+The alternate MAC address feature is only supported by 80003ES2LAN and
+82571 LOMs as well as a couple 82571 mezzanine cards. Checking for an
+alternate MAC address on other parts can fail leading to the driver not
+able to load. This patch limits the check for an alternate MAC address
+to be done only for parts that support the feature.
+
+This issue has been around since support for the feature was introduced
+to the e1000e driver in 2.6.34.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Reported-by: Fabio Varesano <fax8 at users.sourceforge.net>
+Cc: stable at kernel.org
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/82571.c | 30 +++++++++++++++++-------------
+ drivers/net/e1000e/defines.h | 4 ++++
+ drivers/net/e1000e/lib.c | 10 ++++++++++
+ 3 files changed, 31 insertions(+), 13 deletions(-)
+
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+index f844e6c..d3d4a57 100644
+--- a/drivers/net/e1000e/82571.c
++++ b/drivers/net/e1000e/82571.c
+@@ -936,12 +936,14 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
+ ew32(IMC, 0xffffffff);
+ icr = er32(ICR);
+
+- /* Install any alternate MAC address into RAR0 */
+- ret_val = e1000_check_alt_mac_addr_generic(hw);
+- if (ret_val)
+- return ret_val;
++ if (hw->mac.type == e1000_82571) {
++ /* Install any alternate MAC address into RAR0 */
++ ret_val = e1000_check_alt_mac_addr_generic(hw);
++ if (ret_val)
++ return ret_val;
+
+- e1000e_set_laa_state_82571(hw, true);
++ e1000e_set_laa_state_82571(hw, true);
++ }
+
+ /* Reinitialize the 82571 serdes link state machine */
+ if (hw->phy.media_type == e1000_media_type_internal_serdes)
+@@ -1618,14 +1620,16 @@ static s32 e1000_read_mac_addr_82571(struct e1000_hw *hw)
+ {
+ s32 ret_val = 0;
+
+- /*
+- * If there's an alternate MAC address place it in RAR0
+- * so that it will override the Si installed default perm
+- * address.
+- */
+- ret_val = e1000_check_alt_mac_addr_generic(hw);
+- if (ret_val)
+- goto out;
++ if (hw->mac.type == e1000_82571) {
++ /*
++ * If there's an alternate MAC address place it in RAR0
++ * so that it will override the Si installed default perm
++ * address.
++ */
++ ret_val = e1000_check_alt_mac_addr_generic(hw);
++ if (ret_val)
++ goto out;
++ }
+
+ ret_val = e1000_read_mac_addr_generic(hw);
+
+diff --git a/drivers/net/e1000e/defines.h b/drivers/net/e1000e/defines.h
+index 307a72f..93b3bed 100644
+--- a/drivers/net/e1000e/defines.h
++++ b/drivers/net/e1000e/defines.h
+@@ -621,6 +621,7 @@
+ #define E1000_FLASH_UPDATES 2000
+
+ /* NVM Word Offsets */
++#define NVM_COMPAT 0x0003
+ #define NVM_ID_LED_SETTINGS 0x0004
+ #define NVM_INIT_CONTROL2_REG 0x000F
+ #define NVM_INIT_CONTROL3_PORT_B 0x0014
+@@ -643,6 +644,9 @@
+ /* Mask bits for fields in Word 0x1a of the NVM */
+ #define NVM_WORD1A_ASPM_MASK 0x000C
+
++/* Mask bits for fields in Word 0x03 of the EEPROM */
++#define NVM_COMPAT_LOM 0x0800
++
+ /* For checksumming, the sum of all words in the NVM should equal 0xBABA. */
+ #define NVM_SUM 0xBABA
+
+diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c
+index df4a279..0fd4eb5 100644
+--- a/drivers/net/e1000e/lib.c
++++ b/drivers/net/e1000e/lib.c
+@@ -183,6 +183,16 @@ s32 e1000_check_alt_mac_addr_generic(struct e1000_hw *hw)
+ u16 offset, nvm_alt_mac_addr_offset, nvm_data;
+ u8 alt_mac_addr[ETH_ALEN];
+
++ ret_val = e1000_read_nvm(hw, NVM_COMPAT, 1, &nvm_data);
++ if (ret_val)
++ goto out;
++
++ /* Check for LOM (vs. NIC) or one of two valid mezzanine cards */
++ if (!((nvm_data & NVM_COMPAT_LOM) ||
++ (hw->adapter->pdev->device == E1000_DEV_ID_82571EB_SERDES_DUAL) ||
++ (hw->adapter->pdev->device == E1000_DEV_ID_82571EB_SERDES_QUAD)))
++ goto out;
++
+ ret_val = e1000_read_nvm(hw, NVM_ALT_MAC_ADDR_PTR, 1,
+ &nvm_alt_mac_addr_offset);
+ if (ret_val) {
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0119-drivers-net-Remove-address-use-from-assignments-of-f.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0119-drivers-net-Remove-address-use-from-assignments-of-f.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,59 @@
+From: Joe Perches <joe at perches.com>
+Date: Mon, 23 Aug 2010 18:20:03 +0000
+Subject: [PATCH 119/166] drivers/net: Remove address use from assignments of
+ function pointers
+
+commit c061b18df0f1fe3f50fe451dbbdc9ede3c19701a upstream.
+
+"foo = &function" is more commonly written "foo = function"
+
+Done with coccinelle script:
+
+// <smpl>
+ at r@
+identifier f;
+@@
+
+f(...) { ... }
+
+@@
+identifier r.f;
+@@
+
+- &f
++ f
+// </smpl>
+
+drivers/net/tehuti.c used a function and struct with the
+same name, the function was renamed.
+
+Compile tested x86 only.
+
+Signed-off-by: Joe Perches <joe at perches.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Restricted to drivers/net/e1000e]
+---
+ drivers/net/e1000e/netdev.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 2a697d3..206173d 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -5747,11 +5747,11 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
+ }
+
+ init_timer(&adapter->watchdog_timer);
+- adapter->watchdog_timer.function = &e1000_watchdog;
++ adapter->watchdog_timer.function = e1000_watchdog;
+ adapter->watchdog_timer.data = (unsigned long) adapter;
+
+ init_timer(&adapter->phy_info_timer);
+- adapter->phy_info_timer.function = &e1000_update_phy_info;
++ adapter->phy_info_timer.function = e1000_update_phy_info;
+ adapter->phy_info_timer.data = (unsigned long) adapter;
+
+ INIT_WORK(&adapter->reset_task, e1000_reset_task);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0120-e1000e-Simplify-MSI-interrupt-testing.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0120-e1000e-Simplify-MSI-interrupt-testing.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,75 @@
+From: Jean Delvare <jdelvare at suse.de>
+Date: Sun, 12 Sep 2010 22:45:39 +0000
+Subject: [PATCH 120/166] e1000e: Simplify MSI interrupt testing
+
+commit 068e8a30320e33b1f8d15df9eaef84f04258f96d upstream.
+
+The code is quite convoluted, simplify it. This also avoids calling
+e1000_request_irq() without testing the value it returned, which was
+bad.
+
+Signed-off-by: Jean Delvare <jdelvare at suse.de>
+Cc: Bruce Allan <bruce.w.allan at intel.com>
+Cc: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Acked-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/netdev.c | 29 ++++-------------------------
+ 1 files changed, 4 insertions(+), 25 deletions(-)
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 206173d..fa55fcc 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -3422,22 +3422,16 @@ static int e1000_test_msi_interrupt(struct e1000_adapter *adapter)
+
+ if (adapter->flags & FLAG_MSI_TEST_FAILED) {
+ adapter->int_mode = E1000E_INT_MODE_LEGACY;
+- err = -EIO;
+- e_info("MSI interrupt test failed!\n");
+- }
++ e_info("MSI interrupt test failed, using legacy interrupt.\n");
++ } else
++ e_dbg("MSI interrupt test succeeded!\n");
+
+ free_irq(adapter->pdev->irq, netdev);
+ pci_disable_msi(adapter->pdev);
+
+- if (err == -EIO)
+- goto msi_test_failed;
+-
+- /* okay so the test worked, restore settings */
+- e_dbg("MSI interrupt test succeeded!\n");
+ msi_test_failed:
+ e1000e_set_interrupt_capability(adapter);
+- e1000_request_irq(adapter);
+- return err;
++ return e1000_request_irq(adapter);
+ }
+
+ /**
+@@ -3469,21 +3463,6 @@ static int e1000_test_msi(struct e1000_adapter *adapter)
+ pci_write_config_word(adapter->pdev, PCI_COMMAND, pci_cmd);
+ }
+
+- /* success ! */
+- if (!err)
+- return 0;
+-
+- /* EIO means MSI test failed */
+- if (err != -EIO)
+- return err;
+-
+- /* back to INTx mode */
+- e_warn("MSI interrupt test failed, using legacy interrupt.\n");
+-
+- e1000_free_irq(adapter);
+-
+- err = e1000_request_irq(adapter);
+-
+ return err;
+ }
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0121-e1000e-82577-8-9-issues-with-device-in-Sx.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0121-e1000e-82577-8-9-issues-with-device-in-Sx.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,109 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Wed, 22 Sep 2010 17:15:08 +0000
+Subject: [PATCH 121/166] e1000e: 82577/8/9 issues with device in Sx
+
+commit 8395ae8303255b31a8625035fc98391c88b0c257 upstream.
+
+When going to Sx, disable gigabit in PHY (e1000_oem_bits_config_ich8lan)
+in addition to the MAC before configuring PHY wakeup otherwise the PHY
+configuration writes might be missed. Also write the LED configuration
+and SMBus address to the PHY registers (e1000_oem_bits_config_ich8lan and
+e1000_write_smbus_addr, respectively). The reset is no longer needed
+since re-auto-negotiation is forced in e1000_oem_bits_config_ich8lan and
+leaving it in causes issues with auto-negotiating the link.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Jeff Pieper <jeffrey.e.pieper at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/ich8lan.c | 47 ++++++++++++++++++++++++++++++++++-------
+ 1 files changed, 39 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index 63930d1..822de48 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -125,6 +125,7 @@
+
+ /* SMBus Address Phy Register */
+ #define HV_SMB_ADDR PHY_REG(768, 26)
++#define HV_SMB_ADDR_MASK 0x007F
+ #define HV_SMB_ADDR_PEC_EN 0x0200
+ #define HV_SMB_ADDR_VALID 0x0080
+
+@@ -895,6 +896,34 @@ static s32 e1000_check_reset_block_ich8lan(struct e1000_hw *hw)
+ }
+
+ /**
++ * e1000_write_smbus_addr - Write SMBus address to PHY needed during Sx states
++ * @hw: pointer to the HW structure
++ *
++ * Assumes semaphore already acquired.
++ *
++ **/
++static s32 e1000_write_smbus_addr(struct e1000_hw *hw)
++{
++ u16 phy_data;
++ u32 strap = er32(STRAP);
++ s32 ret_val = 0;
++
++ strap &= E1000_STRAP_SMBUS_ADDRESS_MASK;
++
++ ret_val = e1000_read_phy_reg_hv_locked(hw, HV_SMB_ADDR, &phy_data);
++ if (ret_val)
++ goto out;
++
++ phy_data &= ~HV_SMB_ADDR_MASK;
++ phy_data |= (strap >> E1000_STRAP_SMBUS_ADDRESS_SHIFT);
++ phy_data |= HV_SMB_ADDR_PEC_EN | HV_SMB_ADDR_VALID;
++ ret_val = e1000_write_phy_reg_hv_locked(hw, HV_SMB_ADDR, phy_data);
++
++out:
++ return ret_val;
++}
++
++/**
+ * e1000_sw_lcd_config_ich8lan - SW-based LCD Configuration
+ * @hw: pointer to the HW structure
+ *
+@@ -970,12 +999,7 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw)
+ * When both NVM bits are cleared, SW will configure
+ * them instead.
+ */
+- data = er32(STRAP);
+- data &= E1000_STRAP_SMBUS_ADDRESS_MASK;
+- reg_data = data >> E1000_STRAP_SMBUS_ADDRESS_SHIFT;
+- reg_data |= HV_SMB_ADDR_PEC_EN | HV_SMB_ADDR_VALID;
+- ret_val = e1000_write_phy_reg_hv_locked(hw, HV_SMB_ADDR,
+- reg_data);
++ ret_val = e1000_write_smbus_addr(hw);
+ if (ret_val)
+ goto out;
+
+@@ -3460,13 +3484,20 @@ void e1000e_gig_downshift_workaround_ich8lan(struct e1000_hw *hw)
+ void e1000e_disable_gig_wol_ich8lan(struct e1000_hw *hw)
+ {
+ u32 phy_ctrl;
++ s32 ret_val;
+
+ phy_ctrl = er32(PHY_CTRL);
+ phy_ctrl |= E1000_PHY_CTRL_D0A_LPLU | E1000_PHY_CTRL_GBE_DISABLE;
+ ew32(PHY_CTRL, phy_ctrl);
+
+- if (hw->mac.type >= e1000_pchlan)
+- e1000_phy_hw_reset_ich8lan(hw);
++ if (hw->mac.type >= e1000_pchlan) {
++ e1000_oem_bits_config_ich8lan(hw, true);
++ ret_val = hw->phy.ops.acquire(hw);
++ if (ret_val)
++ return;
++ e1000_write_smbus_addr(hw);
++ hw->phy.ops.release(hw);
++ }
+ }
+
+ /**
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0122-e1000e-82579-SMBus-address-and-LEDs-incorrect-after-.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0122-e1000e-82579-SMBus-address-and-LEDs-incorrect-after-.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,41 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Wed, 22 Sep 2010 17:15:33 +0000
+Subject: [PATCH 122/166] e1000e: 82579 SMBus address and LEDs incorrect after
+ device reset
+
+commit 87fb7410cd8d4396dee0155526568645adba3b99 upstream.
+
+Since the hardware is prevented from performing automatic PHY configuration
+(the driver does it instead), the OEM_WRITE_ENABLE bit in the EXTCNF_CTRL
+register will not get cleared preventing the SMBus address and the LED
+configuration to be written to the PHY registers. On 82579, do not check
+the OEM_WRITE_ENABLE bit.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Jeff Pieper <jeffrey.e.pieper at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/ich8lan.c | 6 +++---
+ 1 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index 822de48..fc8c3ce 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -990,9 +990,9 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw)
+ cnf_base_addr = data & E1000_EXTCNF_CTRL_EXT_CNF_POINTER_MASK;
+ cnf_base_addr >>= E1000_EXTCNF_CTRL_EXT_CNF_POINTER_SHIFT;
+
+- if (!(data & E1000_EXTCNF_CTRL_OEM_WRITE_ENABLE) &&
+- ((hw->mac.type == e1000_pchlan) ||
+- (hw->mac.type == e1000_pch2lan))) {
++ if ((!(data & E1000_EXTCNF_CTRL_OEM_WRITE_ENABLE) &&
++ (hw->mac.type == e1000_pchlan)) ||
++ (hw->mac.type == e1000_pch2lan)) {
+ /*
+ * HW configures the SMBus address and LEDs when the
+ * OEM and LCD Write Enable bits are set in the NVM.
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0123-e1000e-82566DC-fails-to-get-link.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0123-e1000e-82566DC-fails-to-get-link.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,58 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Wed, 22 Sep 2010 17:15:54 +0000
+Subject: [PATCH 123/166] e1000e: 82566DC fails to get link
+
+commit 5f3eed6fe0e36e4b56c8dd9160241a868ee0de2a upstream.
+
+Two recent patches to cleanup the reset[1] and initial PHY configuration[2]
+code paths for ICH/PCH devices inadvertently left out a 10msec delay and
+device ID check respectively which are necessary for the 82566DC (device id
+0x104b) to be configured properly, otherwise it will not get link.
+
+[1] commit e98cac447cc1cc418dff1d610a5c79c4f2bdec7f
+[2] commit 3f0c16e84438d657d29446f85fe375794a93f159
+
+CC: stable at kernel.org
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Jeff Pieper <jeffrey.e.pieper at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/ich8lan.c | 7 +++++--
+ 1 files changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index fc8c3ce..6f9cb0d 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -932,7 +932,6 @@ out:
+ **/
+ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw)
+ {
+- struct e1000_adapter *adapter = hw->adapter;
+ struct e1000_phy_info *phy = &hw->phy;
+ u32 i, data, cnf_size, cnf_base_addr, sw_cfg_mask;
+ s32 ret_val = 0;
+@@ -950,7 +949,8 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw)
+ if (phy->type != e1000_phy_igp_3)
+ return ret_val;
+
+- if (adapter->pdev->device == E1000_DEV_ID_ICH8_IGP_AMT) {
++ if ((hw->adapter->pdev->device == E1000_DEV_ID_ICH8_IGP_AMT) ||
++ (hw->adapter->pdev->device == E1000_DEV_ID_ICH8_IGP_C)) {
+ sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG;
+ break;
+ }
+@@ -1626,6 +1626,9 @@ static s32 e1000_post_phy_reset_ich8lan(struct e1000_hw *hw)
+ if (e1000_check_reset_block(hw))
+ goto out;
+
++ /* Allow time for h/w to get to quiescent state after reset */
++ msleep(10);
++
+ /* Perform any necessary post-reset workarounds */
+ switch (hw->mac.type) {
+ case e1000_pchlan:
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0124-e1000e-82579-unaccounted-missed-packets.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0124-e1000e-82579-unaccounted-missed-packets.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,116 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Wed, 22 Sep 2010 17:16:18 +0000
+Subject: [PATCH 124/166] e1000e: 82579 unaccounted missed packets
+
+commit 831bd2e6a6c09588fdde453ecb858f050ac1b942 upstream.
+
+On 82579, there is a hardware bug that can cause received packets to not
+get transferred from the PHY to the MAC due to K1 (a power saving feature
+of the PHY-MAC interconnect similar to ASPM L1). Since the MAC controls
+the accounting of missed packets, these will go unnoticed. Workaround the
+issue by setting the K1 beacon duration according to the link speed.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Jeff Pieper <jeffrey.e.pieper at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/hw.h | 1 +
+ drivers/net/e1000e/ich8lan.c | 48 ++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 49 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h
+index 66ed08f..ba302a5 100644
+--- a/drivers/net/e1000e/hw.h
++++ b/drivers/net/e1000e/hw.h
+@@ -57,6 +57,7 @@ enum e1e_registers {
+ E1000_SCTL = 0x00024, /* SerDes Control - RW */
+ E1000_FCAL = 0x00028, /* Flow Control Address Low - RW */
+ E1000_FCAH = 0x0002C, /* Flow Control Address High -RW */
++ E1000_FEXTNVM4 = 0x00024, /* Future Extended NVM 4 - RW */
+ E1000_FEXTNVM = 0x00028, /* Future Extended NVM - RW */
+ E1000_FCT = 0x00030, /* Flow Control Type - RW */
+ E1000_VET = 0x00038, /* VLAN Ether Type - RW */
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index 6f9cb0d..89b1e1a 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -105,6 +105,10 @@
+ #define E1000_FEXTNVM_SW_CONFIG 1
+ #define E1000_FEXTNVM_SW_CONFIG_ICH8M (1 << 27) /* Bit redefined for ICH8M :/ */
+
++#define E1000_FEXTNVM4_BEACON_DURATION_MASK 0x7
++#define E1000_FEXTNVM4_BEACON_DURATION_8USEC 0x7
++#define E1000_FEXTNVM4_BEACON_DURATION_16USEC 0x3
++
+ #define PCIE_ICH8_SNOOP_ALL PCIE_NO_SNOOP_ALL
+
+ #define E1000_ICH_RAR_ENTRIES 7
+@@ -238,6 +242,7 @@ static s32 e1000_k1_gig_workaround_hv(struct e1000_hw *hw, bool link);
+ static s32 e1000_set_mdio_slow_mode_hv(struct e1000_hw *hw);
+ static bool e1000_check_mng_mode_ich8lan(struct e1000_hw *hw);
+ static bool e1000_check_mng_mode_pchlan(struct e1000_hw *hw);
++static s32 e1000_k1_workaround_lv(struct e1000_hw *hw);
+
+ static inline u16 __er16flash(struct e1000_hw *hw, unsigned long reg)
+ {
+@@ -653,6 +658,12 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
+ goto out;
+ }
+
++ if (hw->mac.type == e1000_pch2lan) {
++ ret_val = e1000_k1_workaround_lv(hw);
++ if (ret_val)
++ goto out;
++ }
++
+ /*
+ * Check if there was DownShift, must be checked
+ * immediately after link-up
+@@ -1583,6 +1594,43 @@ out:
+ }
+
+ /**
++ * e1000_k1_gig_workaround_lv - K1 Si workaround
++ * @hw: pointer to the HW structure
++ *
++ * Workaround to set the K1 beacon duration for 82579 parts
++ **/
++static s32 e1000_k1_workaround_lv(struct e1000_hw *hw)
++{
++ s32 ret_val = 0;
++ u16 status_reg = 0;
++ u32 mac_reg;
++
++ if (hw->mac.type != e1000_pch2lan)
++ goto out;
++
++ /* Set K1 beacon duration based on 1Gbps speed or otherwise */
++ ret_val = e1e_rphy(hw, HV_M_STATUS, &status_reg);
++ if (ret_val)
++ goto out;
++
++ if ((status_reg & (HV_M_STATUS_LINK_UP | HV_M_STATUS_AUTONEG_COMPLETE))
++ == (HV_M_STATUS_LINK_UP | HV_M_STATUS_AUTONEG_COMPLETE)) {
++ mac_reg = er32(FEXTNVM4);
++ mac_reg &= ~E1000_FEXTNVM4_BEACON_DURATION_MASK;
++
++ if (status_reg & HV_M_STATUS_SPEED_1000)
++ mac_reg |= E1000_FEXTNVM4_BEACON_DURATION_8USEC;
++ else
++ mac_reg |= E1000_FEXTNVM4_BEACON_DURATION_16USEC;
++
++ ew32(FEXTNVM4, mac_reg);
++ }
++
++out:
++ return ret_val;
++}
++
++/**
+ * e1000_lan_init_done_ich8lan - Check for PHY config completion
+ * @hw: pointer to the HW structure
+ *
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0125-e1000e-82579-jumbo-frame-workaround-causing-CRC-erro.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0125-e1000e-82579-jumbo-frame-workaround-causing-CRC-erro.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,131 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Wed, 22 Sep 2010 17:16:40 +0000
+Subject: [PATCH 125/166] e1000e: 82579 jumbo frame workaround causing CRC
+ errors
+
+commit a1ce647378c0262fe72757f989e961b2de6460a5 upstream.
+
+The subject workaround was causing CRC errors due to writing the wrong
+register with updates of the RCTL register. It was also found that the
+workaround function which modifies the RCTL register was being called in
+the middle of a read-modify-write operation of the RCTL register, so the
+function call has been moved appropriately. Lastly, jumbo frames must not
+be allowed when CRC stripping is disabled by a module parameter because the
+workaround requires the CRC be stripped.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Jeff Pieper <jeffrey.e.pieper at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/ich8lan.c | 12 +-----------
+ drivers/net/e1000e/netdev.c | 29 +++++++++++++++++++----------
+ 2 files changed, 20 insertions(+), 21 deletions(-)
+
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index 89b1e1a..bb346ae 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -1475,10 +1475,6 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable)
+ goto out;
+
+ /* Enable jumbo frame workaround in the PHY */
+- e1e_rphy(hw, PHY_REG(769, 20), &data);
+- ret_val = e1e_wphy(hw, PHY_REG(769, 20), data & ~(1 << 14));
+- if (ret_val)
+- goto out;
+ e1e_rphy(hw, PHY_REG(769, 23), &data);
+ data &= ~(0x7F << 5);
+ data |= (0x37 << 5);
+@@ -1487,7 +1483,6 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable)
+ goto out;
+ e1e_rphy(hw, PHY_REG(769, 16), &data);
+ data &= ~(1 << 13);
+- data |= (1 << 12);
+ ret_val = e1e_wphy(hw, PHY_REG(769, 16), data);
+ if (ret_val)
+ goto out;
+@@ -1512,7 +1507,7 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable)
+
+ mac_reg = er32(RCTL);
+ mac_reg &= ~E1000_RCTL_SECRC;
+- ew32(FFLT_DBG, mac_reg);
++ ew32(RCTL, mac_reg);
+
+ ret_val = e1000e_read_kmrn_reg(hw,
+ E1000_KMRNCTRLSTA_CTRL_OFFSET,
+@@ -1538,17 +1533,12 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable)
+ goto out;
+
+ /* Write PHY register values back to h/w defaults */
+- e1e_rphy(hw, PHY_REG(769, 20), &data);
+- ret_val = e1e_wphy(hw, PHY_REG(769, 20), data & ~(1 << 14));
+- if (ret_val)
+- goto out;
+ e1e_rphy(hw, PHY_REG(769, 23), &data);
+ data &= ~(0x7F << 5);
+ ret_val = e1e_wphy(hw, PHY_REG(769, 23), data);
+ if (ret_val)
+ goto out;
+ e1e_rphy(hw, PHY_REG(769, 16), &data);
+- data &= ~(1 << 12);
+ data |= (1 << 13);
+ ret_val = e1e_wphy(hw, PHY_REG(769, 16), data);
+ if (ret_val)
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index fa55fcc..a6136c7 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -2704,6 +2704,16 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter)
+ u32 psrctl = 0;
+ u32 pages = 0;
+
++ /* Workaround Si errata on 82579 - configure jumbo frame flow */
++ if (hw->mac.type == e1000_pch2lan) {
++ s32 ret_val;
++
++ if (adapter->netdev->mtu > ETH_DATA_LEN)
++ ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, true);
++ else
++ ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, false);
++ }
++
+ /* Program MC offset vector base */
+ rctl = er32(RCTL);
+ rctl &= ~(3 << E1000_RCTL_MO_SHIFT);
+@@ -2744,16 +2754,6 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter)
+ e1e_wphy(hw, 22, phy_data);
+ }
+
+- /* Workaround Si errata on 82579 - configure jumbo frame flow */
+- if (hw->mac.type == e1000_pch2lan) {
+- s32 ret_val;
+-
+- if (rctl & E1000_RCTL_LPE)
+- ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, true);
+- else
+- ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, false);
+- }
+-
+ /* Setup buffer sizes */
+ rctl &= ~E1000_RCTL_SZ_4096;
+ rctl |= E1000_RCTL_BSEX;
+@@ -4814,6 +4814,15 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu)
+ return -EINVAL;
+ }
+
++ /* Jumbo frame workaround on 82579 requires CRC be stripped */
++ if ((adapter->hw.mac.type == e1000_pch2lan) &&
++ !(adapter->flags2 & FLAG2_CRC_STRIPPING) &&
++ (new_mtu > ETH_DATA_LEN)) {
++ e_err("Jumbo Frames not supported on 82579 when CRC "
++ "stripping is disabled.\n");
++ return -EINVAL;
++ }
++
+ /* 82573 Errata 17 */
+ if (((adapter->hw.mac.type == e1000_82573) ||
+ (adapter->hw.mac.type == e1000_82574)) &&
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0126-e1000e-82579-do-not-gate-auto-config-of-PHY-by-hardw.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0126-e1000e-82579-do-not-gate-auto-config-of-PHY-by-hardw.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,179 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Wed, 22 Sep 2010 17:17:01 +0000
+Subject: [PATCH 126/166] e1000e: 82579 do not gate auto config of PHY by
+ hardware during nominal use
+
+commit 605c82bab5abe0816e5e32716875c245f89f39da upstream.
+
+For non-managed versions of 82579, set the bit that prevents the hardware
+from automatically configuring the PHY after resets only when the driver
+performs a reset, clear the bit after resets. This is so the hardware can
+configure the PHY automatically when the part is reset in a manner that is
+not controlled by the driver (e.g. in a virtual environment via PCI FLR)
+otherwise the PHY will be mis-configured causing issues such as failing to
+link at 1000Mbps.
+For managed versions of 82579, keep the previous behavior since the
+manageability firmware will handle the PHY configuration.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Jeff Pieper <jeffrey.e.pieper at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/ich8lan.c | 77 +++++++++++++++++++++++++++++++++++++-----
+ 1 files changed, 68 insertions(+), 9 deletions(-)
+
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index bb346ae..57b5435 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -243,6 +243,7 @@ static s32 e1000_set_mdio_slow_mode_hv(struct e1000_hw *hw);
+ static bool e1000_check_mng_mode_ich8lan(struct e1000_hw *hw);
+ static bool e1000_check_mng_mode_pchlan(struct e1000_hw *hw);
+ static s32 e1000_k1_workaround_lv(struct e1000_hw *hw);
++static void e1000_gate_hw_phy_config_ich8lan(struct e1000_hw *hw, bool gate);
+
+ static inline u16 __er16flash(struct e1000_hw *hw, unsigned long reg)
+ {
+@@ -278,7 +279,7 @@ static inline void __ew32flash(struct e1000_hw *hw, unsigned long reg, u32 val)
+ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw)
+ {
+ struct e1000_phy_info *phy = &hw->phy;
+- u32 ctrl;
++ u32 ctrl, fwsm;
+ s32 ret_val = 0;
+
+ phy->addr = 1;
+@@ -300,7 +301,8 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw)
+ * disabled, then toggle the LANPHYPC Value bit to force
+ * the interconnect to PCIe mode.
+ */
+- if (!(er32(FWSM) & E1000_ICH_FWSM_FW_VALID)) {
++ fwsm = er32(FWSM);
++ if (!(fwsm & E1000_ICH_FWSM_FW_VALID)) {
+ ctrl = er32(CTRL);
+ ctrl |= E1000_CTRL_LANPHYPC_OVERRIDE;
+ ctrl &= ~E1000_CTRL_LANPHYPC_VALUE;
+@@ -309,6 +311,13 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw)
+ ctrl &= ~E1000_CTRL_LANPHYPC_OVERRIDE;
+ ew32(CTRL, ctrl);
+ msleep(50);
++
++ /*
++ * Gate automatic PHY configuration by hardware on
++ * non-managed 82579
++ */
++ if (hw->mac.type == e1000_pch2lan)
++ e1000_gate_hw_phy_config_ich8lan(hw, true);
+ }
+
+ /*
+@@ -321,6 +330,13 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw)
+ if (ret_val)
+ goto out;
+
++ /* Ungate automatic PHY configuration on non-managed 82579 */
++ if ((hw->mac.type == e1000_pch2lan) &&
++ !(fwsm & E1000_ICH_FWSM_FW_VALID)) {
++ msleep(10);
++ e1000_gate_hw_phy_config_ich8lan(hw, false);
++ }
++
+ phy->id = e1000_phy_unknown;
+ ret_val = e1000e_get_phy_id(hw);
+ if (ret_val)
+@@ -567,13 +583,10 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_adapter *adapter)
+ if (mac->type == e1000_ich8lan)
+ e1000e_set_kmrn_lock_loss_workaround_ich8lan(hw, true);
+
+- /* Disable PHY configuration by hardware, config by software */
+- if (mac->type == e1000_pch2lan) {
+- u32 extcnf_ctrl = er32(EXTCNF_CTRL);
+-
+- extcnf_ctrl |= E1000_EXTCNF_CTRL_GATE_PHY_CFG;
+- ew32(EXTCNF_CTRL, extcnf_ctrl);
+- }
++ /* Gate automatic PHY configuration by hardware on managed 82579 */
++ if ((mac->type == e1000_pch2lan) &&
++ (er32(FWSM) & E1000_ICH_FWSM_FW_VALID))
++ e1000_gate_hw_phy_config_ich8lan(hw, true);
+
+ return 0;
+ }
+@@ -1621,6 +1634,32 @@ out:
+ }
+
+ /**
++ * e1000_gate_hw_phy_config_ich8lan - disable PHY config via hardware
++ * @hw: pointer to the HW structure
++ * @gate: boolean set to true to gate, false to ungate
++ *
++ * Gate/ungate the automatic PHY configuration via hardware; perform
++ * the configuration via software instead.
++ **/
++static void e1000_gate_hw_phy_config_ich8lan(struct e1000_hw *hw, bool gate)
++{
++ u32 extcnf_ctrl;
++
++ if (hw->mac.type != e1000_pch2lan)
++ return;
++
++ extcnf_ctrl = er32(EXTCNF_CTRL);
++
++ if (gate)
++ extcnf_ctrl |= E1000_EXTCNF_CTRL_GATE_PHY_CFG;
++ else
++ extcnf_ctrl &= ~E1000_EXTCNF_CTRL_GATE_PHY_CFG;
++
++ ew32(EXTCNF_CTRL, extcnf_ctrl);
++ return;
++}
++
++/**
+ * e1000_lan_init_done_ich8lan - Check for PHY config completion
+ * @hw: pointer to the HW structure
+ *
+@@ -1695,6 +1734,13 @@ static s32 e1000_post_phy_reset_ich8lan(struct e1000_hw *hw)
+ /* Configure the LCD with the OEM bits in NVM */
+ ret_val = e1000_oem_bits_config_ich8lan(hw, true);
+
++ /* Ungate automatic PHY configuration on non-managed 82579 */
++ if ((hw->mac.type == e1000_pch2lan) &&
++ !(er32(FWSM) & E1000_ICH_FWSM_FW_VALID)) {
++ msleep(10);
++ e1000_gate_hw_phy_config_ich8lan(hw, false);
++ }
++
+ out:
+ return ret_val;
+ }
+@@ -1711,6 +1757,11 @@ static s32 e1000_phy_hw_reset_ich8lan(struct e1000_hw *hw)
+ {
+ s32 ret_val = 0;
+
++ /* Gate automatic PHY configuration by hardware on non-managed 82579 */
++ if ((hw->mac.type == e1000_pch2lan) &&
++ !(er32(FWSM) & E1000_ICH_FWSM_FW_VALID))
++ e1000_gate_hw_phy_config_ich8lan(hw, true);
++
+ ret_val = e1000e_phy_hw_reset_generic(hw);
+ if (ret_val)
+ goto out;
+@@ -2975,6 +3026,14 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
+ * external PHY is reset.
+ */
+ ctrl |= E1000_CTRL_PHY_RST;
++
++ /*
++ * Gate automatic PHY configuration by hardware on
++ * non-managed 82579
++ */
++ if ((hw->mac.type == e1000_pch2lan) &&
++ !(er32(FWSM) & E1000_ICH_FWSM_FW_VALID))
++ e1000_gate_hw_phy_config_ich8lan(hw, true);
+ }
+ ret_val = e1000_acquire_swflag_ich8lan(hw);
+ e_dbg("Issuing a global reset to ich8lan\n");
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0127-e1000-e1000e-igb-ixgb-ixgbe-set-NETIF_F_HIGHDMA-for-.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0127-e1000-e1000e-igb-ixgb-ixgbe-set-NETIF_F_HIGHDMA-for-.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,43 @@
+From: Yi Zou <yi.zou at intel.com>
+Date: Wed, 22 Sep 2010 17:57:58 +0000
+Subject: [PATCH 127/166] e1000/e1000e/igb/ixgb/ixgbe: set NETIF_F_HIGHDMA for
+ VLAN feature flags
+
+commit 7b872a55c40b7e6f5e257c252f96dde911bd7b2f upstream.
+
+If the netdev->features is set with NETIF_F_HIGHDMA, we should set the
+corresponding netdev->vlan_features as well to allow VLAN netdev created
+on top of the real netdev to be able to also benefit from HIGHDMA on 32bit
+system, reducing the performance hit that is caused by __skb_linearize(),
+particularly for large send. This is fixed in this patch for all Intel e1000,
+e1000e, igb, ixgbe, and ixgbe drivers since this should be beneficial
+to all devices supported by these drivers.
+
+Signed-off-by: Yi Zou <yi.zou at intel.com>
+Tested-by: Emil Tantilov <emil.s.tantilov at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Restricted to drivers/net/e1000e]
+---
+ drivers/net/e1000e/netdev.c | 4 +++-
+ 1 files changed, 3 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index a6136c7..83f93f4 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -5693,8 +5693,10 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
+ netdev->vlan_features |= NETIF_F_HW_CSUM;
+ netdev->vlan_features |= NETIF_F_SG;
+
+- if (pci_using_dac)
++ if (pci_using_dac) {
+ netdev->features |= NETIF_F_HIGHDMA;
++ netdev->vlan_features |= NETIF_F_HIGHDMA;
++ }
+
+ if (e1000e_enable_mng_pass_thru(&adapter->hw))
+ adapter->flags |= FLAG_MNG_PT_ENABLED;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0128-drivers-net-return-operator-cleanup.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0128-drivers-net-return-operator-cleanup.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,56 @@
+From: Eric Dumazet <eric.dumazet at gmail.com>
+Date: Thu, 23 Sep 2010 05:40:09 +0000
+Subject: [PATCH 128/166] drivers/net: return operator cleanup
+
+commit 807540baae406c84dcb9c1c8ef07a56d2d2ae84a upstream.
+
+Change "return (EXPR);" to "return EXPR;"
+
+return is not a function, parentheses are not required.
+
+Signed-off-by: Eric Dumazet <eric.dumazet at gmail.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Restricted to drivers/net/e1000e]
+---
+ drivers/net/e1000e/ethtool.c | 4 ++--
+ drivers/net/e1000e/netdev.c | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
+index 6355a1b..b7f15b3 100644
+--- a/drivers/net/e1000e/ethtool.c
++++ b/drivers/net/e1000e/ethtool.c
+@@ -368,7 +368,7 @@ out:
+ static u32 e1000_get_rx_csum(struct net_device *netdev)
+ {
+ struct e1000_adapter *adapter = netdev_priv(netdev);
+- return (adapter->flags & FLAG_RX_CSUM_ENABLED);
++ return adapter->flags & FLAG_RX_CSUM_ENABLED;
+ }
+
+ static int e1000_set_rx_csum(struct net_device *netdev, u32 data)
+@@ -389,7 +389,7 @@ static int e1000_set_rx_csum(struct net_device *netdev, u32 data)
+
+ static u32 e1000_get_tx_csum(struct net_device *netdev)
+ {
+- return ((netdev->features & NETIF_F_HW_CSUM) != 0);
++ return (netdev->features & NETIF_F_HW_CSUM) != 0;
+ }
+
+ static int e1000_set_tx_csum(struct net_device *netdev, u32 data)
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 83f93f4..f16125f 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -1052,7 +1052,7 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter)
+ adapter->total_tx_packets += total_tx_packets;
+ netdev->stats.tx_bytes += total_tx_bytes;
+ netdev->stats.tx_packets += total_tx_packets;
+- return (count < tx_ring->count);
++ return count < tx_ring->count;
+ }
+
+ /**
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0129-e1000e-use-hardware-writeback-batching.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0129-e1000e-use-hardware-writeback-batching.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,228 @@
+From: Jesse Brandeburg <jesse.brandeburg at intel.com>
+Date: Wed, 29 Sep 2010 21:38:49 +0000
+Subject: [PATCH 129/166] e1000e: use hardware writeback batching
+
+commit 3a3b75860527a11ba5035c6aa576079245d09e2a upstream.
+
+Most e1000e parts support batching writebacks. The problem with this is
+that when some of the TADV or TIDV timers are not set, Tx can sit forever.
+
+This is solved in this patch with write flushes using the Flush Partial
+Descriptors (FPD) bit in TIDV and RDTR.
+
+This improves bus utilization and removes partial writes on e1000e,
+particularly from 82571 parts in S5500 chipset based machines.
+
+Only ES2LAN and 82571/2 parts are included in this optimization, to reduce
+testing load.
+
+Signed-off-by: Jesse Brandeburg <jesse.brandeburg at intel.com>
+Tested-by: Emil Tantilov <emil.s.tantilov at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/82571.c | 6 +++-
+ drivers/net/e1000e/defines.h | 2 +
+ drivers/net/e1000e/e1000.h | 28 ++++++++++++++++++++++
+ drivers/net/e1000e/es2lan.c | 1 +
+ drivers/net/e1000e/netdev.c | 53 ++++++++++++++++++++++++++++++++++++++++++
+ drivers/net/e1000e/param.c | 2 -
+ 6 files changed, 88 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+index d3d4a57..ca663f1 100644
+--- a/drivers/net/e1000e/82571.c
++++ b/drivers/net/e1000e/82571.c
+@@ -1801,7 +1801,8 @@ struct e1000_info e1000_82571_info = {
+ | FLAG_RESET_OVERWRITES_LAA /* errata */
+ | FLAG_TARC_SPEED_MODE_BIT /* errata */
+ | FLAG_APME_CHECK_PORT_B,
+- .flags2 = FLAG2_DISABLE_ASPM_L1, /* errata 13 */
++ .flags2 = FLAG2_DISABLE_ASPM_L1 /* errata 13 */
++ | FLAG2_DMA_BURST,
+ .pba = 38,
+ .max_hw_frame_size = DEFAULT_JUMBO,
+ .get_variants = e1000_get_variants_82571,
+@@ -1819,7 +1820,8 @@ struct e1000_info e1000_82572_info = {
+ | FLAG_RX_CSUM_ENABLED
+ | FLAG_HAS_CTRLEXT_ON_LOAD
+ | FLAG_TARC_SPEED_MODE_BIT, /* errata */
+- .flags2 = FLAG2_DISABLE_ASPM_L1, /* errata 13 */
++ .flags2 = FLAG2_DISABLE_ASPM_L1 /* errata 13 */
++ | FLAG2_DMA_BURST,
+ .pba = 38,
+ .max_hw_frame_size = DEFAULT_JUMBO,
+ .get_variants = e1000_get_variants_82571,
+diff --git a/drivers/net/e1000e/defines.h b/drivers/net/e1000e/defines.h
+index 93b3bed..d3f7a9c 100644
+--- a/drivers/net/e1000e/defines.h
++++ b/drivers/net/e1000e/defines.h
+@@ -446,7 +446,9 @@
+
+ /* Transmit Descriptor Control */
+ #define E1000_TXDCTL_PTHRESH 0x0000003F /* TXDCTL Prefetch Threshold */
++#define E1000_TXDCTL_HTHRESH 0x00003F00 /* TXDCTL Host Threshold */
+ #define E1000_TXDCTL_WTHRESH 0x003F0000 /* TXDCTL Writeback Threshold */
++#define E1000_TXDCTL_GRAN 0x01000000 /* TXDCTL Granularity */
+ #define E1000_TXDCTL_FULL_TX_DESC_WB 0x01010000 /* GRAN=1, WTHRESH=1 */
+ #define E1000_TXDCTL_MAX_TX_DESC_PREFETCH 0x0100001F /* GRAN=1, PTHRESH=31 */
+ /* Enable the counting of desc. still to be processed. */
+diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
+index f9a31c8..5ec0af5 100644
+--- a/drivers/net/e1000e/e1000.h
++++ b/drivers/net/e1000e/e1000.h
+@@ -153,6 +153,33 @@ struct e1000_info;
+ /* Time to wait before putting the device into D3 if there's no link (in ms). */
+ #define LINK_TIMEOUT 100
+
++#define DEFAULT_RDTR 0
++#define DEFAULT_RADV 8
++#define BURST_RDTR 0x20
++#define BURST_RADV 0x20
++
++/*
++ * in the case of WTHRESH, it appears at least the 82571/2 hardware
++ * writes back 4 descriptors when WTHRESH=5, and 3 descriptors when
++ * WTHRESH=4, and since we want 64 bytes at a time written back, set
++ * it to 5
++ */
++#define E1000_TXDCTL_DMA_BURST_ENABLE \
++ (E1000_TXDCTL_GRAN | /* set descriptor granularity */ \
++ E1000_TXDCTL_COUNT_DESC | \
++ (5 << 16) | /* wthresh must be +1 more than desired */\
++ (1 << 8) | /* hthresh */ \
++ 0x1f) /* pthresh */
++
++#define E1000_RXDCTL_DMA_BURST_ENABLE \
++ (0x01000000 | /* set descriptor granularity */ \
++ (4 << 16) | /* set writeback threshold */ \
++ (4 << 8) | /* set prefetch threshold */ \
++ 0x20) /* set hthresh */
++
++#define E1000_TIDV_FPD (1 << 31)
++#define E1000_RDTR_FPD (1 << 31)
++
+ enum e1000_boards {
+ board_82571,
+ board_82572,
+@@ -425,6 +452,7 @@ struct e1000_info {
+ #define FLAG2_DISABLE_ASPM_L1 (1 << 3)
+ #define FLAG2_HAS_PHY_STATS (1 << 4)
+ #define FLAG2_HAS_EEE (1 << 5)
++#define FLAG2_DMA_BURST (1 << 6)
+
+ #define E1000_RX_DESC_PS(R, i) \
+ (&(((union e1000_rx_desc_packet_split *)((R).desc))[i]))
+diff --git a/drivers/net/e1000e/es2lan.c b/drivers/net/e1000e/es2lan.c
+index 45aebb4..24f8ac9 100644
+--- a/drivers/net/e1000e/es2lan.c
++++ b/drivers/net/e1000e/es2lan.c
+@@ -1494,6 +1494,7 @@ struct e1000_info e1000_es2_info = {
+ | FLAG_APME_CHECK_PORT_B
+ | FLAG_DISABLE_FC_PAUSE_TIME /* errata */
+ | FLAG_TIPG_MEDIUM_FOR_80003ESLAN,
++ .flags2 = FLAG2_DMA_BURST,
+ .pba = 38,
+ .max_hw_frame_size = DEFAULT_JUMBO,
+ .get_variants = e1000_get_variants_80003es2lan,
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index f16125f..340ed9c 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -2649,6 +2649,26 @@ static void e1000_configure_tx(struct e1000_adapter *adapter)
+ /* Tx irq moderation */
+ ew32(TADV, adapter->tx_abs_int_delay);
+
++ if (adapter->flags2 & FLAG2_DMA_BURST) {
++ u32 txdctl = er32(TXDCTL(0));
++ txdctl &= ~(E1000_TXDCTL_PTHRESH | E1000_TXDCTL_HTHRESH |
++ E1000_TXDCTL_WTHRESH);
++ /*
++ * set up some performance related parameters to encourage the
++ * hardware to use the bus more efficiently in bursts, depends
++ * on the tx_int_delay to be enabled,
++ * wthresh = 5 ==> burst write a cacheline (64 bytes) at a time
++ * hthresh = 1 ==> prefetch when one or more available
++ * pthresh = 0x1f ==> prefetch if internal cache 31 or less
++ * BEWARE: this seems to work but should be considered first if
++ * there are tx hangs or other tx related bugs
++ */
++ txdctl |= E1000_TXDCTL_DMA_BURST_ENABLE;
++ ew32(TXDCTL(0), txdctl);
++ /* erratum work around: set txdctl the same for both queues */
++ ew32(TXDCTL(1), txdctl);
++ }
++
+ /* Program the Transmit Control Register */
+ tctl = er32(TCTL);
+ tctl &= ~E1000_TCTL_CT;
+@@ -2871,6 +2891,29 @@ static void e1000_configure_rx(struct e1000_adapter *adapter)
+ e1e_flush();
+ msleep(10);
+
++ if (adapter->flags2 & FLAG2_DMA_BURST) {
++ /*
++ * set the writeback threshold (only takes effect if the RDTR
++ * is set). set GRAN=1 and write back up to 0x4 worth, and
++ * enable prefetching of 0x20 rx descriptors
++ * granularity = 01
++ * wthresh = 04,
++ * hthresh = 04,
++ * pthresh = 0x20
++ */
++ ew32(RXDCTL(0), E1000_RXDCTL_DMA_BURST_ENABLE);
++ ew32(RXDCTL(1), E1000_RXDCTL_DMA_BURST_ENABLE);
++
++ /*
++ * override the delay timers for enabling bursting, only if
++ * the value was not set by the user via module options
++ */
++ if (adapter->rx_int_delay == DEFAULT_RDTR)
++ adapter->rx_int_delay = BURST_RDTR;
++ if (adapter->rx_abs_int_delay == DEFAULT_RADV)
++ adapter->rx_abs_int_delay = BURST_RADV;
++ }
++
+ /* set the Receive Delay Timer Register */
+ ew32(RDTR, adapter->rx_int_delay);
+
+@@ -4236,6 +4279,16 @@ link_up:
+ /* Force detection of hung controller every watchdog period */
+ adapter->detect_tx_hung = 1;
+
++ /* flush partial descriptors to memory before detecting tx hang */
++ if (adapter->flags2 & FLAG2_DMA_BURST) {
++ ew32(TIDV, adapter->tx_int_delay | E1000_TIDV_FPD);
++ ew32(RDTR, adapter->rx_int_delay | E1000_RDTR_FPD);
++ /*
++ * no need to flush the writes because the timeout code does
++ * an er32 first thing
++ */
++ }
++
+ /*
+ * With 82571 controllers, LAA may be overwritten due to controller
+ * reset from the other port. Set the appropriate LAA in RAR[0]
+diff --git a/drivers/net/e1000e/param.c b/drivers/net/e1000e/param.c
+index 34aeec1..3d36911 100644
+--- a/drivers/net/e1000e/param.c
++++ b/drivers/net/e1000e/param.c
+@@ -91,7 +91,6 @@ E1000_PARAM(TxAbsIntDelay, "Transmit Absolute Interrupt Delay");
+ * Valid Range: 0-65535
+ */
+ E1000_PARAM(RxIntDelay, "Receive Interrupt Delay");
+-#define DEFAULT_RDTR 0
+ #define MAX_RXDELAY 0xFFFF
+ #define MIN_RXDELAY 0
+
+@@ -101,7 +100,6 @@ E1000_PARAM(RxIntDelay, "Receive Interrupt Delay");
+ * Valid Range: 0-65535
+ */
+ E1000_PARAM(RxAbsIntDelay, "Receive Absolute Interrupt Delay");
+-#define DEFAULT_RADV 8
+ #define MAX_RXABSDELAY 0xFFFF
+ #define MIN_RXABSDELAY 0
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0130-e1000e-Fix-for-offline-diag-test-failure-at-first-ca.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0130-e1000e-Fix-for-offline-diag-test-failure-at-first-ca.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,65 @@
+From: Carolyn Wyborny <carolyn.wyborny at intel.com>
+Date: Fri, 15 Oct 2010 17:35:31 +0000
+Subject: [PATCH 130/166] e1000e: Fix for offline diag test failure at first
+ call
+
+commit c6ce3854f098e1307ecd3bde07903d65fb14a9cb upstream.
+
+Move link test call to later in the offline sequence, move the
+restore settings block to afterwards and add another reset to ensure
+the hardware is in a known state afterwards.
+
+Signed-off-by: Carolyn Wyborny <carolyn.wyborny at intel.com>
+Acked-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Jeff Pieper <jeffrey.e.pieper at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/ethtool.c | 19 ++++++++-----------
+ 1 files changed, 8 insertions(+), 11 deletions(-)
+
+diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
+index b7f15b3..8984d16 100644
+--- a/drivers/net/e1000e/ethtool.c
++++ b/drivers/net/e1000e/ethtool.c
+@@ -1717,13 +1717,6 @@ static void e1000_diag_test(struct net_device *netdev,
+
+ e_info("offline testing starting\n");
+
+- /*
+- * Link test performed before hardware reset so autoneg doesn't
+- * interfere with test result
+- */
+- if (e1000_link_test(adapter, &data[4]))
+- eth_test->flags |= ETH_TEST_FL_FAILED;
+-
+ if (if_running)
+ /* indicate we're in test mode */
+ dev_close(netdev);
+@@ -1747,15 +1740,19 @@ static void e1000_diag_test(struct net_device *netdev,
+ if (e1000_loopback_test(adapter, &data[3]))
+ eth_test->flags |= ETH_TEST_FL_FAILED;
+
++ /* force this routine to wait until autoneg complete/timeout */
++ adapter->hw.phy.autoneg_wait_to_complete = 1;
++ e1000e_reset(adapter);
++ adapter->hw.phy.autoneg_wait_to_complete = 0;
++
++ if (e1000_link_test(adapter, &data[4]))
++ eth_test->flags |= ETH_TEST_FL_FAILED;
++
+ /* restore speed, duplex, autoneg settings */
+ adapter->hw.phy.autoneg_advertised = autoneg_advertised;
+ adapter->hw.mac.forced_speed_duplex = forced_speed_duplex;
+ adapter->hw.mac.autoneg = autoneg;
+-
+- /* force this routine to wait until autoneg complete/timeout */
+- adapter->hw.phy.autoneg_wait_to_complete = 1;
+ e1000e_reset(adapter);
+- adapter->hw.phy.autoneg_wait_to_complete = 0;
+
+ clear_bit(__E1000_TESTING, &adapter->state);
+ if (if_running)
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0131-e1000e-82579-performance-improvements.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0131-e1000e-82579-performance-improvements.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,159 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Wed, 29 Sep 2010 21:39:37 +0000
+Subject: [PATCH 131/166] e1000e: 82579 performance improvements
+
+commit 828bac87bb074f3366621724fdfbe314f98ccc7e upstream.
+
+The initial support for 82579 was tuned poorly for performance. Adjust the
+packet buffer allocation appropriately for both standard and jumbo frames;
+and for jumbo frames increase the receive descriptor pre-fetch, disable
+adaptive interrupt moderation and set the DMA latency tolerance.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Jeff Pieper <jeffrey.e.pieper at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Adjust context for omitted pm_qos changes]
+---
+ drivers/net/e1000e/e1000.h | 1 +
+ drivers/net/e1000e/ich8lan.c | 2 +-
+ drivers/net/e1000e/netdev.c | 50 ++++++++++++++++++++++++++++++++++++-----
+ 3 files changed, 46 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
+index 5ec0af5..cee882d 100644
+--- a/drivers/net/e1000e/e1000.h
++++ b/drivers/net/e1000e/e1000.h
+@@ -453,6 +453,7 @@ struct e1000_info {
+ #define FLAG2_HAS_PHY_STATS (1 << 4)
+ #define FLAG2_HAS_EEE (1 << 5)
+ #define FLAG2_DMA_BURST (1 << 6)
++#define FLAG2_DISABLE_AIM (1 << 8)
+
+ #define E1000_RX_DESC_PS(R, i) \
+ (&(((union e1000_rx_desc_packet_split *)((R).desc))[i]))
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index 57b5435..e3374d9 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -3986,7 +3986,7 @@ struct e1000_info e1000_pch2_info = {
+ | FLAG_APME_IN_WUC,
+ .flags2 = FLAG2_HAS_PHY_STATS
+ | FLAG2_HAS_EEE,
+- .pba = 18,
++ .pba = 26,
+ .max_hw_frame_size = DEFAULT_JUMBO,
+ .get_variants = e1000_get_variants_ich8lan,
+ .mac_ops = &ich8_mac_ops,
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 340ed9c..8f6999c 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -2289,6 +2289,11 @@ static void e1000_set_itr(struct e1000_adapter *adapter)
+ goto set_itr_now;
+ }
+
++ if (adapter->flags2 & FLAG2_DISABLE_AIM) {
++ new_itr = 0;
++ goto set_itr_now;
++ }
++
+ adapter->tx_itr = e1000_update_itr(adapter,
+ adapter->tx_itr,
+ adapter->total_tx_packets,
+@@ -2337,7 +2342,10 @@ set_itr_now:
+ if (adapter->msix_entries)
+ adapter->rx_ring->set_itr = 1;
+ else
+- ew32(ITR, 1000000000 / (new_itr * 256));
++ if (new_itr)
++ ew32(ITR, 1000000000 / (new_itr * 256));
++ else
++ ew32(ITR, 0);
+ }
+ }
+
+@@ -2919,7 +2927,7 @@ static void e1000_configure_rx(struct e1000_adapter *adapter)
+
+ /* irq moderation */
+ ew32(RADV, adapter->rx_abs_int_delay);
+- if (adapter->itr_setting != 0)
++ if ((adapter->itr_setting != 0) && (adapter->itr != 0))
+ ew32(ITR, 1000000000 / (adapter->itr * 256));
+
+ ctrl_ext = er32(CTRL_EXT);
+@@ -2964,11 +2972,13 @@ static void e1000_configure_rx(struct e1000_adapter *adapter)
+ * packet size is equal or larger than the specified value (in 8 byte
+ * units), e.g. using jumbo frames when setting to E1000_ERT_2048
+ */
+- if (adapter->flags & FLAG_HAS_ERT) {
++ if ((adapter->flags & FLAG_HAS_ERT) ||
++ (adapter->hw.mac.type == e1000_pch2lan)) {
+ if (adapter->netdev->mtu > ETH_DATA_LEN) {
+ u32 rxdctl = er32(RXDCTL(0));
+ ew32(RXDCTL(0), rxdctl | 0x3);
+- ew32(ERT, E1000_ERT_2048 | (1 << 13));
++ if (adapter->flags & FLAG_HAS_ERT)
++ ew32(ERT, E1000_ERT_2048 | (1 << 13));
+ /*
+ * With jumbo frames and early-receive enabled,
+ * excessive C-state transition latencies result in
+@@ -3232,9 +3242,35 @@ void e1000e_reset(struct e1000_adapter *adapter)
+ fc->low_water = 0x05048;
+ fc->pause_time = 0x0650;
+ fc->refresh_time = 0x0400;
++ if (adapter->netdev->mtu > ETH_DATA_LEN) {
++ pba = 14;
++ ew32(PBA, pba);
++ }
+ break;
+ }
+
++ /*
++ * Disable Adaptive Interrupt Moderation if 2 full packets cannot
++ * fit in receive buffer and early-receive not supported.
++ */
++ if (adapter->itr_setting & 0x3) {
++ if (((adapter->max_frame_size * 2) > (pba << 10)) &&
++ !(adapter->flags & FLAG_HAS_ERT)) {
++ if (!(adapter->flags2 & FLAG2_DISABLE_AIM)) {
++ dev_info(&adapter->pdev->dev,
++ "Interrupt Throttle Rate turned off\n");
++ adapter->flags2 |= FLAG2_DISABLE_AIM;
++ ew32(ITR, 0);
++ }
++ } else if (adapter->flags2 & FLAG2_DISABLE_AIM) {
++ dev_info(&adapter->pdev->dev,
++ "Interrupt Throttle Rate turned on\n");
++ adapter->flags2 &= ~FLAG2_DISABLE_AIM;
++ adapter->itr = 20000;
++ ew32(ITR, 1000000000 / (adapter->itr * 256));
++ }
++ }
++
+ /* Allow time for pending master requests to run */
+ mac->ops.reset_hw(hw);
+
+@@ -3277,7 +3313,8 @@ int e1000e_up(struct e1000_adapter *adapter)
+ struct e1000_hw *hw = &adapter->hw;
+
+ /* DMA latency requirement to workaround early-receive/jumbo issue */
+- if (adapter->flags & FLAG_HAS_ERT)
++ if ((adapter->flags & FLAG_HAS_ERT) ||
++ (adapter->hw.mac.type == e1000_pch2lan))
+ pm_qos_add_requirement(PM_QOS_CPU_DMA_LATENCY,
+ adapter->netdev->name,
+ PM_QOS_DEFAULT_VALUE);
+@@ -3345,7 +3382,8 @@ void e1000e_down(struct e1000_adapter *adapter)
+ e1000_clean_tx_ring(adapter);
+ e1000_clean_rx_ring(adapter);
+
+- if (adapter->flags & FLAG_HAS_ERT)
++ if ((adapter->flags & FLAG_HAS_ERT) ||
++ (adapter->hw.mac.type == e1000_pch2lan))
+ pm_qos_remove_requirement(PM_QOS_CPU_DMA_LATENCY,
+ adapter->netdev->name);
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0132-e1000e-reset-PHY-after-errors-detected.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0132-e1000e-reset-PHY-after-errors-detected.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,157 @@
+From: Carolyn Wyborny <carolyn.wyborny at intel.com>
+Date: Thu, 28 Oct 2010 00:59:53 +0000
+Subject: [PATCH 132/166] e1000e: reset PHY after errors detected
+
+commit ff10e13cd06f3dbe90e9fffc3c2dd2057a116e4b upstream.
+
+Some errors can be induced in the PHY via environmental testing
+(specifically extreme temperature changes and electro static
+discharge testing), and in the case of the PHY hanging due to
+this input, this detects the problem and resets to continue.
+This issue only applies to 82574 silicon.
+
+Signed-off-by: Jesse Brandeburg <jesse.brandeburg at intel.com>
+Signed-off-by: Carolyn Wyborny <carolyn.wyborny at intel.com>
+Tested-by: Emil Tantilov <emil.s.tantilov at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/82571.c | 38 ++++++++++++++++++++++++++++++++++++++
+ drivers/net/e1000e/e1000.h | 3 +++
+ drivers/net/e1000e/netdev.c | 22 ++++++++++++++++++++++
+ 3 files changed, 63 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+index ca663f1..7236f1a 100644
+--- a/drivers/net/e1000e/82571.c
++++ b/drivers/net/e1000e/82571.c
+@@ -52,6 +52,10 @@
+ (ID_LED_DEF1_DEF2))
+
+ #define E1000_GCR_L1_ACT_WITHOUT_L0S_RX 0x08000000
++#define E1000_BASE1000T_STATUS 10
++#define E1000_IDLE_ERROR_COUNT_MASK 0xFF
++#define E1000_RECEIVE_ERROR_COUNTER 21
++#define E1000_RECEIVE_ERROR_MAX 0xFFFF
+
+ #define E1000_NVM_INIT_CTRL2_MNGM 0x6000 /* Manageability Operation Mode mask */
+
+@@ -1243,6 +1247,39 @@ static s32 e1000_led_on_82574(struct e1000_hw *hw)
+ }
+
+ /**
++ * e1000_check_phy_82574 - check 82574 phy hung state
++ * @hw: pointer to the HW structure
++ *
++ * Returns whether phy is hung or not
++ **/
++bool e1000_check_phy_82574(struct e1000_hw *hw)
++{
++ u16 status_1kbt = 0;
++ u16 receive_errors = 0;
++ bool phy_hung = false;
++ s32 ret_val = 0;
++
++ /*
++ * Read PHY Receive Error counter first, if its is max - all F's then
++ * read the Base1000T status register If both are max then PHY is hung.
++ */
++ ret_val = e1e_rphy(hw, E1000_RECEIVE_ERROR_COUNTER, &receive_errors);
++
++ if (ret_val)
++ goto out;
++ if (receive_errors == E1000_RECEIVE_ERROR_MAX) {
++ ret_val = e1e_rphy(hw, E1000_BASE1000T_STATUS, &status_1kbt);
++ if (ret_val)
++ goto out;
++ if ((status_1kbt & E1000_IDLE_ERROR_COUNT_MASK) ==
++ E1000_IDLE_ERROR_COUNT_MASK)
++ phy_hung = true;
++ }
++out:
++ return phy_hung;
++}
++
++/**
+ * e1000_setup_link_82571 - Setup flow control and link settings
+ * @hw: pointer to the HW structure
+ *
+@@ -1859,6 +1896,7 @@ struct e1000_info e1000_82574_info = {
+ | FLAG_HAS_SMART_POWER_DOWN
+ | FLAG_HAS_AMT
+ | FLAG_HAS_CTRLEXT_ON_LOAD,
++ .flags2 = FLAG2_CHECK_PHY_HANG,
+ .pba = 36,
+ .max_hw_frame_size = DEFAULT_JUMBO,
+ .get_variants = e1000_get_variants_82571,
+diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
+index cee882d..fdc67fe 100644
+--- a/drivers/net/e1000e/e1000.h
++++ b/drivers/net/e1000e/e1000.h
+@@ -397,6 +397,7 @@ struct e1000_adapter {
+ struct work_struct print_hang_task;
+
+ bool idle_check;
++ int phy_hang_count;
+ };
+
+ struct e1000_info {
+@@ -454,6 +455,7 @@ struct e1000_info {
+ #define FLAG2_HAS_EEE (1 << 5)
+ #define FLAG2_DMA_BURST (1 << 6)
+ #define FLAG2_DISABLE_AIM (1 << 8)
++#define FLAG2_CHECK_PHY_HANG (1 << 9)
+
+ #define E1000_RX_DESC_PS(R, i) \
+ (&(((union e1000_rx_desc_packet_split *)((R).desc))[i]))
+@@ -631,6 +633,7 @@ extern s32 e1000_get_phy_info_ife(struct e1000_hw *hw);
+ extern s32 e1000_check_polarity_ife(struct e1000_hw *hw);
+ extern s32 e1000_phy_force_speed_duplex_ife(struct e1000_hw *hw);
+ extern s32 e1000_check_polarity_igp(struct e1000_hw *hw);
++extern bool e1000_check_phy_82574(struct e1000_hw *hw);
+
+ static inline s32 e1000_phy_hw_reset(struct e1000_hw *hw)
+ {
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 8f6999c..0a97ece 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -4099,6 +4099,25 @@ static void e1000e_enable_receives(struct e1000_adapter *adapter)
+ }
+ }
+
++static void e1000e_check_82574_phy_workaround(struct e1000_adapter *adapter)
++{
++ struct e1000_hw *hw = &adapter->hw;
++
++ /*
++ * With 82574 controllers, PHY needs to be checked periodically
++ * for hung state and reset, if two calls return true
++ */
++ if (e1000_check_phy_82574(hw))
++ adapter->phy_hang_count++;
++ else
++ adapter->phy_hang_count = 0;
++
++ if (adapter->phy_hang_count > 1) {
++ adapter->phy_hang_count = 0;
++ schedule_work(&adapter->reset_task);
++ }
++}
++
+ /**
+ * e1000_watchdog - Timer Call-back
+ * @data: pointer to adapter cast into an unsigned long
+@@ -4334,6 +4353,9 @@ link_up:
+ if (e1000e_get_laa_state_82571(hw))
+ e1000e_rar_set(hw, adapter->hw.mac.addr, 0);
+
++ if (adapter->flags2 & FLAG2_CHECK_PHY_HANG)
++ e1000e_check_82574_phy_workaround(adapter);
++
+ /* Reset the timer */
+ if (!test_bit(__E1000_DOWN, &adapter->state))
+ mod_timer(&adapter->watchdog_timer,
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0133-e1000e-Add-check-for-reset-flags-before-displaying-r.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0133-e1000e-Add-check-for-reset-flags-before-displaying-r.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,42 @@
+From: Carolyn Wyborny <carolyn.wyborny at intel.com>
+Date: Thu, 28 Oct 2010 00:59:55 +0000
+Subject: [PATCH 133/166] e1000e: Add check for reset flags before displaying
+ reset message
+
+commit affa9dfb04b7e2e3a0b0e6d844ea0c9ed97505f9 upstream.
+
+Some parts need to execute resets during normal operation. This flag
+check ensures that those parts reset without needlessly alarming the
+user. Other unexpected resets by other parts will dump debug info
+and message the reset action to the user, as originally intended.
+
+Signed-off-by: Carolyn Wyborny <carolyn.wyborny at intel.com>
+Acked-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Emil Tantilov <emil.s.tantilov at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/netdev.c | 7 +++++--
+ 1 files changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 0a97ece..694d096 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -4883,8 +4883,11 @@ static void e1000_reset_task(struct work_struct *work)
+ struct e1000_adapter *adapter;
+ adapter = container_of(work, struct e1000_adapter, reset_task);
+
+- e1000e_dump(adapter);
+- e_err("Reset adapter\n");
++ if (!((adapter->flags & FLAG_RX_NEEDS_RESTART) &&
++ (adapter->flags & FLAG_RX_RESTART_NOW))) {
++ e1000e_dump(adapter);
++ e_err("Reset adapter\n");
++ }
+ e1000e_reinit_locked(adapter);
+ }
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0134-tree-wide-fix-comment-printk-typos.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0134-tree-wide-fix-comment-printk-typos.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,65 @@
+From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig at pengutronix.de>
+Date: Mon, 1 Nov 2010 15:38:34 -0400
+Subject: [PATCH 134/166] tree-wide: fix comment/printk typos
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+commit b595076a180a56d1bb170e6eceda6eb9d76f4cd3 upstream.
+
+"gadget", "through", "command", "maintain", "maintain", "controller", "address",
+"between", "initiali[zs]e", "instead", "function", "select", "already",
+"equal", "access", "management", "hierarchy", "registration", "interest",
+"relative", "memory", "offset", "already",
+
+Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
+Signed-off-by: Jiri Kosina <jkosina at suse.cz>
+[bwh: Restricted to drivers/net/e1000e]
+---
+ drivers/net/e1000e/82571.c | 2 +-
+ drivers/net/e1000e/ich8lan.c | 2 +-
+ drivers/net/e1000e/phy.c | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+index 7236f1a..a655beb 100644
+--- a/drivers/net/e1000e/82571.c
++++ b/drivers/net/e1000e/82571.c
+@@ -300,7 +300,7 @@ static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter)
+
+ /*
+ * Ensure that the inter-port SWSM.SMBI lock bit is clear before
+- * first NVM or PHY acess. This should be done for single-port
++ * first NVM or PHY access. This should be done for single-port
+ * devices, and for one port only on dual-port devices so that
+ * for those devices we can still use the SMBI lock to synchronize
+ * inter-port accesses to the PHY & NVM.
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index e3374d9..38c84ba 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -321,7 +321,7 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw)
+ }
+
+ /*
+- * Reset the PHY before any acccess to it. Doing so, ensures that
++ * Reset the PHY before any access to it. Doing so, ensures that
+ * the PHY is in a known good state before we read/write PHY registers.
+ * The generic reset is sufficient here, because we haven't determined
+ * the PHY type yet.
+diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c
+index 3d3dc0c..b9bff5b 100644
+--- a/drivers/net/e1000e/phy.c
++++ b/drivers/net/e1000e/phy.c
+@@ -2976,7 +2976,7 @@ s32 e1000_write_phy_reg_hv_locked(struct e1000_hw *hw, u32 offset, u16 data)
+ }
+
+ /**
+- * e1000_get_phy_addr_for_hv_page - Get PHY adrress based on page
++ * e1000_get_phy_addr_for_hv_page - Get PHY address based on page
+ * @page: page to be accessed
+ **/
+ static u32 e1000_get_phy_addr_for_hv_page(u32 page)
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0135-drivers-net-e1000e-Remove-unnecessary-semicolons.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0135-drivers-net-e1000e-Remove-unnecessary-semicolons.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,28 @@
+From: Joe Perches <joe at perches.com>
+Date: Sun, 14 Nov 2010 17:04:32 +0000
+Subject: [PATCH 135/166] drivers/net/e1000e: Remove unnecessary semicolons
+
+commit 1d51c4185bb369cb39ed8cc20b331508e47b35b2 upstream.
+
+Signed-off-by: Joe Perches <joe at perches.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/netdev.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 694d096..94e22a1 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -4596,7 +4596,7 @@ dma_error:
+ i += tx_ring->count;
+ i--;
+ buffer_info = &tx_ring->buffer_info[i];
+- e1000_put_txbuf(adapter, buffer_info);;
++ e1000_put_txbuf(adapter, buffer_info);
+ }
+
+ return 0;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0136-e1000e-82571-SerDes-link-handle-null-code-word-from-.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0136-e1000e-82571-SerDes-link-handle-null-code-word-from-.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,52 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Tue, 16 Nov 2010 19:50:13 -0800
+Subject: [PATCH 136/166] e1000e: 82571 SerDes link handle null code word from
+ partner
+
+commit d478eb44f7a6b53256ae399fa7e597525b4034ee upstream.
+
+SerDes Link detection on certain 82571 mezzanine cards can fail when the
+link is forced, the link partner does not recognize forced link and the
+link partner sends null code words. Detect the null code words and return
+to auto-negotiation state which causes the link partner to begin responding
+with valid code words. Within a reasonable interval the link will finally
+settle as forced by both partners.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+---
+ drivers/net/e1000e/82571.c | 4 +++-
+ drivers/net/e1000e/defines.h | 1 +
+ 2 files changed, 4 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+index a655beb..fa16e10 100644
+--- a/drivers/net/e1000e/82571.c
++++ b/drivers/net/e1000e/82571.c
+@@ -1431,8 +1431,10 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw)
+ * auto-negotiation in the TXCW register and disable
+ * forced link in the Device Control register in an
+ * attempt to auto-negotiate with our link partner.
++ * If the partner code word is null, stop forcing
++ * and restart auto negotiation.
+ */
+- if (rxcw & E1000_RXCW_C) {
++ if ((rxcw & E1000_RXCW_C) || !(rxcw & E1000_RXCW_CW)) {
+ /* Enable autoneg, and unforce link up */
+ ew32(TXCW, mac->txcw);
+ ew32(CTRL, (ctrl & ~E1000_CTRL_SLU));
+diff --git a/drivers/net/e1000e/defines.h b/drivers/net/e1000e/defines.h
+index d3f7a9c..016ea38 100644
+--- a/drivers/net/e1000e/defines.h
++++ b/drivers/net/e1000e/defines.h
+@@ -516,6 +516,7 @@
+ #define E1000_TXCW_ANE 0x80000000 /* Auto-neg enable */
+
+ /* Receive Configuration Word */
++#define E1000_RXCW_CW 0x0000ffff /* RxConfigWord mask */
+ #define E1000_RXCW_IV 0x08000000 /* Receive config invalid */
+ #define E1000_RXCW_C 0x20000000 /* Receive config */
+ #define E1000_RXCW_SYNCH 0x40000000 /* Receive config synch */
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0137-e1000e-82574-intermittently-fails-to-initialize-with.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0137-e1000e-82574-intermittently-fails-to-initialize-with.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,230 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Tue, 16 Nov 2010 19:50:14 -0800
+Subject: [PATCH 137/166] e1000e: 82574 intermittently fails to initialize
+ with manageability f/w
+
+commit 1b98c2bb63a4b415d8d894d001b6d0256409e0d9 upstream.
+
+The driver can fail initializing the hardware when manageability firmware
+is performing concurrent MDIO operations because the hardware semaphore
+scheme to prevent concurrent operations between software and firmware is
+incorrect for 82574/82583. Instead of using the SWSM register, the driver
+should be using the EXTCNF_CTRL register. A software mutex is also added
+to prevent simultaneous software threads from performing similar concurrent
+accesses.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Emil Tantilov <emil.s.tantilov at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+---
+ drivers/net/e1000e/82571.c | 139 ++++++++++++++++++++++++++++++++++++++------
+ 1 files changed, 120 insertions(+), 19 deletions(-)
+
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+index fa16e10..3f77469 100644
+--- a/drivers/net/e1000e/82571.c
++++ b/drivers/net/e1000e/82571.c
+@@ -74,6 +74,9 @@ static bool e1000_check_mng_mode_82574(struct e1000_hw *hw);
+ static s32 e1000_led_on_82574(struct e1000_hw *hw);
+ static void e1000_put_hw_semaphore_82571(struct e1000_hw *hw);
+ static void e1000_power_down_phy_copper_82571(struct e1000_hw *hw);
++static void e1000_put_hw_semaphore_82573(struct e1000_hw *hw);
++static s32 e1000_get_hw_semaphore_82574(struct e1000_hw *hw);
++static void e1000_put_hw_semaphore_82574(struct e1000_hw *hw);
+
+ /**
+ * e1000_init_phy_params_82571 - Init PHY func ptrs.
+@@ -107,6 +110,8 @@ static s32 e1000_init_phy_params_82571(struct e1000_hw *hw)
+ case e1000_82574:
+ case e1000_82583:
+ phy->type = e1000_phy_bm;
++ phy->ops.acquire = e1000_get_hw_semaphore_82574;
++ phy->ops.release = e1000_put_hw_semaphore_82574;
+ break;
+ default:
+ return -E1000_ERR_PHY;
+@@ -200,6 +205,17 @@ static s32 e1000_init_nvm_params_82571(struct e1000_hw *hw)
+ break;
+ }
+
++ /* Function Pointers */
++ switch (hw->mac.type) {
++ case e1000_82574:
++ case e1000_82583:
++ nvm->ops.acquire = e1000_get_hw_semaphore_82574;
++ nvm->ops.release = e1000_put_hw_semaphore_82574;
++ break;
++ default:
++ break;
++ }
++
+ return 0;
+ }
+
+@@ -542,6 +558,94 @@ static void e1000_put_hw_semaphore_82571(struct e1000_hw *hw)
+ swsm &= ~(E1000_SWSM_SMBI | E1000_SWSM_SWESMBI);
+ ew32(SWSM, swsm);
+ }
++/**
++ * e1000_get_hw_semaphore_82573 - Acquire hardware semaphore
++ * @hw: pointer to the HW structure
++ *
++ * Acquire the HW semaphore during reset.
++ *
++ **/
++static s32 e1000_get_hw_semaphore_82573(struct e1000_hw *hw)
++{
++ u32 extcnf_ctrl;
++ s32 ret_val = 0;
++ s32 i = 0;
++
++ extcnf_ctrl = er32(EXTCNF_CTRL);
++ extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP;
++ do {
++ ew32(EXTCNF_CTRL, extcnf_ctrl);
++ extcnf_ctrl = er32(EXTCNF_CTRL);
++
++ if (extcnf_ctrl & E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP)
++ break;
++
++ extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP;
++
++ msleep(2);
++ i++;
++ } while (i < MDIO_OWNERSHIP_TIMEOUT);
++
++ if (i == MDIO_OWNERSHIP_TIMEOUT) {
++ /* Release semaphores */
++ e1000_put_hw_semaphore_82573(hw);
++ e_dbg("Driver can't access the PHY\n");
++ ret_val = -E1000_ERR_PHY;
++ goto out;
++ }
++
++out:
++ return ret_val;
++}
++
++/**
++ * e1000_put_hw_semaphore_82573 - Release hardware semaphore
++ * @hw: pointer to the HW structure
++ *
++ * Release hardware semaphore used during reset.
++ *
++ **/
++static void e1000_put_hw_semaphore_82573(struct e1000_hw *hw)
++{
++ u32 extcnf_ctrl;
++
++ extcnf_ctrl = er32(EXTCNF_CTRL);
++ extcnf_ctrl &= ~E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP;
++ ew32(EXTCNF_CTRL, extcnf_ctrl);
++}
++
++static DEFINE_MUTEX(swflag_mutex);
++
++/**
++ * e1000_get_hw_semaphore_82574 - Acquire hardware semaphore
++ * @hw: pointer to the HW structure
++ *
++ * Acquire the HW semaphore to access the PHY or NVM.
++ *
++ **/
++static s32 e1000_get_hw_semaphore_82574(struct e1000_hw *hw)
++{
++ s32 ret_val;
++
++ mutex_lock(&swflag_mutex);
++ ret_val = e1000_get_hw_semaphore_82573(hw);
++ if (ret_val)
++ mutex_unlock(&swflag_mutex);
++ return ret_val;
++}
++
++/**
++ * e1000_put_hw_semaphore_82574 - Release hardware semaphore
++ * @hw: pointer to the HW structure
++ *
++ * Release hardware semaphore used to access the PHY or NVM
++ *
++ **/
++static void e1000_put_hw_semaphore_82574(struct e1000_hw *hw)
++{
++ e1000_put_hw_semaphore_82573(hw);
++ mutex_unlock(&swflag_mutex);
++}
+
+ /**
+ * e1000_acquire_nvm_82571 - Request for access to the EEPROM
+@@ -562,8 +666,6 @@ static s32 e1000_acquire_nvm_82571(struct e1000_hw *hw)
+
+ switch (hw->mac.type) {
+ case e1000_82573:
+- case e1000_82574:
+- case e1000_82583:
+ break;
+ default:
+ ret_val = e1000e_acquire_nvm(hw);
+@@ -853,9 +955,8 @@ static s32 e1000_set_d0_lplu_state_82571(struct e1000_hw *hw, bool active)
+ **/
+ static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
+ {
+- u32 ctrl, extcnf_ctrl, ctrl_ext, icr;
++ u32 ctrl, ctrl_ext, icr;
+ s32 ret_val;
+- u16 i = 0;
+
+ /*
+ * Prevent the PCI-E bus from sticking if there is no TLP connection
+@@ -880,33 +981,33 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
+ */
+ switch (hw->mac.type) {
+ case e1000_82573:
++ ret_val = e1000_get_hw_semaphore_82573(hw);
++ break;
+ case e1000_82574:
+ case e1000_82583:
+- extcnf_ctrl = er32(EXTCNF_CTRL);
+- extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP;
+-
+- do {
+- ew32(EXTCNF_CTRL, extcnf_ctrl);
+- extcnf_ctrl = er32(EXTCNF_CTRL);
+-
+- if (extcnf_ctrl & E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP)
+- break;
+-
+- extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP;
+-
+- msleep(2);
+- i++;
+- } while (i < MDIO_OWNERSHIP_TIMEOUT);
++ ret_val = e1000_get_hw_semaphore_82574(hw);
+ break;
+ default:
+ break;
+ }
++ if (ret_val)
++ e_dbg("Cannot acquire MDIO ownership\n");
+
+ ctrl = er32(CTRL);
+
+ e_dbg("Issuing a global reset to MAC\n");
+ ew32(CTRL, ctrl | E1000_CTRL_RST);
+
++ /* Must release MDIO ownership and mutex after MAC reset. */
++ switch (hw->mac.type) {
++ case e1000_82574:
++ case e1000_82583:
++ e1000_put_hw_semaphore_82574(hw);
++ break;
++ default:
++ break;
++ }
++
+ if (hw->nvm.type == e1000_nvm_flash_hw) {
+ udelay(10);
+ ctrl_ext = er32(CTRL_EXT);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0138-e1000e-add-netpoll-support-for-MSI-MSI-X-IRQ-modes.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0138-e1000e-add-netpoll-support-for-MSI-MSI-X-IRQ-modes.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,88 @@
+From: Dongdong Deng <dongdong.deng at windriver.com>
+Date: Tue, 16 Nov 2010 19:50:15 -0800
+Subject: [PATCH 138/166] e1000e: add netpoll support for MSI/MSI-X IRQ modes
+
+commit 147b2c8cb4f3e16aafc87096365a913d01ee3a21 upstream.
+
+With enabling CONFIG_PCI_MSI, e1000e could work in MSI/MSI-X IRQ mode,
+and netpoll controller didn't deal with those IRQ modes on e1000e.
+
+This patch add the handling MSI/MSI-X IRQ modes to netpoll controller,
+so that netconsole could work with those IRQ modes.
+
+Signed-off-by: Dongdong Deng <dongdong.deng at windriver.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+---
+ drivers/net/e1000e/netdev.c | 49 +++++++++++++++++++++++++++++++++++++++---
+ 1 files changed, 45 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 94e22a1..17823a5 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -5466,6 +5466,36 @@ static void e1000_shutdown(struct pci_dev *pdev)
+ }
+
+ #ifdef CONFIG_NET_POLL_CONTROLLER
++
++static irqreturn_t e1000_intr_msix(int irq, void *data)
++{
++ struct net_device *netdev = data;
++ struct e1000_adapter *adapter = netdev_priv(netdev);
++ int vector, msix_irq;
++
++ if (adapter->msix_entries) {
++ vector = 0;
++ msix_irq = adapter->msix_entries[vector].vector;
++ disable_irq(msix_irq);
++ e1000_intr_msix_rx(msix_irq, netdev);
++ enable_irq(msix_irq);
++
++ vector++;
++ msix_irq = adapter->msix_entries[vector].vector;
++ disable_irq(msix_irq);
++ e1000_intr_msix_tx(msix_irq, netdev);
++ enable_irq(msix_irq);
++
++ vector++;
++ msix_irq = adapter->msix_entries[vector].vector;
++ disable_irq(msix_irq);
++ e1000_msix_other(msix_irq, netdev);
++ enable_irq(msix_irq);
++ }
++
++ return IRQ_HANDLED;
++}
++
+ /*
+ * Polling 'interrupt' - used by things like netconsole to send skbs
+ * without having to re-enable interrupts. It's not called while
+@@ -5475,10 +5505,21 @@ static void e1000_netpoll(struct net_device *netdev)
+ {
+ struct e1000_adapter *adapter = netdev_priv(netdev);
+
+- disable_irq(adapter->pdev->irq);
+- e1000_intr(adapter->pdev->irq, netdev);
+-
+- enable_irq(adapter->pdev->irq);
++ switch (adapter->int_mode) {
++ case E1000E_INT_MODE_MSIX:
++ e1000_intr_msix(adapter->pdev->irq, netdev);
++ break;
++ case E1000E_INT_MODE_MSI:
++ disable_irq(adapter->pdev->irq);
++ e1000_intr_msi(adapter->pdev->irq, netdev);
++ enable_irq(adapter->pdev->irq);
++ break;
++ default: /* E1000E_INT_MODE_LEGACY */
++ disable_irq(adapter->pdev->irq);
++ e1000_intr(adapter->pdev->irq, netdev);
++ enable_irq(adapter->pdev->irq);
++ break;
++ }
+ }
+ #endif
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0139-Intel-Wired-LAN-drivers-Use-static-const.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0139-Intel-Wired-LAN-drivers-Use-static-const.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,43 @@
+From: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Date: Wed, 1 Dec 2010 19:59:50 +0000
+Subject: [PATCH 139/166] Intel Wired LAN drivers: Use static const
+
+commit 667445008db3f45a760c235d771be0c9671e59e5 upstream.
+
+Based on work by Joe Perches <joe at perches.com>
+
+Using static const to decrease data and overall object size.
+
+CC: Joe Perches <joe at perches.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Tested-by: Emil Tantilov <emil.s.tantilov at intel.com>
+[bwh: Restricted to drivers/net/e1000e]
+---
+ drivers/net/e1000e/phy.c | 11 ++++++-----
+ 1 files changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c
+index b9bff5b..92fcd9e 100644
+--- a/drivers/net/e1000e/phy.c
++++ b/drivers/net/e1000e/phy.c
+@@ -1840,11 +1840,12 @@ s32 e1000e_get_cable_length_igp_2(struct e1000_hw *hw)
+ u16 phy_data, i, agc_value = 0;
+ u16 cur_agc_index, max_agc_index = 0;
+ u16 min_agc_index = IGP02E1000_CABLE_LENGTH_TABLE_SIZE - 1;
+- u16 agc_reg_array[IGP02E1000_PHY_CHANNEL_NUM] =
+- {IGP02E1000_PHY_AGC_A,
+- IGP02E1000_PHY_AGC_B,
+- IGP02E1000_PHY_AGC_C,
+- IGP02E1000_PHY_AGC_D};
++ static const u16 agc_reg_array[IGP02E1000_PHY_CHANNEL_NUM] = {
++ IGP02E1000_PHY_AGC_A,
++ IGP02E1000_PHY_AGC_B,
++ IGP02E1000_PHY_AGC_C,
++ IGP02E1000_PHY_AGC_D
++ };
+
+ /* Read the AGC registers for all channels */
+ for (i = 0; i < IGP02E1000_PHY_CHANNEL_NUM; i++) {
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0140-e1000e-fix-double-initialization-in-blink-path.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0140-e1000e-fix-double-initialization-in-blink-path.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,72 @@
+From: Holger Eitzenberger <holger at eitzenberger.org>
+Date: Wed, 17 Nov 2010 15:43:52 +0000
+Subject: [PATCH 140/166] e1000e: fix double initialization in blink path
+
+commit 9633e63bb1d82c02950983d5d3317e6656b11c8e upstream.
+
+The kernel goes BUG() at the time 'ethtool -p eth0 3' comes
+back, which is due to adapter->led_blink_task initialized
+several times. At the time it is still running this results
+in a corrupted task_list of the associated workqueue.
+
+The fix is to move the workqueue initialization to the
+probe function instead.
+
+Signed-off-by: Holger Eitzenberger <holger at eitzenberger.org>
+Reviewed-by: Jesse Brandeburg <jesse.brandeburg at intel.com>
+Tested-by: Emil Tantilov <emil.s.tantilov at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+---
+ drivers/net/e1000e/e1000.h | 1 +
+ drivers/net/e1000e/ethtool.c | 3 +--
+ drivers/net/e1000e/netdev.c | 1 +
+ 3 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
+index fdc67fe..3d9366f 100644
+--- a/drivers/net/e1000e/e1000.h
++++ b/drivers/net/e1000e/e1000.h
+@@ -482,6 +482,7 @@ extern const char e1000e_driver_version[];
+
+ extern void e1000e_check_options(struct e1000_adapter *adapter);
+ extern void e1000e_set_ethtool_ops(struct net_device *netdev);
++extern void e1000e_led_blink_task(struct work_struct *work);
+
+ extern int e1000e_up(struct e1000_adapter *adapter);
+ extern void e1000e_down(struct e1000_adapter *adapter);
+diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
+index 8984d16..26d4f3b 100644
+--- a/drivers/net/e1000e/ethtool.c
++++ b/drivers/net/e1000e/ethtool.c
+@@ -1860,7 +1860,7 @@ static int e1000_set_wol(struct net_device *netdev,
+ /* bit defines for adapter->led_status */
+ #define E1000_LED_ON 0
+
+-static void e1000e_led_blink_task(struct work_struct *work)
++void e1000e_led_blink_task(struct work_struct *work)
+ {
+ struct e1000_adapter *adapter = container_of(work,
+ struct e1000_adapter, led_blink_task);
+@@ -1892,7 +1892,6 @@ static int e1000_phys_id(struct net_device *netdev, u32 data)
+ (hw->mac.type == e1000_pch2lan) ||
+ (hw->mac.type == e1000_82583) ||
+ (hw->mac.type == e1000_82574)) {
+- INIT_WORK(&adapter->led_blink_task, e1000e_led_blink_task);
+ if (!adapter->blink_timer.function) {
+ init_timer(&adapter->blink_timer);
+ adapter->blink_timer.function =
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 17823a5..febb684 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -5906,6 +5906,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
+ INIT_WORK(&adapter->downshift_task, e1000e_downshift_workaround);
+ INIT_WORK(&adapter->update_phy_task, e1000e_update_phy_task);
+ INIT_WORK(&adapter->print_hang_task, e1000_print_hw_hang);
++ INIT_WORK(&adapter->led_blink_task, e1000e_led_blink_task);
+
+ /* Initialize link parameters. User can change them with ethtool */
+ adapter->hw.mac.autoneg = 1;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0141-e1000e-82571-based-mezzanine-card-can-fail-ethtool-l.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0141-e1000e-82571-based-mezzanine-card-can-fail-ethtool-l.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,53 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Wed, 24 Nov 2010 06:01:20 +0000
+Subject: [PATCH 141/166] e1000e: 82571-based mezzanine card can fail ethtool
+ link test
+
+commit a82a14f4cdcfedb27eacec8eb4d9e47d42c10d43 upstream.
+
+On certain 82571-based mezzanine NICs in some blade servers, the ethtool
+link test can fail due to the serdes_has_link flag not set correctly.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Emil Tantilov <emil.s.tantilov at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+---
+ drivers/net/e1000e/82571.c | 7 ++++++-
+ 1 files changed, 6 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+index 3f77469..301a36e 100644
+--- a/drivers/net/e1000e/82571.c
++++ b/drivers/net/e1000e/82571.c
+@@ -1523,8 +1523,10 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw)
+ e1000_serdes_link_autoneg_progress;
+ mac->serdes_has_link = false;
+ e_dbg("AN_UP -> AN_PROG\n");
++ } else {
++ mac->serdes_has_link = true;
+ }
+- break;
++ break;
+
+ case e1000_serdes_link_forced_up:
+ /*
+@@ -1543,6 +1545,8 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw)
+ e1000_serdes_link_autoneg_progress;
+ mac->serdes_has_link = false;
+ e_dbg("FORCED_UP -> AN_PROG\n");
++ } else {
++ mac->serdes_has_link = true;
+ }
+ break;
+
+@@ -1598,6 +1602,7 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw)
+ ew32(CTRL, (ctrl & ~E1000_CTRL_SLU));
+ mac->serdes_link_state =
+ e1000_serdes_link_autoneg_progress;
++ mac->serdes_has_link = false;
+ e_dbg("DOWN -> AN_PROG\n");
+ break;
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0142-e1000e-82574-82583-performance-improvement.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0142-e1000e-82574-82583-performance-improvement.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,41 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Wed, 24 Nov 2010 06:01:25 +0000
+Subject: [PATCH 142/166] e1000e: 82574/82583 performance improvement
+
+commit ed5c2b0b78e5467f7948bef92b21f3c76823f392 upstream.
+
+Increasing the transmit fifo by 4K (by decreasing the receive fifo size
+specified in .pba by the same amount) increases Tx performance.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Emil Tantilov <emil.s.tantilov at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+---
+ drivers/net/e1000e/82571.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+index 301a36e..b44789a 100644
+--- a/drivers/net/e1000e/82571.c
++++ b/drivers/net/e1000e/82571.c
+@@ -2005,7 +2005,7 @@ struct e1000_info e1000_82574_info = {
+ | FLAG_HAS_AMT
+ | FLAG_HAS_CTRLEXT_ON_LOAD,
+ .flags2 = FLAG2_CHECK_PHY_HANG,
+- .pba = 36,
++ .pba = 32,
+ .max_hw_frame_size = DEFAULT_JUMBO,
+ .get_variants = e1000_get_variants_82571,
+ .mac_ops = &e82571_mac_ops,
+@@ -2022,7 +2022,7 @@ struct e1000_info e1000_82583_info = {
+ | FLAG_HAS_SMART_POWER_DOWN
+ | FLAG_HAS_AMT
+ | FLAG_HAS_CTRLEXT_ON_LOAD,
+- .pba = 36,
++ .pba = 32,
+ .max_hw_frame_size = ETH_FRAME_LEN + ETH_FCS_LEN,
+ .get_variants = e1000_get_variants_82571,
+ .mac_ops = &e82571_mac_ops,
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0143-e1000e-82577-8-must-acquire-h-w-semaphore-before-wor.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0143-e1000e-82577-8-must-acquire-h-w-semaphore-before-wor.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,47 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Wed, 24 Nov 2010 06:01:30 +0000
+Subject: [PATCH 143/166] e1000e: 82577/8 must acquire h/w semaphore before
+ workaround
+
+commit cbd006cb7d4e7b76c6febf7f51e970bced132914 upstream.
+
+The workaround function e1000_configure_k1_pchlan() assumes the h/w
+semaphore is already acquired. This was originally missed when setting up
+the part for the ethtool loopback test.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Jeff Pieper <jeffrey.e.pieper at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+---
+ drivers/net/e1000e/ethtool.c | 7 +++++++
+ 1 files changed, 7 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
+index 26d4f3b..29b09113 100644
+--- a/drivers/net/e1000e/ethtool.c
++++ b/drivers/net/e1000e/ethtool.c
+@@ -1263,6 +1263,7 @@ static int e1000_integrated_phy_loopback(struct e1000_adapter *adapter)
+ u32 ctrl_reg = 0;
+ u32 stat_reg = 0;
+ u16 phy_reg = 0;
++ s32 ret_val = 0;
+
+ hw->mac.autoneg = 0;
+
+@@ -1322,7 +1323,13 @@ static int e1000_integrated_phy_loopback(struct e1000_adapter *adapter)
+ case e1000_phy_82577:
+ case e1000_phy_82578:
+ /* Workaround: K1 must be disabled for stable 1Gbps operation */
++ ret_val = hw->phy.ops.acquire(hw);
++ if (ret_val) {
++ e_err("Cannot setup 1Gbps loopback.\n");
++ return ret_val;
++ }
+ e1000_configure_k1_ich8lan(hw, false);
++ hw->phy.ops.release(hw);
+ break;
+ case e1000_phy_82579:
+ /* Disable PHY energy detect power down */
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0144-e1000e-82571-Serdes-can-fail-to-get-link.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0144-e1000e-82571-Serdes-can-fail-to-get-link.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,83 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Wed, 24 Nov 2010 06:01:35 +0000
+Subject: [PATCH 144/166] e1000e: 82571 Serdes can fail to get link
+
+commit d9c76f99c2a79feb413e3e751362d59c0f5323f6 upstream.
+
+When link partner is sending continuous Config symbols, the 82571 Serdes
+FIFO can overflow resulting in Invalid bit getting set. To resolve this,
+if Sync and Config bits are both 1 ignore the Invalid bit and restart
+auto-negotiation.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Emil Tantilov <emil.s.tantilov at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+---
+ drivers/net/e1000e/82571.c | 35 +++++++++++++++++++++++++++--------
+ 1 files changed, 27 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+index b44789a..99aeca9 100644
+--- a/drivers/net/e1000e/82571.c
++++ b/drivers/net/e1000e/82571.c
+@@ -52,6 +52,7 @@
+ (ID_LED_DEF1_DEF2))
+
+ #define E1000_GCR_L1_ACT_WITHOUT_L0S_RX 0x08000000
++#define AN_RETRY_COUNT 5 /* Autoneg Retry Count value */
+ #define E1000_BASE1000T_STATUS 10
+ #define E1000_IDLE_ERROR_COUNT_MASK 0xFF
+ #define E1000_RECEIVE_ERROR_COUNTER 21
+@@ -1503,6 +1504,8 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw)
+ u32 rxcw;
+ u32 ctrl;
+ u32 status;
++ u32 txcw;
++ u32 i;
+ s32 ret_val = 0;
+
+ ctrl = er32(CTRL);
+@@ -1613,16 +1616,32 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw)
+ e_dbg("ANYSTATE -> DOWN\n");
+ } else {
+ /*
+- * We have sync, and can tolerate one invalid (IV)
+- * codeword before declaring link down, so reread
+- * to look again.
++ * Check several times, if Sync and Config
++ * both are consistently 1 then simply ignore
++ * the Invalid bit and restart Autoneg
+ */
+- udelay(10);
+- rxcw = er32(RXCW);
+- if (rxcw & E1000_RXCW_IV) {
+- mac->serdes_link_state = e1000_serdes_link_down;
++ for (i = 0; i < AN_RETRY_COUNT; i++) {
++ udelay(10);
++ rxcw = er32(RXCW);
++ if ((rxcw & E1000_RXCW_IV) &&
++ !((rxcw & E1000_RXCW_SYNCH) &&
++ (rxcw & E1000_RXCW_C))) {
++ mac->serdes_has_link = false;
++ mac->serdes_link_state =
++ e1000_serdes_link_down;
++ e_dbg("ANYSTATE -> DOWN\n");
++ break;
++ }
++ }
++
++ if (i == AN_RETRY_COUNT) {
++ txcw = er32(TXCW);
++ txcw |= E1000_TXCW_ANE;
++ ew32(TXCW, txcw);
++ mac->serdes_link_state =
++ e1000_serdes_link_autoneg_progress;
+ mac->serdes_has_link = false;
+- e_dbg("ANYSTATE -> DOWN\n");
++ e_dbg("ANYSTATE -> AN_PROG\n");
+ }
+ }
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0145-e1000e-82577-8-9-mis-configured-OEM-bits-during-S0-S.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0145-e1000e-82577-8-9-mis-configured-OEM-bits-during-S0-S.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,33 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Wed, 24 Nov 2010 06:01:41 +0000
+Subject: [PATCH 145/166] e1000e: 82577/8/9 mis-configured OEM bits during
+ S0->Sx
+
+commit ce54afd16d874ac07378a8bb55d26f7f5b613c0e upstream.
+
+The LPLU (Low Power Link Up) and Gigabit Disable bits (a.k.a. OEM bits)
+were being configured incorrectly when device goes to D3 state.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Jeff Pieper <jeffrey.e.pieper at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+---
+ drivers/net/e1000e/ich8lan.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index 38c84ba..9cd861d 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -3591,7 +3591,7 @@ void e1000e_disable_gig_wol_ich8lan(struct e1000_hw *hw)
+ ew32(PHY_CTRL, phy_ctrl);
+
+ if (hw->mac.type >= e1000_pchlan) {
+- e1000_oem_bits_config_ich8lan(hw, true);
++ e1000_oem_bits_config_ich8lan(hw, false);
+ ret_val = hw->phy.ops.acquire(hw);
+ if (ret_val)
+ return;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0146-e1000e-82579-PHY-incorrectly-identified-during-init.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0146-e1000e-82579-PHY-incorrectly-identified-during-init.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,93 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Wed, 24 Nov 2010 06:01:46 +0000
+Subject: [PATCH 146/166] e1000e: 82579 PHY incorrectly identified during init
+
+commit 664dc878ed6f0476b875547547a49e06f7a4e73b upstream.
+
+During init, reading the 2 PHY ID registers back-to-back in the default
+fast mode could return invalid data (all F's) and in slow mode could
+return data to the second read the data from the first read. To resolve
+the issue in fast mode, set to slow mode before any PHY accesses; to
+resolve the issue in slow mode, put in a delay for every 82579 PHY access.
+Since this PHY is currently only paired with the pch2lan MAC and the PHY
+type is not known before the first PHY access which can fail this way,
+check for this based on MAC-type.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Jeff Pieper <jeffrey.e.pieper at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+---
+ drivers/net/e1000e/ich8lan.c | 16 +++++++++++-----
+ drivers/net/e1000e/phy.c | 14 ++++++++++++++
+ 2 files changed, 25 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index 9cd861d..b0c7258 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -338,12 +338,17 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw)
+ }
+
+ phy->id = e1000_phy_unknown;
+- ret_val = e1000e_get_phy_id(hw);
+- if (ret_val)
+- goto out;
+- if ((phy->id == 0) || (phy->id == PHY_REVISION_MASK)) {
++ switch (hw->mac.type) {
++ default:
++ ret_val = e1000e_get_phy_id(hw);
++ if (ret_val)
++ goto out;
++ if ((phy->id != 0) && (phy->id != PHY_REVISION_MASK))
++ break;
++ /* fall-through */
++ case e1000_pch2lan:
+ /*
+- * In case the PHY needs to be in mdio slow mode (eg. 82577),
++ * In case the PHY needs to be in mdio slow mode,
+ * set slow mode and try to get the PHY id again.
+ */
+ ret_val = e1000_set_mdio_slow_mode_hv(hw);
+@@ -352,6 +357,7 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw)
+ ret_val = e1000e_get_phy_id(hw);
+ if (ret_val)
+ goto out;
++ break;
+ }
+ phy->type = e1000e_get_phy_type_from_id(phy->id);
+
+diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c
+index 92fcd9e..67775d8 100644
+--- a/drivers/net/e1000e/phy.c
++++ b/drivers/net/e1000e/phy.c
+@@ -226,6 +226,13 @@ s32 e1000e_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data)
+ }
+ *data = (u16) mdic;
+
++ /*
++ * Allow some time after each MDIC transaction to avoid
++ * reading duplicate data in the next MDIC transaction.
++ */
++ if (hw->mac.type == e1000_pch2lan)
++ udelay(100);
++
+ return 0;
+ }
+
+@@ -279,6 +286,13 @@ s32 e1000e_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data)
+ return -E1000_ERR_PHY;
+ }
+
++ /*
++ * Allow some time after each MDIC transaction to avoid
++ * reading duplicate data in the next MDIC transaction.
++ */
++ if (hw->mac.type == e1000_pch2lan)
++ udelay(100);
++
+ return 0;
+ }
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0147-e1000e-support-new-PBA-format-from-EEPROM.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0147-e1000e-support-new-PBA-format-from-EEPROM.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,249 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Wed, 24 Nov 2010 06:01:51 +0000
+Subject: [PATCH 147/166] e1000e: support new PBA format from EEPROM
+
+commit 073287c037083497ebaaf75ead469b769f218615 upstream.
+
+Provide support to e1000e for displaying the new format of the PBA found
+in the EEPROM. The unique PBA identifier is no longer restricted to
+hexadecimal numbers and must now be read and displayed as a string.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Jeff Pieper <jeffrey.e.pieper at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+---
+ drivers/net/e1000e/defines.h | 8 ++-
+ drivers/net/e1000e/e1000.h | 3 +-
+ drivers/net/e1000e/lib.c | 135 +++++++++++++++++++++++++++++++++++-------
+ drivers/net/e1000e/netdev.c | 12 +++-
+ 4 files changed, 130 insertions(+), 28 deletions(-)
+
+diff --git a/drivers/net/e1000e/defines.h b/drivers/net/e1000e/defines.h
+index 016ea38..7245dc2 100644
+--- a/drivers/net/e1000e/defines.h
++++ b/drivers/net/e1000e/defines.h
+@@ -488,6 +488,9 @@
+ #define E1000_BLK_PHY_RESET 12
+ #define E1000_ERR_SWFW_SYNC 13
+ #define E1000_NOT_IMPLEMENTED 14
++#define E1000_ERR_INVALID_ARGUMENT 16
++#define E1000_ERR_NO_SPACE 17
++#define E1000_ERR_NVM_PBA_SECTION 18
+
+ /* Loop limit on how long we wait for auto-negotiation to complete */
+ #define FIBER_LINK_UP_LIMIT 50
+@@ -650,13 +653,16 @@
+ /* Mask bits for fields in Word 0x03 of the EEPROM */
+ #define NVM_COMPAT_LOM 0x0800
+
++/* length of string needed to store PBA number */
++#define E1000_PBANUM_LENGTH 11
++
+ /* For checksumming, the sum of all words in the NVM should equal 0xBABA. */
+ #define NVM_SUM 0xBABA
+
+ /* PBA (printed board assembly) number words */
+ #define NVM_PBA_OFFSET_0 8
+ #define NVM_PBA_OFFSET_1 9
+-
++#define NVM_PBA_PTR_GUARD 0xFAFA
+ #define NVM_WORD_SIZE_BASE_SHIFT 6
+
+ /* NVM Commands - SPI */
+diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
+index 3d9366f..2c913b8 100644
+--- a/drivers/net/e1000e/e1000.h
++++ b/drivers/net/e1000e/e1000.h
+@@ -514,7 +514,8 @@ extern struct e1000_info e1000_pch_info;
+ extern struct e1000_info e1000_pch2_info;
+ extern struct e1000_info e1000_es2_info;
+
+-extern s32 e1000e_read_pba_num(struct e1000_hw *hw, u32 *pba_num);
++extern s32 e1000_read_pba_string_generic(struct e1000_hw *hw, u8 *pba_num,
++ u32 pba_num_size);
+
+ extern s32 e1000e_commit_phy(struct e1000_hw *hw);
+
+diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c
+index 0fd4eb5..8377523 100644
+--- a/drivers/net/e1000e/lib.c
++++ b/drivers/net/e1000e/lib.c
+@@ -2139,6 +2139,119 @@ s32 e1000e_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
+ }
+
+ /**
++ * e1000_read_pba_string_generic - Read device part number
++ * @hw: pointer to the HW structure
++ * @pba_num: pointer to device part number
++ * @pba_num_size: size of part number buffer
++ *
++ * Reads the product board assembly (PBA) number from the EEPROM and stores
++ * the value in pba_num.
++ **/
++s32 e1000_read_pba_string_generic(struct e1000_hw *hw, u8 *pba_num,
++ u32 pba_num_size)
++{
++ s32 ret_val;
++ u16 nvm_data;
++ u16 pba_ptr;
++ u16 offset;
++ u16 length;
++
++ if (pba_num == NULL) {
++ e_dbg("PBA string buffer was null\n");
++ ret_val = E1000_ERR_INVALID_ARGUMENT;
++ goto out;
++ }
++
++ ret_val = e1000_read_nvm(hw, NVM_PBA_OFFSET_0, 1, &nvm_data);
++ if (ret_val) {
++ e_dbg("NVM Read Error\n");
++ goto out;
++ }
++
++ ret_val = e1000_read_nvm(hw, NVM_PBA_OFFSET_1, 1, &pba_ptr);
++ if (ret_val) {
++ e_dbg("NVM Read Error\n");
++ goto out;
++ }
++
++ /*
++ * if nvm_data is not ptr guard the PBA must be in legacy format which
++ * means pba_ptr is actually our second data word for the PBA number
++ * and we can decode it into an ascii string
++ */
++ if (nvm_data != NVM_PBA_PTR_GUARD) {
++ e_dbg("NVM PBA number is not stored as string\n");
++
++ /* we will need 11 characters to store the PBA */
++ if (pba_num_size < 11) {
++ e_dbg("PBA string buffer too small\n");
++ return E1000_ERR_NO_SPACE;
++ }
++
++ /* extract hex string from data and pba_ptr */
++ pba_num[0] = (nvm_data >> 12) & 0xF;
++ pba_num[1] = (nvm_data >> 8) & 0xF;
++ pba_num[2] = (nvm_data >> 4) & 0xF;
++ pba_num[3] = nvm_data & 0xF;
++ pba_num[4] = (pba_ptr >> 12) & 0xF;
++ pba_num[5] = (pba_ptr >> 8) & 0xF;
++ pba_num[6] = '-';
++ pba_num[7] = 0;
++ pba_num[8] = (pba_ptr >> 4) & 0xF;
++ pba_num[9] = pba_ptr & 0xF;
++
++ /* put a null character on the end of our string */
++ pba_num[10] = '\0';
++
++ /* switch all the data but the '-' to hex char */
++ for (offset = 0; offset < 10; offset++) {
++ if (pba_num[offset] < 0xA)
++ pba_num[offset] += '0';
++ else if (pba_num[offset] < 0x10)
++ pba_num[offset] += 'A' - 0xA;
++ }
++
++ goto out;
++ }
++
++ ret_val = e1000_read_nvm(hw, pba_ptr, 1, &length);
++ if (ret_val) {
++ e_dbg("NVM Read Error\n");
++ goto out;
++ }
++
++ if (length == 0xFFFF || length == 0) {
++ e_dbg("NVM PBA number section invalid length\n");
++ ret_val = E1000_ERR_NVM_PBA_SECTION;
++ goto out;
++ }
++ /* check if pba_num buffer is big enough */
++ if (pba_num_size < (((u32)length * 2) - 1)) {
++ e_dbg("PBA string buffer too small\n");
++ ret_val = E1000_ERR_NO_SPACE;
++ goto out;
++ }
++
++ /* trim pba length from start of string */
++ pba_ptr++;
++ length--;
++
++ for (offset = 0; offset < length; offset++) {
++ ret_val = e1000_read_nvm(hw, pba_ptr + offset, 1, &nvm_data);
++ if (ret_val) {
++ e_dbg("NVM Read Error\n");
++ goto out;
++ }
++ pba_num[offset * 2] = (u8)(nvm_data >> 8);
++ pba_num[(offset * 2) + 1] = (u8)(nvm_data & 0xFF);
++ }
++ pba_num[offset * 2] = '\0';
++
++out:
++ return ret_val;
++}
++
++/**
+ * e1000_read_mac_addr_generic - Read device MAC address
+ * @hw: pointer to the HW structure
+ *
+@@ -2579,25 +2692,3 @@ bool e1000e_enable_mng_pass_thru(struct e1000_hw *hw)
+ out:
+ return ret_val;
+ }
+-
+-s32 e1000e_read_pba_num(struct e1000_hw *hw, u32 *pba_num)
+-{
+- s32 ret_val;
+- u16 nvm_data;
+-
+- ret_val = e1000_read_nvm(hw, NVM_PBA_OFFSET_0, 1, &nvm_data);
+- if (ret_val) {
+- e_dbg("NVM Read Error\n");
+- return ret_val;
+- }
+- *pba_num = (u32)(nvm_data << 16);
+-
+- ret_val = e1000_read_nvm(hw, NVM_PBA_OFFSET_1, 1, &nvm_data);
+- if (ret_val) {
+- e_dbg("NVM Read Error\n");
+- return ret_val;
+- }
+- *pba_num |= nvm_data;
+-
+- return 0;
+-}
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index febb684..16c2708 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -5629,7 +5629,8 @@ static void e1000_print_device_info(struct e1000_adapter *adapter)
+ {
+ struct e1000_hw *hw = &adapter->hw;
+ struct net_device *netdev = adapter->netdev;
+- u32 pba_num;
++ u32 ret_val;
++ u8 pba_str[E1000_PBANUM_LENGTH];
+
+ /* print bus type/speed/width info */
+ e_info("(PCI Express:2.5GB/s:%s) %pM\n",
+@@ -5640,9 +5641,12 @@ static void e1000_print_device_info(struct e1000_adapter *adapter)
+ netdev->dev_addr);
+ e_info("Intel(R) PRO/%s Network Connection\n",
+ (hw->phy.type == e1000_phy_ife) ? "10/100" : "1000");
+- e1000e_read_pba_num(hw, &pba_num);
+- e_info("MAC: %d, PHY: %d, PBA No: %06x-%03x\n",
+- hw->mac.type, hw->phy.type, (pba_num >> 8), (pba_num & 0xff));
++ ret_val = e1000_read_pba_string_generic(hw, pba_str,
++ E1000_PBANUM_LENGTH);
++ if (ret_val)
++ strcpy(pba_str, "Unknown");
++ e_info("MAC: %d, PHY: %d, PBA No: %s\n",
++ hw->mac.type, hw->phy.type, pba_str);
+ }
+
+ static void e1000_eeprom_checks(struct e1000_adapter *adapter)
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0148-e1000e-prevent-null-ptr-dereference-in-e1000_tx_queu.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0148-e1000e-prevent-null-ptr-dereference-in-e1000_tx_queu.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,42 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Wed, 24 Nov 2010 07:42:43 +0000
+Subject: [PATCH 148/166] e1000e: prevent null ptr dereference in
+ e1000_tx_queue()
+
+commit 36b973df713e1395b79896de667ad7dbb1925fa7 upstream.
+
+tx_desc can be dereferenced as a null pointer when count is passed in
+as 0.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Emil Tantilov <emil.s.tantilov at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+---
+ drivers/net/e1000e/netdev.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 16c2708..4f01cb5 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -4632,7 +4632,7 @@ static void e1000_tx_queue(struct e1000_adapter *adapter,
+
+ i = tx_ring->next_to_use;
+
+- while (count--) {
++ do {
+ buffer_info = &tx_ring->buffer_info[i];
+ tx_desc = E1000_TX_DESC(*tx_ring, i);
+ tx_desc->buffer_addr = cpu_to_le64(buffer_info->dma);
+@@ -4643,7 +4643,7 @@ static void e1000_tx_queue(struct e1000_adapter *adapter,
+ i++;
+ if (i == tx_ring->count)
+ i = 0;
+- }
++ } while (--count > 0);
+
+ tx_desc->lower.data |= cpu_to_le32(adapter->txd_cmd);
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0149-e1000e-minor-error-message-corrections.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0149-e1000e-minor-error-message-corrections.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,46 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Wed, 24 Nov 2010 06:02:06 +0000
+Subject: [PATCH 149/166] e1000e: minor error message corrections
+
+commit e9262447233037e9336d5866628821156a17366f upstream.
+
+Correct error messages when setting up Rx resources and when checking
+module parameters.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Jeff Pieper <jeffrey.e.pieper at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+---
+ drivers/net/e1000e/netdev.c | 2 +-
+ drivers/net/e1000e/param.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 4f01cb5..59ac70e 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -2131,7 +2131,7 @@ err_pages:
+ }
+ err:
+ vfree(rx_ring->buffer_info);
+- e_err("Unable to allocate memory for the transmit descriptor ring\n");
++ e_err("Unable to allocate memory for the receive descriptor ring\n");
+ return err;
+ }
+
+diff --git a/drivers/net/e1000e/param.c b/drivers/net/e1000e/param.c
+index 3d36911..a9612b0 100644
+--- a/drivers/net/e1000e/param.c
++++ b/drivers/net/e1000e/param.c
+@@ -421,7 +421,7 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
+ static const struct e1000_option opt = {
+ .type = enable_option,
+ .name = "CRC Stripping",
+- .err = "defaulting to enabled",
++ .err = "defaulting to Enabled",
+ .def = OPTION_ENABLED
+ };
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0150-e1000e-static-analysis-tools-complain-of-a-possible-.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0150-e1000e-static-analysis-tools-complain-of-a-possible-.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,35 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Thu, 9 Dec 2010 23:04:25 +0000
+Subject: [PATCH 150/166] e1000e: static analysis tools complain of a possible
+ null ptr p dereference
+
+commit 61c758166701c4f156c0aba10260f5729b1a6f43 upstream.
+
+Adding this default case resolves the issue.
+
+v2- Removed "break" in default case based on feedback
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Emil Tantilov <emil.s.tantilov at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+---
+ drivers/net/e1000e/ethtool.c | 3 +++
+ 1 files changed, 3 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
+index 29b09113..a7bec0b 100644
+--- a/drivers/net/e1000e/ethtool.c
++++ b/drivers/net/e1000e/ethtool.c
+@@ -1992,6 +1992,9 @@ static void e1000_get_ethtool_stats(struct net_device *netdev,
+ p = (char *) adapter +
+ e1000_gstrings_stats[i].stat_offset;
+ break;
++ default:
++ data[i] = 0;
++ continue;
+ }
+
+ data[i] = (e1000_gstrings_stats[i].sizeof_stat ==
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0151-e1000e-increment-the-driver-version.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0151-e1000e-increment-the-driver-version.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,29 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Wed, 1 Dec 2010 08:45:24 +0000
+Subject: [PATCH 151/166] e1000e: increment the driver version
+
+commit c920aa8b87bfec3dbd926ae777430e613e5088df upstream.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Jeff Pieper <jeffrey.e.pieper at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+---
+ drivers/net/e1000e/netdev.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 59ac70e..cbd197f 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -54,7 +54,7 @@
+
+ #define DRV_EXTRAVERSION "-k2"
+
+-#define DRV_VERSION "1.2.7" DRV_EXTRAVERSION
++#define DRV_VERSION "1.2.20" DRV_EXTRAVERSION
+ char e1000e_driver_name[] = "e1000e";
+ const char e1000e_driver_version[] = DRV_VERSION;
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0152-e1000e-checkpatch-error-macro-panethesis.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0152-e1000e-checkpatch-error-macro-panethesis.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,159 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Sat, 11 Dec 2010 05:53:32 +0000
+Subject: [PATCH 152/166] e1000e: checkpatch error - macro panethesis
+
+commit f0f1a172b2a9e26319b9aa95fa6c322ebb01089d upstream.
+
+ERROR: Macros with complex values should be enclosed in parenthesis
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Emil Tantilov <emil.s.tantilov at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+---
+ drivers/net/e1000e/ethtool.c | 114 ++++++++++++++++++++++--------------------
+ drivers/net/e1000e/netdev.c | 2 +-
+ 2 files changed, 60 insertions(+), 56 deletions(-)
+
+diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
+index a7bec0b..54ecd545 100644
+--- a/drivers/net/e1000e/ethtool.c
++++ b/drivers/net/e1000e/ethtool.c
+@@ -45,63 +45,67 @@ struct e1000_stats {
+ int stat_offset;
+ };
+
+-#define E1000_STAT(m) E1000_STATS, \
+- sizeof(((struct e1000_adapter *)0)->m), \
+- offsetof(struct e1000_adapter, m)
+-#define E1000_NETDEV_STAT(m) NETDEV_STATS, \
+- sizeof(((struct net_device *)0)->m), \
+- offsetof(struct net_device, m)
++#define E1000_STAT(str, m) { \
++ .stat_string = str, \
++ .type = E1000_STATS, \
++ .sizeof_stat = sizeof(((struct e1000_adapter *)0)->m), \
++ .stat_offset = offsetof(struct e1000_adapter, m) }
++#define E1000_NETDEV_STAT(str, m) { \
++ .stat_string = str, \
++ .type = NETDEV_STATS, \
++ .sizeof_stat = sizeof(((struct net_device *)0)->m), \
++ .stat_offset = offsetof(struct net_device, m) }
+
+ static const struct e1000_stats e1000_gstrings_stats[] = {
+- { "rx_packets", E1000_STAT(stats.gprc) },
+- { "tx_packets", E1000_STAT(stats.gptc) },
+- { "rx_bytes", E1000_STAT(stats.gorc) },
+- { "tx_bytes", E1000_STAT(stats.gotc) },
+- { "rx_broadcast", E1000_STAT(stats.bprc) },
+- { "tx_broadcast", E1000_STAT(stats.bptc) },
+- { "rx_multicast", E1000_STAT(stats.mprc) },
+- { "tx_multicast", E1000_STAT(stats.mptc) },
+- { "rx_errors", E1000_NETDEV_STAT(stats.rx_errors) },
+- { "tx_errors", E1000_NETDEV_STAT(stats.tx_errors) },
+- { "tx_dropped", E1000_NETDEV_STAT(stats.tx_dropped) },
+- { "multicast", E1000_STAT(stats.mprc) },
+- { "collisions", E1000_STAT(stats.colc) },
+- { "rx_length_errors", E1000_NETDEV_STAT(stats.rx_length_errors) },
+- { "rx_over_errors", E1000_NETDEV_STAT(stats.rx_over_errors) },
+- { "rx_crc_errors", E1000_STAT(stats.crcerrs) },
+- { "rx_frame_errors", E1000_NETDEV_STAT(stats.rx_frame_errors) },
+- { "rx_no_buffer_count", E1000_STAT(stats.rnbc) },
+- { "rx_missed_errors", E1000_STAT(stats.mpc) },
+- { "tx_aborted_errors", E1000_STAT(stats.ecol) },
+- { "tx_carrier_errors", E1000_STAT(stats.tncrs) },
+- { "tx_fifo_errors", E1000_NETDEV_STAT(stats.tx_fifo_errors) },
+- { "tx_heartbeat_errors", E1000_NETDEV_STAT(stats.tx_heartbeat_errors) },
+- { "tx_window_errors", E1000_STAT(stats.latecol) },
+- { "tx_abort_late_coll", E1000_STAT(stats.latecol) },
+- { "tx_deferred_ok", E1000_STAT(stats.dc) },
+- { "tx_single_coll_ok", E1000_STAT(stats.scc) },
+- { "tx_multi_coll_ok", E1000_STAT(stats.mcc) },
+- { "tx_timeout_count", E1000_STAT(tx_timeout_count) },
+- { "tx_restart_queue", E1000_STAT(restart_queue) },
+- { "rx_long_length_errors", E1000_STAT(stats.roc) },
+- { "rx_short_length_errors", E1000_STAT(stats.ruc) },
+- { "rx_align_errors", E1000_STAT(stats.algnerrc) },
+- { "tx_tcp_seg_good", E1000_STAT(stats.tsctc) },
+- { "tx_tcp_seg_failed", E1000_STAT(stats.tsctfc) },
+- { "rx_flow_control_xon", E1000_STAT(stats.xonrxc) },
+- { "rx_flow_control_xoff", E1000_STAT(stats.xoffrxc) },
+- { "tx_flow_control_xon", E1000_STAT(stats.xontxc) },
+- { "tx_flow_control_xoff", E1000_STAT(stats.xofftxc) },
+- { "rx_long_byte_count", E1000_STAT(stats.gorc) },
+- { "rx_csum_offload_good", E1000_STAT(hw_csum_good) },
+- { "rx_csum_offload_errors", E1000_STAT(hw_csum_err) },
+- { "rx_header_split", E1000_STAT(rx_hdr_split) },
+- { "alloc_rx_buff_failed", E1000_STAT(alloc_rx_buff_failed) },
+- { "tx_smbus", E1000_STAT(stats.mgptc) },
+- { "rx_smbus", E1000_STAT(stats.mgprc) },
+- { "dropped_smbus", E1000_STAT(stats.mgpdc) },
+- { "rx_dma_failed", E1000_STAT(rx_dma_failed) },
+- { "tx_dma_failed", E1000_STAT(tx_dma_failed) },
++ E1000_STAT("rx_packets", stats.gprc),
++ E1000_STAT("tx_packets", stats.gptc),
++ E1000_STAT("rx_bytes", stats.gorc),
++ E1000_STAT("tx_bytes", stats.gotc),
++ E1000_STAT("rx_broadcast", stats.bprc),
++ E1000_STAT("tx_broadcast", stats.bptc),
++ E1000_STAT("rx_multicast", stats.mprc),
++ E1000_STAT("tx_multicast", stats.mptc),
++ E1000_NETDEV_STAT("rx_errors", stats.rx_errors),
++ E1000_NETDEV_STAT("tx_errors", stats.tx_errors),
++ E1000_NETDEV_STAT("tx_dropped", stats.tx_dropped),
++ E1000_STAT("multicast", stats.mprc),
++ E1000_STAT("collisions", stats.colc),
++ E1000_NETDEV_STAT("rx_length_errors", stats.rx_length_errors),
++ E1000_NETDEV_STAT("rx_over_errors", stats.rx_over_errors),
++ E1000_STAT("rx_crc_errors", stats.crcerrs),
++ E1000_NETDEV_STAT("rx_frame_errors", stats.rx_frame_errors),
++ E1000_STAT("rx_no_buffer_count", stats.rnbc),
++ E1000_STAT("rx_missed_errors", stats.mpc),
++ E1000_STAT("tx_aborted_errors", stats.ecol),
++ E1000_STAT("tx_carrier_errors", stats.tncrs),
++ E1000_NETDEV_STAT("tx_fifo_errors", stats.tx_fifo_errors),
++ E1000_NETDEV_STAT("tx_heartbeat_errors", stats.tx_heartbeat_errors),
++ E1000_STAT("tx_window_errors", stats.latecol),
++ E1000_STAT("tx_abort_late_coll", stats.latecol),
++ E1000_STAT("tx_deferred_ok", stats.dc),
++ E1000_STAT("tx_single_coll_ok", stats.scc),
++ E1000_STAT("tx_multi_coll_ok", stats.mcc),
++ E1000_STAT("tx_timeout_count", tx_timeout_count),
++ E1000_STAT("tx_restart_queue", restart_queue),
++ E1000_STAT("rx_long_length_errors", stats.roc),
++ E1000_STAT("rx_short_length_errors", stats.ruc),
++ E1000_STAT("rx_align_errors", stats.algnerrc),
++ E1000_STAT("tx_tcp_seg_good", stats.tsctc),
++ E1000_STAT("tx_tcp_seg_failed", stats.tsctfc),
++ E1000_STAT("rx_flow_control_xon", stats.xonrxc),
++ E1000_STAT("rx_flow_control_xoff", stats.xoffrxc),
++ E1000_STAT("tx_flow_control_xon", stats.xontxc),
++ E1000_STAT("tx_flow_control_xoff", stats.xofftxc),
++ E1000_STAT("rx_long_byte_count", stats.gorc),
++ E1000_STAT("rx_csum_offload_good", hw_csum_good),
++ E1000_STAT("rx_csum_offload_errors", hw_csum_err),
++ E1000_STAT("rx_header_split", rx_hdr_split),
++ E1000_STAT("alloc_rx_buff_failed", alloc_rx_buff_failed),
++ E1000_STAT("tx_smbus", stats.mgptc),
++ E1000_STAT("rx_smbus", stats.mgprc),
++ E1000_STAT("dropped_smbus", stats.mgpdc),
++ E1000_STAT("rx_dma_failed", rx_dma_failed),
++ E1000_STAT("tx_dma_failed", tx_dma_failed),
+ };
+
+ #define E1000_GLOBAL_STATS_LEN ARRAY_SIZE(e1000_gstrings_stats)
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index cbd197f..f8f54d5 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -1324,7 +1324,7 @@ static bool e1000_clean_jumbo_rx_irq(struct e1000_adapter *adapter,
+ goto next_desc;
+ }
+
+-#define rxtop rx_ring->rx_skb_top
++#define rxtop (rx_ring->rx_skb_top)
+ if (!(status & E1000_RXD_STAT_EOP)) {
+ /* this descriptor is only the beginning (or middle) */
+ if (!rxtop) {
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0153-e1000e-checkpatch-error-trailing-statements.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0153-e1000e-checkpatch-error-trailing-statements.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,33 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Sat, 11 Dec 2010 05:53:37 +0000
+Subject: [PATCH 153/166] e1000e: checkpatch error - trailing statements
+
+commit 184125a389cf2c81980de5d5f365c786cc76d229 upstream.
+
+ERROR: trailing statements should be on next line
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Emil Tantilov <emil.s.tantilov at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+---
+ drivers/net/e1000e/es2lan.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/e1000e/es2lan.c b/drivers/net/e1000e/es2lan.c
+index 24f8ac9..79da646 100644
+--- a/drivers/net/e1000e/es2lan.c
++++ b/drivers/net/e1000e/es2lan.c
+@@ -426,8 +426,8 @@ static void e1000_release_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask)
+ {
+ u32 swfw_sync;
+
+- while (e1000e_get_hw_semaphore(hw) != 0);
+- /* Empty */
++ while (e1000e_get_hw_semaphore(hw) != 0)
++ ; /* Empty */
+
+ swfw_sync = er32(SW_FW_SYNC);
+ swfw_sync &= ~mask;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0154-e1000e-checkpatch-error-open-braces.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0154-e1000e-checkpatch-error-open-braces.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,86 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Sat, 11 Dec 2010 05:53:42 +0000
+Subject: [PATCH 154/166] e1000e: checkpatch error - open braces
+
+commit 6480641eb741cabbba8e196d4f17db7fb80d101c upstream.
+
+ERROR: that open brace { should be on the previous line
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Emil Tantilov <emil.s.tantilov at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+---
+ drivers/net/e1000e/es2lan.c | 4 ++--
+ drivers/net/e1000e/ethtool.c | 4 ++--
+ drivers/net/e1000e/phy.c | 22 +++++++++++-----------
+ 3 files changed, 15 insertions(+), 15 deletions(-)
+
+diff --git a/drivers/net/e1000e/es2lan.c b/drivers/net/e1000e/es2lan.c
+index 79da646..b18c644 100644
+--- a/drivers/net/e1000e/es2lan.c
++++ b/drivers/net/e1000e/es2lan.c
+@@ -100,8 +100,8 @@
+ * with a lower bound at "index" and the upper bound at
+ * "index + 5".
+ */
+-static const u16 e1000_gg82563_cable_length_table[] =
+- { 0, 60, 115, 150, 150, 60, 115, 150, 180, 180, 0xFF };
++static const u16 e1000_gg82563_cable_length_table[] = {
++ 0, 60, 115, 150, 150, 60, 115, 150, 180, 180, 0xFF };
+ #define GG82563_CABLE_LENGTH_TABLE_SIZE \
+ ARRAY_SIZE(e1000_gg82563_cable_length_table)
+
+diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
+index 54ecd545..66a2f8b 100644
+--- a/drivers/net/e1000e/ethtool.c
++++ b/drivers/net/e1000e/ethtool.c
+@@ -767,8 +767,8 @@ static bool reg_pattern_test(struct e1000_adapter *adapter, u64 *data,
+ int reg, int offset, u32 mask, u32 write)
+ {
+ u32 pat, val;
+- static const u32 test[] =
+- {0x5A5A5A5A, 0xA5A5A5A5, 0x00000000, 0xFFFFFFFF};
++ static const u32 test[] = {
++ 0x5A5A5A5A, 0xA5A5A5A5, 0x00000000, 0xFFFFFFFF};
+ for (pat = 0; pat < ARRAY_SIZE(test); pat++) {
+ E1000_WRITE_REG_ARRAY(&adapter->hw, reg, offset,
+ (test[pat] & write));
+diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c
+index 67775d8..3752193 100644
+--- a/drivers/net/e1000e/phy.c
++++ b/drivers/net/e1000e/phy.c
+@@ -42,20 +42,20 @@ static s32 e1000_access_phy_debug_regs_hv(struct e1000_hw *hw, u32 offset,
+ u16 *data, bool read);
+
+ /* Cable length tables */
+-static const u16 e1000_m88_cable_length_table[] =
+- { 0, 50, 80, 110, 140, 140, E1000_CABLE_LENGTH_UNDEFINED };
++static const u16 e1000_m88_cable_length_table[] = {
++ 0, 50, 80, 110, 140, 140, E1000_CABLE_LENGTH_UNDEFINED };
+ #define M88E1000_CABLE_LENGTH_TABLE_SIZE \
+ ARRAY_SIZE(e1000_m88_cable_length_table)
+
+-static const u16 e1000_igp_2_cable_length_table[] =
+- { 0, 0, 0, 0, 0, 0, 0, 0, 3, 5, 8, 11, 13, 16, 18, 21, 0, 0, 0, 3,
+- 6, 10, 13, 16, 19, 23, 26, 29, 32, 35, 38, 41, 6, 10, 14, 18, 22,
+- 26, 30, 33, 37, 41, 44, 48, 51, 54, 58, 61, 21, 26, 31, 35, 40,
+- 44, 49, 53, 57, 61, 65, 68, 72, 75, 79, 82, 40, 45, 51, 56, 61,
+- 66, 70, 75, 79, 83, 87, 91, 94, 98, 101, 104, 60, 66, 72, 77, 82,
+- 87, 92, 96, 100, 104, 108, 111, 114, 117, 119, 121, 83, 89, 95,
+- 100, 105, 109, 113, 116, 119, 122, 124, 104, 109, 114, 118, 121,
+- 124};
++static const u16 e1000_igp_2_cable_length_table[] = {
++ 0, 0, 0, 0, 0, 0, 0, 0, 3, 5, 8, 11, 13, 16, 18, 21, 0, 0, 0, 3,
++ 6, 10, 13, 16, 19, 23, 26, 29, 32, 35, 38, 41, 6, 10, 14, 18, 22,
++ 26, 30, 33, 37, 41, 44, 48, 51, 54, 58, 61, 21, 26, 31, 35, 40,
++ 44, 49, 53, 57, 61, 65, 68, 72, 75, 79, 82, 40, 45, 51, 56, 61,
++ 66, 70, 75, 79, 83, 87, 91, 94, 98, 101, 104, 60, 66, 72, 77, 82,
++ 87, 92, 96, 100, 104, 108, 111, 114, 117, 119, 121, 83, 89, 95,
++ 100, 105, 109, 113, 116, 119, 122, 124, 104, 109, 114, 118, 121,
++ 124};
+ #define IGP02E1000_CABLE_LENGTH_TABLE_SIZE \
+ ARRAY_SIZE(e1000_igp_2_cable_length_table)
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0155-e1000e-checkpatch-warnings-braces.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0155-e1000e-checkpatch-warnings-braces.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,143 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Sat, 11 Dec 2010 05:53:47 +0000
+Subject: [PATCH 155/166] e1000e: checkpatch warnings - braces
+
+commit b1cdfead0e532d7614b5d5b97044df94cc8945ae upstream.
+
+WARNING: braces {} are not necessary for any arm of this statement
+WARNING: braces {} are not necessary for single statement blocks
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Emil Tantilov <emil.s.tantilov at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+---
+ drivers/net/e1000e/ich8lan.c | 5 ++---
+ drivers/net/e1000e/lib.c | 6 ++----
+ drivers/net/e1000e/netdev.c | 19 +++++++------------
+ drivers/net/e1000e/phy.c | 3 +--
+ 4 files changed, 12 insertions(+), 21 deletions(-)
+
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index b0c7258..ebc0639 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -2309,11 +2309,10 @@ static s32 e1000_read_flash_data_ich8lan(struct e1000_hw *hw, u32 offset,
+ */
+ if (ret_val == 0) {
+ flash_data = er32flash(ICH_FLASH_FDATA0);
+- if (size == 1) {
++ if (size == 1)
+ *data = (u8)(flash_data & 0x000000FF);
+- } else if (size == 2) {
++ else if (size == 2)
+ *data = (u16)(flash_data & 0x0000FFFF);
+- }
+ break;
+ } else {
+ /*
+diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c
+index 8377523..7e55170 100644
+--- a/drivers/net/e1000e/lib.c
++++ b/drivers/net/e1000e/lib.c
+@@ -493,9 +493,8 @@ s32 e1000e_check_for_copper_link(struct e1000_hw *hw)
+ * different link partner.
+ */
+ ret_val = e1000e_config_fc_after_link_up(hw);
+- if (ret_val) {
++ if (ret_val)
+ e_dbg("Error configuring flow control\n");
+- }
+
+ return ret_val;
+ }
+@@ -1496,9 +1495,8 @@ s32 e1000e_setup_led_generic(struct e1000_hw *hw)
+ {
+ u32 ledctl;
+
+- if (hw->mac.ops.setup_led != e1000e_setup_led_generic) {
++ if (hw->mac.ops.setup_led != e1000e_setup_led_generic)
+ return -E1000_ERR_CONFIG;
+- }
+
+ if (hw->phy.media_type == e1000_media_type_fiber) {
+ ledctl = er32(LEDCTL);
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index f8f54d5..29367aa 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -1805,9 +1805,8 @@ void e1000e_set_interrupt_capability(struct e1000_adapter *adapter)
+ err = pci_enable_msix(adapter->pdev,
+ adapter->msix_entries,
+ adapter->num_vectors);
+- if (err == 0) {
++ if (err == 0)
+ return;
+- }
+ }
+ /* MSI-X failed, so fall through and try MSI */
+ e_err("Failed to initialize MSI-X interrupts. "
+@@ -2199,9 +2198,8 @@ void e1000e_free_rx_resources(struct e1000_adapter *adapter)
+
+ e1000_clean_rx_ring(adapter);
+
+- for (i = 0; i < rx_ring->count; i++) {
++ for (i = 0; i < rx_ring->count; i++)
+ kfree(rx_ring->buffer_info[i].ps_pages);
+- }
+
+ vfree(rx_ring->buffer_info);
+ rx_ring->buffer_info = NULL;
+@@ -2241,20 +2239,18 @@ static unsigned int e1000_update_itr(struct e1000_adapter *adapter,
+ /* handle TSO and jumbo frames */
+ if (bytes/packets > 8000)
+ retval = bulk_latency;
+- else if ((packets < 5) && (bytes > 512)) {
++ else if ((packets < 5) && (bytes > 512))
+ retval = low_latency;
+- }
+ break;
+ case low_latency: /* 50 usec aka 20000 ints/s */
+ if (bytes > 10000) {
+ /* this if handles the TSO accounting */
+- if (bytes/packets > 8000) {
++ if (bytes/packets > 8000)
+ retval = bulk_latency;
+- } else if ((packets < 10) || ((bytes/packets) > 1200)) {
++ else if ((packets < 10) || ((bytes/packets) > 1200))
+ retval = bulk_latency;
+- } else if ((packets > 35)) {
++ else if ((packets > 35))
+ retval = lowest_latency;
+- }
+ } else if (bytes/packets > 2000) {
+ retval = bulk_latency;
+ } else if (packets <= 2 && bytes < 512) {
+@@ -2263,9 +2259,8 @@ static unsigned int e1000_update_itr(struct e1000_adapter *adapter,
+ break;
+ case bulk_latency: /* 250 usec aka 4000 ints/s */
+ if (bytes > 25000) {
+- if (packets > 35) {
++ if (packets > 35)
+ retval = low_latency;
+- }
+ } else if (bytes < 6000) {
+ retval = low_latency;
+ }
+diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c
+index 3752193..4d6c57e 100644
+--- a/drivers/net/e1000e/phy.c
++++ b/drivers/net/e1000e/phy.c
+@@ -1057,9 +1057,8 @@ static s32 e1000_phy_setup_autoneg(struct e1000_hw *hw)
+
+ e_dbg("Auto-Neg Advertising %x\n", mii_autoneg_adv_reg);
+
+- if (phy->autoneg_mask & ADVERTISE_1000_FULL) {
++ if (phy->autoneg_mask & ADVERTISE_1000_FULL)
+ ret_val = e1e_wphy(hw, PHY_1000T_CTRL, mii_1000t_ctrl_reg);
+- }
+
+ return ret_val;
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0156-e1000e-cleanup-variables-set-but-not-used.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0156-e1000e-cleanup-variables-set-but-not-used.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,148 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Thu, 6 Jan 2011 14:29:48 +0000
+Subject: [PATCH 156/166] e1000e: cleanup variables set but not used
+
+commit dd93f95e92283498f2497a632a81c167444668b5 upstream.
+
+The ICR register is clear on read and we don't care what the returned value
+is when resetting the hardware so the icr variable(s) can be removed. We
+should not ignore the return from e1000_lv_jumbo_workaround_ich8lan() and
+from e1000_get_phy_id_82571() (dump a debug message when it fails and when
+an unknown Phy id is returned).
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Emil Tantilov <emil.s.tantilov at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/82571.c | 21 ++++++++++++++-------
+ drivers/net/e1000e/es2lan.c | 4 ++--
+ drivers/net/e1000e/ich8lan.c | 4 ++--
+ drivers/net/e1000e/netdev.c | 3 +++
+ 4 files changed, 21 insertions(+), 11 deletions(-)
+
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+index 99aeca9..bbcac4d 100644
+--- a/drivers/net/e1000e/82571.c
++++ b/drivers/net/e1000e/82571.c
+@@ -121,29 +121,36 @@ static s32 e1000_init_phy_params_82571(struct e1000_hw *hw)
+
+ /* This can only be done after all function pointers are setup. */
+ ret_val = e1000_get_phy_id_82571(hw);
++ if (ret_val) {
++ e_dbg("Error getting PHY ID\n");
++ return ret_val;
++ }
+
+ /* Verify phy id */
+ switch (hw->mac.type) {
+ case e1000_82571:
+ case e1000_82572:
+ if (phy->id != IGP01E1000_I_PHY_ID)
+- return -E1000_ERR_PHY;
++ ret_val = -E1000_ERR_PHY;
+ break;
+ case e1000_82573:
+ if (phy->id != M88E1111_I_PHY_ID)
+- return -E1000_ERR_PHY;
++ ret_val = -E1000_ERR_PHY;
+ break;
+ case e1000_82574:
+ case e1000_82583:
+ if (phy->id != BME1000_E_PHY_ID_R2)
+- return -E1000_ERR_PHY;
++ ret_val = -E1000_ERR_PHY;
+ break;
+ default:
+- return -E1000_ERR_PHY;
++ ret_val = -E1000_ERR_PHY;
+ break;
+ }
+
+- return 0;
++ if (ret_val)
++ e_dbg("PHY ID unknown: type = 0x%08x\n", phy->id);
++
++ return ret_val;
+ }
+
+ /**
+@@ -956,7 +963,7 @@ static s32 e1000_set_d0_lplu_state_82571(struct e1000_hw *hw, bool active)
+ **/
+ static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
+ {
+- u32 ctrl, ctrl_ext, icr;
++ u32 ctrl, ctrl_ext;
+ s32 ret_val;
+
+ /*
+@@ -1040,7 +1047,7 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
+
+ /* Clear any pending interrupt events. */
+ ew32(IMC, 0xffffffff);
+- icr = er32(ICR);
++ er32(ICR);
+
+ if (hw->mac.type == e1000_82571) {
+ /* Install any alternate MAC address into RAR0 */
+diff --git a/drivers/net/e1000e/es2lan.c b/drivers/net/e1000e/es2lan.c
+index b18c644..e45a61c 100644
+--- a/drivers/net/e1000e/es2lan.c
++++ b/drivers/net/e1000e/es2lan.c
+@@ -784,7 +784,7 @@ static s32 e1000_get_link_up_info_80003es2lan(struct e1000_hw *hw, u16 *speed,
+ **/
+ static s32 e1000_reset_hw_80003es2lan(struct e1000_hw *hw)
+ {
+- u32 ctrl, icr;
++ u32 ctrl;
+ s32 ret_val;
+
+ /*
+@@ -818,7 +818,7 @@ static s32 e1000_reset_hw_80003es2lan(struct e1000_hw *hw)
+
+ /* Clear any pending interrupt events. */
+ ew32(IMC, 0xffffffff);
+- icr = er32(ICR);
++ er32(ICR);
+
+ ret_val = e1000_check_alt_mac_addr_generic(hw);
+
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index ebc0639..728cf8a 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -2977,7 +2977,7 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
+ {
+ struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan;
+ u16 reg;
+- u32 ctrl, icr, kab;
++ u32 ctrl, kab;
+ s32 ret_val;
+
+ /*
+@@ -3067,7 +3067,7 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
+ ew32(CRC_OFFSET, 0x65656565);
+
+ ew32(IMC, 0xffffffff);
+- icr = er32(ICR);
++ er32(ICR);
+
+ kab = er32(KABGTXD);
+ kab |= E1000_KABGTXD_BGSQLBIAS;
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 29367aa..ac84075 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -2735,6 +2735,9 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter)
+ ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, true);
+ else
+ ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, false);
++
++ if (ret_val)
++ e_dbg("failed to enable jumbo frame workaround mode\n");
+ }
+
+ /* Program MC offset vector base */
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0157-e1000e-convert-calls-of-ops.-read-write-_reg-to-e1e_.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0157-e1000e-convert-calls-of-ops.-read-write-_reg-to-e1e_.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,309 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Thu, 6 Jan 2011 14:29:49 +0000
+Subject: [PATCH 157/166] e1000e: convert calls of ops.[read|write]_reg to
+ e1e_[r|w]phy
+
+commit 482fed85e64958f678a138a4b5f8891190d2b169 upstream.
+
+Cleans up the code a bit by using the driver-specific e1e_rphy and
+e1e_wphy macros instead of the full function pointer variants. Fix
+a couple whitespace issue with two already existing calls to e1e_wphy.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Jeff Pieper <jeffrey.e.pieper at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/ich8lan.c | 54 +++++++++++++++++++----------------------
+ drivers/net/e1000e/lib.c | 3 +-
+ drivers/net/e1000e/phy.c | 40 +++++++++++++------------------
+ 3 files changed, 44 insertions(+), 53 deletions(-)
+
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index 728cf8a..5759545 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -3118,7 +3118,7 @@ static s32 e1000_init_hw_ich8lan(struct e1000_hw *hw)
+ * Reset the phy after disabling host wakeup to reset the Rx buffer.
+ */
+ if (hw->phy.type == e1000_phy_82578) {
+- hw->phy.ops.read_reg(hw, BM_WUC, &i);
++ e1e_rphy(hw, BM_WUC, &i);
+ ret_val = e1000_phy_hw_reset_ich8lan(hw);
+ if (ret_val)
+ return ret_val;
+@@ -3276,9 +3276,8 @@ static s32 e1000_setup_link_ich8lan(struct e1000_hw *hw)
+ (hw->phy.type == e1000_phy_82577)) {
+ ew32(FCRTV_PCH, hw->fc.refresh_time);
+
+- ret_val = hw->phy.ops.write_reg(hw,
+- PHY_REG(BM_PORT_CTRL_PAGE, 27),
+- hw->fc.pause_time);
++ ret_val = e1e_wphy(hw, PHY_REG(BM_PORT_CTRL_PAGE, 27),
++ hw->fc.pause_time);
+ if (ret_val)
+ return ret_val;
+ }
+@@ -3342,8 +3341,7 @@ static s32 e1000_setup_copper_link_ich8lan(struct e1000_hw *hw)
+ return ret_val;
+ break;
+ case e1000_phy_ife:
+- ret_val = hw->phy.ops.read_reg(hw, IFE_PHY_MDIX_CONTROL,
+- ®_data);
++ ret_val = e1e_rphy(hw, IFE_PHY_MDIX_CONTROL, ®_data);
+ if (ret_val)
+ return ret_val;
+
+@@ -3361,8 +3359,7 @@ static s32 e1000_setup_copper_link_ich8lan(struct e1000_hw *hw)
+ reg_data |= IFE_PMC_AUTO_MDIX;
+ break;
+ }
+- ret_val = hw->phy.ops.write_reg(hw, IFE_PHY_MDIX_CONTROL,
+- reg_data);
++ ret_val = e1e_wphy(hw, IFE_PHY_MDIX_CONTROL, reg_data);
+ if (ret_val)
+ return ret_val;
+ break;
+@@ -3646,7 +3643,8 @@ static s32 e1000_led_off_ich8lan(struct e1000_hw *hw)
+ {
+ if (hw->phy.type == e1000_phy_ife)
+ return e1e_wphy(hw, IFE_PHY_SPECIAL_CONTROL_LED,
+- (IFE_PSCL_PROBE_MODE | IFE_PSCL_PROBE_LEDS_OFF));
++ (IFE_PSCL_PROBE_MODE |
++ IFE_PSCL_PROBE_LEDS_OFF));
+
+ ew32(LEDCTL, hw->mac.ledctl_mode1);
+ return 0;
+@@ -3660,8 +3658,7 @@ static s32 e1000_led_off_ich8lan(struct e1000_hw *hw)
+ **/
+ static s32 e1000_setup_led_pchlan(struct e1000_hw *hw)
+ {
+- return hw->phy.ops.write_reg(hw, HV_LED_CONFIG,
+- (u16)hw->mac.ledctl_mode1);
++ return e1e_wphy(hw, HV_LED_CONFIG, (u16)hw->mac.ledctl_mode1);
+ }
+
+ /**
+@@ -3672,8 +3669,7 @@ static s32 e1000_setup_led_pchlan(struct e1000_hw *hw)
+ **/
+ static s32 e1000_cleanup_led_pchlan(struct e1000_hw *hw)
+ {
+- return hw->phy.ops.write_reg(hw, HV_LED_CONFIG,
+- (u16)hw->mac.ledctl_default);
++ return e1e_wphy(hw, HV_LED_CONFIG, (u16)hw->mac.ledctl_default);
+ }
+
+ /**
+@@ -3704,7 +3700,7 @@ static s32 e1000_led_on_pchlan(struct e1000_hw *hw)
+ }
+ }
+
+- return hw->phy.ops.write_reg(hw, HV_LED_CONFIG, data);
++ return e1e_wphy(hw, HV_LED_CONFIG, data);
+ }
+
+ /**
+@@ -3735,7 +3731,7 @@ static s32 e1000_led_off_pchlan(struct e1000_hw *hw)
+ }
+ }
+
+- return hw->phy.ops.write_reg(hw, HV_LED_CONFIG, data);
++ return e1e_wphy(hw, HV_LED_CONFIG, data);
+ }
+
+ /**
+@@ -3844,20 +3840,20 @@ static void e1000_clear_hw_cntrs_ich8lan(struct e1000_hw *hw)
+ if ((hw->phy.type == e1000_phy_82578) ||
+ (hw->phy.type == e1000_phy_82579) ||
+ (hw->phy.type == e1000_phy_82577)) {
+- hw->phy.ops.read_reg(hw, HV_SCC_UPPER, &phy_data);
+- hw->phy.ops.read_reg(hw, HV_SCC_LOWER, &phy_data);
+- hw->phy.ops.read_reg(hw, HV_ECOL_UPPER, &phy_data);
+- hw->phy.ops.read_reg(hw, HV_ECOL_LOWER, &phy_data);
+- hw->phy.ops.read_reg(hw, HV_MCC_UPPER, &phy_data);
+- hw->phy.ops.read_reg(hw, HV_MCC_LOWER, &phy_data);
+- hw->phy.ops.read_reg(hw, HV_LATECOL_UPPER, &phy_data);
+- hw->phy.ops.read_reg(hw, HV_LATECOL_LOWER, &phy_data);
+- hw->phy.ops.read_reg(hw, HV_COLC_UPPER, &phy_data);
+- hw->phy.ops.read_reg(hw, HV_COLC_LOWER, &phy_data);
+- hw->phy.ops.read_reg(hw, HV_DC_UPPER, &phy_data);
+- hw->phy.ops.read_reg(hw, HV_DC_LOWER, &phy_data);
+- hw->phy.ops.read_reg(hw, HV_TNCRS_UPPER, &phy_data);
+- hw->phy.ops.read_reg(hw, HV_TNCRS_LOWER, &phy_data);
++ e1e_rphy(hw, HV_SCC_UPPER, &phy_data);
++ e1e_rphy(hw, HV_SCC_LOWER, &phy_data);
++ e1e_rphy(hw, HV_ECOL_UPPER, &phy_data);
++ e1e_rphy(hw, HV_ECOL_LOWER, &phy_data);
++ e1e_rphy(hw, HV_MCC_UPPER, &phy_data);
++ e1e_rphy(hw, HV_MCC_LOWER, &phy_data);
++ e1e_rphy(hw, HV_LATECOL_UPPER, &phy_data);
++ e1e_rphy(hw, HV_LATECOL_LOWER, &phy_data);
++ e1e_rphy(hw, HV_COLC_UPPER, &phy_data);
++ e1e_rphy(hw, HV_COLC_LOWER, &phy_data);
++ e1e_rphy(hw, HV_DC_UPPER, &phy_data);
++ e1e_rphy(hw, HV_DC_LOWER, &phy_data);
++ e1e_rphy(hw, HV_TNCRS_UPPER, &phy_data);
++ e1e_rphy(hw, HV_TNCRS_LOWER, &phy_data);
+ }
+ }
+
+diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c
+index 7e55170..ff28721 100644
+--- a/drivers/net/e1000e/lib.c
++++ b/drivers/net/e1000e/lib.c
+@@ -1135,7 +1135,8 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw)
+ ret_val = e1e_rphy(hw, PHY_AUTONEG_ADV, &mii_nway_adv_reg);
+ if (ret_val)
+ return ret_val;
+- ret_val = e1e_rphy(hw, PHY_LP_ABILITY, &mii_nway_lp_ability_reg);
++ ret_val =
++ e1e_rphy(hw, PHY_LP_ABILITY, &mii_nway_lp_ability_reg);
+ if (ret_val)
+ return ret_val;
+
+diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c
+index 4d6c57e..00f89e8 100644
+--- a/drivers/net/e1000e/phy.c
++++ b/drivers/net/e1000e/phy.c
+@@ -637,12 +637,11 @@ s32 e1000e_write_kmrn_reg_locked(struct e1000_hw *hw, u32 offset, u16 data)
+ **/
+ s32 e1000_copper_link_setup_82577(struct e1000_hw *hw)
+ {
+- struct e1000_phy_info *phy = &hw->phy;
+ s32 ret_val;
+ u16 phy_data;
+
+ /* Enable CRS on TX. This must be set for half-duplex operation. */
+- ret_val = phy->ops.read_reg(hw, I82577_CFG_REG, &phy_data);
++ ret_val = e1e_rphy(hw, I82577_CFG_REG, &phy_data);
+ if (ret_val)
+ goto out;
+
+@@ -651,7 +650,7 @@ s32 e1000_copper_link_setup_82577(struct e1000_hw *hw)
+ /* Enable downshift */
+ phy_data |= I82577_CFG_ENABLE_DOWNSHIFT;
+
+- ret_val = phy->ops.write_reg(hw, I82577_CFG_REG, phy_data);
++ ret_val = e1e_wphy(hw, I82577_CFG_REG, phy_data);
+
+ out:
+ return ret_val;
+@@ -774,16 +773,14 @@ s32 e1000e_copper_link_setup_m88(struct e1000_hw *hw)
+ }
+
+ if (phy->type == e1000_phy_82578) {
+- ret_val = phy->ops.read_reg(hw, M88E1000_EXT_PHY_SPEC_CTRL,
+- &phy_data);
++ ret_val = e1e_rphy(hw, M88E1000_EXT_PHY_SPEC_CTRL, &phy_data);
+ if (ret_val)
+ return ret_val;
+
+ /* 82578 PHY - set the downshift count to 1x. */
+ phy_data |= I82578_EPSCR_DOWNSHIFT_ENABLE;
+ phy_data &= ~I82578_EPSCR_DOWNSHIFT_COUNTER_MASK;
+- ret_val = phy->ops.write_reg(hw, M88E1000_EXT_PHY_SPEC_CTRL,
+- phy_data);
++ ret_val = e1e_wphy(hw, M88E1000_EXT_PHY_SPEC_CTRL, phy_data);
+ if (ret_val)
+ return ret_val;
+ }
+@@ -1319,9 +1316,8 @@ s32 e1000e_phy_force_speed_duplex_m88(struct e1000_hw *hw)
+ * We didn't get link.
+ * Reset the DSP and cross our fingers.
+ */
+- ret_val = e1e_wphy(hw,
+- M88E1000_PHY_PAGE_SELECT,
+- 0x001d);
++ ret_val = e1e_wphy(hw, M88E1000_PHY_PAGE_SELECT,
++ 0x001d);
+ if (ret_val)
+ return ret_val;
+ ret_val = e1000e_phy_reset_dsp(hw);
+@@ -3071,12 +3067,12 @@ s32 e1000_link_stall_workaround_hv(struct e1000_hw *hw)
+ goto out;
+
+ /* Do not apply workaround if in PHY loopback bit 14 set */
+- hw->phy.ops.read_reg(hw, PHY_CONTROL, &data);
++ e1e_rphy(hw, PHY_CONTROL, &data);
+ if (data & PHY_CONTROL_LB)
+ goto out;
+
+ /* check if link is up and at 1Gbps */
+- ret_val = hw->phy.ops.read_reg(hw, BM_CS_STATUS, &data);
++ ret_val = e1e_rphy(hw, BM_CS_STATUS, &data);
+ if (ret_val)
+ goto out;
+
+@@ -3092,14 +3088,12 @@ s32 e1000_link_stall_workaround_hv(struct e1000_hw *hw)
+ mdelay(200);
+
+ /* flush the packets in the fifo buffer */
+- ret_val = hw->phy.ops.write_reg(hw, HV_MUX_DATA_CTRL,
+- HV_MUX_DATA_CTRL_GEN_TO_MAC |
+- HV_MUX_DATA_CTRL_FORCE_SPEED);
++ ret_val = e1e_wphy(hw, HV_MUX_DATA_CTRL, HV_MUX_DATA_CTRL_GEN_TO_MAC |
++ HV_MUX_DATA_CTRL_FORCE_SPEED);
+ if (ret_val)
+ goto out;
+
+- ret_val = hw->phy.ops.write_reg(hw, HV_MUX_DATA_CTRL,
+- HV_MUX_DATA_CTRL_GEN_TO_MAC);
++ ret_val = e1e_wphy(hw, HV_MUX_DATA_CTRL, HV_MUX_DATA_CTRL_GEN_TO_MAC);
+
+ out:
+ return ret_val;
+@@ -3119,7 +3113,7 @@ s32 e1000_check_polarity_82577(struct e1000_hw *hw)
+ s32 ret_val;
+ u16 data;
+
+- ret_val = phy->ops.read_reg(hw, I82577_PHY_STATUS_2, &data);
++ ret_val = e1e_rphy(hw, I82577_PHY_STATUS_2, &data);
+
+ if (!ret_val)
+ phy->cable_polarity = (data & I82577_PHY_STATUS2_REV_POLARITY)
+@@ -3142,13 +3136,13 @@ s32 e1000_phy_force_speed_duplex_82577(struct e1000_hw *hw)
+ u16 phy_data;
+ bool link;
+
+- ret_val = phy->ops.read_reg(hw, PHY_CONTROL, &phy_data);
++ ret_val = e1e_rphy(hw, PHY_CONTROL, &phy_data);
+ if (ret_val)
+ goto out;
+
+ e1000e_phy_force_speed_duplex_setup(hw, &phy_data);
+
+- ret_val = phy->ops.write_reg(hw, PHY_CONTROL, phy_data);
++ ret_val = e1e_wphy(hw, PHY_CONTROL, phy_data);
+ if (ret_val)
+ goto out;
+
+@@ -3212,7 +3206,7 @@ s32 e1000_get_phy_info_82577(struct e1000_hw *hw)
+ if (ret_val)
+ goto out;
+
+- ret_val = phy->ops.read_reg(hw, I82577_PHY_STATUS_2, &data);
++ ret_val = e1e_rphy(hw, I82577_PHY_STATUS_2, &data);
+ if (ret_val)
+ goto out;
+
+@@ -3224,7 +3218,7 @@ s32 e1000_get_phy_info_82577(struct e1000_hw *hw)
+ if (ret_val)
+ goto out;
+
+- ret_val = phy->ops.read_reg(hw, PHY_1000T_STATUS, &data);
++ ret_val = e1e_rphy(hw, PHY_1000T_STATUS, &data);
+ if (ret_val)
+ goto out;
+
+@@ -3258,7 +3252,7 @@ s32 e1000_get_cable_length_82577(struct e1000_hw *hw)
+ s32 ret_val;
+ u16 phy_data, length;
+
+- ret_val = phy->ops.read_reg(hw, I82577_PHY_DIAG_STATUS, &phy_data);
++ ret_val = e1e_rphy(hw, I82577_PHY_DIAG_STATUS, &phy_data);
+ if (ret_val)
+ goto out;
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0158-e1000e-properly-bounds-check-string-functions.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0158-e1000e-properly-bounds-check-string-functions.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,77 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Thu, 6 Jan 2011 14:29:50 +0000
+Subject: [PATCH 158/166] e1000e: properly bounds-check string functions
+
+commit e0dc4f125456e57347a6d016bd7209f064135b1d upstream.
+
+Use string functions with bounds checking rather than their non-bounds
+checking counterparts, and do not hard code these boundaries.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Emil Tantilov <emil.s.tantilov at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/ethtool.c | 14 +++++++++-----
+ drivers/net/e1000e/netdev.c | 4 ++--
+ 2 files changed, 11 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
+index 66a2f8b..be45070 100644
+--- a/drivers/net/e1000e/ethtool.c
++++ b/drivers/net/e1000e/ethtool.c
+@@ -638,20 +638,24 @@ static void e1000_get_drvinfo(struct net_device *netdev,
+ struct e1000_adapter *adapter = netdev_priv(netdev);
+ char firmware_version[32];
+
+- strncpy(drvinfo->driver, e1000e_driver_name, 32);
+- strncpy(drvinfo->version, e1000e_driver_version, 32);
++ strncpy(drvinfo->driver, e1000e_driver_name,
++ sizeof(drvinfo->driver) - 1);
++ strncpy(drvinfo->version, e1000e_driver_version,
++ sizeof(drvinfo->version) - 1);
+
+ /*
+ * EEPROM image version # is reported as firmware version # for
+ * PCI-E controllers
+ */
+- sprintf(firmware_version, "%d.%d-%d",
++ snprintf(firmware_version, sizeof(firmware_version), "%d.%d-%d",
+ (adapter->eeprom_vers & 0xF000) >> 12,
+ (adapter->eeprom_vers & 0x0FF0) >> 4,
+ (adapter->eeprom_vers & 0x000F));
+
+- strncpy(drvinfo->fw_version, firmware_version, 32);
+- strncpy(drvinfo->bus_info, pci_name(adapter->pdev), 32);
++ strncpy(drvinfo->fw_version, firmware_version,
++ sizeof(drvinfo->fw_version) - 1);
++ strncpy(drvinfo->bus_info, pci_name(adapter->pdev),
++ sizeof(drvinfo->bus_info) - 1);
+ drvinfo->regdump_len = e1000_get_regs_len(netdev);
+ drvinfo->eedump_len = e1000_get_eeprom_len(netdev);
+ }
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index ac84075..6b54f4e 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -5642,7 +5642,7 @@ static void e1000_print_device_info(struct e1000_adapter *adapter)
+ ret_val = e1000_read_pba_string_generic(hw, pba_str,
+ E1000_PBANUM_LENGTH);
+ if (ret_val)
+- strcpy(pba_str, "Unknown");
++ strncpy((char *)pba_str, "Unknown", sizeof(pba_str) - 1);
+ e_info("MAC: %d, PHY: %d, PBA No: %s\n",
+ hw->mac.type, hw->phy.type, pba_str);
+ }
+@@ -5972,7 +5972,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
+ if (!(adapter->flags & FLAG_HAS_AMT))
+ e1000_get_hw_control(adapter);
+
+- strcpy(netdev->name, "eth%d");
++ strncpy(netdev->name, "eth%d", sizeof(netdev->name) - 1);
+ err = register_netdev(netdev);
+ if (err)
+ goto err_register;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0159-e1000e-use-either_crc_le-rather-than-re-write-it.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0159-e1000e-use-either_crc_le-rather-than-re-write-it.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,70 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Thu, 6 Jan 2011 14:29:51 +0000
+Subject: [PATCH 159/166] e1000e: use either_crc_le() rather than re-write it
+
+commit fe46f58fa61f025564a3c1e80b789885cb4b0f30 upstream.
+
+For the 82579 jumbo frame workaround, there is no need to re-write the CRC
+calculation functionality already found in the kernel's ether_crc_le().
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Jeff Pieper <jeffrey.e.pieper at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/e1000.h | 1 +
+ drivers/net/e1000e/ich8lan.c | 19 +------------------
+ 2 files changed, 2 insertions(+), 18 deletions(-)
+
+diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
+index 2c913b8..4b3802a 100644
+--- a/drivers/net/e1000e/e1000.h
++++ b/drivers/net/e1000e/e1000.h
+@@ -38,6 +38,7 @@
+ #include <linux/netdevice.h>
+ #include <linux/pci.h>
+ #include <linux/pci-aspm.h>
++#include <linux/crc32.h>
+
+ #include "hw.h"
+
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index 5759545..5bb65b7 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -1395,22 +1395,6 @@ void e1000_copy_rx_addrs_to_phy_ich8lan(struct e1000_hw *hw)
+ }
+ }
+
+-static u32 e1000_calc_rx_da_crc(u8 mac[])
+-{
+- u32 poly = 0xEDB88320; /* Polynomial for 802.3 CRC calculation */
+- u32 i, j, mask, crc;
+-
+- crc = 0xffffffff;
+- for (i = 0; i < 6; i++) {
+- crc = crc ^ mac[i];
+- for (j = 8; j > 0; j--) {
+- mask = (crc & 1) * (-1);
+- crc = (crc >> 1) ^ (poly & mask);
+- }
+- }
+- return ~crc;
+-}
+-
+ /**
+ * e1000_lv_jumbo_workaround_ich8lan - required for jumbo frame operation
+ * with 82579 PHY
+@@ -1453,8 +1437,7 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable)
+ mac_addr[4] = (addr_high & 0xFF);
+ mac_addr[5] = ((addr_high >> 8) & 0xFF);
+
+- ew32(PCH_RAICC(i),
+- e1000_calc_rx_da_crc(mac_addr));
++ ew32(PCH_RAICC(i), ~ether_crc_le(ETH_ALEN, mac_addr));
+ }
+
+ /* Write Rx addresses to the PHY */
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0160-e1000e-power-off-PHY-after-reset-when-interface-is-d.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0160-e1000e-power-off-PHY-after-reset-when-interface-is-d.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,300 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Thu, 6 Jan 2011 14:29:52 +0000
+Subject: [PATCH 160/166] e1000e: power off PHY after reset when interface is
+ down
+
+commit 31dbe5b4ac6fca72dec946e4d0fa7f0913f1d9b1 upstream.
+
+Some Phys supported by the driver do not remain powered off across a reset
+of the device when the interface is down, e.g. on 82571, but not on 82574.
+This patch powers down (only when WoL is disabled) the PHY after a reset if
+the interface is down and the ethtool diagnostics are not currently running.
+
+The ethtool diagnostic function required a minor re-factor as a result, and
+the e1000_[get|put]_hw_control() functions are renamed since they are no
+longer static to netdev.c as they are needed by the ethtool diagnostics.
+A couple minor whitespace issues were cleaned up, too.
+
+Reported-by: Arthur Jones <ajones at riverbed.com>
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Jeff Pieper <jeffrey.e.pieper at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Adjust context for omitted pm_qos changes]
+---
+ drivers/net/e1000e/e1000.h | 2 +
+ drivers/net/e1000e/ethtool.c | 40 ++++++++++++++++++++++-------------
+ drivers/net/e1000e/netdev.c | 46 +++++++++++++++++++++++------------------
+ 3 files changed, 53 insertions(+), 35 deletions(-)
+
+diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
+index 4b3802a..5255be7 100644
+--- a/drivers/net/e1000e/e1000.h
++++ b/drivers/net/e1000e/e1000.h
+@@ -497,6 +497,8 @@ extern void e1000e_free_tx_resources(struct e1000_adapter *adapter);
+ extern void e1000e_update_stats(struct e1000_adapter *adapter);
+ extern void e1000e_set_interrupt_capability(struct e1000_adapter *adapter);
+ extern void e1000e_reset_interrupt_capability(struct e1000_adapter *adapter);
++extern void e1000e_get_hw_control(struct e1000_adapter *adapter);
++extern void e1000e_release_hw_control(struct e1000_adapter *adapter);
+ extern void e1000e_disable_aspm(struct pci_dev *pdev, u16 state);
+
+ extern unsigned int copybreak;
+diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
+index be45070..7c8d745 100644
+--- a/drivers/net/e1000e/ethtool.c
++++ b/drivers/net/e1000e/ethtool.c
+@@ -1722,6 +1722,19 @@ static void e1000_diag_test(struct net_device *netdev,
+ bool if_running = netif_running(netdev);
+
+ set_bit(__E1000_TESTING, &adapter->state);
++
++ if (!if_running) {
++ /* Get control of and reset hardware */
++ if (adapter->flags & FLAG_HAS_AMT)
++ e1000e_get_hw_control(adapter);
++
++ e1000e_power_up_phy(adapter);
++
++ adapter->hw.phy.autoneg_wait_to_complete = 1;
++ e1000e_reset(adapter);
++ adapter->hw.phy.autoneg_wait_to_complete = 0;
++ }
++
+ if (eth_test->flags == ETH_TEST_FL_OFFLINE) {
+ /* Offline tests */
+
+@@ -1735,8 +1748,6 @@ static void e1000_diag_test(struct net_device *netdev,
+ if (if_running)
+ /* indicate we're in test mode */
+ dev_close(netdev);
+- else
+- e1000e_reset(adapter);
+
+ if (e1000_reg_test(adapter, &data[0]))
+ eth_test->flags |= ETH_TEST_FL_FAILED;
+@@ -1750,8 +1761,6 @@ static void e1000_diag_test(struct net_device *netdev,
+ eth_test->flags |= ETH_TEST_FL_FAILED;
+
+ e1000e_reset(adapter);
+- /* make sure the phy is powered up */
+- e1000e_power_up_phy(adapter);
+ if (e1000_loopback_test(adapter, &data[3]))
+ eth_test->flags |= ETH_TEST_FL_FAILED;
+
+@@ -1773,28 +1782,29 @@ static void e1000_diag_test(struct net_device *netdev,
+ if (if_running)
+ dev_open(netdev);
+ } else {
+- if (!if_running && (adapter->flags & FLAG_HAS_AMT)) {
+- clear_bit(__E1000_TESTING, &adapter->state);
+- dev_open(netdev);
+- set_bit(__E1000_TESTING, &adapter->state);
+- }
++ /* Online tests */
+
+ e_info("online testing starting\n");
+- /* Online tests */
+- if (e1000_link_test(adapter, &data[4]))
+- eth_test->flags |= ETH_TEST_FL_FAILED;
+
+- /* Online tests aren't run; pass by default */
++ /* register, eeprom, intr and loopback tests not run online */
+ data[0] = 0;
+ data[1] = 0;
+ data[2] = 0;
+ data[3] = 0;
+
+- if (!if_running && (adapter->flags & FLAG_HAS_AMT))
+- dev_close(netdev);
++ if (e1000_link_test(adapter, &data[4]))
++ eth_test->flags |= ETH_TEST_FL_FAILED;
+
+ clear_bit(__E1000_TESTING, &adapter->state);
+ }
++
++ if (!if_running) {
++ e1000e_reset(adapter);
++
++ if (adapter->flags & FLAG_HAS_AMT)
++ e1000e_release_hw_control(adapter);
++ }
++
+ msleep_interruptible(4 * 1000);
+ }
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 6b54f4e..25f9173 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -1979,15 +1979,15 @@ static void e1000_irq_enable(struct e1000_adapter *adapter)
+ }
+
+ /**
+- * e1000_get_hw_control - get control of the h/w from f/w
++ * e1000e_get_hw_control - get control of the h/w from f/w
+ * @adapter: address of board private structure
+ *
+- * e1000_get_hw_control sets {CTRL_EXT|SWSM}:DRV_LOAD bit.
++ * e1000e_get_hw_control sets {CTRL_EXT|SWSM}:DRV_LOAD bit.
+ * For ASF and Pass Through versions of f/w this means that
+ * the driver is loaded. For AMT version (only with 82573)
+ * of the f/w this means that the network i/f is open.
+ **/
+-static void e1000_get_hw_control(struct e1000_adapter *adapter)
++void e1000e_get_hw_control(struct e1000_adapter *adapter)
+ {
+ struct e1000_hw *hw = &adapter->hw;
+ u32 ctrl_ext;
+@@ -2004,16 +2004,16 @@ static void e1000_get_hw_control(struct e1000_adapter *adapter)
+ }
+
+ /**
+- * e1000_release_hw_control - release control of the h/w to f/w
++ * e1000e_release_hw_control - release control of the h/w to f/w
+ * @adapter: address of board private structure
+ *
+- * e1000_release_hw_control resets {CTRL_EXT|SWSM}:DRV_LOAD bit.
++ * e1000e_release_hw_control resets {CTRL_EXT|SWSM}:DRV_LOAD bit.
+ * For ASF and Pass Through versions of f/w this means that the
+ * driver is no longer loaded. For AMT version (only with 82573) i
+ * of the f/w this means that the network i/f is closed.
+ *
+ **/
+-static void e1000_release_hw_control(struct e1000_adapter *adapter)
++void e1000e_release_hw_control(struct e1000_adapter *adapter)
+ {
+ struct e1000_hw *hw = &adapter->hw;
+ u32 ctrl_ext;
+@@ -2446,7 +2446,7 @@ static void e1000_vlan_rx_kill_vid(struct net_device *netdev, u16 vid)
+ E1000_MNG_DHCP_COOKIE_STATUS_VLAN) &&
+ (vid == adapter->mng_vlan_id)) {
+ /* release control to f/w */
+- e1000_release_hw_control(adapter);
++ e1000e_release_hw_control(adapter);
+ return;
+ }
+
+@@ -3189,7 +3189,6 @@ void e1000e_reset(struct e1000_adapter *adapter)
+ ew32(PBA, pba);
+ }
+
+-
+ /*
+ * flow control settings
+ *
+@@ -3277,7 +3276,7 @@ void e1000e_reset(struct e1000_adapter *adapter)
+ * that the network interface is in control
+ */
+ if (adapter->flags & FLAG_HAS_AMT)
+- e1000_get_hw_control(adapter);
++ e1000e_get_hw_control(adapter);
+
+ ew32(WUC, 0);
+
+@@ -3290,6 +3289,13 @@ void e1000e_reset(struct e1000_adapter *adapter)
+ ew32(VET, ETH_P_8021Q);
+
+ e1000e_reset_adaptive(hw);
++
++ if (!netif_running(adapter->netdev) &&
++ !test_bit(__E1000_TESTING, &adapter->state)) {
++ e1000_power_down_phy(adapter);
++ return;
++ }
++
+ e1000_get_phy_info(hw);
+
+ if ((adapter->flags & FLAG_HAS_SMART_POWER_DOWN) &&
+@@ -3587,7 +3593,7 @@ static int e1000_open(struct net_device *netdev)
+ * interface is now open and reset the part to a known state.
+ */
+ if (adapter->flags & FLAG_HAS_AMT) {
+- e1000_get_hw_control(adapter);
++ e1000e_get_hw_control(adapter);
+ e1000e_reset(adapter);
+ }
+
+@@ -3644,7 +3650,7 @@ static int e1000_open(struct net_device *netdev)
+ return 0;
+
+ err_req_irq:
+- e1000_release_hw_control(adapter);
++ e1000e_release_hw_control(adapter);
+ e1000_power_down_phy(adapter);
+ e1000e_free_rx_resources(adapter);
+ err_setup_rx:
+@@ -3699,8 +3705,9 @@ static int e1000_close(struct net_device *netdev)
+ * If AMT is enabled, let the firmware know that the network
+ * interface is now closed
+ */
+- if (adapter->flags & FLAG_HAS_AMT)
+- e1000_release_hw_control(adapter);
++ if ((adapter->flags & FLAG_HAS_AMT) &&
++ !test_bit(__E1000_TESTING, &adapter->state))
++ e1000e_release_hw_control(adapter);
+
+ pm_runtime_put_sync(&pdev->dev);
+
+@@ -5215,7 +5222,7 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool *enable_wake,
+ * Release control of h/w to f/w. If f/w is AMT enabled, this
+ * would have already happened in close and is redundant.
+ */
+- e1000_release_hw_control(adapter);
++ e1000e_release_hw_control(adapter);
+
+ pci_disable_device(pdev);
+
+@@ -5372,7 +5379,7 @@ static int __e1000_resume(struct pci_dev *pdev)
+ * under the control of the driver.
+ */
+ if (!(adapter->flags & FLAG_HAS_AMT))
+- e1000_get_hw_control(adapter);
++ e1000e_get_hw_control(adapter);
+
+ return 0;
+ }
+@@ -5619,7 +5626,7 @@ static void e1000_io_resume(struct pci_dev *pdev)
+ * under the control of the driver.
+ */
+ if (!(adapter->flags & FLAG_HAS_AMT))
+- e1000_get_hw_control(adapter);
++ e1000e_get_hw_control(adapter);
+
+ }
+
+@@ -5970,7 +5977,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
+ * under the control of the driver.
+ */
+ if (!(adapter->flags & FLAG_HAS_AMT))
+- e1000_get_hw_control(adapter);
++ e1000e_get_hw_control(adapter);
+
+ strncpy(netdev->name, "eth%d", sizeof(netdev->name) - 1);
+ err = register_netdev(netdev);
+@@ -5992,12 +5999,11 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
+
+ err_register:
+ if (!(adapter->flags & FLAG_HAS_AMT))
+- e1000_release_hw_control(adapter);
++ e1000e_release_hw_control(adapter);
+ err_eeprom:
+ if (!e1000_check_reset_block(&adapter->hw))
+ e1000_phy_hw_reset(&adapter->hw);
+ err_hw_init:
+-
+ kfree(adapter->tx_ring);
+ kfree(adapter->rx_ring);
+ err_sw_init:
+@@ -6068,7 +6074,7 @@ static void __devexit e1000_remove(struct pci_dev *pdev)
+ * Release control of h/w to f/w. If f/w is AMT enabled, this
+ * would have already happened in close and is redundant.
+ */
+- e1000_release_hw_control(adapter);
++ e1000e_release_hw_control(adapter);
+
+ e1000e_reset_interrupt_capability(adapter);
+ kfree(adapter->tx_ring);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0161-e1000e-add-custom-set_d-0-3-_lplu_state-function-poi.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0161-e1000e-add-custom-set_d-0-3-_lplu_state-function-poi.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,115 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Thu, 6 Jan 2011 14:29:53 +0000
+Subject: [PATCH 161/166] e1000e: add custom set_d[0|3]_lplu_state function
+ pointer for 82574
+
+commit 77996d1d4c1cf0059f5c2d1cea9d5135ac1b8c91 upstream.
+
+82574 needs to configure Low Power Link Up (or LPLU) differently than
+the other parts in the 8257x family supported by the driver.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Emil Tantilov <emil.s.tantilov at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/e1000e/82571.c | 56 ++++++++++++++++++++++++++++++++++++++++++++
+ drivers/net/e1000e/hw.h | 1 +
+ 2 files changed, 57 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+index bbcac4d..1397da1 100644
+--- a/drivers/net/e1000e/82571.c
++++ b/drivers/net/e1000e/82571.c
+@@ -78,6 +78,8 @@ static void e1000_power_down_phy_copper_82571(struct e1000_hw *hw);
+ static void e1000_put_hw_semaphore_82573(struct e1000_hw *hw);
+ static s32 e1000_get_hw_semaphore_82574(struct e1000_hw *hw);
+ static void e1000_put_hw_semaphore_82574(struct e1000_hw *hw);
++static s32 e1000_set_d0_lplu_state_82574(struct e1000_hw *hw, bool active);
++static s32 e1000_set_d3_lplu_state_82574(struct e1000_hw *hw, bool active);
+
+ /**
+ * e1000_init_phy_params_82571 - Init PHY func ptrs.
+@@ -113,6 +115,8 @@ static s32 e1000_init_phy_params_82571(struct e1000_hw *hw)
+ phy->type = e1000_phy_bm;
+ phy->ops.acquire = e1000_get_hw_semaphore_82574;
+ phy->ops.release = e1000_put_hw_semaphore_82574;
++ phy->ops.set_d0_lplu_state = e1000_set_d0_lplu_state_82574;
++ phy->ops.set_d3_lplu_state = e1000_set_d3_lplu_state_82574;
+ break;
+ default:
+ return -E1000_ERR_PHY;
+@@ -656,6 +660,58 @@ static void e1000_put_hw_semaphore_82574(struct e1000_hw *hw)
+ }
+
+ /**
++ * e1000_set_d0_lplu_state_82574 - Set Low Power Linkup D0 state
++ * @hw: pointer to the HW structure
++ * @active: true to enable LPLU, false to disable
++ *
++ * Sets the LPLU D0 state according to the active flag.
++ * LPLU will not be activated unless the
++ * device autonegotiation advertisement meets standards of
++ * either 10 or 10/100 or 10/100/1000 at all duplexes.
++ * This is a function pointer entry point only called by
++ * PHY setup routines.
++ **/
++static s32 e1000_set_d0_lplu_state_82574(struct e1000_hw *hw, bool active)
++{
++ u16 data = er32(POEMB);
++
++ if (active)
++ data |= E1000_PHY_CTRL_D0A_LPLU;
++ else
++ data &= ~E1000_PHY_CTRL_D0A_LPLU;
++
++ ew32(POEMB, data);
++ return 0;
++}
++
++/**
++ * e1000_set_d3_lplu_state_82574 - Sets low power link up state for D3
++ * @hw: pointer to the HW structure
++ * @active: boolean used to enable/disable lplu
++ *
++ * The low power link up (lplu) state is set to the power management level D3
++ * when active is true, else clear lplu for D3. LPLU
++ * is used during Dx states where the power conservation is most important.
++ * During driver activity, SmartSpeed should be enabled so performance is
++ * maintained.
++ **/
++static s32 e1000_set_d3_lplu_state_82574(struct e1000_hw *hw, bool active)
++{
++ u16 data = er32(POEMB);
++
++ if (!active) {
++ data &= ~E1000_PHY_CTRL_NOND0A_LPLU;
++ } else if ((hw->phy.autoneg_advertised == E1000_ALL_SPEED_DUPLEX) ||
++ (hw->phy.autoneg_advertised == E1000_ALL_NOT_GIG) ||
++ (hw->phy.autoneg_advertised == E1000_ALL_10_SPEED)) {
++ data |= E1000_PHY_CTRL_NOND0A_LPLU;
++ }
++
++ ew32(POEMB, data);
++ return 0;
++}
++
++/**
+ * e1000_acquire_nvm_82571 - Request for access to the EEPROM
+ * @hw: pointer to the HW structure
+ *
+diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h
+index ba302a5..e774380 100644
+--- a/drivers/net/e1000e/hw.h
++++ b/drivers/net/e1000e/hw.h
+@@ -83,6 +83,7 @@ enum e1e_registers {
+ E1000_EXTCNF_CTRL = 0x00F00, /* Extended Configuration Control */
+ E1000_EXTCNF_SIZE = 0x00F08, /* Extended Configuration Size */
+ E1000_PHY_CTRL = 0x00F10, /* PHY Control Register in CSR */
++#define E1000_POEMB E1000_PHY_CTRL /* PHY OEM Bits */
+ E1000_PBA = 0x01000, /* Packet Buffer Allocation - RW */
+ E1000_PBS = 0x01008, /* Packet Buffer Size */
+ E1000_EEMNGCTL = 0x01010, /* MNG EEprom Control */
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0162-e1000e-update-Copyright-for-2011.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0162-e1000e-update-Copyright-for-2011.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,192 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Tue, 4 Jan 2011 01:16:44 +0000
+Subject: [PATCH 162/166] e1000e: update Copyright for 2011
+
+commit 0d6057e48b9d2004024e97252da83dce0661b131 upstream.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Jeff Pieper <jeffrey.e.pieper at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+---
+ drivers/net/e1000e/82571.c | 2 +-
+ drivers/net/e1000e/Makefile | 2 +-
+ drivers/net/e1000e/defines.h | 2 +-
+ drivers/net/e1000e/e1000.h | 2 +-
+ drivers/net/e1000e/es2lan.c | 2 +-
+ drivers/net/e1000e/ethtool.c | 2 +-
+ drivers/net/e1000e/hw.h | 2 +-
+ drivers/net/e1000e/ich8lan.c | 2 +-
+ drivers/net/e1000e/lib.c | 2 +-
+ drivers/net/e1000e/netdev.c | 4 ++--
+ drivers/net/e1000e/param.c | 2 +-
+ drivers/net/e1000e/phy.c | 2 +-
+ 12 files changed, 13 insertions(+), 13 deletions(-)
+
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+index 1397da1..7122218 100644
+--- a/drivers/net/e1000e/82571.c
++++ b/drivers/net/e1000e/82571.c
+@@ -1,7 +1,7 @@
+ /*******************************************************************************
+
+ Intel PRO/1000 Linux driver
+- Copyright(c) 1999 - 2010 Intel Corporation.
++ Copyright(c) 1999 - 2011 Intel Corporation.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+diff --git a/drivers/net/e1000e/Makefile b/drivers/net/e1000e/Makefile
+index 360c913..28519ac 100644
+--- a/drivers/net/e1000e/Makefile
++++ b/drivers/net/e1000e/Makefile
+@@ -1,7 +1,7 @@
+ ################################################################################
+ #
+ # Intel PRO/1000 Linux driver
+-# Copyright(c) 1999 - 2008 Intel Corporation.
++# Copyright(c) 1999 - 2011 Intel Corporation.
+ #
+ # This program is free software; you can redistribute it and/or modify it
+ # under the terms and conditions of the GNU General Public License,
+diff --git a/drivers/net/e1000e/defines.h b/drivers/net/e1000e/defines.h
+index 7245dc2..1314998 100644
+--- a/drivers/net/e1000e/defines.h
++++ b/drivers/net/e1000e/defines.h
+@@ -1,7 +1,7 @@
+ /*******************************************************************************
+
+ Intel PRO/1000 Linux driver
+- Copyright(c) 1999 - 2010 Intel Corporation.
++ Copyright(c) 1999 - 2011 Intel Corporation.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
+index 5255be7..e610e13 100644
+--- a/drivers/net/e1000e/e1000.h
++++ b/drivers/net/e1000e/e1000.h
+@@ -1,7 +1,7 @@
+ /*******************************************************************************
+
+ Intel PRO/1000 Linux driver
+- Copyright(c) 1999 - 2010 Intel Corporation.
++ Copyright(c) 1999 - 2011 Intel Corporation.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+diff --git a/drivers/net/e1000e/es2lan.c b/drivers/net/e1000e/es2lan.c
+index e45a61c..2fefa82 100644
+--- a/drivers/net/e1000e/es2lan.c
++++ b/drivers/net/e1000e/es2lan.c
+@@ -1,7 +1,7 @@
+ /*******************************************************************************
+
+ Intel PRO/1000 Linux driver
+- Copyright(c) 1999 - 2010 Intel Corporation.
++ Copyright(c) 1999 - 2011 Intel Corporation.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
+index 7c8d745..6f0f415 100644
+--- a/drivers/net/e1000e/ethtool.c
++++ b/drivers/net/e1000e/ethtool.c
+@@ -1,7 +1,7 @@
+ /*******************************************************************************
+
+ Intel PRO/1000 Linux driver
+- Copyright(c) 1999 - 2010 Intel Corporation.
++ Copyright(c) 1999 - 2011 Intel Corporation.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h
+index e774380..efdbb28 100644
+--- a/drivers/net/e1000e/hw.h
++++ b/drivers/net/e1000e/hw.h
+@@ -1,7 +1,7 @@
+ /*******************************************************************************
+
+ Intel PRO/1000 Linux driver
+- Copyright(c) 1999 - 2010 Intel Corporation.
++ Copyright(c) 1999 - 2011 Intel Corporation.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index 5bb65b7..fb46974 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -1,7 +1,7 @@
+ /*******************************************************************************
+
+ Intel PRO/1000 Linux driver
+- Copyright(c) 1999 - 2010 Intel Corporation.
++ Copyright(c) 1999 - 2011 Intel Corporation.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c
+index ff28721..1c98dfa 100644
+--- a/drivers/net/e1000e/lib.c
++++ b/drivers/net/e1000e/lib.c
+@@ -1,7 +1,7 @@
+ /*******************************************************************************
+
+ Intel PRO/1000 Linux driver
+- Copyright(c) 1999 - 2010 Intel Corporation.
++ Copyright(c) 1999 - 2011 Intel Corporation.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 25f9173..3a54b34 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -1,7 +1,7 @@
+ /*******************************************************************************
+
+ Intel PRO/1000 Linux driver
+- Copyright(c) 1999 - 2010 Intel Corporation.
++ Copyright(c) 1999 - 2011 Intel Corporation.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+@@ -6207,7 +6207,7 @@ static int __init e1000_init_module(void)
+ int ret;
+ pr_info("Intel(R) PRO/1000 Network Driver - %s\n",
+ e1000e_driver_version);
+- pr_info("Copyright (c) 1999 - 2010 Intel Corporation.\n");
++ pr_info("Copyright(c) 1999 - 2011 Intel Corporation.\n");
+ ret = pci_register_driver(&e1000_driver);
+
+ return ret;
+diff --git a/drivers/net/e1000e/param.c b/drivers/net/e1000e/param.c
+index a9612b0..d6f618d 100644
+--- a/drivers/net/e1000e/param.c
++++ b/drivers/net/e1000e/param.c
+@@ -1,7 +1,7 @@
+ /*******************************************************************************
+
+ Intel PRO/1000 Linux driver
+- Copyright(c) 1999 - 2010 Intel Corporation.
++ Copyright(c) 1999 - 2011 Intel Corporation.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c
+index 00f89e8..6857d21 100644
+--- a/drivers/net/e1000e/phy.c
++++ b/drivers/net/e1000e/phy.c
+@@ -1,7 +1,7 @@
+ /*******************************************************************************
+
+ Intel PRO/1000 Linux driver
+- Copyright(c) 1999 - 2010 Intel Corporation.
++ Copyright(c) 1999 - 2011 Intel Corporation.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0163-e1000e-consistent-use-of-Rx-Tx-vs.-RX-TX-rx-tx-in-co.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0163-e1000e-consistent-use-of-Rx-Tx-vs.-RX-TX-rx-tx-in-co.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,674 @@
+From: Bruce Allan <bruce.w.allan at intel.com>
+Date: Fri, 31 Dec 2010 06:10:01 +0000
+Subject: [PATCH 163/166] e1000e: consistent use of Rx/Tx vs. RX/TX/rx/tx in
+ comments/logs
+
+commit af667a29dd3dfc0464f83bac30cc3c63fe5d0206 upstream.
+
+Some minor comment errors and whitespace issues discovered while looking
+into this are also addressed.
+
+Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Jeff Pieper <jeffrey.e.pieper at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+[bwh: Drop change to pm_qos configuration]
+---
+ drivers/net/e1000e/82571.c | 2 +-
+ drivers/net/e1000e/hw.h | 2 +-
+ drivers/net/e1000e/lib.c | 18 ++--
+ drivers/net/e1000e/netdev.c | 213 ++++++++++++++++++++++---------------------
+ drivers/net/e1000e/param.c | 4 +-
+ drivers/net/e1000e/phy.c | 2 +-
+ 6 files changed, 123 insertions(+), 118 deletions(-)
+
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+index 7122218..89a6903 100644
+--- a/drivers/net/e1000e/82571.c
++++ b/drivers/net/e1000e/82571.c
+@@ -1310,7 +1310,7 @@ static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw)
+ * apply workaround for hardware errata documented in errata
+ * docs Fixes issue where some error prone or unreliable PCIe
+ * completions are occurring, particularly with ASPM enabled.
+- * Without fix, issue can cause tx timeouts.
++ * Without fix, issue can cause Tx timeouts.
+ */
+ reg = er32(GCR2);
+ reg |= 1;
+diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h
+index efdbb28..bc0860a 100644
+--- a/drivers/net/e1000e/hw.h
++++ b/drivers/net/e1000e/hw.h
+@@ -102,7 +102,7 @@ enum e1e_registers {
+ E1000_RDTR = 0x02820, /* Rx Delay Timer - RW */
+ E1000_RXDCTL_BASE = 0x02828, /* Rx Descriptor Control - RW */
+ #define E1000_RXDCTL(_n) (E1000_RXDCTL_BASE + (_n << 8))
+- E1000_RADV = 0x0282C, /* RX Interrupt Absolute Delay Timer - RW */
++ E1000_RADV = 0x0282C, /* Rx Interrupt Absolute Delay Timer - RW */
+
+ /* Convenience macros
+ *
+diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c
+index 1c98dfa..68aa174 100644
+--- a/drivers/net/e1000e/lib.c
++++ b/drivers/net/e1000e/lib.c
+@@ -533,7 +533,7 @@ s32 e1000e_check_for_fiber_link(struct e1000_hw *hw)
+ mac->autoneg_failed = 1;
+ return 0;
+ }
+- e_dbg("NOT RXing /C/, disable AutoNeg and force link.\n");
++ e_dbg("NOT Rx'ing /C/, disable AutoNeg and force link.\n");
+
+ /* Disable auto-negotiation in the TXCW register */
+ ew32(TXCW, (mac->txcw & ~E1000_TXCW_ANE));
+@@ -556,7 +556,7 @@ s32 e1000e_check_for_fiber_link(struct e1000_hw *hw)
+ * and disable forced link in the Device Control register
+ * in an attempt to auto-negotiate with our link partner.
+ */
+- e_dbg("RXing /C/, enable AutoNeg and stop forcing link.\n");
++ e_dbg("Rx'ing /C/, enable AutoNeg and stop forcing link.\n");
+ ew32(TXCW, mac->txcw);
+ ew32(CTRL, (ctrl & ~E1000_CTRL_SLU));
+
+@@ -598,7 +598,7 @@ s32 e1000e_check_for_serdes_link(struct e1000_hw *hw)
+ mac->autoneg_failed = 1;
+ return 0;
+ }
+- e_dbg("NOT RXing /C/, disable AutoNeg and force link.\n");
++ e_dbg("NOT Rx'ing /C/, disable AutoNeg and force link.\n");
+
+ /* Disable auto-negotiation in the TXCW register */
+ ew32(TXCW, (mac->txcw & ~E1000_TXCW_ANE));
+@@ -621,7 +621,7 @@ s32 e1000e_check_for_serdes_link(struct e1000_hw *hw)
+ * and disable forced link in the Device Control register
+ * in an attempt to auto-negotiate with our link partner.
+ */
+- e_dbg("RXing /C/, enable AutoNeg and stop forcing link.\n");
++ e_dbg("Rx'ing /C/, enable AutoNeg and stop forcing link.\n");
+ ew32(TXCW, mac->txcw);
+ ew32(CTRL, (ctrl & ~E1000_CTRL_SLU));
+
+@@ -800,9 +800,9 @@ static s32 e1000_commit_fc_settings_generic(struct e1000_hw *hw)
+ * The possible values of the "fc" parameter are:
+ * 0: Flow control is completely disabled
+ * 1: Rx flow control is enabled (we can receive pause frames,
+- * but not send pause frames).
++ * but not send pause frames).
+ * 2: Tx flow control is enabled (we can send pause frames but we
+- * do not support receiving pause frames).
++ * do not support receiving pause frames).
+ * 3: Both Rx and Tx flow control (symmetric) are enabled.
+ */
+ switch (hw->fc.current_mode) {
+@@ -1031,9 +1031,9 @@ s32 e1000e_force_mac_fc(struct e1000_hw *hw)
+ * The possible values of the "fc" parameter are:
+ * 0: Flow control is completely disabled
+ * 1: Rx flow control is enabled (we can receive pause
+- * frames but not send pause frames).
++ * frames but not send pause frames).
+ * 2: Tx flow control is enabled (we can send pause frames
+- * frames but we do not receive pause frames).
++ * frames but we do not receive pause frames).
+ * 3: Both Rx and Tx flow control (symmetric) is enabled.
+ * other: No other values should be possible at this point.
+ */
+@@ -1189,7 +1189,7 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw)
+ } else {
+ hw->fc.current_mode = e1000_fc_rx_pause;
+ e_dbg("Flow Control = "
+- "RX PAUSE frames only.\r\n");
++ "Rx PAUSE frames only.\r\n");
+ }
+ }
+ /*
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 3a54b34..768e5da 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -77,17 +77,17 @@ struct e1000_reg_info {
+ char *name;
+ };
+
+-#define E1000_RDFH 0x02410 /* Rx Data FIFO Head - RW */
+-#define E1000_RDFT 0x02418 /* Rx Data FIFO Tail - RW */
+-#define E1000_RDFHS 0x02420 /* Rx Data FIFO Head Saved - RW */
+-#define E1000_RDFTS 0x02428 /* Rx Data FIFO Tail Saved - RW */
+-#define E1000_RDFPC 0x02430 /* Rx Data FIFO Packet Count - RW */
+-
+-#define E1000_TDFH 0x03410 /* Tx Data FIFO Head - RW */
+-#define E1000_TDFT 0x03418 /* Tx Data FIFO Tail - RW */
+-#define E1000_TDFHS 0x03420 /* Tx Data FIFO Head Saved - RW */
+-#define E1000_TDFTS 0x03428 /* Tx Data FIFO Tail Saved - RW */
+-#define E1000_TDFPC 0x03430 /* Tx Data FIFO Packet Count - RW */
++#define E1000_RDFH 0x02410 /* Rx Data FIFO Head - RW */
++#define E1000_RDFT 0x02418 /* Rx Data FIFO Tail - RW */
++#define E1000_RDFHS 0x02420 /* Rx Data FIFO Head Saved - RW */
++#define E1000_RDFTS 0x02428 /* Rx Data FIFO Tail Saved - RW */
++#define E1000_RDFPC 0x02430 /* Rx Data FIFO Packet Count - RW */
++
++#define E1000_TDFH 0x03410 /* Tx Data FIFO Head - RW */
++#define E1000_TDFT 0x03418 /* Tx Data FIFO Tail - RW */
++#define E1000_TDFHS 0x03420 /* Tx Data FIFO Head Saved - RW */
++#define E1000_TDFTS 0x03428 /* Tx Data FIFO Tail Saved - RW */
++#define E1000_TDFPC 0x03430 /* Tx Data FIFO Packet Count - RW */
+
+ static const struct e1000_reg_info e1000_reg_info_tbl[] = {
+
+@@ -99,7 +99,7 @@ static const struct e1000_reg_info e1000_reg_info_tbl[] = {
+ /* Interrupt Registers */
+ {E1000_ICR, "ICR"},
+
+- /* RX Registers */
++ /* Rx Registers */
+ {E1000_RCTL, "RCTL"},
+ {E1000_RDLEN, "RDLEN"},
+ {E1000_RDH, "RDH"},
+@@ -115,7 +115,7 @@ static const struct e1000_reg_info e1000_reg_info_tbl[] = {
+ {E1000_RDFTS, "RDFTS"},
+ {E1000_RDFPC, "RDFPC"},
+
+- /* TX Registers */
++ /* Tx Registers */
+ {E1000_TCTL, "TCTL"},
+ {E1000_TDBAL, "TDBAL"},
+ {E1000_TDBAH, "TDBAH"},
+@@ -160,7 +160,7 @@ static void e1000_regdump(struct e1000_hw *hw, struct e1000_reg_info *reginfo)
+ break;
+ default:
+ printk(KERN_INFO "%-15s %08x\n",
+- reginfo->name, __er32(hw, reginfo->ofs));
++ reginfo->name, __er32(hw, reginfo->ofs));
+ return;
+ }
+
+@@ -171,9 +171,8 @@ static void e1000_regdump(struct e1000_hw *hw, struct e1000_reg_info *reginfo)
+ printk(KERN_CONT "\n");
+ }
+
+-
+ /*
+- * e1000e_dump - Print registers, tx-ring and rx-ring
++ * e1000e_dump - Print registers, Tx-ring and Rx-ring
+ */
+ static void e1000e_dump(struct e1000_adapter *adapter)
+ {
+@@ -182,12 +181,20 @@ static void e1000e_dump(struct e1000_adapter *adapter)
+ struct e1000_reg_info *reginfo;
+ struct e1000_ring *tx_ring = adapter->tx_ring;
+ struct e1000_tx_desc *tx_desc;
+- struct my_u0 { u64 a; u64 b; } *u0;
++ struct my_u0 {
++ u64 a;
++ u64 b;
++ } *u0;
+ struct e1000_buffer *buffer_info;
+ struct e1000_ring *rx_ring = adapter->rx_ring;
+ union e1000_rx_desc_packet_split *rx_desc_ps;
+ struct e1000_rx_desc *rx_desc;
+- struct my_u1 { u64 a; u64 b; u64 c; u64 d; } *u1;
++ struct my_u1 {
++ u64 a;
++ u64 b;
++ u64 c;
++ u64 d;
++ } *u1;
+ u32 staterr;
+ int i = 0;
+
+@@ -198,12 +205,10 @@ static void e1000e_dump(struct e1000_adapter *adapter)
+ if (netdev) {
+ dev_info(&adapter->pdev->dev, "Net device Info\n");
+ printk(KERN_INFO "Device Name state "
+- "trans_start last_rx\n");
++ "trans_start last_rx\n");
+ printk(KERN_INFO "%-15s %016lX %016lX %016lX\n",
+- netdev->name,
+- netdev->state,
+- netdev->trans_start,
+- netdev->last_rx);
++ netdev->name, netdev->state, netdev->trans_start,
++ netdev->last_rx);
+ }
+
+ /* Print Registers */
+@@ -214,26 +219,26 @@ static void e1000e_dump(struct e1000_adapter *adapter)
+ e1000_regdump(hw, reginfo);
+ }
+
+- /* Print TX Ring Summary */
++ /* Print Tx Ring Summary */
+ if (!netdev || !netif_running(netdev))
+ goto exit;
+
+- dev_info(&adapter->pdev->dev, "TX Rings Summary\n");
++ dev_info(&adapter->pdev->dev, "Tx Ring Summary\n");
+ printk(KERN_INFO "Queue [NTU] [NTC] [bi(ntc)->dma ]"
+- " leng ntw timestamp\n");
++ " leng ntw timestamp\n");
+ buffer_info = &tx_ring->buffer_info[tx_ring->next_to_clean];
+ printk(KERN_INFO " %5d %5X %5X %016llX %04X %3X %016llX\n",
+- 0, tx_ring->next_to_use, tx_ring->next_to_clean,
+- (unsigned long long)buffer_info->dma,
+- buffer_info->length,
+- buffer_info->next_to_watch,
+- (unsigned long long)buffer_info->time_stamp);
++ 0, tx_ring->next_to_use, tx_ring->next_to_clean,
++ (unsigned long long)buffer_info->dma,
++ buffer_info->length,
++ buffer_info->next_to_watch,
++ (unsigned long long)buffer_info->time_stamp);
+
+- /* Print TX Rings */
++ /* Print Tx Ring */
+ if (!netif_msg_tx_done(adapter))
+ goto rx_ring_summary;
+
+- dev_info(&adapter->pdev->dev, "TX Rings Dump\n");
++ dev_info(&adapter->pdev->dev, "Tx Ring Dump\n");
+
+ /* Transmit Descriptor Formats - DEXT[29] is 0 (Legacy) or 1 (Extended)
+ *
+@@ -263,22 +268,22 @@ static void e1000e_dump(struct e1000_adapter *adapter)
+ * 63 48 47 40 39 36 35 32 31 24 23 20 19 0
+ */
+ printk(KERN_INFO "Tl[desc] [address 63:0 ] [SpeCssSCmCsLen]"
+- " [bi->dma ] leng ntw timestamp bi->skb "
+- "<-- Legacy format\n");
++ " [bi->dma ] leng ntw timestamp bi->skb "
++ "<-- Legacy format\n");
+ printk(KERN_INFO "Tc[desc] [Ce CoCsIpceCoS] [MssHlRSCm0Plen]"
+- " [bi->dma ] leng ntw timestamp bi->skb "
+- "<-- Ext Context format\n");
++ " [bi->dma ] leng ntw timestamp bi->skb "
++ "<-- Ext Context format\n");
+ printk(KERN_INFO "Td[desc] [address 63:0 ] [VlaPoRSCm1Dlen]"
+- " [bi->dma ] leng ntw timestamp bi->skb "
+- "<-- Ext Data format\n");
++ " [bi->dma ] leng ntw timestamp bi->skb "
++ "<-- Ext Data format\n");
+ for (i = 0; tx_ring->desc && (i < tx_ring->count); i++) {
+ tx_desc = E1000_TX_DESC(*tx_ring, i);
+ buffer_info = &tx_ring->buffer_info[i];
+ u0 = (struct my_u0 *)tx_desc;
+ printk(KERN_INFO "T%c[0x%03X] %016llX %016llX %016llX "
+- "%04X %3X %016llX %p",
+- (!(le64_to_cpu(u0->b) & (1<<29)) ? 'l' :
+- ((le64_to_cpu(u0->b) & (1<<20)) ? 'd' : 'c')), i,
++ "%04X %3X %016llX %p",
++ (!(le64_to_cpu(u0->b) & (1 << 29)) ? 'l' :
++ ((le64_to_cpu(u0->b) & (1 << 20)) ? 'd' : 'c')), i,
+ (unsigned long long)le64_to_cpu(u0->a),
+ (unsigned long long)le64_to_cpu(u0->b),
+ (unsigned long long)buffer_info->dma,
+@@ -296,22 +301,22 @@ static void e1000e_dump(struct e1000_adapter *adapter)
+
+ if (netif_msg_pktdata(adapter) && buffer_info->dma != 0)
+ print_hex_dump(KERN_INFO, "", DUMP_PREFIX_ADDRESS,
+- 16, 1, phys_to_virt(buffer_info->dma),
+- buffer_info->length, true);
++ 16, 1, phys_to_virt(buffer_info->dma),
++ buffer_info->length, true);
+ }
+
+- /* Print RX Rings Summary */
++ /* Print Rx Ring Summary */
+ rx_ring_summary:
+- dev_info(&adapter->pdev->dev, "RX Rings Summary\n");
++ dev_info(&adapter->pdev->dev, "Rx Ring Summary\n");
+ printk(KERN_INFO "Queue [NTU] [NTC]\n");
+ printk(KERN_INFO " %5d %5X %5X\n", 0,
+- rx_ring->next_to_use, rx_ring->next_to_clean);
++ rx_ring->next_to_use, rx_ring->next_to_clean);
+
+- /* Print RX Rings */
++ /* Print Rx Ring */
+ if (!netif_msg_rx_status(adapter))
+ goto exit;
+
+- dev_info(&adapter->pdev->dev, "RX Rings Dump\n");
++ dev_info(&adapter->pdev->dev, "Rx Ring Dump\n");
+ switch (adapter->rx_ps_pages) {
+ case 1:
+ case 2:
+@@ -329,7 +334,7 @@ rx_ring_summary:
+ * +-----------------------------------------------------+
+ */
+ printk(KERN_INFO "R [desc] [buffer 0 63:0 ] "
+- "[buffer 1 63:0 ] "
++ "[buffer 1 63:0 ] "
+ "[buffer 2 63:0 ] [buffer 3 63:0 ] [bi->dma ] "
+ "[bi->skb] <-- Ext Pkt Split format\n");
+ /* [Extended] Receive Descriptor (Write-Back) Format
+@@ -344,7 +349,7 @@ rx_ring_summary:
+ * 63 48 47 32 31 20 19 0
+ */
+ printk(KERN_INFO "RWB[desc] [ck ipid mrqhsh] "
+- "[vl l0 ee es] "
++ "[vl l0 ee es] "
+ "[ l3 l2 l1 hs] [reserved ] ---------------- "
+ "[bi->skb] <-- Ext Rx Write-Back format\n");
+ for (i = 0; i < rx_ring->count; i++) {
+@@ -352,26 +357,26 @@ rx_ring_summary:
+ rx_desc_ps = E1000_RX_DESC_PS(*rx_ring, i);
+ u1 = (struct my_u1 *)rx_desc_ps;
+ staterr =
+- le32_to_cpu(rx_desc_ps->wb.middle.status_error);
++ le32_to_cpu(rx_desc_ps->wb.middle.status_error);
+ if (staterr & E1000_RXD_STAT_DD) {
+ /* Descriptor Done */
+ printk(KERN_INFO "RWB[0x%03X] %016llX "
+- "%016llX %016llX %016llX "
+- "---------------- %p", i,
+- (unsigned long long)le64_to_cpu(u1->a),
+- (unsigned long long)le64_to_cpu(u1->b),
+- (unsigned long long)le64_to_cpu(u1->c),
+- (unsigned long long)le64_to_cpu(u1->d),
+- buffer_info->skb);
++ "%016llX %016llX %016llX "
++ "---------------- %p", i,
++ (unsigned long long)le64_to_cpu(u1->a),
++ (unsigned long long)le64_to_cpu(u1->b),
++ (unsigned long long)le64_to_cpu(u1->c),
++ (unsigned long long)le64_to_cpu(u1->d),
++ buffer_info->skb);
+ } else {
+ printk(KERN_INFO "R [0x%03X] %016llX "
+- "%016llX %016llX %016llX %016llX %p", i,
+- (unsigned long long)le64_to_cpu(u1->a),
+- (unsigned long long)le64_to_cpu(u1->b),
+- (unsigned long long)le64_to_cpu(u1->c),
+- (unsigned long long)le64_to_cpu(u1->d),
+- (unsigned long long)buffer_info->dma,
+- buffer_info->skb);
++ "%016llX %016llX %016llX %016llX %p", i,
++ (unsigned long long)le64_to_cpu(u1->a),
++ (unsigned long long)le64_to_cpu(u1->b),
++ (unsigned long long)le64_to_cpu(u1->c),
++ (unsigned long long)le64_to_cpu(u1->d),
++ (unsigned long long)buffer_info->dma,
++ buffer_info->skb);
+
+ if (netif_msg_pktdata(adapter))
+ print_hex_dump(KERN_INFO, "",
+@@ -400,18 +405,18 @@ rx_ring_summary:
+ * 63 48 47 40 39 32 31 16 15 0
+ */
+ printk(KERN_INFO "Rl[desc] [address 63:0 ] "
+- "[vl er S cks ln] [bi->dma ] [bi->skb] "
+- "<-- Legacy format\n");
++ "[vl er S cks ln] [bi->dma ] [bi->skb] "
++ "<-- Legacy format\n");
+ for (i = 0; rx_ring->desc && (i < rx_ring->count); i++) {
+ rx_desc = E1000_RX_DESC(*rx_ring, i);
+ buffer_info = &rx_ring->buffer_info[i];
+ u0 = (struct my_u0 *)rx_desc;
+ printk(KERN_INFO "Rl[0x%03X] %016llX %016llX "
+- "%016llX %p", i,
+- (unsigned long long)le64_to_cpu(u0->a),
+- (unsigned long long)le64_to_cpu(u0->b),
+- (unsigned long long)buffer_info->dma,
+- buffer_info->skb);
++ "%016llX %p", i,
++ (unsigned long long)le64_to_cpu(u0->a),
++ (unsigned long long)le64_to_cpu(u0->b),
++ (unsigned long long)buffer_info->dma,
++ buffer_info->skb);
+ if (i == rx_ring->next_to_use)
+ printk(KERN_CONT " NTU\n");
+ else if (i == rx_ring->next_to_clean)
+@@ -421,9 +426,10 @@ rx_ring_summary:
+
+ if (netif_msg_pktdata(adapter))
+ print_hex_dump(KERN_INFO, "",
+- DUMP_PREFIX_ADDRESS,
+- 16, 1, phys_to_virt(buffer_info->dma),
+- adapter->rx_buffer_len, true);
++ DUMP_PREFIX_ADDRESS,
++ 16, 1,
++ phys_to_virt(buffer_info->dma),
++ adapter->rx_buffer_len, true);
+ }
+ }
+
+@@ -450,8 +456,7 @@ static int e1000_desc_unused(struct e1000_ring *ring)
+ * @skb: pointer to sk_buff to be indicated to stack
+ **/
+ static void e1000_receive_skb(struct e1000_adapter *adapter,
+- struct net_device *netdev,
+- struct sk_buff *skb,
++ struct net_device *netdev, struct sk_buff *skb,
+ u8 status, __le16 vlan)
+ {
+ skb->protocol = eth_type_trans(skb, netdev);
+@@ -464,7 +469,7 @@ static void e1000_receive_skb(struct e1000_adapter *adapter,
+ }
+
+ /**
+- * e1000_rx_checksum - Receive Checksum Offload for 82543
++ * e1000_rx_checksum - Receive Checksum Offload
+ * @adapter: board private structure
+ * @status_err: receive descriptor status and error fields
+ * @csum: receive descriptor csum field
+@@ -547,7 +552,7 @@ map_skb:
+ adapter->rx_buffer_len,
+ DMA_FROM_DEVICE);
+ if (dma_mapping_error(&pdev->dev, buffer_info->dma)) {
+- dev_err(&pdev->dev, "RX DMA map failed\n");
++ dev_err(&pdev->dev, "Rx DMA map failed\n");
+ adapter->rx_dma_failed++;
+ break;
+ }
+@@ -600,7 +605,8 @@ static void e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter,
+ ps_page = &buffer_info->ps_pages[j];
+ if (j >= adapter->rx_ps_pages) {
+ /* all unused desc entries get hw null ptr */
+- rx_desc->read.buffer_addr[j+1] = ~cpu_to_le64(0);
++ rx_desc->read.buffer_addr[j + 1] =
++ ~cpu_to_le64(0);
+ continue;
+ }
+ if (!ps_page->page) {
+@@ -616,7 +622,7 @@ static void e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter,
+ if (dma_mapping_error(&pdev->dev,
+ ps_page->dma)) {
+ dev_err(&adapter->pdev->dev,
+- "RX DMA page map failed\n");
++ "Rx DMA page map failed\n");
+ adapter->rx_dma_failed++;
+ goto no_buffers;
+ }
+@@ -626,8 +632,8 @@ static void e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter,
+ * didn't change because each write-back
+ * erases this info.
+ */
+- rx_desc->read.buffer_addr[j+1] =
+- cpu_to_le64(ps_page->dma);
++ rx_desc->read.buffer_addr[j + 1] =
++ cpu_to_le64(ps_page->dma);
+ }
+
+ skb = netdev_alloc_skb_ip_align(netdev,
+@@ -643,7 +649,7 @@ static void e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter,
+ adapter->rx_ps_bsize0,
+ DMA_FROM_DEVICE);
+ if (dma_mapping_error(&pdev->dev, buffer_info->dma)) {
+- dev_err(&pdev->dev, "RX DMA map failed\n");
++ dev_err(&pdev->dev, "Rx DMA map failed\n");
+ adapter->rx_dma_failed++;
+ /* cleanup skb */
+ dev_kfree_skb_any(skb);
+@@ -661,7 +667,7 @@ static void e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter,
+ * such as IA-64).
+ */
+ wmb();
+- writel(i<<1, adapter->hw.hw_addr + rx_ring->tail);
++ writel(i << 1, adapter->hw.hw_addr + rx_ring->tail);
+ }
+
+ i++;
+@@ -1105,11 +1111,10 @@ static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
+ cleaned = 1;
+ cleaned_count++;
+ dma_unmap_single(&pdev->dev, buffer_info->dma,
+- adapter->rx_ps_bsize0,
+- DMA_FROM_DEVICE);
++ adapter->rx_ps_bsize0, DMA_FROM_DEVICE);
+ buffer_info->dma = 0;
+
+- /* see !EOP comment in other rx routine */
++ /* see !EOP comment in other Rx routine */
+ if (!(staterr & E1000_RXD_STAT_EOP))
+ adapter->flags2 |= FLAG2_IS_DISCARDING;
+
+@@ -2611,7 +2616,7 @@ static void e1000_init_manageability_pt(struct e1000_adapter *adapter)
+ }
+
+ /**
+- * e1000_configure_tx - Configure 8254x Transmit Unit after Reset
++ * e1000_configure_tx - Configure Transmit Unit after Reset
+ * @adapter: board private structure
+ *
+ * Configure the Tx unit of the MAC after a reset.
+@@ -2664,7 +2669,7 @@ static void e1000_configure_tx(struct e1000_adapter *adapter)
+ * hthresh = 1 ==> prefetch when one or more available
+ * pthresh = 0x1f ==> prefetch if internal cache 31 or less
+ * BEWARE: this seems to work but should be considered first if
+- * there are tx hangs or other tx related bugs
++ * there are Tx hangs or other Tx related bugs
+ */
+ txdctl |= E1000_TXDCTL_DMA_BURST_ENABLE;
+ ew32(TXDCTL(0), txdctl);
+@@ -2878,7 +2883,7 @@ static void e1000_configure_rx(struct e1000_adapter *adapter)
+ if (adapter->rx_ps_pages) {
+ /* this is a 32 byte descriptor */
+ rdlen = rx_ring->count *
+- sizeof(union e1000_rx_desc_packet_split);
++ sizeof(union e1000_rx_desc_packet_split);
+ adapter->clean_rx = e1000_clean_rx_irq_ps;
+ adapter->alloc_rx_buf = e1000_alloc_rx_buffers_ps;
+ } else if (adapter->netdev->mtu > ETH_FRAME_LEN + ETH_FCS_LEN) {
+@@ -2901,7 +2906,7 @@ static void e1000_configure_rx(struct e1000_adapter *adapter)
+ /*
+ * set the writeback threshold (only takes effect if the RDTR
+ * is set). set GRAN=1 and write back up to 0x4 worth, and
+- * enable prefetching of 0x20 rx descriptors
++ * enable prefetching of 0x20 Rx descriptors
+ * granularity = 01
+ * wthresh = 04,
+ * hthresh = 04,
+@@ -3154,7 +3159,7 @@ void e1000e_reset(struct e1000_adapter *adapter)
+ /* lower 16 bits has Rx packet buffer allocation size in KB */
+ pba &= 0xffff;
+ /*
+- * the Tx fifo also stores 16 bytes of information about the tx
++ * the Tx fifo also stores 16 bytes of information about the Tx
+ * but don't include ethernet FCS because hardware appends it
+ */
+ min_tx_space = (adapter->max_frame_size +
+@@ -3177,7 +3182,7 @@ void e1000e_reset(struct e1000_adapter *adapter)
+ pba -= min_tx_space - tx_space;
+
+ /*
+- * if short on Rx space, Rx wins and must trump tx
++ * if short on Rx space, Rx wins and must trump Tx
+ * adjustment or use Early Receive if available
+ */
+ if ((pba < min_rx_space) &&
+@@ -4042,11 +4047,11 @@ static void e1000_print_link_info(struct e1000_adapter *adapter)
+ adapter->netdev->name,
+ adapter->link_speed,
+ (adapter->link_duplex == FULL_DUPLEX) ?
+- "Full Duplex" : "Half Duplex",
++ "Full Duplex" : "Half Duplex",
+ ((ctrl & E1000_CTRL_TFCE) && (ctrl & E1000_CTRL_RFCE)) ?
+- "RX/TX" :
+- ((ctrl & E1000_CTRL_RFCE) ? "RX" :
+- ((ctrl & E1000_CTRL_TFCE) ? "TX" : "None" )));
++ "Rx/Tx" :
++ ((ctrl & E1000_CTRL_RFCE) ? "Rx" :
++ ((ctrl & E1000_CTRL_TFCE) ? "Tx" : "None")));
+ }
+
+ static bool e1000e_has_link(struct e1000_adapter *adapter)
+@@ -4341,7 +4346,7 @@ link_up:
+ /* Force detection of hung controller every watchdog period */
+ adapter->detect_tx_hung = 1;
+
+- /* flush partial descriptors to memory before detecting tx hang */
++ /* flush partial descriptors to memory before detecting Tx hang */
+ if (adapter->flags2 & FLAG2_DMA_BURST) {
+ ew32(TIDV, adapter->tx_int_delay | E1000_TIDV_FPD);
+ ew32(RDTR, adapter->rx_int_delay | E1000_RDTR_FPD);
+@@ -4532,7 +4537,7 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
+ buffer_info->next_to_watch = i;
+ buffer_info->dma = dma_map_single(&pdev->dev,
+ skb->data + offset,
+- size, DMA_TO_DEVICE);
++ size, DMA_TO_DEVICE);
+ buffer_info->mapped_as_page = false;
+ if (dma_mapping_error(&pdev->dev, buffer_info->dma))
+ goto dma_error;
+@@ -4579,7 +4584,7 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
+ }
+ }
+
+- segs = skb_shinfo(skb)->gso_segs ?: 1;
++ segs = skb_shinfo(skb)->gso_segs ? : 1;
+ /* multiply data chunks by size of headers */
+ bytecount = ((segs - 1) * skb_headlen(skb)) + skb->len;
+
+@@ -4591,13 +4596,13 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
+ return count;
+
+ dma_error:
+- dev_err(&pdev->dev, "TX DMA map failed\n");
++ dev_err(&pdev->dev, "Tx DMA map failed\n");
+ buffer_info->dma = 0;
+ if (count)
+ count--;
+
+ while (count--) {
+- if (i==0)
++ if (i == 0)
+ i += tx_ring->count;
+ i--;
+ buffer_info = &tx_ring->buffer_info[i];
+diff --git a/drivers/net/e1000e/param.c b/drivers/net/e1000e/param.c
+index d6f618d..4dd9b63 100644
+--- a/drivers/net/e1000e/param.c
++++ b/drivers/net/e1000e/param.c
+@@ -62,10 +62,9 @@ MODULE_PARM_DESC(copybreak,
+ module_param_array_named(X, X, int, &num_##X, 0); \
+ MODULE_PARM_DESC(X, desc);
+
+-
+ /*
+ * Transmit Interrupt Delay in units of 1.024 microseconds
+- * Tx interrupt delay needs to typically be set to something non zero
++ * Tx interrupt delay needs to typically be set to something non-zero
+ *
+ * Valid Range: 0-65535
+ */
+@@ -112,6 +111,7 @@ E1000_PARAM(InterruptThrottleRate, "Interrupt Throttling Rate");
+ #define DEFAULT_ITR 3
+ #define MAX_ITR 100000
+ #define MIN_ITR 100
++
+ /* IntMode (Interrupt Mode)
+ *
+ * Valid Range: 0 - 2
+diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c
+index 6857d21..6bea051 100644
+--- a/drivers/net/e1000e/phy.c
++++ b/drivers/net/e1000e/phy.c
+@@ -640,7 +640,7 @@ s32 e1000_copper_link_setup_82577(struct e1000_hw *hw)
+ s32 ret_val;
+ u16 phy_data;
+
+- /* Enable CRS on TX. This must be set for half-duplex operation. */
++ /* Enable CRS on Tx. This must be set for half-duplex operation. */
+ ret_val = e1e_rphy(hw, I82577_CFG_REG, &phy_data);
+ if (ret_val)
+ goto out;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0164-e1000e-tx_timeout-should-not-increment-for-non-hang-.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0164-e1000e-tx_timeout-should-not-increment-for-non-hang-.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,37 @@
+From: Jesse Brandeburg <jesse.brandeburg at intel.com>
+Date: Wed, 2 Feb 2011 10:19:55 +0000
+Subject: [PATCH 164/166] e1000e: tx_timeout should not increment for non-hang
+ events
+
+commit 463342741222c79469303cdab8ce99c8bc2d80e8 upstream.
+
+Currently the driver increments the tx_timeout counter (an error counter)
+when simply resetting the part with outstanding transmit work pending.
+This is an unnecessary count of an error, when all we should be doing is
+just resetting the part and discarding the transmits. With this change the
+only increment of tx_timeout is when the stack calls the watchdog reset
+function due to a true Tx timeout.
+
+Signed-off-by: Jesse Brandeburg <jesse.brandeburg at intel.com>
+Reviewed-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Jeff Pieper <jeffrey.e.pieper at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+---
+ drivers/net/e1000e/netdev.c | 1 -
+ 1 files changed, 0 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 768e5da..f5b6872 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -4314,7 +4314,6 @@ link_up:
+ * to get done, so reset controller to flush Tx.
+ * (Do the reset outside of interrupt context).
+ */
+- adapter->tx_timeout_count++;
+ schedule_work(&adapter->reset_task);
+ /* return immediately since reset is imminent */
+ return;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0165-e1000e-check-down-flag-in-tasks.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0165-e1000e-check-down-flag-in-tasks.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,86 @@
+From: Jesse Brandeburg <jesse.brandeburg at intel.com>
+Date: Wed, 2 Feb 2011 10:19:45 +0000
+Subject: [PATCH 165/166] e1000e: check down flag in tasks
+
+commit 615b32af9730def64330e4c0c95c973e90bd9c6d upstream.
+
+This change is part of a fix to avoid any tasks running while the driver is
+exiting and deinitializing resources.
+
+Signed-off-by: Jesse Brandeburg <jesse.brandeburg at intel.com>
+Tested-by: Jeff Pieper <jeffrey.e.pieper at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+---
+ drivers/net/e1000e/netdev.c | 21 +++++++++++++++++++++
+ 1 files changed, 21 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index f5b6872..de8de8d 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -936,6 +936,9 @@ static void e1000_print_hw_hang(struct work_struct *work)
+ u16 phy_status, phy_1000t_status, phy_ext_status;
+ u16 pci_status;
+
++ if (test_bit(__E1000_DOWN, &adapter->state))
++ return;
++
+ e1e_rphy(hw, PHY_STATUS, &phy_status);
+ e1e_rphy(hw, PHY_1000T_STATUS, &phy_1000t_status);
+ e1e_rphy(hw, PHY_EXT_STATUS, &phy_ext_status);
+@@ -1505,6 +1508,9 @@ static void e1000e_downshift_workaround(struct work_struct *work)
+ struct e1000_adapter *adapter = container_of(work,
+ struct e1000_adapter, downshift_task);
+
++ if (test_bit(__E1000_DOWN, &adapter->state))
++ return;
++
+ e1000e_gig_downshift_workaround_ich8lan(&adapter->hw);
+ }
+
+@@ -3770,6 +3776,10 @@ static void e1000e_update_phy_task(struct work_struct *work)
+ {
+ struct e1000_adapter *adapter = container_of(work,
+ struct e1000_adapter, update_phy_task);
++
++ if (test_bit(__E1000_DOWN, &adapter->state))
++ return;
++
+ e1000_get_phy_info(&adapter->hw);
+ }
+
+@@ -3780,6 +3790,10 @@ static void e1000e_update_phy_task(struct work_struct *work)
+ static void e1000_update_phy_info(unsigned long data)
+ {
+ struct e1000_adapter *adapter = (struct e1000_adapter *) data;
++
++ if (test_bit(__E1000_DOWN, &adapter->state))
++ return;
++
+ schedule_work(&adapter->update_phy_task);
+ }
+
+@@ -4154,6 +4168,9 @@ static void e1000_watchdog_task(struct work_struct *work)
+ u32 link, tctl;
+ int tx_pending = 0;
+
++ if (test_bit(__E1000_DOWN, &adapter->state))
++ return;
++
+ link = e1000e_has_link(adapter);
+ if ((netif_carrier_ok(netdev)) && link) {
+ /* Cancel scheduled suspend requests. */
+@@ -4892,6 +4909,10 @@ static void e1000_reset_task(struct work_struct *work)
+ struct e1000_adapter *adapter;
+ adapter = container_of(work, struct e1000_adapter, reset_task);
+
++ /* don't run the task if already down */
++ if (test_bit(__E1000_DOWN, &adapter->state))
++ return;
++
+ if (!((adapter->flags & FLAG_RX_NEEDS_RESTART) &&
+ (adapter->flags & FLAG_RX_RESTART_NOW))) {
+ e1000e_dump(adapter);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0166-e1000e-flush-all-writebacks-before-unload.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/e1000e/0166-e1000e-flush-all-writebacks-before-unload.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,84 @@
+From: Jesse Brandeburg <jesse.brandeburg at intel.com>
+Date: Wed, 2 Feb 2011 10:19:50 +0000
+Subject: [PATCH 166/166] e1000e: flush all writebacks before unload
+
+commit 713b3c9e4c1a6da6b45da6474ed554ed0a48de69 upstream.
+
+The driver was not flushing all writebacks before unloading, possibly
+causing memory to be written by the hardware after the driver had
+reinitialized the rings.
+
+This adds missing functionality to flush any pending writebacks and is
+called in all spots where descriptors should be completed before the driver
+begins processing.
+
+Signed-off-by: Jesse Brandeburg <jesse.brandeburg at intel.com>
+Reviewed-by: Bruce Allan <bruce.w.allan at intel.com>
+Tested-by: Jeff Pieper <jeffrey.e.pieper at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+---
+ drivers/net/e1000e/netdev.c | 31 +++++++++++++++++++++----------
+ 1 files changed, 21 insertions(+), 10 deletions(-)
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index de8de8d..dcdc472 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -3355,6 +3355,21 @@ int e1000e_up(struct e1000_adapter *adapter)
+ return 0;
+ }
+
++static void e1000e_flush_descriptors(struct e1000_adapter *adapter)
++{
++ struct e1000_hw *hw = &adapter->hw;
++
++ if (!(adapter->flags2 & FLAG2_DMA_BURST))
++ return;
++
++ /* flush pending descriptor writebacks to memory */
++ ew32(TIDV, adapter->tx_int_delay | E1000_TIDV_FPD);
++ ew32(RDTR, adapter->rx_int_delay | E1000_RDTR_FPD);
++
++ /* execute the writes immediately */
++ e1e_flush();
++}
++
+ void e1000e_down(struct e1000_adapter *adapter)
+ {
+ struct net_device *netdev = adapter->netdev;
+@@ -3394,6 +3409,9 @@ void e1000e_down(struct e1000_adapter *adapter)
+
+ if (!pci_channel_offline(adapter->pdev))
+ e1000e_reset(adapter);
++
++ e1000e_flush_descriptors(adapter);
++
+ e1000_clean_tx_ring(adapter);
+ e1000_clean_rx_ring(adapter);
+
+@@ -4359,19 +4377,12 @@ link_up:
+ else
+ ew32(ICS, E1000_ICS_RXDMT0);
+
++ /* flush pending descriptors to memory before detecting Tx hang */
++ e1000e_flush_descriptors(adapter);
++
+ /* Force detection of hung controller every watchdog period */
+ adapter->detect_tx_hung = 1;
+
+- /* flush partial descriptors to memory before detecting Tx hang */
+- if (adapter->flags2 & FLAG2_DMA_BURST) {
+- ew32(TIDV, adapter->tx_int_delay | E1000_TIDV_FPD);
+- ew32(RDTR, adapter->rx_int_delay | E1000_RDTR_FPD);
+- /*
+- * no need to flush the writes because the timeout code does
+- * an er32 first thing
+- */
+- }
+-
+ /*
+ * With 82571 controllers, LAA may be overwritten due to controller
+ * reset from the other port. Set the appropriate LAA in RAR[0]
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/etherdevice-Dummy-implementation-of-dev_hw_addr_rand.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/etherdevice-Dummy-implementation-of-dev_hw_addr_rand.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,28 @@
+From: Ben Hutchings <ben at decadent.org.uk>
+Date: Thu, 22 Jul 2010 02:50:21 +0000
+Subject: [PATCH 6/6] etherdevice: Dummy implementation of
+ dev_hw_addr_random()
+
+---
+ include/linux/etherdevice.h | 5 +++++
+ 1 files changed, 5 insertions(+), 0 deletions(-)
+
+diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
+index 3d7a668..2ec7be7 100644
+--- a/include/linux/etherdevice.h
++++ b/include/linux/etherdevice.h
+@@ -126,6 +126,11 @@ static inline void random_ether_addr(u8 *addr)
+ addr [0] |= 0x02; /* set local assignment bit (IEEE802) */
+ }
+
++static inline void dev_hw_addr_random(struct net_device *dev, u8 *hwaddr)
++{
++ random_ether_addr(hwaddr);
++}
++
+ /**
+ * compare_ether_addr - Compare two Ethernet addresses
+ * @addr1: Pointer to a six-byte array containing the Ethernet address
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0001-net-Convert-ethtool-get_stats-self_test-_count-ops-t.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0001-net-Convert-ethtool-get_stats-self_test-_count-ops-t.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,78 @@
+From: Ben Hutchings <bhutchings at solarflare.com>
+Date: Thu, 1 Oct 2009 11:58:24 +0000
+Subject: [PATCH 001/165] net: Convert ethtool {get_stats, self_test}_count()
+ ops to get_sset_count()
+
+commit 15f0a394c6573f4cb65a13095288ab9b9f8135f9 upstream.
+
+These string query operations were supposed to be replaced by the
+generic get_sset_count() starting in 2007. Convert the remaining
+implementations.
+
+Also remove calls to these operations to initialise drvinfo->n_stats.
+The ethtool core code already does that.
+
+Signed-off-by: Ben Hutchings <bhutchings at solarflare.com>
+Acked-by: Eilon Greenstein <eilong at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Restricted to drivers/net/igb{,vf}]
+---
+ drivers/net/igbvf/ethtool.c | 25 +++++++++++++------------
+ 1 files changed, 13 insertions(+), 12 deletions(-)
+
+diff --git a/drivers/net/igbvf/ethtool.c b/drivers/net/igbvf/ethtool.c
+index c68265b..8afff07 100644
+--- a/drivers/net/igbvf/ethtool.c
++++ b/drivers/net/igbvf/ethtool.c
+@@ -367,16 +367,6 @@ static int igbvf_link_test(struct igbvf_adapter *adapter, u64 *data)
+ return *data;
+ }
+
+-static int igbvf_get_self_test_count(struct net_device *netdev)
+-{
+- return IGBVF_TEST_LEN;
+-}
+-
+-static int igbvf_get_stats_count(struct net_device *netdev)
+-{
+- return IGBVF_GLOBAL_STATS_LEN;
+-}
+-
+ static void igbvf_diag_test(struct net_device *netdev,
+ struct ethtool_test *eth_test, u64 *data)
+ {
+@@ -484,6 +474,18 @@ static void igbvf_get_ethtool_stats(struct net_device *netdev,
+
+ }
+
++static int igbvf_get_sset_count(struct net_device *dev, int stringset)
++{
++ switch(stringset) {
++ case ETH_SS_TEST:
++ return IGBVF_TEST_LEN;
++ case ETH_SS_STATS:
++ return IGBVF_GLOBAL_STATS_LEN;
++ default:
++ return -EINVAL;
++ }
++}
++
+ static void igbvf_get_strings(struct net_device *netdev, u32 stringset,
+ u8 *data)
+ {
+@@ -532,11 +534,10 @@ static const struct ethtool_ops igbvf_ethtool_ops = {
+ .get_tso = ethtool_op_get_tso,
+ .set_tso = igbvf_set_tso,
+ .self_test = igbvf_diag_test,
++ .get_sset_count = igbvf_get_sset_count,
+ .get_strings = igbvf_get_strings,
+ .phys_id = igbvf_phys_id,
+ .get_ethtool_stats = igbvf_get_ethtool_stats,
+- .self_test_count = igbvf_get_self_test_count,
+- .get_stats_count = igbvf_get_stats_count,
+ .get_coalesce = igbvf_get_coalesce,
+ .set_coalesce = igbvf_set_coalesce,
+ };
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0002-igb-remove-unused-temp-variable-from-stats-clearing-.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0002-igb-remove-unused-temp-variable-from-stats-clearing-.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,222 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Mon, 5 Oct 2009 06:31:25 +0000
+Subject: [PATCH 002/165] igb: remove unused temp variable from stats clearing
+ path
+
+commit cc9073bbc901a0b695c9c5966d65520c29af70af upstream.
+
+There is a temp variable in the stats clearing path that isn't needed since
+the results from the stats read can be immediately discared. Since it
+isn't needed we might as well just drop it from the function call.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/e1000_82575.c | 96 ++++++++++++++++++++---------------------
+ drivers/net/igb/e1000_mac.c | 76 ++++++++++++++++-----------------
+ 2 files changed, 84 insertions(+), 88 deletions(-)
+
+diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c
+index 33352ff..e6488fa 100644
+--- a/drivers/net/igb/e1000_82575.c
++++ b/drivers/net/igb/e1000_82575.c
+@@ -1191,61 +1191,59 @@ out:
+ **/
+ static void igb_clear_hw_cntrs_82575(struct e1000_hw *hw)
+ {
+- u32 temp;
+-
+ igb_clear_hw_cntrs_base(hw);
+
+- temp = rd32(E1000_PRC64);
+- temp = rd32(E1000_PRC127);
+- temp = rd32(E1000_PRC255);
+- temp = rd32(E1000_PRC511);
+- temp = rd32(E1000_PRC1023);
+- temp = rd32(E1000_PRC1522);
+- temp = rd32(E1000_PTC64);
+- temp = rd32(E1000_PTC127);
+- temp = rd32(E1000_PTC255);
+- temp = rd32(E1000_PTC511);
+- temp = rd32(E1000_PTC1023);
+- temp = rd32(E1000_PTC1522);
+-
+- temp = rd32(E1000_ALGNERRC);
+- temp = rd32(E1000_RXERRC);
+- temp = rd32(E1000_TNCRS);
+- temp = rd32(E1000_CEXTERR);
+- temp = rd32(E1000_TSCTC);
+- temp = rd32(E1000_TSCTFC);
+-
+- temp = rd32(E1000_MGTPRC);
+- temp = rd32(E1000_MGTPDC);
+- temp = rd32(E1000_MGTPTC);
+-
+- temp = rd32(E1000_IAC);
+- temp = rd32(E1000_ICRXOC);
+-
+- temp = rd32(E1000_ICRXPTC);
+- temp = rd32(E1000_ICRXATC);
+- temp = rd32(E1000_ICTXPTC);
+- temp = rd32(E1000_ICTXATC);
+- temp = rd32(E1000_ICTXQEC);
+- temp = rd32(E1000_ICTXQMTC);
+- temp = rd32(E1000_ICRXDMTC);
+-
+- temp = rd32(E1000_CBTMPC);
+- temp = rd32(E1000_HTDPMC);
+- temp = rd32(E1000_CBRMPC);
+- temp = rd32(E1000_RPTHC);
+- temp = rd32(E1000_HGPTC);
+- temp = rd32(E1000_HTCBDPC);
+- temp = rd32(E1000_HGORCL);
+- temp = rd32(E1000_HGORCH);
+- temp = rd32(E1000_HGOTCL);
+- temp = rd32(E1000_HGOTCH);
+- temp = rd32(E1000_LENERRS);
++ rd32(E1000_PRC64);
++ rd32(E1000_PRC127);
++ rd32(E1000_PRC255);
++ rd32(E1000_PRC511);
++ rd32(E1000_PRC1023);
++ rd32(E1000_PRC1522);
++ rd32(E1000_PTC64);
++ rd32(E1000_PTC127);
++ rd32(E1000_PTC255);
++ rd32(E1000_PTC511);
++ rd32(E1000_PTC1023);
++ rd32(E1000_PTC1522);
++
++ rd32(E1000_ALGNERRC);
++ rd32(E1000_RXERRC);
++ rd32(E1000_TNCRS);
++ rd32(E1000_CEXTERR);
++ rd32(E1000_TSCTC);
++ rd32(E1000_TSCTFC);
++
++ rd32(E1000_MGTPRC);
++ rd32(E1000_MGTPDC);
++ rd32(E1000_MGTPTC);
++
++ rd32(E1000_IAC);
++ rd32(E1000_ICRXOC);
++
++ rd32(E1000_ICRXPTC);
++ rd32(E1000_ICRXATC);
++ rd32(E1000_ICTXPTC);
++ rd32(E1000_ICTXATC);
++ rd32(E1000_ICTXQEC);
++ rd32(E1000_ICTXQMTC);
++ rd32(E1000_ICRXDMTC);
++
++ rd32(E1000_CBTMPC);
++ rd32(E1000_HTDPMC);
++ rd32(E1000_CBRMPC);
++ rd32(E1000_RPTHC);
++ rd32(E1000_HGPTC);
++ rd32(E1000_HTCBDPC);
++ rd32(E1000_HGORCL);
++ rd32(E1000_HGORCH);
++ rd32(E1000_HGOTCL);
++ rd32(E1000_HGOTCH);
++ rd32(E1000_LENERRS);
+
+ /* This register should not be read in copper configurations */
+ if (hw->phy.media_type == e1000_media_type_internal_serdes ||
+ igb_sgmii_active_82575(hw))
+- temp = rd32(E1000_SCVPC);
++ rd32(E1000_SCVPC);
+ }
+
+ /**
+diff --git a/drivers/net/igb/e1000_mac.c b/drivers/net/igb/e1000_mac.c
+index d4fa82c..4969a5b 100644
+--- a/drivers/net/igb/e1000_mac.c
++++ b/drivers/net/igb/e1000_mac.c
+@@ -400,45 +400,43 @@ void igb_update_mc_addr_list(struct e1000_hw *hw,
+ **/
+ void igb_clear_hw_cntrs_base(struct e1000_hw *hw)
+ {
+- u32 temp;
+-
+- temp = rd32(E1000_CRCERRS);
+- temp = rd32(E1000_SYMERRS);
+- temp = rd32(E1000_MPC);
+- temp = rd32(E1000_SCC);
+- temp = rd32(E1000_ECOL);
+- temp = rd32(E1000_MCC);
+- temp = rd32(E1000_LATECOL);
+- temp = rd32(E1000_COLC);
+- temp = rd32(E1000_DC);
+- temp = rd32(E1000_SEC);
+- temp = rd32(E1000_RLEC);
+- temp = rd32(E1000_XONRXC);
+- temp = rd32(E1000_XONTXC);
+- temp = rd32(E1000_XOFFRXC);
+- temp = rd32(E1000_XOFFTXC);
+- temp = rd32(E1000_FCRUC);
+- temp = rd32(E1000_GPRC);
+- temp = rd32(E1000_BPRC);
+- temp = rd32(E1000_MPRC);
+- temp = rd32(E1000_GPTC);
+- temp = rd32(E1000_GORCL);
+- temp = rd32(E1000_GORCH);
+- temp = rd32(E1000_GOTCL);
+- temp = rd32(E1000_GOTCH);
+- temp = rd32(E1000_RNBC);
+- temp = rd32(E1000_RUC);
+- temp = rd32(E1000_RFC);
+- temp = rd32(E1000_ROC);
+- temp = rd32(E1000_RJC);
+- temp = rd32(E1000_TORL);
+- temp = rd32(E1000_TORH);
+- temp = rd32(E1000_TOTL);
+- temp = rd32(E1000_TOTH);
+- temp = rd32(E1000_TPR);
+- temp = rd32(E1000_TPT);
+- temp = rd32(E1000_MPTC);
+- temp = rd32(E1000_BPTC);
++ rd32(E1000_CRCERRS);
++ rd32(E1000_SYMERRS);
++ rd32(E1000_MPC);
++ rd32(E1000_SCC);
++ rd32(E1000_ECOL);
++ rd32(E1000_MCC);
++ rd32(E1000_LATECOL);
++ rd32(E1000_COLC);
++ rd32(E1000_DC);
++ rd32(E1000_SEC);
++ rd32(E1000_RLEC);
++ rd32(E1000_XONRXC);
++ rd32(E1000_XONTXC);
++ rd32(E1000_XOFFRXC);
++ rd32(E1000_XOFFTXC);
++ rd32(E1000_FCRUC);
++ rd32(E1000_GPRC);
++ rd32(E1000_BPRC);
++ rd32(E1000_MPRC);
++ rd32(E1000_GPTC);
++ rd32(E1000_GORCL);
++ rd32(E1000_GORCH);
++ rd32(E1000_GOTCL);
++ rd32(E1000_GOTCH);
++ rd32(E1000_RNBC);
++ rd32(E1000_RUC);
++ rd32(E1000_RFC);
++ rd32(E1000_ROC);
++ rd32(E1000_RJC);
++ rd32(E1000_TORL);
++ rd32(E1000_TORH);
++ rd32(E1000_TOTL);
++ rd32(E1000_TOTH);
++ rd32(E1000_TPR);
++ rd32(E1000_TPT);
++ rd32(E1000_MPTC);
++ rd32(E1000_BPTC);
+ }
+
+ /**
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0003-igb-update-comments-for-serdes-config-and-update-to-.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0003-igb-update-comments-for-serdes-config-and-update-to-.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,149 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Mon, 5 Oct 2009 06:31:47 +0000
+Subject: [PATCH 003/165] igb: update comments for serdes config and update to
+ handle duplex
+
+commit 70d92f86dc162fc24e13cd79fd3481ae39b66f72 upstream.
+
+This update corrects the driver so that it handles duplex for serdes links
+correctly instead of just forcing full duplex always.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/e1000_82575.c | 55 ++++++++++++++++++++++++++++------------
+ drivers/net/igb/e1000_82575.h | 1 +
+ drivers/net/igb/e1000_hw.h | 1 +
+ 3 files changed, 40 insertions(+), 17 deletions(-)
+
+diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c
+index e6488fa..c20cbbe 100644
+--- a/drivers/net/igb/e1000_82575.c
++++ b/drivers/net/igb/e1000_82575.c
+@@ -707,9 +707,7 @@ static s32 igb_check_for_link_82575(struct e1000_hw *hw)
+ s32 ret_val;
+ u16 speed, duplex;
+
+- /* SGMII link check is done through the PCS register. */
+- if ((hw->phy.media_type != e1000_media_type_copper) ||
+- (igb_sgmii_active_82575(hw))) {
++ if (hw->phy.media_type != e1000_media_type_copper) {
+ ret_val = igb_get_pcs_speed_and_duplex_82575(hw, &speed,
+ &duplex);
+ /*
+@@ -724,6 +722,7 @@ static s32 igb_check_for_link_82575(struct e1000_hw *hw)
+
+ return ret_val;
+ }
++
+ /**
+ * igb_get_pcs_speed_and_duplex_82575 - Retrieve current speed/duplex
+ * @hw: pointer to the HW structure
+@@ -789,13 +788,23 @@ static s32 igb_get_pcs_speed_and_duplex_82575(struct e1000_hw *hw, u16 *speed,
+ void igb_shutdown_serdes_link_82575(struct e1000_hw *hw)
+ {
+ u32 reg;
++ u16 eeprom_data = 0;
+
+ if (hw->phy.media_type != e1000_media_type_internal_serdes ||
+ igb_sgmii_active_82575(hw))
+ return;
+
+- /* if the management interface is not enabled, then power down */
+- if (!igb_enable_mng_pass_thru(hw)) {
++ if (hw->bus.func == E1000_FUNC_0)
++ hw->nvm.ops.read(hw, NVM_INIT_CONTROL3_PORT_A, 1, &eeprom_data);
++ else if (hw->bus.func == E1000_FUNC_1)
++ hw->nvm.ops.read(hw, NVM_INIT_CONTROL3_PORT_B, 1, &eeprom_data);
++
++ /*
++ * If APM is not enabled in the EEPROM and management interface is
++ * not enabled, then power down.
++ */
++ if (!(eeprom_data & E1000_NVM_APME_82575) &&
++ !igb_enable_mng_pass_thru(hw)) {
+ /* Disable PCS to turn off link */
+ reg = rd32(E1000_PCS_CFG0);
+ reg &= ~E1000_PCS_CFG_PCS_EN;
+@@ -1011,10 +1020,13 @@ out:
+ }
+
+ /**
+- * igb_setup_serdes_link_82575 - Setup link for fiber/serdes
++ * igb_setup_serdes_link_82575 - Setup link for serdes
+ * @hw: pointer to the HW structure
+ *
+- * Configures speed and duplex for fiber and serdes links.
++ * Configure the physical coding sub-layer (PCS) link. The PCS link is
++ * used on copper connections where the serialized gigabit media independent
++ * interface (sgmii), or serdes fiber is being used. Configures the link
++ * for auto-negotiation or forces speed/duplex.
+ **/
+ static s32 igb_setup_serdes_link_82575(struct e1000_hw *hw)
+ {
+@@ -1087,18 +1099,27 @@ static s32 igb_setup_serdes_link_82575(struct e1000_hw *hw)
+ */
+ if (hw->mac.autoneg || igb_sgmii_active_82575(hw)) {
+ /* Set PCS register for autoneg */
+- reg |= E1000_PCS_LCTL_FSV_1000 | /* Force 1000 */
+- E1000_PCS_LCTL_FDV_FULL | /* SerDes Full duplex */
+- E1000_PCS_LCTL_AN_ENABLE | /* Enable Autoneg */
+- E1000_PCS_LCTL_AN_RESTART; /* Restart autoneg */
++ reg |= E1000_PCS_LCTL_FSV_1000 | /* Force 1000 */
++ E1000_PCS_LCTL_FDV_FULL | /* SerDes Full dplx */
++ E1000_PCS_LCTL_AN_ENABLE | /* Enable Autoneg */
++ E1000_PCS_LCTL_AN_RESTART; /* Restart autoneg */
+ hw_dbg("Configuring Autoneg; PCS_LCTL = 0x%08X\n", reg);
+ } else {
+- /* Set PCS register for forced speed */
+- reg |= E1000_PCS_LCTL_FLV_LINK_UP | /* Force link up */
+- E1000_PCS_LCTL_FSV_1000 | /* Force 1000 */
+- E1000_PCS_LCTL_FDV_FULL | /* SerDes Full duplex */
+- E1000_PCS_LCTL_FSD | /* Force Speed */
+- E1000_PCS_LCTL_FORCE_LINK; /* Force Link */
++ /* Check for duplex first */
++ if (hw->mac.forced_speed_duplex & E1000_ALL_FULL_DUPLEX)
++ reg |= E1000_PCS_LCTL_FDV_FULL;
++
++ /* No need to check for 1000/full since the spec states that
++ * it requires autoneg to be enabled */
++ /* Now set speed */
++ if (hw->mac.forced_speed_duplex & E1000_ALL_100_SPEED)
++ reg |= E1000_PCS_LCTL_FSV_100;
++
++ /* Force speed and force link */
++ reg |= E1000_PCS_LCTL_FSD |
++ E1000_PCS_LCTL_FORCE_LINK |
++ E1000_PCS_LCTL_FLV_LINK_UP;
++
+ hw_dbg("Configuring Forced Link; PCS_LCTL = 0x%08X\n", reg);
+ }
+
+diff --git a/drivers/net/igb/e1000_82575.h b/drivers/net/igb/e1000_82575.h
+index ebd146f..7be3a0b 100644
+--- a/drivers/net/igb/e1000_82575.h
++++ b/drivers/net/igb/e1000_82575.h
+@@ -167,6 +167,7 @@ struct e1000_adv_tx_context_desc {
+ #define E1000_DCA_TXCTRL_CPUID_SHIFT 24 /* Tx CPUID now in the last byte */
+ #define E1000_DCA_RXCTRL_CPUID_SHIFT 24 /* Rx CPUID now in the last byte */
+
++#define E1000_NVM_APME_82575 0x0400
+ #define MAX_NUM_VFS 8
+
+ #define E1000_DTXSWC_VMDQ_LOOPBACK_EN (1 << 31) /* global VF LB enable */
+diff --git a/drivers/net/igb/e1000_hw.h b/drivers/net/igb/e1000_hw.h
+index 72081df..743f743 100644
+--- a/drivers/net/igb/e1000_hw.h
++++ b/drivers/net/igb/e1000_hw.h
+@@ -51,6 +51,7 @@ struct e1000_hw;
+ #define E1000_REVISION_2 2
+ #define E1000_REVISION_4 4
+
++#define E1000_FUNC_0 0
+ #define E1000_FUNC_1 1
+
+ #define E1000_ALT_MAC_ADDRESS_OFFSET_LAN1 3
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0004-igb-update-the-approach-taken-to-acquiring-and-relea.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0004-igb-update-the-approach-taken-to-acquiring-and-relea.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,52 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Mon, 5 Oct 2009 06:32:07 +0000
+Subject: [PATCH 004/165] igb: update the approach taken to acquiring and
+ releasing the phy lock
+
+commit 008c3422d48b217792789bdea822dbc2efe2165c upstream.
+
+The current approach is just using a ?: type mechanism to set the phy
+locking bit. This if fine for now but limits us to only 2. Switch to a
+nested if statement for future compatiblity with more than 2 phys.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/e1000_82575.c | 11 +++++++----
+ 1 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c
+index c20cbbe..e9f8bca 100644
+--- a/drivers/net/igb/e1000_82575.c
++++ b/drivers/net/igb/e1000_82575.c
+@@ -241,9 +241,10 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
+ **/
+ static s32 igb_acquire_phy_82575(struct e1000_hw *hw)
+ {
+- u16 mask;
++ u16 mask = E1000_SWFW_PHY0_SM;
+
+- mask = hw->bus.func ? E1000_SWFW_PHY1_SM : E1000_SWFW_PHY0_SM;
++ if (hw->bus.func == E1000_FUNC_1)
++ mask = E1000_SWFW_PHY1_SM;
+
+ return igb_acquire_swfw_sync_82575(hw, mask);
+ }
+@@ -257,9 +258,11 @@ static s32 igb_acquire_phy_82575(struct e1000_hw *hw)
+ **/
+ static void igb_release_phy_82575(struct e1000_hw *hw)
+ {
+- u16 mask;
++ u16 mask = E1000_SWFW_PHY0_SM;
++
++ if (hw->bus.func == E1000_FUNC_1)
++ mask = E1000_SWFW_PHY1_SM;
+
+- mask = hw->bus.func ? E1000_SWFW_PHY1_SM : E1000_SWFW_PHY0_SM;
+ igb_release_swfw_sync_82575(hw, mask);
+ }
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0005-igb-add-locking-to-reads-of-the-i2c-interface.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0005-igb-add-locking-to-reads-of-the-i2c-interface.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,263 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Mon, 5 Oct 2009 06:32:27 +0000
+Subject: [PATCH 005/165] igb: add locking to reads of the i2c interface
+
+commit bf6f7a928d313ddecb0a16ea60fa6b45ac1414a7 upstream.
+
+The current implementation of sgmii support isn't correctly locking the
+interfaces for reads/writes. This change pulls the read/write
+functionality out of 82575.c and moves it to phy.c. In addition it
+replaces the implementation in 82575.c with one that uses locking around
+the relocated i2c interface calls.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/e1000_82575.c | 87 +++++++++----------------------------
+ drivers/net/igb/e1000_phy.c | 97 +++++++++++++++++++++++++++++++++++++++++
+ drivers/net/igb/e1000_phy.h | 2 +
+ 3 files changed, 120 insertions(+), 66 deletions(-)
+
+diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c
+index e9f8bca..ba30226 100644
+--- a/drivers/net/igb/e1000_82575.c
++++ b/drivers/net/igb/e1000_82575.c
+@@ -278,45 +278,23 @@ static void igb_release_phy_82575(struct e1000_hw *hw)
+ static s32 igb_read_phy_reg_sgmii_82575(struct e1000_hw *hw, u32 offset,
+ u16 *data)
+ {
+- struct e1000_phy_info *phy = &hw->phy;
+- u32 i, i2ccmd = 0;
++ s32 ret_val = -E1000_ERR_PARAM;
+
+ if (offset > E1000_MAX_SGMII_PHY_REG_ADDR) {
+ hw_dbg("PHY Address %u is out of range\n", offset);
+- return -E1000_ERR_PARAM;
++ goto out;
+ }
+
+- /*
+- * Set up Op-code, Phy Address, and register address in the I2CCMD
+- * register. The MAC will take care of interfacing with the
+- * PHY to retrieve the desired data.
+- */
+- i2ccmd = ((offset << E1000_I2CCMD_REG_ADDR_SHIFT) |
+- (phy->addr << E1000_I2CCMD_PHY_ADDR_SHIFT) |
+- (E1000_I2CCMD_OPCODE_READ));
++ ret_val = hw->phy.ops.acquire(hw);
++ if (ret_val)
++ goto out;
+
+- wr32(E1000_I2CCMD, i2ccmd);
++ ret_val = igb_read_phy_reg_i2c(hw, offset, data);
+
+- /* Poll the ready bit to see if the I2C read completed */
+- for (i = 0; i < E1000_I2CCMD_PHY_TIMEOUT; i++) {
+- udelay(50);
+- i2ccmd = rd32(E1000_I2CCMD);
+- if (i2ccmd & E1000_I2CCMD_READY)
+- break;
+- }
+- if (!(i2ccmd & E1000_I2CCMD_READY)) {
+- hw_dbg("I2CCMD Read did not complete\n");
+- return -E1000_ERR_PHY;
+- }
+- if (i2ccmd & E1000_I2CCMD_ERROR) {
+- hw_dbg("I2CCMD Error bit set\n");
+- return -E1000_ERR_PHY;
+- }
+-
+- /* Need to byte-swap the 16-bit value. */
+- *data = ((i2ccmd >> 8) & 0x00FF) | ((i2ccmd << 8) & 0xFF00);
++ hw->phy.ops.release(hw);
+
+- return 0;
++out:
++ return ret_val;
+ }
+
+ /**
+@@ -331,47 +309,24 @@ static s32 igb_read_phy_reg_sgmii_82575(struct e1000_hw *hw, u32 offset,
+ static s32 igb_write_phy_reg_sgmii_82575(struct e1000_hw *hw, u32 offset,
+ u16 data)
+ {
+- struct e1000_phy_info *phy = &hw->phy;
+- u32 i, i2ccmd = 0;
+- u16 phy_data_swapped;
++ s32 ret_val = -E1000_ERR_PARAM;
++
+
+ if (offset > E1000_MAX_SGMII_PHY_REG_ADDR) {
+ hw_dbg("PHY Address %d is out of range\n", offset);
+- return -E1000_ERR_PARAM;
++ goto out;
+ }
+
+- /* Swap the data bytes for the I2C interface */
+- phy_data_swapped = ((data >> 8) & 0x00FF) | ((data << 8) & 0xFF00);
++ ret_val = hw->phy.ops.acquire(hw);
++ if (ret_val)
++ goto out;
+
+- /*
+- * Set up Op-code, Phy Address, and register address in the I2CCMD
+- * register. The MAC will take care of interfacing with the
+- * PHY to retrieve the desired data.
+- */
+- i2ccmd = ((offset << E1000_I2CCMD_REG_ADDR_SHIFT) |
+- (phy->addr << E1000_I2CCMD_PHY_ADDR_SHIFT) |
+- E1000_I2CCMD_OPCODE_WRITE |
+- phy_data_swapped);
+-
+- wr32(E1000_I2CCMD, i2ccmd);
+-
+- /* Poll the ready bit to see if the I2C read completed */
+- for (i = 0; i < E1000_I2CCMD_PHY_TIMEOUT; i++) {
+- udelay(50);
+- i2ccmd = rd32(E1000_I2CCMD);
+- if (i2ccmd & E1000_I2CCMD_READY)
+- break;
+- }
+- if (!(i2ccmd & E1000_I2CCMD_READY)) {
+- hw_dbg("I2CCMD Write did not complete\n");
+- return -E1000_ERR_PHY;
+- }
+- if (i2ccmd & E1000_I2CCMD_ERROR) {
+- hw_dbg("I2CCMD Error bit set\n");
+- return -E1000_ERR_PHY;
+- }
++ ret_val = igb_write_phy_reg_i2c(hw, offset, data);
+
+- return 0;
++ hw->phy.ops.release(hw);
++
++out:
++ return ret_val;
+ }
+
+ /**
+diff --git a/drivers/net/igb/e1000_phy.c b/drivers/net/igb/e1000_phy.c
+index ee46060..d4c928c 100644
+--- a/drivers/net/igb/e1000_phy.c
++++ b/drivers/net/igb/e1000_phy.c
+@@ -239,6 +239,103 @@ out:
+ }
+
+ /**
++ * igb_read_phy_reg_i2c - Read PHY register using i2c
++ * @hw: pointer to the HW structure
++ * @offset: register offset to be read
++ * @data: pointer to the read data
++ *
++ * Reads the PHY register at offset using the i2c interface and stores the
++ * retrieved information in data.
++ **/
++s32 igb_read_phy_reg_i2c(struct e1000_hw *hw, u32 offset, u16 *data)
++{
++ struct e1000_phy_info *phy = &hw->phy;
++ u32 i, i2ccmd = 0;
++
++
++ /*
++ * Set up Op-code, Phy Address, and register address in the I2CCMD
++ * register. The MAC will take care of interfacing with the
++ * PHY to retrieve the desired data.
++ */
++ i2ccmd = ((offset << E1000_I2CCMD_REG_ADDR_SHIFT) |
++ (phy->addr << E1000_I2CCMD_PHY_ADDR_SHIFT) |
++ (E1000_I2CCMD_OPCODE_READ));
++
++ wr32(E1000_I2CCMD, i2ccmd);
++
++ /* Poll the ready bit to see if the I2C read completed */
++ for (i = 0; i < E1000_I2CCMD_PHY_TIMEOUT; i++) {
++ udelay(50);
++ i2ccmd = rd32(E1000_I2CCMD);
++ if (i2ccmd & E1000_I2CCMD_READY)
++ break;
++ }
++ if (!(i2ccmd & E1000_I2CCMD_READY)) {
++ hw_dbg("I2CCMD Read did not complete\n");
++ return -E1000_ERR_PHY;
++ }
++ if (i2ccmd & E1000_I2CCMD_ERROR) {
++ hw_dbg("I2CCMD Error bit set\n");
++ return -E1000_ERR_PHY;
++ }
++
++ /* Need to byte-swap the 16-bit value. */
++ *data = ((i2ccmd >> 8) & 0x00FF) | ((i2ccmd << 8) & 0xFF00);
++
++ return 0;
++}
++
++/**
++ * igb_write_phy_reg_i2c - Write PHY register using i2c
++ * @hw: pointer to the HW structure
++ * @offset: register offset to write to
++ * @data: data to write at register offset
++ *
++ * Writes the data to PHY register at the offset using the i2c interface.
++ **/
++s32 igb_write_phy_reg_i2c(struct e1000_hw *hw, u32 offset, u16 data)
++{
++ struct e1000_phy_info *phy = &hw->phy;
++ u32 i, i2ccmd = 0;
++ u16 phy_data_swapped;
++
++
++ /* Swap the data bytes for the I2C interface */
++ phy_data_swapped = ((data >> 8) & 0x00FF) | ((data << 8) & 0xFF00);
++
++ /*
++ * Set up Op-code, Phy Address, and register address in the I2CCMD
++ * register. The MAC will take care of interfacing with the
++ * PHY to retrieve the desired data.
++ */
++ i2ccmd = ((offset << E1000_I2CCMD_REG_ADDR_SHIFT) |
++ (phy->addr << E1000_I2CCMD_PHY_ADDR_SHIFT) |
++ E1000_I2CCMD_OPCODE_WRITE |
++ phy_data_swapped);
++
++ wr32(E1000_I2CCMD, i2ccmd);
++
++ /* Poll the ready bit to see if the I2C read completed */
++ for (i = 0; i < E1000_I2CCMD_PHY_TIMEOUT; i++) {
++ udelay(50);
++ i2ccmd = rd32(E1000_I2CCMD);
++ if (i2ccmd & E1000_I2CCMD_READY)
++ break;
++ }
++ if (!(i2ccmd & E1000_I2CCMD_READY)) {
++ hw_dbg("I2CCMD Write did not complete\n");
++ return -E1000_ERR_PHY;
++ }
++ if (i2ccmd & E1000_I2CCMD_ERROR) {
++ hw_dbg("I2CCMD Error bit set\n");
++ return -E1000_ERR_PHY;
++ }
++
++ return 0;
++}
++
++/**
+ * igb_read_phy_reg_igp - Read igp PHY register
+ * @hw: pointer to the HW structure
+ * @offset: register offset to be read
+diff --git a/drivers/net/igb/e1000_phy.h b/drivers/net/igb/e1000_phy.h
+index ebe4b61..4c49803 100644
+--- a/drivers/net/igb/e1000_phy.h
++++ b/drivers/net/igb/e1000_phy.h
+@@ -61,6 +61,8 @@ s32 igb_write_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 data);
+ s32 igb_phy_has_link(struct e1000_hw *hw, u32 iterations,
+ u32 usec_interval, bool *success);
+ s32 igb_phy_init_script_igp3(struct e1000_hw *hw);
++s32 igb_read_phy_reg_i2c(struct e1000_hw *hw, u32 offset, u16 *data);
++s32 igb_write_phy_reg_i2c(struct e1000_hw *hw, u32 offset, u16 data);
+
+ /* IGP01E1000 Specific Registers */
+ #define IGP01E1000_PHY_PORT_CONFIG 0x10 /* Port Config */
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0006-igb-add-combined-function-for-setting-rar-and-pool-b.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0006-igb-add-combined-function-for-setting-rar-and-pool-b.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,160 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Mon, 5 Oct 2009 06:32:49 +0000
+Subject: [PATCH 006/165] igb: add combined function for setting rar and pool
+ bits
+
+commit 26ad91783c489486d3fd1a6932e5bdab9d404a38 upstream.
+
+This patch adds igb_rar_qsel which sets the mac address and pool bits for a
+given mac address in the receive address register table.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 63 ++++++++++++++++++++++++++++----------------
+ 1 files changed, 40 insertions(+), 23 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 9e3d87a..14adca2 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -128,10 +128,10 @@ static void igb_vlan_rx_register(struct net_device *, struct vlan_group *);
+ static void igb_vlan_rx_add_vid(struct net_device *, u16);
+ static void igb_vlan_rx_kill_vid(struct net_device *, u16);
+ static void igb_restore_vlan(struct igb_adapter *);
++static void igb_rar_set_qsel(struct igb_adapter *, u8 *, u32 , u8);
+ static void igb_ping_all_vfs(struct igb_adapter *);
+ static void igb_msg_task(struct igb_adapter *);
+ static int igb_rcv_msg_from_vf(struct igb_adapter *, u32);
+-static inline void igb_set_rah_pool(struct e1000_hw *, int , int);
+ static void igb_vmm_control(struct igb_adapter *);
+ static int igb_set_vf_mac(struct igb_adapter *adapter, int, unsigned char *);
+ static void igb_restore_vf_multicasts(struct igb_adapter *adapter);
+@@ -169,16 +169,6 @@ static inline int igb_set_vf_rlpml(struct igb_adapter *adapter, int size,
+ return 0;
+ }
+
+-static inline void igb_set_rah_pool(struct e1000_hw *hw, int pool, int entry)
+-{
+- u32 reg_data;
+-
+- reg_data = rd32(E1000_RAH(entry));
+- reg_data &= ~E1000_RAH_POOL_MASK;
+- reg_data |= E1000_RAH_POOL_1 << pool;;
+- wr32(E1000_RAH(entry), reg_data);
+-}
+-
+ #ifdef CONFIG_PM
+ static int igb_suspend(struct pci_dev *, pm_message_t);
+ static int igb_resume(struct pci_dev *);
+@@ -983,7 +973,6 @@ int igb_up(struct igb_adapter *adapter)
+ igb_configure_msix(adapter);
+
+ igb_vmm_control(adapter);
+- igb_set_rah_pool(hw, adapter->vfs_allocated_count, 0);
+ igb_set_vmolr(hw, adapter->vfs_allocated_count);
+
+ /* Clear any pending interrupts. */
+@@ -1770,7 +1759,6 @@ static int igb_open(struct net_device *netdev)
+ igb_configure(adapter);
+
+ igb_vmm_control(adapter);
+- igb_set_rah_pool(hw, adapter->vfs_allocated_count, 0);
+ igb_set_vmolr(hw, adapter->vfs_allocated_count);
+
+ err = igb_request_irq(adapter);
+@@ -2299,6 +2287,10 @@ static void igb_configure_rx(struct igb_adapter *adapter)
+ /* Set the default pool for the PF's first queue */
+ igb_configure_vt_default_pool(adapter);
+
++ /* set the correct pool for the PF default MAC address in entry 0 */
++ igb_rar_set_qsel(adapter, adapter->hw.mac.addr, 0,
++ adapter->vfs_allocated_count);
++
+ igb_rlpml_set(adapter);
+
+ /* Enable Receives */
+@@ -2522,8 +2514,9 @@ static int igb_set_mac(struct net_device *netdev, void *p)
+ memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
+ memcpy(hw->mac.addr, addr->sa_data, netdev->addr_len);
+
+- igb_rar_set(hw, hw->mac.addr, 0);
+- igb_set_rah_pool(hw, adapter->vfs_allocated_count, 0);
++ /* set the correct pool for the new PF MAC address in entry 0 */
++ igb_rar_set_qsel(adapter, hw->mac.addr, 0,
++ adapter->vfs_allocated_count);
+
+ return 0;
+ }
+@@ -2573,10 +2566,9 @@ static void igb_set_rx_mode(struct net_device *netdev)
+ list_for_each_entry(ha, &netdev->uc.list, list) {
+ if (!rar_entries)
+ break;
+- igb_rar_set(hw, ha->addr, rar_entries);
+- igb_set_rah_pool(hw, adapter->vfs_allocated_count,
+- rar_entries);
+- rar_entries--;
++ igb_rar_set_qsel(adapter, ha->addr,
++ rar_entries--,
++ adapter->vfs_allocated_count);
+ }
+ }
+ /* write the addresses in reverse order to avoid write combining */
+@@ -4143,8 +4135,7 @@ static inline void igb_vf_reset_msg(struct igb_adapter *adapter, u32 vf)
+ igb_vf_reset_event(adapter, vf);
+
+ /* set vf mac address */
+- igb_rar_set(hw, vf_mac, rar_entry);
+- igb_set_rah_pool(hw, vf, rar_entry);
++ igb_rar_set_qsel(adapter, vf_mac, rar_entry, vf);
+
+ /* enable transmit and receive for vf */
+ reg = rd32(E1000_VFTE);
+@@ -5533,6 +5524,33 @@ static void igb_io_resume(struct pci_dev *pdev)
+ igb_get_hw_control(adapter);
+ }
+
++static void igb_rar_set_qsel(struct igb_adapter *adapter, u8 *addr, u32 index,
++ u8 qsel)
++{
++ u32 rar_low, rar_high;
++ struct e1000_hw *hw = &adapter->hw;
++
++ /* HW expects these in little endian so we reverse the byte order
++ * from network order (big endian) to little endian
++ */
++ rar_low = ((u32) addr[0] | ((u32) addr[1] << 8) |
++ ((u32) addr[2] << 16) | ((u32) addr[3] << 24));
++ rar_high = ((u32) addr[4] | ((u32) addr[5] << 8));
++
++ /* Indicate to hardware the Address is Valid. */
++ rar_high |= E1000_RAH_AV;
++
++ if (hw->mac.type == e1000_82575)
++ rar_high |= E1000_RAH_POOL_1 * qsel;
++ else
++ rar_high |= E1000_RAH_POOL_1 << qsel;
++
++ wr32(E1000_RAL(index), rar_low);
++ wrfl();
++ wr32(E1000_RAH(index), rar_high);
++ wrfl();
++}
++
+ static int igb_set_vf_mac(struct igb_adapter *adapter,
+ int vf, unsigned char *mac_addr)
+ {
+@@ -5543,8 +5561,7 @@ static int igb_set_vf_mac(struct igb_adapter *adapter,
+
+ memcpy(adapter->vf_data[vf].vf_mac_addresses, mac_addr, ETH_ALEN);
+
+- igb_rar_set(hw, mac_addr, rar_entry);
+- igb_set_rah_pool(hw, vf, rar_entry);
++ igb_rar_set_qsel(adapter, mac_addr, rar_entry, vf);
+
+ return 0;
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0007-igb-make-use-of-the-uta-to-allow-for-promiscous-mode.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0007-igb-make-use-of-the-uta-to-allow-for-promiscous-mode.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,340 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Mon, 5 Oct 2009 06:33:08 +0000
+Subject: [PATCH 007/165] igb: make use of the uta to allow for promiscous
+ mode filter
+
+commit 68d480c4defb69d834e75fd0be9069a8447afe36 upstream.
+
+In order to support functions such as vlan tag stripping when SR-IOV is
+enabled any given packet must match at least one filter. However in the
+case of promiscous mode being enabled on the PF the traffic routed to it
+may not match any filters and is just sent to the PF by default. In order
+to make certain that this traffic is processed we can set all bits in the
+UTA registers to create a pseudo promiscous mode filter that accepts all
+packets.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/e1000_82575.c | 5 +
+ drivers/net/igb/e1000_hw.h | 1 +
+ drivers/net/igb/e1000_regs.h | 1 +
+ drivers/net/igb/igb_main.c | 203 +++++++++++++++++++++++++++++++----------
+ 4 files changed, 163 insertions(+), 47 deletions(-)
+
+diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c
+index ba30226..45063c2 100644
+--- a/drivers/net/igb/e1000_82575.c
++++ b/drivers/net/igb/e1000_82575.c
+@@ -876,6 +876,11 @@ static s32 igb_init_hw_82575(struct e1000_hw *hw)
+ for (i = 0; i < mac->mta_reg_count; i++)
+ array_wr32(E1000_MTA, i, 0);
+
++ /* Zero out the Unicast HASH table */
++ hw_dbg("Zeroing the UTA\n");
++ for (i = 0; i < mac->uta_reg_count; i++)
++ array_wr32(E1000_UTA, i, 0);
++
+ /* Setup link and flow control */
+ ret_val = igb_setup_link(hw);
+
+diff --git a/drivers/net/igb/e1000_hw.h b/drivers/net/igb/e1000_hw.h
+index 743f743..fad7cf5 100644
+--- a/drivers/net/igb/e1000_hw.h
++++ b/drivers/net/igb/e1000_hw.h
+@@ -343,6 +343,7 @@ struct e1000_mac_info {
+ u16 ifs_ratio;
+ u16 ifs_step_size;
+ u16 mta_reg_count;
++ u16 uta_reg_count;
+
+ /* Maximum size of the MTA register table in all supported adapters */
+ #define MAX_MTA_REG 128
+diff --git a/drivers/net/igb/e1000_regs.h b/drivers/net/igb/e1000_regs.h
+index 345d144..76c3389 100644
+--- a/drivers/net/igb/e1000_regs.h
++++ b/drivers/net/igb/e1000_regs.h
+@@ -331,6 +331,7 @@ enum {
+ #define E1000_QDE 0x02408 /* Queue Drop Enable - RW */
+ #define E1000_DTXSWC 0x03500 /* DMA Tx Switch Control - RW */
+ #define E1000_RPLOLR 0x05AF0 /* Replication Offload - RW */
++#define E1000_UTA 0x0A000 /* Unicast Table Array - RW */
+ #define E1000_IOVTCL 0x05BBC /* IOV Control Register */
+ /* These act per VF so an array friendly macro is used */
+ #define E1000_P2VMAILBOX(_n) (0x00C00 + (4 * (_n)))
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 14adca2..1f604af 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -107,6 +107,7 @@ static netdev_tx_t igb_xmit_frame_adv(struct sk_buff *skb,
+ static struct net_device_stats *igb_get_stats(struct net_device *);
+ static int igb_change_mtu(struct net_device *, int);
+ static int igb_set_mac(struct net_device *, void *);
++static void igb_set_uta(struct igb_adapter *adapter);
+ static irqreturn_t igb_intr(int irq, void *);
+ static irqreturn_t igb_intr_msi(int irq, void *);
+ static irqreturn_t igb_msix_other(int irq, void *);
+@@ -142,7 +143,6 @@ static inline void igb_set_vmolr(struct e1000_hw *hw, int vfn)
+
+ reg_data = rd32(E1000_VMOLR(vfn));
+ reg_data |= E1000_VMOLR_BAM | /* Accept broadcast */
+- E1000_VMOLR_ROPE | /* Accept packets matched in UTA */
+ E1000_VMOLR_ROMPE | /* Accept packets matched in MTA */
+ E1000_VMOLR_AUPE | /* Accept untagged packets */
+ E1000_VMOLR_STRVLAN; /* Strip vlan tags */
+@@ -2287,6 +2287,9 @@ static void igb_configure_rx(struct igb_adapter *adapter)
+ /* Set the default pool for the PF's first queue */
+ igb_configure_vt_default_pool(adapter);
+
++ /* set UTA to appropriate mode */
++ igb_set_uta(adapter);
++
+ /* set the correct pool for the PF default MAC address in entry 0 */
+ igb_rar_set_qsel(adapter, adapter->hw.mac.addr, 0,
+ adapter->vfs_allocated_count);
+@@ -2522,44 +2525,72 @@ static int igb_set_mac(struct net_device *netdev, void *p)
+ }
+
+ /**
+- * igb_set_rx_mode - Secondary Unicast, Multicast and Promiscuous mode set
++ * igb_write_mc_addr_list - write multicast addresses to MTA
+ * @netdev: network interface device structure
+ *
+- * The set_rx_mode entry point is called whenever the unicast or multicast
+- * address lists or the network interface flags are updated. This routine is
+- * responsible for configuring the hardware for proper unicast, multicast,
+- * promiscuous mode, and all-multi behavior.
++ * Writes multicast address list to the MTA hash table.
++ * Returns: -ENOMEM on failure
++ * 0 on no addresses written
++ * X on writing X addresses to MTA
+ **/
+-static void igb_set_rx_mode(struct net_device *netdev)
++static int igb_write_mc_addr_list(struct net_device *netdev)
+ {
+ struct igb_adapter *adapter = netdev_priv(netdev);
+ struct e1000_hw *hw = &adapter->hw;
+- unsigned int rar_entries = hw->mac.rar_entry_count -
+- (adapter->vfs_allocated_count + 1);
+ struct dev_mc_list *mc_ptr = netdev->mc_list;
+- u8 *mta_list = NULL;
+- u32 rctl;
++ u8 *mta_list;
++ u32 vmolr = 0;
+ int i;
+
+- /* Check for Promiscuous and All Multicast modes */
+- rctl = rd32(E1000_RCTL);
++ if (!netdev->mc_count) {
++ /* nothing to program, so clear mc list */
++ igb_update_mc_addr_list(hw, NULL, 0);
++ igb_restore_vf_multicasts(adapter);
++ return 0;
++ }
+
+- if (netdev->flags & IFF_PROMISC) {
+- rctl |= (E1000_RCTL_UPE | E1000_RCTL_MPE);
+- rctl &= ~E1000_RCTL_VFE;
+- } else {
+- if (netdev->flags & IFF_ALLMULTI)
+- rctl |= E1000_RCTL_MPE;
+- else
+- rctl &= ~E1000_RCTL_MPE;
++ mta_list = kzalloc(netdev->mc_count * 6, GFP_ATOMIC);
++ if (!mta_list)
++ return -ENOMEM;
+
+- if (netdev->uc.count > rar_entries)
+- rctl |= E1000_RCTL_UPE;
+- else
+- rctl &= ~E1000_RCTL_UPE;
+- rctl |= E1000_RCTL_VFE;
++ /* set vmolr receive overflow multicast bit */
++ vmolr |= E1000_VMOLR_ROMPE;
++
++ /* The shared function expects a packed array of only addresses. */
++ mc_ptr = netdev->mc_list;
++
++ for (i = 0; i < netdev->mc_count; i++) {
++ if (!mc_ptr)
++ break;
++ memcpy(mta_list + (i*ETH_ALEN), mc_ptr->dmi_addr, ETH_ALEN);
++ mc_ptr = mc_ptr->next;
+ }
+- wr32(E1000_RCTL, rctl);
++ igb_update_mc_addr_list(hw, mta_list, i);
++ kfree(mta_list);
++
++ return netdev->mc_count;
++}
++
++/**
++ * igb_write_uc_addr_list - write unicast addresses to RAR table
++ * @netdev: network interface device structure
++ *
++ * Writes unicast address list to the RAR table.
++ * Returns: -ENOMEM on failure/insufficient address space
++ * 0 on no addresses written
++ * X on writing X addresses to the RAR table
++ **/
++static int igb_write_uc_addr_list(struct net_device *netdev)
++{
++ struct igb_adapter *adapter = netdev_priv(netdev);
++ struct e1000_hw *hw = &adapter->hw;
++ unsigned int vfn = adapter->vfs_allocated_count;
++ unsigned int rar_entries = hw->mac.rar_entry_count - (vfn + 1);
++ int count = 0;
++
++ /* return ENOMEM indicating insufficient memory for addresses */
++ if (netdev->uc.count > rar_entries)
++ return -ENOMEM;
+
+ if (netdev->uc.count && rar_entries) {
+ struct netdev_hw_addr *ha;
+@@ -2568,7 +2599,8 @@ static void igb_set_rx_mode(struct net_device *netdev)
+ break;
+ igb_rar_set_qsel(adapter, ha->addr,
+ rar_entries--,
+- adapter->vfs_allocated_count);
++ vfn);
++ count++;
+ }
+ }
+ /* write the addresses in reverse order to avoid write combining */
+@@ -2578,29 +2610,79 @@ static void igb_set_rx_mode(struct net_device *netdev)
+ }
+ wrfl();
+
+- if (!netdev->mc_count) {
+- /* nothing to program, so clear mc list */
+- igb_update_mc_addr_list(hw, NULL, 0);
+- igb_restore_vf_multicasts(adapter);
+- return;
++ return count;
++}
++
++/**
++ * igb_set_rx_mode - Secondary Unicast, Multicast and Promiscuous mode set
++ * @netdev: network interface device structure
++ *
++ * The set_rx_mode entry point is called whenever the unicast or multicast
++ * address lists or the network interface flags are updated. This routine is
++ * responsible for configuring the hardware for proper unicast, multicast,
++ * promiscuous mode, and all-multi behavior.
++ **/
++static void igb_set_rx_mode(struct net_device *netdev)
++{
++ struct igb_adapter *adapter = netdev_priv(netdev);
++ struct e1000_hw *hw = &adapter->hw;
++ unsigned int vfn = adapter->vfs_allocated_count;
++ u32 rctl, vmolr = 0;
++ int count;
++
++ /* Check for Promiscuous and All Multicast modes */
++ rctl = rd32(E1000_RCTL);
++
++ /* clear the effected bits */
++ rctl &= ~(E1000_RCTL_UPE | E1000_RCTL_MPE | E1000_RCTL_VFE);
++
++ if (netdev->flags & IFF_PROMISC) {
++ rctl |= (E1000_RCTL_UPE | E1000_RCTL_MPE);
++ vmolr |= (E1000_VMOLR_ROPE | E1000_VMOLR_MPME);
++ } else {
++ if (netdev->flags & IFF_ALLMULTI) {
++ rctl |= E1000_RCTL_MPE;
++ vmolr |= E1000_VMOLR_MPME;
++ } else {
++ /*
++ * Write addresses to the MTA, if the attempt fails
++ * then we should just turn on promiscous mode so
++ * that we can at least receive multicast traffic
++ */
++ count = igb_write_mc_addr_list(netdev);
++ if (count < 0) {
++ rctl |= E1000_RCTL_MPE;
++ vmolr |= E1000_VMOLR_MPME;
++ } else if (count) {
++ vmolr |= E1000_VMOLR_ROMPE;
++ }
++ }
++ /*
++ * Write addresses to available RAR registers, if there is not
++ * sufficient space to store all the addresses then enable
++ * unicast promiscous mode
++ */
++ count = igb_write_uc_addr_list(netdev);
++ if (count < 0) {
++ rctl |= E1000_RCTL_UPE;
++ vmolr |= E1000_VMOLR_ROPE;
++ }
++ rctl |= E1000_RCTL_VFE;
+ }
++ wr32(E1000_RCTL, rctl);
+
+- mta_list = kzalloc(netdev->mc_count * 6, GFP_ATOMIC);
+- if (!mta_list) {
+- dev_err(&adapter->pdev->dev,
+- "failed to allocate multicast filter list\n");
++ /*
++ * In order to support SR-IOV and eventually VMDq it is necessary to set
++ * the VMOLR to enable the appropriate modes. Without this workaround
++ * we will have issues with VLAN tag stripping not being done for frames
++ * that are only arriving because we are the default pool
++ */
++ if (hw->mac.type < e1000_82576)
+ return;
+- }
+
+- /* The shared function expects a packed array of only addresses. */
+- for (i = 0; i < netdev->mc_count; i++) {
+- if (!mc_ptr)
+- break;
+- memcpy(mta_list + (i*ETH_ALEN), mc_ptr->dmi_addr, ETH_ALEN);
+- mc_ptr = mc_ptr->next;
+- }
+- igb_update_mc_addr_list(hw, mta_list, i);
+- kfree(mta_list);
++ vmolr |= rd32(E1000_VMOLR(vfn)) &
++ ~(E1000_VMOLR_ROPE | E1000_VMOLR_MPME | E1000_VMOLR_ROMPE);
++ wr32(E1000_VMOLR(vfn), vmolr);
+ igb_restore_vf_multicasts(adapter);
+ }
+
+@@ -4265,6 +4347,33 @@ static int igb_rcv_msg_from_vf(struct igb_adapter *adapter, u32 vf)
+ }
+
+ /**
++ * igb_set_uta - Set unicast filter table address
++ * @adapter: board private structure
++ *
++ * The unicast table address is a register array of 32-bit registers.
++ * The table is meant to be used in a way similar to how the MTA is used
++ * however due to certain limitations in the hardware it is necessary to
++ * set all the hash bits to 1 and use the VMOLR ROPE bit as a promiscous
++ * enable bit to allow vlan tag stripping when promiscous mode is enabled
++ **/
++static void igb_set_uta(struct igb_adapter *adapter)
++{
++ struct e1000_hw *hw = &adapter->hw;
++ int i;
++
++ /* The UTA table only exists on 82576 hardware and newer */
++ if (hw->mac.type < e1000_82576)
++ return;
++
++ /* we only need to do this if VMDq is enabled */
++ if (!adapter->vfs_allocated_count)
++ return;
++
++ for (i = 0; i < hw->mac.uta_reg_count; i++)
++ array_wr32(E1000_UTA, i, ~0);
++}
++
++/**
+ * igb_intr_msi - Interrupt Handler
+ * @irq: interrupt number
+ * @data: pointer to a network interface device structure
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0008-igb-add-function-to-handle-mailbox-lock.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0008-igb-add-function-to-handle-mailbox-lock.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,123 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Mon, 5 Oct 2009 06:33:46 +0000
+Subject: [PATCH 008/165] igb: add function to handle mailbox lock
+
+commit 0acb6fde5fc84009be1c7efc0aaa8e69e394a2e2 upstream.
+
+Both the read and write mailbox functions need to acquire the mailbox lock.
+Since that is the case we might as well combine both of the procedures into
+one function so it is easier to maintain.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/e1000_mbx.c | 63 +++++++++++++++++++++++-------------------
+ 1 files changed, 34 insertions(+), 29 deletions(-)
+
+diff --git a/drivers/net/igb/e1000_mbx.c b/drivers/net/igb/e1000_mbx.c
+index ed9058e..ef645f6 100644
+--- a/drivers/net/igb/e1000_mbx.c
++++ b/drivers/net/igb/e1000_mbx.c
+@@ -305,6 +305,30 @@ static s32 igb_check_for_rst_pf(struct e1000_hw *hw, u16 vf_number)
+ }
+
+ /**
++ * igb_obtain_mbx_lock_pf - obtain mailbox lock
++ * @hw: pointer to the HW structure
++ * @vf_number: the VF index
++ *
++ * return SUCCESS if we obtained the mailbox lock
++ **/
++static s32 igb_obtain_mbx_lock_pf(struct e1000_hw *hw, u16 vf_number)
++{
++ s32 ret_val = -E1000_ERR_MBX;
++ u32 p2v_mailbox;
++
++
++ /* Take ownership of the buffer */
++ wr32(E1000_P2VMAILBOX(vf_number), E1000_P2VMAILBOX_PFU);
++
++ /* reserve mailbox for vf use */
++ p2v_mailbox = rd32(E1000_P2VMAILBOX(vf_number));
++ if (p2v_mailbox & E1000_P2VMAILBOX_PFU)
++ ret_val = 0;
++
++ return ret_val;
++}
++
++/**
+ * igb_write_mbx_pf - Places a message in the mailbox
+ * @hw: pointer to the HW structure
+ * @msg: The message buffer
+@@ -316,27 +340,17 @@ static s32 igb_check_for_rst_pf(struct e1000_hw *hw, u16 vf_number)
+ static s32 igb_write_mbx_pf(struct e1000_hw *hw, u32 *msg, u16 size,
+ u16 vf_number)
+ {
+- u32 p2v_mailbox;
+- s32 ret_val = 0;
++ s32 ret_val;
+ u16 i;
+
+- /* Take ownership of the buffer */
+- wr32(E1000_P2VMAILBOX(vf_number), E1000_P2VMAILBOX_PFU);
+-
+- /* Make sure we have ownership now... */
+- p2v_mailbox = rd32(E1000_P2VMAILBOX(vf_number));
+- if (!(p2v_mailbox & E1000_P2VMAILBOX_PFU)) {
+- /* failed to grab ownership */
+- ret_val = -E1000_ERR_MBX;
++ /* lock the mailbox to prevent pf/vf race condition */
++ ret_val = igb_obtain_mbx_lock_pf(hw, vf_number);
++ if (ret_val)
+ goto out_no_write;
+- }
+
+- /*
+- * flush any ack or msg which may already be in the queue
+- * as they are likely the result of an error
+- */
+- igb_check_for_ack_pf(hw, vf_number);
++ /* flush msg and acks as we are overwriting the message buffer */
+ igb_check_for_msg_pf(hw, vf_number);
++ igb_check_for_ack_pf(hw, vf_number);
+
+ /* copy the caller specified message to the mailbox memory buffer */
+ for (i = 0; i < size; i++)
+@@ -367,20 +381,13 @@ out_no_write:
+ static s32 igb_read_mbx_pf(struct e1000_hw *hw, u32 *msg, u16 size,
+ u16 vf_number)
+ {
+- u32 p2v_mailbox;
+- s32 ret_val = 0;
++ s32 ret_val;
+ u16 i;
+
+- /* Take ownership of the buffer */
+- wr32(E1000_P2VMAILBOX(vf_number), E1000_P2VMAILBOX_PFU);
+-
+- /* Make sure we have ownership now... */
+- p2v_mailbox = rd32(E1000_P2VMAILBOX(vf_number));
+- if (!(p2v_mailbox & E1000_P2VMAILBOX_PFU)) {
+- /* failed to grab ownership */
+- ret_val = -E1000_ERR_MBX;
++ /* lock the mailbox to prevent pf/vf race condition */
++ ret_val = igb_obtain_mbx_lock_pf(hw, vf_number);
++ if (ret_val)
+ goto out_no_read;
+- }
+
+ /* copy the message to the mailbox memory buffer */
+ for (i = 0; i < size; i++)
+@@ -392,8 +399,6 @@ static s32 igb_read_mbx_pf(struct e1000_hw *hw, u32 *msg, u16 size,
+ /* update stats */
+ hw->mbx.stats.msgs_rx++;
+
+- ret_val = 0;
+-
+ out_no_read:
+ return ret_val;
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0009-igb-fix-a-few-items-where-weren-t-correctly-setup-fo.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0009-igb-fix-a-few-items-where-weren-t-correctly-setup-fo.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,78 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Mon, 5 Oct 2009 06:34:05 +0000
+Subject: [PATCH 009/165] igb: fix a few items where weren't correctly setup
+ for mbx timeout
+
+commit 3272686c98da64d6eeaa2434782f42270b110758 upstream.
+
+The mailbox timeout routines need to be updated as they were not correctly
+handling the case of a mailbox timeout and could cause issues with long
+delays when used.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/e1000_mbx.c | 19 ++++++++++++++-----
+ 1 files changed, 14 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/net/igb/e1000_mbx.c b/drivers/net/igb/e1000_mbx.c
+index ef645f6..c474cdb 100644
+--- a/drivers/net/igb/e1000_mbx.c
++++ b/drivers/net/igb/e1000_mbx.c
+@@ -143,12 +143,16 @@ static s32 igb_poll_for_msg(struct e1000_hw *hw, u16 mbx_id)
+ if (!countdown || !mbx->ops.check_for_msg)
+ goto out;
+
+- while (mbx->ops.check_for_msg(hw, mbx_id)) {
++ while (countdown && mbx->ops.check_for_msg(hw, mbx_id)) {
+ countdown--;
+ if (!countdown)
+ break;
+ udelay(mbx->usec_delay);
+ }
++
++ /* if we failed, all future posted messages fail until reset */
++ if (!countdown)
++ mbx->timeout = 0;
+ out:
+ return countdown ? 0 : -E1000_ERR_MBX;
+ }
+@@ -168,12 +172,16 @@ static s32 igb_poll_for_ack(struct e1000_hw *hw, u16 mbx_id)
+ if (!countdown || !mbx->ops.check_for_ack)
+ goto out;
+
+- while (mbx->ops.check_for_ack(hw, mbx_id)) {
++ while (countdown && mbx->ops.check_for_ack(hw, mbx_id)) {
+ countdown--;
+ if (!countdown)
+ break;
+ udelay(mbx->usec_delay);
+ }
++
++ /* if we failed, all future posted messages fail until reset */
++ if (!countdown)
++ mbx->timeout = 0;
+ out:
+ return countdown ? 0 : -E1000_ERR_MBX;
+ }
+@@ -217,12 +225,13 @@ out:
+ static s32 igb_write_posted_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id)
+ {
+ struct e1000_mbx_info *mbx = &hw->mbx;
+- s32 ret_val = 0;
++ s32 ret_val = -E1000_ERR_MBX;
+
+- if (!mbx->ops.write)
++ /* exit if either we can't write or there isn't a defined timeout */
++ if (!mbx->ops.write || !mbx->timeout)
+ goto out;
+
+- /* send msg*/
++ /* send msg */
+ ret_val = mbx->ops.write(hw, msg, size, mbx_id);
+
+ /* if msg sent wait until we receive an ack */
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0010-igb-remove-microwire-support-from-igb.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0010-igb-remove-microwire-support-from-igb.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,109 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Mon, 5 Oct 2009 06:34:44 +0000
+Subject: [PATCH 010/165] igb: remove microwire support from igb
+
+commit 285b4167458ec7cc49008b2e61cbe0362deed335 upstream.
+
+igb doesn't have any devices that use a microwire interface for NVM. As
+such the code related to this can be removed.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/e1000_hw.h | 3 ---
+ drivers/net/igb/e1000_nvm.c | 36 +++---------------------------------
+ 2 files changed, 3 insertions(+), 36 deletions(-)
+
+diff --git a/drivers/net/igb/e1000_hw.h b/drivers/net/igb/e1000_hw.h
+index fad7cf5..2dc9294 100644
+--- a/drivers/net/igb/e1000_hw.h
++++ b/drivers/net/igb/e1000_hw.h
+@@ -74,7 +74,6 @@ enum e1000_nvm_type {
+ e1000_nvm_unknown = 0,
+ e1000_nvm_none,
+ e1000_nvm_eeprom_spi,
+- e1000_nvm_eeprom_microwire,
+ e1000_nvm_flash_hw,
+ e1000_nvm_flash_sw
+ };
+@@ -83,8 +82,6 @@ enum e1000_nvm_override {
+ e1000_nvm_override_none = 0,
+ e1000_nvm_override_spi_small,
+ e1000_nvm_override_spi_large,
+- e1000_nvm_override_microwire_small,
+- e1000_nvm_override_microwire_large
+ };
+
+ enum e1000_phy_type {
+diff --git a/drivers/net/igb/e1000_nvm.c b/drivers/net/igb/e1000_nvm.c
+index a88bfe2..d83b77fa 100644
+--- a/drivers/net/igb/e1000_nvm.c
++++ b/drivers/net/igb/e1000_nvm.c
+@@ -78,9 +78,7 @@ static void igb_shift_out_eec_bits(struct e1000_hw *hw, u16 data, u16 count)
+ u32 mask;
+
+ mask = 0x01 << (count - 1);
+- if (nvm->type == e1000_nvm_eeprom_microwire)
+- eecd &= ~E1000_EECD_DO;
+- else if (nvm->type == e1000_nvm_eeprom_spi)
++ if (nvm->type == e1000_nvm_eeprom_spi)
+ eecd |= E1000_EECD_DO;
+
+ do {
+@@ -220,22 +218,7 @@ static void igb_standby_nvm(struct e1000_hw *hw)
+ struct e1000_nvm_info *nvm = &hw->nvm;
+ u32 eecd = rd32(E1000_EECD);
+
+- if (nvm->type == e1000_nvm_eeprom_microwire) {
+- eecd &= ~(E1000_EECD_CS | E1000_EECD_SK);
+- wr32(E1000_EECD, eecd);
+- wrfl();
+- udelay(nvm->delay_usec);
+-
+- igb_raise_eec_clk(hw, &eecd);
+-
+- /* Select EEPROM */
+- eecd |= E1000_EECD_CS;
+- wr32(E1000_EECD, eecd);
+- wrfl();
+- udelay(nvm->delay_usec);
+-
+- igb_lower_eec_clk(hw, &eecd);
+- } else if (nvm->type == e1000_nvm_eeprom_spi) {
++ if (nvm->type == e1000_nvm_eeprom_spi) {
+ /* Toggle CS to flush commands */
+ eecd |= E1000_EECD_CS;
+ wr32(E1000_EECD, eecd);
+@@ -263,12 +246,6 @@ static void e1000_stop_nvm(struct e1000_hw *hw)
+ /* Pull CS high */
+ eecd |= E1000_EECD_CS;
+ igb_lower_eec_clk(hw, &eecd);
+- } else if (hw->nvm.type == e1000_nvm_eeprom_microwire) {
+- /* CS on Microcwire is active-high */
+- eecd &= ~(E1000_EECD_CS | E1000_EECD_DI);
+- wr32(E1000_EECD, eecd);
+- igb_raise_eec_clk(hw, &eecd);
+- igb_lower_eec_clk(hw, &eecd);
+ }
+ }
+
+@@ -304,14 +281,7 @@ static s32 igb_ready_nvm_eeprom(struct e1000_hw *hw)
+ u8 spi_stat_reg;
+
+
+- if (nvm->type == e1000_nvm_eeprom_microwire) {
+- /* Clear SK and DI */
+- eecd &= ~(E1000_EECD_DI | E1000_EECD_SK);
+- wr32(E1000_EECD, eecd);
+- /* Set CS */
+- eecd |= E1000_EECD_CS;
+- wr32(E1000_EECD, eecd);
+- } else if (nvm->type == e1000_nvm_eeprom_spi) {
++ if (nvm->type == e1000_nvm_eeprom_spi) {
+ /* Clear SK and CS */
+ eecd &= ~(E1000_EECD_CS | E1000_EECD_SK);
+ wr32(E1000_EECD, eecd);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0011-igb-move-the-generic-copper-link-setup-code-into-e10.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0011-igb-move-the-generic-copper-link-setup-code-into-e10.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,180 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Mon, 5 Oct 2009 06:35:03 +0000
+Subject: [PATCH 011/165] igb: move the generic copper link setup code into
+ e1000_phy.c
+
+commit 81fadd81a5bc897c8d0424d1cd90cb999d8e12b0 upstream.
+
+This patch moves the generic portion of the copper link setup into a
+seperate function in e1000_phy.c. This helps to reduce the size of
+copper_link_setup_82575 and make it a bit more readable.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/e1000_82575.c | 40 +--------------------------
+ drivers/net/igb/e1000_phy.c | 61 ++++++++++++++++++++++++++++++++++++++++-
+ drivers/net/igb/e1000_phy.h | 2 +-
+ 3 files changed, 62 insertions(+), 41 deletions(-)
+
+diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c
+index 45063c2..5d345e3 100644
+--- a/drivers/net/igb/e1000_82575.c
++++ b/drivers/net/igb/e1000_82575.c
+@@ -907,7 +907,6 @@ static s32 igb_setup_copper_link_82575(struct e1000_hw *hw)
+ {
+ u32 ctrl;
+ s32 ret_val;
+- bool link;
+
+ ctrl = rd32(E1000_CTRL);
+ ctrl |= E1000_CTRL_SLU;
+@@ -940,44 +939,7 @@ static s32 igb_setup_copper_link_82575(struct e1000_hw *hw)
+ if (ret_val)
+ goto out;
+
+- if (hw->mac.autoneg) {
+- /*
+- * Setup autoneg and flow control advertisement
+- * and perform autonegotiation.
+- */
+- ret_val = igb_copper_link_autoneg(hw);
+- if (ret_val)
+- goto out;
+- } else {
+- /*
+- * PHY will be set to 10H, 10F, 100H or 100F
+- * depending on user settings.
+- */
+- hw_dbg("Forcing Speed and Duplex\n");
+- ret_val = hw->phy.ops.force_speed_duplex(hw);
+- if (ret_val) {
+- hw_dbg("Error Forcing Speed and Duplex\n");
+- goto out;
+- }
+- }
+-
+- /*
+- * Check link status. Wait up to 100 microseconds for link to become
+- * valid.
+- */
+- ret_val = igb_phy_has_link(hw, COPPER_LINK_UP_LIMIT, 10, &link);
+- if (ret_val)
+- goto out;
+-
+- if (link) {
+- hw_dbg("Valid link established!!!\n");
+- /* Config the MAC and PHY after link is up */
+- igb_config_collision_dist(hw);
+- ret_val = igb_config_fc_after_link_up(hw);
+- } else {
+- hw_dbg("Unable to establish link!!!\n");
+- }
+-
++ ret_val = igb_setup_copper_link(hw);
+ out:
+ return ret_val;
+ }
+diff --git a/drivers/net/igb/e1000_phy.c b/drivers/net/igb/e1000_phy.c
+index d4c928c..b27275d 100644
+--- a/drivers/net/igb/e1000_phy.c
++++ b/drivers/net/igb/e1000_phy.c
+@@ -669,7 +669,7 @@ out:
+ * and restart the negotiation process between the link partner. If
+ * autoneg_wait_to_complete, then wait for autoneg to complete before exiting.
+ **/
+-s32 igb_copper_link_autoneg(struct e1000_hw *hw)
++static s32 igb_copper_link_autoneg(struct e1000_hw *hw)
+ {
+ struct e1000_phy_info *phy = &hw->phy;
+ s32 ret_val;
+@@ -893,6 +893,65 @@ out:
+ }
+
+ /**
++ * igb_setup_copper_link - Configure copper link settings
++ * @hw: pointer to the HW structure
++ *
++ * Calls the appropriate function to configure the link for auto-neg or forced
++ * speed and duplex. Then we check for link, once link is established calls
++ * to configure collision distance and flow control are called. If link is
++ * not established, we return -E1000_ERR_PHY (-2).
++ **/
++s32 igb_setup_copper_link(struct e1000_hw *hw)
++{
++ s32 ret_val;
++ bool link;
++
++
++ if (hw->mac.autoneg) {
++ /*
++ * Setup autoneg and flow control advertisement and perform
++ * autonegotiation.
++ */
++ ret_val = igb_copper_link_autoneg(hw);
++ if (ret_val)
++ goto out;
++ } else {
++ /*
++ * PHY will be set to 10H, 10F, 100H or 100F
++ * depending on user settings.
++ */
++ hw_dbg("Forcing Speed and Duplex\n");
++ ret_val = hw->phy.ops.force_speed_duplex(hw);
++ if (ret_val) {
++ hw_dbg("Error Forcing Speed and Duplex\n");
++ goto out;
++ }
++ }
++
++ /*
++ * Check link status. Wait up to 100 microseconds for link to become
++ * valid.
++ */
++ ret_val = igb_phy_has_link(hw,
++ COPPER_LINK_UP_LIMIT,
++ 10,
++ &link);
++ if (ret_val)
++ goto out;
++
++ if (link) {
++ hw_dbg("Valid link established!!!\n");
++ igb_config_collision_dist(hw);
++ ret_val = igb_config_fc_after_link_up(hw);
++ } else {
++ hw_dbg("Unable to establish link!!!\n");
++ }
++
++out:
++ return ret_val;
++}
++
++/**
+ * igb_phy_force_speed_duplex_igp - Force speed/duplex for igp PHY
+ * @hw: pointer to the HW structure
+ *
+diff --git a/drivers/net/igb/e1000_phy.h b/drivers/net/igb/e1000_phy.h
+index 4c49803..adb9436 100644
+--- a/drivers/net/igb/e1000_phy.h
++++ b/drivers/net/igb/e1000_phy.h
+@@ -43,7 +43,6 @@ enum e1000_smart_speed {
+
+ s32 igb_check_downshift(struct e1000_hw *hw);
+ s32 igb_check_reset_block(struct e1000_hw *hw);
+-s32 igb_copper_link_autoneg(struct e1000_hw *hw);
+ s32 igb_copper_link_setup_igp(struct e1000_hw *hw);
+ s32 igb_copper_link_setup_m88(struct e1000_hw *hw);
+ s32 igb_phy_force_speed_duplex_igp(struct e1000_hw *hw);
+@@ -57,6 +56,7 @@ s32 igb_phy_sw_reset(struct e1000_hw *hw);
+ s32 igb_phy_hw_reset(struct e1000_hw *hw);
+ s32 igb_read_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 *data);
+ s32 igb_set_d3_lplu_state(struct e1000_hw *hw, bool active);
++s32 igb_setup_copper_link(struct e1000_hw *hw);
+ s32 igb_write_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 data);
+ s32 igb_phy_has_link(struct e1000_hw *hw, u32 iterations,
+ u32 usec_interval, bool *success);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0012-igb-add-code-to-retry-a-phy-read-in-the-event-of-fai.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0012-igb-add-code-to-retry-a-phy-read-in-the-event-of-fai.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,42 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Mon, 5 Oct 2009 06:35:23 +0000
+Subject: [PATCH 012/165] igb: add code to retry a phy read in the event of
+ failure on link check
+
+commit ab576389b733b458495529f81839f499b3fece78 upstream.
+
+This patch adds a retry to phy reads in the event of failure. The original
+code broke out of the loop on failure and this is a mistake as we should be
+trying to do the read twice.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/e1000_phy.c | 10 ++++++++--
+ 1 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/igb/e1000_phy.c b/drivers/net/igb/e1000_phy.c
+index b27275d..5fe03e1 100644
+--- a/drivers/net/igb/e1000_phy.c
++++ b/drivers/net/igb/e1000_phy.c
+@@ -1444,8 +1444,14 @@ s32 igb_phy_has_link(struct e1000_hw *hw, u32 iterations,
+ * it across the board.
+ */
+ ret_val = hw->phy.ops.read_reg(hw, PHY_STATUS, &phy_status);
+- if (ret_val)
+- break;
++ if (ret_val) {
++ /*
++ * If the first read fails, another entity may have
++ * ownership of the resources, wait and try again to
++ * see if they have relinquished the resources yet.
++ */
++ udelay(usec_interval);
++ }
+ ret_val = hw->phy.ops.read_reg(hw, PHY_STATUS, &phy_status);
+ if (ret_val)
+ break;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0013-igb-add-additional-error-handling-to-the-phy-code.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0013-igb-add-additional-error-handling-to-the-phy-code.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,124 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Mon, 5 Oct 2009 06:35:42 +0000
+Subject: [PATCH 013/165] igb: add additional error handling to the phy code
+
+commit 2553bb2681645bf932db2845121b8f33954f6f39 upstream.
+
+This update adds additional exception handling to the phy code to handle
+situations where it may be called incorrectly. In addition it adds some
+bounds checking to the cable length checks to prevent an array overrun in
+the event that the hardware returned a different value than expected.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/e1000_phy.c | 39 +++++++++++++++++++++++++--------------
+ 1 files changed, 25 insertions(+), 14 deletions(-)
+
+diff --git a/drivers/net/igb/e1000_phy.c b/drivers/net/igb/e1000_phy.c
+index 5fe03e1..83b706c 100644
+--- a/drivers/net/igb/e1000_phy.c
++++ b/drivers/net/igb/e1000_phy.c
+@@ -39,6 +39,9 @@ static s32 igb_wait_autoneg(struct e1000_hw *hw);
+ /* Cable length tables */
+ static const u16 e1000_m88_cable_length_table[] =
+ { 0, 50, 80, 110, 140, 140, E1000_CABLE_LENGTH_UNDEFINED };
++#define M88E1000_CABLE_LENGTH_TABLE_SIZE \
++ (sizeof(e1000_m88_cable_length_table) / \
++ sizeof(e1000_m88_cable_length_table[0]))
+
+ static const u16 e1000_igp_2_cable_length_table[] =
+ { 0, 0, 0, 0, 0, 0, 0, 0, 3, 5, 8, 11, 13, 16, 18, 21,
+@@ -109,7 +112,10 @@ out:
+ **/
+ static s32 igb_phy_reset_dsp(struct e1000_hw *hw)
+ {
+- s32 ret_val;
++ s32 ret_val = 0;
++
++ if (!(hw->phy.ops.write_reg))
++ goto out;
+
+ ret_val = hw->phy.ops.write_reg(hw, M88E1000_PHY_GEN_CONTROL, 0xC1);
+ if (ret_val)
+@@ -1059,22 +1065,19 @@ s32 igb_phy_force_speed_duplex_m88(struct e1000_hw *hw)
+
+ igb_phy_force_speed_duplex_setup(hw, &phy_data);
+
+- /* Reset the phy to commit changes. */
+- phy_data |= MII_CR_RESET;
+-
+ ret_val = phy->ops.write_reg(hw, PHY_CONTROL, phy_data);
+ if (ret_val)
+ goto out;
+
+- udelay(1);
++ /* Reset the phy to commit changes. */
++ ret_val = igb_phy_sw_reset(hw);
++ if (ret_val)
++ goto out;
+
+ if (phy->autoneg_wait_to_complete) {
+ hw_dbg("Waiting for forced speed/duplex link on M88 phy.\n");
+
+- ret_val = igb_phy_has_link(hw,
+- PHY_FORCE_LIMIT,
+- 100000,
+- &link);
++ ret_val = igb_phy_has_link(hw, PHY_FORCE_LIMIT, 100000, &link);
+ if (ret_val)
+ goto out;
+
+@@ -1084,8 +1087,8 @@ s32 igb_phy_force_speed_duplex_m88(struct e1000_hw *hw)
+ * Reset the DSP and cross our fingers.
+ */
+ ret_val = phy->ops.write_reg(hw,
+- M88E1000_PHY_PAGE_SELECT,
+- 0x001d);
++ M88E1000_PHY_PAGE_SELECT,
++ 0x001d);
+ if (ret_val)
+ goto out;
+ ret_val = igb_phy_reset_dsp(hw);
+@@ -1095,7 +1098,7 @@ s32 igb_phy_force_speed_duplex_m88(struct e1000_hw *hw)
+
+ /* Try once more */
+ ret_val = igb_phy_has_link(hw, PHY_FORCE_LIMIT,
+- 100000, &link);
++ 100000, &link);
+ if (ret_val)
+ goto out;
+ }
+@@ -1207,9 +1210,12 @@ static void igb_phy_force_speed_duplex_setup(struct e1000_hw *hw,
+ s32 igb_set_d3_lplu_state(struct e1000_hw *hw, bool active)
+ {
+ struct e1000_phy_info *phy = &hw->phy;
+- s32 ret_val;
++ s32 ret_val = 0;
+ u16 data;
+
++ if (!(hw->phy.ops.read_reg))
++ goto out;
++
+ ret_val = phy->ops.read_reg(hw, IGP02E1000_PHY_POWER_MGMT, &data);
+ if (ret_val)
+ goto out;
+@@ -1495,8 +1501,13 @@ s32 igb_get_cable_length_m88(struct e1000_hw *hw)
+
+ index = (phy_data & M88E1000_PSSR_CABLE_LENGTH) >>
+ M88E1000_PSSR_CABLE_LENGTH_SHIFT;
++ if (index >= M88E1000_CABLE_LENGTH_TABLE_SIZE - 1) {
++ ret_val = -E1000_ERR_PHY;
++ goto out;
++ }
++
+ phy->min_cable_length = e1000_m88_cable_length_table[index];
+- phy->max_cable_length = e1000_m88_cable_length_table[index+1];
++ phy->max_cable_length = e1000_m88_cable_length_table[index + 1];
+
+ phy->cable_length = (phy->min_cable_length + phy->max_cable_length) / 2;
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0014-igb-add-flushes-between-RAR-writes-when-setting-mac-.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0014-igb-add-flushes-between-RAR-writes-when-setting-mac-.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,42 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Mon, 5 Oct 2009 06:36:01 +0000
+Subject: [PATCH 014/165] igb: add flushes between RAR writes when setting mac
+ address
+
+commit 6deac6f2b46f84b8822683cce92eab4edf2ade5e upstream.
+
+There are some switches that will do write combining when they see two
+sequential regions written. In order to avoid any possible write combining
+issues it is necessary to add a flush after writing each piece of a rar
+register.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/e1000_mac.c | 7 +++++++
+ 1 files changed, 7 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/igb/e1000_mac.c b/drivers/net/igb/e1000_mac.c
+index 4969a5b..2ad358a 100644
+--- a/drivers/net/igb/e1000_mac.c
++++ b/drivers/net/igb/e1000_mac.c
+@@ -247,8 +247,15 @@ void igb_rar_set(struct e1000_hw *hw, u8 *addr, u32 index)
+ if (rar_low || rar_high)
+ rar_high |= E1000_RAH_AV;
+
++ /*
++ * Some bridges will combine consecutive 32-bit writes into
++ * a single burst write, which will malfunction on some parts.
++ * The flushes avoid this.
++ */
+ wr32(E1000_RAL(index), rar_low);
++ wrfl();
+ wr32(E1000_RAH(index), rar_high);
++ wrfl();
+ }
+
+ /**
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0015-igb-Use-the-instance-of-net_device_stats-from-net_de.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0015-igb-Use-the-instance-of-net_device_stats-from-net_de.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,181 @@
+From: Ajit Khaparde <ajitkhaparde at gmail.com>
+Date: Wed, 7 Oct 2009 02:42:56 +0000
+Subject: [PATCH 015/165] igb: Use the instance of net_device_stats from
+ net_device.
+
+commit 8d24e93309d688d59d4b6cf0b9cffc40337e067d upstream.
+
+Since net_device has an instance of net_device_stats,
+we can remove the instance of this from the adapter structure.
+
+Signed-off-by: Ajit Khaparde <ajitk at serverengines.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb.h | 1 -
+ drivers/net/igb/igb_ethtool.c | 20 +++++++++++---------
+ drivers/net/igb/igb_main.c | 39 +++++++++++++++++++--------------------
+ 3 files changed, 30 insertions(+), 30 deletions(-)
+
+diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
+index 7126fea..b805b1c 100644
+--- a/drivers/net/igb/igb.h
++++ b/drivers/net/igb/igb.h
+@@ -256,7 +256,6 @@ struct igb_adapter {
+ struct net_device *netdev;
+ struct napi_struct napi;
+ struct pci_dev *pdev;
+- struct net_device_stats net_stats;
+ struct cyclecounter cycles;
+ struct timecounter clock;
+ struct timecompare compare;
+diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
+index b243ed3..ee74425 100644
+--- a/drivers/net/igb/igb_ethtool.c
++++ b/drivers/net/igb/igb_ethtool.c
+@@ -46,6 +46,8 @@ struct igb_stats {
+
+ #define IGB_STAT(m) FIELD_SIZEOF(struct igb_adapter, m), \
+ offsetof(struct igb_adapter, m)
++#define IGB_NETDEV_STAT(m) FIELD_SIZEOF(struct net_device, m), \
++ offsetof(struct net_device, m)
+ static const struct igb_stats igb_gstrings_stats[] = {
+ { "rx_packets", IGB_STAT(stats.gprc) },
+ { "tx_packets", IGB_STAT(stats.gptc) },
+@@ -55,22 +57,22 @@ static const struct igb_stats igb_gstrings_stats[] = {
+ { "tx_broadcast", IGB_STAT(stats.bptc) },
+ { "rx_multicast", IGB_STAT(stats.mprc) },
+ { "tx_multicast", IGB_STAT(stats.mptc) },
+- { "rx_errors", IGB_STAT(net_stats.rx_errors) },
+- { "tx_errors", IGB_STAT(net_stats.tx_errors) },
+- { "tx_dropped", IGB_STAT(net_stats.tx_dropped) },
++ { "rx_errors", IGB_NETDEV_STAT(stats.rx_errors) },
++ { "tx_errors", IGB_NETDEV_STAT(stats.tx_errors) },
++ { "tx_dropped", IGB_NETDEV_STAT(stats.tx_dropped) },
+ { "multicast", IGB_STAT(stats.mprc) },
+ { "collisions", IGB_STAT(stats.colc) },
+- { "rx_length_errors", IGB_STAT(net_stats.rx_length_errors) },
+- { "rx_over_errors", IGB_STAT(net_stats.rx_over_errors) },
++ { "rx_length_errors", IGB_NETDEV_STAT(stats.rx_length_errors) },
++ { "rx_over_errors", IGB_NETDEV_STAT(stats.rx_over_errors) },
+ { "rx_crc_errors", IGB_STAT(stats.crcerrs) },
+- { "rx_frame_errors", IGB_STAT(net_stats.rx_frame_errors) },
++ { "rx_frame_errors", IGB_NETDEV_STAT(stats.rx_frame_errors) },
+ { "rx_no_buffer_count", IGB_STAT(stats.rnbc) },
+- { "rx_queue_drop_packet_count", IGB_STAT(net_stats.rx_fifo_errors) },
++ { "rx_queue_drop_packet_count", IGB_NETDEV_STAT(stats.rx_fifo_errors) },
+ { "rx_missed_errors", IGB_STAT(stats.mpc) },
+ { "tx_aborted_errors", IGB_STAT(stats.ecol) },
+ { "tx_carrier_errors", IGB_STAT(stats.tncrs) },
+- { "tx_fifo_errors", IGB_STAT(net_stats.tx_fifo_errors) },
+- { "tx_heartbeat_errors", IGB_STAT(net_stats.tx_heartbeat_errors) },
++ { "tx_fifo_errors", IGB_NETDEV_STAT(stats.tx_fifo_errors) },
++ { "tx_heartbeat_errors", IGB_NETDEV_STAT(stats.tx_heartbeat_errors) },
+ { "tx_window_errors", IGB_STAT(stats.latecol) },
+ { "tx_abort_late_coll", IGB_STAT(stats.latecol) },
+ { "tx_deferred_ok", IGB_STAT(stats.dc) },
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 1f604af..5054cbb 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -3534,10 +3534,8 @@ static void igb_reset_task(struct work_struct *work)
+ **/
+ static struct net_device_stats *igb_get_stats(struct net_device *netdev)
+ {
+- struct igb_adapter *adapter = netdev_priv(netdev);
+-
+ /* only return the current stats */
+- return &adapter->net_stats;
++ return &netdev->stats;
+ }
+
+ /**
+@@ -3623,6 +3621,7 @@ static int igb_change_mtu(struct net_device *netdev, int new_mtu)
+
+ void igb_update_stats(struct igb_adapter *adapter)
+ {
++ struct net_device *netdev = adapter->netdev;
+ struct e1000_hw *hw = &adapter->hw;
+ struct pci_dev *pdev = adapter->pdev;
+ u16 phy_tmp;
+@@ -3712,8 +3711,8 @@ void igb_update_stats(struct igb_adapter *adapter)
+ adapter->stats.icrxdmtc += rd32(E1000_ICRXDMTC);
+
+ /* Fill out the OS statistics structure */
+- adapter->net_stats.multicast = adapter->stats.mprc;
+- adapter->net_stats.collisions = adapter->stats.colc;
++ netdev->stats.multicast = adapter->stats.mprc;
++ netdev->stats.collisions = adapter->stats.colc;
+
+ /* Rx Errors */
+
+@@ -3734,7 +3733,7 @@ void igb_update_stats(struct igb_adapter *adapter)
+ adapter->rx_ring[i].rx_stats.drops += rqdpc_tmp;
+ rqdpc_total += adapter->rx_ring[i].rx_stats.drops;
+ }
+- adapter->net_stats.rx_fifo_errors = rqdpc_total;
++ netdev->stats.rx_fifo_errors = rqdpc_total;
+ }
+
+ /* Note RNBC (Receive No Buffers Count) is an not an exact
+@@ -3742,26 +3741,26 @@ void igb_update_stats(struct igb_adapter *adapter)
+ * one of the reason for saving it in rx_fifo_errors, as its
+ * potentially not a true drop.
+ */
+- adapter->net_stats.rx_fifo_errors += adapter->stats.rnbc;
++ netdev->stats.rx_fifo_errors += adapter->stats.rnbc;
+
+ /* RLEC on some newer hardware can be incorrect so build
+ * our own version based on RUC and ROC */
+- adapter->net_stats.rx_errors = adapter->stats.rxerrc +
++ netdev->stats.rx_errors = adapter->stats.rxerrc +
+ adapter->stats.crcerrs + adapter->stats.algnerrc +
+ adapter->stats.ruc + adapter->stats.roc +
+ adapter->stats.cexterr;
+- adapter->net_stats.rx_length_errors = adapter->stats.ruc +
++ netdev->stats.rx_length_errors = adapter->stats.ruc +
+ adapter->stats.roc;
+- adapter->net_stats.rx_crc_errors = adapter->stats.crcerrs;
+- adapter->net_stats.rx_frame_errors = adapter->stats.algnerrc;
+- adapter->net_stats.rx_missed_errors = adapter->stats.mpc;
++ netdev->stats.rx_crc_errors = adapter->stats.crcerrs;
++ netdev->stats.rx_frame_errors = adapter->stats.algnerrc;
++ netdev->stats.rx_missed_errors = adapter->stats.mpc;
+
+ /* Tx Errors */
+- adapter->net_stats.tx_errors = adapter->stats.ecol +
++ netdev->stats.tx_errors = adapter->stats.ecol +
+ adapter->stats.latecol;
+- adapter->net_stats.tx_aborted_errors = adapter->stats.ecol;
+- adapter->net_stats.tx_window_errors = adapter->stats.latecol;
+- adapter->net_stats.tx_carrier_errors = adapter->stats.tncrs;
++ netdev->stats.tx_aborted_errors = adapter->stats.ecol;
++ netdev->stats.tx_window_errors = adapter->stats.latecol;
++ netdev->stats.tx_carrier_errors = adapter->stats.tncrs;
+
+ /* Tx Dropped needs to be maintained elsewhere */
+
+@@ -4640,8 +4639,8 @@ static bool igb_clean_tx_irq(struct igb_ring *tx_ring)
+ tx_ring->total_packets += total_packets;
+ tx_ring->tx_stats.bytes += total_bytes;
+ tx_ring->tx_stats.packets += total_packets;
+- adapter->net_stats.tx_bytes += total_bytes;
+- adapter->net_stats.tx_packets += total_packets;
++ netdev->stats.tx_bytes += total_bytes;
++ netdev->stats.tx_packets += total_packets;
+ return (count < tx_ring->count);
+ }
+
+@@ -4884,8 +4883,8 @@ next_desc:
+ rx_ring->total_bytes += total_bytes;
+ rx_ring->rx_stats.packets += total_packets;
+ rx_ring->rx_stats.bytes += total_bytes;
+- adapter->net_stats.rx_bytes += total_bytes;
+- adapter->net_stats.rx_packets += total_packets;
++ netdev->stats.rx_bytes += total_bytes;
++ netdev->stats.rx_packets += total_packets;
+ return cleaned;
+ }
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0016-net-Use-netdev_alloc_skb_ip_align.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0016-net-Use-netdev_alloc_skb_ip_align.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,65 @@
+From: Eric Dumazet <eric.dumazet at gmail.com>
+Date: Tue, 13 Oct 2009 05:34:20 +0000
+Subject: [PATCH 016/165] net: Use netdev_alloc_skb_ip_align()
+
+commit 89d71a66c40d629e3b1285def543ab1425558cd5 upstream.
+
+Signed-off-by: Eric Dumazet <eric.dumazet at gmail.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Restricted to drivers/net/igb{,vf}]
+---
+ drivers/net/igb/igb_main.c | 8 +-------
+ drivers/net/igbvf/netdev.c | 8 +-------
+ 2 files changed, 2 insertions(+), 14 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 5054cbb..a4cd121 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -4934,18 +4934,12 @@ static void igb_alloc_rx_buffers_adv(struct igb_ring *rx_ring,
+ }
+
+ if (!buffer_info->skb) {
+- skb = netdev_alloc_skb(netdev, bufsz + NET_IP_ALIGN);
++ skb = netdev_alloc_skb_ip_align(netdev, bufsz);
+ if (!skb) {
+ adapter->alloc_rx_buff_failed++;
+ goto no_buffers;
+ }
+
+- /* Make buffer alignment 2 beyond a 16 byte boundary
+- * this will result in a 16 byte aligned IP header after
+- * the 14 byte MAC header is removed
+- */
+- skb_reserve(skb, NET_IP_ALIGN);
+-
+ buffer_info->skb = skb;
+ buffer_info->dma = pci_map_single(pdev, skb->data,
+ bufsz,
+diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
+index 91024a3..fad7f34 100644
+--- a/drivers/net/igbvf/netdev.c
++++ b/drivers/net/igbvf/netdev.c
+@@ -170,18 +170,12 @@ static void igbvf_alloc_rx_buffers(struct igbvf_ring *rx_ring,
+ }
+
+ if (!buffer_info->skb) {
+- skb = netdev_alloc_skb(netdev, bufsz + NET_IP_ALIGN);
++ skb = netdev_alloc_skb_ip_align(netdev, bufsz);
+ if (!skb) {
+ adapter->alloc_rx_buff_failed++;
+ goto no_buffers;
+ }
+
+- /* Make buffer alignment 2 beyond a 16 byte boundary
+- * this will result in a 16 byte aligned IP header after
+- * the 14 byte MAC header is removed
+- */
+- skb_reserve(skb, NET_IP_ALIGN);
+-
+ buffer_info->skb = skb;
+ buffer_info->dma = pci_map_single(pdev, skb->data,
+ bufsz,
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0017-igb-Fix-erroneous-display-of-stats-by-ethtool-S.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0017-igb-Fix-erroneous-display-of-stats-by-ethtool-S.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,73 @@
+From: Ajit Khaparde <ajitk at serverengines.com>
+Date: Tue, 13 Oct 2009 01:46:29 +0000
+Subject: [PATCH 017/165] igb: Fix erroneous display of stats by ethtool -S
+
+commit 231835e4163cf14c90e295f1729004f571ee1cc7 upstream.
+
+Commit 337e067d overlooked the way offsets for netdev stats were considered.
+Because of this some of the stats shown by ethtool -S were wrong.
+This patch fixes it.
+
+Signed-off-by: Ajit Khaparde <ajitk at serverengines.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_ethtool.c | 27 ++++++++++++++++++++++-----
+ 1 files changed, 22 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
+index ee74425..f7303d1 100644
+--- a/drivers/net/igb/igb_ethtool.c
++++ b/drivers/net/igb/igb_ethtool.c
+@@ -38,16 +38,22 @@
+
+ #include "igb.h"
+
++enum {NETDEV_STATS, IGB_STATS};
++
+ struct igb_stats {
+ char stat_string[ETH_GSTRING_LEN];
++ int type;
+ int sizeof_stat;
+ int stat_offset;
+ };
+
+-#define IGB_STAT(m) FIELD_SIZEOF(struct igb_adapter, m), \
+- offsetof(struct igb_adapter, m)
+-#define IGB_NETDEV_STAT(m) FIELD_SIZEOF(struct net_device, m), \
+- offsetof(struct net_device, m)
++#define IGB_STAT(m) IGB_STATS, \
++ FIELD_SIZEOF(struct igb_adapter, m), \
++ offsetof(struct igb_adapter, m)
++#define IGB_NETDEV_STAT(m) NETDEV_STATS, \
++ FIELD_SIZEOF(struct net_device, m), \
++ offsetof(struct net_device, m)
++
+ static const struct igb_stats igb_gstrings_stats[] = {
+ { "rx_packets", IGB_STAT(stats.gprc) },
+ { "tx_packets", IGB_STAT(stats.gptc) },
+@@ -1969,10 +1975,21 @@ static void igb_get_ethtool_stats(struct net_device *netdev,
+ int stat_count_rx = sizeof(struct igb_rx_queue_stats) / sizeof(u64);
+ int j;
+ int i;
++ char *p = NULL;
+
+ igb_update_stats(adapter);
+ for (i = 0; i < IGB_GLOBAL_STATS_LEN; i++) {
+- char *p = (char *)adapter+igb_gstrings_stats[i].stat_offset;
++ switch (igb_gstrings_stats[i].type) {
++ case NETDEV_STATS:
++ p = (char *) netdev +
++ igb_gstrings_stats[i].stat_offset;
++ break;
++ case IGB_STATS:
++ p = (char *) adapter +
++ igb_gstrings_stats[i].stat_offset;
++ break;
++ }
++
+ data[i] = (igb_gstrings_stats[i].sizeof_stat ==
+ sizeof(u64)) ? *(u64 *)p : *(u32 *)p;
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0018-igb-add-new-data-structure-for-handling-interrupts-a.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0018-igb-add-new-data-structure-for-handling-interrupts-a.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,1628 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 27 Oct 2009 15:49:27 +0000
+Subject: [PATCH 018/165] igb: add new data structure for handling interrupts
+ and NAPI
+
+commit 047e0030f1e601233ae5b03910602ec93c620bce upstream.
+
+Add a new igb_q_vector data structure to handle interrupts and NAPI. This
+helps to abstract the rings away from the adapter struct. In addition it
+allows for a bit of consolidation since a tx and rx ring can share a
+q_vector.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Adjust to apply on top of fixes cherry-picked in 2.6.32.y]
+---
+ drivers/net/igb/igb.h | 46 ++-
+ drivers/net/igb/igb_ethtool.c | 8 +-
+ drivers/net/igb/igb_main.c | 872 +++++++++++++++++++++++------------------
+ 3 files changed, 534 insertions(+), 392 deletions(-)
+
+diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
+index b805b1c..86492c8 100644
+--- a/drivers/net/igb/igb.h
++++ b/drivers/net/igb/igb.h
+@@ -55,6 +55,8 @@ struct igb_adapter;
+ #define IGB_DEFAULT_ITR 3 /* dynamic */
+ #define IGB_MAX_ITR_USECS 10000
+ #define IGB_MIN_ITR_USECS 10
++#define NON_Q_VECTORS 1
++#define MAX_Q_VECTORS 8
+
+ /* Transmit and receive queues */
+ #define IGB_MAX_RX_QUEUES (adapter->vfs_allocated_count ? \
+@@ -149,25 +151,38 @@ struct igb_rx_queue_stats {
+ u64 drops;
+ };
+
+-struct igb_ring {
++struct igb_q_vector {
+ struct igb_adapter *adapter; /* backlink */
+- void *desc; /* descriptor ring memory */
+- dma_addr_t dma; /* phys address of the ring */
+- unsigned int size; /* length of desc. ring in bytes */
+- unsigned int count; /* number of desc. in the ring */
++ struct igb_ring *rx_ring;
++ struct igb_ring *tx_ring;
++ struct napi_struct napi;
++
++ u32 eims_value;
++ u16 cpu;
++
++ u16 itr_val;
++ u8 set_itr;
++ u8 itr_shift;
++ void __iomem *itr_register;
++
++ char name[IFNAMSIZ + 9];
++};
++
++struct igb_ring {
++ struct igb_q_vector *q_vector; /* backlink to q_vector */
++ void *desc; /* descriptor ring memory */
++ dma_addr_t dma; /* phys address of the ring */
++ unsigned int size; /* length of desc. ring in bytes */
++ unsigned int count; /* number of desc. in the ring */
+ u16 next_to_use;
+ u16 next_to_clean;
+ u16 head;
+ u16 tail;
+ struct igb_buffer *buffer_info; /* array of buffer info structs */
+
+- u32 eims_value;
+- u32 itr_val;
+- u16 itr_register;
+- u16 cpu;
++ u8 queue_index;
++ u8 reg_idx;
+
+- u16 queue_index;
+- u16 reg_idx;
+ unsigned int total_bytes;
+ unsigned int total_packets;
+
+@@ -181,13 +196,8 @@ struct igb_ring {
+ struct {
+ struct igb_rx_queue_stats rx_stats;
+ u64 rx_queue_drops;
+- struct napi_struct napi;
+- int set_itr;
+- struct igb_ring *buddy;
+ };
+ };
+-
+- char name[IFNAMSIZ + 5];
+ };
+
+ #define E1000_RX_DESC_ADV(R, i) \
+@@ -254,7 +264,6 @@ struct igb_adapter {
+
+ /* OS defined structs */
+ struct net_device *netdev;
+- struct napi_struct napi;
+ struct pci_dev *pdev;
+ struct cyclecounter cycles;
+ struct timecounter clock;
+@@ -272,6 +281,9 @@ struct igb_adapter {
+ struct igb_ring test_rx_ring;
+
+ int msg_enable;
++
++ unsigned int num_q_vectors;
++ struct igb_q_vector *q_vector[MAX_Q_VECTORS];
+ struct msix_entry *msix_entries;
+ u32 eims_enable_mask;
+ u32 eims_other;
+diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
+index f7303d1..55d535c 100644
+--- a/drivers/net/igb/igb_ethtool.c
++++ b/drivers/net/igb/igb_ethtool.c
+@@ -1908,7 +1908,6 @@ static int igb_set_coalesce(struct net_device *netdev,
+ struct ethtool_coalesce *ec)
+ {
+ struct igb_adapter *adapter = netdev_priv(netdev);
+- struct e1000_hw *hw = &adapter->hw;
+ int i;
+
+ if ((ec->rx_coalesce_usecs > IGB_MAX_ITR_USECS) ||
+@@ -1926,8 +1925,11 @@ static int igb_set_coalesce(struct net_device *netdev,
+ adapter->itr = adapter->itr_setting;
+ }
+
+- for (i = 0; i < adapter->num_rx_queues; i++)
+- wr32(adapter->rx_ring[i].itr_register, adapter->itr);
++ for (i = 0; i < adapter->num_q_vectors; i++) {
++ struct igb_q_vector *q_vector = adapter->q_vector[i];
++ q_vector->itr_val = adapter->itr;
++ q_vector->set_itr = 1;
++ }
+
+ return 0;
+ }
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index a4cd121..95d5ab2 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -111,16 +111,14 @@ static void igb_set_uta(struct igb_adapter *adapter);
+ static irqreturn_t igb_intr(int irq, void *);
+ static irqreturn_t igb_intr_msi(int irq, void *);
+ static irqreturn_t igb_msix_other(int irq, void *);
+-static irqreturn_t igb_msix_rx(int irq, void *);
+-static irqreturn_t igb_msix_tx(int irq, void *);
++static irqreturn_t igb_msix_ring(int irq, void *);
+ #ifdef CONFIG_IGB_DCA
+-static void igb_update_rx_dca(struct igb_ring *);
+-static void igb_update_tx_dca(struct igb_ring *);
++static void igb_update_dca(struct igb_q_vector *);
+ static void igb_setup_dca(struct igb_adapter *);
+ #endif /* CONFIG_IGB_DCA */
+-static bool igb_clean_tx_irq(struct igb_ring *);
++static bool igb_clean_tx_irq(struct igb_q_vector *);
+ static int igb_poll(struct napi_struct *, int);
+-static bool igb_clean_rx_irq_adv(struct igb_ring *, int *, int);
++static bool igb_clean_rx_irq_adv(struct igb_q_vector *, int *, int);
+ static void igb_alloc_rx_buffers_adv(struct igb_ring *, int);
+ static int igb_ioctl(struct net_device *, struct ifreq *, int cmd);
+ static void igb_tx_timeout(struct net_device *);
+@@ -374,7 +372,7 @@ module_exit(igb_exit_module);
+ static void igb_cache_ring_register(struct igb_adapter *adapter)
+ {
+ int i;
+- unsigned int rbase_offset = adapter->vfs_allocated_count;
++ u32 rbase_offset = adapter->vfs_allocated_count;
+
+ switch (adapter->hw.mac.type) {
+ case e1000_82576:
+@@ -400,6 +398,18 @@ static void igb_cache_ring_register(struct igb_adapter *adapter)
+ }
+ }
+
++static void igb_free_queues(struct igb_adapter *adapter)
++{
++ kfree(adapter->tx_ring);
++ kfree(adapter->rx_ring);
++
++ adapter->tx_ring = NULL;
++ adapter->rx_ring = NULL;
++
++ adapter->num_rx_queues = 0;
++ adapter->num_tx_queues = 0;
++}
++
+ /**
+ * igb_alloc_queues - Allocate memory for all rings
+ * @adapter: board private structure to initialize
+@@ -414,59 +424,48 @@ static int igb_alloc_queues(struct igb_adapter *adapter)
+ adapter->tx_ring = kcalloc(adapter->num_tx_queues,
+ sizeof(struct igb_ring), GFP_KERNEL);
+ if (!adapter->tx_ring)
+- return -ENOMEM;
++ goto err;
+
+ adapter->rx_ring = kcalloc(adapter->num_rx_queues,
+ sizeof(struct igb_ring), GFP_KERNEL);
+- if (!adapter->rx_ring) {
+- kfree(adapter->tx_ring);
+- return -ENOMEM;
+- }
+-
+- adapter->rx_ring->buddy = adapter->tx_ring;
++ if (!adapter->rx_ring)
++ goto err;
+
+ for (i = 0; i < adapter->num_tx_queues; i++) {
+ struct igb_ring *ring = &(adapter->tx_ring[i]);
+ ring->count = adapter->tx_ring_count;
+- ring->adapter = adapter;
+ ring->queue_index = i;
+ }
+ for (i = 0; i < adapter->num_rx_queues; i++) {
+ struct igb_ring *ring = &(adapter->rx_ring[i]);
+ ring->count = adapter->rx_ring_count;
+- ring->adapter = adapter;
+ ring->queue_index = i;
+- ring->itr_register = E1000_ITR;
+-
+- /* set a default napi handler for each rx_ring */
+- netif_napi_add(adapter->netdev, &ring->napi, igb_poll, 64);
+ }
+
+ igb_cache_ring_register(adapter);
+- return 0;
+-}
+
+-static void igb_free_queues(struct igb_adapter *adapter)
+-{
+- int i;
+-
+- for (i = 0; i < adapter->num_rx_queues; i++)
+- netif_napi_del(&adapter->rx_ring[i].napi);
++ return 0;
+
+- adapter->num_rx_queues = 0;
+- adapter->num_tx_queues = 0;
++err:
++ igb_free_queues(adapter);
+
+- kfree(adapter->tx_ring);
+- kfree(adapter->rx_ring);
++ return -ENOMEM;
+ }
+
+ #define IGB_N0_QUEUE -1
+-static void igb_assign_vector(struct igb_adapter *adapter, int rx_queue,
+- int tx_queue, int msix_vector)
++static void igb_assign_vector(struct igb_q_vector *q_vector, int msix_vector)
+ {
+ u32 msixbm = 0;
++ struct igb_adapter *adapter = q_vector->adapter;
+ struct e1000_hw *hw = &adapter->hw;
+ u32 ivar, index;
++ int rx_queue = IGB_N0_QUEUE;
++ int tx_queue = IGB_N0_QUEUE;
++
++ if (q_vector->rx_ring)
++ rx_queue = q_vector->rx_ring->reg_idx;
++ if (q_vector->tx_ring)
++ tx_queue = q_vector->tx_ring->reg_idx;
+
+ switch (hw->mac.type) {
+ case e1000_82575:
+@@ -474,16 +473,12 @@ static void igb_assign_vector(struct igb_adapter *adapter, int rx_queue,
+ bitmask for the EICR/EIMS/EIMC registers. To assign one
+ or more queues to a vector, we write the appropriate bits
+ into the MSIXBM register for that vector. */
+- if (rx_queue > IGB_N0_QUEUE) {
++ if (rx_queue > IGB_N0_QUEUE)
+ msixbm = E1000_EICR_RX_QUEUE0 << rx_queue;
+- adapter->rx_ring[rx_queue].eims_value = msixbm;
+- }
+- if (tx_queue > IGB_N0_QUEUE) {
++ if (tx_queue > IGB_N0_QUEUE)
+ msixbm |= E1000_EICR_TX_QUEUE0 << tx_queue;
+- adapter->tx_ring[tx_queue].eims_value =
+- E1000_EICR_TX_QUEUE0 << tx_queue;
+- }
+ array_wr32(E1000_MSIXBM(0), msix_vector, msixbm);
++ q_vector->eims_value = msixbm;
+ break;
+ case e1000_82576:
+ /* 82576 uses a table-based method for assigning vectors.
+@@ -491,35 +486,34 @@ static void igb_assign_vector(struct igb_adapter *adapter, int rx_queue,
+ a vector number along with a "valid" bit. Sadly, the layout
+ of the table is somewhat counterintuitive. */
+ if (rx_queue > IGB_N0_QUEUE) {
+- index = (rx_queue >> 1) + adapter->vfs_allocated_count;
++ index = (rx_queue & 0x7);
+ ivar = array_rd32(E1000_IVAR0, index);
+- if (rx_queue & 0x1) {
+- /* vector goes into third byte of register */
+- ivar = ivar & 0xFF00FFFF;
+- ivar |= (msix_vector | E1000_IVAR_VALID) << 16;
+- } else {
++ if (rx_queue < 8) {
+ /* vector goes into low byte of register */
+ ivar = ivar & 0xFFFFFF00;
+ ivar |= msix_vector | E1000_IVAR_VALID;
++ } else {
++ /* vector goes into third byte of register */
++ ivar = ivar & 0xFF00FFFF;
++ ivar |= (msix_vector | E1000_IVAR_VALID) << 16;
+ }
+- adapter->rx_ring[rx_queue].eims_value= 1 << msix_vector;
+ array_wr32(E1000_IVAR0, index, ivar);
+ }
+ if (tx_queue > IGB_N0_QUEUE) {
+- index = (tx_queue >> 1) + adapter->vfs_allocated_count;
++ index = (tx_queue & 0x7);
+ ivar = array_rd32(E1000_IVAR0, index);
+- if (tx_queue & 0x1) {
+- /* vector goes into high byte of register */
+- ivar = ivar & 0x00FFFFFF;
+- ivar |= (msix_vector | E1000_IVAR_VALID) << 24;
+- } else {
++ if (tx_queue < 8) {
+ /* vector goes into second byte of register */
+ ivar = ivar & 0xFFFF00FF;
+ ivar |= (msix_vector | E1000_IVAR_VALID) << 8;
++ } else {
++ /* vector goes into high byte of register */
++ ivar = ivar & 0x00FFFFFF;
++ ivar |= (msix_vector | E1000_IVAR_VALID) << 24;
+ }
+- adapter->tx_ring[tx_queue].eims_value= 1 << msix_vector;
+ array_wr32(E1000_IVAR0, index, ivar);
+ }
++ q_vector->eims_value = 1 << msix_vector;
+ break;
+ default:
+ BUG();
+@@ -540,43 +534,10 @@ static void igb_configure_msix(struct igb_adapter *adapter)
+ struct e1000_hw *hw = &adapter->hw;
+
+ adapter->eims_enable_mask = 0;
+- if (hw->mac.type == e1000_82576)
+- /* Turn on MSI-X capability first, or our settings
+- * won't stick. And it will take days to debug. */
+- wr32(E1000_GPIE, E1000_GPIE_MSIX_MODE |
+- E1000_GPIE_PBA | E1000_GPIE_EIAME |
+- E1000_GPIE_NSICR);
+-
+- for (i = 0; i < adapter->num_tx_queues; i++) {
+- struct igb_ring *tx_ring = &adapter->tx_ring[i];
+- igb_assign_vector(adapter, IGB_N0_QUEUE, i, vector++);
+- adapter->eims_enable_mask |= tx_ring->eims_value;
+- if (tx_ring->itr_val)
+- writel(tx_ring->itr_val,
+- hw->hw_addr + tx_ring->itr_register);
+- else
+- writel(1, hw->hw_addr + tx_ring->itr_register);
+- }
+-
+- for (i = 0; i < adapter->num_rx_queues; i++) {
+- struct igb_ring *rx_ring = &adapter->rx_ring[i];
+- rx_ring->buddy = NULL;
+- igb_assign_vector(adapter, i, IGB_N0_QUEUE, vector++);
+- adapter->eims_enable_mask |= rx_ring->eims_value;
+- if (rx_ring->itr_val)
+- writel(rx_ring->itr_val,
+- hw->hw_addr + rx_ring->itr_register);
+- else
+- writel(1, hw->hw_addr + rx_ring->itr_register);
+- }
+-
+
+ /* set vector for other causes, i.e. link changes */
+ switch (hw->mac.type) {
+ case e1000_82575:
+- array_wr32(E1000_MSIXBM(0), vector++,
+- E1000_EIMS_OTHER);
+-
+ tmp = rd32(E1000_CTRL_EXT);
+ /* enable MSI-X PBA support*/
+ tmp |= E1000_CTRL_EXT_PBA_CLR;
+@@ -586,22 +547,40 @@ static void igb_configure_msix(struct igb_adapter *adapter)
+ tmp |= E1000_CTRL_EXT_IRCA;
+
+ wr32(E1000_CTRL_EXT, tmp);
+- adapter->eims_enable_mask |= E1000_EIMS_OTHER;
++
++ /* enable msix_other interrupt */
++ array_wr32(E1000_MSIXBM(0), vector++,
++ E1000_EIMS_OTHER);
+ adapter->eims_other = E1000_EIMS_OTHER;
+
+ break;
+
+ case e1000_82576:
++ /* Turn on MSI-X capability first, or our settings
++ * won't stick. And it will take days to debug. */
++ wr32(E1000_GPIE, E1000_GPIE_MSIX_MODE |
++ E1000_GPIE_PBA | E1000_GPIE_EIAME |
++ E1000_GPIE_NSICR);
++
++ /* enable msix_other interrupt */
++ adapter->eims_other = 1 << vector;
+ tmp = (vector++ | E1000_IVAR_VALID) << 8;
+- wr32(E1000_IVAR_MISC, tmp);
+
+- adapter->eims_enable_mask = (1 << (vector)) - 1;
+- adapter->eims_other = 1 << (vector - 1);
++ wr32(E1000_IVAR_MISC, tmp);
+ break;
+ default:
+ /* do nothing, since nothing else supports MSI-X */
+ break;
+ } /* switch (hw->mac.type) */
++
++ adapter->eims_enable_mask |= adapter->eims_other;
++
++ for (i = 0; i < adapter->num_q_vectors; i++) {
++ struct igb_q_vector *q_vector = adapter->q_vector[i];
++ igb_assign_vector(q_vector, vector++);
++ adapter->eims_enable_mask |= q_vector->eims_value;
++ }
++
+ wrfl();
+ }
+
+@@ -614,43 +593,40 @@ static void igb_configure_msix(struct igb_adapter *adapter)
+ static int igb_request_msix(struct igb_adapter *adapter)
+ {
+ struct net_device *netdev = adapter->netdev;
++ struct e1000_hw *hw = &adapter->hw;
+ int i, err = 0, vector = 0;
+
+- vector = 0;
+-
+- for (i = 0; i < adapter->num_tx_queues; i++) {
+- struct igb_ring *ring = &(adapter->tx_ring[i]);
+- sprintf(ring->name, "%s-tx-%d", netdev->name, i);
+- err = request_irq(adapter->msix_entries[vector].vector,
+- &igb_msix_tx, 0, ring->name,
+- &(adapter->tx_ring[i]));
+- if (err)
+- goto out;
+- ring->itr_register = E1000_EITR(0) + (vector << 2);
+- ring->itr_val = 976; /* ~4000 ints/sec */
+- vector++;
+- }
+- for (i = 0; i < adapter->num_rx_queues; i++) {
+- struct igb_ring *ring = &(adapter->rx_ring[i]);
+- if (strlen(netdev->name) < (IFNAMSIZ - 5))
+- sprintf(ring->name, "%s-rx-%d", netdev->name, i);
++ err = request_irq(adapter->msix_entries[vector].vector,
++ &igb_msix_other, 0, netdev->name, adapter);
++ if (err)
++ goto out;
++ vector++;
++
++ for (i = 0; i < adapter->num_q_vectors; i++) {
++ struct igb_q_vector *q_vector = adapter->q_vector[i];
++
++ q_vector->itr_register = hw->hw_addr + E1000_EITR(vector);
++
++ if (q_vector->rx_ring && q_vector->tx_ring)
++ sprintf(q_vector->name, "%s-TxRx-%u", netdev->name,
++ q_vector->rx_ring->queue_index);
++ else if (q_vector->tx_ring)
++ sprintf(q_vector->name, "%s-tx-%u", netdev->name,
++ q_vector->tx_ring->queue_index);
++ else if (q_vector->rx_ring)
++ sprintf(q_vector->name, "%s-rx-%u", netdev->name,
++ q_vector->rx_ring->queue_index);
+ else
+- memcpy(ring->name, netdev->name, IFNAMSIZ);
++ sprintf(q_vector->name, "%s-unused", netdev->name);
++
+ err = request_irq(adapter->msix_entries[vector].vector,
+- &igb_msix_rx, 0, ring->name,
+- &(adapter->rx_ring[i]));
++ &igb_msix_ring, 0, q_vector->name,
++ q_vector);
+ if (err)
+ goto out;
+- ring->itr_register = E1000_EITR(0) + (vector << 2);
+- ring->itr_val = adapter->itr;
+ vector++;
+ }
+
+- err = request_irq(adapter->msix_entries[vector].vector,
+- &igb_msix_other, 0, netdev->name, netdev);
+- if (err)
+- goto out;
+-
+ igb_configure_msix(adapter);
+ return 0;
+ out:
+@@ -663,11 +639,44 @@ static void igb_reset_interrupt_capability(struct igb_adapter *adapter)
+ pci_disable_msix(adapter->pdev);
+ kfree(adapter->msix_entries);
+ adapter->msix_entries = NULL;
+- } else if (adapter->flags & IGB_FLAG_HAS_MSI)
++ } else if (adapter->flags & IGB_FLAG_HAS_MSI) {
+ pci_disable_msi(adapter->pdev);
+- return;
++ }
+ }
+
++/**
++ * igb_free_q_vectors - Free memory allocated for interrupt vectors
++ * @adapter: board private structure to initialize
++ *
++ * This function frees the memory allocated to the q_vectors. In addition if
++ * NAPI is enabled it will delete any references to the NAPI struct prior
++ * to freeing the q_vector.
++ **/
++static void igb_free_q_vectors(struct igb_adapter *adapter)
++{
++ int v_idx;
++
++ for (v_idx = 0; v_idx < adapter->num_q_vectors; v_idx++) {
++ struct igb_q_vector *q_vector = adapter->q_vector[v_idx];
++ adapter->q_vector[v_idx] = NULL;
++ netif_napi_del(&q_vector->napi);
++ kfree(q_vector);
++ }
++ adapter->num_q_vectors = 0;
++}
++
++/**
++ * igb_clear_interrupt_scheme - reset the device to a state of no interrupts
++ *
++ * This function resets the device so that it has 0 rx queues, tx queues, and
++ * MSI-X interrupts allocated.
++ */
++static void igb_clear_interrupt_scheme(struct igb_adapter *adapter)
++{
++ igb_free_queues(adapter);
++ igb_free_q_vectors(adapter);
++ igb_reset_interrupt_capability(adapter);
++}
+
+ /**
+ * igb_set_interrupt_capability - set MSI or MSI-X if supported
+@@ -681,11 +690,20 @@ static void igb_set_interrupt_capability(struct igb_adapter *adapter)
+ int numvecs, i;
+
+ /* Number of supported queues. */
+- /* Having more queues than CPUs doesn't make sense. */
+ adapter->num_rx_queues = min_t(u32, IGB_MAX_RX_QUEUES, num_online_cpus());
+ adapter->num_tx_queues = min_t(u32, IGB_MAX_TX_QUEUES, num_online_cpus());
+
+- numvecs = adapter->num_tx_queues + adapter->num_rx_queues + 1;
++ /* start with one vector for every rx queue */
++ numvecs = adapter->num_rx_queues;
++
++ /* if tx handler is seperate add 1 for every tx queue */
++ numvecs += adapter->num_tx_queues;
++
++ /* store the number of vectors reserved for queues */
++ adapter->num_q_vectors = numvecs;
++
++ /* add 1 vector for link status interrupts */
++ numvecs++;
+ adapter->msix_entries = kcalloc(numvecs, sizeof(struct msix_entry),
+ GFP_KERNEL);
+ if (!adapter->msix_entries)
+@@ -721,6 +739,7 @@ msi_only:
+ #endif
+ adapter->num_rx_queues = 1;
+ adapter->num_tx_queues = 1;
++ adapter->num_q_vectors = 1;
+ if (!pci_enable_msi(adapter->pdev))
+ adapter->flags |= IGB_FLAG_HAS_MSI;
+ out:
+@@ -730,6 +749,139 @@ out:
+ }
+
+ /**
++ * igb_alloc_q_vectors - Allocate memory for interrupt vectors
++ * @adapter: board private structure to initialize
++ *
++ * We allocate one q_vector per queue interrupt. If allocation fails we
++ * return -ENOMEM.
++ **/
++static int igb_alloc_q_vectors(struct igb_adapter *adapter)
++{
++ struct igb_q_vector *q_vector;
++ struct e1000_hw *hw = &adapter->hw;
++ int v_idx;
++
++ for (v_idx = 0; v_idx < adapter->num_q_vectors; v_idx++) {
++ q_vector = kzalloc(sizeof(struct igb_q_vector), GFP_KERNEL);
++ if (!q_vector)
++ goto err_out;
++ q_vector->adapter = adapter;
++ q_vector->itr_shift = (hw->mac.type == e1000_82575) ? 16 : 0;
++ q_vector->itr_register = hw->hw_addr + E1000_EITR(0);
++ q_vector->itr_val = IGB_START_ITR;
++ q_vector->set_itr = 1;
++ netif_napi_add(adapter->netdev, &q_vector->napi, igb_poll, 64);
++ adapter->q_vector[v_idx] = q_vector;
++ }
++ return 0;
++
++err_out:
++ while (v_idx) {
++ v_idx--;
++ q_vector = adapter->q_vector[v_idx];
++ netif_napi_del(&q_vector->napi);
++ kfree(q_vector);
++ adapter->q_vector[v_idx] = NULL;
++ }
++ return -ENOMEM;
++}
++
++static void igb_map_rx_ring_to_vector(struct igb_adapter *adapter,
++ int ring_idx, int v_idx)
++{
++ struct igb_q_vector *q_vector;
++
++ q_vector = adapter->q_vector[v_idx];
++ q_vector->rx_ring = &adapter->rx_ring[ring_idx];
++ q_vector->rx_ring->q_vector = q_vector;
++ q_vector->itr_val = adapter->itr;
++}
++
++static void igb_map_tx_ring_to_vector(struct igb_adapter *adapter,
++ int ring_idx, int v_idx)
++{
++ struct igb_q_vector *q_vector;
++
++ q_vector = adapter->q_vector[v_idx];
++ q_vector->tx_ring = &adapter->tx_ring[ring_idx];
++ q_vector->tx_ring->q_vector = q_vector;
++ q_vector->itr_val = adapter->itr;
++}
++
++/**
++ * igb_map_ring_to_vector - maps allocated queues to vectors
++ *
++ * This function maps the recently allocated queues to vectors.
++ **/
++static int igb_map_ring_to_vector(struct igb_adapter *adapter)
++{
++ int i;
++ int v_idx = 0;
++
++ if ((adapter->num_q_vectors < adapter->num_rx_queues) ||
++ (adapter->num_q_vectors < adapter->num_tx_queues))
++ return -ENOMEM;
++
++ if (adapter->num_q_vectors >=
++ (adapter->num_rx_queues + adapter->num_tx_queues)) {
++ for (i = 0; i < adapter->num_rx_queues; i++)
++ igb_map_rx_ring_to_vector(adapter, i, v_idx++);
++ for (i = 0; i < adapter->num_tx_queues; i++)
++ igb_map_tx_ring_to_vector(adapter, i, v_idx++);
++ } else {
++ for (i = 0; i < adapter->num_rx_queues; i++) {
++ if (i < adapter->num_tx_queues)
++ igb_map_tx_ring_to_vector(adapter, i, v_idx);
++ igb_map_rx_ring_to_vector(adapter, i, v_idx++);
++ }
++ for (; i < adapter->num_tx_queues; i++)
++ igb_map_tx_ring_to_vector(adapter, i, v_idx++);
++ }
++ return 0;
++}
++
++/**
++ * igb_init_interrupt_scheme - initialize interrupts, allocate queues/vectors
++ *
++ * This function initializes the interrupts and allocates all of the queues.
++ **/
++static int igb_init_interrupt_scheme(struct igb_adapter *adapter)
++{
++ struct pci_dev *pdev = adapter->pdev;
++ int err;
++
++ igb_set_interrupt_capability(adapter);
++
++ err = igb_alloc_q_vectors(adapter);
++ if (err) {
++ dev_err(&pdev->dev, "Unable to allocate memory for vectors\n");
++ goto err_alloc_q_vectors;
++ }
++
++ err = igb_alloc_queues(adapter);
++ if (err) {
++ dev_err(&pdev->dev, "Unable to allocate memory for queues\n");
++ goto err_alloc_queues;
++ }
++
++ err = igb_map_ring_to_vector(adapter);
++ if (err) {
++ dev_err(&pdev->dev, "Invalid q_vector to ring mapping\n");
++ goto err_map_queues;
++ }
++
++
++ return 0;
++err_map_queues:
++ igb_free_queues(adapter);
++err_alloc_queues:
++ igb_free_q_vectors(adapter);
++err_alloc_q_vectors:
++ igb_reset_interrupt_capability(adapter);
++ return err;
++}
++
++/**
+ * igb_request_irq - initialize interrupts
+ *
+ * Attempts to configure interrupts using the best available
+@@ -738,6 +890,7 @@ out:
+ static int igb_request_irq(struct igb_adapter *adapter)
+ {
+ struct net_device *netdev = adapter->netdev;
++ struct pci_dev *pdev = adapter->pdev;
+ struct e1000_hw *hw = &adapter->hw;
+ int err = 0;
+
+@@ -746,18 +899,36 @@ static int igb_request_irq(struct igb_adapter *adapter)
+ if (!err)
+ goto request_done;
+ /* fall back to MSI */
+- igb_reset_interrupt_capability(adapter);
++ igb_clear_interrupt_scheme(adapter);
+ if (!pci_enable_msi(adapter->pdev))
+ adapter->flags |= IGB_FLAG_HAS_MSI;
+ igb_free_all_tx_resources(adapter);
+ igb_free_all_rx_resources(adapter);
++ adapter->num_tx_queues = 1;
+ adapter->num_rx_queues = 1;
+- igb_alloc_queues(adapter);
++ adapter->num_q_vectors = 1;
++ err = igb_alloc_q_vectors(adapter);
++ if (err) {
++ dev_err(&pdev->dev,
++ "Unable to allocate memory for vectors\n");
++ goto request_done;
++ }
++ err = igb_alloc_queues(adapter);
++ if (err) {
++ dev_err(&pdev->dev,
++ "Unable to allocate memory for queues\n");
++ igb_free_q_vectors(adapter);
++ goto request_done;
++ }
++ igb_setup_all_tx_resources(adapter);
++ igb_setup_all_rx_resources(adapter);
+ } else {
+ switch (hw->mac.type) {
+ case e1000_82575:
+ wr32(E1000_MSIXBM(0),
+- (E1000_EICR_RX_QUEUE0 | E1000_EIMS_OTHER));
++ (E1000_EICR_RX_QUEUE0 |
++ E1000_EICR_TX_QUEUE0 |
++ E1000_EIMS_OTHER));
+ break;
+ case e1000_82576:
+ wr32(E1000_IVAR0, E1000_IVAR_VALID);
+@@ -769,16 +940,17 @@ static int igb_request_irq(struct igb_adapter *adapter)
+
+ if (adapter->flags & IGB_FLAG_HAS_MSI) {
+ err = request_irq(adapter->pdev->irq, &igb_intr_msi, 0,
+- netdev->name, netdev);
++ netdev->name, adapter);
+ if (!err)
+ goto request_done;
++
+ /* fall back to legacy interrupts */
+ igb_reset_interrupt_capability(adapter);
+ adapter->flags &= ~IGB_FLAG_HAS_MSI;
+ }
+
+ err = request_irq(adapter->pdev->irq, &igb_intr, IRQF_SHARED,
+- netdev->name, netdev);
++ netdev->name, adapter);
+
+ if (err)
+ dev_err(&adapter->pdev->dev, "Error %d getting interrupt\n",
+@@ -790,23 +962,19 @@ request_done:
+
+ static void igb_free_irq(struct igb_adapter *adapter)
+ {
+- struct net_device *netdev = adapter->netdev;
+-
+ if (adapter->msix_entries) {
+ int vector = 0, i;
+
+- for (i = 0; i < adapter->num_tx_queues; i++)
+- free_irq(adapter->msix_entries[vector++].vector,
+- &(adapter->tx_ring[i]));
+- for (i = 0; i < adapter->num_rx_queues; i++)
+- free_irq(adapter->msix_entries[vector++].vector,
+- &(adapter->rx_ring[i]));
++ free_irq(adapter->msix_entries[vector++].vector, adapter);
+
+- free_irq(adapter->msix_entries[vector++].vector, netdev);
+- return;
++ for (i = 0; i < adapter->num_q_vectors; i++) {
++ struct igb_q_vector *q_vector = adapter->q_vector[i];
++ free_irq(adapter->msix_entries[vector++].vector,
++ q_vector);
++ }
++ } else {
++ free_irq(adapter->pdev->irq, adapter);
+ }
+-
+- free_irq(adapter->pdev->irq, netdev);
+ }
+
+ /**
+@@ -967,8 +1135,10 @@ int igb_up(struct igb_adapter *adapter)
+
+ clear_bit(__IGB_DOWN, &adapter->state);
+
+- for (i = 0; i < adapter->num_rx_queues; i++)
+- napi_enable(&adapter->rx_ring[i].napi);
++ for (i = 0; i < adapter->num_q_vectors; i++) {
++ struct igb_q_vector *q_vector = adapter->q_vector[i];
++ napi_enable(&q_vector->napi);
++ }
+ if (adapter->msix_entries)
+ igb_configure_msix(adapter);
+
+@@ -1012,8 +1182,10 @@ void igb_down(struct igb_adapter *adapter)
+ wrfl();
+ msleep(10);
+
+- for (i = 0; i < adapter->num_rx_queues; i++)
+- napi_disable(&adapter->rx_ring[i].napi);
++ for (i = 0; i < adapter->num_q_vectors; i++) {
++ struct igb_q_vector *q_vector = adapter->q_vector[i];
++ napi_disable(&q_vector->napi);
++ }
+
+ igb_irq_disable(adapter);
+
+@@ -1584,9 +1756,8 @@ err_eeprom:
+
+ if (hw->flash_address)
+ iounmap(hw->flash_address);
+-
+- igb_free_queues(adapter);
+ err_sw_init:
++ igb_clear_interrupt_scheme(adapter);
+ iounmap(hw->hw_addr);
+ err_ioremap:
+ free_netdev(netdev);
+@@ -1640,9 +1811,7 @@ static void __devexit igb_remove(struct pci_dev *pdev)
+ if (!igb_check_reset_block(&adapter->hw))
+ igb_reset_phy(&adapter->hw);
+
+- igb_reset_interrupt_capability(adapter);
+-
+- igb_free_queues(adapter);
++ igb_clear_interrupt_scheme(adapter);
+
+ #ifdef CONFIG_PCI_IOV
+ /* reclaim resources allocated to VFs */
+@@ -1696,9 +1865,7 @@ static int __devinit igb_sw_init(struct igb_adapter *adapter)
+
+ /* This call may decrease the number of queues depending on
+ * interrupt mode. */
+- igb_set_interrupt_capability(adapter);
+-
+- if (igb_alloc_queues(adapter)) {
++ if (igb_init_interrupt_scheme(adapter)) {
+ dev_err(&pdev->dev, "Unable to allocate memory for queues\n");
+ return -ENOMEM;
+ }
+@@ -1768,8 +1935,10 @@ static int igb_open(struct net_device *netdev)
+ /* From here on the code is the same as igb_up() */
+ clear_bit(__IGB_DOWN, &adapter->state);
+
+- for (i = 0; i < adapter->num_rx_queues; i++)
+- napi_enable(&adapter->rx_ring[i].napi);
++ for (i = 0; i < adapter->num_q_vectors; i++) {
++ struct igb_q_vector *q_vector = adapter->q_vector[i];
++ napi_enable(&q_vector->napi);
++ }
+
+ /* Clear any pending interrupts. */
+ rd32(E1000_ICR);
+@@ -1858,14 +2027,13 @@ int igb_setup_tx_resources(struct igb_adapter *adapter,
+ if (!tx_ring->desc)
+ goto err;
+
+- tx_ring->adapter = adapter;
+ tx_ring->next_to_use = 0;
+ tx_ring->next_to_clean = 0;
+ return 0;
+
+ err:
+ vfree(tx_ring->buffer_info);
+- dev_err(&adapter->pdev->dev,
++ dev_err(&pdev->dev,
+ "Unable to allocate memory for the transmit descriptor ring\n");
+ return -ENOMEM;
+ }
+@@ -1996,8 +2164,6 @@ int igb_setup_rx_resources(struct igb_adapter *adapter,
+ rx_ring->next_to_clean = 0;
+ rx_ring->next_to_use = 0;
+
+- rx_ring->adapter = adapter;
+-
+ return 0;
+
+ err:
+@@ -2308,7 +2474,7 @@ static void igb_configure_rx(struct igb_adapter *adapter)
+ **/
+ void igb_free_tx_resources(struct igb_ring *tx_ring)
+ {
+- struct pci_dev *pdev = tx_ring->adapter->pdev;
++ struct pci_dev *pdev = tx_ring->q_vector->adapter->pdev;
+
+ igb_clean_tx_ring(tx_ring);
+
+@@ -2354,7 +2520,7 @@ static void igb_unmap_and_free_tx_resource(struct igb_adapter *adapter,
+ **/
+ static void igb_clean_tx_ring(struct igb_ring *tx_ring)
+ {
+- struct igb_adapter *adapter = tx_ring->adapter;
++ struct igb_adapter *adapter = tx_ring->q_vector->adapter;
+ struct igb_buffer *buffer_info;
+ unsigned long size;
+ unsigned int i;
+@@ -2402,7 +2568,7 @@ static void igb_clean_all_tx_rings(struct igb_adapter *adapter)
+ **/
+ void igb_free_rx_resources(struct igb_ring *rx_ring)
+ {
+- struct pci_dev *pdev = rx_ring->adapter->pdev;
++ struct pci_dev *pdev = rx_ring->q_vector->adapter->pdev;
+
+ igb_clean_rx_ring(rx_ring);
+
+@@ -2434,7 +2600,7 @@ static void igb_free_all_rx_resources(struct igb_adapter *adapter)
+ **/
+ static void igb_clean_rx_ring(struct igb_ring *rx_ring)
+ {
+- struct igb_adapter *adapter = rx_ring->adapter;
++ struct igb_adapter *adapter = rx_ring->q_vector->adapter;
+ struct igb_buffer *buffer_info;
+ struct pci_dev *pdev = adapter->pdev;
+ unsigned long size;
+@@ -2749,7 +2915,6 @@ static void igb_watchdog_task(struct work_struct *work)
+ struct net_device *netdev = adapter->netdev;
+ struct igb_ring *tx_ring = adapter->tx_ring;
+ u32 link;
+- u32 eics = 0;
+ int i;
+
+ link = igb_has_link(adapter);
+@@ -2848,8 +3013,11 @@ link_up:
+
+ /* Cause software interrupt to ensure rx ring is cleaned */
+ if (adapter->msix_entries) {
+- for (i = 0; i < adapter->num_rx_queues; i++)
+- eics |= adapter->rx_ring[i].eims_value;
++ u32 eics = 0;
++ for (i = 0; i < adapter->num_q_vectors; i++) {
++ struct igb_q_vector *q_vector = adapter->q_vector[i];
++ eics |= q_vector->eims_value;
++ }
+ wr32(E1000_EICS, eics);
+ } else {
+ wr32(E1000_ICS, E1000_ICS_RXDMT0);
+@@ -2886,25 +3054,37 @@ enum latency_range {
+ * parameter (see igb_param.c)
+ * NOTE: This function is called only when operating in a multiqueue
+ * receive environment.
+- * @rx_ring: pointer to ring
++ * @q_vector: pointer to q_vector
+ **/
+-static void igb_update_ring_itr(struct igb_ring *rx_ring)
++static void igb_update_ring_itr(struct igb_q_vector *q_vector)
+ {
+- int new_val = rx_ring->itr_val;
++ int new_val = q_vector->itr_val;
+ int avg_wire_size = 0;
+- struct igb_adapter *adapter = rx_ring->adapter;
+-
+- if (!rx_ring->total_packets)
+- goto clear_counts; /* no packets, so don't do anything */
++ struct igb_adapter *adapter = q_vector->adapter;
+
+ /* For non-gigabit speeds, just fix the interrupt rate at 4000
+ * ints/sec - ITR timer value of 120 ticks.
+ */
+ if (adapter->link_speed != SPEED_1000) {
+- new_val = 120;
++ new_val = 976;
+ goto set_itr_val;
+ }
+- avg_wire_size = rx_ring->total_bytes / rx_ring->total_packets;
++
++ if (q_vector->rx_ring && q_vector->rx_ring->total_packets) {
++ struct igb_ring *ring = q_vector->rx_ring;
++ avg_wire_size = ring->total_bytes / ring->total_packets;
++ }
++
++ if (q_vector->tx_ring && q_vector->tx_ring->total_packets) {
++ struct igb_ring *ring = q_vector->tx_ring;
++ avg_wire_size = max_t(u32, avg_wire_size,
++ (ring->total_bytes /
++ ring->total_packets));
++ }
++
++ /* if avg_wire_size isn't set no work was done */
++ if (!avg_wire_size)
++ goto clear_counts;
+
+ /* Add 24 bytes to size to account for CRC, preamble, and gap */
+ avg_wire_size += 24;
+@@ -2919,13 +3099,19 @@ static void igb_update_ring_itr(struct igb_ring *rx_ring)
+ new_val = avg_wire_size / 2;
+
+ set_itr_val:
+- if (new_val != rx_ring->itr_val) {
+- rx_ring->itr_val = new_val;
+- rx_ring->set_itr = 1;
++ if (new_val != q_vector->itr_val) {
++ q_vector->itr_val = new_val;
++ q_vector->set_itr = 1;
+ }
+ clear_counts:
+- rx_ring->total_bytes = 0;
+- rx_ring->total_packets = 0;
++ if (q_vector->rx_ring) {
++ q_vector->rx_ring->total_bytes = 0;
++ q_vector->rx_ring->total_packets = 0;
++ }
++ if (q_vector->tx_ring) {
++ q_vector->tx_ring->total_bytes = 0;
++ q_vector->tx_ring->total_packets = 0;
++ }
+ }
+
+ /**
+@@ -2942,7 +3128,7 @@ clear_counts:
+ * NOTE: These calculations are only valid when operating in a single-
+ * queue environment.
+ * @adapter: pointer to adapter
+- * @itr_setting: current adapter->itr
++ * @itr_setting: current q_vector->itr_val
+ * @packets: the number of packets during this measurement interval
+ * @bytes: the number of bytes during this measurement interval
+ **/
+@@ -2994,8 +3180,9 @@ update_itr_done:
+
+ static void igb_set_itr(struct igb_adapter *adapter)
+ {
++ struct igb_q_vector *q_vector = adapter->q_vector[0];
+ u16 current_itr;
+- u32 new_itr = adapter->itr;
++ u32 new_itr = q_vector->itr_val;
+
+ /* for non-gigabit speeds, just fix the interrupt rate at 4000 */
+ if (adapter->link_speed != SPEED_1000) {
+@@ -3009,15 +3196,11 @@ static void igb_set_itr(struct igb_adapter *adapter)
+ adapter->rx_ring->total_packets,
+ adapter->rx_ring->total_bytes);
+
+- if (adapter->rx_ring->buddy) {
+- adapter->tx_itr = igb_update_itr(adapter,
+- adapter->tx_itr,
+- adapter->tx_ring->total_packets,
+- adapter->tx_ring->total_bytes);
+- current_itr = max(adapter->rx_itr, adapter->tx_itr);
+- } else {
+- current_itr = adapter->rx_itr;
+- }
++ adapter->tx_itr = igb_update_itr(adapter,
++ adapter->tx_itr,
++ adapter->tx_ring->total_packets,
++ adapter->tx_ring->total_bytes);
++ current_itr = max(adapter->rx_itr, adapter->tx_itr);
+
+ /* conservative mode (itr 3) eliminates the lowest_latency setting */
+ if (adapter->itr_setting == 3 && current_itr == lowest_latency)
+@@ -3041,18 +3224,17 @@ static void igb_set_itr(struct igb_adapter *adapter)
+ set_itr_now:
+ adapter->rx_ring->total_bytes = 0;
+ adapter->rx_ring->total_packets = 0;
+- if (adapter->rx_ring->buddy) {
+- adapter->rx_ring->buddy->total_bytes = 0;
+- adapter->rx_ring->buddy->total_packets = 0;
+- }
++ adapter->tx_ring->total_bytes = 0;
++ adapter->tx_ring->total_packets = 0;
+
+- if (new_itr != adapter->itr) {
++ if (new_itr != q_vector->itr_val) {
+ /* this attempts to bias the interrupt rate towards Bulk
+ * by adding intermediate steps when interrupt rate is
+ * increasing */
+- new_itr = new_itr > adapter->itr ?
+- max((new_itr * adapter->itr) /
+- (new_itr + (adapter->itr >> 2)), new_itr) :
++ new_itr = new_itr > q_vector->itr_val ?
++ max((new_itr * q_vector->itr_val) /
++ (new_itr + (q_vector->itr_val >> 2)),
++ new_itr) :
+ new_itr;
+ /* Don't write the value here; it resets the adapter's
+ * internal timer, and causes us to delay far longer than
+@@ -3060,15 +3242,13 @@ set_itr_now:
+ * value at the beginning of the next interrupt so the timing
+ * ends up being correct.
+ */
+- adapter->itr = new_itr;
+- adapter->rx_ring->itr_val = new_itr;
+- adapter->rx_ring->set_itr = 1;
++ q_vector->itr_val = new_itr;
++ q_vector->set_itr = 1;
+ }
+
+ return;
+ }
+
+-
+ #define IGB_TX_FLAGS_CSUM 0x00000001
+ #define IGB_TX_FLAGS_VLAN 0x00000002
+ #define IGB_TX_FLAGS_TSO 0x00000004
+@@ -3781,14 +3961,12 @@ void igb_update_stats(struct igb_adapter *adapter)
+
+ static irqreturn_t igb_msix_other(int irq, void *data)
+ {
+- struct net_device *netdev = data;
+- struct igb_adapter *adapter = netdev_priv(netdev);
++ struct igb_adapter *adapter = data;
+ struct e1000_hw *hw = &adapter->hw;
+ u32 icr = rd32(E1000_ICR);
+-
+ /* reading ICR causes bit 31 of EICR to be cleared */
+
+- if(icr & E1000_ICR_DOUTSYNC) {
++ if (icr & E1000_ICR_DOUTSYNC) {
+ /* HW is reporting DMA is out of sync */
+ adapter->stats.doosync++;
+ }
+@@ -3810,119 +3988,79 @@ static irqreturn_t igb_msix_other(int irq, void *data)
+ return IRQ_HANDLED;
+ }
+
+-static irqreturn_t igb_msix_tx(int irq, void *data)
++static void igb_write_itr(struct igb_q_vector *q_vector)
+ {
+- struct igb_ring *tx_ring = data;
+- struct igb_adapter *adapter = tx_ring->adapter;
+- struct e1000_hw *hw = &adapter->hw;
++ u32 itr_val = q_vector->itr_val & 0x7FFC;
+
+-#ifdef CONFIG_IGB_DCA
+- if (adapter->flags & IGB_FLAG_DCA_ENABLED)
+- igb_update_tx_dca(tx_ring);
+-#endif
++ if (!q_vector->set_itr)
++ return;
+
+- tx_ring->total_bytes = 0;
+- tx_ring->total_packets = 0;
++ if (!itr_val)
++ itr_val = 0x4;
+
+- /* auto mask will automatically reenable the interrupt when we write
+- * EICS */
+- if (!igb_clean_tx_irq(tx_ring))
+- /* Ring was not completely cleaned, so fire another interrupt */
+- wr32(E1000_EICS, tx_ring->eims_value);
++ if (q_vector->itr_shift)
++ itr_val |= itr_val << q_vector->itr_shift;
+ else
+- wr32(E1000_EIMS, tx_ring->eims_value);
++ itr_val |= 0x8000000;
+
+- return IRQ_HANDLED;
+-}
+-
+-static void igb_write_itr(struct igb_ring *ring)
+-{
+- struct e1000_hw *hw = &ring->adapter->hw;
+- if ((ring->adapter->itr_setting & 3) && ring->set_itr) {
+- switch (hw->mac.type) {
+- case e1000_82576:
+- wr32(ring->itr_register, ring->itr_val |
+- 0x80000000);
+- break;
+- default:
+- wr32(ring->itr_register, ring->itr_val |
+- (ring->itr_val << 16));
+- break;
+- }
+- ring->set_itr = 0;
+- }
++ writel(itr_val, q_vector->itr_register);
++ q_vector->set_itr = 0;
+ }
+
+-static irqreturn_t igb_msix_rx(int irq, void *data)
++static irqreturn_t igb_msix_ring(int irq, void *data)
+ {
+- struct igb_ring *rx_ring = data;
+-
+- /* Write the ITR value calculated at the end of the
+- * previous interrupt.
+- */
++ struct igb_q_vector *q_vector = data;
+
+- igb_write_itr(rx_ring);
++ /* Write the ITR value calculated from the previous interrupt. */
++ igb_write_itr(q_vector);
+
+- if (napi_schedule_prep(&rx_ring->napi))
+- __napi_schedule(&rx_ring->napi);
++ napi_schedule(&q_vector->napi);
+
+-#ifdef CONFIG_IGB_DCA
+- if (rx_ring->adapter->flags & IGB_FLAG_DCA_ENABLED)
+- igb_update_rx_dca(rx_ring);
+-#endif
+- return IRQ_HANDLED;
++ return IRQ_HANDLED;
+ }
+
+ #ifdef CONFIG_IGB_DCA
+-static void igb_update_rx_dca(struct igb_ring *rx_ring)
++static void igb_update_dca(struct igb_q_vector *q_vector)
+ {
+- u32 dca_rxctrl;
+- struct igb_adapter *adapter = rx_ring->adapter;
++ struct igb_adapter *adapter = q_vector->adapter;
+ struct e1000_hw *hw = &adapter->hw;
+ int cpu = get_cpu();
+- int q = rx_ring->reg_idx;
+
+- if (rx_ring->cpu != cpu) {
+- dca_rxctrl = rd32(E1000_DCA_RXCTRL(q));
+- if (hw->mac.type == e1000_82576) {
+- dca_rxctrl &= ~E1000_DCA_RXCTRL_CPUID_MASK_82576;
+- dca_rxctrl |= dca3_get_tag(&adapter->pdev->dev, cpu) <<
+- E1000_DCA_RXCTRL_CPUID_SHIFT;
++ if (q_vector->cpu == cpu)
++ goto out_no_update;
++
++ if (q_vector->tx_ring) {
++ int q = q_vector->tx_ring->reg_idx;
++ u32 dca_txctrl = rd32(E1000_DCA_TXCTRL(q));
++ if (hw->mac.type == e1000_82575) {
++ dca_txctrl &= ~E1000_DCA_TXCTRL_CPUID_MASK;
++ dca_txctrl |= dca3_get_tag(&adapter->pdev->dev, cpu);
+ } else {
++ dca_txctrl &= ~E1000_DCA_TXCTRL_CPUID_MASK_82576;
++ dca_txctrl |= dca3_get_tag(&adapter->pdev->dev, cpu) <<
++ E1000_DCA_TXCTRL_CPUID_SHIFT;
++ }
++ dca_txctrl |= E1000_DCA_TXCTRL_DESC_DCA_EN;
++ wr32(E1000_DCA_TXCTRL(q), dca_txctrl);
++ }
++ if (q_vector->rx_ring) {
++ int q = q_vector->rx_ring->reg_idx;
++ u32 dca_rxctrl = rd32(E1000_DCA_RXCTRL(q));
++ if (hw->mac.type == e1000_82575) {
+ dca_rxctrl &= ~E1000_DCA_RXCTRL_CPUID_MASK;
+ dca_rxctrl |= dca3_get_tag(&adapter->pdev->dev, cpu);
++ } else {
++ dca_rxctrl &= ~E1000_DCA_RXCTRL_CPUID_MASK_82576;
++ dca_rxctrl |= dca3_get_tag(&adapter->pdev->dev, cpu) <<
++ E1000_DCA_RXCTRL_CPUID_SHIFT;
+ }
+ dca_rxctrl |= E1000_DCA_RXCTRL_DESC_DCA_EN;
+ dca_rxctrl |= E1000_DCA_RXCTRL_HEAD_DCA_EN;
+ dca_rxctrl |= E1000_DCA_RXCTRL_DATA_DCA_EN;
+ wr32(E1000_DCA_RXCTRL(q), dca_rxctrl);
+- rx_ring->cpu = cpu;
+- }
+- put_cpu();
+-}
+-
+-static void igb_update_tx_dca(struct igb_ring *tx_ring)
+-{
+- u32 dca_txctrl;
+- struct igb_adapter *adapter = tx_ring->adapter;
+- struct e1000_hw *hw = &adapter->hw;
+- int cpu = get_cpu();
+- int q = tx_ring->reg_idx;
+-
+- if (tx_ring->cpu != cpu) {
+- dca_txctrl = rd32(E1000_DCA_TXCTRL(q));
+- if (hw->mac.type == e1000_82576) {
+- dca_txctrl &= ~E1000_DCA_TXCTRL_CPUID_MASK_82576;
+- dca_txctrl |= dca3_get_tag(&adapter->pdev->dev, cpu) <<
+- E1000_DCA_TXCTRL_CPUID_SHIFT;
+- } else {
+- dca_txctrl &= ~E1000_DCA_TXCTRL_CPUID_MASK;
+- dca_txctrl |= dca3_get_tag(&adapter->pdev->dev, cpu);
+- }
+- dca_txctrl |= E1000_DCA_TXCTRL_DESC_DCA_EN;
+- wr32(E1000_DCA_TXCTRL(q), dca_txctrl);
+- tx_ring->cpu = cpu;
+ }
++ q_vector->cpu = cpu;
++out_no_update:
+ put_cpu();
+ }
+
+@@ -3937,13 +4075,10 @@ static void igb_setup_dca(struct igb_adapter *adapter)
+ /* Always use CB2 mode, difference is masked in the CB driver. */
+ wr32(E1000_DCA_CTRL, E1000_DCA_CTRL_DCA_MODE_CB2);
+
+- for (i = 0; i < adapter->num_tx_queues; i++) {
+- adapter->tx_ring[i].cpu = -1;
+- igb_update_tx_dca(&adapter->tx_ring[i]);
+- }
+- for (i = 0; i < adapter->num_rx_queues; i++) {
+- adapter->rx_ring[i].cpu = -1;
+- igb_update_rx_dca(&adapter->rx_ring[i]);
++ for (i = 0; i < adapter->num_q_vectors; i++) {
++ struct igb_q_vector *q_vector = adapter->q_vector[i];
++ q_vector->cpu = -1;
++ igb_update_dca(q_vector);
+ }
+ }
+
+@@ -3972,7 +4107,7 @@ static int __igb_notify_dca(struct device *dev, void *data)
+ case DCA_PROVIDER_REMOVE:
+ if (adapter->flags & IGB_FLAG_DCA_ENABLED) {
+ /* without this a class_device is left
+- * hanging around in the sysfs model */
++ * hanging around in the sysfs model */
+ dca_remove_requester(dev);
+ dev_info(&adapter->pdev->dev, "DCA disabled\n");
+ adapter->flags &= ~IGB_FLAG_DCA_ENABLED;
+@@ -4379,15 +4514,15 @@ static void igb_set_uta(struct igb_adapter *adapter)
+ **/
+ static irqreturn_t igb_intr_msi(int irq, void *data)
+ {
+- struct net_device *netdev = data;
+- struct igb_adapter *adapter = netdev_priv(netdev);
++ struct igb_adapter *adapter = data;
++ struct igb_q_vector *q_vector = adapter->q_vector[0];
+ struct e1000_hw *hw = &adapter->hw;
+ /* read ICR disables interrupts using IAM */
+ u32 icr = rd32(E1000_ICR);
+
+- igb_write_itr(adapter->rx_ring);
++ igb_write_itr(q_vector);
+
+- if(icr & E1000_ICR_DOUTSYNC) {
++ if (icr & E1000_ICR_DOUTSYNC) {
+ /* HW is reporting DMA is out of sync */
+ adapter->stats.doosync++;
+ }
+@@ -4398,7 +4533,7 @@ static irqreturn_t igb_intr_msi(int irq, void *data)
+ mod_timer(&adapter->watchdog_timer, jiffies + 1);
+ }
+
+- napi_schedule(&adapter->rx_ring[0].napi);
++ napi_schedule(&q_vector->napi);
+
+ return IRQ_HANDLED;
+ }
+@@ -4410,8 +4545,8 @@ static irqreturn_t igb_intr_msi(int irq, void *data)
+ **/
+ static irqreturn_t igb_intr(int irq, void *data)
+ {
+- struct net_device *netdev = data;
+- struct igb_adapter *adapter = netdev_priv(netdev);
++ struct igb_adapter *adapter = data;
++ struct igb_q_vector *q_vector = adapter->q_vector[0];
+ struct e1000_hw *hw = &adapter->hw;
+ /* Interrupt Auto-Mask...upon reading ICR, interrupts are masked. No
+ * need for the IMC write */
+@@ -4419,14 +4554,14 @@ static irqreturn_t igb_intr(int irq, void *data)
+ if (!icr)
+ return IRQ_NONE; /* Not our interrupt */
+
+- igb_write_itr(adapter->rx_ring);
++ igb_write_itr(q_vector);
+
+ /* IMS will not auto-mask if INT_ASSERTED is not set, and if it is
+ * not set, then the adapter didn't send an interrupt */
+ if (!(icr & E1000_ICR_INT_ASSERTED))
+ return IRQ_NONE;
+
+- if(icr & E1000_ICR_DOUTSYNC) {
++ if (icr & E1000_ICR_DOUTSYNC) {
+ /* HW is reporting DMA is out of sync */
+ adapter->stats.doosync++;
+ }
+@@ -4438,26 +4573,26 @@ static irqreturn_t igb_intr(int irq, void *data)
+ mod_timer(&adapter->watchdog_timer, jiffies + 1);
+ }
+
+- napi_schedule(&adapter->rx_ring[0].napi);
++ napi_schedule(&q_vector->napi);
+
+ return IRQ_HANDLED;
+ }
+
+-static inline void igb_rx_irq_enable(struct igb_ring *rx_ring)
++static inline void igb_ring_irq_enable(struct igb_q_vector *q_vector)
+ {
+- struct igb_adapter *adapter = rx_ring->adapter;
++ struct igb_adapter *adapter = q_vector->adapter;
+ struct e1000_hw *hw = &adapter->hw;
+
+ if (adapter->itr_setting & 3) {
+- if (adapter->num_rx_queues == 1)
++ if (!adapter->msix_entries)
+ igb_set_itr(adapter);
+ else
+- igb_update_ring_itr(rx_ring);
++ igb_update_ring_itr(q_vector);
+ }
+
+ if (!test_bit(__IGB_DOWN, &adapter->state)) {
+ if (adapter->msix_entries)
+- wr32(E1000_EIMS, rx_ring->eims_value);
++ wr32(E1000_EIMS, q_vector->eims_value);
+ else
+ igb_irq_enable(adapter);
+ }
+@@ -4470,28 +4605,28 @@ static inline void igb_rx_irq_enable(struct igb_ring *rx_ring)
+ **/
+ static int igb_poll(struct napi_struct *napi, int budget)
+ {
+- struct igb_ring *rx_ring = container_of(napi, struct igb_ring, napi);
+- int work_done = 0;
++ struct igb_q_vector *q_vector = container_of(napi,
++ struct igb_q_vector,
++ napi);
++ int tx_clean_complete = 1, work_done = 0;
+
+ #ifdef CONFIG_IGB_DCA
+- if (rx_ring->adapter->flags & IGB_FLAG_DCA_ENABLED)
+- igb_update_rx_dca(rx_ring);
++ if (q_vector->adapter->flags & IGB_FLAG_DCA_ENABLED)
++ igb_update_dca(q_vector);
+ #endif
+- igb_clean_rx_irq_adv(rx_ring, &work_done, budget);
++ if (q_vector->tx_ring)
++ tx_clean_complete = igb_clean_tx_irq(q_vector);
+
+- if (rx_ring->buddy) {
+-#ifdef CONFIG_IGB_DCA
+- if (rx_ring->adapter->flags & IGB_FLAG_DCA_ENABLED)
+- igb_update_tx_dca(rx_ring->buddy);
+-#endif
+- if (!igb_clean_tx_irq(rx_ring->buddy))
+- work_done = budget;
+- }
++ if (q_vector->rx_ring)
++ igb_clean_rx_irq_adv(q_vector, &work_done, budget);
++
++ if (!tx_clean_complete)
++ work_done = budget;
+
+ /* If not enough Rx work done, exit the polling mode */
+ if (work_done < budget) {
+ napi_complete(napi);
+- igb_rx_irq_enable(rx_ring);
++ igb_ring_irq_enable(q_vector);
+ }
+
+ return work_done;
+@@ -4533,12 +4668,13 @@ static void igb_tx_hwtstamp(struct igb_adapter *adapter, struct sk_buff *skb)
+
+ /**
+ * igb_clean_tx_irq - Reclaim resources after transmit completes
+- * @adapter: board private structure
++ * @q_vector: pointer to q_vector containing needed info
+ * returns true if ring is completely cleaned
+ **/
+-static bool igb_clean_tx_irq(struct igb_ring *tx_ring)
++static bool igb_clean_tx_irq(struct igb_q_vector *q_vector)
+ {
+- struct igb_adapter *adapter = tx_ring->adapter;
++ struct igb_adapter *adapter = q_vector->adapter;
++ struct igb_ring *tx_ring = q_vector->tx_ring;
+ struct net_device *netdev = adapter->netdev;
+ struct e1000_hw *hw = &adapter->hw;
+ struct igb_buffer *buffer_info;
+@@ -4646,25 +4782,21 @@ static bool igb_clean_tx_irq(struct igb_ring *tx_ring)
+
+ /**
+ * igb_receive_skb - helper function to handle rx indications
+- * @ring: pointer to receive ring receving this packet
+- * @status: descriptor status field as written by hardware
+- * @rx_desc: receive descriptor containing vlan and type information.
+- * @skb: pointer to sk_buff to be indicated to stack
++ * @q_vector: structure containing interrupt and ring information
++ * @skb: packet to send up
++ * @vlan_tag: vlan tag for packet
+ **/
+-static void igb_receive_skb(struct igb_ring *ring, u8 status,
+- union e1000_adv_rx_desc * rx_desc,
+- struct sk_buff *skb)
+-{
+- struct igb_adapter * adapter = ring->adapter;
+- bool vlan_extracted = (adapter->vlgrp && (status & E1000_RXD_STAT_VP));
+-
+- skb_record_rx_queue(skb, ring->queue_index);
+- if (vlan_extracted && adapter->vlgrp)
+- vlan_gro_receive(&ring->napi, adapter->vlgrp,
+- le16_to_cpu(rx_desc->wb.upper.vlan),
+- skb);
++static void igb_receive_skb(struct igb_q_vector *q_vector,
++ struct sk_buff *skb,
++ u16 vlan_tag)
++{
++ struct igb_adapter *adapter = q_vector->adapter;
++
++ if (vlan_tag && adapter->vlgrp)
++ vlan_gro_receive(&q_vector->napi, adapter->vlgrp,
++ vlan_tag, skb);
+ else
+- napi_gro_receive(&ring->napi, skb);
++ napi_gro_receive(&q_vector->napi, skb);
+ }
+
+ static inline void igb_rx_checksum_adv(struct igb_adapter *adapter,
+@@ -4712,11 +4844,12 @@ static inline u16 igb_get_hlen(struct igb_adapter *adapter,
+ return hlen;
+ }
+
+-static bool igb_clean_rx_irq_adv(struct igb_ring *rx_ring,
+- int *work_done, int budget)
++static bool igb_clean_rx_irq_adv(struct igb_q_vector *q_vector,
++ int *work_done, int budget)
+ {
+- struct igb_adapter *adapter = rx_ring->adapter;
++ struct igb_adapter *adapter = q_vector->adapter;
+ struct net_device *netdev = adapter->netdev;
++ struct igb_ring *rx_ring = q_vector->rx_ring;
+ struct e1000_hw *hw = &adapter->hw;
+ struct pci_dev *pdev = adapter->pdev;
+ union e1000_adv_rx_desc *rx_desc , *next_rxd;
+@@ -4728,6 +4861,7 @@ static bool igb_clean_rx_irq_adv(struct igb_ring *rx_ring,
+ unsigned int i;
+ u32 staterr;
+ u16 length;
++ u16 vlan_tag;
+
+ i = rx_ring->next_to_clean;
+ buffer_info = &rx_ring->buffer_info[i];
+@@ -4855,8 +4989,12 @@ send_up:
+ igb_rx_checksum_adv(adapter, staterr, skb);
+
+ skb->protocol = eth_type_trans(skb, netdev);
++ skb_record_rx_queue(skb, rx_ring->queue_index);
++
++ vlan_tag = ((staterr & E1000_RXD_STAT_VP) ?
++ le16_to_cpu(rx_desc->wb.upper.vlan) : 0);
+
+- igb_receive_skb(rx_ring, staterr, rx_desc, skb);
++ igb_receive_skb(q_vector, skb, vlan_tag);
+
+ next_desc:
+ rx_desc->wb.upper.status_error = 0;
+@@ -4895,7 +5033,7 @@ next_desc:
+ static void igb_alloc_rx_buffers_adv(struct igb_ring *rx_ring,
+ int cleaned_count)
+ {
+- struct igb_adapter *adapter = rx_ring->adapter;
++ struct igb_adapter *adapter = rx_ring->q_vector->adapter;
+ struct net_device *netdev = adapter->netdev;
+ struct pci_dev *pdev = adapter->pdev;
+ union e1000_adv_rx_desc *rx_desc;
+@@ -5360,9 +5498,7 @@ static int __igb_shutdown(struct pci_dev *pdev, bool *enable_wake)
+ if (netif_running(netdev))
+ igb_close(netdev);
+
+- igb_reset_interrupt_capability(adapter);
+-
+- igb_free_queues(adapter);
++ igb_clear_interrupt_scheme(adapter);
+
+ #ifdef CONFIG_PM
+ retval = pci_save_state(pdev);
+@@ -5457,9 +5593,7 @@ static int igb_resume(struct pci_dev *pdev)
+ pci_enable_wake(pdev, PCI_D3hot, 0);
+ pci_enable_wake(pdev, PCI_D3cold, 0);
+
+- igb_set_interrupt_capability(adapter);
+-
+- if (igb_alloc_queues(adapter)) {
++ if (igb_init_interrupt_scheme(adapter)) {
+ dev_err(&pdev->dev, "Unable to allocate memory for queues\n");
+ return -ENOMEM;
+ }
+@@ -5511,22 +5645,16 @@ static void igb_netpoll(struct net_device *netdev)
+ int i;
+
+ if (!adapter->msix_entries) {
++ struct igb_q_vector *q_vector = adapter->q_vector[0];
+ igb_irq_disable(adapter);
+- napi_schedule(&adapter->rx_ring[0].napi);
++ napi_schedule(&q_vector->napi);
+ return;
+ }
+
+- for (i = 0; i < adapter->num_tx_queues; i++) {
+- struct igb_ring *tx_ring = &adapter->tx_ring[i];
+- wr32(E1000_EIMC, tx_ring->eims_value);
+- igb_clean_tx_irq(tx_ring);
+- wr32(E1000_EIMS, tx_ring->eims_value);
+- }
+-
+- for (i = 0; i < adapter->num_rx_queues; i++) {
+- struct igb_ring *rx_ring = &adapter->rx_ring[i];
+- wr32(E1000_EIMC, rx_ring->eims_value);
+- napi_schedule(&rx_ring->napi);
++ for (i = 0; i < adapter->num_q_vectors; i++) {
++ struct igb_q_vector *q_vector = adapter->q_vector[i];
++ wr32(E1000_EIMC, q_vector->eims_value);
++ napi_schedule(&q_vector->napi);
+ }
+ }
+ #endif /* CONFIG_NET_POLL_CONTROLLER */
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0019-igb-remove-rx-checksum-good-counter.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0019-igb-remove-rx-checksum-good-counter.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,59 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 27 Oct 2009 15:49:49 +0000
+Subject: [PATCH 019/165] igb: remove rx checksum good counter
+
+commit 094919a4b0c56d6afbfb5ea14567fbb2f8d47554 upstream.
+
+Counting packets with a good checksum can cause a significant amount of cache
+line bouncing due to the shared counter being written to by all of the queues.
+In order to avoid this I am removing the counter since we still have the
+checksum failed counter which will tell us if there are any issues.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb.h | 1 -
+ drivers/net/igb/igb_ethtool.c | 1 -
+ drivers/net/igb/igb_main.c | 1 -
+ 3 files changed, 0 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
+index 86492c8..d27dcd1 100644
+--- a/drivers/net/igb/igb.h
++++ b/drivers/net/igb/igb.h
+@@ -254,7 +254,6 @@ struct igb_adapter {
+ int num_rx_queues;
+
+ u64 hw_csum_err;
+- u64 hw_csum_good;
+ u32 alloc_rx_buff_failed;
+ u32 gorc;
+ u64 gorc_old;
+diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
+index 55d535c..186c78a 100644
+--- a/drivers/net/igb/igb_ethtool.c
++++ b/drivers/net/igb/igb_ethtool.c
+@@ -96,7 +96,6 @@ static const struct igb_stats igb_gstrings_stats[] = {
+ { "tx_flow_control_xon", IGB_STAT(stats.xontxc) },
+ { "tx_flow_control_xoff", IGB_STAT(stats.xofftxc) },
+ { "rx_long_byte_count", IGB_STAT(stats.gorc) },
+- { "rx_csum_offload_good", IGB_STAT(hw_csum_good) },
+ { "rx_csum_offload_errors", IGB_STAT(hw_csum_err) },
+ { "tx_dma_out_of_sync", IGB_STAT(stats.doosync) },
+ { "alloc_rx_buff_failed", IGB_STAT(alloc_rx_buff_failed) },
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 95d5ab2..eba4b01 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -4827,7 +4827,6 @@ static inline void igb_rx_checksum_adv(struct igb_adapter *adapter,
+ skb->ip_summed = CHECKSUM_UNNECESSARY;
+
+ dev_dbg(&adapter->pdev->dev, "cksum success: bits %08X\n", status_err);
+- adapter->hw_csum_good++;
+ }
+
+ static inline u16 igb_get_hlen(struct igb_adapter *adapter,
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0020-igb-increase-minimum-rx-buffer-size-to-1K.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0020-igb-increase-minimum-rx-buffer-size-to-1K.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,84 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 27 Oct 2009 15:50:08 +0000
+Subject: [PATCH 020/165] igb: increase minimum rx buffer size to 1K
+
+commit 7d95b7170eca3f95bad939fc9eb365b823c05e39 upstream.
+
+This update increases the minimum rx buffer size to 1K. The reason for this
+change is to support SR-IOV and avoid any conflicts with the rings being able
+to set their own MTU sizes.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb.h | 2 --
+ drivers/net/igb/igb_main.c | 25 +++----------------------
+ 2 files changed, 3 insertions(+), 24 deletions(-)
+
+diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
+index d27dcd1..044ba02 100644
+--- a/drivers/net/igb/igb.h
++++ b/drivers/net/igb/igb.h
+@@ -96,8 +96,6 @@ struct vf_data_storage {
+
+ /* Supported Rx Buffer Sizes */
+ #define IGB_RXBUFFER_128 128 /* Used for packet split */
+-#define IGB_RXBUFFER_256 256 /* Used for packet split */
+-#define IGB_RXBUFFER_512 512
+ #define IGB_RXBUFFER_1024 1024
+ #define IGB_RXBUFFER_2048 2048
+ #define IGB_RXBUFFER_16384 16384
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index eba4b01..55b5306 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -2233,18 +2233,8 @@ static void igb_setup_rctl(struct igb_adapter *adapter)
+ rctl |= E1000_RCTL_LPE;
+
+ /* Setup buffer sizes */
+- switch (adapter->rx_buffer_len) {
+- case IGB_RXBUFFER_256:
+- rctl |= E1000_RCTL_SZ_256;
+- break;
+- case IGB_RXBUFFER_512:
+- rctl |= E1000_RCTL_SZ_512;
+- break;
+- default:
+- srrctl = ALIGN(adapter->rx_buffer_len, 1024)
+- >> E1000_SRRCTL_BSIZEPKT_SHIFT;
+- break;
+- }
++ srrctl = ALIGN(adapter->rx_buffer_len, 1024)
++ >> E1000_SRRCTL_BSIZEPKT_SHIFT;
+
+ /* 82575 and greater support packet-split where the protocol
+ * header is placed in skb->data and the packet data is
+@@ -3755,11 +3745,7 @@ static int igb_change_mtu(struct net_device *netdev, int new_mtu)
+ * i.e. RXBUFFER_2048 --> size-4096 slab
+ */
+
+- if (max_frame <= IGB_RXBUFFER_256)
+- adapter->rx_buffer_len = IGB_RXBUFFER_256;
+- else if (max_frame <= IGB_RXBUFFER_512)
+- adapter->rx_buffer_len = IGB_RXBUFFER_512;
+- else if (max_frame <= IGB_RXBUFFER_1024)
++ if (max_frame <= IGB_RXBUFFER_1024)
+ adapter->rx_buffer_len = IGB_RXBUFFER_1024;
+ else if (max_frame <= IGB_RXBUFFER_2048)
+ adapter->rx_buffer_len = IGB_RXBUFFER_2048;
+@@ -3770,11 +3756,6 @@ static int igb_change_mtu(struct net_device *netdev, int new_mtu)
+ adapter->rx_buffer_len = PAGE_SIZE / 2;
+ #endif
+
+- /* if sr-iov is enabled we need to force buffer size to 1K or larger */
+- if (adapter->vfs_allocated_count &&
+- (adapter->rx_buffer_len < IGB_RXBUFFER_1024))
+- adapter->rx_buffer_len = IGB_RXBUFFER_1024;
+-
+ /* adjust allocation if LPE protects us, and we aren't using SBP */
+ if ((max_frame == ETH_FRAME_LEN + ETH_FCS_LEN) ||
+ (max_frame == MAXIMUM_ETHERNET_VLAN_SIZE))
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0021-igb-move-the-tx-and-rx-ring-specific-config-into-sep.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0021-igb-move-the-tx-and-rx-ring-specific-config-into-sep.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,287 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 27 Oct 2009 15:50:29 +0000
+Subject: [PATCH 021/165] igb: move the tx and rx ring specific config into
+ seperate functions
+
+commit 85b430b47736d1f59e8f9efb0e47bc46aeb2b01d upstream.
+
+This change makes the tx and rx config a bit cleaner by breaking out the ring
+specific configuration from the generic rx and tx configuration.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb.h | 6 +-
+ drivers/net/igb/igb_main.c | 179 +++++++++++++++++++++++++++----------------
+ 2 files changed, 117 insertions(+), 68 deletions(-)
+
+diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
+index 044ba02..1675f6a 100644
+--- a/drivers/net/igb/igb.h
++++ b/drivers/net/igb/igb.h
+@@ -87,9 +87,13 @@ struct vf_data_storage {
+ * descriptors until either it has this many to write back, or the
+ * ITR timer expires.
+ */
+-#define IGB_RX_PTHRESH 16
++#define IGB_RX_PTHRESH (hw->mac.type <= e1000_82576 ? 16 : 8)
+ #define IGB_RX_HTHRESH 8
+ #define IGB_RX_WTHRESH 1
++#define IGB_TX_PTHRESH 8
++#define IGB_TX_HTHRESH 1
++#define IGB_TX_WTHRESH ((hw->mac.type == e1000_82576 && \
++ adapter->msix_entries) ? 0 : 16)
+
+ /* this is the size past which hardware will drop packets when setting LPE=0 */
+ #define MAXIMUM_ETHERNET_VLAN_SIZE 1522
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 55b5306..d20f2b3 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -90,6 +90,7 @@ static int igb_open(struct net_device *);
+ static int igb_close(struct net_device *);
+ static void igb_configure_tx(struct igb_adapter *);
+ static void igb_configure_rx(struct igb_adapter *);
++static void igb_setup_tctl(struct igb_adapter *);
+ static void igb_setup_rctl(struct igb_adapter *);
+ static void igb_clean_all_tx_rings(struct igb_adapter *);
+ static void igb_clean_all_rx_rings(struct igb_adapter *);
+@@ -1101,8 +1102,10 @@ static void igb_configure(struct igb_adapter *adapter)
+
+ igb_restore_vlan(adapter);
+
+- igb_configure_tx(adapter);
++ igb_setup_tctl(adapter);
+ igb_setup_rctl(adapter);
++
++ igb_configure_tx(adapter);
+ igb_configure_rx(adapter);
+
+ igb_rx_fifo_flush_82575(&adapter->hw);
+@@ -2069,49 +2072,16 @@ static int igb_setup_all_tx_resources(struct igb_adapter *adapter)
+ }
+
+ /**
+- * igb_configure_tx - Configure transmit Unit after Reset
+- * @adapter: board private structure
+- *
+- * Configure the Tx unit of the MAC after a reset.
++ * igb_setup_tctl - configure the transmit control registers
++ * @adapter: Board private structure
+ **/
+-static void igb_configure_tx(struct igb_adapter *adapter)
++static void igb_setup_tctl(struct igb_adapter *adapter)
+ {
+- u64 tdba;
+ struct e1000_hw *hw = &adapter->hw;
+ u32 tctl;
+- u32 txdctl, txctrl;
+- int i, j;
+-
+- for (i = 0; i < adapter->num_tx_queues; i++) {
+- struct igb_ring *ring = &adapter->tx_ring[i];
+- j = ring->reg_idx;
+- wr32(E1000_TDLEN(j),
+- ring->count * sizeof(union e1000_adv_tx_desc));
+- tdba = ring->dma;
+- wr32(E1000_TDBAL(j),
+- tdba & 0x00000000ffffffffULL);
+- wr32(E1000_TDBAH(j), tdba >> 32);
+-
+- ring->head = E1000_TDH(j);
+- ring->tail = E1000_TDT(j);
+- writel(0, hw->hw_addr + ring->tail);
+- writel(0, hw->hw_addr + ring->head);
+- txdctl = rd32(E1000_TXDCTL(j));
+- txdctl |= E1000_TXDCTL_QUEUE_ENABLE;
+- wr32(E1000_TXDCTL(j), txdctl);
+-
+- /* Turn off Relaxed Ordering on head write-backs. The
+- * writebacks MUST be delivered in order or it will
+- * completely screw up our bookeeping.
+- */
+- txctrl = rd32(E1000_DCA_TXCTRL(j));
+- txctrl &= ~E1000_DCA_TXCTRL_TX_WB_RO_EN;
+- wr32(E1000_DCA_TXCTRL(j), txctrl);
+- }
+
+- /* disable queue 0 to prevent tail bump w/o re-configuration */
+- if (adapter->vfs_allocated_count)
+- wr32(E1000_TXDCTL(0), 0);
++ /* disable queue 0 which is enabled by default on 82575 and 82576 */
++ wr32(E1000_TXDCTL(0), 0);
+
+ /* Program the Transmit Control Register */
+ tctl = rd32(E1000_TCTL);
+@@ -2121,9 +2091,6 @@ static void igb_configure_tx(struct igb_adapter *adapter)
+
+ igb_config_collision_dist(hw);
+
+- /* Setup Transmit Descriptor Settings for eop descriptor */
+- adapter->txd_cmd = E1000_TXD_CMD_EOP | E1000_TXD_CMD_RS;
+-
+ /* Enable transmits */
+ tctl |= E1000_TCTL_EN;
+
+@@ -2131,6 +2098,64 @@ static void igb_configure_tx(struct igb_adapter *adapter)
+ }
+
+ /**
++ * igb_configure_tx_ring - Configure transmit ring after Reset
++ * @adapter: board private structure
++ * @ring: tx ring to configure
++ *
++ * Configure a transmit ring after a reset.
++ **/
++static void igb_configure_tx_ring(struct igb_adapter *adapter,
++ struct igb_ring *ring)
++{
++ struct e1000_hw *hw = &adapter->hw;
++ u32 txdctl;
++ u64 tdba = ring->dma;
++ int reg_idx = ring->reg_idx;
++
++ /* disable the queue */
++ txdctl = rd32(E1000_TXDCTL(reg_idx));
++ wr32(E1000_TXDCTL(reg_idx),
++ txdctl & ~E1000_TXDCTL_QUEUE_ENABLE);
++ wrfl();
++ mdelay(10);
++
++ wr32(E1000_TDLEN(reg_idx),
++ ring->count * sizeof(union e1000_adv_tx_desc));
++ wr32(E1000_TDBAL(reg_idx),
++ tdba & 0x00000000ffffffffULL);
++ wr32(E1000_TDBAH(reg_idx), tdba >> 32);
++
++ ring->head = E1000_TDH(reg_idx);
++ ring->tail = E1000_TDT(reg_idx);
++ writel(0, hw->hw_addr + ring->tail);
++ writel(0, hw->hw_addr + ring->head);
++
++ txdctl |= IGB_TX_PTHRESH;
++ txdctl |= IGB_TX_HTHRESH << 8;
++ txdctl |= IGB_TX_WTHRESH << 16;
++
++ txdctl |= E1000_TXDCTL_QUEUE_ENABLE;
++ wr32(E1000_TXDCTL(reg_idx), txdctl);
++}
++
++/**
++ * igb_configure_tx - Configure transmit Unit after Reset
++ * @adapter: board private structure
++ *
++ * Configure the Tx unit of the MAC after a reset.
++ **/
++static void igb_configure_tx(struct igb_adapter *adapter)
++{
++ int i;
++
++ for (i = 0; i < adapter->num_tx_queues; i++)
++ igb_configure_tx_ring(adapter, &adapter->tx_ring[i]);
++
++ /* Setup Transmit Descriptor Settings for eop descriptor */
++ adapter->txd_cmd = E1000_TXD_CMD_EOP | E1000_TXD_CMD_RS;
++}
++
++/**
+ * igb_setup_rx_resources - allocate Rx resources (Descriptors)
+ * @adapter: board private structure
+ * @rx_ring: rx descriptor ring (for a specific queue) to setup
+@@ -2334,6 +2359,49 @@ static void igb_configure_vt_default_pool(struct igb_adapter *adapter)
+ }
+
+ /**
++ * igb_configure_rx_ring - Configure a receive ring after Reset
++ * @adapter: board private structure
++ * @ring: receive ring to be configured
++ *
++ * Configure the Rx unit of the MAC after a reset.
++ **/
++static void igb_configure_rx_ring(struct igb_adapter *adapter,
++ struct igb_ring *ring)
++{
++ struct e1000_hw *hw = &adapter->hw;
++ u64 rdba = ring->dma;
++ int reg_idx = ring->reg_idx;
++ u32 rxdctl;
++
++ /* disable the queue */
++ rxdctl = rd32(E1000_RXDCTL(reg_idx));
++ wr32(E1000_RXDCTL(reg_idx),
++ rxdctl & ~E1000_RXDCTL_QUEUE_ENABLE);
++
++ /* Set DMA base address registers */
++ wr32(E1000_RDBAL(reg_idx),
++ rdba & 0x00000000ffffffffULL);
++ wr32(E1000_RDBAH(reg_idx), rdba >> 32);
++ wr32(E1000_RDLEN(reg_idx),
++ ring->count * sizeof(union e1000_adv_rx_desc));
++
++ /* initialize head and tail */
++ ring->head = E1000_RDH(reg_idx);
++ ring->tail = E1000_RDT(reg_idx);
++ writel(0, hw->hw_addr + ring->head);
++ writel(0, hw->hw_addr + ring->tail);
++
++ /* enable receive descriptor fetching */
++ rxdctl = rd32(E1000_RXDCTL(reg_idx));
++ rxdctl |= E1000_RXDCTL_QUEUE_ENABLE;
++ rxdctl &= 0xFFF00000;
++ rxdctl |= IGB_RX_PTHRESH;
++ rxdctl |= IGB_RX_HTHRESH << 8;
++ rxdctl |= IGB_RX_WTHRESH << 16;
++ wr32(E1000_RXDCTL(reg_idx), rxdctl);
++}
++
++/**
+ * igb_configure_rx - Configure receive Unit after Reset
+ * @adapter: board private structure
+ *
+@@ -2341,10 +2409,8 @@ static void igb_configure_vt_default_pool(struct igb_adapter *adapter)
+ **/
+ static void igb_configure_rx(struct igb_adapter *adapter)
+ {
+- u64 rdba;
+ struct e1000_hw *hw = &adapter->hw;
+ u32 rctl, rxcsum;
+- u32 rxdctl;
+ int i;
+
+ /* disable receives while setting up the descriptors */
+@@ -2358,29 +2424,8 @@ static void igb_configure_rx(struct igb_adapter *adapter)
+
+ /* Setup the HW Rx Head and Tail Descriptor Pointers and
+ * the Base and Length of the Rx Descriptor Ring */
+- for (i = 0; i < adapter->num_rx_queues; i++) {
+- struct igb_ring *ring = &adapter->rx_ring[i];
+- int j = ring->reg_idx;
+- rdba = ring->dma;
+- wr32(E1000_RDBAL(j),
+- rdba & 0x00000000ffffffffULL);
+- wr32(E1000_RDBAH(j), rdba >> 32);
+- wr32(E1000_RDLEN(j),
+- ring->count * sizeof(union e1000_adv_rx_desc));
+-
+- ring->head = E1000_RDH(j);
+- ring->tail = E1000_RDT(j);
+- writel(0, hw->hw_addr + ring->tail);
+- writel(0, hw->hw_addr + ring->head);
+-
+- rxdctl = rd32(E1000_RXDCTL(j));
+- rxdctl |= E1000_RXDCTL_QUEUE_ENABLE;
+- rxdctl &= 0xFFF00000;
+- rxdctl |= IGB_RX_PTHRESH;
+- rxdctl |= IGB_RX_HTHRESH << 8;
+- rxdctl |= IGB_RX_WTHRESH << 16;
+- wr32(E1000_RXDCTL(j), rxdctl);
+- }
++ for (i = 0; i < adapter->num_rx_queues; i++)
++ igb_configure_rx_ring(adapter, &adapter->rx_ring[i]);
+
+ if (adapter->num_rx_queues > 1) {
+ u32 random[10];
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0022-igb-remove-rx_ps_hdr_len.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0022-igb-remove-rx_ps_hdr_len.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,227 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 27 Oct 2009 15:50:48 +0000
+Subject: [PATCH 022/165] igb: remove rx_ps_hdr_len
+
+commit 6ec43fe635fb5c96fbc0955b2794b74fee69b723 upstream.
+
+This patch removes the rx_ps_hdr_len which isn't really needed since we can
+now use rx_buffer_len less than 1K to indicate that we are in a packet split
+mode. We also don't need it since we always use a half page for the data
+buffers when receiving so we always know the size to map/unmap.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb.h | 1 -
+ drivers/net/igb/igb_main.c | 98 +++++++++++++++++---------------------------
+ 2 files changed, 38 insertions(+), 61 deletions(-)
+
+diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
+index 1675f6a..303df02 100644
+--- a/drivers/net/igb/igb.h
++++ b/drivers/net/igb/igb.h
+@@ -259,7 +259,6 @@ struct igb_adapter {
+ u32 alloc_rx_buff_failed;
+ u32 gorc;
+ u64 gorc_old;
+- u16 rx_ps_hdr_size;
+ u32 max_frame_size;
+ u32 min_frame_size;
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index d20f2b3..273de5db 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -1862,7 +1862,6 @@ static int __devinit igb_sw_init(struct igb_adapter *adapter)
+ adapter->tx_ring_count = IGB_DEFAULT_TXD;
+ adapter->rx_ring_count = IGB_DEFAULT_RXD;
+ adapter->rx_buffer_len = MAXIMUM_ETHERNET_VLAN_SIZE;
+- adapter->rx_ps_hdr_size = 0; /* disable packet split */
+ adapter->max_frame_size = netdev->mtu + ETH_HLEN + ETH_FCS_LEN;
+ adapter->min_frame_size = ETH_ZLEN + ETH_FCS_LEN;
+
+@@ -2254,12 +2253,8 @@ static void igb_setup_rctl(struct igb_adapter *adapter)
+ */
+ rctl &= ~(E1000_RCTL_SBP | E1000_RCTL_SZ_256);
+
+- /* enable LPE when to prevent packets larger than max_frame_size */
+- rctl |= E1000_RCTL_LPE;
+-
+- /* Setup buffer sizes */
+- srrctl = ALIGN(adapter->rx_buffer_len, 1024)
+- >> E1000_SRRCTL_BSIZEPKT_SHIFT;
++ /* enable LPE to prevent packets larger than max_frame_size */
++ rctl |= E1000_RCTL_LPE;
+
+ /* 82575 and greater support packet-split where the protocol
+ * header is placed in skb->data and the packet data is
+@@ -2270,13 +2265,20 @@ static void igb_setup_rctl(struct igb_adapter *adapter)
+ */
+ /* allocations using alloc_page take too long for regular MTU
+ * so only enable packet split for jumbo frames */
+- if (adapter->netdev->mtu > ETH_DATA_LEN) {
+- adapter->rx_ps_hdr_size = IGB_RXBUFFER_128;
+- srrctl |= adapter->rx_ps_hdr_size <<
+- E1000_SRRCTL_BSIZEHDRSIZE_SHIFT;
++ if (adapter->rx_buffer_len < IGB_RXBUFFER_1024) {
++ srrctl = ALIGN(adapter->rx_buffer_len, 64) <<
++ E1000_SRRCTL_BSIZEHDRSIZE_SHIFT;
++#if (PAGE_SIZE / 2) > IGB_RXBUFFER_16384
++ srrctl |= IGB_RXBUFFER_16384 >>
++ E1000_SRRCTL_BSIZEPKT_SHIFT;
++#else
++ srrctl |= (PAGE_SIZE / 2) >>
++ E1000_SRRCTL_BSIZEPKT_SHIFT;
++#endif
+ srrctl |= E1000_SRRCTL_DESCTYPE_HDR_SPLIT_ALWAYS;
+ } else {
+- adapter->rx_ps_hdr_size = 0;
++ srrctl = ALIGN(adapter->rx_buffer_len, 1024) >>
++ E1000_SRRCTL_BSIZEPKT_SHIFT;
+ srrctl |= E1000_SRRCTL_DESCTYPE_ADV_ONEBUF;
+ }
+
+@@ -2647,14 +2649,9 @@ static void igb_clean_rx_ring(struct igb_ring *rx_ring)
+ for (i = 0; i < rx_ring->count; i++) {
+ buffer_info = &rx_ring->buffer_info[i];
+ if (buffer_info->dma) {
+- if (adapter->rx_ps_hdr_size)
+- pci_unmap_single(pdev, buffer_info->dma,
+- adapter->rx_ps_hdr_size,
+- PCI_DMA_FROMDEVICE);
+- else
+- pci_unmap_single(pdev, buffer_info->dma,
+- adapter->rx_buffer_len,
+- PCI_DMA_FROMDEVICE);
++ pci_unmap_single(pdev, buffer_info->dma,
++ adapter->rx_buffer_len,
++ PCI_DMA_FROMDEVICE);
+ buffer_info->dma = 0;
+ }
+
+@@ -2662,14 +2659,15 @@ static void igb_clean_rx_ring(struct igb_ring *rx_ring)
+ dev_kfree_skb(buffer_info->skb);
+ buffer_info->skb = NULL;
+ }
++ if (buffer_info->page_dma) {
++ pci_unmap_page(pdev, buffer_info->page_dma,
++ PAGE_SIZE / 2,
++ PCI_DMA_FROMDEVICE);
++ buffer_info->page_dma = 0;
++ }
+ if (buffer_info->page) {
+- if (buffer_info->page_dma)
+- pci_unmap_page(pdev, buffer_info->page_dma,
+- PAGE_SIZE / 2,
+- PCI_DMA_FROMDEVICE);
+ put_page(buffer_info->page);
+ buffer_info->page = NULL;
+- buffer_info->page_dma = 0;
+ buffer_info->page_offset = 0;
+ }
+ }
+@@ -3792,19 +3790,10 @@ static int igb_change_mtu(struct net_device *netdev, int new_mtu)
+
+ if (max_frame <= IGB_RXBUFFER_1024)
+ adapter->rx_buffer_len = IGB_RXBUFFER_1024;
+- else if (max_frame <= IGB_RXBUFFER_2048)
+- adapter->rx_buffer_len = IGB_RXBUFFER_2048;
+- else
+-#if (PAGE_SIZE / 2) > IGB_RXBUFFER_16384
+- adapter->rx_buffer_len = IGB_RXBUFFER_16384;
+-#else
+- adapter->rx_buffer_len = PAGE_SIZE / 2;
+-#endif
+-
+- /* adjust allocation if LPE protects us, and we aren't using SBP */
+- if ((max_frame == ETH_FRAME_LEN + ETH_FCS_LEN) ||
+- (max_frame == MAXIMUM_ETHERNET_VLAN_SIZE))
++ else if (max_frame <= MAXIMUM_ETHERNET_VLAN_SIZE)
+ adapter->rx_buffer_len = MAXIMUM_ETHERNET_VLAN_SIZE;
++ else
++ adapter->rx_buffer_len = IGB_RXBUFFER_128;
+
+ dev_info(&adapter->pdev->dev, "changing MTU from %d to %d\n",
+ netdev->mtu, new_mtu);
+@@ -4864,8 +4853,8 @@ static inline u16 igb_get_hlen(struct igb_adapter *adapter,
+ */
+ u16 hlen = (le16_to_cpu(rx_desc->wb.lower.lo_dword.hdr_info) &
+ E1000_RXDADV_HDRBUFLEN_MASK) >> E1000_RXDADV_HDRBUFLEN_SHIFT;
+- if (hlen > adapter->rx_ps_hdr_size)
+- hlen = adapter->rx_ps_hdr_size;
++ if (hlen > adapter->rx_buffer_len)
++ hlen = adapter->rx_buffer_len;
+ return hlen;
+ }
+
+@@ -4913,23 +4902,16 @@ static bool igb_clean_rx_irq_adv(struct igb_q_vector *q_vector,
+ cleaned = true;
+ cleaned_count++;
+
+- /* this is the fast path for the non-packet split case */
+- if (!adapter->rx_ps_hdr_size) {
+- pci_unmap_single(pdev, buffer_info->dma,
+- adapter->rx_buffer_len,
+- PCI_DMA_FROMDEVICE);
+- buffer_info->dma = 0;
+- skb_put(skb, length);
+- goto send_up;
+- }
+-
+ if (buffer_info->dma) {
+- u16 hlen = igb_get_hlen(adapter, rx_desc);
+ pci_unmap_single(pdev, buffer_info->dma,
+- adapter->rx_ps_hdr_size,
++ adapter->rx_buffer_len,
+ PCI_DMA_FROMDEVICE);
+ buffer_info->dma = 0;
+- skb_put(skb, hlen);
++ if (adapter->rx_buffer_len >= IGB_RXBUFFER_1024) {
++ skb_put(skb, length);
++ goto send_up;
++ }
++ skb_put(skb, igb_get_hlen(adapter, rx_desc));
+ }
+
+ if (length) {
+@@ -4942,8 +4924,7 @@ static bool igb_clean_rx_irq_adv(struct igb_q_vector *q_vector,
+ buffer_info->page_offset,
+ length);
+
+- if ((adapter->rx_buffer_len > (PAGE_SIZE / 2)) ||
+- (page_count(buffer_info->page) != 1))
++ if (page_count(buffer_info->page) != 1)
+ buffer_info->page = NULL;
+ else
+ get_page(buffer_info->page);
+@@ -5070,15 +5051,12 @@ static void igb_alloc_rx_buffers_adv(struct igb_ring *rx_ring,
+ i = rx_ring->next_to_use;
+ buffer_info = &rx_ring->buffer_info[i];
+
+- if (adapter->rx_ps_hdr_size)
+- bufsz = adapter->rx_ps_hdr_size;
+- else
+- bufsz = adapter->rx_buffer_len;
++ bufsz = adapter->rx_buffer_len;
+
+ while (cleaned_count--) {
+ rx_desc = E1000_RX_DESC_ADV(*rx_ring, i);
+
+- if (adapter->rx_ps_hdr_size && !buffer_info->page_dma) {
++ if ((bufsz < IGB_RXBUFFER_1024) && !buffer_info->page_dma) {
+ if (!buffer_info->page) {
+ buffer_info->page = alloc_page(GFP_ATOMIC);
+ if (!buffer_info->page) {
+@@ -5110,7 +5088,7 @@ static void igb_alloc_rx_buffers_adv(struct igb_ring *rx_ring,
+ }
+ /* Refresh the desc even if buffer_addrs didn't change because
+ * each write-back erases this info. */
+- if (adapter->rx_ps_hdr_size) {
++ if (bufsz < IGB_RXBUFFER_1024) {
+ rx_desc->read.pkt_addr =
+ cpu_to_le64(buffer_info->page_dma);
+ rx_desc->read.hdr_addr = cpu_to_le64(buffer_info->dma);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0023-igb-move-SRRCTL-register-configuration-into-ring-spe.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0023-igb-move-SRRCTL-register-configuration-into-ring-spe.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,127 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 27 Oct 2009 15:51:07 +0000
+Subject: [PATCH 023/165] igb: move SRRCTL register configuration into ring
+ specific config
+
+commit 952f72a8ceee3996ef8476a2f05ece1627080c20 upstream.
+
+The SRRCTL register exists per ring. Instead of configuring all of them in
+the RCTL configuration which is meant to be global it makes more sense to move
+this out into the ring specific configuration.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 60 +++++++++++++++++---------------------------
+ 1 files changed, 23 insertions(+), 37 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 273de5db..5ea7f55 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -2230,8 +2230,6 @@ static void igb_setup_rctl(struct igb_adapter *adapter)
+ {
+ struct e1000_hw *hw = &adapter->hw;
+ u32 rctl;
+- u32 srrctl = 0;
+- int i;
+
+ rctl = rd32(E1000_RCTL);
+
+@@ -2256,31 +2254,8 @@ static void igb_setup_rctl(struct igb_adapter *adapter)
+ /* enable LPE to prevent packets larger than max_frame_size */
+ rctl |= E1000_RCTL_LPE;
+
+- /* 82575 and greater support packet-split where the protocol
+- * header is placed in skb->data and the packet data is
+- * placed in pages hanging off of skb_shinfo(skb)->nr_frags.
+- * In the case of a non-split, skb->data is linearly filled,
+- * followed by the page buffers. Therefore, skb->data is
+- * sized to hold the largest protocol header.
+- */
+- /* allocations using alloc_page take too long for regular MTU
+- * so only enable packet split for jumbo frames */
+- if (adapter->rx_buffer_len < IGB_RXBUFFER_1024) {
+- srrctl = ALIGN(adapter->rx_buffer_len, 64) <<
+- E1000_SRRCTL_BSIZEHDRSIZE_SHIFT;
+-#if (PAGE_SIZE / 2) > IGB_RXBUFFER_16384
+- srrctl |= IGB_RXBUFFER_16384 >>
+- E1000_SRRCTL_BSIZEPKT_SHIFT;
+-#else
+- srrctl |= (PAGE_SIZE / 2) >>
+- E1000_SRRCTL_BSIZEPKT_SHIFT;
+-#endif
+- srrctl |= E1000_SRRCTL_DESCTYPE_HDR_SPLIT_ALWAYS;
+- } else {
+- srrctl = ALIGN(adapter->rx_buffer_len, 1024) >>
+- E1000_SRRCTL_BSIZEPKT_SHIFT;
+- srrctl |= E1000_SRRCTL_DESCTYPE_ADV_ONEBUF;
+- }
++ /* disable queue 0 to prevent tail write w/o re-config */
++ wr32(E1000_RXDCTL(0), 0);
+
+ /* Attention!!! For SR-IOV PF driver operations you must enable
+ * queue drop for all VF and PF queues to prevent head of line blocking
+@@ -2291,10 +2266,6 @@ static void igb_setup_rctl(struct igb_adapter *adapter)
+
+ /* set all queue drop enable bits */
+ wr32(E1000_QDE, ALL_QUEUES);
+- srrctl |= E1000_SRRCTL_DROP_EN;
+-
+- /* disable queue 0 to prevent tail write w/o re-config */
+- wr32(E1000_RXDCTL(0), 0);
+
+ vmolr = rd32(E1000_VMOLR(adapter->vfs_allocated_count));
+ if (rctl & E1000_RCTL_LPE)
+@@ -2304,11 +2275,6 @@ static void igb_setup_rctl(struct igb_adapter *adapter)
+ wr32(E1000_VMOLR(adapter->vfs_allocated_count), vmolr);
+ }
+
+- for (i = 0; i < adapter->num_rx_queues; i++) {
+- int j = adapter->rx_ring[i].reg_idx;
+- wr32(E1000_SRRCTL(j), srrctl);
+- }
+-
+ wr32(E1000_RCTL, rctl);
+ }
+
+@@ -2373,7 +2339,7 @@ static void igb_configure_rx_ring(struct igb_adapter *adapter,
+ struct e1000_hw *hw = &adapter->hw;
+ u64 rdba = ring->dma;
+ int reg_idx = ring->reg_idx;
+- u32 rxdctl;
++ u32 srrctl, rxdctl;
+
+ /* disable the queue */
+ rxdctl = rd32(E1000_RXDCTL(reg_idx));
+@@ -2393,6 +2359,26 @@ static void igb_configure_rx_ring(struct igb_adapter *adapter,
+ writel(0, hw->hw_addr + ring->head);
+ writel(0, hw->hw_addr + ring->tail);
+
++ /* set descriptor configuration */
++ if (adapter->rx_buffer_len < IGB_RXBUFFER_1024) {
++ srrctl = ALIGN(adapter->rx_buffer_len, 64) <<
++ E1000_SRRCTL_BSIZEHDRSIZE_SHIFT;
++#if (PAGE_SIZE / 2) > IGB_RXBUFFER_16384
++ srrctl |= IGB_RXBUFFER_16384 >>
++ E1000_SRRCTL_BSIZEPKT_SHIFT;
++#else
++ srrctl |= (PAGE_SIZE / 2) >>
++ E1000_SRRCTL_BSIZEPKT_SHIFT;
++#endif
++ srrctl |= E1000_SRRCTL_DESCTYPE_HDR_SPLIT_ALWAYS;
++ } else {
++ srrctl = ALIGN(adapter->rx_buffer_len, 1024) >>
++ E1000_SRRCTL_BSIZEPKT_SHIFT;
++ srrctl |= E1000_SRRCTL_DESCTYPE_ADV_ONEBUF;
++ }
++
++ wr32(E1000_SRRCTL(reg_idx), srrctl);
++
+ /* enable receive descriptor fetching */
+ rxdctl = rd32(E1000_RXDCTL(reg_idx));
+ rxdctl |= E1000_RXDCTL_QUEUE_ENABLE;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0024-igb-change-the-head-and-tail-offsets-into-pointers.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0024-igb-change-the-head-and-tail-offsets-into-pointers.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,123 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 27 Oct 2009 15:51:27 +0000
+Subject: [PATCH 024/165] igb: change the head and tail offsets into pointers
+
+commit fce99e341524c204ef3dd3e7c5f77265a7e05ddd upstream.
+
+Since we are writting to the head/tail pointers frequently we might as well
+save ourselves some processing time by converting the head and tail offsets
+directly to pointers. This will shave a few cycles off the rx/tx path and
+allows us to move one step closer to the rings being a bit more independant of
+each other.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb.h | 4 ++--
+ drivers/net/igb/igb_main.c | 32 ++++++++++++++++----------------
+ 2 files changed, 18 insertions(+), 18 deletions(-)
+
+diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
+index 303df02..e52fee4 100644
+--- a/drivers/net/igb/igb.h
++++ b/drivers/net/igb/igb.h
+@@ -178,8 +178,8 @@ struct igb_ring {
+ unsigned int count; /* number of desc. in the ring */
+ u16 next_to_use;
+ u16 next_to_clean;
+- u16 head;
+- u16 tail;
++ void __iomem *head;
++ void __iomem *tail;
+ struct igb_buffer *buffer_info; /* array of buffer info structs */
+
+ u8 queue_index;
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 5ea7f55..6a7cc02 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -2124,10 +2124,10 @@ static void igb_configure_tx_ring(struct igb_adapter *adapter,
+ tdba & 0x00000000ffffffffULL);
+ wr32(E1000_TDBAH(reg_idx), tdba >> 32);
+
+- ring->head = E1000_TDH(reg_idx);
+- ring->tail = E1000_TDT(reg_idx);
+- writel(0, hw->hw_addr + ring->tail);
+- writel(0, hw->hw_addr + ring->head);
++ ring->head = hw->hw_addr + E1000_TDH(reg_idx);
++ ring->tail = hw->hw_addr + E1000_TDT(reg_idx);
++ writel(0, ring->head);
++ writel(0, ring->tail);
+
+ txdctl |= IGB_TX_PTHRESH;
+ txdctl |= IGB_TX_HTHRESH << 8;
+@@ -2354,10 +2354,10 @@ static void igb_configure_rx_ring(struct igb_adapter *adapter,
+ ring->count * sizeof(union e1000_adv_rx_desc));
+
+ /* initialize head and tail */
+- ring->head = E1000_RDH(reg_idx);
+- ring->tail = E1000_RDT(reg_idx);
+- writel(0, hw->hw_addr + ring->head);
+- writel(0, hw->hw_addr + ring->tail);
++ ring->head = hw->hw_addr + E1000_RDH(reg_idx);
++ ring->tail = hw->hw_addr + E1000_RDT(reg_idx);
++ writel(0, ring->head);
++ writel(0, ring->tail);
+
+ /* set descriptor configuration */
+ if (adapter->rx_buffer_len < IGB_RXBUFFER_1024) {
+@@ -2567,8 +2567,8 @@ static void igb_clean_tx_ring(struct igb_ring *tx_ring)
+ tx_ring->next_to_use = 0;
+ tx_ring->next_to_clean = 0;
+
+- writel(0, adapter->hw.hw_addr + tx_ring->head);
+- writel(0, adapter->hw.hw_addr + tx_ring->tail);
++ writel(0, tx_ring->head);
++ writel(0, tx_ring->tail);
+ }
+
+ /**
+@@ -2667,8 +2667,8 @@ static void igb_clean_rx_ring(struct igb_ring *rx_ring)
+ rx_ring->next_to_clean = 0;
+ rx_ring->next_to_use = 0;
+
+- writel(0, adapter->hw.hw_addr + rx_ring->head);
+- writel(0, adapter->hw.hw_addr + rx_ring->tail);
++ writel(0, rx_ring->head);
++ writel(0, rx_ring->tail);
+ }
+
+ /**
+@@ -3556,7 +3556,7 @@ static inline void igb_tx_queue_adv(struct igb_adapter *adapter,
+ wmb();
+
+ tx_ring->next_to_use = i;
+- writel(i, adapter->hw.hw_addr + tx_ring->tail);
++ writel(i, tx_ring->tail);
+ /* we need this if more than one processor can write to our tail
+ * at a time, it syncronizes IO on IA64/Altix systems */
+ mmiowb();
+@@ -4761,8 +4761,8 @@ static bool igb_clean_tx_irq(struct igb_q_vector *q_vector)
+ " jiffies <%lx>\n"
+ " desc.status <%x>\n",
+ tx_ring->queue_index,
+- readl(adapter->hw.hw_addr + tx_ring->head),
+- readl(adapter->hw.hw_addr + tx_ring->tail),
++ readl(tx_ring->head),
++ readl(tx_ring->tail),
+ tx_ring->next_to_use,
+ tx_ring->next_to_clean,
+ tx_ring->buffer_info[i].time_stamp,
+@@ -5103,7 +5103,7 @@ no_buffers:
+ * applicable for weak-ordered memory model archs,
+ * such as IA-64). */
+ wmb();
+- writel(i, adapter->hw.hw_addr + rx_ring->tail);
++ writel(i, rx_ring->tail);
+ }
+ }
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0025-igb-add-pci-device-pointer-to-ring-structure.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0025-igb-add-pci-device-pointer-to-ring-structure.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,351 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 27 Oct 2009 15:51:47 +0000
+Subject: [PATCH 025/165] igb: add pci device pointer to ring structure
+
+commit 80785298aa5b6f2005a34afb97457ae7a65af270 upstream.
+
+This patch adds a pci device pointer to the ring structure. The main use of
+this pointer is for memory mapping/unmapping of the rings.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb.h | 5 ++-
+ drivers/net/igb/igb_ethtool.c | 4 +-
+ drivers/net/igb/igb_main.c | 72 ++++++++++++++++++++---------------------
+ 3 files changed, 40 insertions(+), 41 deletions(-)
+
+diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
+index e52fee4..de26862 100644
+--- a/drivers/net/igb/igb.h
++++ b/drivers/net/igb/igb.h
+@@ -173,6 +173,7 @@ struct igb_q_vector {
+ struct igb_ring {
+ struct igb_q_vector *q_vector; /* backlink to q_vector */
+ void *desc; /* descriptor ring memory */
++ struct pci_dev *pdev; /* pci device for dma mapping */
+ dma_addr_t dma; /* phys address of the ring */
+ unsigned int size; /* length of desc. ring in bytes */
+ unsigned int count; /* number of desc. in the ring */
+@@ -325,8 +326,8 @@ extern void igb_down(struct igb_adapter *);
+ extern void igb_reinit_locked(struct igb_adapter *);
+ extern void igb_reset(struct igb_adapter *);
+ extern int igb_set_spd_dplx(struct igb_adapter *, u16);
+-extern int igb_setup_tx_resources(struct igb_adapter *, struct igb_ring *);
+-extern int igb_setup_rx_resources(struct igb_adapter *, struct igb_ring *);
++extern int igb_setup_tx_resources(struct igb_ring *);
++extern int igb_setup_rx_resources(struct igb_ring *);
+ extern void igb_free_tx_resources(struct igb_ring *);
+ extern void igb_free_rx_resources(struct igb_ring *);
+ extern void igb_update_stats(struct igb_adapter *);
+diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
+index 186c78a..d84c503 100644
+--- a/drivers/net/igb/igb_ethtool.c
++++ b/drivers/net/igb/igb_ethtool.c
+@@ -795,7 +795,7 @@ static int igb_set_ringparam(struct net_device *netdev,
+
+ for (i = 0; i < adapter->num_tx_queues; i++) {
+ temp_ring[i].count = new_tx_count;
+- err = igb_setup_tx_resources(adapter, &temp_ring[i]);
++ err = igb_setup_tx_resources(&temp_ring[i]);
+ if (err) {
+ while (i) {
+ i--;
+@@ -820,7 +820,7 @@ static int igb_set_ringparam(struct net_device *netdev,
+
+ for (i = 0; i < adapter->num_rx_queues; i++) {
+ temp_ring[i].count = new_rx_count;
+- err = igb_setup_rx_resources(adapter, &temp_ring[i]);
++ err = igb_setup_rx_resources(&temp_ring[i]);
+ if (err) {
+ while (i) {
+ i--;
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 6a7cc02..bfbefb5 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -436,11 +436,13 @@ static int igb_alloc_queues(struct igb_adapter *adapter)
+ struct igb_ring *ring = &(adapter->tx_ring[i]);
+ ring->count = adapter->tx_ring_count;
+ ring->queue_index = i;
++ ring->pdev = adapter->pdev;
+ }
+ for (i = 0; i < adapter->num_rx_queues; i++) {
+ struct igb_ring *ring = &(adapter->rx_ring[i]);
+ ring->count = adapter->rx_ring_count;
+ ring->queue_index = i;
++ ring->pdev = adapter->pdev;
+ }
+
+ igb_cache_ring_register(adapter);
+@@ -2002,15 +2004,13 @@ static int igb_close(struct net_device *netdev)
+
+ /**
+ * igb_setup_tx_resources - allocate Tx resources (Descriptors)
+- * @adapter: board private structure
+ * @tx_ring: tx descriptor ring (for a specific queue) to setup
+ *
+ * Return 0 on success, negative on failure
+ **/
+-int igb_setup_tx_resources(struct igb_adapter *adapter,
+- struct igb_ring *tx_ring)
++int igb_setup_tx_resources(struct igb_ring *tx_ring)
+ {
+- struct pci_dev *pdev = adapter->pdev;
++ struct pci_dev *pdev = tx_ring->pdev;
+ int size;
+
+ size = sizeof(struct igb_buffer) * tx_ring->count;
+@@ -2053,7 +2053,7 @@ static int igb_setup_all_tx_resources(struct igb_adapter *adapter)
+ int r_idx;
+
+ for (i = 0; i < adapter->num_tx_queues; i++) {
+- err = igb_setup_tx_resources(adapter, &adapter->tx_ring[i]);
++ err = igb_setup_tx_resources(&adapter->tx_ring[i]);
+ if (err) {
+ dev_err(&adapter->pdev->dev,
+ "Allocation for Tx Queue %u failed\n", i);
+@@ -2156,15 +2156,13 @@ static void igb_configure_tx(struct igb_adapter *adapter)
+
+ /**
+ * igb_setup_rx_resources - allocate Rx resources (Descriptors)
+- * @adapter: board private structure
+ * @rx_ring: rx descriptor ring (for a specific queue) to setup
+ *
+ * Returns 0 on success, negative on failure
+ **/
+-int igb_setup_rx_resources(struct igb_adapter *adapter,
+- struct igb_ring *rx_ring)
++int igb_setup_rx_resources(struct igb_ring *rx_ring)
+ {
+- struct pci_dev *pdev = adapter->pdev;
++ struct pci_dev *pdev = rx_ring->pdev;
+ int size, desc_len;
+
+ size = sizeof(struct igb_buffer) * rx_ring->count;
+@@ -2192,7 +2190,7 @@ int igb_setup_rx_resources(struct igb_adapter *adapter,
+
+ err:
+ vfree(rx_ring->buffer_info);
+- dev_err(&adapter->pdev->dev, "Unable to allocate memory for "
++ dev_err(&pdev->dev, "Unable to allocate memory for "
+ "the receive descriptor ring\n");
+ return -ENOMEM;
+ }
+@@ -2209,7 +2207,7 @@ static int igb_setup_all_rx_resources(struct igb_adapter *adapter)
+ int i, err = 0;
+
+ for (i = 0; i < adapter->num_rx_queues; i++) {
+- err = igb_setup_rx_resources(adapter, &adapter->rx_ring[i]);
++ err = igb_setup_rx_resources(&adapter->rx_ring[i]);
+ if (err) {
+ dev_err(&adapter->pdev->dev,
+ "Allocation for Rx Queue %u failed\n", i);
+@@ -2497,14 +2495,13 @@ static void igb_configure_rx(struct igb_adapter *adapter)
+ **/
+ void igb_free_tx_resources(struct igb_ring *tx_ring)
+ {
+- struct pci_dev *pdev = tx_ring->q_vector->adapter->pdev;
+-
+ igb_clean_tx_ring(tx_ring);
+
+ vfree(tx_ring->buffer_info);
+ tx_ring->buffer_info = NULL;
+
+- pci_free_consistent(pdev, tx_ring->size, tx_ring->desc, tx_ring->dma);
++ pci_free_consistent(tx_ring->pdev, tx_ring->size,
++ tx_ring->desc, tx_ring->dma);
+
+ tx_ring->desc = NULL;
+ }
+@@ -2523,12 +2520,13 @@ static void igb_free_all_tx_resources(struct igb_adapter *adapter)
+ igb_free_tx_resources(&adapter->tx_ring[i]);
+ }
+
+-static void igb_unmap_and_free_tx_resource(struct igb_adapter *adapter,
++static void igb_unmap_and_free_tx_resource(struct igb_ring *tx_ring,
+ struct igb_buffer *buffer_info)
+ {
+ buffer_info->dma = 0;
+ if (buffer_info->skb) {
+- skb_dma_unmap(&adapter->pdev->dev, buffer_info->skb,
++ skb_dma_unmap(&tx_ring->pdev->dev,
++ buffer_info->skb,
+ DMA_TO_DEVICE);
+ dev_kfree_skb_any(buffer_info->skb);
+ buffer_info->skb = NULL;
+@@ -2543,7 +2541,6 @@ static void igb_unmap_and_free_tx_resource(struct igb_adapter *adapter,
+ **/
+ static void igb_clean_tx_ring(struct igb_ring *tx_ring)
+ {
+- struct igb_adapter *adapter = tx_ring->q_vector->adapter;
+ struct igb_buffer *buffer_info;
+ unsigned long size;
+ unsigned int i;
+@@ -2554,7 +2551,7 @@ static void igb_clean_tx_ring(struct igb_ring *tx_ring)
+
+ for (i = 0; i < tx_ring->count; i++) {
+ buffer_info = &tx_ring->buffer_info[i];
+- igb_unmap_and_free_tx_resource(adapter, buffer_info);
++ igb_unmap_and_free_tx_resource(tx_ring, buffer_info);
+ }
+
+ size = sizeof(struct igb_buffer) * tx_ring->count;
+@@ -2591,14 +2588,13 @@ static void igb_clean_all_tx_rings(struct igb_adapter *adapter)
+ **/
+ void igb_free_rx_resources(struct igb_ring *rx_ring)
+ {
+- struct pci_dev *pdev = rx_ring->q_vector->adapter->pdev;
+-
+ igb_clean_rx_ring(rx_ring);
+
+ vfree(rx_ring->buffer_info);
+ rx_ring->buffer_info = NULL;
+
+- pci_free_consistent(pdev, rx_ring->size, rx_ring->desc, rx_ring->dma);
++ pci_free_consistent(rx_ring->pdev, rx_ring->size,
++ rx_ring->desc, rx_ring->dma);
+
+ rx_ring->desc = NULL;
+ }
+@@ -2625,7 +2621,6 @@ static void igb_clean_rx_ring(struct igb_ring *rx_ring)
+ {
+ struct igb_adapter *adapter = rx_ring->q_vector->adapter;
+ struct igb_buffer *buffer_info;
+- struct pci_dev *pdev = adapter->pdev;
+ unsigned long size;
+ unsigned int i;
+
+@@ -2635,7 +2630,8 @@ static void igb_clean_rx_ring(struct igb_ring *rx_ring)
+ for (i = 0; i < rx_ring->count; i++) {
+ buffer_info = &rx_ring->buffer_info[i];
+ if (buffer_info->dma) {
+- pci_unmap_single(pdev, buffer_info->dma,
++ pci_unmap_single(rx_ring->pdev,
++ buffer_info->dma,
+ adapter->rx_buffer_len,
+ PCI_DMA_FROMDEVICE);
+ buffer_info->dma = 0;
+@@ -2646,7 +2642,8 @@ static void igb_clean_rx_ring(struct igb_ring *rx_ring)
+ buffer_info->skb = NULL;
+ }
+ if (buffer_info->page_dma) {
+- pci_unmap_page(pdev, buffer_info->page_dma,
++ pci_unmap_page(rx_ring->pdev,
++ buffer_info->page_dma,
+ PAGE_SIZE / 2,
+ PCI_DMA_FROMDEVICE);
+ buffer_info->page_dma = 0;
+@@ -3362,9 +3359,10 @@ static inline bool igb_tx_csum_adv(struct igb_adapter *adapter,
+ struct sk_buff *skb, u32 tx_flags)
+ {
+ struct e1000_adv_tx_context_desc *context_desc;
+- unsigned int i;
++ struct pci_dev *pdev = tx_ring->pdev;
+ struct igb_buffer *buffer_info;
+ u32 info = 0, tu_cmd = 0;
++ unsigned int i;
+
+ if ((skb->ip_summed == CHECKSUM_PARTIAL) ||
+ (tx_flags & IGB_TX_FLAGS_VLAN)) {
+@@ -3411,7 +3409,7 @@ static inline bool igb_tx_csum_adv(struct igb_adapter *adapter,
+ break;
+ default:
+ if (unlikely(net_ratelimit()))
+- dev_warn(&adapter->pdev->dev,
++ dev_warn(&pdev->dev,
+ "partial checksum but proto=%x!\n",
+ skb->protocol);
+ break;
+@@ -3443,11 +3441,11 @@ static inline bool igb_tx_csum_adv(struct igb_adapter *adapter,
+ #define IGB_MAX_TXD_PWR 16
+ #define IGB_MAX_DATA_PER_TXD (1<<IGB_MAX_TXD_PWR)
+
+-static inline int igb_tx_map_adv(struct igb_adapter *adapter,
+- struct igb_ring *tx_ring, struct sk_buff *skb,
++static inline int igb_tx_map_adv(struct igb_ring *tx_ring, struct sk_buff *skb,
+ unsigned int first)
+ {
+ struct igb_buffer *buffer_info;
++ struct pci_dev *pdev = tx_ring->pdev;
+ unsigned int len = skb_headlen(skb);
+ unsigned int count = 0, i;
+ unsigned int f;
+@@ -3455,8 +3453,8 @@ static inline int igb_tx_map_adv(struct igb_adapter *adapter,
+
+ i = tx_ring->next_to_use;
+
+- if (skb_dma_map(&adapter->pdev->dev, skb, DMA_TO_DEVICE)) {
+- dev_err(&adapter->pdev->dev, "TX DMA map failed\n");
++ if (skb_dma_map(&pdev->dev, skb, DMA_TO_DEVICE)) {
++ dev_err(&pdev->dev, "TX DMA map failed\n");
+ return 0;
+ }
+
+@@ -3667,7 +3665,7 @@ static netdev_tx_t igb_xmit_frame_ring_adv(struct sk_buff *skb,
+ * count reflects descriptors mapped, if 0 then mapping error
+ * has occured and we need to rewind the descriptor queue
+ */
+- count = igb_tx_map_adv(adapter, tx_ring, skb, first);
++ count = igb_tx_map_adv(tx_ring, skb, first);
+
+ if (count) {
+ igb_tx_queue_adv(adapter, tx_ring, tx_flags, count,
+@@ -4710,7 +4708,7 @@ static bool igb_clean_tx_irq(struct igb_q_vector *q_vector)
+ igb_tx_hwtstamp(adapter, skb);
+ }
+
+- igb_unmap_and_free_tx_resource(adapter, buffer_info);
++ igb_unmap_and_free_tx_resource(tx_ring, buffer_info);
+ tx_desc->wb.status = 0;
+
+ i++;
+@@ -4748,7 +4746,7 @@ static bool igb_clean_tx_irq(struct igb_q_vector *q_vector)
+ E1000_STATUS_TXOFF)) {
+
+ /* detected Tx unit hang */
+- dev_err(&adapter->pdev->dev,
++ dev_err(&tx_ring->pdev->dev,
+ "Detected Tx Unit Hang\n"
+ " Tx Queue <%d>\n"
+ " TDH <%x>\n"
+@@ -4851,7 +4849,7 @@ static bool igb_clean_rx_irq_adv(struct igb_q_vector *q_vector,
+ struct net_device *netdev = adapter->netdev;
+ struct igb_ring *rx_ring = q_vector->rx_ring;
+ struct e1000_hw *hw = &adapter->hw;
+- struct pci_dev *pdev = adapter->pdev;
++ struct pci_dev *pdev = rx_ring->pdev;
+ union e1000_adv_rx_desc *rx_desc , *next_rxd;
+ struct igb_buffer *buffer_info , *next_buffer;
+ struct sk_buff *skb;
+@@ -5027,7 +5025,6 @@ static void igb_alloc_rx_buffers_adv(struct igb_ring *rx_ring,
+ {
+ struct igb_adapter *adapter = rx_ring->q_vector->adapter;
+ struct net_device *netdev = adapter->netdev;
+- struct pci_dev *pdev = adapter->pdev;
+ union e1000_adv_rx_desc *rx_desc;
+ struct igb_buffer *buffer_info;
+ struct sk_buff *skb;
+@@ -5054,7 +5051,7 @@ static void igb_alloc_rx_buffers_adv(struct igb_ring *rx_ring,
+ buffer_info->page_offset ^= PAGE_SIZE / 2;
+ }
+ buffer_info->page_dma =
+- pci_map_page(pdev, buffer_info->page,
++ pci_map_page(rx_ring->pdev, buffer_info->page,
+ buffer_info->page_offset,
+ PAGE_SIZE / 2,
+ PCI_DMA_FROMDEVICE);
+@@ -5068,7 +5065,8 @@ static void igb_alloc_rx_buffers_adv(struct igb_ring *rx_ring,
+ }
+
+ buffer_info->skb = skb;
+- buffer_info->dma = pci_map_single(pdev, skb->data,
++ buffer_info->dma = pci_map_single(rx_ring->pdev,
++ skb->data,
+ bufsz,
+ PCI_DMA_FROMDEVICE);
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0026-igb-move-rx_buffer_len-into-the-ring-structure.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0026-igb-move-rx_buffer_len-into-the-ring-structure.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,190 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 27 Oct 2009 15:52:07 +0000
+Subject: [PATCH 026/165] igb: move rx_buffer_len into the ring structure
+
+commit 4c844851d15cc08d995179ab5118172711be6eb0 upstream.
+
+This patch moves the rx_buffer_len value into the ring structure. This allows
+greater flexibility and the option of doing things such as supporting packet
+split only on some queues, or enabling virtualization.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb.h | 3 +--
+ drivers/net/igb/igb_main.c | 41 ++++++++++++++++++++++-------------------
+ 2 files changed, 23 insertions(+), 21 deletions(-)
+
+diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
+index de26862..00ff274 100644
+--- a/drivers/net/igb/igb.h
++++ b/drivers/net/igb/igb.h
+@@ -198,7 +198,7 @@ struct igb_ring {
+ /* RX */
+ struct {
+ struct igb_rx_queue_stats rx_stats;
+- u64 rx_queue_drops;
++ u32 rx_buffer_len;
+ };
+ };
+ };
+@@ -218,7 +218,6 @@ struct igb_adapter {
+ struct vlan_group *vlgrp;
+ u16 mng_vlan_id;
+ u32 bd_number;
+- u32 rx_buffer_len;
+ u32 wol;
+ u32 en_mng_pt;
+ u16 link_speed;
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index bfbefb5..9d508c4 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -443,6 +443,7 @@ static int igb_alloc_queues(struct igb_adapter *adapter)
+ ring->count = adapter->rx_ring_count;
+ ring->queue_index = i;
+ ring->pdev = adapter->pdev;
++ ring->rx_buffer_len = MAXIMUM_ETHERNET_VLAN_SIZE;
+ }
+
+ igb_cache_ring_register(adapter);
+@@ -1863,7 +1864,6 @@ static int __devinit igb_sw_init(struct igb_adapter *adapter)
+
+ adapter->tx_ring_count = IGB_DEFAULT_TXD;
+ adapter->rx_ring_count = IGB_DEFAULT_RXD;
+- adapter->rx_buffer_len = MAXIMUM_ETHERNET_VLAN_SIZE;
+ adapter->max_frame_size = netdev->mtu + ETH_HLEN + ETH_FCS_LEN;
+ adapter->min_frame_size = ETH_ZLEN + ETH_FCS_LEN;
+
+@@ -2358,8 +2358,8 @@ static void igb_configure_rx_ring(struct igb_adapter *adapter,
+ writel(0, ring->tail);
+
+ /* set descriptor configuration */
+- if (adapter->rx_buffer_len < IGB_RXBUFFER_1024) {
+- srrctl = ALIGN(adapter->rx_buffer_len, 64) <<
++ if (ring->rx_buffer_len < IGB_RXBUFFER_1024) {
++ srrctl = ALIGN(ring->rx_buffer_len, 64) <<
+ E1000_SRRCTL_BSIZEHDRSIZE_SHIFT;
+ #if (PAGE_SIZE / 2) > IGB_RXBUFFER_16384
+ srrctl |= IGB_RXBUFFER_16384 >>
+@@ -2370,7 +2370,7 @@ static void igb_configure_rx_ring(struct igb_adapter *adapter,
+ #endif
+ srrctl |= E1000_SRRCTL_DESCTYPE_HDR_SPLIT_ALWAYS;
+ } else {
+- srrctl = ALIGN(adapter->rx_buffer_len, 1024) >>
++ srrctl = ALIGN(ring->rx_buffer_len, 1024) >>
+ E1000_SRRCTL_BSIZEPKT_SHIFT;
+ srrctl |= E1000_SRRCTL_DESCTYPE_ADV_ONEBUF;
+ }
+@@ -2619,7 +2619,6 @@ static void igb_free_all_rx_resources(struct igb_adapter *adapter)
+ **/
+ static void igb_clean_rx_ring(struct igb_ring *rx_ring)
+ {
+- struct igb_adapter *adapter = rx_ring->q_vector->adapter;
+ struct igb_buffer *buffer_info;
+ unsigned long size;
+ unsigned int i;
+@@ -2632,7 +2631,7 @@ static void igb_clean_rx_ring(struct igb_ring *rx_ring)
+ if (buffer_info->dma) {
+ pci_unmap_single(rx_ring->pdev,
+ buffer_info->dma,
+- adapter->rx_buffer_len,
++ rx_ring->rx_buffer_len,
+ PCI_DMA_FROMDEVICE);
+ buffer_info->dma = 0;
+ }
+@@ -3746,6 +3745,7 @@ static int igb_change_mtu(struct net_device *netdev, int new_mtu)
+ {
+ struct igb_adapter *adapter = netdev_priv(netdev);
+ int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN;
++ u32 rx_buffer_len, i;
+
+ if ((max_frame < ETH_ZLEN + ETH_FCS_LEN) ||
+ (max_frame > MAX_JUMBO_FRAME_SIZE)) {
+@@ -3763,9 +3763,6 @@ static int igb_change_mtu(struct net_device *netdev, int new_mtu)
+
+ /* igb_down has a dependency on max_frame_size */
+ adapter->max_frame_size = max_frame;
+- if (netif_running(netdev))
+- igb_down(adapter);
+-
+ /* NOTE: netdev_alloc_skb reserves 16 bytes, and typically NET_IP_ALIGN
+ * means we reserve 2 more, this pushes us to allocate from the next
+ * larger slab size.
+@@ -3773,16 +3770,22 @@ static int igb_change_mtu(struct net_device *netdev, int new_mtu)
+ */
+
+ if (max_frame <= IGB_RXBUFFER_1024)
+- adapter->rx_buffer_len = IGB_RXBUFFER_1024;
++ rx_buffer_len = IGB_RXBUFFER_1024;
+ else if (max_frame <= MAXIMUM_ETHERNET_VLAN_SIZE)
+- adapter->rx_buffer_len = MAXIMUM_ETHERNET_VLAN_SIZE;
++ rx_buffer_len = MAXIMUM_ETHERNET_VLAN_SIZE;
+ else
+- adapter->rx_buffer_len = IGB_RXBUFFER_128;
++ rx_buffer_len = IGB_RXBUFFER_128;
++
++ if (netif_running(netdev))
++ igb_down(adapter);
+
+ dev_info(&adapter->pdev->dev, "changing MTU from %d to %d\n",
+ netdev->mtu, new_mtu);
+ netdev->mtu = new_mtu;
+
++ for (i = 0; i < adapter->num_rx_queues; i++)
++ adapter->rx_ring[i].rx_buffer_len = rx_buffer_len;
++
+ if (netif_running(netdev))
+ igb_up(adapter);
+ else
+@@ -4828,7 +4831,7 @@ static inline void igb_rx_checksum_adv(struct igb_adapter *adapter,
+ dev_dbg(&adapter->pdev->dev, "cksum success: bits %08X\n", status_err);
+ }
+
+-static inline u16 igb_get_hlen(struct igb_adapter *adapter,
++static inline u16 igb_get_hlen(struct igb_ring *rx_ring,
+ union e1000_adv_rx_desc *rx_desc)
+ {
+ /* HW will not DMA in data larger than the given buffer, even if it
+@@ -4837,8 +4840,8 @@ static inline u16 igb_get_hlen(struct igb_adapter *adapter,
+ */
+ u16 hlen = (le16_to_cpu(rx_desc->wb.lower.lo_dword.hdr_info) &
+ E1000_RXDADV_HDRBUFLEN_MASK) >> E1000_RXDADV_HDRBUFLEN_SHIFT;
+- if (hlen > adapter->rx_buffer_len)
+- hlen = adapter->rx_buffer_len;
++ if (hlen > rx_ring->rx_buffer_len)
++ hlen = rx_ring->rx_buffer_len;
+ return hlen;
+ }
+
+@@ -4888,14 +4891,14 @@ static bool igb_clean_rx_irq_adv(struct igb_q_vector *q_vector,
+
+ if (buffer_info->dma) {
+ pci_unmap_single(pdev, buffer_info->dma,
+- adapter->rx_buffer_len,
++ rx_ring->rx_buffer_len,
+ PCI_DMA_FROMDEVICE);
+ buffer_info->dma = 0;
+- if (adapter->rx_buffer_len >= IGB_RXBUFFER_1024) {
++ if (rx_ring->rx_buffer_len >= IGB_RXBUFFER_1024) {
+ skb_put(skb, length);
+ goto send_up;
+ }
+- skb_put(skb, igb_get_hlen(adapter, rx_desc));
++ skb_put(skb, igb_get_hlen(rx_ring, rx_desc));
+ }
+
+ if (length) {
+@@ -5034,7 +5037,7 @@ static void igb_alloc_rx_buffers_adv(struct igb_ring *rx_ring,
+ i = rx_ring->next_to_use;
+ buffer_info = &rx_ring->buffer_info[i];
+
+- bufsz = adapter->rx_buffer_len;
++ bufsz = rx_ring->rx_buffer_len;
+
+ while (cleaned_count--) {
+ rx_desc = E1000_RX_DESC_ADV(*rx_ring, i);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0027-igb-move-alloc_failed-and-csum_err-stats-into-per-rx.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0027-igb-move-alloc_failed-and-csum_err-stats-into-per-rx.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,181 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 27 Oct 2009 15:52:27 +0000
+Subject: [PATCH 027/165] igb: move alloc_failed and csum_err stats into per
+ rx-ring stat
+
+commit 04a5fcaaf0e12d066411aa54e42591952aa18da7 upstream.
+
+The allocation failed and checksum error stats are currently kept as a
+global stat. If we end up allocating the queues to multiple netdevs then
+the global counter doesn't make much sense. For this reason I felt it
+necessary to move the alloc_rx_buff_failed stat into the rx_stats
+portion of the rx_ring.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb.h | 6 +++---
+ drivers/net/igb/igb_ethtool.c | 9 ++++++---
+ drivers/net/igb/igb_main.c | 17 ++++++++---------
+ 3 files changed, 17 insertions(+), 15 deletions(-)
+
+diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
+index 00ff274..6a67fa2 100644
+--- a/drivers/net/igb/igb.h
++++ b/drivers/net/igb/igb.h
+@@ -145,12 +145,15 @@ struct igb_buffer {
+ struct igb_tx_queue_stats {
+ u64 packets;
+ u64 bytes;
++ u64 restart_queue;
+ };
+
+ struct igb_rx_queue_stats {
+ u64 packets;
+ u64 bytes;
+ u64 drops;
++ u64 csum_err;
++ u64 alloc_failed;
+ };
+
+ struct igb_q_vector {
+@@ -241,7 +244,6 @@ struct igb_adapter {
+
+ /* TX */
+ struct igb_ring *tx_ring; /* One per active queue */
+- unsigned int restart_queue;
+ unsigned long tx_queue_len;
+ u32 txd_cmd;
+ u32 gotc;
+@@ -255,8 +257,6 @@ struct igb_adapter {
+ int num_tx_queues;
+ int num_rx_queues;
+
+- u64 hw_csum_err;
+- u32 alloc_rx_buff_failed;
+ u32 gorc;
+ u64 gorc_old;
+ u32 max_frame_size;
+diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
+index d84c503..c920ae1 100644
+--- a/drivers/net/igb/igb_ethtool.c
++++ b/drivers/net/igb/igb_ethtool.c
+@@ -85,7 +85,6 @@ static const struct igb_stats igb_gstrings_stats[] = {
+ { "tx_single_coll_ok", IGB_STAT(stats.scc) },
+ { "tx_multi_coll_ok", IGB_STAT(stats.mcc) },
+ { "tx_timeout_count", IGB_STAT(tx_timeout_count) },
+- { "tx_restart_queue", IGB_STAT(restart_queue) },
+ { "rx_long_length_errors", IGB_STAT(stats.roc) },
+ { "rx_short_length_errors", IGB_STAT(stats.ruc) },
+ { "rx_align_errors", IGB_STAT(stats.algnerrc) },
+@@ -96,9 +95,7 @@ static const struct igb_stats igb_gstrings_stats[] = {
+ { "tx_flow_control_xon", IGB_STAT(stats.xontxc) },
+ { "tx_flow_control_xoff", IGB_STAT(stats.xofftxc) },
+ { "rx_long_byte_count", IGB_STAT(stats.gorc) },
+- { "rx_csum_offload_errors", IGB_STAT(hw_csum_err) },
+ { "tx_dma_out_of_sync", IGB_STAT(stats.doosync) },
+- { "alloc_rx_buff_failed", IGB_STAT(alloc_rx_buff_failed) },
+ { "tx_smbus", IGB_STAT(stats.mgptc) },
+ { "rx_smbus", IGB_STAT(stats.mgprc) },
+ { "dropped_smbus", IGB_STAT(stats.mgpdc) },
+@@ -2032,6 +2029,8 @@ static void igb_get_strings(struct net_device *netdev, u32 stringset, u8 *data)
+ p += ETH_GSTRING_LEN;
+ sprintf(p, "tx_queue_%u_bytes", i);
+ p += ETH_GSTRING_LEN;
++ sprintf(p, "tx_queue_%u_restart", i);
++ p += ETH_GSTRING_LEN;
+ }
+ for (i = 0; i < adapter->num_rx_queues; i++) {
+ sprintf(p, "rx_queue_%u_packets", i);
+@@ -2040,6 +2039,10 @@ static void igb_get_strings(struct net_device *netdev, u32 stringset, u8 *data)
+ p += ETH_GSTRING_LEN;
+ sprintf(p, "rx_queue_%u_drops", i);
+ p += ETH_GSTRING_LEN;
++ sprintf(p, "rx_queue_%u_csum_err", i);
++ p += ETH_GSTRING_LEN;
++ sprintf(p, "rx_queue_%u_alloc_failed", i);
++ p += ETH_GSTRING_LEN;
+ }
+ /* BUG_ON(p - data != IGB_STATS_LEN * ETH_GSTRING_LEN); */
+ break;
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 9d508c4..6b3aabc 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -3562,8 +3562,6 @@ static inline void igb_tx_queue_adv(struct igb_adapter *adapter,
+ static int __igb_maybe_stop_tx(struct net_device *netdev,
+ struct igb_ring *tx_ring, int size)
+ {
+- struct igb_adapter *adapter = netdev_priv(netdev);
+-
+ netif_stop_subqueue(netdev, tx_ring->queue_index);
+
+ /* Herbert's original patch had:
+@@ -3578,7 +3576,7 @@ static int __igb_maybe_stop_tx(struct net_device *netdev,
+
+ /* A reprieve! */
+ netif_wake_subqueue(netdev, tx_ring->queue_index);
+- ++adapter->restart_queue;
++ tx_ring->tx_stats.restart_queue++;
+ return 0;
+ }
+
+@@ -4734,7 +4732,7 @@ static bool igb_clean_tx_irq(struct igb_q_vector *q_vector)
+ if (__netif_subqueue_stopped(netdev, tx_ring->queue_index) &&
+ !(test_bit(__IGB_DOWN, &adapter->state))) {
+ netif_wake_subqueue(netdev, tx_ring->queue_index);
+- ++adapter->restart_queue;
++ tx_ring->tx_stats.restart_queue++;
+ }
+ }
+
+@@ -4801,7 +4799,8 @@ static void igb_receive_skb(struct igb_q_vector *q_vector,
+ napi_gro_receive(&q_vector->napi, skb);
+ }
+
+-static inline void igb_rx_checksum_adv(struct igb_adapter *adapter,
++static inline void igb_rx_checksum_adv(struct igb_ring *ring,
++ struct igb_adapter *adapter,
+ u32 status_err, struct sk_buff *skb)
+ {
+ skb->ip_summed = CHECKSUM_NONE;
+@@ -4820,7 +4819,7 @@ static inline void igb_rx_checksum_adv(struct igb_adapter *adapter,
+ */
+ if (!((adapter->hw.mac.type == e1000_82576) &&
+ (skb->len == 60)))
+- adapter->hw_csum_err++;
++ ring->rx_stats.csum_err++;
+ /* let the stack verify checksum errors */
+ return;
+ }
+@@ -4979,7 +4978,7 @@ send_up:
+ total_bytes += skb->len;
+ total_packets++;
+
+- igb_rx_checksum_adv(adapter, staterr, skb);
++ igb_rx_checksum_adv(rx_ring, adapter, staterr, skb);
+
+ skb->protocol = eth_type_trans(skb, netdev);
+ skb_record_rx_queue(skb, rx_ring->queue_index);
+@@ -5046,7 +5045,7 @@ static void igb_alloc_rx_buffers_adv(struct igb_ring *rx_ring,
+ if (!buffer_info->page) {
+ buffer_info->page = alloc_page(GFP_ATOMIC);
+ if (!buffer_info->page) {
+- adapter->alloc_rx_buff_failed++;
++ rx_ring->rx_stats.alloc_failed++;
+ goto no_buffers;
+ }
+ buffer_info->page_offset = 0;
+@@ -5063,7 +5062,7 @@ static void igb_alloc_rx_buffers_adv(struct igb_ring *rx_ring,
+ if (!buffer_info->skb) {
+ skb = netdev_alloc_skb_ip_align(netdev, bufsz);
+ if (!skb) {
+- adapter->alloc_rx_buff_failed++;
++ rx_ring->rx_stats.alloc_failed++;
+ goto no_buffers;
+ }
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0028-igb-add-a-flags-value-to-the-ring.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0028-igb-add-a-flags-value-to-the-ring.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,331 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 27 Oct 2009 15:52:46 +0000
+Subject: [PATCH 028/165] igb: add a flags value to the ring
+
+commit 85ad76b2f9c4956ec90c86298b22bb35c326e772 upstream.
+
+This patch adds a flags value to the ring that cleans up some of the last
+remaining items from the ring in order to help seperate it from the adapter
+struct. By implementing these flags it becomes possible for different rings
+to support different functions such as rx checksumming.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb.h | 12 ++++-
+ drivers/net/igb/igb_ethtool.c | 13 ++++--
+ drivers/net/igb/igb_main.c | 93 +++++++++++++++++++----------------------
+ 3 files changed, 60 insertions(+), 58 deletions(-)
+
+diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
+index 6a67fa2..0c30c5e 100644
+--- a/drivers/net/igb/igb.h
++++ b/drivers/net/igb/igb.h
+@@ -192,6 +192,8 @@ struct igb_ring {
+ unsigned int total_bytes;
+ unsigned int total_packets;
+
++ u32 flags;
++
+ union {
+ /* TX */
+ struct {
+@@ -206,6 +208,13 @@ struct igb_ring {
+ };
+ };
+
++#define IGB_RING_FLAG_RX_CSUM 0x00000001 /* RX CSUM enabled */
++#define IGB_RING_FLAG_RX_SCTP_CSUM 0x00000002 /* SCTP CSUM offload enabled */
++
++#define IGB_RING_FLAG_TX_CTX_IDX 0x00000001 /* HW requires context index */
++
++#define IGB_ADVTXD_DCMD (E1000_TXD_CMD_EOP | E1000_TXD_CMD_RS)
++
+ #define E1000_RX_DESC_ADV(R, i) \
+ (&(((union e1000_adv_rx_desc *)((R).desc))[i]))
+ #define E1000_TX_DESC_ADV(R, i) \
+@@ -245,7 +254,6 @@ struct igb_adapter {
+ /* TX */
+ struct igb_ring *tx_ring; /* One per active queue */
+ unsigned long tx_queue_len;
+- u32 txd_cmd;
+ u32 gotc;
+ u64 gotc_old;
+ u64 tpt_old;
+@@ -303,8 +311,6 @@ struct igb_adapter {
+ #define IGB_FLAG_HAS_MSI (1 << 0)
+ #define IGB_FLAG_DCA_ENABLED (1 << 1)
+ #define IGB_FLAG_QUAD_PORT_A (1 << 2)
+-#define IGB_FLAG_NEED_CTX_IDX (1 << 3)
+-#define IGB_FLAG_RX_CSUM_DISABLED (1 << 4)
+
+ enum e1000_state_t {
+ __IGB_TESTING,
+diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
+index c920ae1..51ecbf4 100644
+--- a/drivers/net/igb/igb_ethtool.c
++++ b/drivers/net/igb/igb_ethtool.c
+@@ -280,17 +280,20 @@ static int igb_set_pauseparam(struct net_device *netdev,
+ static u32 igb_get_rx_csum(struct net_device *netdev)
+ {
+ struct igb_adapter *adapter = netdev_priv(netdev);
+- return !(adapter->flags & IGB_FLAG_RX_CSUM_DISABLED);
++ return !!(adapter->rx_ring[0].flags & IGB_RING_FLAG_RX_CSUM);
+ }
+
+ static int igb_set_rx_csum(struct net_device *netdev, u32 data)
+ {
+ struct igb_adapter *adapter = netdev_priv(netdev);
++ int i;
+
+- if (data)
+- adapter->flags &= ~IGB_FLAG_RX_CSUM_DISABLED;
+- else
+- adapter->flags |= IGB_FLAG_RX_CSUM_DISABLED;
++ for (i = 0; i < adapter->num_rx_queues; i++) {
++ if (data)
++ adapter->rx_ring[i].flags |= IGB_RING_FLAG_RX_CSUM;
++ else
++ adapter->rx_ring[i].flags &= ~IGB_RING_FLAG_RX_CSUM;
++ }
+
+ return 0;
+ }
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 6b3aabc..b4c8e5c 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -437,13 +437,21 @@ static int igb_alloc_queues(struct igb_adapter *adapter)
+ ring->count = adapter->tx_ring_count;
+ ring->queue_index = i;
+ ring->pdev = adapter->pdev;
++ /* For 82575, context index must be unique per ring. */
++ if (adapter->hw.mac.type == e1000_82575)
++ ring->flags = IGB_RING_FLAG_TX_CTX_IDX;
+ }
++
+ for (i = 0; i < adapter->num_rx_queues; i++) {
+ struct igb_ring *ring = &(adapter->rx_ring[i]);
+ ring->count = adapter->rx_ring_count;
+ ring->queue_index = i;
+ ring->pdev = adapter->pdev;
+ ring->rx_buffer_len = MAXIMUM_ETHERNET_VLAN_SIZE;
++ ring->flags = IGB_RING_FLAG_RX_CSUM; /* enable rx checksum */
++ /* set flag indicating ring supports SCTP checksum offload */
++ if (adapter->hw.mac.type >= e1000_82576)
++ ring->flags |= IGB_RING_FLAG_RX_SCTP_CSUM;
+ }
+
+ igb_cache_ring_register(adapter);
+@@ -1517,16 +1525,6 @@ static int __devinit igb_probe(struct pci_dev *pdev,
+
+ igb_get_bus_info_pcie(hw);
+
+- /* set flags */
+- switch (hw->mac.type) {
+- case e1000_82575:
+- adapter->flags |= IGB_FLAG_NEED_CTX_IDX;
+- break;
+- case e1000_82576:
+- default:
+- break;
+- }
+-
+ hw->phy.autoneg_wait_to_complete = false;
+ hw->mac.adaptive_ifs = true;
+
+@@ -2149,9 +2147,6 @@ static void igb_configure_tx(struct igb_adapter *adapter)
+
+ for (i = 0; i < adapter->num_tx_queues; i++)
+ igb_configure_tx_ring(adapter, &adapter->tx_ring[i]);
+-
+- /* Setup Transmit Descriptor Settings for eop descriptor */
+- adapter->txd_cmd = E1000_TXD_CMD_EOP | E1000_TXD_CMD_RS;
+ }
+
+ /**
+@@ -3272,8 +3267,7 @@ set_itr_now:
+ #define IGB_TX_FLAGS_VLAN_MASK 0xffff0000
+ #define IGB_TX_FLAGS_VLAN_SHIFT 16
+
+-static inline int igb_tso_adv(struct igb_adapter *adapter,
+- struct igb_ring *tx_ring,
++static inline int igb_tso_adv(struct igb_ring *tx_ring,
+ struct sk_buff *skb, u32 tx_flags, u8 *hdr_len)
+ {
+ struct e1000_adv_tx_context_desc *context_desc;
+@@ -3335,8 +3329,8 @@ static inline int igb_tso_adv(struct igb_adapter *adapter,
+ mss_l4len_idx |= (l4len << E1000_ADVTXD_L4LEN_SHIFT);
+
+ /* For 82575, context index must be unique per ring. */
+- if (adapter->flags & IGB_FLAG_NEED_CTX_IDX)
+- mss_l4len_idx |= tx_ring->queue_index << 4;
++ if (tx_ring->flags & IGB_RING_FLAG_TX_CTX_IDX)
++ mss_l4len_idx |= tx_ring->reg_idx << 4;
+
+ context_desc->mss_l4len_idx = cpu_to_le32(mss_l4len_idx);
+ context_desc->seqnum_seed = 0;
+@@ -3353,9 +3347,8 @@ static inline int igb_tso_adv(struct igb_adapter *adapter,
+ return true;
+ }
+
+-static inline bool igb_tx_csum_adv(struct igb_adapter *adapter,
+- struct igb_ring *tx_ring,
+- struct sk_buff *skb, u32 tx_flags)
++static inline bool igb_tx_csum_adv(struct igb_ring *tx_ring,
++ struct sk_buff *skb, u32 tx_flags)
+ {
+ struct e1000_adv_tx_context_desc *context_desc;
+ struct pci_dev *pdev = tx_ring->pdev;
+@@ -3417,11 +3410,9 @@ static inline bool igb_tx_csum_adv(struct igb_adapter *adapter,
+
+ context_desc->type_tucmd_mlhl = cpu_to_le32(tu_cmd);
+ context_desc->seqnum_seed = 0;
+- if (adapter->flags & IGB_FLAG_NEED_CTX_IDX)
++ if (tx_ring->flags & IGB_RING_FLAG_TX_CTX_IDX)
+ context_desc->mss_l4len_idx =
+- cpu_to_le32(tx_ring->queue_index << 4);
+- else
+- context_desc->mss_l4len_idx = 0;
++ cpu_to_le32(tx_ring->reg_idx << 4);
+
+ buffer_info->time_stamp = jiffies;
+ buffer_info->next_to_watch = i;
+@@ -3492,8 +3483,7 @@ static inline int igb_tx_map_adv(struct igb_ring *tx_ring, struct sk_buff *skb,
+ return count + 1;
+ }
+
+-static inline void igb_tx_queue_adv(struct igb_adapter *adapter,
+- struct igb_ring *tx_ring,
++static inline void igb_tx_queue_adv(struct igb_ring *tx_ring,
+ int tx_flags, int count, u32 paylen,
+ u8 hdr_len)
+ {
+@@ -3525,10 +3515,11 @@ static inline void igb_tx_queue_adv(struct igb_adapter *adapter,
+ olinfo_status |= E1000_TXD_POPTS_TXSM << 8;
+ }
+
+- if ((adapter->flags & IGB_FLAG_NEED_CTX_IDX) &&
+- (tx_flags & (IGB_TX_FLAGS_CSUM | IGB_TX_FLAGS_TSO |
++ if ((tx_ring->flags & IGB_RING_FLAG_TX_CTX_IDX) &&
++ (tx_flags & (IGB_TX_FLAGS_CSUM |
++ IGB_TX_FLAGS_TSO |
+ IGB_TX_FLAGS_VLAN)))
+- olinfo_status |= tx_ring->queue_index << 4;
++ olinfo_status |= tx_ring->reg_idx << 4;
+
+ olinfo_status |= ((paylen - hdr_len) << E1000_ADVTXD_PAYLEN_SHIFT);
+
+@@ -3545,7 +3536,7 @@ static inline void igb_tx_queue_adv(struct igb_adapter *adapter,
+ i = 0;
+ }
+
+- tx_desc->read.cmd_type_len |= cpu_to_le32(adapter->txd_cmd);
++ tx_desc->read.cmd_type_len |= cpu_to_le32(IGB_ADVTXD_DCMD);
+ /* Force memory writes to complete before letting h/w
+ * know there are new descriptors to fetch. (Only
+ * applicable for weak-ordered memory model archs,
+@@ -3644,17 +3635,17 @@ static netdev_tx_t igb_xmit_frame_ring_adv(struct sk_buff *skb,
+ tx_flags |= IGB_TX_FLAGS_IPV4;
+
+ first = tx_ring->next_to_use;
+- tso = skb_is_gso(skb) ? igb_tso_adv(adapter, tx_ring, skb, tx_flags,
+- &hdr_len) : 0;
+-
+- if (tso < 0) {
+- dev_kfree_skb_any(skb);
+- return NETDEV_TX_OK;
++ if (skb_is_gso(skb)) {
++ tso = igb_tso_adv(tx_ring, skb, tx_flags, &hdr_len);
++ if (tso < 0) {
++ dev_kfree_skb_any(skb);
++ return NETDEV_TX_OK;
++ }
+ }
+
+ if (tso)
+ tx_flags |= IGB_TX_FLAGS_TSO;
+- else if (igb_tx_csum_adv(adapter, tx_ring, skb, tx_flags) &&
++ else if (igb_tx_csum_adv(tx_ring, skb, tx_flags) &&
+ (skb->ip_summed == CHECKSUM_PARTIAL))
+ tx_flags |= IGB_TX_FLAGS_CSUM;
+
+@@ -3664,17 +3655,18 @@ static netdev_tx_t igb_xmit_frame_ring_adv(struct sk_buff *skb,
+ */
+ count = igb_tx_map_adv(tx_ring, skb, first);
+
+- if (count) {
+- igb_tx_queue_adv(adapter, tx_ring, tx_flags, count,
+- skb->len, hdr_len);
+- /* Make sure there is space in the ring for the next send. */
+- igb_maybe_stop_tx(netdev, tx_ring, MAX_SKB_FRAGS + 4);
+- } else {
++ if (!count) {
+ dev_kfree_skb_any(skb);
+ tx_ring->buffer_info[first].time_stamp = 0;
+ tx_ring->next_to_use = first;
++ return NETDEV_TX_OK;
+ }
+
++ igb_tx_queue_adv(tx_ring, tx_flags, count, skb->len, hdr_len);
++
++ /* Make sure there is space in the ring for the next send. */
++ igb_maybe_stop_tx(netdev, tx_ring, MAX_SKB_FRAGS + 4);
++
+ return NETDEV_TX_OK;
+ }
+
+@@ -4800,15 +4792,15 @@ static void igb_receive_skb(struct igb_q_vector *q_vector,
+ }
+
+ static inline void igb_rx_checksum_adv(struct igb_ring *ring,
+- struct igb_adapter *adapter,
+ u32 status_err, struct sk_buff *skb)
+ {
+ skb->ip_summed = CHECKSUM_NONE;
+
+ /* Ignore Checksum bit is set or checksum is disabled through ethtool */
+- if ((status_err & E1000_RXD_STAT_IXSM) ||
+- (adapter->flags & IGB_FLAG_RX_CSUM_DISABLED))
++ if (!(ring->flags & IGB_RING_FLAG_RX_CSUM) ||
++ (status_err & E1000_RXD_STAT_IXSM))
+ return;
++
+ /* TCP/UDP checksum error bit is set */
+ if (status_err &
+ (E1000_RXDEXT_STATERR_TCPE | E1000_RXDEXT_STATERR_IPE)) {
+@@ -4817,9 +4809,10 @@ static inline void igb_rx_checksum_adv(struct igb_ring *ring,
+ * L4E bit is set incorrectly on 64 byte (60 byte w/o crc)
+ * packets, (aka let the stack check the crc32c)
+ */
+- if (!((adapter->hw.mac.type == e1000_82576) &&
+- (skb->len == 60)))
++ if ((skb->len == 60) &&
++ (ring->flags & IGB_RING_FLAG_RX_SCTP_CSUM))
+ ring->rx_stats.csum_err++;
++
+ /* let the stack verify checksum errors */
+ return;
+ }
+@@ -4827,7 +4820,7 @@ static inline void igb_rx_checksum_adv(struct igb_ring *ring,
+ if (status_err & (E1000_RXD_STAT_TCPCS | E1000_RXD_STAT_UDPCS))
+ skb->ip_summed = CHECKSUM_UNNECESSARY;
+
+- dev_dbg(&adapter->pdev->dev, "cksum success: bits %08X\n", status_err);
++ dev_dbg(&ring->pdev->dev, "cksum success: bits %08X\n", status_err);
+ }
+
+ static inline u16 igb_get_hlen(struct igb_ring *rx_ring,
+@@ -4978,7 +4971,7 @@ send_up:
+ total_bytes += skb->len;
+ total_packets++;
+
+- igb_rx_checksum_adv(rx_ring, adapter, staterr, skb);
++ igb_rx_checksum_adv(rx_ring, staterr, skb);
+
+ skb->protocol = eth_type_trans(skb, netdev);
+ skb_record_rx_queue(skb, rx_ring->queue_index);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0029-igb-place-a-pointer-to-the-netdev-struct-in-the-ring.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0029-igb-place-a-pointer-to-the-netdev-struct-in-the-ring.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,158 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 27 Oct 2009 15:53:06 +0000
+Subject: [PATCH 029/165] igb: place a pointer to the netdev struct in the
+ ring itself
+
+commit e694e964fc1241b4981873bdccce70438d5f0394 upstream.
+
+This change adds a pointer to the netdev to the ring itself. The idea being
+at some point in the future it will be possible to support multiple netdevs
+from a single adapter struct.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb.h | 3 ++-
+ drivers/net/igb/igb_main.c | 29 ++++++++++++++---------------
+ 2 files changed, 16 insertions(+), 16 deletions(-)
+
+diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
+index 0c30c5e..2416c12 100644
+--- a/drivers/net/igb/igb.h
++++ b/drivers/net/igb/igb.h
+@@ -175,9 +175,10 @@ struct igb_q_vector {
+
+ struct igb_ring {
+ struct igb_q_vector *q_vector; /* backlink to q_vector */
+- void *desc; /* descriptor ring memory */
++ struct net_device *netdev; /* back pointer to net_device */
+ struct pci_dev *pdev; /* pci device for dma mapping */
+ dma_addr_t dma; /* phys address of the ring */
++ void *desc; /* descriptor ring memory */
+ unsigned int size; /* length of desc. ring in bytes */
+ unsigned int count; /* number of desc. in the ring */
+ u16 next_to_use;
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index b4c8e5c..79e3657 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -101,7 +101,6 @@ static void igb_update_phy_info(unsigned long);
+ static void igb_watchdog(unsigned long);
+ static void igb_watchdog_task(struct work_struct *);
+ static netdev_tx_t igb_xmit_frame_ring_adv(struct sk_buff *,
+- struct net_device *,
+ struct igb_ring *);
+ static netdev_tx_t igb_xmit_frame_adv(struct sk_buff *skb,
+ struct net_device *);
+@@ -437,6 +436,7 @@ static int igb_alloc_queues(struct igb_adapter *adapter)
+ ring->count = adapter->tx_ring_count;
+ ring->queue_index = i;
+ ring->pdev = adapter->pdev;
++ ring->netdev = adapter->netdev;
+ /* For 82575, context index must be unique per ring. */
+ if (adapter->hw.mac.type == e1000_82575)
+ ring->flags = IGB_RING_FLAG_TX_CTX_IDX;
+@@ -447,6 +447,7 @@ static int igb_alloc_queues(struct igb_adapter *adapter)
+ ring->count = adapter->rx_ring_count;
+ ring->queue_index = i;
+ ring->pdev = adapter->pdev;
++ ring->netdev = adapter->netdev;
+ ring->rx_buffer_len = MAXIMUM_ETHERNET_VLAN_SIZE;
+ ring->flags = IGB_RING_FLAG_RX_CSUM; /* enable rx checksum */
+ /* set flag indicating ring supports SCTP checksum offload */
+@@ -3550,9 +3551,10 @@ static inline void igb_tx_queue_adv(struct igb_ring *tx_ring,
+ mmiowb();
+ }
+
+-static int __igb_maybe_stop_tx(struct net_device *netdev,
+- struct igb_ring *tx_ring, int size)
++static int __igb_maybe_stop_tx(struct igb_ring *tx_ring, int size)
+ {
++ struct net_device *netdev = tx_ring->netdev;
++
+ netif_stop_subqueue(netdev, tx_ring->queue_index);
+
+ /* Herbert's original patch had:
+@@ -3571,19 +3573,17 @@ static int __igb_maybe_stop_tx(struct net_device *netdev,
+ return 0;
+ }
+
+-static int igb_maybe_stop_tx(struct net_device *netdev,
+- struct igb_ring *tx_ring, int size)
++static int igb_maybe_stop_tx(struct igb_ring *tx_ring, int size)
+ {
+ if (igb_desc_unused(tx_ring) >= size)
+ return 0;
+- return __igb_maybe_stop_tx(netdev, tx_ring, size);
++ return __igb_maybe_stop_tx(tx_ring, size);
+ }
+
+ static netdev_tx_t igb_xmit_frame_ring_adv(struct sk_buff *skb,
+- struct net_device *netdev,
+ struct igb_ring *tx_ring)
+ {
+- struct igb_adapter *adapter = netdev_priv(netdev);
++ struct igb_adapter *adapter = netdev_priv(tx_ring->netdev);
+ unsigned int first;
+ unsigned int tx_flags = 0;
+ u8 hdr_len = 0;
+@@ -3606,7 +3606,7 @@ static netdev_tx_t igb_xmit_frame_ring_adv(struct sk_buff *skb,
+ * + 1 desc for skb->data,
+ * + 1 desc for context descriptor,
+ * otherwise try next time */
+- if (igb_maybe_stop_tx(netdev, tx_ring, skb_shinfo(skb)->nr_frags + 4)) {
++ if (igb_maybe_stop_tx(tx_ring, skb_shinfo(skb)->nr_frags + 4)) {
+ /* this is a hard error */
+ return NETDEV_TX_BUSY;
+ }
+@@ -3665,7 +3665,7 @@ static netdev_tx_t igb_xmit_frame_ring_adv(struct sk_buff *skb,
+ igb_tx_queue_adv(tx_ring, tx_flags, count, skb->len, hdr_len);
+
+ /* Make sure there is space in the ring for the next send. */
+- igb_maybe_stop_tx(netdev, tx_ring, MAX_SKB_FRAGS + 4);
++ igb_maybe_stop_tx(tx_ring, MAX_SKB_FRAGS + 4);
+
+ return NETDEV_TX_OK;
+ }
+@@ -3684,7 +3684,7 @@ static netdev_tx_t igb_xmit_frame_adv(struct sk_buff *skb,
+ * to a flow. Right now, performance is impacted slightly negatively
+ * if using multiple tx queues. If the stack breaks away from a
+ * single qdisc implementation, we can look at this again. */
+- return igb_xmit_frame_ring_adv(skb, netdev, tx_ring);
++ return igb_xmit_frame_ring_adv(skb, tx_ring);
+ }
+
+ /**
+@@ -4667,7 +4667,7 @@ static bool igb_clean_tx_irq(struct igb_q_vector *q_vector)
+ {
+ struct igb_adapter *adapter = q_vector->adapter;
+ struct igb_ring *tx_ring = q_vector->tx_ring;
+- struct net_device *netdev = adapter->netdev;
++ struct net_device *netdev = tx_ring->netdev;
+ struct e1000_hw *hw = &adapter->hw;
+ struct igb_buffer *buffer_info;
+ struct sk_buff *skb;
+@@ -4841,8 +4841,8 @@ static bool igb_clean_rx_irq_adv(struct igb_q_vector *q_vector,
+ int *work_done, int budget)
+ {
+ struct igb_adapter *adapter = q_vector->adapter;
+- struct net_device *netdev = adapter->netdev;
+ struct igb_ring *rx_ring = q_vector->rx_ring;
++ struct net_device *netdev = rx_ring->netdev;
+ struct e1000_hw *hw = &adapter->hw;
+ struct pci_dev *pdev = rx_ring->pdev;
+ union e1000_adv_rx_desc *rx_desc , *next_rxd;
+@@ -5018,8 +5018,7 @@ next_desc:
+ static void igb_alloc_rx_buffers_adv(struct igb_ring *rx_ring,
+ int cleaned_count)
+ {
+- struct igb_adapter *adapter = rx_ring->q_vector->adapter;
+- struct net_device *netdev = adapter->netdev;
++ struct net_device *netdev = rx_ring->netdev;
+ union e1000_adv_rx_desc *rx_desc;
+ struct igb_buffer *buffer_info;
+ struct sk_buff *skb;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0030-igb-move-the-multiple-receive-queue-configuration-in.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0030-igb-move-the-multiple-receive-queue-configuration-in.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,302 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 27 Oct 2009 15:53:25 +0000
+Subject: [PATCH 030/165] igb: move the multiple receive queue configuration
+ into seperate function
+
+commit 06cf2666c7f5cc4ba4bf2687d041c61ada76fa3c upstream.
+
+This patch moves the multiple receive queue configuration into a seperate
+function from igb_configure_rx. We can essentially do the configuration for
+the multiple receive queues just prior to enabling the RX and this will allow
+us to seperate the queue enablement from the receive queue layout
+configuration.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 217 ++++++++++++++++++++++---------------------
+ 1 files changed, 111 insertions(+), 106 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 79e3657..cc22a9a 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -82,6 +82,7 @@ static int igb_setup_all_tx_resources(struct igb_adapter *);
+ static int igb_setup_all_rx_resources(struct igb_adapter *);
+ static void igb_free_all_tx_resources(struct igb_adapter *);
+ static void igb_free_all_rx_resources(struct igb_adapter *);
++static void igb_setup_mrqc(struct igb_adapter *);
+ void igb_update_stats(struct igb_adapter *);
+ static int igb_probe(struct pci_dev *, const struct pci_device_id *);
+ static void __devexit igb_remove(struct pci_dev *pdev);
+@@ -1115,6 +1116,7 @@ static void igb_configure(struct igb_adapter *adapter)
+ igb_restore_vlan(adapter);
+
+ igb_setup_tctl(adapter);
++ igb_setup_mrqc(adapter);
+ igb_setup_rctl(adapter);
+
+ igb_configure_tx(adapter);
+@@ -1157,7 +1159,6 @@ int igb_up(struct igb_adapter *adapter)
+ if (adapter->msix_entries)
+ igb_configure_msix(adapter);
+
+- igb_vmm_control(adapter);
+ igb_set_vmolr(hw, adapter->vfs_allocated_count);
+
+ /* Clear any pending interrupts. */
+@@ -1928,7 +1929,6 @@ static int igb_open(struct net_device *netdev)
+ * clean_rx handler before we do so. */
+ igb_configure(adapter);
+
+- igb_vmm_control(adapter);
+ igb_set_vmolr(hw, adapter->vfs_allocated_count);
+
+ err = igb_request_irq(adapter);
+@@ -2217,6 +2217,111 @@ static int igb_setup_all_rx_resources(struct igb_adapter *adapter)
+ }
+
+ /**
++ * igb_setup_mrqc - configure the multiple receive queue control registers
++ * @adapter: Board private structure
++ **/
++static void igb_setup_mrqc(struct igb_adapter *adapter)
++{
++ struct e1000_hw *hw = &adapter->hw;
++ u32 mrqc, rxcsum;
++ u32 j, num_rx_queues, shift = 0, shift2 = 0;
++ union e1000_reta {
++ u32 dword;
++ u8 bytes[4];
++ } reta;
++ static const u8 rsshash[40] = {
++ 0x6d, 0x5a, 0x56, 0xda, 0x25, 0x5b, 0x0e, 0xc2, 0x41, 0x67,
++ 0x25, 0x3d, 0x43, 0xa3, 0x8f, 0xb0, 0xd0, 0xca, 0x2b, 0xcb,
++ 0xae, 0x7b, 0x30, 0xb4, 0x77, 0xcb, 0x2d, 0xa3, 0x80, 0x30,
++ 0xf2, 0x0c, 0x6a, 0x42, 0xb7, 0x3b, 0xbe, 0xac, 0x01, 0xfa };
++
++ /* Fill out hash function seeds */
++ for (j = 0; j < 10; j++) {
++ u32 rsskey = rsshash[(j * 4)];
++ rsskey |= rsshash[(j * 4) + 1] << 8;
++ rsskey |= rsshash[(j * 4) + 2] << 16;
++ rsskey |= rsshash[(j * 4) + 3] << 24;
++ array_wr32(E1000_RSSRK(0), j, rsskey);
++ }
++
++ num_rx_queues = adapter->num_rx_queues;
++
++ if (adapter->vfs_allocated_count) {
++ /* 82575 and 82576 supports 2 RSS queues for VMDq */
++ switch (hw->mac.type) {
++ case e1000_82576:
++ shift = 3;
++ num_rx_queues = 2;
++ break;
++ case e1000_82575:
++ shift = 2;
++ shift2 = 6;
++ default:
++ break;
++ }
++ } else {
++ if (hw->mac.type == e1000_82575)
++ shift = 6;
++ }
++
++ for (j = 0; j < (32 * 4); j++) {
++ reta.bytes[j & 3] = (j % num_rx_queues) << shift;
++ if (shift2)
++ reta.bytes[j & 3] |= num_rx_queues << shift2;
++ if ((j & 3) == 3)
++ wr32(E1000_RETA(j >> 2), reta.dword);
++ }
++
++ /*
++ * Disable raw packet checksumming so that RSS hash is placed in
++ * descriptor on writeback. No need to enable TCP/UDP/IP checksum
++ * offloads as they are enabled by default
++ */
++ rxcsum = rd32(E1000_RXCSUM);
++ rxcsum |= E1000_RXCSUM_PCSD;
++
++ if (adapter->hw.mac.type >= e1000_82576)
++ /* Enable Receive Checksum Offload for SCTP */
++ rxcsum |= E1000_RXCSUM_CRCOFL;
++
++ /* Don't need to set TUOFL or IPOFL, they default to 1 */
++ wr32(E1000_RXCSUM, rxcsum);
++
++ /* If VMDq is enabled then we set the appropriate mode for that, else
++ * we default to RSS so that an RSS hash is calculated per packet even
++ * if we are only using one queue */
++ if (adapter->vfs_allocated_count) {
++ if (hw->mac.type > e1000_82575) {
++ /* Set the default pool for the PF's first queue */
++ u32 vtctl = rd32(E1000_VT_CTL);
++ vtctl &= ~(E1000_VT_CTL_DEFAULT_POOL_MASK |
++ E1000_VT_CTL_DISABLE_DEF_POOL);
++ vtctl |= adapter->vfs_allocated_count <<
++ E1000_VT_CTL_DEFAULT_POOL_SHIFT;
++ wr32(E1000_VT_CTL, vtctl);
++ }
++ if (adapter->num_rx_queues > 1)
++ mrqc = E1000_MRQC_ENABLE_VMDQ_RSS_2Q;
++ else
++ mrqc = E1000_MRQC_ENABLE_VMDQ;
++ } else {
++ mrqc = E1000_MRQC_ENABLE_RSS_4Q;
++ }
++ igb_vmm_control(adapter);
++
++ mrqc |= (E1000_MRQC_RSS_FIELD_IPV4 |
++ E1000_MRQC_RSS_FIELD_IPV4_TCP);
++ mrqc |= (E1000_MRQC_RSS_FIELD_IPV6 |
++ E1000_MRQC_RSS_FIELD_IPV6_TCP);
++ mrqc |= (E1000_MRQC_RSS_FIELD_IPV4_UDP |
++ E1000_MRQC_RSS_FIELD_IPV6_UDP);
++ mrqc |= (E1000_MRQC_RSS_FIELD_IPV6_UDP_EX |
++ E1000_MRQC_RSS_FIELD_IPV6_TCP_EX);
++
++ wr32(E1000_MRQC, mrqc);
++}
++
++/**
+ * igb_setup_rctl - configure the receive control registers
+ * @adapter: Board private structure
+ **/
+@@ -2298,29 +2403,6 @@ static void igb_rlpml_set(struct igb_adapter *adapter)
+ }
+
+ /**
+- * igb_configure_vt_default_pool - Configure VT default pool
+- * @adapter: board private structure
+- *
+- * Configure the default pool
+- **/
+-static void igb_configure_vt_default_pool(struct igb_adapter *adapter)
+-{
+- struct e1000_hw *hw = &adapter->hw;
+- u16 pf_id = adapter->vfs_allocated_count;
+- u32 vtctl;
+-
+- /* not in sr-iov mode - do nothing */
+- if (!pf_id)
+- return;
+-
+- vtctl = rd32(E1000_VT_CTL);
+- vtctl &= ~(E1000_VT_CTL_DEFAULT_POOL_MASK |
+- E1000_VT_CTL_DISABLE_DEF_POOL);
+- vtctl |= pf_id << E1000_VT_CTL_DEFAULT_POOL_SHIFT;
+- wr32(E1000_VT_CTL, vtctl);
+-}
+-
+-/**
+ * igb_configure_rx_ring - Configure a receive ring after Reset
+ * @adapter: board private structure
+ * @ring: receive ring to be configured
+@@ -2391,85 +2473,8 @@ static void igb_configure_rx_ring(struct igb_adapter *adapter,
+ **/
+ static void igb_configure_rx(struct igb_adapter *adapter)
+ {
+- struct e1000_hw *hw = &adapter->hw;
+- u32 rctl, rxcsum;
+ int i;
+
+- /* disable receives while setting up the descriptors */
+- rctl = rd32(E1000_RCTL);
+- wr32(E1000_RCTL, rctl & ~E1000_RCTL_EN);
+- wrfl();
+- mdelay(10);
+-
+- if (adapter->itr_setting > 3)
+- wr32(E1000_ITR, adapter->itr);
+-
+- /* Setup the HW Rx Head and Tail Descriptor Pointers and
+- * the Base and Length of the Rx Descriptor Ring */
+- for (i = 0; i < adapter->num_rx_queues; i++)
+- igb_configure_rx_ring(adapter, &adapter->rx_ring[i]);
+-
+- if (adapter->num_rx_queues > 1) {
+- u32 random[10];
+- u32 mrqc;
+- u32 j, shift;
+- union e1000_reta {
+- u32 dword;
+- u8 bytes[4];
+- } reta;
+-
+- get_random_bytes(&random[0], 40);
+-
+- if (hw->mac.type >= e1000_82576)
+- shift = 0;
+- else
+- shift = 6;
+- for (j = 0; j < (32 * 4); j++) {
+- reta.bytes[j & 3] =
+- adapter->rx_ring[(j % adapter->num_rx_queues)].reg_idx << shift;
+- if ((j & 3) == 3)
+- writel(reta.dword,
+- hw->hw_addr + E1000_RETA(0) + (j & ~3));
+- }
+- if (adapter->vfs_allocated_count)
+- mrqc = E1000_MRQC_ENABLE_VMDQ_RSS_2Q;
+- else
+- mrqc = E1000_MRQC_ENABLE_RSS_4Q;
+-
+- /* Fill out hash function seeds */
+- for (j = 0; j < 10; j++)
+- array_wr32(E1000_RSSRK(0), j, random[j]);
+-
+- mrqc |= (E1000_MRQC_RSS_FIELD_IPV4 |
+- E1000_MRQC_RSS_FIELD_IPV4_TCP);
+- mrqc |= (E1000_MRQC_RSS_FIELD_IPV6 |
+- E1000_MRQC_RSS_FIELD_IPV6_TCP);
+- mrqc |= (E1000_MRQC_RSS_FIELD_IPV4_UDP |
+- E1000_MRQC_RSS_FIELD_IPV6_UDP);
+- mrqc |= (E1000_MRQC_RSS_FIELD_IPV6_UDP_EX |
+- E1000_MRQC_RSS_FIELD_IPV6_TCP_EX);
+-
+- wr32(E1000_MRQC, mrqc);
+- } else if (adapter->vfs_allocated_count) {
+- /* Enable multi-queue for sr-iov */
+- wr32(E1000_MRQC, E1000_MRQC_ENABLE_VMDQ);
+- }
+-
+- /* Enable Receive Checksum Offload for TCP and UDP */
+- rxcsum = rd32(E1000_RXCSUM);
+- /* Disable raw packet checksumming */
+- rxcsum |= E1000_RXCSUM_PCSD;
+-
+- if (adapter->hw.mac.type == e1000_82576)
+- /* Enable Receive Checksum Offload for SCTP */
+- rxcsum |= E1000_RXCSUM_CRCOFL;
+-
+- /* Don't need to set TUOFL or IPOFL, they default to 1 */
+- wr32(E1000_RXCSUM, rxcsum);
+-
+- /* Set the default pool for the PF's first queue */
+- igb_configure_vt_default_pool(adapter);
+-
+ /* set UTA to appropriate mode */
+ igb_set_uta(adapter);
+
+@@ -2477,10 +2482,10 @@ static void igb_configure_rx(struct igb_adapter *adapter)
+ igb_rar_set_qsel(adapter, adapter->hw.mac.addr, 0,
+ adapter->vfs_allocated_count);
+
+- igb_rlpml_set(adapter);
+-
+- /* Enable Receives */
+- wr32(E1000_RCTL, rctl);
++ /* Setup the HW Rx Head and Tail Descriptor Pointers and
++ * the Base and Length of the Rx Descriptor Ring */
++ for (i = 0; i < adapter->num_rx_queues; i++)
++ igb_configure_rx_ring(adapter, &adapter->rx_ring[i]);
+ }
+
+ /**
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0031-igb-delay-VF-reset-notification-until-after-interrup.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0031-igb-delay-VF-reset-notification-until-after-interrup.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,82 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 27 Oct 2009 15:53:45 +0000
+Subject: [PATCH 031/165] igb: delay VF reset notification until after
+ interrupts are enabed
+
+commit d4960307ea63a5625a175cc2d7b192e68e6b4fba upstream.
+
+This update delays the VF reset notification until after interrupts are
+enabled. Otherwise there is a chance of having the VF try to reset itself too
+soon and being ignored by the PF as a result.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 33 +++++++++++++++++++++++----------
+ 1 files changed, 23 insertions(+), 10 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index cc22a9a..634a232 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -1165,6 +1165,13 @@ int igb_up(struct igb_adapter *adapter)
+ rd32(E1000_ICR);
+ igb_irq_enable(adapter);
+
++ /* notify VFs that reset has been completed */
++ if (adapter->vfs_allocated_count) {
++ u32 reg_data = rd32(E1000_CTRL_EXT);
++ reg_data |= E1000_CTRL_EXT_PFRSTD;
++ wr32(E1000_CTRL_EXT, reg_data);
++ }
++
+ netif_tx_start_all_queues(adapter->netdev);
+
+ /* Fire a link change interrupt to start the watchdog. */
+@@ -1948,6 +1955,13 @@ static int igb_open(struct net_device *netdev)
+
+ igb_irq_enable(adapter);
+
++ /* notify VFs that reset has been completed */
++ if (adapter->vfs_allocated_count) {
++ u32 reg_data = rd32(E1000_CTRL_EXT);
++ reg_data |= E1000_CTRL_EXT_PFRSTD;
++ wr32(E1000_CTRL_EXT, reg_data);
++ }
++
+ netif_tx_start_all_queues(netdev);
+
+ /* Fire a link status change interrupt to start the watchdog. */
+@@ -5785,19 +5799,18 @@ static int igb_set_vf_mac(struct igb_adapter *adapter,
+ static void igb_vmm_control(struct igb_adapter *adapter)
+ {
+ struct e1000_hw *hw = &adapter->hw;
+- u32 reg_data;
+
+- if (!adapter->vfs_allocated_count)
++ /* replication is not supported for 82575 */
++ if (hw->mac.type == e1000_82575)
+ return;
+
+- /* VF's need PF reset indication before they
+- * can send/receive mail */
+- reg_data = rd32(E1000_CTRL_EXT);
+- reg_data |= E1000_CTRL_EXT_PFRSTD;
+- wr32(E1000_CTRL_EXT, reg_data);
+-
+- igb_vmdq_set_loopback_pf(hw, true);
+- igb_vmdq_set_replication_pf(hw, true);
++ if (adapter->vfs_allocated_count) {
++ igb_vmdq_set_loopback_pf(hw, true);
++ igb_vmdq_set_replication_pf(hw, true);
++ } else {
++ igb_vmdq_set_loopback_pf(hw, false);
++ igb_vmdq_set_replication_pf(hw, false);
++ }
+ }
+
+ /* igb_main.c */
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0032-igb-setup-vlan-tag-replication-stripping-in-igb_vmm_.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0032-igb-setup-vlan-tag-replication-stripping-in-igb_vmm_.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,68 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 27 Oct 2009 15:54:04 +0000
+Subject: [PATCH 032/165] igb: setup vlan tag replication stripping in
+ igb_vmm_control
+
+commit 10d8e9073a320a1c9cc13f996bd600b477eb4872 upstream.
+
+This update adds vlan tag stripping for inter-vf communications to the
+igb_vmm_control configuration function.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/e1000_82575.h | 9 +++++++++
+ drivers/net/igb/igb_main.c | 11 +++++++++++
+ 2 files changed, 20 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/igb/e1000_82575.h b/drivers/net/igb/e1000_82575.h
+index 7be3a0b..9418683 100644
+--- a/drivers/net/igb/e1000_82575.h
++++ b/drivers/net/igb/e1000_82575.h
+@@ -203,6 +203,15 @@ struct e1000_adv_tx_context_desc {
+ #define E1000_IOVCTL 0x05BBC
+ #define E1000_IOVCTL_REUSE_VFQ 0x00000001
+
++#define E1000_RPLOLR_STRVLAN 0x40000000
++#define E1000_RPLOLR_STRCRC 0x80000000
++
++#define E1000_DTXCTL_8023LL 0x0004
++#define E1000_DTXCTL_VLAN_ADDED 0x0008
++#define E1000_DTXCTL_OOS_ENABLE 0x0010
++#define E1000_DTXCTL_MDP_EN 0x0020
++#define E1000_DTXCTL_SPOOF_INT 0x0040
++
+ #define ALL_QUEUES 0xFFFF
+
+ void igb_vmdq_set_loopback_pf(struct e1000_hw *, bool);
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 634a232..2404c10 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -5799,11 +5799,22 @@ static int igb_set_vf_mac(struct igb_adapter *adapter,
+ static void igb_vmm_control(struct igb_adapter *adapter)
+ {
+ struct e1000_hw *hw = &adapter->hw;
++ u32 reg;
+
+ /* replication is not supported for 82575 */
+ if (hw->mac.type == e1000_82575)
+ return;
+
++ /* enable replication vlan tag stripping */
++ reg = rd32(E1000_RPLOLR);
++ reg |= E1000_RPLOLR_STRVLAN;
++ wr32(E1000_RPLOLR, reg);
++
++ /* notify HW that the MAC is adding vlan tags */
++ reg = rd32(E1000_DTXCTL);
++ reg |= E1000_DTXCTL_VLAN_ADDED;
++ wr32(E1000_DTXCTL, reg);
++
+ if (adapter->vfs_allocated_count) {
+ igb_vmdq_set_loopback_pf(hw, true);
+ igb_vmdq_set_replication_pf(hw, true);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0033-igb-re-use-ring-configuration-code-in-ethtool-testin.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0033-igb-re-use-ring-configuration-code-in-ethtool-testin.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,405 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 27 Oct 2009 15:54:23 +0000
+Subject: [PATCH 033/165] igb: re-use ring configuration code in ethtool
+ testing
+
+commit d7ee5b3a78f57a8ca9ca2392ff5d03f91ec90bdb upstream.
+
+Since all of the ring code is now specific to the ring instead of the adapter
+struct it is possible to cut a large section of code out of the ethtool
+testing configuraiton since we can just use the existing functions to
+configure the rings.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb.h | 14 +++
+ drivers/net/igb/igb_ethtool.c | 185 +++++++++--------------------------------
+ drivers/net/igb/igb_main.c | 29 ++-----
+ 3 files changed, 60 insertions(+), 168 deletions(-)
+
+diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
+index 2416c12..8b189a0 100644
+--- a/drivers/net/igb/igb.h
++++ b/drivers/net/igb/igb.h
+@@ -223,6 +223,15 @@ struct igb_ring {
+ #define E1000_TX_CTXTDESC_ADV(R, i) \
+ (&(((struct e1000_adv_tx_context_desc *)((R).desc))[i]))
+
++/* igb_desc_unused - calculate if we have unused descriptors */
++static inline int igb_desc_unused(struct igb_ring *ring)
++{
++ if (ring->next_to_clean > ring->next_to_use)
++ return ring->next_to_clean - ring->next_to_use - 1;
++
++ return ring->count + ring->next_to_clean - ring->next_to_use - 1;
++}
++
+ /* board specific private data structure */
+
+ struct igb_adapter {
+@@ -336,6 +345,11 @@ extern int igb_setup_tx_resources(struct igb_ring *);
+ extern int igb_setup_rx_resources(struct igb_ring *);
+ extern void igb_free_tx_resources(struct igb_ring *);
+ extern void igb_free_rx_resources(struct igb_ring *);
++extern void igb_configure_tx_ring(struct igb_adapter *, struct igb_ring *);
++extern void igb_configure_rx_ring(struct igb_adapter *, struct igb_ring *);
++extern void igb_setup_tctl(struct igb_adapter *);
++extern void igb_setup_rctl(struct igb_adapter *);
++extern void igb_alloc_rx_buffers_adv(struct igb_ring *, int);
+ extern void igb_update_stats(struct igb_adapter *);
+ extern void igb_set_ethtool_ops(struct net_device *);
+
+diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
+index 51ecbf4..a6db4b4 100644
+--- a/drivers/net/igb/igb_ethtool.c
++++ b/drivers/net/igb/igb_ethtool.c
+@@ -1246,116 +1246,49 @@ static int igb_intr_test(struct igb_adapter *adapter, u64 *data)
+
+ static void igb_free_desc_rings(struct igb_adapter *adapter)
+ {
+- struct igb_ring *tx_ring = &adapter->test_tx_ring;
+- struct igb_ring *rx_ring = &adapter->test_rx_ring;
+- struct pci_dev *pdev = adapter->pdev;
+- int i;
+-
+- if (tx_ring->desc && tx_ring->buffer_info) {
+- for (i = 0; i < tx_ring->count; i++) {
+- struct igb_buffer *buf = &(tx_ring->buffer_info[i]);
+- if (buf->dma)
+- pci_unmap_single(pdev, buf->dma, buf->length,
+- PCI_DMA_TODEVICE);
+- if (buf->skb)
+- dev_kfree_skb(buf->skb);
+- }
+- }
+-
+- if (rx_ring->desc && rx_ring->buffer_info) {
+- for (i = 0; i < rx_ring->count; i++) {
+- struct igb_buffer *buf = &(rx_ring->buffer_info[i]);
+- if (buf->dma)
+- pci_unmap_single(pdev, buf->dma,
+- IGB_RXBUFFER_2048,
+- PCI_DMA_FROMDEVICE);
+- if (buf->skb)
+- dev_kfree_skb(buf->skb);
+- }
+- }
+-
+- if (tx_ring->desc) {
+- pci_free_consistent(pdev, tx_ring->size, tx_ring->desc,
+- tx_ring->dma);
+- tx_ring->desc = NULL;
+- }
+- if (rx_ring->desc) {
+- pci_free_consistent(pdev, rx_ring->size, rx_ring->desc,
+- rx_ring->dma);
+- rx_ring->desc = NULL;
+- }
+-
+- kfree(tx_ring->buffer_info);
+- tx_ring->buffer_info = NULL;
+- kfree(rx_ring->buffer_info);
+- rx_ring->buffer_info = NULL;
+-
+- return;
++ igb_free_tx_resources(&adapter->test_tx_ring);
++ igb_free_rx_resources(&adapter->test_rx_ring);
+ }
+
+ static int igb_setup_desc_rings(struct igb_adapter *adapter)
+ {
+- struct e1000_hw *hw = &adapter->hw;
+ struct igb_ring *tx_ring = &adapter->test_tx_ring;
+ struct igb_ring *rx_ring = &adapter->test_rx_ring;
+- struct pci_dev *pdev = adapter->pdev;
+- struct igb_buffer *buffer_info;
+- u32 rctl;
++ struct e1000_hw *hw = &adapter->hw;
+ int i, ret_val;
+
+ /* Setup Tx descriptor ring and Tx buffers */
++ tx_ring->count = IGB_DEFAULT_TXD;
++ tx_ring->pdev = adapter->pdev;
++ tx_ring->netdev = adapter->netdev;
++ tx_ring->reg_idx = adapter->vfs_allocated_count;
+
+- if (!tx_ring->count)
+- tx_ring->count = IGB_DEFAULT_TXD;
+-
+- tx_ring->buffer_info = kcalloc(tx_ring->count,
+- sizeof(struct igb_buffer),
+- GFP_KERNEL);
+- if (!tx_ring->buffer_info) {
++ if (igb_setup_tx_resources(tx_ring)) {
+ ret_val = 1;
+ goto err_nomem;
+ }
+
+- tx_ring->size = tx_ring->count * sizeof(union e1000_adv_tx_desc);
+- tx_ring->size = ALIGN(tx_ring->size, 4096);
+- tx_ring->desc = pci_alloc_consistent(pdev, tx_ring->size,
+- &tx_ring->dma);
+- if (!tx_ring->desc) {
+- ret_val = 2;
+- goto err_nomem;
+- }
+- tx_ring->next_to_use = tx_ring->next_to_clean = 0;
+-
+- wr32(E1000_TDBAL(0),
+- ((u64) tx_ring->dma & 0x00000000FFFFFFFF));
+- wr32(E1000_TDBAH(0), ((u64) tx_ring->dma >> 32));
+- wr32(E1000_TDLEN(0),
+- tx_ring->count * sizeof(union e1000_adv_tx_desc));
+- wr32(E1000_TDH(0), 0);
+- wr32(E1000_TDT(0), 0);
+- wr32(E1000_TCTL,
+- E1000_TCTL_PSP | E1000_TCTL_EN |
+- E1000_COLLISION_THRESHOLD << E1000_CT_SHIFT |
+- E1000_COLLISION_DISTANCE << E1000_COLD_SHIFT);
++ igb_setup_tctl(adapter);
++ igb_configure_tx_ring(adapter, tx_ring);
+
+ for (i = 0; i < tx_ring->count; i++) {
+ union e1000_adv_tx_desc *tx_desc;
+- struct sk_buff *skb;
+ unsigned int size = 1024;
++ struct sk_buff *skb = alloc_skb(size, GFP_KERNEL);
+
+- tx_desc = E1000_TX_DESC_ADV(*tx_ring, i);
+- skb = alloc_skb(size, GFP_KERNEL);
+ if (!skb) {
+- ret_val = 3;
++ ret_val = 2;
+ goto err_nomem;
+ }
+ skb_put(skb, size);
+- buffer_info = &tx_ring->buffer_info[i];
+- buffer_info->skb = skb;
+- buffer_info->length = skb->len;
+- buffer_info->dma = pci_map_single(pdev, skb->data, skb->len,
+- PCI_DMA_TODEVICE);
+- tx_desc->read.buffer_addr = cpu_to_le64(buffer_info->dma);
++ tx_ring->buffer_info[i].skb = skb;
++ tx_ring->buffer_info[i].length = skb->len;
++ tx_ring->buffer_info[i].dma =
++ pci_map_single(tx_ring->pdev, skb->data, skb->len,
++ PCI_DMA_TODEVICE);
++ tx_desc = E1000_TX_DESC_ADV(*tx_ring, i);
++ tx_desc->read.buffer_addr =
++ cpu_to_le64(tx_ring->buffer_info[i].dma);
+ tx_desc->read.olinfo_status = cpu_to_le32(skb->len) <<
+ E1000_ADVTXD_PAYLEN_SHIFT;
+ tx_desc->read.cmd_type_len = cpu_to_le32(skb->len);
+@@ -1367,62 +1300,25 @@ static int igb_setup_desc_rings(struct igb_adapter *adapter)
+ }
+
+ /* Setup Rx descriptor ring and Rx buffers */
+-
+- if (!rx_ring->count)
+- rx_ring->count = IGB_DEFAULT_RXD;
+-
+- rx_ring->buffer_info = kcalloc(rx_ring->count,
+- sizeof(struct igb_buffer),
+- GFP_KERNEL);
+- if (!rx_ring->buffer_info) {
+- ret_val = 4;
+- goto err_nomem;
+- }
+-
+- rx_ring->size = rx_ring->count * sizeof(union e1000_adv_rx_desc);
+- rx_ring->desc = pci_alloc_consistent(pdev, rx_ring->size,
+- &rx_ring->dma);
+- if (!rx_ring->desc) {
+- ret_val = 5;
++ rx_ring->count = IGB_DEFAULT_RXD;
++ rx_ring->pdev = adapter->pdev;
++ rx_ring->netdev = adapter->netdev;
++ rx_ring->rx_buffer_len = IGB_RXBUFFER_2048;
++ rx_ring->reg_idx = adapter->vfs_allocated_count;
++
++ if (igb_setup_rx_resources(rx_ring)) {
++ ret_val = 3;
+ goto err_nomem;
+ }
+- rx_ring->next_to_use = rx_ring->next_to_clean = 0;
+
+- rctl = rd32(E1000_RCTL);
+- wr32(E1000_RCTL, rctl & ~E1000_RCTL_EN);
+- wr32(E1000_RDBAL(0),
+- ((u64) rx_ring->dma & 0xFFFFFFFF));
+- wr32(E1000_RDBAH(0),
+- ((u64) rx_ring->dma >> 32));
+- wr32(E1000_RDLEN(0), rx_ring->size);
+- wr32(E1000_RDH(0), 0);
+- wr32(E1000_RDT(0), 0);
+- rctl &= ~(E1000_RCTL_LBM_TCVR | E1000_RCTL_LBM_MAC);
+- rctl = E1000_RCTL_EN | E1000_RCTL_BAM | E1000_RCTL_RDMTS_HALF |
+- (adapter->hw.mac.mc_filter_type << E1000_RCTL_MO_SHIFT);
+- wr32(E1000_RCTL, rctl);
+- wr32(E1000_SRRCTL(0), E1000_SRRCTL_DESCTYPE_ADV_ONEBUF);
++ /* set the default queue to queue 0 of PF */
++ wr32(E1000_MRQC, adapter->vfs_allocated_count << 3);
+
+- for (i = 0; i < rx_ring->count; i++) {
+- union e1000_adv_rx_desc *rx_desc;
+- struct sk_buff *skb;
++ /* enable receive ring */
++ igb_setup_rctl(adapter);
++ igb_configure_rx_ring(adapter, rx_ring);
+
+- buffer_info = &rx_ring->buffer_info[i];
+- rx_desc = E1000_RX_DESC_ADV(*rx_ring, i);
+- skb = alloc_skb(IGB_RXBUFFER_2048 + NET_IP_ALIGN,
+- GFP_KERNEL);
+- if (!skb) {
+- ret_val = 6;
+- goto err_nomem;
+- }
+- skb_reserve(skb, NET_IP_ALIGN);
+- buffer_info->skb = skb;
+- buffer_info->dma = pci_map_single(pdev, skb->data,
+- IGB_RXBUFFER_2048,
+- PCI_DMA_FROMDEVICE);
+- rx_desc->read.pkt_addr = cpu_to_le64(buffer_info->dma);
+- memset(skb->data, 0x00, skb->len);
+- }
++ igb_alloc_rx_buffers_adv(rx_ring, igb_desc_unused(rx_ring));
+
+ return 0;
+
+@@ -1577,15 +1473,12 @@ static int igb_check_lbtest_frame(struct sk_buff *skb, unsigned int frame_size)
+
+ static int igb_run_loopback_test(struct igb_adapter *adapter)
+ {
+- struct e1000_hw *hw = &adapter->hw;
+ struct igb_ring *tx_ring = &adapter->test_tx_ring;
+ struct igb_ring *rx_ring = &adapter->test_rx_ring;
+- struct pci_dev *pdev = adapter->pdev;
+- int i, j, k, l, lc, good_cnt;
+- int ret_val = 0;
++ int i, j, k, l, lc, good_cnt, ret_val = 0;
+ unsigned long time;
+
+- wr32(E1000_RDT(0), rx_ring->count - 1);
++ writel(rx_ring->count - 1, rx_ring->tail);
+
+ /* Calculate the loop count based on the largest descriptor ring
+ * The idea is to wrap the largest ring a number of times using 64
+@@ -1602,7 +1495,7 @@ static int igb_run_loopback_test(struct igb_adapter *adapter)
+ for (i = 0; i < 64; i++) { /* send the packets */
+ igb_create_lbtest_frame(tx_ring->buffer_info[k].skb,
+ 1024);
+- pci_dma_sync_single_for_device(pdev,
++ pci_dma_sync_single_for_device(tx_ring->pdev,
+ tx_ring->buffer_info[k].dma,
+ tx_ring->buffer_info[k].length,
+ PCI_DMA_TODEVICE);
+@@ -1610,12 +1503,12 @@ static int igb_run_loopback_test(struct igb_adapter *adapter)
+ if (k == tx_ring->count)
+ k = 0;
+ }
+- wr32(E1000_TDT(0), k);
++ writel(k, tx_ring->tail);
+ msleep(200);
+ time = jiffies; /* set the start time for the receive */
+ good_cnt = 0;
+ do { /* receive the sent packets */
+- pci_dma_sync_single_for_cpu(pdev,
++ pci_dma_sync_single_for_cpu(rx_ring->pdev,
+ rx_ring->buffer_info[l].dma,
+ IGB_RXBUFFER_2048,
+ PCI_DMA_FROMDEVICE);
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 2404c10..2966a14 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -91,8 +91,6 @@ static int igb_open(struct net_device *);
+ static int igb_close(struct net_device *);
+ static void igb_configure_tx(struct igb_adapter *);
+ static void igb_configure_rx(struct igb_adapter *);
+-static void igb_setup_tctl(struct igb_adapter *);
+-static void igb_setup_rctl(struct igb_adapter *);
+ static void igb_clean_all_tx_rings(struct igb_adapter *);
+ static void igb_clean_all_rx_rings(struct igb_adapter *);
+ static void igb_clean_tx_ring(struct igb_ring *);
+@@ -120,7 +118,6 @@ static void igb_setup_dca(struct igb_adapter *);
+ static bool igb_clean_tx_irq(struct igb_q_vector *);
+ static int igb_poll(struct napi_struct *, int);
+ static bool igb_clean_rx_irq_adv(struct igb_q_vector *, int *, int);
+-static void igb_alloc_rx_buffers_adv(struct igb_ring *, int);
+ static int igb_ioctl(struct net_device *, struct ifreq *, int cmd);
+ static void igb_tx_timeout(struct net_device *);
+ static void igb_reset_task(struct work_struct *);
+@@ -310,17 +307,6 @@ static char *igb_get_time_str(struct igb_adapter *adapter,
+ #endif
+
+ /**
+- * igb_desc_unused - calculate if we have unused descriptors
+- **/
+-static int igb_desc_unused(struct igb_ring *ring)
+-{
+- if (ring->next_to_clean > ring->next_to_use)
+- return ring->next_to_clean - ring->next_to_use - 1;
+-
+- return ring->count + ring->next_to_clean - ring->next_to_use - 1;
+-}
+-
+-/**
+ * igb_init_module - Driver Registration Routine
+ *
+ * igb_init_module is the first routine called when the driver is
+@@ -2087,7 +2073,7 @@ static int igb_setup_all_tx_resources(struct igb_adapter *adapter)
+ * igb_setup_tctl - configure the transmit control registers
+ * @adapter: Board private structure
+ **/
+-static void igb_setup_tctl(struct igb_adapter *adapter)
++void igb_setup_tctl(struct igb_adapter *adapter)
+ {
+ struct e1000_hw *hw = &adapter->hw;
+ u32 tctl;
+@@ -2116,8 +2102,8 @@ static void igb_setup_tctl(struct igb_adapter *adapter)
+ *
+ * Configure a transmit ring after a reset.
+ **/
+-static void igb_configure_tx_ring(struct igb_adapter *adapter,
+- struct igb_ring *ring)
++void igb_configure_tx_ring(struct igb_adapter *adapter,
++ struct igb_ring *ring)
+ {
+ struct e1000_hw *hw = &adapter->hw;
+ u32 txdctl;
+@@ -2339,7 +2325,7 @@ static void igb_setup_mrqc(struct igb_adapter *adapter)
+ * igb_setup_rctl - configure the receive control registers
+ * @adapter: Board private structure
+ **/
+-static void igb_setup_rctl(struct igb_adapter *adapter)
++void igb_setup_rctl(struct igb_adapter *adapter)
+ {
+ struct e1000_hw *hw = &adapter->hw;
+ u32 rctl;
+@@ -2423,8 +2409,8 @@ static void igb_rlpml_set(struct igb_adapter *adapter)
+ *
+ * Configure the Rx unit of the MAC after a reset.
+ **/
+-static void igb_configure_rx_ring(struct igb_adapter *adapter,
+- struct igb_ring *ring)
++void igb_configure_rx_ring(struct igb_adapter *adapter,
++ struct igb_ring *ring)
+ {
+ struct e1000_hw *hw = &adapter->hw;
+ u64 rdba = ring->dma;
+@@ -5034,8 +5020,7 @@ next_desc:
+ * igb_alloc_rx_buffers_adv - Replace used receive buffers; packet split
+ * @adapter: address of board private structure
+ **/
+-static void igb_alloc_rx_buffers_adv(struct igb_ring *rx_ring,
+- int cleaned_count)
++void igb_alloc_rx_buffers_adv(struct igb_ring *rx_ring, int cleaned_count)
+ {
+ struct net_device *netdev = rx_ring->netdev;
+ union e1000_adv_rx_desc *rx_desc;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0034-igb-make-tx-ring-map-and-free-functionality-non-stat.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0034-igb-make-tx-ring-map-and-free-functionality-non-stat.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,113 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 27 Oct 2009 15:54:43 +0000
+Subject: [PATCH 034/165] igb: make tx ring map and free functionality
+ non-static
+
+commit b1a436c34c44c6e3fb03c12545d87b4c2818f31d upstream.
+
+This change makes a minor change to the xmit_frame_ring_adv funcition in that
+it moves 2 checks from it into the xmit_frame_adv since the checks were not
+ring specific. In addition it exports the xmit_frame_ring_adv and the
+unmap_and_free_tx_resource calls so that they can be used by other code such
+as the ethtool loopback testing calls.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb.h | 3 +++
+ drivers/net/igb/igb_main.c | 35 ++++++++++++++++-------------------
+ 2 files changed, 19 insertions(+), 19 deletions(-)
+
+diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
+index 8b189a0..6c35c90 100644
+--- a/drivers/net/igb/igb.h
++++ b/drivers/net/igb/igb.h
+@@ -349,6 +349,9 @@ extern void igb_configure_tx_ring(struct igb_adapter *, struct igb_ring *);
+ extern void igb_configure_rx_ring(struct igb_adapter *, struct igb_ring *);
+ extern void igb_setup_tctl(struct igb_adapter *);
+ extern void igb_setup_rctl(struct igb_adapter *);
++extern netdev_tx_t igb_xmit_frame_ring_adv(struct sk_buff *, struct igb_ring *);
++extern void igb_unmap_and_free_tx_resource(struct igb_ring *,
++ struct igb_buffer *);
+ extern void igb_alloc_rx_buffers_adv(struct igb_ring *, int);
+ extern void igb_update_stats(struct igb_adapter *);
+ extern void igb_set_ethtool_ops(struct net_device *);
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 2966a14..8b98e2f 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -99,10 +99,7 @@ static void igb_set_rx_mode(struct net_device *);
+ static void igb_update_phy_info(unsigned long);
+ static void igb_watchdog(unsigned long);
+ static void igb_watchdog_task(struct work_struct *);
+-static netdev_tx_t igb_xmit_frame_ring_adv(struct sk_buff *,
+- struct igb_ring *);
+-static netdev_tx_t igb_xmit_frame_adv(struct sk_buff *skb,
+- struct net_device *);
++static netdev_tx_t igb_xmit_frame_adv(struct sk_buff *skb, struct net_device *);
+ static struct net_device_stats *igb_get_stats(struct net_device *);
+ static int igb_change_mtu(struct net_device *, int);
+ static int igb_set_mac(struct net_device *, void *);
+@@ -2521,8 +2518,8 @@ static void igb_free_all_tx_resources(struct igb_adapter *adapter)
+ igb_free_tx_resources(&adapter->tx_ring[i]);
+ }
+
+-static void igb_unmap_and_free_tx_resource(struct igb_ring *tx_ring,
+- struct igb_buffer *buffer_info)
++void igb_unmap_and_free_tx_resource(struct igb_ring *tx_ring,
++ struct igb_buffer *buffer_info)
+ {
+ buffer_info->dma = 0;
+ if (buffer_info->skb) {
+@@ -3585,8 +3582,8 @@ static int igb_maybe_stop_tx(struct igb_ring *tx_ring, int size)
+ return __igb_maybe_stop_tx(tx_ring, size);
+ }
+
+-static netdev_tx_t igb_xmit_frame_ring_adv(struct sk_buff *skb,
+- struct igb_ring *tx_ring)
++netdev_tx_t igb_xmit_frame_ring_adv(struct sk_buff *skb,
++ struct igb_ring *tx_ring)
+ {
+ struct igb_adapter *adapter = netdev_priv(tx_ring->netdev);
+ unsigned int first;
+@@ -3596,16 +3593,6 @@ static netdev_tx_t igb_xmit_frame_ring_adv(struct sk_buff *skb,
+ int tso = 0;
+ union skb_shared_tx *shtx;
+
+- if (test_bit(__IGB_DOWN, &adapter->state)) {
+- dev_kfree_skb_any(skb);
+- return NETDEV_TX_OK;
+- }
+-
+- if (skb->len <= 0) {
+- dev_kfree_skb_any(skb);
+- return NETDEV_TX_OK;
+- }
+-
+ /* need: 1 descriptor per page,
+ * + 2 desc gap to keep tail from touching head,
+ * + 1 desc for skb->data,
+@@ -3680,8 +3667,18 @@ static netdev_tx_t igb_xmit_frame_adv(struct sk_buff *skb,
+ {
+ struct igb_adapter *adapter = netdev_priv(netdev);
+ struct igb_ring *tx_ring;
+-
+ int r_idx = 0;
++
++ if (test_bit(__IGB_DOWN, &adapter->state)) {
++ dev_kfree_skb_any(skb);
++ return NETDEV_TX_OK;
++ }
++
++ if (skb->len <= 0) {
++ dev_kfree_skb_any(skb);
++ return NETDEV_TX_OK;
++ }
++
+ r_idx = skb->queue_mapping & (IGB_ABS_MAX_TX_QUEUES - 1);
+ tx_ring = adapter->multi_tx_table[r_idx];
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0035-igb-make-ethtool-use-core-xmit-map-and-free-function.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0035-igb-make-ethtool-use-core-xmit-map-and-free-function.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,223 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 27 Oct 2009 15:55:02 +0000
+Subject: [PATCH 035/165] igb: make ethtool use core xmit map and free
+ functionality
+
+commit ad93d17efe063b6e95f3177fa01706f3b3b15dde upstream.
+
+This change adds a clean_rx/tx_irq type function call to the ethtool loopback
+testing which allows us to test the core transmit and receive functionality in
+the driver.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_ethtool.c | 156 +++++++++++++++++++++++------------------
+ 1 files changed, 89 insertions(+), 67 deletions(-)
+
+diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
+index a6db4b4..2fc4f1b 100644
+--- a/drivers/net/igb/igb_ethtool.c
++++ b/drivers/net/igb/igb_ethtool.c
+@@ -1255,7 +1255,7 @@ static int igb_setup_desc_rings(struct igb_adapter *adapter)
+ struct igb_ring *tx_ring = &adapter->test_tx_ring;
+ struct igb_ring *rx_ring = &adapter->test_rx_ring;
+ struct e1000_hw *hw = &adapter->hw;
+- int i, ret_val;
++ int ret_val;
+
+ /* Setup Tx descriptor ring and Tx buffers */
+ tx_ring->count = IGB_DEFAULT_TXD;
+@@ -1271,34 +1271,6 @@ static int igb_setup_desc_rings(struct igb_adapter *adapter)
+ igb_setup_tctl(adapter);
+ igb_configure_tx_ring(adapter, tx_ring);
+
+- for (i = 0; i < tx_ring->count; i++) {
+- union e1000_adv_tx_desc *tx_desc;
+- unsigned int size = 1024;
+- struct sk_buff *skb = alloc_skb(size, GFP_KERNEL);
+-
+- if (!skb) {
+- ret_val = 2;
+- goto err_nomem;
+- }
+- skb_put(skb, size);
+- tx_ring->buffer_info[i].skb = skb;
+- tx_ring->buffer_info[i].length = skb->len;
+- tx_ring->buffer_info[i].dma =
+- pci_map_single(tx_ring->pdev, skb->data, skb->len,
+- PCI_DMA_TODEVICE);
+- tx_desc = E1000_TX_DESC_ADV(*tx_ring, i);
+- tx_desc->read.buffer_addr =
+- cpu_to_le64(tx_ring->buffer_info[i].dma);
+- tx_desc->read.olinfo_status = cpu_to_le32(skb->len) <<
+- E1000_ADVTXD_PAYLEN_SHIFT;
+- tx_desc->read.cmd_type_len = cpu_to_le32(skb->len);
+- tx_desc->read.cmd_type_len |= cpu_to_le32(E1000_TXD_CMD_EOP |
+- E1000_TXD_CMD_IFCS |
+- E1000_TXD_CMD_RS |
+- E1000_ADVTXD_DTYP_DATA |
+- E1000_ADVTXD_DCMD_DEXT);
+- }
+-
+ /* Setup Rx descriptor ring and Rx buffers */
+ rx_ring->count = IGB_DEFAULT_RXD;
+ rx_ring->pdev = adapter->pdev;
+@@ -1471,14 +1443,78 @@ static int igb_check_lbtest_frame(struct sk_buff *skb, unsigned int frame_size)
+ return 13;
+ }
+
++static int igb_clean_test_rings(struct igb_ring *rx_ring,
++ struct igb_ring *tx_ring,
++ unsigned int size)
++{
++ union e1000_adv_rx_desc *rx_desc;
++ struct igb_buffer *buffer_info;
++ int rx_ntc, tx_ntc, count = 0;
++ u32 staterr;
++
++ /* initialize next to clean and descriptor values */
++ rx_ntc = rx_ring->next_to_clean;
++ tx_ntc = tx_ring->next_to_clean;
++ rx_desc = E1000_RX_DESC_ADV(*rx_ring, rx_ntc);
++ staterr = le32_to_cpu(rx_desc->wb.upper.status_error);
++
++ while (staterr & E1000_RXD_STAT_DD) {
++ /* check rx buffer */
++ buffer_info = &rx_ring->buffer_info[rx_ntc];
++
++ /* unmap rx buffer, will be remapped by alloc_rx_buffers */
++ pci_unmap_single(rx_ring->pdev,
++ buffer_info->dma,
++ rx_ring->rx_buffer_len,
++ PCI_DMA_FROMDEVICE);
++ buffer_info->dma = 0;
++
++ /* verify contents of skb */
++ if (!igb_check_lbtest_frame(buffer_info->skb, size))
++ count++;
++
++ /* unmap buffer on tx side */
++ buffer_info = &tx_ring->buffer_info[tx_ntc];
++ igb_unmap_and_free_tx_resource(tx_ring, buffer_info);
++
++ /* increment rx/tx next to clean counters */
++ rx_ntc++;
++ if (rx_ntc == rx_ring->count)
++ rx_ntc = 0;
++ tx_ntc++;
++ if (tx_ntc == tx_ring->count)
++ tx_ntc = 0;
++
++ /* fetch next descriptor */
++ rx_desc = E1000_RX_DESC_ADV(*rx_ring, rx_ntc);
++ staterr = le32_to_cpu(rx_desc->wb.upper.status_error);
++ }
++
++ /* re-map buffers to ring, store next to clean values */
++ igb_alloc_rx_buffers_adv(rx_ring, count);
++ rx_ring->next_to_clean = rx_ntc;
++ tx_ring->next_to_clean = tx_ntc;
++
++ return count;
++}
++
+ static int igb_run_loopback_test(struct igb_adapter *adapter)
+ {
+ struct igb_ring *tx_ring = &adapter->test_tx_ring;
+ struct igb_ring *rx_ring = &adapter->test_rx_ring;
+- int i, j, k, l, lc, good_cnt, ret_val = 0;
+- unsigned long time;
++ int i, j, lc, good_cnt, ret_val = 0;
++ unsigned int size = 1024;
++ netdev_tx_t tx_ret_val;
++ struct sk_buff *skb;
++
++ /* allocate test skb */
++ skb = alloc_skb(size, GFP_KERNEL);
++ if (!skb)
++ return 11;
+
+- writel(rx_ring->count - 1, rx_ring->tail);
++ /* place data into test skb */
++ igb_create_lbtest_frame(skb, size);
++ skb_put(skb, size);
+
+ /* Calculate the loop count based on the largest descriptor ring
+ * The idea is to wrap the largest ring a number of times using 64
+@@ -1490,50 +1526,36 @@ static int igb_run_loopback_test(struct igb_adapter *adapter)
+ else
+ lc = ((rx_ring->count / 64) * 2) + 1;
+
+- k = l = 0;
+ for (j = 0; j <= lc; j++) { /* loop count loop */
+- for (i = 0; i < 64; i++) { /* send the packets */
+- igb_create_lbtest_frame(tx_ring->buffer_info[k].skb,
+- 1024);
+- pci_dma_sync_single_for_device(tx_ring->pdev,
+- tx_ring->buffer_info[k].dma,
+- tx_ring->buffer_info[k].length,
+- PCI_DMA_TODEVICE);
+- k++;
+- if (k == tx_ring->count)
+- k = 0;
+- }
+- writel(k, tx_ring->tail);
+- msleep(200);
+- time = jiffies; /* set the start time for the receive */
++ /* reset count of good packets */
+ good_cnt = 0;
+- do { /* receive the sent packets */
+- pci_dma_sync_single_for_cpu(rx_ring->pdev,
+- rx_ring->buffer_info[l].dma,
+- IGB_RXBUFFER_2048,
+- PCI_DMA_FROMDEVICE);
+-
+- ret_val = igb_check_lbtest_frame(
+- rx_ring->buffer_info[l].skb, 1024);
+- if (!ret_val)
++
++ /* place 64 packets on the transmit queue*/
++ for (i = 0; i < 64; i++) {
++ skb_get(skb);
++ tx_ret_val = igb_xmit_frame_ring_adv(skb, tx_ring);
++ if (tx_ret_val == NETDEV_TX_OK)
+ good_cnt++;
+- l++;
+- if (l == rx_ring->count)
+- l = 0;
+- /* time + 20 msecs (200 msecs on 2.4) is more than
+- * enough time to complete the receives, if it's
+- * exceeded, break and error off
+- */
+- } while (good_cnt < 64 && jiffies < (time + 20));
++ }
++
+ if (good_cnt != 64) {
+- ret_val = 13; /* ret_val is the same as mis-compare */
++ ret_val = 12;
+ break;
+ }
+- if (jiffies >= (time + 20)) {
+- ret_val = 14; /* error code for time out error */
++
++ /* allow 200 milliseconds for packets to go from tx to rx */
++ msleep(200);
++
++ good_cnt = igb_clean_test_rings(rx_ring, tx_ring, size);
++ if (good_cnt != 64) {
++ ret_val = 13;
+ break;
+ }
+ } /* end loop count loop */
++
++ /* free the original skb */
++ kfree_skb(skb);
++
+ return ret_val;
+ }
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0036-igb-add-single-vector-msi-x-testing-to-interrupt-tes.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0036-igb-add-single-vector-msi-x-testing-to-interrupt-tes.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,83 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 27 Oct 2009 15:55:22 +0000
+Subject: [PATCH 036/165] igb: add single vector msi-x testing to interrupt
+ test
+
+commit 4eefa8f0131410eddaca323cd65e1ebefe3b3328 upstream.
+
+This change adds testing of the first msix vector to the interrupt testing.
+This should help with determining the cause of interrupt issues when they are
+encountered.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_ethtool.c | 27 +++++++++++++++++----------
+ 1 files changed, 17 insertions(+), 10 deletions(-)
+
+diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
+index 2fc4f1b..678b9ee 100644
+--- a/drivers/net/igb/igb_ethtool.c
++++ b/drivers/net/igb/igb_ethtool.c
+@@ -1124,32 +1124,36 @@ static int igb_intr_test(struct igb_adapter *adapter, u64 *data)
+ *data = 0;
+
+ /* Hook up test interrupt handler just for this test */
+- if (adapter->msix_entries)
+- /* NOTE: we don't test MSI-X interrupts here, yet */
+- return 0;
++ if (adapter->msix_entries) {
++ if (request_irq(adapter->msix_entries[0].vector,
++ &igb_test_intr, 0, netdev->name, adapter)) {
++ *data = 1;
++ return -1;
++ }
+
+- if (adapter->flags & IGB_FLAG_HAS_MSI) {
++ } else if (adapter->flags & IGB_FLAG_HAS_MSI) {
+ shared_int = false;
+- if (request_irq(irq, &igb_test_intr, 0, netdev->name, netdev)) {
++ if (request_irq(irq,
++ &igb_test_intr, 0, netdev->name, adapter)) {
+ *data = 1;
+ return -1;
+ }
+ } else if (!request_irq(irq, &igb_test_intr, IRQF_PROBE_SHARED,
+- netdev->name, netdev)) {
++ netdev->name, adapter)) {
+ shared_int = false;
+ } else if (request_irq(irq, &igb_test_intr, IRQF_SHARED,
+- netdev->name, netdev)) {
++ netdev->name, adapter)) {
+ *data = 1;
+ return -1;
+ }
+ dev_info(&adapter->pdev->dev, "testing %s interrupt\n",
+ (shared_int ? "shared" : "unshared"));
+ /* Disable all the interrupts */
+- wr32(E1000_IMC, 0xFFFFFFFF);
++ wr32(E1000_IMC, ~0);
+ msleep(10);
+
+ /* Define all writable bits for ICS */
+- switch(hw->mac.type) {
++ switch (hw->mac.type) {
+ case e1000_82575:
+ ics_mask = 0x37F47EDD;
+ break;
+@@ -1239,7 +1243,10 @@ static int igb_intr_test(struct igb_adapter *adapter, u64 *data)
+ msleep(10);
+
+ /* Unhook test interrupt handler */
+- free_irq(irq, netdev);
++ if (adapter->msix_entries)
++ free_irq(adapter->msix_entries[0].vector, adapter);
++ else
++ free_irq(irq, adapter);
+
+ return *data;
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0037-igb-cleanup-todo-code-found-in-igb_ethtool.c.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0037-igb-cleanup-todo-code-found-in-igb_ethtool.c.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,67 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 27 Oct 2009 15:55:41 +0000
+Subject: [PATCH 037/165] igb: cleanup "todo" code found in igb_ethtool.c
+
+commit 83ab50a56e6ea94627fea83ce7b03332bd4c2f02 upstream.
+
+This patch moves some defines into the e1000_regs.h file since this is the
+correct place for register defines and not inside of igb_ethtool.c
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/e1000_regs.h | 7 +++++++
+ drivers/net/igb/igb_ethtool.c | 11 +----------
+ 2 files changed, 8 insertions(+), 10 deletions(-)
+
+diff --git a/drivers/net/igb/e1000_regs.h b/drivers/net/igb/e1000_regs.h
+index 76c3389..e06c3b7 100644
+--- a/drivers/net/igb/e1000_regs.h
++++ b/drivers/net/igb/e1000_regs.h
+@@ -288,10 +288,17 @@ enum {
+ #define E1000_MTA 0x05200 /* Multicast Table Array - RW Array */
+ #define E1000_RA 0x05400 /* Receive Address - RW Array */
+ #define E1000_RA2 0x054E0 /* 2nd half of receive address array - RW Array */
++#define E1000_PSRTYPE(_i) (0x05480 + ((_i) * 4))
+ #define E1000_RAL(_i) (((_i) <= 15) ? (0x05400 + ((_i) * 8)) : \
+ (0x054E0 + ((_i - 16) * 8)))
+ #define E1000_RAH(_i) (((_i) <= 15) ? (0x05404 + ((_i) * 8)) : \
+ (0x054E4 + ((_i - 16) * 8)))
++#define E1000_IP4AT_REG(_i) (0x05840 + ((_i) * 8))
++#define E1000_IP6AT_REG(_i) (0x05880 + ((_i) * 4))
++#define E1000_WUPM_REG(_i) (0x05A00 + ((_i) * 4))
++#define E1000_FFMT_REG(_i) (0x09000 + ((_i) * 8))
++#define E1000_FFVT_REG(_i) (0x09800 + ((_i) * 8))
++#define E1000_FFLT_REG(_i) (0x05F00 + ((_i) * 8))
+ #define E1000_VFTA 0x05600 /* VLAN Filter Table Array - RW Array */
+ #define E1000_VT_CTL 0x0581C /* VMDq Control - RW */
+ #define E1000_WUC 0x05800 /* Wakeup Control - RW */
+diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
+index 678b9ee..cf139d3 100644
+--- a/drivers/net/igb/igb_ethtool.c
++++ b/drivers/net/igb/igb_ethtool.c
+@@ -503,19 +503,10 @@ static void igb_get_regs(struct net_device *netdev,
+ regs_buff[119] = adapter->stats.scvpc;
+ regs_buff[120] = adapter->stats.hrmpc;
+
+- /* These should probably be added to e1000_regs.h instead */
+- #define E1000_PSRTYPE_REG(_i) (0x05480 + ((_i) * 4))
+- #define E1000_IP4AT_REG(_i) (0x05840 + ((_i) * 8))
+- #define E1000_IP6AT_REG(_i) (0x05880 + ((_i) * 4))
+- #define E1000_WUPM_REG(_i) (0x05A00 + ((_i) * 4))
+- #define E1000_FFMT_REG(_i) (0x09000 + ((_i) * 8))
+- #define E1000_FFVT_REG(_i) (0x09800 + ((_i) * 8))
+- #define E1000_FFLT_REG(_i) (0x05F00 + ((_i) * 8))
+-
+ for (i = 0; i < 4; i++)
+ regs_buff[121 + i] = rd32(E1000_SRRCTL(i));
+ for (i = 0; i < 4; i++)
+- regs_buff[125 + i] = rd32(E1000_PSRTYPE_REG(i));
++ regs_buff[125 + i] = rd32(E1000_PSRTYPE(i));
+ for (i = 0; i < 4; i++)
+ regs_buff[129 + i] = rd32(E1000_RDBAL(i));
+ for (i = 0; i < 4; i++)
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0038-igb-add-support-for-seperate-tx-usecs-setting-in-eth.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0038-igb-add-support-for-seperate-tx-usecs-setting-in-eth.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,203 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 27 Oct 2009 23:45:42 +0000
+Subject: [PATCH 038/165] igb: add support for seperate tx-usecs setting in
+ ethtool
+
+commit 4fc82adfb01bdee79ec21e44557dc409ef31419a upstream.
+
+This patch adds support for a seperate tx-usecs interrupt moderation setting
+in ethtool which is supported when tx and rx interrupt vectors are sperated.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb.h | 5 ++-
+ drivers/net/igb/igb_ethtool.c | 49 +++++++++++++++++++++++++++++++----------
+ drivers/net/igb/igb_main.c | 22 +++++++++++------
+ 3 files changed, 54 insertions(+), 22 deletions(-)
+
+diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
+index 6c35c90..bef8cdc 100644
+--- a/drivers/net/igb/igb.h
++++ b/drivers/net/igb/igb.h
+@@ -249,8 +249,8 @@ struct igb_adapter {
+ unsigned int total_rx_bytes;
+ unsigned int total_rx_packets;
+ /* Interrupt Throttle Rate */
+- u32 itr;
+- u32 itr_setting;
++ u32 rx_itr_setting;
++ u32 tx_itr_setting;
+ u16 tx_itr;
+ u16 rx_itr;
+
+@@ -321,6 +321,7 @@ struct igb_adapter {
+ #define IGB_FLAG_HAS_MSI (1 << 0)
+ #define IGB_FLAG_DCA_ENABLED (1 << 1)
+ #define IGB_FLAG_QUAD_PORT_A (1 << 2)
++#define IGB_FLAG_QUEUE_PAIRS (1 << 3)
+
+ enum e1000_state_t {
+ __IGB_TESTING,
+diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
+index cf139d3..6bff005 100644
+--- a/drivers/net/igb/igb_ethtool.c
++++ b/drivers/net/igb/igb_ethtool.c
+@@ -1828,18 +1828,37 @@ static int igb_set_coalesce(struct net_device *netdev,
+ (ec->rx_coalesce_usecs == 2))
+ return -EINVAL;
+
++ if ((ec->tx_coalesce_usecs > IGB_MAX_ITR_USECS) ||
++ ((ec->tx_coalesce_usecs > 3) &&
++ (ec->tx_coalesce_usecs < IGB_MIN_ITR_USECS)) ||
++ (ec->tx_coalesce_usecs == 2))
++ return -EINVAL;
++
++ if ((adapter->flags & IGB_FLAG_QUEUE_PAIRS) && ec->tx_coalesce_usecs)
++ return -EINVAL;
++
+ /* convert to rate of irq's per second */
+- if (ec->rx_coalesce_usecs && ec->rx_coalesce_usecs <= 3) {
+- adapter->itr_setting = ec->rx_coalesce_usecs;
+- adapter->itr = IGB_START_ITR;
+- } else {
+- adapter->itr_setting = ec->rx_coalesce_usecs << 2;
+- adapter->itr = adapter->itr_setting;
+- }
++ if (ec->rx_coalesce_usecs && ec->rx_coalesce_usecs <= 3)
++ adapter->rx_itr_setting = ec->rx_coalesce_usecs;
++ else
++ adapter->rx_itr_setting = ec->rx_coalesce_usecs << 2;
++
++ /* convert to rate of irq's per second */
++ if (adapter->flags & IGB_FLAG_QUEUE_PAIRS)
++ adapter->tx_itr_setting = adapter->rx_itr_setting;
++ else if (ec->tx_coalesce_usecs && ec->tx_coalesce_usecs <= 3)
++ adapter->tx_itr_setting = ec->tx_coalesce_usecs;
++ else
++ adapter->tx_itr_setting = ec->tx_coalesce_usecs << 2;
+
+ for (i = 0; i < adapter->num_q_vectors; i++) {
+ struct igb_q_vector *q_vector = adapter->q_vector[i];
+- q_vector->itr_val = adapter->itr;
++ if (q_vector->rx_ring)
++ q_vector->itr_val = adapter->rx_itr_setting;
++ else
++ q_vector->itr_val = adapter->tx_itr_setting;
++ if (q_vector->itr_val && q_vector->itr_val <= 3)
++ q_vector->itr_val = IGB_START_ITR;
+ q_vector->set_itr = 1;
+ }
+
+@@ -1851,15 +1870,21 @@ static int igb_get_coalesce(struct net_device *netdev,
+ {
+ struct igb_adapter *adapter = netdev_priv(netdev);
+
+- if (adapter->itr_setting <= 3)
+- ec->rx_coalesce_usecs = adapter->itr_setting;
++ if (adapter->rx_itr_setting <= 3)
++ ec->rx_coalesce_usecs = adapter->rx_itr_setting;
+ else
+- ec->rx_coalesce_usecs = adapter->itr_setting >> 2;
++ ec->rx_coalesce_usecs = adapter->rx_itr_setting >> 2;
++
++ if (!(adapter->flags & IGB_FLAG_QUEUE_PAIRS)) {
++ if (adapter->tx_itr_setting <= 3)
++ ec->tx_coalesce_usecs = adapter->tx_itr_setting;
++ else
++ ec->tx_coalesce_usecs = adapter->tx_itr_setting >> 2;
++ }
+
+ return 0;
+ }
+
+-
+ static int igb_nway_reset(struct net_device *netdev)
+ {
+ struct igb_adapter *adapter = netdev_priv(netdev);
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 8b98e2f..4186a7d 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -734,6 +734,8 @@ msi_only:
+ dev_info(&adapter->pdev->dev, "IOV Disabled\n");
+ }
+ #endif
++ adapter->vfs_allocated_count = 0;
++ adapter->flags |= IGB_FLAG_QUEUE_PAIRS;
+ adapter->num_rx_queues = 1;
+ adapter->num_tx_queues = 1;
+ adapter->num_q_vectors = 1;
+@@ -791,7 +793,9 @@ static void igb_map_rx_ring_to_vector(struct igb_adapter *adapter,
+ q_vector = adapter->q_vector[v_idx];
+ q_vector->rx_ring = &adapter->rx_ring[ring_idx];
+ q_vector->rx_ring->q_vector = q_vector;
+- q_vector->itr_val = adapter->itr;
++ q_vector->itr_val = adapter->rx_itr_setting;
++ if (q_vector->itr_val && q_vector->itr_val <= 3)
++ q_vector->itr_val = IGB_START_ITR;
+ }
+
+ static void igb_map_tx_ring_to_vector(struct igb_adapter *adapter,
+@@ -802,7 +806,9 @@ static void igb_map_tx_ring_to_vector(struct igb_adapter *adapter,
+ q_vector = adapter->q_vector[v_idx];
+ q_vector->tx_ring = &adapter->tx_ring[ring_idx];
+ q_vector->tx_ring->q_vector = q_vector;
+- q_vector->itr_val = adapter->itr;
++ q_vector->itr_val = adapter->tx_itr_setting;
++ if (q_vector->itr_val && q_vector->itr_val <= 3)
++ q_vector->itr_val = IGB_START_ITR;
+ }
+
+ /**
+@@ -1597,9 +1603,6 @@ static int __devinit igb_probe(struct pci_dev *pdev,
+ hw->fc.requested_mode = e1000_fc_default;
+ hw->fc.current_mode = e1000_fc_default;
+
+- adapter->itr_setting = IGB_DEFAULT_ITR;
+- adapter->itr = IGB_START_ITR;
+-
+ igb_validate_mdi_setting(hw);
+
+ /* Initial Wake on LAN setting If APM wake is enabled in the EEPROM,
+@@ -1854,6 +1857,9 @@ static int __devinit igb_sw_init(struct igb_adapter *adapter)
+
+ adapter->tx_ring_count = IGB_DEFAULT_TXD;
+ adapter->rx_ring_count = IGB_DEFAULT_RXD;
++ adapter->rx_itr_setting = IGB_DEFAULT_ITR;
++ adapter->tx_itr_setting = IGB_DEFAULT_ITR;
++
+ adapter->max_frame_size = netdev->mtu + ETH_HLEN + ETH_FCS_LEN;
+ adapter->min_frame_size = ETH_ZLEN + ETH_FCS_LEN;
+
+@@ -3052,7 +3058,6 @@ enum latency_range {
+ latency_invalid = 255
+ };
+
+-
+ /**
+ * igb_update_ring_itr - update the dynamic ITR value based on packet size
+ *
+@@ -3216,7 +3221,7 @@ static void igb_set_itr(struct igb_adapter *adapter)
+ current_itr = max(adapter->rx_itr, adapter->tx_itr);
+
+ /* conservative mode (itr 3) eliminates the lowest_latency setting */
+- if (adapter->itr_setting == 3 && current_itr == lowest_latency)
++ if (adapter->rx_itr_setting == 3 && current_itr == lowest_latency)
+ current_itr = low_latency;
+
+ switch (current_itr) {
+@@ -4577,7 +4582,8 @@ static inline void igb_ring_irq_enable(struct igb_q_vector *q_vector)
+ struct igb_adapter *adapter = q_vector->adapter;
+ struct e1000_hw *hw = &adapter->hw;
+
+- if (adapter->itr_setting & 3) {
++ if ((q_vector->rx_ring && (adapter->rx_itr_setting & 3)) ||
++ (!q_vector->rx_ring && (adapter->tx_itr_setting & 3))) {
+ if (!adapter->msix_entries)
+ igb_set_itr(adapter);
+ else
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0039-igb-cleanup-some-of-the-code-related-to-hw-timestamp.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0039-igb-cleanup-some-of-the-code-related-to-hw-timestamp.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,755 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 27 Oct 2009 23:46:01 +0000
+Subject: [PATCH 039/165] igb: cleanup some of the code related to hw
+ timestamping
+
+commit c5b9bd5e4f7caea10d113f610b85cc2093cc3179 upstream.
+
+The code for the hw timestamping is a bit bulky and making some of the
+functions difficult to read. In order to clean things up a bit I am moving
+the timestamping operations into seperate functions.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/e1000_82575.h | 14 ++
+ drivers/net/igb/e1000_defines.h | 33 ++++
+ drivers/net/igb/e1000_regs.h | 65 ++-----
+ drivers/net/igb/igb.h | 1 +
+ drivers/net/igb/igb_main.c | 397 ++++++++++++++++++---------------------
+ 5 files changed, 242 insertions(+), 268 deletions(-)
+
+diff --git a/drivers/net/igb/e1000_82575.h b/drivers/net/igb/e1000_82575.h
+index 9418683..cbe4757 100644
+--- a/drivers/net/igb/e1000_82575.h
++++ b/drivers/net/igb/e1000_82575.h
+@@ -66,6 +66,8 @@ extern void igb_rx_fifo_flush_82575(struct e1000_hw *hw);
+ E1000_EICR_RX_QUEUE3)
+
+ /* Immediate Interrupt Rx (A.K.A. Low Latency Interrupt) */
++#define E1000_IMIREXT_SIZE_BP 0x00001000 /* Packet size bypass */
++#define E1000_IMIREXT_CTRL_BP 0x00080000 /* Bypass check of ctrl bits */
+
+ /* Receive Descriptor - Advanced */
+ union e1000_adv_rx_desc {
+@@ -98,6 +100,7 @@ union e1000_adv_rx_desc {
+
+ #define E1000_RXDADV_HDRBUFLEN_MASK 0x7FE0
+ #define E1000_RXDADV_HDRBUFLEN_SHIFT 5
++#define E1000_RXDADV_STAT_TS 0x10000 /* Pkt was time stamped */
+
+ /* Transmit Descriptor - Advanced */
+ union e1000_adv_tx_desc {
+@@ -167,6 +170,17 @@ struct e1000_adv_tx_context_desc {
+ #define E1000_DCA_TXCTRL_CPUID_SHIFT 24 /* Tx CPUID now in the last byte */
+ #define E1000_DCA_RXCTRL_CPUID_SHIFT 24 /* Rx CPUID now in the last byte */
+
++/* ETQF register bit definitions */
++#define E1000_ETQF_FILTER_ENABLE (1 << 26)
++#define E1000_ETQF_1588 (1 << 30)
++
++/* FTQF register bit definitions */
++#define E1000_FTQF_VF_BP 0x00008000
++#define E1000_FTQF_1588_TIME_STAMP 0x08000000
++#define E1000_FTQF_MASK 0xF0000000
++#define E1000_FTQF_MASK_PROTO_BP 0x10000000
++#define E1000_FTQF_MASK_SOURCE_PORT_BP 0x80000000
++
+ #define E1000_NVM_APME_82575 0x0400
+ #define MAX_NUM_VFS 8
+
+diff --git a/drivers/net/igb/e1000_defines.h b/drivers/net/igb/e1000_defines.h
+index cb91683..48fcab0 100644
+--- a/drivers/net/igb/e1000_defines.h
++++ b/drivers/net/igb/e1000_defines.h
+@@ -435,6 +435,39 @@
+ /* Flow Control */
+ #define E1000_FCRTL_XONE 0x80000000 /* Enable XON frame transmission */
+
++#define E1000_TSYNCTXCTL_VALID 0x00000001 /* tx timestamp valid */
++#define E1000_TSYNCTXCTL_ENABLED 0x00000010 /* enable tx timestampping */
++
++#define E1000_TSYNCRXCTL_VALID 0x00000001 /* rx timestamp valid */
++#define E1000_TSYNCRXCTL_TYPE_MASK 0x0000000E /* rx type mask */
++#define E1000_TSYNCRXCTL_TYPE_L2_V2 0x00
++#define E1000_TSYNCRXCTL_TYPE_L4_V1 0x02
++#define E1000_TSYNCRXCTL_TYPE_L2_L4_V2 0x04
++#define E1000_TSYNCRXCTL_TYPE_ALL 0x08
++#define E1000_TSYNCRXCTL_TYPE_EVENT_V2 0x0A
++#define E1000_TSYNCRXCTL_ENABLED 0x00000010 /* enable rx timestampping */
++
++#define E1000_TSYNCRXCFG_PTP_V1_CTRLT_MASK 0x000000FF
++#define E1000_TSYNCRXCFG_PTP_V1_SYNC_MESSAGE 0x00
++#define E1000_TSYNCRXCFG_PTP_V1_DELAY_REQ_MESSAGE 0x01
++#define E1000_TSYNCRXCFG_PTP_V1_FOLLOWUP_MESSAGE 0x02
++#define E1000_TSYNCRXCFG_PTP_V1_DELAY_RESP_MESSAGE 0x03
++#define E1000_TSYNCRXCFG_PTP_V1_MANAGEMENT_MESSAGE 0x04
++
++#define E1000_TSYNCRXCFG_PTP_V2_MSGID_MASK 0x00000F00
++#define E1000_TSYNCRXCFG_PTP_V2_SYNC_MESSAGE 0x0000
++#define E1000_TSYNCRXCFG_PTP_V2_DELAY_REQ_MESSAGE 0x0100
++#define E1000_TSYNCRXCFG_PTP_V2_PATH_DELAY_REQ_MESSAGE 0x0200
++#define E1000_TSYNCRXCFG_PTP_V2_PATH_DELAY_RESP_MESSAGE 0x0300
++#define E1000_TSYNCRXCFG_PTP_V2_FOLLOWUP_MESSAGE 0x0800
++#define E1000_TSYNCRXCFG_PTP_V2_DELAY_RESP_MESSAGE 0x0900
++#define E1000_TSYNCRXCFG_PTP_V2_PATH_DELAY_FOLLOWUP_MESSAGE 0x0A00
++#define E1000_TSYNCRXCFG_PTP_V2_ANNOUNCE_MESSAGE 0x0B00
++#define E1000_TSYNCRXCFG_PTP_V2_SIGNALLING_MESSAGE 0x0C00
++#define E1000_TSYNCRXCFG_PTP_V2_MANAGEMENT_MESSAGE 0x0D00
++
++#define E1000_TIMINCA_16NS_SHIFT 24
++
+ /* PCI Express Control */
+ #define E1000_GCR_CMPL_TMOUT_MASK 0x0000F000
+ #define E1000_GCR_CMPL_TMOUT_10ms 0x00001000
+diff --git a/drivers/net/igb/e1000_regs.h b/drivers/net/igb/e1000_regs.h
+index e06c3b7..24f2c24 100644
+--- a/drivers/net/igb/e1000_regs.h
++++ b/drivers/net/igb/e1000_regs.h
+@@ -76,59 +76,18 @@
+ #define E1000_FCRTV 0x02460 /* Flow Control Refresh Timer Value - RW */
+
+ /* IEEE 1588 TIMESYNCH */
+-#define E1000_TSYNCTXCTL 0x0B614
+-#define E1000_TSYNCTXCTL_VALID (1<<0)
+-#define E1000_TSYNCTXCTL_ENABLED (1<<4)
+-#define E1000_TSYNCRXCTL 0x0B620
+-#define E1000_TSYNCRXCTL_VALID (1<<0)
+-#define E1000_TSYNCRXCTL_ENABLED (1<<4)
+-enum {
+- E1000_TSYNCRXCTL_TYPE_L2_V2 = 0,
+- E1000_TSYNCRXCTL_TYPE_L4_V1 = (1<<1),
+- E1000_TSYNCRXCTL_TYPE_L2_L4_V2 = (1<<2),
+- E1000_TSYNCRXCTL_TYPE_ALL = (1<<3),
+- E1000_TSYNCRXCTL_TYPE_EVENT_V2 = (1<<3) | (1<<1),
+-};
+-#define E1000_TSYNCRXCFG 0x05F50
+-enum {
+- E1000_TSYNCRXCFG_PTP_V1_SYNC_MESSAGE = 0<<0,
+- E1000_TSYNCRXCFG_PTP_V1_DELAY_REQ_MESSAGE = 1<<0,
+- E1000_TSYNCRXCFG_PTP_V1_FOLLOWUP_MESSAGE = 2<<0,
+- E1000_TSYNCRXCFG_PTP_V1_DELAY_RESP_MESSAGE = 3<<0,
+- E1000_TSYNCRXCFG_PTP_V1_MANAGEMENT_MESSAGE = 4<<0,
+-
+- E1000_TSYNCRXCFG_PTP_V2_SYNC_MESSAGE = 0<<8,
+- E1000_TSYNCRXCFG_PTP_V2_DELAY_REQ_MESSAGE = 1<<8,
+- E1000_TSYNCRXCFG_PTP_V2_PATH_DELAY_REQ_MESSAGE = 2<<8,
+- E1000_TSYNCRXCFG_PTP_V2_PATH_DELAY_RESP_MESSAGE = 3<<8,
+- E1000_TSYNCRXCFG_PTP_V2_FOLLOWUP_MESSAGE = 8<<8,
+- E1000_TSYNCRXCFG_PTP_V2_DELAY_RESP_MESSAGE = 9<<8,
+- E1000_TSYNCRXCFG_PTP_V2_PATH_DELAY_FOLLOWUP_MESSAGE = 0xA<<8,
+- E1000_TSYNCRXCFG_PTP_V2_ANNOUNCE_MESSAGE = 0xB<<8,
+- E1000_TSYNCRXCFG_PTP_V2_SIGNALLING_MESSAGE = 0xC<<8,
+- E1000_TSYNCRXCFG_PTP_V2_MANAGEMENT_MESSAGE = 0xD<<8,
+-};
+-#define E1000_SYSTIML 0x0B600
+-#define E1000_SYSTIMH 0x0B604
+-#define E1000_TIMINCA 0x0B608
+-
+-#define E1000_RXMTRL 0x0B634
+-#define E1000_RXSTMPL 0x0B624
+-#define E1000_RXSTMPH 0x0B628
+-#define E1000_RXSATRL 0x0B62C
+-#define E1000_RXSATRH 0x0B630
+-
+-#define E1000_TXSTMPL 0x0B618
+-#define E1000_TXSTMPH 0x0B61C
+-
+-#define E1000_ETQF0 0x05CB0
+-#define E1000_ETQF1 0x05CB4
+-#define E1000_ETQF2 0x05CB8
+-#define E1000_ETQF3 0x05CBC
+-#define E1000_ETQF4 0x05CC0
+-#define E1000_ETQF5 0x05CC4
+-#define E1000_ETQF6 0x05CC8
+-#define E1000_ETQF7 0x05CCC
++#define E1000_TSYNCRXCTL 0x0B620 /* Rx Time Sync Control register - RW */
++#define E1000_TSYNCTXCTL 0x0B614 /* Tx Time Sync Control register - RW */
++#define E1000_TSYNCRXCFG 0x05F50 /* Time Sync Rx Configuration - RW */
++#define E1000_RXSTMPL 0x0B624 /* Rx timestamp Low - RO */
++#define E1000_RXSTMPH 0x0B628 /* Rx timestamp High - RO */
++#define E1000_RXSATRL 0x0B62C /* Rx timestamp attribute low - RO */
++#define E1000_RXSATRH 0x0B630 /* Rx timestamp attribute high - RO */
++#define E1000_TXSTMPL 0x0B618 /* Tx timestamp value Low - RO */
++#define E1000_TXSTMPH 0x0B61C /* Tx timestamp value High - RO */
++#define E1000_SYSTIML 0x0B600 /* System time register Low - RO */
++#define E1000_SYSTIMH 0x0B604 /* System time register High - RO */
++#define E1000_TIMINCA 0x0B608 /* Increment attributes register - RW */
+
+ /* Filtering Registers */
+ #define E1000_SAQF(_n) (0x5980 + 4 * (_n))
+diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
+index bef8cdc..1a0ae57 100644
+--- a/drivers/net/igb/igb.h
++++ b/drivers/net/igb/igb.h
+@@ -323,6 +323,7 @@ struct igb_adapter {
+ #define IGB_FLAG_QUAD_PORT_A (1 << 2)
+ #define IGB_FLAG_QUEUE_PAIRS (1 << 3)
+
++#define IGB_82576_TSYNC_SHIFT 19
+ enum e1000_state_t {
+ __IGB_TESTING,
+ __IGB_RESETTING,
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 4186a7d..19a12f0 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -220,38 +220,6 @@ MODULE_LICENSE("GPL");
+ MODULE_VERSION(DRV_VERSION);
+
+ /**
+- * Scale the NIC clock cycle by a large factor so that
+- * relatively small clock corrections can be added or
+- * substracted at each clock tick. The drawbacks of a
+- * large factor are a) that the clock register overflows
+- * more quickly (not such a big deal) and b) that the
+- * increment per tick has to fit into 24 bits.
+- *
+- * Note that
+- * TIMINCA = IGB_TSYNC_CYCLE_TIME_IN_NANOSECONDS *
+- * IGB_TSYNC_SCALE
+- * TIMINCA += TIMINCA * adjustment [ppm] / 1e9
+- *
+- * The base scale factor is intentionally a power of two
+- * so that the division in %struct timecounter can be done with
+- * a shift.
+- */
+-#define IGB_TSYNC_SHIFT (19)
+-#define IGB_TSYNC_SCALE (1<<IGB_TSYNC_SHIFT)
+-
+-/**
+- * The duration of one clock cycle of the NIC.
+- *
+- * @todo This hard-coded value is part of the specification and might change
+- * in future hardware revisions. Add revision check.
+- */
+-#define IGB_TSYNC_CYCLE_TIME_IN_NANOSECONDS 16
+-
+-#if (IGB_TSYNC_SCALE * IGB_TSYNC_CYCLE_TIME_IN_NANOSECONDS) >= (1<<24)
+-# error IGB_TSYNC_SCALE and/or IGB_TSYNC_CYCLE_TIME_IN_NANOSECONDS are too large to fit into TIMINCA
+-#endif
+-
+-/**
+ * igb_read_clock - read raw cycle counter (to be used by time counter)
+ */
+ static cycle_t igb_read_clock(const struct cyclecounter *tc)
+@@ -259,11 +227,11 @@ static cycle_t igb_read_clock(const struct cyclecounter *tc)
+ struct igb_adapter *adapter =
+ container_of(tc, struct igb_adapter, cycles);
+ struct e1000_hw *hw = &adapter->hw;
+- u64 stamp;
+-
+- stamp = rd32(E1000_SYSTIML);
+- stamp |= (u64)rd32(E1000_SYSTIMH) << 32ULL;
++ u64 stamp = 0;
++ int shift = 0;
+
++ stamp |= (u64)rd32(E1000_SYSTIML) << shift;
++ stamp |= (u64)rd32(E1000_SYSTIMH) << (shift + 32);
+ return stamp;
+ }
+
+@@ -1669,59 +1637,58 @@ static int __devinit igb_probe(struct pci_dev *pdev,
+ dev_info(&pdev->dev, "DCA enabled\n");
+ igb_setup_dca(adapter);
+ }
+-#endif
+
+- /*
+- * Initialize hardware timer: we keep it running just in case
+- * that some program needs it later on.
+- */
+- memset(&adapter->cycles, 0, sizeof(adapter->cycles));
+- adapter->cycles.read = igb_read_clock;
+- adapter->cycles.mask = CLOCKSOURCE_MASK(64);
+- adapter->cycles.mult = 1;
+- adapter->cycles.shift = IGB_TSYNC_SHIFT;
+- wr32(E1000_TIMINCA,
+- (1<<24) |
+- IGB_TSYNC_CYCLE_TIME_IN_NANOSECONDS * IGB_TSYNC_SCALE);
+-#if 0
+- /*
+- * Avoid rollover while we initialize by resetting the time counter.
+- */
+- wr32(E1000_SYSTIML, 0x00000000);
+- wr32(E1000_SYSTIMH, 0x00000000);
+-#else
+- /*
+- * Set registers so that rollover occurs soon to test this.
+- */
+- wr32(E1000_SYSTIML, 0x00000000);
+- wr32(E1000_SYSTIMH, 0xFF800000);
+ #endif
+- wrfl();
+- timecounter_init(&adapter->clock,
+- &adapter->cycles,
+- ktime_to_ns(ktime_get_real()));
+
+- /*
+- * Synchronize our NIC clock against system wall clock. NIC
+- * time stamp reading requires ~3us per sample, each sample
+- * was pretty stable even under load => only require 10
+- * samples for each offset comparison.
+- */
+- memset(&adapter->compare, 0, sizeof(adapter->compare));
+- adapter->compare.source = &adapter->clock;
+- adapter->compare.target = ktime_get_real;
+- adapter->compare.num_samples = 10;
+- timecompare_update(&adapter->compare, 0);
+-
+-#ifdef DEBUG
+- {
+- char buffer[160];
+- printk(KERN_DEBUG
+- "igb: %s: hw %p initialized timer\n",
+- igb_get_time_str(adapter, buffer),
+- &adapter->hw);
++ switch (hw->mac.type) {
++ case e1000_82576:
++ /*
++ * Initialize hardware timer: we keep it running just in case
++ * that some program needs it later on.
++ */
++ memset(&adapter->cycles, 0, sizeof(adapter->cycles));
++ adapter->cycles.read = igb_read_clock;
++ adapter->cycles.mask = CLOCKSOURCE_MASK(64);
++ adapter->cycles.mult = 1;
++ /**
++ * Scale the NIC clock cycle by a large factor so that
++ * relatively small clock corrections can be added or
++ * substracted at each clock tick. The drawbacks of a large
++ * factor are a) that the clock register overflows more quickly
++ * (not such a big deal) and b) that the increment per tick has
++ * to fit into 24 bits. As a result we need to use a shift of
++ * 19 so we can fit a value of 16 into the TIMINCA register.
++ */
++ adapter->cycles.shift = IGB_82576_TSYNC_SHIFT;
++ wr32(E1000_TIMINCA,
++ (1 << E1000_TIMINCA_16NS_SHIFT) |
++ (16 << IGB_82576_TSYNC_SHIFT));
++
++ /* Set registers so that rollover occurs soon to test this. */
++ wr32(E1000_SYSTIML, 0x00000000);
++ wr32(E1000_SYSTIMH, 0xFF800000);
++ wrfl();
++
++ timecounter_init(&adapter->clock,
++ &adapter->cycles,
++ ktime_to_ns(ktime_get_real()));
++ /*
++ * Synchronize our NIC clock against system wall clock. NIC
++ * time stamp reading requires ~3us per sample, each sample
++ * was pretty stable even under load => only require 10
++ * samples for each offset comparison.
++ */
++ memset(&adapter->compare, 0, sizeof(adapter->compare));
++ adapter->compare.source = &adapter->clock;
++ adapter->compare.target = ktime_get_real;
++ adapter->compare.num_samples = 10;
++ timecompare_update(&adapter->compare, 0);
++ break;
++ case e1000_82575:
++ /* 82575 does not support timesync */
++ default:
++ break;
+ }
+-#endif
+
+ dev_info(&pdev->dev, "Intel(R) Gigabit Ethernet Network Connection\n");
+ /* print bus type/speed/width info */
+@@ -3596,7 +3563,7 @@ netdev_tx_t igb_xmit_frame_ring_adv(struct sk_buff *skb,
+ u8 hdr_len = 0;
+ int count = 0;
+ int tso = 0;
+- union skb_shared_tx *shtx;
++ union skb_shared_tx *shtx = skb_tx(skb);
+
+ /* need: 1 descriptor per page,
+ * + 2 desc gap to keep tail from touching head,
+@@ -3608,16 +3575,6 @@ netdev_tx_t igb_xmit_frame_ring_adv(struct sk_buff *skb,
+ return NETDEV_TX_BUSY;
+ }
+
+- /*
+- * TODO: check that there currently is no other packet with
+- * time stamping in the queue
+- *
+- * When doing time stamping, keep the connection to the socket
+- * a while longer: it is still needed by skb_hwtstamp_tx(),
+- * called either in igb_tx_hwtstamp() or by our caller when
+- * doing software time stamping.
+- */
+- shtx = skb_tx(skb);
+ if (unlikely(shtx->hardware)) {
+ shtx->in_progress = 1;
+ tx_flags |= IGB_TX_FLAGS_TSTAMP;
+@@ -4633,37 +4590,54 @@ static int igb_poll(struct napi_struct *napi, int budget)
+ }
+
+ /**
+- * igb_hwtstamp - utility function which checks for TX time stamp
++ * igb_systim_to_hwtstamp - convert system time value to hw timestamp
+ * @adapter: board private structure
++ * @shhwtstamps: timestamp structure to update
++ * @regval: unsigned 64bit system time value.
++ *
++ * We need to convert the system time value stored in the RX/TXSTMP registers
++ * into a hwtstamp which can be used by the upper level timestamping functions
++ */
++static void igb_systim_to_hwtstamp(struct igb_adapter *adapter,
++ struct skb_shared_hwtstamps *shhwtstamps,
++ u64 regval)
++{
++ u64 ns;
++
++ ns = timecounter_cyc2time(&adapter->clock, regval);
++ timecompare_update(&adapter->compare, ns);
++ memset(shhwtstamps, 0, sizeof(struct skb_shared_hwtstamps));
++ shhwtstamps->hwtstamp = ns_to_ktime(ns);
++ shhwtstamps->syststamp = timecompare_transform(&adapter->compare, ns);
++}
++
++/**
++ * igb_tx_hwtstamp - utility function which checks for TX time stamp
++ * @q_vector: pointer to q_vector containing needed info
+ * @skb: packet that was just sent
+ *
+ * If we were asked to do hardware stamping and such a time stamp is
+ * available, then it must have been for this skb here because we only
+ * allow only one such packet into the queue.
+ */
+-static void igb_tx_hwtstamp(struct igb_adapter *adapter, struct sk_buff *skb)
++static void igb_tx_hwtstamp(struct igb_q_vector *q_vector, struct sk_buff *skb)
+ {
++ struct igb_adapter *adapter = q_vector->adapter;
+ union skb_shared_tx *shtx = skb_tx(skb);
+ struct e1000_hw *hw = &adapter->hw;
++ struct skb_shared_hwtstamps shhwtstamps;
++ u64 regval;
+
+- if (unlikely(shtx->hardware)) {
+- u32 valid = rd32(E1000_TSYNCTXCTL) & E1000_TSYNCTXCTL_VALID;
+- if (valid) {
+- u64 regval = rd32(E1000_TXSTMPL);
+- u64 ns;
+- struct skb_shared_hwtstamps shhwtstamps;
+-
+- memset(&shhwtstamps, 0, sizeof(shhwtstamps));
+- regval |= (u64)rd32(E1000_TXSTMPH) << 32;
+- ns = timecounter_cyc2time(&adapter->clock,
+- regval);
+- timecompare_update(&adapter->compare, ns);
+- shhwtstamps.hwtstamp = ns_to_ktime(ns);
+- shhwtstamps.syststamp =
+- timecompare_transform(&adapter->compare, ns);
+- skb_tstamp_tx(skb, &shhwtstamps);
+- }
+- }
++ /* if skb does not support hw timestamp or TX stamp not valid exit */
++ if (likely(!shtx->hardware) ||
++ !(rd32(E1000_TSYNCTXCTL) & E1000_TSYNCTXCTL_VALID))
++ return;
++
++ regval = rd32(E1000_TXSTMPL);
++ regval |= (u64)rd32(E1000_TXSTMPH) << 32;
++
++ igb_systim_to_hwtstamp(adapter, &shhwtstamps, regval);
++ skb_tstamp_tx(skb, &shhwtstamps);
+ }
+
+ /**
+@@ -4706,7 +4680,7 @@ static bool igb_clean_tx_irq(struct igb_q_vector *q_vector)
+ total_packets += segs;
+ total_bytes += bytecount;
+
+- igb_tx_hwtstamp(adapter, skb);
++ igb_tx_hwtstamp(q_vector, skb);
+ }
+
+ igb_unmap_and_free_tx_resource(tx_ring, buffer_info);
+@@ -4831,6 +4805,34 @@ static inline void igb_rx_checksum_adv(struct igb_ring *ring,
+ dev_dbg(&ring->pdev->dev, "cksum success: bits %08X\n", status_err);
+ }
+
++static inline void igb_rx_hwtstamp(struct igb_q_vector *q_vector, u32 staterr,
++ struct sk_buff *skb)
++{
++ struct igb_adapter *adapter = q_vector->adapter;
++ struct e1000_hw *hw = &adapter->hw;
++ u64 regval;
++
++ /*
++ * If this bit is set, then the RX registers contain the time stamp. No
++ * other packet will be time stamped until we read these registers, so
++ * read the registers to make them available again. Because only one
++ * packet can be time stamped at a time, we know that the register
++ * values must belong to this one here and therefore we don't need to
++ * compare any of the additional attributes stored for it.
++ *
++ * If nothing went wrong, then it should have a skb_shared_tx that we
++ * can turn into a skb_shared_hwtstamps.
++ */
++ if (likely(!(staterr & E1000_RXDADV_STAT_TS)))
++ return;
++ if (!(rd32(E1000_TSYNCRXCTL) & E1000_TSYNCRXCTL_VALID))
++ return;
++
++ regval = rd32(E1000_RXSTMPL);
++ regval |= (u64)rd32(E1000_RXSTMPH) << 32;
++
++ igb_systim_to_hwtstamp(adapter, skb_hwtstamps(skb), regval);
++}
+ static inline u16 igb_get_hlen(struct igb_ring *rx_ring,
+ union e1000_adv_rx_desc *rx_desc)
+ {
+@@ -4848,10 +4850,8 @@ static inline u16 igb_get_hlen(struct igb_ring *rx_ring,
+ static bool igb_clean_rx_irq_adv(struct igb_q_vector *q_vector,
+ int *work_done, int budget)
+ {
+- struct igb_adapter *adapter = q_vector->adapter;
+ struct igb_ring *rx_ring = q_vector->rx_ring;
+ struct net_device *netdev = rx_ring->netdev;
+- struct e1000_hw *hw = &adapter->hw;
+ struct pci_dev *pdev = rx_ring->pdev;
+ union e1000_adv_rx_desc *rx_desc , *next_rxd;
+ struct igb_buffer *buffer_info , *next_buffer;
+@@ -4930,52 +4930,12 @@ static bool igb_clean_rx_irq_adv(struct igb_q_vector *q_vector,
+ goto next_desc;
+ }
+ send_up:
+- /*
+- * If this bit is set, then the RX registers contain
+- * the time stamp. No other packet will be time
+- * stamped until we read these registers, so read the
+- * registers to make them available again. Because
+- * only one packet can be time stamped at a time, we
+- * know that the register values must belong to this
+- * one here and therefore we don't need to compare
+- * any of the additional attributes stored for it.
+- *
+- * If nothing went wrong, then it should have a
+- * skb_shared_tx that we can turn into a
+- * skb_shared_hwtstamps.
+- *
+- * TODO: can time stamping be triggered (thus locking
+- * the registers) without the packet reaching this point
+- * here? In that case RX time stamping would get stuck.
+- *
+- * TODO: in "time stamp all packets" mode this bit is
+- * not set. Need a global flag for this mode and then
+- * always read the registers. Cannot be done without
+- * a race condition.
+- */
+- if (unlikely(staterr & E1000_RXD_STAT_TS)) {
+- u64 regval;
+- u64 ns;
+- struct skb_shared_hwtstamps *shhwtstamps =
+- skb_hwtstamps(skb);
+-
+- WARN(!(rd32(E1000_TSYNCRXCTL) & E1000_TSYNCRXCTL_VALID),
+- "igb: no RX time stamp available for time stamped packet");
+- regval = rd32(E1000_RXSTMPL);
+- regval |= (u64)rd32(E1000_RXSTMPH) << 32;
+- ns = timecounter_cyc2time(&adapter->clock, regval);
+- timecompare_update(&adapter->compare, ns);
+- memset(shhwtstamps, 0, sizeof(*shhwtstamps));
+- shhwtstamps->hwtstamp = ns_to_ktime(ns);
+- shhwtstamps->syststamp =
+- timecompare_transform(&adapter->compare, ns);
+- }
+-
+ if (staterr & E1000_RXDEXT_ERR_FRAME_ERR_MASK) {
+ dev_kfree_skb_irq(skb);
+ goto next_desc;
+ }
+
++ igb_rx_hwtstamp(q_vector, staterr, skb);
+ total_bytes += skb->len;
+ total_packets++;
+
+@@ -5161,13 +5121,11 @@ static int igb_hwtstamp_ioctl(struct net_device *netdev,
+ struct igb_adapter *adapter = netdev_priv(netdev);
+ struct e1000_hw *hw = &adapter->hw;
+ struct hwtstamp_config config;
+- u32 tsync_tx_ctl_bit = E1000_TSYNCTXCTL_ENABLED;
+- u32 tsync_rx_ctl_bit = E1000_TSYNCRXCTL_ENABLED;
+- u32 tsync_rx_ctl_type = 0;
++ u32 tsync_tx_ctl = E1000_TSYNCTXCTL_ENABLED;
++ u32 tsync_rx_ctl = E1000_TSYNCRXCTL_ENABLED;
+ u32 tsync_rx_cfg = 0;
+- int is_l4 = 0;
+- int is_l2 = 0;
+- short port = 319; /* PTP */
++ bool is_l4 = false;
++ bool is_l2 = false;
+ u32 regval;
+
+ if (copy_from_user(&config, ifr->ifr_data, sizeof(config)))
+@@ -5179,10 +5137,8 @@ static int igb_hwtstamp_ioctl(struct net_device *netdev,
+
+ switch (config.tx_type) {
+ case HWTSTAMP_TX_OFF:
+- tsync_tx_ctl_bit = 0;
+- break;
++ tsync_tx_ctl = 0;
+ case HWTSTAMP_TX_ON:
+- tsync_tx_ctl_bit = E1000_TSYNCTXCTL_ENABLED;
+ break;
+ default:
+ return -ERANGE;
+@@ -5190,7 +5146,7 @@ static int igb_hwtstamp_ioctl(struct net_device *netdev,
+
+ switch (config.rx_filter) {
+ case HWTSTAMP_FILTER_NONE:
+- tsync_rx_ctl_bit = 0;
++ tsync_rx_ctl = 0;
+ break;
+ case HWTSTAMP_FILTER_PTP_V1_L4_EVENT:
+ case HWTSTAMP_FILTER_PTP_V2_L4_EVENT:
+@@ -5201,86 +5157,97 @@ static int igb_hwtstamp_ioctl(struct net_device *netdev,
+ * possible to time stamp both Sync and Delay_Req messages
+ * => fall back to time stamping all packets
+ */
+- tsync_rx_ctl_type = E1000_TSYNCRXCTL_TYPE_ALL;
++ tsync_rx_ctl |= E1000_TSYNCRXCTL_TYPE_ALL;
+ config.rx_filter = HWTSTAMP_FILTER_ALL;
+ break;
+ case HWTSTAMP_FILTER_PTP_V1_L4_SYNC:
+- tsync_rx_ctl_type = E1000_TSYNCRXCTL_TYPE_L4_V1;
++ tsync_rx_ctl |= E1000_TSYNCRXCTL_TYPE_L4_V1;
+ tsync_rx_cfg = E1000_TSYNCRXCFG_PTP_V1_SYNC_MESSAGE;
+- is_l4 = 1;
++ is_l4 = true;
+ break;
+ case HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ:
+- tsync_rx_ctl_type = E1000_TSYNCRXCTL_TYPE_L4_V1;
++ tsync_rx_ctl |= E1000_TSYNCRXCTL_TYPE_L4_V1;
+ tsync_rx_cfg = E1000_TSYNCRXCFG_PTP_V1_DELAY_REQ_MESSAGE;
+- is_l4 = 1;
++ is_l4 = true;
+ break;
+ case HWTSTAMP_FILTER_PTP_V2_L2_SYNC:
+ case HWTSTAMP_FILTER_PTP_V2_L4_SYNC:
+- tsync_rx_ctl_type = E1000_TSYNCRXCTL_TYPE_L2_L4_V2;
++ tsync_rx_ctl |= E1000_TSYNCRXCTL_TYPE_L2_L4_V2;
+ tsync_rx_cfg = E1000_TSYNCRXCFG_PTP_V2_SYNC_MESSAGE;
+- is_l2 = 1;
+- is_l4 = 1;
++ is_l2 = true;
++ is_l4 = true;
+ config.rx_filter = HWTSTAMP_FILTER_SOME;
+ break;
+ case HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ:
+ case HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ:
+- tsync_rx_ctl_type = E1000_TSYNCRXCTL_TYPE_L2_L4_V2;
++ tsync_rx_ctl |= E1000_TSYNCRXCTL_TYPE_L2_L4_V2;
+ tsync_rx_cfg = E1000_TSYNCRXCFG_PTP_V2_DELAY_REQ_MESSAGE;
+- is_l2 = 1;
+- is_l4 = 1;
++ is_l2 = true;
++ is_l4 = true;
+ config.rx_filter = HWTSTAMP_FILTER_SOME;
+ break;
+ case HWTSTAMP_FILTER_PTP_V2_EVENT:
+ case HWTSTAMP_FILTER_PTP_V2_SYNC:
+ case HWTSTAMP_FILTER_PTP_V2_DELAY_REQ:
+- tsync_rx_ctl_type = E1000_TSYNCRXCTL_TYPE_EVENT_V2;
++ tsync_rx_ctl |= E1000_TSYNCRXCTL_TYPE_EVENT_V2;
+ config.rx_filter = HWTSTAMP_FILTER_PTP_V2_EVENT;
+- is_l2 = 1;
++ is_l2 = true;
+ break;
+ default:
+ return -ERANGE;
+ }
+
++ if (hw->mac.type == e1000_82575) {
++ if (tsync_rx_ctl | tsync_tx_ctl)
++ return -EINVAL;
++ return 0;
++ }
++
+ /* enable/disable TX */
+ regval = rd32(E1000_TSYNCTXCTL);
+- regval = (regval & ~E1000_TSYNCTXCTL_ENABLED) | tsync_tx_ctl_bit;
++ regval &= ~E1000_TSYNCTXCTL_ENABLED;
++ regval |= tsync_tx_ctl;
+ wr32(E1000_TSYNCTXCTL, regval);
+
+- /* enable/disable RX, define which PTP packets are time stamped */
++ /* enable/disable RX */
+ regval = rd32(E1000_TSYNCRXCTL);
+- regval = (regval & ~E1000_TSYNCRXCTL_ENABLED) | tsync_rx_ctl_bit;
+- regval = (regval & ~0xE) | tsync_rx_ctl_type;
++ regval &= ~(E1000_TSYNCRXCTL_ENABLED | E1000_TSYNCRXCTL_TYPE_MASK);
++ regval |= tsync_rx_ctl;
+ wr32(E1000_TSYNCRXCTL, regval);
+- wr32(E1000_TSYNCRXCFG, tsync_rx_cfg);
+
+- /*
+- * Ethertype Filter Queue Filter[0][15:0] = 0x88F7
+- * (Ethertype to filter on)
+- * Ethertype Filter Queue Filter[0][26] = 0x1 (Enable filter)
+- * Ethertype Filter Queue Filter[0][30] = 0x1 (Enable Timestamping)
+- */
+- wr32(E1000_ETQF0, is_l2 ? 0x440088f7 : 0);
+-
+- /* L4 Queue Filter[0]: only filter by source and destination port */
+- wr32(E1000_SPQF0, htons(port));
+- wr32(E1000_IMIREXT(0), is_l4 ?
+- ((1<<12) | (1<<19) /* bypass size and control flags */) : 0);
+- wr32(E1000_IMIR(0), is_l4 ?
+- (htons(port)
+- | (0<<16) /* immediate interrupt disabled */
+- | 0 /* (1<<17) bit cleared: do not bypass
+- destination port check */)
+- : 0);
+- wr32(E1000_FTQF0, is_l4 ?
+- (0x11 /* UDP */
+- | (1<<15) /* VF not compared */
+- | (1<<27) /* Enable Timestamping */
+- | (7<<28) /* only source port filter enabled,
+- source/target address and protocol
+- masked */)
+- : ((1<<15) | (15<<28) /* all mask bits set = filter not
+- enabled */));
++ /* define which PTP packets are time stamped */
++ wr32(E1000_TSYNCRXCFG, tsync_rx_cfg);
+
++ /* define ethertype filter for timestamped packets */
++ if (is_l2)
++ wr32(E1000_ETQF(3),
++ (E1000_ETQF_FILTER_ENABLE | /* enable filter */
++ E1000_ETQF_1588 | /* enable timestamping */
++ ETH_P_1588)); /* 1588 eth protocol type */
++ else
++ wr32(E1000_ETQF(3), 0);
++
++#define PTP_PORT 319
++ /* L4 Queue Filter[3]: filter by destination port and protocol */
++ if (is_l4) {
++ u32 ftqf = (IPPROTO_UDP /* UDP */
++ | E1000_FTQF_VF_BP /* VF not compared */
++ | E1000_FTQF_1588_TIME_STAMP /* Enable Timestamping */
++ | E1000_FTQF_MASK); /* mask all inputs */
++ ftqf &= ~E1000_FTQF_MASK_PROTO_BP; /* enable protocol check */
++
++ wr32(E1000_IMIR(3), htons(PTP_PORT));
++ wr32(E1000_IMIREXT(3),
++ (E1000_IMIREXT_SIZE_BP | E1000_IMIREXT_CTRL_BP));
++ if (hw->mac.type == e1000_82576) {
++ /* enable source port check */
++ wr32(E1000_SPQF(3), htons(PTP_PORT));
++ ftqf &= ~E1000_FTQF_MASK_SOURCE_PORT_BP;
++ }
++ wr32(E1000_FTQF(3), ftqf);
++ } else {
++ wr32(E1000_FTQF(3), E1000_FTQF_MASK);
++ }
+ wrfl();
+
+ adapter->hwtstamp_config = config;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0040-igb-misc-cleanups-within-igb_ethtool.c.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0040-igb-misc-cleanups-within-igb_ethtool.c.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,310 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 27 Oct 2009 23:46:20 +0000
+Subject: [PATCH 040/165] igb: misc cleanups within igb_ethtool.c
+
+commit 317f66bdadc31f0c037b91ae7857f5c3d2a4e3e5 upstream.
+
+This patch just goes thorugh and does several cleanups on igb_ethtool.c.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_ethtool.c | 105 +++++++++++++++++++++++-----------------
+ 1 files changed, 60 insertions(+), 45 deletions(-)
+
+diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
+index 6bff005..1518f56 100644
+--- a/drivers/net/igb/igb_ethtool.c
++++ b/drivers/net/igb/igb_ethtool.c
+@@ -102,24 +102,25 @@ static const struct igb_stats igb_gstrings_stats[] = {
+ };
+
+ #define IGB_QUEUE_STATS_LEN \
+- (((((struct igb_adapter *)netdev_priv(netdev))->num_rx_queues)* \
++ ((((struct igb_adapter *)netdev_priv(netdev))->num_rx_queues * \
+ (sizeof(struct igb_rx_queue_stats) / sizeof(u64))) + \
+- ((((struct igb_adapter *)netdev_priv(netdev))->num_tx_queues) * \
++ (((struct igb_adapter *)netdev_priv(netdev))->num_tx_queues * \
+ (sizeof(struct igb_tx_queue_stats) / sizeof(u64))))
+ #define IGB_GLOBAL_STATS_LEN \
+- sizeof(igb_gstrings_stats) / sizeof(struct igb_stats)
++ (sizeof(igb_gstrings_stats) / sizeof(struct igb_stats))
+ #define IGB_STATS_LEN (IGB_GLOBAL_STATS_LEN + IGB_QUEUE_STATS_LEN)
+ static const char igb_gstrings_test[][ETH_GSTRING_LEN] = {
+ "Register test (offline)", "Eeprom test (offline)",
+ "Interrupt test (offline)", "Loopback test (offline)",
+ "Link test (on/offline)"
+ };
+-#define IGB_TEST_LEN sizeof(igb_gstrings_test) / ETH_GSTRING_LEN
++#define IGB_TEST_LEN (sizeof(igb_gstrings_test) / ETH_GSTRING_LEN)
+
+ static int igb_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
+ {
+ struct igb_adapter *adapter = netdev_priv(netdev);
+ struct e1000_hw *hw = &adapter->hw;
++ u32 status;
+
+ if (hw->phy.media_type == e1000_media_type_copper) {
+
+@@ -154,17 +155,20 @@ static int igb_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
+
+ ecmd->transceiver = XCVR_INTERNAL;
+
+- if (rd32(E1000_STATUS) & E1000_STATUS_LU) {
++ status = rd32(E1000_STATUS);
+
+- adapter->hw.mac.ops.get_speed_and_duplex(hw,
+- &adapter->link_speed,
+- &adapter->link_duplex);
+- ecmd->speed = adapter->link_speed;
++ if (status & E1000_STATUS_LU) {
+
+- /* unfortunately FULL_DUPLEX != DUPLEX_FULL
+- * and HALF_DUPLEX != DUPLEX_HALF */
++ if ((status & E1000_STATUS_SPEED_1000) ||
++ hw->phy.media_type != e1000_media_type_copper)
++ ecmd->speed = SPEED_1000;
++ else if (status & E1000_STATUS_SPEED_100)
++ ecmd->speed = SPEED_100;
++ else
++ ecmd->speed = SPEED_10;
+
+- if (adapter->link_duplex == FULL_DUPLEX)
++ if ((status & E1000_STATUS_FD) ||
++ hw->phy.media_type != e1000_media_type_copper)
+ ecmd->duplex = DUPLEX_FULL;
+ else
+ ecmd->duplex = DUPLEX_HALF;
+@@ -255,8 +259,9 @@ static int igb_set_pauseparam(struct net_device *netdev,
+ if (netif_running(adapter->netdev)) {
+ igb_down(adapter);
+ igb_up(adapter);
+- } else
++ } else {
+ igb_reset(adapter);
++ }
+ } else {
+ if (pause->rx_pause && pause->tx_pause)
+ hw->fc.requested_mode = e1000_fc_full;
+@@ -309,7 +314,7 @@ static int igb_set_tx_csum(struct net_device *netdev, u32 data)
+
+ if (data) {
+ netdev->features |= (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM);
+- if (adapter->hw.mac.type == e1000_82576)
++ if (adapter->hw.mac.type >= e1000_82576)
+ netdev->features |= NETIF_F_SCTP_CSUM;
+ } else {
+ netdev->features &= ~(NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
+@@ -736,12 +741,12 @@ static int igb_set_ringparam(struct net_device *netdev,
+ if ((ring->rx_mini_pending) || (ring->rx_jumbo_pending))
+ return -EINVAL;
+
+- new_rx_count = max(ring->rx_pending, (u32)IGB_MIN_RXD);
+- new_rx_count = min(new_rx_count, (u32)IGB_MAX_RXD);
++ new_rx_count = min(ring->rx_pending, (u32)IGB_MAX_RXD);
++ new_rx_count = max(new_rx_count, (u16)IGB_MIN_RXD);
+ new_rx_count = ALIGN(new_rx_count, REQ_RX_DESCRIPTOR_MULTIPLE);
+
+- new_tx_count = max(ring->tx_pending, (u32)IGB_MIN_TXD);
+- new_tx_count = min(new_tx_count, (u32)IGB_MAX_TXD);
++ new_tx_count = min(ring->tx_pending, (u32)IGB_MAX_TXD);
++ new_tx_count = max(new_tx_count, (u16)IGB_MIN_TXD);
+ new_tx_count = ALIGN(new_tx_count, REQ_TX_DESCRIPTOR_MULTIPLE);
+
+ if ((new_tx_count == adapter->tx_ring_count) &&
+@@ -942,7 +947,7 @@ static bool reg_pattern_test(struct igb_adapter *adapter, u64 *data,
+ {
+ struct e1000_hw *hw = &adapter->hw;
+ u32 pat, val;
+- u32 _test[] =
++ static const u32 _test[] =
+ {0x5A5A5A5A, 0xA5A5A5A5, 0x00000000, 0xFFFFFFFF};
+ for (pat = 0; pat < ARRAY_SIZE(_test); pat++) {
+ wr32(reg, (_test[pat] & write));
+@@ -955,6 +960,7 @@ static bool reg_pattern_test(struct igb_adapter *adapter, u64 *data,
+ return 1;
+ }
+ }
++
+ return 0;
+ }
+
+@@ -972,6 +978,7 @@ static bool reg_set_and_check(struct igb_adapter *adapter, u64 *data,
+ *data = reg;
+ return 1;
+ }
++
+ return 0;
+ }
+
+@@ -994,14 +1001,14 @@ static int igb_reg_test(struct igb_adapter *adapter, u64 *data)
+ u32 value, before, after;
+ u32 i, toggle;
+
+- toggle = 0x7FFFF3FF;
+-
+ switch (adapter->hw.mac.type) {
+ case e1000_82576:
+ test = reg_test_82576;
++ toggle = 0x7FFFF3FF;
+ break;
+ default:
+ test = reg_test_82575;
++ toggle = 0x7FFFF3FF;
+ break;
+ }
+
+@@ -1079,8 +1086,7 @@ static int igb_eeprom_test(struct igb_adapter *adapter, u64 *data)
+ *data = 0;
+ /* Read and add up the contents of the EEPROM */
+ for (i = 0; i < (NVM_CHECKSUM_REG + 1); i++) {
+- if ((adapter->hw.nvm.ops.read(&adapter->hw, i, 1, &temp))
+- < 0) {
++ if ((adapter->hw.nvm.ops.read(&adapter->hw, i, 1, &temp)) < 0) {
+ *data = 1;
+ break;
+ }
+@@ -1096,8 +1102,7 @@ static int igb_eeprom_test(struct igb_adapter *adapter, u64 *data)
+
+ static irqreturn_t igb_test_intr(int irq, void *data)
+ {
+- struct net_device *netdev = (struct net_device *) data;
+- struct igb_adapter *adapter = netdev_priv(netdev);
++ struct igb_adapter *adapter = (struct igb_adapter *) data;
+ struct e1000_hw *hw = &adapter->hw;
+
+ adapter->test_icr |= rd32(E1000_ICR);
+@@ -1121,7 +1126,6 @@ static int igb_intr_test(struct igb_adapter *adapter, u64 *data)
+ *data = 1;
+ return -1;
+ }
+-
+ } else if (adapter->flags & IGB_FLAG_HAS_MSI) {
+ shared_int = false;
+ if (request_irq(irq,
+@@ -1139,6 +1143,7 @@ static int igb_intr_test(struct igb_adapter *adapter, u64 *data)
+ }
+ dev_info(&adapter->pdev->dev, "testing %s interrupt\n",
+ (shared_int ? "shared" : "unshared"));
++
+ /* Disable all the interrupts */
+ wr32(E1000_IMC, ~0);
+ msleep(10);
+@@ -1364,7 +1369,10 @@ static int igb_setup_loopback_test(struct igb_adapter *adapter)
+ struct e1000_hw *hw = &adapter->hw;
+ u32 reg;
+
+- if (hw->phy.media_type == e1000_media_type_internal_serdes) {
++ reg = rd32(E1000_CTRL_EXT);
++
++ /* use CTRL_EXT to identify link type as SGMII can appear as copper */
++ if (reg & E1000_CTRL_EXT_LINK_MODE_MASK) {
+ reg = rd32(E1000_RCTL);
+ reg |= E1000_RCTL_LBM_TCVR;
+ wr32(E1000_RCTL, reg);
+@@ -1395,11 +1403,9 @@ static int igb_setup_loopback_test(struct igb_adapter *adapter)
+ wr32(E1000_PCS_LCTL, reg);
+
+ return 0;
+- } else if (hw->phy.media_type == e1000_media_type_copper) {
+- return igb_set_phy_loopback(adapter);
+ }
+
+- return 7;
++ return igb_set_phy_loopback(adapter);
+ }
+
+ static void igb_loopback_cleanup(struct igb_adapter *adapter)
+@@ -1425,19 +1431,21 @@ static void igb_create_lbtest_frame(struct sk_buff *skb,
+ unsigned int frame_size)
+ {
+ memset(skb->data, 0xFF, frame_size);
+- frame_size &= ~1;
+- memset(&skb->data[frame_size / 2], 0xAA, frame_size / 2 - 1);
+- memset(&skb->data[frame_size / 2 + 10], 0xBE, 1);
+- memset(&skb->data[frame_size / 2 + 12], 0xAF, 1);
++ frame_size /= 2;
++ memset(&skb->data[frame_size], 0xAA, frame_size - 1);
++ memset(&skb->data[frame_size + 10], 0xBE, 1);
++ memset(&skb->data[frame_size + 12], 0xAF, 1);
+ }
+
+ static int igb_check_lbtest_frame(struct sk_buff *skb, unsigned int frame_size)
+ {
+- frame_size &= ~1;
+- if (*(skb->data + 3) == 0xFF)
+- if ((*(skb->data + frame_size / 2 + 10) == 0xBE) &&
+- (*(skb->data + frame_size / 2 + 12) == 0xAF))
++ frame_size /= 2;
++ if (*(skb->data + 3) == 0xFF) {
++ if ((*(skb->data + frame_size + 10) == 0xBE) &&
++ (*(skb->data + frame_size + 12) == 0xAF)) {
+ return 0;
++ }
++ }
+ return 13;
+ }
+
+@@ -1514,7 +1522,8 @@ static int igb_run_loopback_test(struct igb_adapter *adapter)
+ igb_create_lbtest_frame(skb, size);
+ skb_put(skb, size);
+
+- /* Calculate the loop count based on the largest descriptor ring
++ /*
++ * Calculate the loop count based on the largest descriptor ring
+ * The idea is to wrap the largest ring a number of times using 64
+ * send/receive pairs during each loop
+ */
+@@ -1606,8 +1615,7 @@ static int igb_link_test(struct igb_adapter *adapter, u64 *data)
+ if (hw->mac.autoneg)
+ msleep(4000);
+
+- if (!(rd32(E1000_STATUS) &
+- E1000_STATUS_LU))
++ if (!(rd32(E1000_STATUS) & E1000_STATUS_LU))
+ *data = 1;
+ }
+ return *data;
+@@ -1789,7 +1797,6 @@ static int igb_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
+ adapter->wol |= E1000_WUFC_BC;
+ if (wol->wolopts & WAKE_MAGIC)
+ adapter->wol |= E1000_WUFC_MAG;
+-
+ device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol);
+
+ return 0;
+@@ -1802,12 +1809,19 @@ static int igb_phys_id(struct net_device *netdev, u32 data)
+ {
+ struct igb_adapter *adapter = netdev_priv(netdev);
+ struct e1000_hw *hw = &adapter->hw;
++ unsigned long timeout;
+
+- if (!data || data > (u32)(MAX_SCHEDULE_TIMEOUT / HZ))
+- data = (u32)(MAX_SCHEDULE_TIMEOUT / HZ);
++ timeout = data * 1000;
++
++ /*
++ * msleep_interruptable only accepts unsigned int so we are limited
++ * in how long a duration we can wait
++ */
++ if (!timeout || timeout > UINT_MAX)
++ timeout = UINT_MAX;
+
+ igb_blink_led(hw);
+- msleep_interruptible(data * 1000);
++ msleep_interruptible(timeout);
+
+ igb_led_off(hw);
+ clear_bit(IGB_LED_ON, &adapter->led_status);
+@@ -1917,6 +1931,7 @@ static void igb_get_ethtool_stats(struct net_device *netdev,
+ char *p = NULL;
+
+ igb_update_stats(adapter);
++
+ for (i = 0; i < IGB_GLOBAL_STATS_LEN; i++) {
+ switch (igb_gstrings_stats[i].type) {
+ case NETDEV_STATS:
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0041-igb-use-packet-buffer-sizes-from-RXPBS-register.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0041-igb-use-packet-buffer-sizes-from-RXPBS-register.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,63 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 27 Oct 2009 23:46:38 +0000
+Subject: [PATCH 041/165] igb: use packet buffer sizes from RXPBS register
+
+commit d249be54745259980dcbd898bdfeb7307c9c5e10 upstream.
+
+This patch changes the configuration for 82576 so that it uses the actual
+value of the 82576 rx packet buffer size instead of just assuming the
+value.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/e1000_82575.h | 2 ++
+ drivers/net/igb/e1000_regs.h | 2 ++
+ drivers/net/igb/igb_main.c | 3 ++-
+ 3 files changed, 6 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/igb/e1000_82575.h b/drivers/net/igb/e1000_82575.h
+index cbe4757..b3808ca 100644
+--- a/drivers/net/igb/e1000_82575.h
++++ b/drivers/net/igb/e1000_82575.h
+@@ -228,6 +228,8 @@ struct e1000_adv_tx_context_desc {
+
+ #define ALL_QUEUES 0xFFFF
+
++/* RX packet buffer size defines */
++#define E1000_RXPBS_SIZE_MASK_82576 0x0000007F
+ void igb_vmdq_set_loopback_pf(struct e1000_hw *, bool);
+ void igb_vmdq_set_replication_pf(struct e1000_hw *, bool);
+
+diff --git a/drivers/net/igb/e1000_regs.h b/drivers/net/igb/e1000_regs.h
+index 24f2c24..934e03b 100644
+--- a/drivers/net/igb/e1000_regs.h
++++ b/drivers/net/igb/e1000_regs.h
+@@ -102,7 +102,9 @@
+ #define E1000_ETQF(_n) (0x05CB0 + (4 * (_n))) /* EType Queue Fltr */
+
+ #define E1000_RQDPC(_n) (0x0C030 + ((_n) * 0x40))
++
+ /* Split and Replication RX Control - RW */
++#define E1000_RXPBS 0x02404 /* Rx Packet Buffer Size - RW */
+ /*
+ * Convenience macros
+ *
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 19a12f0..2ace3a3 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -1215,7 +1215,8 @@ void igb_reset(struct igb_adapter *adapter)
+ */
+ switch (mac->type) {
+ case e1000_82576:
+- pba = E1000_PBA_64K;
++ pba = rd32(E1000_RXPBS);
++ pba &= E1000_RXPBS_SIZE_MASK_82576;
+ break;
+ case e1000_82575:
+ default:
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0042-igb-replace-the-VF-clear_to_send-with-a-flags-value.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0042-igb-replace-the-VF-clear_to_send-with-a-flags-value.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,269 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 27 Oct 2009 23:46:57 +0000
+Subject: [PATCH 042/165] igb: replace the VF clear_to_send with a flags value
+
+commit f2ca0dbe077389f061ffa15de9dd7fc96a5b97d2 upstream.
+
+In order to support future features it is easiest to replace the
+clear_to_send boolean with a flag value.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb.h | 5 ++-
+ drivers/net/igb/igb_main.c | 125 +++++++++++++++++++++++---------------------
+ 2 files changed, 70 insertions(+), 60 deletions(-)
+
+diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
+index 1a0ae57..7801d3f 100644
+--- a/drivers/net/igb/igb.h
++++ b/drivers/net/igb/igb.h
+@@ -73,9 +73,12 @@ struct vf_data_storage {
+ u16 vf_mc_hashes[IGB_MAX_VF_MC_ENTRIES];
+ u16 num_vf_mc_hashes;
+ u16 vlans_enabled;
+- bool clear_to_send;
++ u32 flags;
++ unsigned long last_nack;
+ };
+
++#define IGB_VF_FLAG_CTS 0x00000001 /* VF is clear to send data */
++
+ /* RX descriptor control thresholds.
+ * PTHRESH - MAC will consider prefetch if it has fewer than this number of
+ * descriptors available in its onboard memory.
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 2ace3a3..d931b8f 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -125,9 +125,8 @@ static void igb_restore_vlan(struct igb_adapter *);
+ static void igb_rar_set_qsel(struct igb_adapter *, u8 *, u32 , u8);
+ static void igb_ping_all_vfs(struct igb_adapter *);
+ static void igb_msg_task(struct igb_adapter *);
+-static int igb_rcv_msg_from_vf(struct igb_adapter *, u32);
+ static void igb_vmm_control(struct igb_adapter *);
+-static int igb_set_vf_mac(struct igb_adapter *adapter, int, unsigned char *);
++static int igb_set_vf_mac(struct igb_adapter *, int, unsigned char *);
+ static void igb_restore_vf_multicasts(struct igb_adapter *adapter);
+
+ static inline void igb_set_vmolr(struct e1000_hw *hw, int vfn)
+@@ -1291,10 +1290,10 @@ void igb_reset(struct igb_adapter *adapter)
+ if (adapter->vfs_allocated_count) {
+ int i;
+ for (i = 0 ; i < adapter->vfs_allocated_count; i++)
+- adapter->vf_data[i].clear_to_send = false;
++ adapter->vf_data[i].flags = 0;
+
+ /* ping all the active vfs to let them know we are going down */
+- igb_ping_all_vfs(adapter);
++ igb_ping_all_vfs(adapter);
+
+ /* disable transmits and receives */
+ wr32(E1000_VFRE, 0);
+@@ -4096,7 +4095,7 @@ static void igb_ping_all_vfs(struct igb_adapter *adapter)
+
+ for (i = 0 ; i < adapter->vfs_allocated_count; i++) {
+ ping = E1000_PF_CONTROL_MSG;
+- if (adapter->vf_data[i].clear_to_send)
++ if (adapter->vf_data[i].flags & IGB_VF_FLAG_CTS)
+ ping |= E1000_VT_MSGTYPE_CTS;
+ igb_write_mbx(hw, &ping, 1, i);
+ }
+@@ -4276,15 +4275,14 @@ static int igb_set_vf_vlan(struct igb_adapter *adapter, u32 *msgbuf, u32 vf)
+ return igb_vlvf_set(adapter, vid, add, vf);
+ }
+
+-static inline void igb_vf_reset_event(struct igb_adapter *adapter, u32 vf)
++static inline void igb_vf_reset(struct igb_adapter *adapter, u32 vf)
+ {
+- struct e1000_hw *hw = &adapter->hw;
+-
+- /* disable mailbox functionality for vf */
+- adapter->vf_data[vf].clear_to_send = false;
++ /* clear all flags */
++ adapter->vf_data[vf].flags = 0;
++ adapter->vf_data[vf].last_nack = jiffies;
+
+ /* reset offloads to defaults */
+- igb_set_vmolr(hw, vf);
++ igb_set_vmolr(&adapter->hw, vf);
+
+ /* reset vlans for device */
+ igb_clear_vf_vfta(adapter, vf);
+@@ -4296,7 +4294,18 @@ static inline void igb_vf_reset_event(struct igb_adapter *adapter, u32 vf)
+ igb_set_rx_mode(adapter->netdev);
+ }
+
+-static inline void igb_vf_reset_msg(struct igb_adapter *adapter, u32 vf)
++static void igb_vf_reset_event(struct igb_adapter *adapter, u32 vf)
++{
++ unsigned char *vf_mac = adapter->vf_data[vf].vf_mac_addresses;
++
++ /* generate a new mac address as we were hotplug removed/added */
++ random_ether_addr(vf_mac);
++
++ /* process remaining reset events */
++ igb_vf_reset(adapter, vf);
++}
++
++static void igb_vf_reset_msg(struct igb_adapter *adapter, u32 vf)
+ {
+ struct e1000_hw *hw = &adapter->hw;
+ unsigned char *vf_mac = adapter->vf_data[vf].vf_mac_addresses;
+@@ -4305,7 +4314,7 @@ static inline void igb_vf_reset_msg(struct igb_adapter *adapter, u32 vf)
+ u8 *addr = (u8 *)(&msgbuf[1]);
+
+ /* process all the same items cleared in a function level reset */
+- igb_vf_reset_event(adapter, vf);
++ igb_vf_reset(adapter, vf);
+
+ /* set vf mac address */
+ igb_rar_set_qsel(adapter, vf_mac, rar_entry, vf);
+@@ -4316,8 +4325,7 @@ static inline void igb_vf_reset_msg(struct igb_adapter *adapter, u32 vf)
+ reg = rd32(E1000_VFRE);
+ wr32(E1000_VFRE, reg | (1 << vf));
+
+- /* enable mailbox functionality for vf */
+- adapter->vf_data[vf].clear_to_send = true;
++ adapter->vf_data[vf].flags = IGB_VF_FLAG_CTS;
+
+ /* reply to reset with ack and vf mac address */
+ msgbuf[0] = E1000_VF_RESET | E1000_VT_MSGTYPE_ACK;
+@@ -4327,66 +4335,45 @@ static inline void igb_vf_reset_msg(struct igb_adapter *adapter, u32 vf)
+
+ static int igb_set_vf_mac_addr(struct igb_adapter *adapter, u32 *msg, int vf)
+ {
+- unsigned char *addr = (char *)&msg[1];
+- int err = -1;
++ unsigned char *addr = (char *)&msg[1];
++ int err = -1;
+
+- if (is_valid_ether_addr(addr))
+- err = igb_set_vf_mac(adapter, vf, addr);
+-
+- return err;
++ if (is_valid_ether_addr(addr))
++ err = igb_set_vf_mac(adapter, vf, addr);
+
++ return err;
+ }
+
+ static void igb_rcv_ack_from_vf(struct igb_adapter *adapter, u32 vf)
+ {
+ struct e1000_hw *hw = &adapter->hw;
++ struct vf_data_storage *vf_data = &adapter->vf_data[vf];
+ u32 msg = E1000_VT_MSGTYPE_NACK;
+
+ /* if device isn't clear to send it shouldn't be reading either */
+- if (!adapter->vf_data[vf].clear_to_send)
++ if (!(vf_data->flags & IGB_VF_FLAG_CTS) &&
++ time_after(jiffies, vf_data->last_nack + (2 * HZ))) {
+ igb_write_mbx(hw, &msg, 1, vf);
+-}
+-
+-
+-static void igb_msg_task(struct igb_adapter *adapter)
+-{
+- struct e1000_hw *hw = &adapter->hw;
+- u32 vf;
+-
+- for (vf = 0; vf < adapter->vfs_allocated_count; vf++) {
+- /* process any reset requests */
+- if (!igb_check_for_rst(hw, vf)) {
+- adapter->vf_data[vf].clear_to_send = false;
+- igb_vf_reset_event(adapter, vf);
+- }
+-
+- /* process any messages pending */
+- if (!igb_check_for_msg(hw, vf))
+- igb_rcv_msg_from_vf(adapter, vf);
+-
+- /* process any acks */
+- if (!igb_check_for_ack(hw, vf))
+- igb_rcv_ack_from_vf(adapter, vf);
+-
++ vf_data->last_nack = jiffies;
+ }
+ }
+
+-static int igb_rcv_msg_from_vf(struct igb_adapter *adapter, u32 vf)
++static void igb_rcv_msg_from_vf(struct igb_adapter *adapter, u32 vf)
+ {
+- u32 mbx_size = E1000_VFMAILBOX_SIZE;
+- u32 msgbuf[mbx_size];
++ struct pci_dev *pdev = adapter->pdev;
++ u32 msgbuf[E1000_VFMAILBOX_SIZE];
+ struct e1000_hw *hw = &adapter->hw;
++ struct vf_data_storage *vf_data = &adapter->vf_data[vf];
+ s32 retval;
+
+- retval = igb_read_mbx(hw, msgbuf, mbx_size, vf);
++ retval = igb_read_mbx(hw, msgbuf, E1000_VFMAILBOX_SIZE, vf);
+
+ if (retval)
+- dev_err(&adapter->pdev->dev,
+- "Error receiving message from VF\n");
++ dev_err(&pdev->dev, "Error receiving message from VF\n");
+
+ /* this is a message we already processed, do nothing */
+ if (msgbuf[0] & (E1000_VT_MSGTYPE_ACK | E1000_VT_MSGTYPE_NACK))
+- return retval;
++ return;
+
+ /*
+ * until the vf completes a reset it should not be
+@@ -4395,14 +4382,16 @@ static int igb_rcv_msg_from_vf(struct igb_adapter *adapter, u32 vf)
+
+ if (msgbuf[0] == E1000_VF_RESET) {
+ igb_vf_reset_msg(adapter, vf);
+-
+- return retval;
++ return;
+ }
+
+- if (!adapter->vf_data[vf].clear_to_send) {
+- msgbuf[0] |= E1000_VT_MSGTYPE_NACK;
+- igb_write_mbx(hw, msgbuf, 1, vf);
+- return retval;
++ if (!(vf_data->flags & IGB_VF_FLAG_CTS)) {
++ msgbuf[0] = E1000_VT_MSGTYPE_NACK;
++ if (time_after(jiffies, vf_data->last_nack + (2 * HZ))) {
++ igb_write_mbx(hw, msgbuf, 1, vf);
++ vf_data->last_nack = jiffies;
++ }
++ return;
+ }
+
+ switch ((msgbuf[0] & 0xFFFF)) {
+@@ -4433,8 +4422,26 @@ static int igb_rcv_msg_from_vf(struct igb_adapter *adapter, u32 vf)
+ msgbuf[0] |= E1000_VT_MSGTYPE_CTS;
+
+ igb_write_mbx(hw, msgbuf, 1, vf);
++}
+
+- return retval;
++static void igb_msg_task(struct igb_adapter *adapter)
++{
++ struct e1000_hw *hw = &adapter->hw;
++ u32 vf;
++
++ for (vf = 0; vf < adapter->vfs_allocated_count; vf++) {
++ /* process any reset requests */
++ if (!igb_check_for_rst(hw, vf))
++ igb_vf_reset_event(adapter, vf);
++
++ /* process any messages pending */
++ if (!igb_check_for_msg(hw, vf))
++ igb_rcv_msg_from_vf(adapter, vf);
++
++ /* process any acks */
++ if (!igb_check_for_ack(hw, vf))
++ igb_rcv_ack_from_vf(adapter, vf);
++ }
+ }
+
+ /**
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0043-igb-rework-use-of-VMOLR-in-regards-to-PF-and-VFs.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0043-igb-rework-use-of-VMOLR-in-regards-to-PF-and-VFs.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,329 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 27 Oct 2009 23:47:16 +0000
+Subject: [PATCH 043/165] igb: rework use of VMOLR in regards to PF and VFs
+
+commit 7d5753f08c5be5440ac0385b5f2518d2630be7b7 upstream.
+
+This patch updates the use of the VMOLR to include enabling multicast
+promiscous for the VFs should they attempt to send over 30 multicast
+addresses or if they use the new message type to enable multicast
+promiscuous.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/e1000_mbx.h | 10 ++-
+ drivers/net/igb/igb.h | 2 +
+ drivers/net/igb/igb_main.c | 173 +++++++++++++++++++++++++++++--------------
+ 3 files changed, 125 insertions(+), 60 deletions(-)
+
+diff --git a/drivers/net/igb/e1000_mbx.h b/drivers/net/igb/e1000_mbx.h
+index ebc02ea..bb112fb 100644
+--- a/drivers/net/igb/e1000_mbx.h
++++ b/drivers/net/igb/e1000_mbx.h
+@@ -58,10 +58,12 @@
+ #define E1000_VT_MSGINFO_MASK (0xFF << E1000_VT_MSGINFO_SHIFT)
+
+ #define E1000_VF_RESET 0x01 /* VF requests reset */
+-#define E1000_VF_SET_MAC_ADDR 0x02 /* VF requests PF to set MAC addr */
+-#define E1000_VF_SET_MULTICAST 0x03 /* VF requests PF to set MC addr */
+-#define E1000_VF_SET_VLAN 0x04 /* VF requests PF to set VLAN */
+-#define E1000_VF_SET_LPE 0x05 /* VF requests PF to set VMOLR.LPE */
++#define E1000_VF_SET_MAC_ADDR 0x02 /* VF requests to set MAC addr */
++#define E1000_VF_SET_MULTICAST 0x03 /* VF requests to set MC addr */
++#define E1000_VF_SET_VLAN 0x04 /* VF requests to set VLAN */
++#define E1000_VF_SET_LPE 0x05 /* VF requests to set VMOLR.LPE */
++#define E1000_VF_SET_PROMISC 0x06 /*VF requests to clear VMOLR.ROPE/MPME*/
++#define E1000_VF_SET_PROMISC_MULTICAST (0x02 << E1000_VT_MSGINFO_SHIFT)
+
+ #define E1000_PF_CONTROL_MSG 0x0100 /* PF control message */
+
+diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
+index 7801d3f..c27dc1a 100644
+--- a/drivers/net/igb/igb.h
++++ b/drivers/net/igb/igb.h
+@@ -78,6 +78,8 @@ struct vf_data_storage {
+ };
+
+ #define IGB_VF_FLAG_CTS 0x00000001 /* VF is clear to send data */
++#define IGB_VF_FLAG_UNI_PROMISC 0x00000002 /* VF has unicast promisc */
++#define IGB_VF_FLAG_MULTI_PROMISC 0x00000004 /* VF has multicast promisc */
+
+ /* RX descriptor control thresholds.
+ * PTHRESH - MAC will consider prefetch if it has fewer than this number of
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index d931b8f..d6f4075 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -129,38 +129,6 @@ static void igb_vmm_control(struct igb_adapter *);
+ static int igb_set_vf_mac(struct igb_adapter *, int, unsigned char *);
+ static void igb_restore_vf_multicasts(struct igb_adapter *adapter);
+
+-static inline void igb_set_vmolr(struct e1000_hw *hw, int vfn)
+-{
+- u32 reg_data;
+-
+- reg_data = rd32(E1000_VMOLR(vfn));
+- reg_data |= E1000_VMOLR_BAM | /* Accept broadcast */
+- E1000_VMOLR_ROMPE | /* Accept packets matched in MTA */
+- E1000_VMOLR_AUPE | /* Accept untagged packets */
+- E1000_VMOLR_STRVLAN; /* Strip vlan tags */
+- wr32(E1000_VMOLR(vfn), reg_data);
+-}
+-
+-static inline int igb_set_vf_rlpml(struct igb_adapter *adapter, int size,
+- int vfn)
+-{
+- struct e1000_hw *hw = &adapter->hw;
+- u32 vmolr;
+-
+- /* if it isn't the PF check to see if VFs are enabled and
+- * increase the size to support vlan tags */
+- if (vfn < adapter->vfs_allocated_count &&
+- adapter->vf_data[vfn].vlans_enabled)
+- size += VLAN_TAG_SIZE;
+-
+- vmolr = rd32(E1000_VMOLR(vfn));
+- vmolr &= ~E1000_VMOLR_RLPML_MASK;
+- vmolr |= size | E1000_VMOLR_LPE;
+- wr32(E1000_VMOLR(vfn), vmolr);
+-
+- return 0;
+-}
+-
+ #ifdef CONFIG_PM
+ static int igb_suspend(struct pci_dev *, pm_message_t);
+ static int igb_resume(struct pci_dev *);
+@@ -1115,8 +1083,6 @@ int igb_up(struct igb_adapter *adapter)
+ if (adapter->msix_entries)
+ igb_configure_msix(adapter);
+
+- igb_set_vmolr(hw, adapter->vfs_allocated_count);
+-
+ /* Clear any pending interrupts. */
+ rd32(E1000_ICR);
+ igb_irq_enable(adapter);
+@@ -1892,8 +1858,6 @@ static int igb_open(struct net_device *netdev)
+ * clean_rx handler before we do so. */
+ igb_configure(adapter);
+
+- igb_set_vmolr(hw, adapter->vfs_allocated_count);
+-
+ err = igb_request_irq(adapter);
+ if (err)
+ goto err_req_irq;
+@@ -2331,22 +2295,33 @@ void igb_setup_rctl(struct igb_adapter *adapter)
+ * if an un-trusted VF does not provide descriptors to hardware.
+ */
+ if (adapter->vfs_allocated_count) {
+- u32 vmolr;
+-
+ /* set all queue drop enable bits */
+ wr32(E1000_QDE, ALL_QUEUES);
+-
+- vmolr = rd32(E1000_VMOLR(adapter->vfs_allocated_count));
+- if (rctl & E1000_RCTL_LPE)
+- vmolr |= E1000_VMOLR_LPE;
+- if (adapter->num_rx_queues > 1)
+- vmolr |= E1000_VMOLR_RSSE;
+- wr32(E1000_VMOLR(adapter->vfs_allocated_count), vmolr);
+ }
+
+ wr32(E1000_RCTL, rctl);
+ }
+
++static inline int igb_set_vf_rlpml(struct igb_adapter *adapter, int size,
++ int vfn)
++{
++ struct e1000_hw *hw = &adapter->hw;
++ u32 vmolr;
++
++ /* if it isn't the PF check to see if VFs are enabled and
++ * increase the size to support vlan tags */
++ if (vfn < adapter->vfs_allocated_count &&
++ adapter->vf_data[vfn].vlans_enabled)
++ size += VLAN_TAG_SIZE;
++
++ vmolr = rd32(E1000_VMOLR(vfn));
++ vmolr &= ~E1000_VMOLR_RLPML_MASK;
++ vmolr |= size | E1000_VMOLR_LPE;
++ wr32(E1000_VMOLR(vfn), vmolr);
++
++ return 0;
++}
++
+ /**
+ * igb_rlpml_set - set maximum receive packet size
+ * @adapter: board private structure
+@@ -2366,12 +2341,43 @@ static void igb_rlpml_set(struct igb_adapter *adapter)
+ * size and set the VMOLR RLPML to the size we need */
+ if (pf_id) {
+ igb_set_vf_rlpml(adapter, max_frame_size, pf_id);
+- max_frame_size = MAX_STD_JUMBO_FRAME_SIZE + VLAN_TAG_SIZE;
++ max_frame_size = MAX_JUMBO_FRAME_SIZE;
+ }
+
+ wr32(E1000_RLPML, max_frame_size);
+ }
+
++static inline void igb_set_vmolr(struct igb_adapter *adapter, int vfn)
++{
++ struct e1000_hw *hw = &adapter->hw;
++ u32 vmolr;
++
++ /*
++ * This register exists only on 82576 and newer so if we are older then
++ * we should exit and do nothing
++ */
++ if (hw->mac.type < e1000_82576)
++ return;
++
++ vmolr = rd32(E1000_VMOLR(vfn));
++ vmolr |= E1000_VMOLR_AUPE | /* Accept untagged packets */
++ E1000_VMOLR_STRVLAN; /* Strip vlan tags */
++
++ /* clear all bits that might not be set */
++ vmolr &= ~(E1000_VMOLR_BAM | E1000_VMOLR_RSSE);
++
++ if (adapter->num_rx_queues > 1 && vfn == adapter->vfs_allocated_count)
++ vmolr |= E1000_VMOLR_RSSE; /* enable RSS */
++ /*
++ * for VMDq only allow the VFs and pool 0 to accept broadcast and
++ * multicast packets
++ */
++ if (vfn <= adapter->vfs_allocated_count)
++ vmolr |= E1000_VMOLR_BAM; /* Accept broadcast */
++
++ wr32(E1000_VMOLR(vfn), vmolr);
++}
++
+ /**
+ * igb_configure_rx_ring - Configure a receive ring after Reset
+ * @adapter: board private structure
+@@ -2425,6 +2431,9 @@ void igb_configure_rx_ring(struct igb_adapter *adapter,
+
+ wr32(E1000_SRRCTL(reg_idx), srrctl);
+
++ /* set filtering for VMDQ pools */
++ igb_set_vmolr(adapter, reg_idx & 0x7);
++
+ /* enable receive descriptor fetching */
+ rxdctl = rd32(E1000_RXDCTL(reg_idx));
+ rxdctl |= E1000_RXDCTL_QUEUE_ENABLE;
+@@ -4101,6 +4110,45 @@ static void igb_ping_all_vfs(struct igb_adapter *adapter)
+ }
+ }
+
++static int igb_set_vf_promisc(struct igb_adapter *adapter, u32 *msgbuf, u32 vf)
++{
++ struct e1000_hw *hw = &adapter->hw;
++ u32 vmolr = rd32(E1000_VMOLR(vf));
++ struct vf_data_storage *vf_data = &adapter->vf_data[vf];
++
++ vf_data->flags |= ~(IGB_VF_FLAG_UNI_PROMISC |
++ IGB_VF_FLAG_MULTI_PROMISC);
++ vmolr &= ~(E1000_VMOLR_ROPE | E1000_VMOLR_ROMPE | E1000_VMOLR_MPME);
++
++ if (*msgbuf & E1000_VF_SET_PROMISC_MULTICAST) {
++ vmolr |= E1000_VMOLR_MPME;
++ *msgbuf &= ~E1000_VF_SET_PROMISC_MULTICAST;
++ } else {
++ /*
++ * if we have hashes and we are clearing a multicast promisc
++ * flag we need to write the hashes to the MTA as this step
++ * was previously skipped
++ */
++ if (vf_data->num_vf_mc_hashes > 30) {
++ vmolr |= E1000_VMOLR_MPME;
++ } else if (vf_data->num_vf_mc_hashes) {
++ int j;
++ vmolr |= E1000_VMOLR_ROMPE;
++ for (j = 0; j < vf_data->num_vf_mc_hashes; j++)
++ igb_mta_set(hw, vf_data->vf_mc_hashes[j]);
++ }
++ }
++
++ wr32(E1000_VMOLR(vf), vmolr);
++
++ /* there are flags left unprocessed, likely not supported */
++ if (*msgbuf & E1000_VT_MSGINFO_MASK)
++ return -EINVAL;
++
++ return 0;
++
++}
++
+ static int igb_set_vf_multicasts(struct igb_adapter *adapter,
+ u32 *msgbuf, u32 vf)
+ {
+@@ -4109,18 +4157,17 @@ static int igb_set_vf_multicasts(struct igb_adapter *adapter,
+ struct vf_data_storage *vf_data = &adapter->vf_data[vf];
+ int i;
+
+- /* only up to 30 hash values supported */
+- if (n > 30)
+- n = 30;
+-
+- /* salt away the number of multi cast addresses assigned
++ /* salt away the number of multicast addresses assigned
+ * to this VF for later use to restore when the PF multi cast
+ * list changes
+ */
+ vf_data->num_vf_mc_hashes = n;
+
+- /* VFs are limited to using the MTA hash table for their multicast
+- * addresses */
++ /* only up to 30 hash values supported */
++ if (n > 30)
++ n = 30;
++
++ /* store the hashes for later use */
+ for (i = 0; i < n; i++)
+ vf_data->vf_mc_hashes[i] = hash_list[i];
+
+@@ -4137,9 +4184,20 @@ static void igb_restore_vf_multicasts(struct igb_adapter *adapter)
+ int i, j;
+
+ for (i = 0; i < adapter->vfs_allocated_count; i++) {
++ u32 vmolr = rd32(E1000_VMOLR(i));
++ vmolr &= ~(E1000_VMOLR_ROMPE | E1000_VMOLR_MPME);
++
+ vf_data = &adapter->vf_data[i];
+- for (j = 0; j < vf_data->num_vf_mc_hashes; j++)
+- igb_mta_set(hw, vf_data->vf_mc_hashes[j]);
++
++ if ((vf_data->num_vf_mc_hashes > 30) ||
++ (vf_data->flags & IGB_VF_FLAG_MULTI_PROMISC)) {
++ vmolr |= E1000_VMOLR_MPME;
++ } else if (vf_data->num_vf_mc_hashes) {
++ vmolr |= E1000_VMOLR_ROMPE;
++ for (j = 0; j < vf_data->num_vf_mc_hashes; j++)
++ igb_mta_set(hw, vf_data->vf_mc_hashes[j]);
++ }
++ wr32(E1000_VMOLR(i), vmolr);
+ }
+ }
+
+@@ -4282,7 +4340,7 @@ static inline void igb_vf_reset(struct igb_adapter *adapter, u32 vf)
+ adapter->vf_data[vf].last_nack = jiffies;
+
+ /* reset offloads to defaults */
+- igb_set_vmolr(&adapter->hw, vf);
++ igb_set_vmolr(adapter, vf);
+
+ /* reset vlans for device */
+ igb_clear_vf_vfta(adapter, vf);
+@@ -4398,6 +4456,9 @@ static void igb_rcv_msg_from_vf(struct igb_adapter *adapter, u32 vf)
+ case E1000_VF_SET_MAC_ADDR:
+ retval = igb_set_vf_mac_addr(adapter, msgbuf, vf);
+ break;
++ case E1000_VF_SET_PROMISC:
++ retval = igb_set_vf_promisc(adapter, msgbuf, vf);
++ break;
+ case E1000_VF_SET_MULTICAST:
+ retval = igb_set_vf_multicasts(adapter, msgbuf, vf);
+ break;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0044-igb-rework-handling-of-the-vfta-and-vlvf-registers-i.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0044-igb-rework-handling-of-the-vfta-and-vlvf-registers-i.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,206 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 27 Oct 2009 23:47:35 +0000
+Subject: [PATCH 044/165] igb: rework handling of the vfta and vlvf registers
+ in relation to mng_vlan
+
+commit 51466239fb9f95343e88c14475a0f99fe4882c54 upstream.
+
+This patch corrects some errors in how vlans are being handled when vfs
+start interacting with the management vlans.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 96 +++++++++++++++-----------------------------
+ 1 files changed, 33 insertions(+), 63 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index d6f4075..f5ff282 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -963,24 +963,23 @@ static void igb_irq_enable(struct igb_adapter *adapter)
+
+ static void igb_update_mng_vlan(struct igb_adapter *adapter)
+ {
+- struct net_device *netdev = adapter->netdev;
++ struct e1000_hw *hw = &adapter->hw;
+ u16 vid = adapter->hw.mng_cookie.vlan_id;
+ u16 old_vid = adapter->mng_vlan_id;
+- if (adapter->vlgrp) {
+- if (!vlan_group_get_device(adapter->vlgrp, vid)) {
+- if (adapter->hw.mng_cookie.status &
+- E1000_MNG_DHCP_COOKIE_STATUS_VLAN) {
+- igb_vlan_rx_add_vid(netdev, vid);
+- adapter->mng_vlan_id = vid;
+- } else
+- adapter->mng_vlan_id = IGB_MNG_VLAN_NONE;
+
+- if ((old_vid != (u16)IGB_MNG_VLAN_NONE) &&
+- (vid != old_vid) &&
+- !vlan_group_get_device(adapter->vlgrp, old_vid))
+- igb_vlan_rx_kill_vid(netdev, old_vid);
+- } else
+- adapter->mng_vlan_id = vid;
++ if (hw->mng_cookie.status & E1000_MNG_DHCP_COOKIE_STATUS_VLAN) {
++ /* add VID to filter table */
++ igb_vfta_set(hw, vid, true);
++ adapter->mng_vlan_id = vid;
++ } else {
++ adapter->mng_vlan_id = IGB_MNG_VLAN_NONE;
++ }
++
++ if ((old_vid != (u16)IGB_MNG_VLAN_NONE) &&
++ (vid != old_vid) &&
++ !vlan_group_get_device(adapter->vlgrp, old_vid)) {
++ /* remove VID from filter table */
++ igb_vfta_set(hw, old_vid, false);
+ }
+ }
+
+@@ -1847,11 +1846,6 @@ static int igb_open(struct net_device *netdev)
+
+ /* e1000_power_up_phy(adapter); */
+
+- adapter->mng_vlan_id = IGB_MNG_VLAN_NONE;
+- if ((adapter->hw.mng_cookie.status &
+- E1000_MNG_DHCP_COOKIE_STATUS_VLAN))
+- igb_update_mng_vlan(adapter);
+-
+ /* before we allocate an interrupt, we must be ready to handle it.
+ * Setting DEBUG_SHIRQ in the kernel makes it fire an interrupt
+ * as soon as we call pci_request_irq, so we have to setup our
+@@ -1924,14 +1918,6 @@ static int igb_close(struct net_device *netdev)
+ igb_free_all_tx_resources(adapter);
+ igb_free_all_rx_resources(adapter);
+
+- /* kill manageability vlan ID if supported, but not if a vlan with
+- * the same ID is registered on the host OS (let 8021q kill it) */
+- if ((adapter->hw.mng_cookie.status &
+- E1000_MNG_DHCP_COOKIE_STATUS_VLAN) &&
+- !(adapter->vlgrp &&
+- vlan_group_get_device(adapter->vlgrp, adapter->mng_vlan_id)))
+- igb_vlan_rx_kill_vid(netdev, adapter->mng_vlan_id);
+-
+ return 0;
+ }
+
+@@ -4235,7 +4221,11 @@ static s32 igb_vlvf_set(struct igb_adapter *adapter, u32 vid, bool add, u32 vf)
+ struct e1000_hw *hw = &adapter->hw;
+ u32 reg, i;
+
+- /* It is an error to call this function when VFs are not enabled */
++ /* The vlvf table only exists on 82576 hardware and newer */
++ if (hw->mac.type < e1000_82576)
++ return -1;
++
++ /* we only need to do this if VMDq is enabled */
+ if (!adapter->vfs_allocated_count)
+ return -1;
+
+@@ -4265,16 +4255,12 @@ static s32 igb_vlvf_set(struct igb_adapter *adapter, u32 vid, bool add, u32 vf)
+
+ /* if !enabled we need to set this up in vfta */
+ if (!(reg & E1000_VLVF_VLANID_ENABLE)) {
+- /* add VID to filter table, if bit already set
+- * PF must have added it outside of table */
+- if (igb_vfta_set(hw, vid, true))
+- reg |= 1 << (E1000_VLVF_POOLSEL_SHIFT +
+- adapter->vfs_allocated_count);
++ /* add VID to filter table */
++ igb_vfta_set(hw, vid, true);
+ reg |= E1000_VLVF_VLANID_ENABLE;
+ }
+ reg &= ~E1000_VLVF_VLANID_MASK;
+ reg |= vid;
+-
+ wr32(E1000_VLVF(i), reg);
+
+ /* do not modify RLPML for PF devices */
+@@ -4290,8 +4276,8 @@ static s32 igb_vlvf_set(struct igb_adapter *adapter, u32 vid, bool add, u32 vf)
+ reg |= size;
+ wr32(E1000_VMOLR(vf), reg);
+ }
+- adapter->vf_data[vf].vlans_enabled++;
+
++ adapter->vf_data[vf].vlans_enabled++;
+ return 0;
+ }
+ } else {
+@@ -5393,21 +5379,15 @@ static void igb_vlan_rx_register(struct net_device *netdev,
+ ctrl |= E1000_CTRL_VME;
+ wr32(E1000_CTRL, ctrl);
+
+- /* enable VLAN receive filtering */
++ /* Disable CFI check */
+ rctl = rd32(E1000_RCTL);
+ rctl &= ~E1000_RCTL_CFIEN;
+ wr32(E1000_RCTL, rctl);
+- igb_update_mng_vlan(adapter);
+ } else {
+ /* disable VLAN tag insert/strip */
+ ctrl = rd32(E1000_CTRL);
+ ctrl &= ~E1000_CTRL_VME;
+ wr32(E1000_CTRL, ctrl);
+-
+- if (adapter->mng_vlan_id != (u16)IGB_MNG_VLAN_NONE) {
+- igb_vlan_rx_kill_vid(netdev, adapter->mng_vlan_id);
+- adapter->mng_vlan_id = IGB_MNG_VLAN_NONE;
+- }
+ }
+
+ igb_rlpml_set(adapter);
+@@ -5422,16 +5402,11 @@ static void igb_vlan_rx_add_vid(struct net_device *netdev, u16 vid)
+ struct e1000_hw *hw = &adapter->hw;
+ int pf_id = adapter->vfs_allocated_count;
+
+- if ((hw->mng_cookie.status &
+- E1000_MNG_DHCP_COOKIE_STATUS_VLAN) &&
+- (vid == adapter->mng_vlan_id))
+- return;
+-
+- /* add vid to vlvf if sr-iov is enabled,
+- * if that fails add directly to filter table */
+- if (igb_vlvf_set(adapter, vid, true, pf_id))
+- igb_vfta_set(hw, vid, true);
++ /* attempt to add filter to vlvf array */
++ igb_vlvf_set(adapter, vid, true, pf_id);
+
++ /* add the filter since PF can receive vlans w/o entry in vlvf */
++ igb_vfta_set(hw, vid, true);
+ }
+
+ static void igb_vlan_rx_kill_vid(struct net_device *netdev, u16 vid)
+@@ -5439,6 +5414,7 @@ static void igb_vlan_rx_kill_vid(struct net_device *netdev, u16 vid)
+ struct igb_adapter *adapter = netdev_priv(netdev);
+ struct e1000_hw *hw = &adapter->hw;
+ int pf_id = adapter->vfs_allocated_count;
++ s32 err;
+
+ igb_irq_disable(adapter);
+ vlan_group_set_device(adapter->vlgrp, vid, NULL);
+@@ -5446,17 +5422,11 @@ static void igb_vlan_rx_kill_vid(struct net_device *netdev, u16 vid)
+ if (!test_bit(__IGB_DOWN, &adapter->state))
+ igb_irq_enable(adapter);
+
+- if ((adapter->hw.mng_cookie.status &
+- E1000_MNG_DHCP_COOKIE_STATUS_VLAN) &&
+- (vid == adapter->mng_vlan_id)) {
+- /* release control to f/w */
+- igb_release_hw_control(adapter);
+- return;
+- }
++ /* remove vlan from VLVF table array */
++ err = igb_vlvf_set(adapter, vid, false, pf_id);
+
+- /* remove vid from vlvf if sr-iov is enabled,
+- * if not in vlvf remove from vfta */
+- if (igb_vlvf_set(adapter, vid, false, pf_id))
++ /* if vid was not present in VLVF just remove it from table */
++ if (err)
+ igb_vfta_set(hw, vid, false);
+ }
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0045-igb-move-vf-init-into-a-seperate-function.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0045-igb-move-vf-init-into-a-seperate-function.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,147 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 27 Oct 2009 23:47:53 +0000
+Subject: [PATCH 045/165] igb: move vf init into a seperate function
+
+commit a6b623e0e5787ba5ffd2a3c4448ff6d1eaa904a9 upstream.
+
+This patch moves VF initialization into a seperate function to help improve
+the readability of igb_probe.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 98 +++++++++++++++++++++++++-------------------
+ 1 files changed, 56 insertions(+), 42 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index f5ff282..5e6fa2d 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -1409,46 +1409,6 @@ static int __devinit igb_probe(struct pci_dev *pdev,
+ if (err)
+ goto err_sw_init;
+
+-#ifdef CONFIG_PCI_IOV
+- /* since iov functionality isn't critical to base device function we
+- * can accept failure. If it fails we don't allow iov to be enabled */
+- if (hw->mac.type == e1000_82576) {
+- /* 82576 supports a maximum of 7 VFs in addition to the PF */
+- unsigned int num_vfs = (max_vfs > 7) ? 7 : max_vfs;
+- int i;
+- unsigned char mac_addr[ETH_ALEN];
+-
+- if (num_vfs) {
+- adapter->vf_data = kcalloc(num_vfs,
+- sizeof(struct vf_data_storage),
+- GFP_KERNEL);
+- if (!adapter->vf_data) {
+- dev_err(&pdev->dev,
+- "Could not allocate VF private data - "
+- "IOV enable failed\n");
+- } else {
+- err = pci_enable_sriov(pdev, num_vfs);
+- if (!err) {
+- adapter->vfs_allocated_count = num_vfs;
+- dev_info(&pdev->dev,
+- "%d vfs allocated\n",
+- num_vfs);
+- for (i = 0;
+- i < adapter->vfs_allocated_count;
+- i++) {
+- random_ether_addr(mac_addr);
+- igb_set_vf_mac(adapter, i,
+- mac_addr);
+- }
+- } else {
+- kfree(adapter->vf_data);
+- adapter->vf_data = NULL;
+- }
+- }
+- }
+- }
+-
+-#endif
+ /* setup the private structure */
+ err = igb_sw_init(adapter);
+ if (err)
+@@ -1772,6 +1732,54 @@ static void __devexit igb_remove(struct pci_dev *pdev)
+ }
+
+ /**
++ * igb_probe_vfs - Initialize vf data storage and add VFs to pci config space
++ * @adapter: board private structure to initialize
++ *
++ * This function initializes the vf specific data storage and then attempts to
++ * allocate the VFs. The reason for ordering it this way is because it is much
++ * mor expensive time wise to disable SR-IOV than it is to allocate and free
++ * the memory for the VFs.
++ **/
++static void __devinit igb_probe_vfs(struct igb_adapter * adapter)
++{
++#ifdef CONFIG_PCI_IOV
++ struct pci_dev *pdev = adapter->pdev;
++
++ if (adapter->vfs_allocated_count > 7)
++ adapter->vfs_allocated_count = 7;
++
++ if (adapter->vfs_allocated_count) {
++ adapter->vf_data = kcalloc(adapter->vfs_allocated_count,
++ sizeof(struct vf_data_storage),
++ GFP_KERNEL);
++ /* if allocation failed then we do not support SR-IOV */
++ if (!adapter->vf_data) {
++ adapter->vfs_allocated_count = 0;
++ dev_err(&pdev->dev, "Unable to allocate memory for VF "
++ "Data Storage\n");
++ }
++ }
++
++ if (pci_enable_sriov(pdev, adapter->vfs_allocated_count)) {
++ kfree(adapter->vf_data);
++ adapter->vf_data = NULL;
++#endif /* CONFIG_PCI_IOV */
++ adapter->vfs_allocated_count = 0;
++#ifdef CONFIG_PCI_IOV
++ } else {
++ unsigned char mac_addr[ETH_ALEN];
++ int i;
++ dev_info(&pdev->dev, "%d vfs allocated\n",
++ adapter->vfs_allocated_count);
++ for (i = 0; i < adapter->vfs_allocated_count; i++) {
++ random_ether_addr(mac_addr);
++ igb_set_vf_mac(adapter, i, mac_addr);
++ }
++ }
++#endif /* CONFIG_PCI_IOV */
++}
++
++/**
+ * igb_sw_init - Initialize general software structures (struct igb_adapter)
+ * @adapter: board private structure to initialize
+ *
+@@ -1795,13 +1803,19 @@ static int __devinit igb_sw_init(struct igb_adapter *adapter)
+ adapter->max_frame_size = netdev->mtu + ETH_HLEN + ETH_FCS_LEN;
+ adapter->min_frame_size = ETH_ZLEN + ETH_FCS_LEN;
+
+- /* This call may decrease the number of queues depending on
+- * interrupt mode. */
++#ifdef CONFIG_PCI_IOV
++ if (hw->mac.type == e1000_82576)
++ adapter->vfs_allocated_count = max_vfs;
++
++#endif /* CONFIG_PCI_IOV */
++ /* This call may decrease the number of queues */
+ if (igb_init_interrupt_scheme(adapter)) {
+ dev_err(&pdev->dev, "Unable to allocate memory for queues\n");
+ return -ENOMEM;
+ }
+
++ igb_probe_vfs(adapter);
++
+ /* Explicitly disable IRQ since the NIC can be in any state. */
+ igb_irq_disable(adapter);
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0046-igb-only-process-global-stats-in-igb_update_stats.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0046-igb-only-process-global-stats-in-igb_update_stats.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,128 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 27 Oct 2009 23:48:12 +0000
+Subject: [PATCH 046/165] igb: only process global stats in igb_update_stats
+
+commit 3f9c01648146a256d8238292ac9c63fed7e00473 upstream.
+
+This patch moves the update of adapter->net_stats.rx/tx values out of the
+interrupt routine and into igb_update_stats by just adding together the
+tx/rx byte/packet counts for the rings.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 61 +++++++++++++++++++++-----------------------
+ 1 files changed, 29 insertions(+), 32 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 5e6fa2d..1ce859d 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -3769,7 +3769,10 @@ void igb_update_stats(struct igb_adapter *adapter)
+ struct net_device *netdev = adapter->netdev;
+ struct e1000_hw *hw = &adapter->hw;
+ struct pci_dev *pdev = adapter->pdev;
++ u32 rnbc;
+ u16 phy_tmp;
++ int i;
++ u64 bytes, packets;
+
+ #define PHY_IDLE_ERROR_COUNT_MASK 0x00FF
+
+@@ -3782,6 +3785,29 @@ void igb_update_stats(struct igb_adapter *adapter)
+ if (pci_channel_offline(pdev))
+ return;
+
++ bytes = 0;
++ packets = 0;
++ for (i = 0; i < adapter->num_rx_queues; i++) {
++ u32 rqdpc_tmp = rd32(E1000_RQDPC(i)) & 0x0FFF;
++ adapter->rx_ring[i].rx_stats.drops += rqdpc_tmp;
++ netdev->stats.rx_fifo_errors += rqdpc_tmp;
++ bytes += adapter->rx_ring[i].rx_stats.bytes;
++ packets += adapter->rx_ring[i].rx_stats.packets;
++ }
++
++ netdev->stats.rx_bytes = bytes;
++ netdev->stats.rx_packets = packets;
++
++ bytes = 0;
++ packets = 0;
++ for (i = 0; i < adapter->num_tx_queues; i++) {
++ bytes += adapter->tx_ring[i].tx_stats.bytes;
++ packets += adapter->tx_ring[i].tx_stats.packets;
++ }
++ netdev->stats.tx_bytes = bytes;
++ netdev->stats.tx_packets = packets;
++
++ /* read stats registers */
+ adapter->stats.crcerrs += rd32(E1000_CRCERRS);
+ adapter->stats.gprc += rd32(E1000_GPRC);
+ adapter->stats.gorc += rd32(E1000_GORCL);
+@@ -3814,7 +3840,9 @@ void igb_update_stats(struct igb_adapter *adapter)
+ adapter->stats.gptc += rd32(E1000_GPTC);
+ adapter->stats.gotc += rd32(E1000_GOTCL);
+ rd32(E1000_GOTCH); /* clear GOTCL */
+- adapter->stats.rnbc += rd32(E1000_RNBC);
++ rnbc = rd32(E1000_RNBC);
++ adapter->stats.rnbc += rnbc;
++ netdev->stats.rx_fifo_errors += rnbc;
+ adapter->stats.ruc += rd32(E1000_RUC);
+ adapter->stats.rfc += rd32(E1000_RFC);
+ adapter->stats.rjc += rd32(E1000_RJC);
+@@ -3861,33 +3889,6 @@ void igb_update_stats(struct igb_adapter *adapter)
+
+ /* Rx Errors */
+
+- if (hw->mac.type != e1000_82575) {
+- u32 rqdpc_tmp;
+- u64 rqdpc_total = 0;
+- int i;
+- /* Read out drops stats per RX queue. Notice RQDPC (Receive
+- * Queue Drop Packet Count) stats only gets incremented, if
+- * the DROP_EN but it set (in the SRRCTL register for that
+- * queue). If DROP_EN bit is NOT set, then the some what
+- * equivalent count is stored in RNBC (not per queue basis).
+- * Also note the drop count is due to lack of available
+- * descriptors.
+- */
+- for (i = 0; i < adapter->num_rx_queues; i++) {
+- rqdpc_tmp = rd32(E1000_RQDPC(i)) & 0xFFF;
+- adapter->rx_ring[i].rx_stats.drops += rqdpc_tmp;
+- rqdpc_total += adapter->rx_ring[i].rx_stats.drops;
+- }
+- netdev->stats.rx_fifo_errors = rqdpc_total;
+- }
+-
+- /* Note RNBC (Receive No Buffers Count) is an not an exact
+- * drop count as the hardware FIFO might save the day. Thats
+- * one of the reason for saving it in rx_fifo_errors, as its
+- * potentially not a true drop.
+- */
+- netdev->stats.rx_fifo_errors += adapter->stats.rnbc;
+-
+ /* RLEC on some newer hardware can be incorrect so build
+ * our own version based on RUC and ROC */
+ netdev->stats.rx_errors = adapter->stats.rxerrc +
+@@ -4818,8 +4819,6 @@ static bool igb_clean_tx_irq(struct igb_q_vector *q_vector)
+ tx_ring->total_packets += total_packets;
+ tx_ring->tx_stats.bytes += total_bytes;
+ tx_ring->tx_stats.packets += total_packets;
+- netdev->stats.tx_bytes += total_bytes;
+- netdev->stats.tx_packets += total_packets;
+ return (count < tx_ring->count);
+ }
+
+@@ -5043,8 +5042,6 @@ next_desc:
+ rx_ring->total_bytes += total_bytes;
+ rx_ring->rx_stats.packets += total_packets;
+ rx_ring->rx_stats.bytes += total_bytes;
+- netdev->stats.rx_bytes += total_bytes;
+- netdev->stats.rx_packets += total_packets;
+ return cleaned;
+ }
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0047-igb-move-global_quad_port_a-from-global-into-local-s.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0047-igb-move-global_quad_port_a-from-global-into-local-s.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,59 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 27 Oct 2009 23:48:31 +0000
+Subject: [PATCH 047/165] igb: move global_quad_port_a from global into local
+ static define
+
+commit 4337e993e13eb2f2e05dd65a3ab25b57c2f89d56 upstream.
+
+This change moves global_quad_port_a into igb_probe as a static define
+since it doesn't actually need to be global.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 8 ++------
+ 1 files changed, 2 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 1ce859d..942fb3e 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -179,8 +179,6 @@ static struct pci_driver igb_driver = {
+ .err_handler = &igb_err_handler
+ };
+
+-static int global_quad_port_a; /* global quad port a indication */
+-
+ MODULE_AUTHOR("Intel Corporation, <e1000-devel at lists.sourceforge.net>");
+ MODULE_DESCRIPTION("Intel(R) Gigabit Ethernet Network Driver");
+ MODULE_LICENSE("GPL");
+@@ -252,12 +250,9 @@ static int __init igb_init_module(void)
+
+ printk(KERN_INFO "%s\n", igb_copyright);
+
+- global_quad_port_a = 0;
+-
+ #ifdef CONFIG_IGB_DCA
+ dca_register_notify(&dca_notifier);
+ #endif
+-
+ ret = pci_register_driver(&igb_driver);
+ return ret;
+ }
+@@ -1318,10 +1313,11 @@ static int __devinit igb_probe(struct pci_dev *pdev,
+ struct net_device *netdev;
+ struct igb_adapter *adapter;
+ struct e1000_hw *hw;
++ u16 eeprom_data = 0;
++ static int global_quad_port_a; /* global quad port a indication */
+ const struct e1000_info *ei = igb_info_tbl[ent->driver_data];
+ unsigned long mmio_start, mmio_len;
+ int err, pci_using_dac;
+- u16 eeprom_data = 0;
+ u16 eeprom_apme_mask = IGB_EEPROM_APME;
+ u32 part_num;
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0048-igb-make-tx-hang-check-multiqueue-check-eop-descript.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0048-igb-make-tx-hang-check-multiqueue-check-eop-descript.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,63 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 27 Oct 2009 23:48:51 +0000
+Subject: [PATCH 048/165] igb: make tx hang check multiqueue, check eop
+ descriptor
+
+commit f7ba205e823f32e634712323a221b42bfea06efa upstream.
+
+This change makes the tx hang check run over all tx queues instead of just
+queue 0. Also have hang display info on EOP descriptor instead of the
+descriptor at the start of the chain.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 10 ++++++----
+ 1 files changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 942fb3e..b794b3c 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -3002,6 +3002,10 @@ link_up:
+ }
+ }
+
++ /* Force detection of hung controller every watchdog period */
++ for (i = 0; i < adapter->num_tx_queues; i++)
++ adapter->tx_ring[i].detect_tx_hung = true;
++
+ /* Cause software interrupt to ensure rx ring is cleaned */
+ if (adapter->msix_entries) {
+ u32 eics = 0;
+@@ -3014,9 +3018,6 @@ link_up:
+ wr32(E1000_ICS, E1000_ICS_RXDMT0);
+ }
+
+- /* Force detection of hung controller every watchdog period */
+- tx_ring->detect_tx_hung = true;
+-
+ /* Reset the timer */
+ if (!test_bit(__IGB_DOWN, &adapter->state))
+ mod_timer(&adapter->watchdog_timer,
+@@ -3667,6 +3668,7 @@ static void igb_tx_timeout(struct net_device *netdev)
+
+ /* Do the reset outside of interrupt context */
+ adapter->tx_timeout_count++;
++
+ schedule_work(&adapter->reset_task);
+ wr32(E1000_EICS,
+ (adapter->eims_enable_mask & ~adapter->eims_other));
+@@ -4804,7 +4806,7 @@ static bool igb_clean_tx_irq(struct igb_q_vector *q_vector)
+ readl(tx_ring->tail),
+ tx_ring->next_to_use,
+ tx_ring->next_to_clean,
+- tx_ring->buffer_info[i].time_stamp,
++ tx_ring->buffer_info[eop].time_stamp,
+ eop,
+ jiffies,
+ eop_desc->wb.status);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0049-igb-cleanup-code-related-to-ring-resource-allocation.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0049-igb-cleanup-code-related-to-ring-resource-allocation.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,137 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 27 Oct 2009 23:49:20 +0000
+Subject: [PATCH 049/165] igb: cleanup code related to ring resource
+ allocation and free
+
+commit 439705e1d7281cc8a4631a2dc390df7ad868bad8 upstream.
+
+This patch cleans up some of the ring alloc and free code to better handle
+exceptions such as attempting to free resources on an already freed ring.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 29 +++++++++++++++++------------
+ 1 files changed, 17 insertions(+), 12 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index b794b3c..340b295 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -1952,7 +1952,8 @@ int igb_setup_tx_resources(struct igb_ring *tx_ring)
+ tx_ring->size = tx_ring->count * sizeof(union e1000_adv_tx_desc);
+ tx_ring->size = ALIGN(tx_ring->size, 4096);
+
+- tx_ring->desc = pci_alloc_consistent(pdev, tx_ring->size,
++ tx_ring->desc = pci_alloc_consistent(pdev,
++ tx_ring->size,
+ &tx_ring->dma);
+
+ if (!tx_ring->desc)
+@@ -1978,13 +1979,13 @@ err:
+ **/
+ static int igb_setup_all_tx_resources(struct igb_adapter *adapter)
+ {
++ struct pci_dev *pdev = adapter->pdev;
+ int i, err = 0;
+- int r_idx;
+
+ for (i = 0; i < adapter->num_tx_queues; i++) {
+ err = igb_setup_tx_resources(&adapter->tx_ring[i]);
+ if (err) {
+- dev_err(&adapter->pdev->dev,
++ dev_err(&pdev->dev,
+ "Allocation for Tx Queue %u failed\n", i);
+ for (i--; i >= 0; i--)
+ igb_free_tx_resources(&adapter->tx_ring[i]);
+@@ -1993,7 +1994,7 @@ static int igb_setup_all_tx_resources(struct igb_adapter *adapter)
+ }
+
+ for (i = 0; i < IGB_MAX_TX_QUEUES; i++) {
+- r_idx = i % adapter->num_tx_queues;
++ int r_idx = i % adapter->num_tx_queues;
+ adapter->multi_tx_table[i] = &adapter->tx_ring[r_idx];
+ }
+ return err;
+@@ -2116,6 +2117,7 @@ int igb_setup_rx_resources(struct igb_ring *rx_ring)
+
+ err:
+ vfree(rx_ring->buffer_info);
++ rx_ring->buffer_info = NULL;
+ dev_err(&pdev->dev, "Unable to allocate memory for "
+ "the receive descriptor ring\n");
+ return -ENOMEM;
+@@ -2130,12 +2132,13 @@ err:
+ **/
+ static int igb_setup_all_rx_resources(struct igb_adapter *adapter)
+ {
++ struct pci_dev *pdev = adapter->pdev;
+ int i, err = 0;
+
+ for (i = 0; i < adapter->num_rx_queues; i++) {
+ err = igb_setup_rx_resources(&adapter->rx_ring[i]);
+ if (err) {
+- dev_err(&adapter->pdev->dev,
++ dev_err(&pdev->dev,
+ "Allocation for Rx Queue %u failed\n", i);
+ for (i--; i >= 0; i--)
+ igb_free_rx_resources(&adapter->rx_ring[i]);
+@@ -2476,6 +2479,10 @@ void igb_free_tx_resources(struct igb_ring *tx_ring)
+ vfree(tx_ring->buffer_info);
+ tx_ring->buffer_info = NULL;
+
++ /* if not set, then don't free */
++ if (!tx_ring->desc)
++ return;
++
+ pci_free_consistent(tx_ring->pdev, tx_ring->size,
+ tx_ring->desc, tx_ring->dma);
+
+@@ -2534,14 +2541,10 @@ static void igb_clean_tx_ring(struct igb_ring *tx_ring)
+ memset(tx_ring->buffer_info, 0, size);
+
+ /* Zero out the descriptor ring */
+-
+ memset(tx_ring->desc, 0, tx_ring->size);
+
+ tx_ring->next_to_use = 0;
+ tx_ring->next_to_clean = 0;
+-
+- writel(0, tx_ring->head);
+- writel(0, tx_ring->tail);
+ }
+
+ /**
+@@ -2569,6 +2572,10 @@ void igb_free_rx_resources(struct igb_ring *rx_ring)
+ vfree(rx_ring->buffer_info);
+ rx_ring->buffer_info = NULL;
+
++ /* if not set, then don't free */
++ if (!rx_ring->desc)
++ return;
++
+ pci_free_consistent(rx_ring->pdev, rx_ring->size,
+ rx_ring->desc, rx_ring->dma);
+
+@@ -2601,6 +2608,7 @@ static void igb_clean_rx_ring(struct igb_ring *rx_ring)
+
+ if (!rx_ring->buffer_info)
+ return;
++
+ /* Free all the Rx ring sk_buffs */
+ for (i = 0; i < rx_ring->count; i++) {
+ buffer_info = &rx_ring->buffer_info[i];
+@@ -2638,9 +2646,6 @@ static void igb_clean_rx_ring(struct igb_ring *rx_ring)
+
+ rx_ring->next_to_clean = 0;
+ rx_ring->next_to_use = 0;
+-
+- writel(0, rx_ring->head);
+- writel(0, rx_ring->tail);
+ }
+
+ /**
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0050-igb-change-queue-ordering-for-82576-based-adapters.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0050-igb-change-queue-ordering-for-82576-based-adapters.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,65 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 27 Oct 2009 23:49:40 +0000
+Subject: [PATCH 050/165] igb: change queue ordering for 82576 based adapters
+
+commit ee1b9f06dca9c406b159904e9b13ea2dfa5ed037 upstream.
+
+This patch changes the queue ordering for 82576 adapters so that if VFs are
+enabled the queues will first be allocated out of the PF pool. Any
+remaining queues will be allocated out of other VMDq pools.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 25 +++++++++++++------------
+ 1 files changed, 13 insertions(+), 12 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 340b295..0fad094 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -285,7 +285,7 @@ module_exit(igb_exit_module);
+ **/
+ static void igb_cache_ring_register(struct igb_adapter *adapter)
+ {
+- int i;
++ int i = 0, j = 0;
+ u32 rbase_offset = adapter->vfs_allocated_count;
+
+ switch (adapter->hw.mac.type) {
+@@ -295,19 +295,20 @@ static void igb_cache_ring_register(struct igb_adapter *adapter)
+ * In order to avoid collision we start at the first free queue
+ * and continue consuming queues in the same sequence
+ */
+- for (i = 0; i < adapter->num_rx_queues; i++)
+- adapter->rx_ring[i].reg_idx = rbase_offset +
+- Q_IDX_82576(i);
+- for (i = 0; i < adapter->num_tx_queues; i++)
+- adapter->tx_ring[i].reg_idx = rbase_offset +
+- Q_IDX_82576(i);
+- break;
++ if (adapter->vfs_allocated_count) {
++ for (; i < adapter->num_rx_queues; i++)
++ adapter->rx_ring[i].reg_idx = rbase_offset +
++ Q_IDX_82576(i);
++ for (; j < adapter->num_tx_queues; j++)
++ adapter->tx_ring[j].reg_idx = rbase_offset +
++ Q_IDX_82576(j);
++ }
+ case e1000_82575:
+ default:
+- for (i = 0; i < adapter->num_rx_queues; i++)
+- adapter->rx_ring[i].reg_idx = i;
+- for (i = 0; i < adapter->num_tx_queues; i++)
+- adapter->tx_ring[i].reg_idx = i;
++ for (; i < adapter->num_rx_queues; i++)
++ adapter->rx_ring[i].reg_idx = rbase_offset + i;
++ for (; j < adapter->num_tx_queues; j++)
++ adapter->tx_ring[j].reg_idx = rbase_offset + j;
+ break;
+ }
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0051-igb-cleanup-interrupt-enablement-in-regards-to-msix_.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0051-igb-cleanup-interrupt-enablement-in-regards-to-msix_.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,98 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 27 Oct 2009 23:49:59 +0000
+Subject: [PATCH 051/165] igb: cleanup interrupt enablement in regards to
+ msix_other
+
+commit 25568a531a1bc76fdf968382a4eb65a979186c67 upstream.
+
+This patch changes a few things so that instead of firing a link status
+interrupt directly the get_link_status bit is set and the watchdog is
+scheduled. In addition the mailbox bit is now only enabled if VFs are
+enabled.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 31 +++++++++++++++++++++++--------
+ 1 files changed, 23 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 0fad094..915f2cc 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -919,6 +919,11 @@ static void igb_irq_disable(struct igb_adapter *adapter)
+ {
+ struct e1000_hw *hw = &adapter->hw;
+
++ /*
++ * we need to be careful when disabling interrupts. The VFs are also
++ * mapped into these registers and so clearing the bits can cause
++ * issues on the VF drivers so we only need to clear what we set
++ */
+ if (adapter->msix_entries) {
+ u32 regval = rd32(E1000_EIAM);
+ wr32(E1000_EIAM, regval & ~adapter->eims_enable_mask);
+@@ -942,15 +947,17 @@ static void igb_irq_enable(struct igb_adapter *adapter)
+ struct e1000_hw *hw = &adapter->hw;
+
+ if (adapter->msix_entries) {
++ u32 ims = E1000_IMS_LSC | E1000_IMS_DOUTSYNC;
+ u32 regval = rd32(E1000_EIAC);
+ wr32(E1000_EIAC, regval | adapter->eims_enable_mask);
+ regval = rd32(E1000_EIAM);
+ wr32(E1000_EIAM, regval | adapter->eims_enable_mask);
+ wr32(E1000_EIMS, adapter->eims_enable_mask);
+- if (adapter->vfs_allocated_count)
++ if (adapter->vfs_allocated_count) {
+ wr32(E1000_MBVFIMR, 0xFF);
+- wr32(E1000_IMS, (E1000_IMS_LSC | E1000_IMS_VMMB |
+- E1000_IMS_DOUTSYNC));
++ ims |= E1000_IMS_VMMB;
++ }
++ wr32(E1000_IMS, ims);
+ } else {
+ wr32(E1000_IMS, IMS_ENABLE_MASK);
+ wr32(E1000_IAM, IMS_ENABLE_MASK);
+@@ -1091,8 +1098,10 @@ int igb_up(struct igb_adapter *adapter)
+
+ netif_tx_start_all_queues(adapter->netdev);
+
+- /* Fire a link change interrupt to start the watchdog. */
+- wr32(E1000_ICS, E1000_ICS_LSC);
++ /* start the watchdog. */
++ hw->mac.get_link_status = 1;
++ schedule_work(&adapter->watchdog_task);
++
+ return 0;
+ }
+
+@@ -1889,8 +1898,9 @@ static int igb_open(struct net_device *netdev)
+
+ netif_tx_start_all_queues(netdev);
+
+- /* Fire a link status change interrupt to start the watchdog. */
+- wr32(E1000_ICS, E1000_ICS_LSC);
++ /* start the watchdog. */
++ hw->mac.get_link_status = 1;
++ schedule_work(&adapter->watchdog_task);
+
+ return 0;
+
+@@ -3952,7 +3962,12 @@ static irqreturn_t igb_msix_other(int irq, void *data)
+ mod_timer(&adapter->watchdog_timer, jiffies + 1);
+ }
+
+- wr32(E1000_IMS, E1000_IMS_LSC | E1000_IMS_DOUTSYNC | E1000_IMS_VMMB);
++ if (adapter->vfs_allocated_count)
++ wr32(E1000_IMS, E1000_IMS_LSC |
++ E1000_IMS_VMMB |
++ E1000_IMS_DOUTSYNC);
++ else
++ wr32(E1000_IMS, E1000_IMS_LSC | E1000_IMS_DOUTSYNC);
+ wr32(E1000_EIMS, adapter->eims_other);
+
+ return IRQ_HANDLED;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0052-igb-Remove-invalid-stats-counters.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0052-igb-Remove-invalid-stats-counters.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,89 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 27 Oct 2009 23:50:18 +0000
+Subject: [PATCH 052/165] igb: Remove invalid stats counters
+
+commit 645a3abd73c2ac05d375f080d2f58d56e1502562 upstream.
+
+There are several counters being used like they are static when in fact
+they are clear on read. In order to prevent the values from being
+incorrect I am removing the defunct counters.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb.h | 6 ------
+ drivers/net/igb/igb_main.c | 18 +-----------------
+ 2 files changed, 1 insertions(+), 23 deletions(-)
+
+diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
+index c27dc1a..b9fcfd3 100644
+--- a/drivers/net/igb/igb.h
++++ b/drivers/net/igb/igb.h
+@@ -269,10 +269,6 @@ struct igb_adapter {
+ /* TX */
+ struct igb_ring *tx_ring; /* One per active queue */
+ unsigned long tx_queue_len;
+- u32 gotc;
+- u64 gotc_old;
+- u64 tpt_old;
+- u64 colc_old;
+ u32 tx_timeout_count;
+
+ /* RX */
+@@ -280,8 +276,6 @@ struct igb_adapter {
+ int num_tx_queues;
+ int num_rx_queues;
+
+- u32 gorc;
+- u64 gorc_old;
+ u32 max_frame_size;
+ u32 min_frame_size;
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 915f2cc..0444ae9 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -2925,9 +2925,6 @@ static void igb_watchdog_task(struct work_struct *work)
+ int i;
+
+ link = igb_has_link(adapter);
+- if ((netif_carrier_ok(netdev)) && link)
+- goto link_up;
+-
+ if (link) {
+ if (!netif_carrier_ok(netdev)) {
+ u32 ctrl;
+@@ -2990,20 +2987,8 @@ static void igb_watchdog_task(struct work_struct *work)
+ }
+ }
+
+-link_up:
+ igb_update_stats(adapter);
+-
+- hw->mac.tx_packet_delta = adapter->stats.tpt - adapter->tpt_old;
+- adapter->tpt_old = adapter->stats.tpt;
+- hw->mac.collision_delta = adapter->stats.colc - adapter->colc_old;
+- adapter->colc_old = adapter->stats.colc;
+-
+- adapter->gorc = adapter->stats.gorc - adapter->gorc_old;
+- adapter->gorc_old = adapter->stats.gorc;
+- adapter->gotc = adapter->stats.gotc - adapter->gotc_old;
+- adapter->gotc_old = adapter->stats.gotc;
+-
+- igb_update_adaptive(&adapter->hw);
++ igb_update_adaptive(hw);
+
+ if (!netif_carrier_ok(netdev)) {
+ if (igb_desc_unused(tx_ring) + 1 < tx_ring->count) {
+@@ -3875,7 +3860,6 @@ void igb_update_stats(struct igb_adapter *adapter)
+ adapter->stats.bptc += rd32(E1000_BPTC);
+
+ /* used for adaptive IFS */
+-
+ hw->mac.tx_packet_delta = rd32(E1000_TPT);
+ adapter->stats.tpt += hw->mac.tx_packet_delta;
+ hw->mac.collision_delta = rd32(E1000_COLC);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0053-igb-cleanup-igb.h-header-whitespace-and-some-structu.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0053-igb-cleanup-igb.h-header-whitespace-and-some-structu.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,64 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 27 Oct 2009 23:50:38 +0000
+Subject: [PATCH 053/165] igb: cleanup igb.h header whitespace and some
+ structure formatting
+
+commit 2e5655e758736488abbe9c024c8cda0e367214e5 upstream.
+
+This patch changes the layout of the ring and adapter structs to fill a few
+holes in the structure. It also cleans up some whitespace and formatting
+issues.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb.h | 12 ++++++------
+ 1 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
+index b9fcfd3..3298f5a 100644
+--- a/drivers/net/igb/igb.h
++++ b/drivers/net/igb/igb.h
+@@ -185,16 +185,15 @@ struct igb_ring {
+ dma_addr_t dma; /* phys address of the ring */
+ void *desc; /* descriptor ring memory */
+ unsigned int size; /* length of desc. ring in bytes */
+- unsigned int count; /* number of desc. in the ring */
++ u16 count; /* number of desc. in the ring */
+ u16 next_to_use;
+ u16 next_to_clean;
++ u8 queue_index;
++ u8 reg_idx;
+ void __iomem *head;
+ void __iomem *tail;
+ struct igb_buffer *buffer_info; /* array of buffer info structs */
+
+- u8 queue_index;
+- u8 reg_idx;
+-
+ unsigned int total_bytes;
+ unsigned int total_packets;
+
+@@ -249,6 +248,7 @@ struct igb_adapter {
+ u32 en_mng_pt;
+ u16 link_speed;
+ u16 link_duplex;
++
+ unsigned int total_tx_bytes;
+ unsigned int total_tx_packets;
+ unsigned int total_rx_bytes;
+@@ -311,8 +311,8 @@ struct igb_adapter {
+ u32 eeprom_wol;
+
+ struct igb_ring *multi_tx_table[IGB_ABS_MAX_TX_QUEUES];
+- unsigned int tx_ring_count;
+- unsigned int rx_ring_count;
++ u16 tx_ring_count;
++ u16 rx_ring_count;
+ unsigned int vfs_allocated_count;
+ struct vf_data_storage *vf_data;
+ };
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0054-igb-cleanup-igb-xmit-frame-path.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0054-igb-cleanup-igb-xmit-frame-path.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,130 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 27 Oct 2009 23:50:57 +0000
+Subject: [PATCH 054/165] igb: cleanup igb xmit frame path
+
+commit cdfd01fcc674cc1c0c7b54084d74c2b684bf67c2 upstream.
+
+This patch cleans up the xmit frame path for igb to better handle xmit
+frame errors and avoid null pointer exceptions. It also cleans up some
+whitespace issues found in the xmit frame path.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 30 +++++++++++++++---------------
+ 1 files changed, 15 insertions(+), 15 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 0444ae9..5e02964 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -3245,9 +3245,9 @@ set_itr_now:
+ #define IGB_TX_FLAGS_VLAN 0x00000002
+ #define IGB_TX_FLAGS_TSO 0x00000004
+ #define IGB_TX_FLAGS_IPV4 0x00000008
+-#define IGB_TX_FLAGS_TSTAMP 0x00000010
+-#define IGB_TX_FLAGS_VLAN_MASK 0xffff0000
+-#define IGB_TX_FLAGS_VLAN_SHIFT 16
++#define IGB_TX_FLAGS_TSTAMP 0x00000010
++#define IGB_TX_FLAGS_VLAN_MASK 0xffff0000
++#define IGB_TX_FLAGS_VLAN_SHIFT 16
+
+ static inline int igb_tso_adv(struct igb_ring *tx_ring,
+ struct sk_buff *skb, u32 tx_flags, u8 *hdr_len)
+@@ -3346,6 +3346,7 @@ static inline bool igb_tx_csum_adv(struct igb_ring *tx_ring,
+
+ if (tx_flags & IGB_TX_FLAGS_VLAN)
+ info |= (tx_flags & IGB_TX_FLAGS_VLAN_MASK);
++
+ info |= (skb_network_offset(skb) << E1000_ADVTXD_MACLEN_SHIFT);
+ if (skb->ip_summed == CHECKSUM_PARTIAL)
+ info |= skb_network_header_len(skb);
+@@ -3462,17 +3463,17 @@ static inline int igb_tx_map_adv(struct igb_ring *tx_ring, struct sk_buff *skb,
+ tx_ring->buffer_info[i].skb = skb;
+ tx_ring->buffer_info[first].next_to_watch = i;
+
+- return count + 1;
++ return ++count;
+ }
+
+ static inline void igb_tx_queue_adv(struct igb_ring *tx_ring,
+ int tx_flags, int count, u32 paylen,
+ u8 hdr_len)
+ {
+- union e1000_adv_tx_desc *tx_desc = NULL;
++ union e1000_adv_tx_desc *tx_desc;
+ struct igb_buffer *buffer_info;
+ u32 olinfo_status = 0, cmd_type_len;
+- unsigned int i;
++ unsigned int i = tx_ring->next_to_use;
+
+ cmd_type_len = (E1000_ADVTXD_DTYP_DATA | E1000_ADVTXD_DCMD_IFCS |
+ E1000_ADVTXD_DCMD_DEXT);
+@@ -3505,18 +3506,18 @@ static inline void igb_tx_queue_adv(struct igb_ring *tx_ring,
+
+ olinfo_status |= ((paylen - hdr_len) << E1000_ADVTXD_PAYLEN_SHIFT);
+
+- i = tx_ring->next_to_use;
+- while (count--) {
++ do {
+ buffer_info = &tx_ring->buffer_info[i];
+ tx_desc = E1000_TX_DESC_ADV(*tx_ring, i);
+ tx_desc->read.buffer_addr = cpu_to_le64(buffer_info->dma);
+ tx_desc->read.cmd_type_len =
+ cpu_to_le32(cmd_type_len | buffer_info->length);
+ tx_desc->read.olinfo_status = cpu_to_le32(olinfo_status);
++ count--;
+ i++;
+ if (i == tx_ring->count)
+ i = 0;
+- }
++ } while (count > 0);
+
+ tx_desc->read.cmd_type_len |= cpu_to_le32(IGB_ADVTXD_DCMD);
+ /* Force memory writes to complete before letting h/w
+@@ -3568,8 +3569,7 @@ netdev_tx_t igb_xmit_frame_ring_adv(struct sk_buff *skb,
+ unsigned int first;
+ unsigned int tx_flags = 0;
+ u8 hdr_len = 0;
+- int count = 0;
+- int tso = 0;
++ int tso = 0, count;
+ union skb_shared_tx *shtx = skb_tx(skb);
+
+ /* need: 1 descriptor per page,
+@@ -3587,7 +3587,7 @@ netdev_tx_t igb_xmit_frame_ring_adv(struct sk_buff *skb,
+ tx_flags |= IGB_TX_FLAGS_TSTAMP;
+ }
+
+- if (adapter->vlgrp && vlan_tx_tag_present(skb)) {
++ if (vlan_tx_tag_present(skb) && adapter->vlgrp) {
+ tx_flags |= IGB_TX_FLAGS_VLAN;
+ tx_flags |= (vlan_tx_tag_get(skb) << IGB_TX_FLAGS_VLAN_SHIFT);
+ }
+@@ -3598,6 +3598,7 @@ netdev_tx_t igb_xmit_frame_ring_adv(struct sk_buff *skb,
+ first = tx_ring->next_to_use;
+ if (skb_is_gso(skb)) {
+ tso = igb_tso_adv(tx_ring, skb, tx_flags, &hdr_len);
++
+ if (tso < 0) {
+ dev_kfree_skb_any(skb);
+ return NETDEV_TX_OK;
+@@ -3611,12 +3612,11 @@ netdev_tx_t igb_xmit_frame_ring_adv(struct sk_buff *skb,
+ tx_flags |= IGB_TX_FLAGS_CSUM;
+
+ /*
+- * count reflects descriptors mapped, if 0 then mapping error
++ * count reflects descriptors mapped, if 0 or less then mapping error
+ * has occured and we need to rewind the descriptor queue
+ */
+ count = igb_tx_map_adv(tx_ring, skb, first);
+-
+- if (!count) {
++ if (count <= 0) {
+ dev_kfree_skb_any(skb);
+ tx_ring->buffer_info[first].time_stamp = 0;
+ tx_ring->next_to_use = first;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0055-igb-cleanup-clean_rx_irq_adv-and-alloc_rx_buffers_ad.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0055-igb-cleanup-clean_rx_irq_adv-and-alloc_rx_buffers_ad.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,97 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 27 Oct 2009 23:51:16 +0000
+Subject: [PATCH 055/165] igb: cleanup clean_rx_irq_adv and
+ alloc_rx_buffers_adv
+
+commit 42d0781a1337ec5624da0657ba57b734768f489c upstream.
+
+This patch cleans up some whitespace issues in clean_rx_irq_adv. It also
+adds NUMA aware page allocation and dma error handling to
+alloc_rx_buffers_adv.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 24 +++++++++++++++++++-----
+ 1 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 5e02964..3c270b1 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -4952,6 +4952,7 @@ static bool igb_clean_rx_irq_adv(struct igb_q_vector *q_vector,
+ i++;
+ if (i == rx_ring->count)
+ i = 0;
++
+ next_rxd = E1000_RX_DESC_ADV(*rx_ring, i);
+ prefetch(next_rxd);
+ next_buffer = &rx_ring->buffer_info[i];
+@@ -4989,7 +4990,6 @@ static bool igb_clean_rx_irq_adv(struct igb_q_vector *q_vector,
+
+ skb->len += length;
+ skb->data_len += length;
+-
+ skb->truesize += length;
+ }
+
+@@ -5071,7 +5071,7 @@ void igb_alloc_rx_buffers_adv(struct igb_ring *rx_ring, int cleaned_count)
+
+ if ((bufsz < IGB_RXBUFFER_1024) && !buffer_info->page_dma) {
+ if (!buffer_info->page) {
+- buffer_info->page = alloc_page(GFP_ATOMIC);
++ buffer_info->page = netdev_alloc_page(netdev);
+ if (!buffer_info->page) {
+ rx_ring->rx_stats.alloc_failed++;
+ goto no_buffers;
+@@ -5085,9 +5085,16 @@ void igb_alloc_rx_buffers_adv(struct igb_ring *rx_ring, int cleaned_count)
+ buffer_info->page_offset,
+ PAGE_SIZE / 2,
+ PCI_DMA_FROMDEVICE);
++ if (pci_dma_mapping_error(rx_ring->pdev,
++ buffer_info->page_dma)) {
++ buffer_info->page_dma = 0;
++ rx_ring->rx_stats.alloc_failed++;
++ goto no_buffers;
++ }
+ }
+
+- if (!buffer_info->skb) {
++ skb = buffer_info->skb;
++ if (!skb) {
+ skb = netdev_alloc_skb_ip_align(netdev, bufsz);
+ if (!skb) {
+ rx_ring->rx_stats.alloc_failed++;
+@@ -5095,10 +5102,18 @@ void igb_alloc_rx_buffers_adv(struct igb_ring *rx_ring, int cleaned_count)
+ }
+
+ buffer_info->skb = skb;
++ }
++ if (!buffer_info->dma) {
+ buffer_info->dma = pci_map_single(rx_ring->pdev,
+ skb->data,
+ bufsz,
+ PCI_DMA_FROMDEVICE);
++ if (pci_dma_mapping_error(rx_ring->pdev,
++ buffer_info->dma)) {
++ buffer_info->dma = 0;
++ rx_ring->rx_stats.alloc_failed++;
++ goto no_buffers;
++ }
+ }
+ /* Refresh the desc even if buffer_addrs didn't change because
+ * each write-back erases this info. */
+@@ -5107,8 +5122,7 @@ void igb_alloc_rx_buffers_adv(struct igb_ring *rx_ring, int cleaned_count)
+ cpu_to_le64(buffer_info->page_dma);
+ rx_desc->read.hdr_addr = cpu_to_le64(buffer_info->dma);
+ } else {
+- rx_desc->read.pkt_addr =
+- cpu_to_le64(buffer_info->dma);
++ rx_desc->read.pkt_addr = cpu_to_le64(buffer_info->dma);
+ rx_desc->read.hdr_addr = 0;
+ }
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0056-igb-replace-unecessary-adapter-hw-with-just-hw-where.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0056-igb-replace-unecessary-adapter-hw-with-just-hw-where.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,109 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 27 Oct 2009 23:51:35 +0000
+Subject: [PATCH 056/165] igb: replace unecessary &adapter->hw with just hw
+ where applicable
+
+commit 330a6d6a7c75e11ca6da52092cfa96cda45d3386 upstream.
+
+This patch just cleans up some unecessary references to the adapter->hw
+member when it has already been placed in a local variable named hw.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 26 ++++++++++++--------------
+ 1 files changed, 12 insertions(+), 14 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 3c270b1..c707cbc 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -1107,8 +1107,8 @@ int igb_up(struct igb_adapter *adapter)
+
+ void igb_down(struct igb_adapter *adapter)
+ {
+- struct e1000_hw *hw = &adapter->hw;
+ struct net_device *netdev = adapter->netdev;
++ struct e1000_hw *hw = &adapter->hw;
+ u32 tctl, rctl;
+ int i;
+
+@@ -1271,10 +1271,10 @@ void igb_reset(struct igb_adapter *adapter)
+ }
+
+ /* Allow time for pending master requests to run */
+- adapter->hw.mac.ops.reset_hw(&adapter->hw);
++ hw->mac.ops.reset_hw(hw);
+ wr32(E1000_WUC, 0);
+
+- if (adapter->hw.mac.ops.init_hw(&adapter->hw))
++ if (hw->mac.ops.init_hw(hw))
+ dev_err(&adapter->pdev->dev, "Hardware Error\n");
+
+ igb_update_mng_vlan(adapter);
+@@ -1282,8 +1282,8 @@ void igb_reset(struct igb_adapter *adapter)
+ /* Enable h/w to recognize an 802.1Q VLAN Ethernet packet */
+ wr32(E1000_VET, ETHERNET_IEEE_VLAN_TYPE);
+
+- igb_reset_adaptive(&adapter->hw);
+- igb_get_phy_info(&adapter->hw);
++ igb_reset_adaptive(hw);
++ igb_get_phy_info(hw);
+ }
+
+ static const struct net_device_ops igb_netdev_ops = {
+@@ -1404,8 +1404,6 @@ static int __devinit igb_probe(struct pci_dev *pdev,
+ hw->subsystem_vendor_id = pdev->subsystem_vendor;
+ hw->subsystem_device_id = pdev->subsystem_device;
+
+- /* setup the private structure */
+- hw->back = adapter;
+ /* Copy the default MAC, PHY and NVM function pointers */
+ memcpy(&hw->mac.ops, ei->mac_ops, sizeof(hw->mac.ops));
+ memcpy(&hw->phy.ops, ei->phy_ops, sizeof(hw->phy.ops));
+@@ -1460,7 +1458,7 @@ static int __devinit igb_probe(struct pci_dev *pdev,
+ if (adapter->hw.mac.type == e1000_82576)
+ netdev->features |= NETIF_F_SCTP_CSUM;
+
+- adapter->en_mng_pt = igb_enable_mng_pass_thru(&adapter->hw);
++ adapter->en_mng_pt = igb_enable_mng_pass_thru(hw);
+
+ /* before reading the NVM, reset the controller to put the device in a
+ * known good starting state */
+@@ -1705,8 +1703,8 @@ static void __devexit igb_remove(struct pci_dev *pdev)
+
+ unregister_netdev(netdev);
+
+- if (!igb_check_reset_block(&adapter->hw))
+- igb_reset_phy(&adapter->hw);
++ if (!igb_check_reset_block(hw))
++ igb_reset_phy(hw);
+
+ igb_clear_interrupt_scheme(adapter);
+
+@@ -2928,9 +2926,9 @@ static void igb_watchdog_task(struct work_struct *work)
+ if (link) {
+ if (!netif_carrier_ok(netdev)) {
+ u32 ctrl;
+- hw->mac.ops.get_speed_and_duplex(&adapter->hw,
+- &adapter->link_speed,
+- &adapter->link_duplex);
++ hw->mac.ops.get_speed_and_duplex(hw,
++ &adapter->link_speed,
++ &adapter->link_duplex);
+
+ ctrl = rd32(E1000_CTRL);
+ /* Links status message must follow this format */
+@@ -5552,7 +5550,7 @@ static int __igb_shutdown(struct pci_dev *pdev, bool *enable_wake)
+ wr32(E1000_CTRL, ctrl);
+
+ /* Allow time for pending master requests to run */
+- igb_disable_pcie_master(&adapter->hw);
++ igb_disable_pcie_master(hw);
+
+ wr32(E1000_WUC, E1000_WUC_PME_EN);
+ wr32(E1000_WUFC, wufc);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0057-igb-add-pci_dev-in-few-spots-to-clean-up-use-of-dev_.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0057-igb-add-pci_dev-in-few-spots-to-clean-up-use-of-dev_.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,130 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 27 Oct 2009 23:51:55 +0000
+Subject: [PATCH 057/165] igb: add pci_dev in few spots to clean up use of
+ dev_err/info/warn
+
+commit 090b17952826eb3c5d712b6d4f90a292fe4acc93 upstream.
+
+This patch relpaces several references to adapter->pdev->dev with just
+pdev->dev. This allows for cleanup of several multiline dev_err/info
+calls.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 24 ++++++++++++------------
+ 1 files changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index c707cbc..d7b7961 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -1173,6 +1173,7 @@ void igb_reinit_locked(struct igb_adapter *adapter)
+
+ void igb_reset(struct igb_adapter *adapter)
+ {
++ struct pci_dev *pdev = adapter->pdev;
+ struct e1000_hw *hw = &adapter->hw;
+ struct e1000_mac_info *mac = &hw->mac;
+ struct e1000_fc_info *fc = &hw->fc;
+@@ -1275,7 +1276,7 @@ void igb_reset(struct igb_adapter *adapter)
+ wr32(E1000_WUC, 0);
+
+ if (hw->mac.ops.init_hw(hw))
+- dev_err(&adapter->pdev->dev, "Hardware Error\n");
++ dev_err(&pdev->dev, "Hardware Error\n");
+
+ igb_update_mng_vlan(adapter);
+
+@@ -3704,17 +3705,18 @@ static struct net_device_stats *igb_get_stats(struct net_device *netdev)
+ static int igb_change_mtu(struct net_device *netdev, int new_mtu)
+ {
+ struct igb_adapter *adapter = netdev_priv(netdev);
++ struct pci_dev *pdev = adapter->pdev;
+ int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN;
+ u32 rx_buffer_len, i;
+
+ if ((max_frame < ETH_ZLEN + ETH_FCS_LEN) ||
+ (max_frame > MAX_JUMBO_FRAME_SIZE)) {
+- dev_err(&adapter->pdev->dev, "Invalid MTU setting\n");
++ dev_err(&pdev->dev, "Invalid MTU setting\n");
+ return -EINVAL;
+ }
+
+ if (max_frame > MAX_STD_JUMBO_FRAME_SIZE) {
+- dev_err(&adapter->pdev->dev, "MTU > 9216 not supported.\n");
++ dev_err(&pdev->dev, "MTU > 9216 not supported.\n");
+ return -EINVAL;
+ }
+
+@@ -3739,7 +3741,7 @@ static int igb_change_mtu(struct net_device *netdev, int new_mtu)
+ if (netif_running(netdev))
+ igb_down(adapter);
+
+- dev_info(&adapter->pdev->dev, "changing MTU from %d to %d\n",
++ dev_info(&pdev->dev, "changing MTU from %d to %d\n",
+ netdev->mtu, new_mtu);
+ netdev->mtu = new_mtu;
+
+@@ -4053,6 +4055,7 @@ static int __igb_notify_dca(struct device *dev, void *data)
+ {
+ struct net_device *netdev = dev_get_drvdata(dev);
+ struct igb_adapter *adapter = netdev_priv(netdev);
++ struct pci_dev *pdev = adapter->pdev;
+ struct e1000_hw *hw = &adapter->hw;
+ unsigned long event = *(unsigned long *)data;
+
+@@ -4061,12 +4064,9 @@ static int __igb_notify_dca(struct device *dev, void *data)
+ /* if already enabled, don't do it again */
+ if (adapter->flags & IGB_FLAG_DCA_ENABLED)
+ break;
+- /* Always use CB2 mode, difference is masked
+- * in the CB driver. */
+- wr32(E1000_DCA_CTRL, E1000_DCA_CTRL_DCA_MODE_CB2);
+ if (dca_add_requester(dev) == 0) {
+ adapter->flags |= IGB_FLAG_DCA_ENABLED;
+- dev_info(&adapter->pdev->dev, "DCA enabled\n");
++ dev_info(&pdev->dev, "DCA enabled\n");
+ igb_setup_dca(adapter);
+ break;
+ }
+@@ -4076,7 +4076,7 @@ static int __igb_notify_dca(struct device *dev, void *data)
+ /* without this a class_device is left
+ * hanging around in the sysfs model */
+ dca_remove_requester(dev);
+- dev_info(&adapter->pdev->dev, "DCA disabled\n");
++ dev_info(&pdev->dev, "DCA disabled\n");
+ adapter->flags &= ~IGB_FLAG_DCA_ENABLED;
+ wr32(E1000_DCA_CTRL, E1000_DCA_CTRL_DCA_MODE_DISABLE);
+ }
+@@ -4471,7 +4471,7 @@ static void igb_rcv_msg_from_vf(struct igb_adapter *adapter, u32 vf)
+ retval = igb_set_vf_vlan(adapter, msgbuf, vf);
+ break;
+ default:
+- dev_err(&adapter->pdev->dev, "Unhandled Msg %08x\n", msgbuf[0]);
++ dev_err(&pdev->dev, "Unhandled Msg %08x\n", msgbuf[0]);
+ retval = -1;
+ break;
+ }
+@@ -5472,6 +5472,7 @@ static void igb_restore_vlan(struct igb_adapter *adapter)
+
+ int igb_set_spd_dplx(struct igb_adapter *adapter, u16 spddplx)
+ {
++ struct pci_dev *pdev = adapter->pdev;
+ struct e1000_mac_info *mac = &adapter->hw.mac;
+
+ mac->autoneg = 0;
+@@ -5495,8 +5496,7 @@ int igb_set_spd_dplx(struct igb_adapter *adapter, u16 spddplx)
+ break;
+ case SPEED_1000 + DUPLEX_HALF: /* not supported */
+ default:
+- dev_err(&adapter->pdev->dev,
+- "Unsupported Speed/Duplex configuration\n");
++ dev_err(&pdev->dev, "Unsupported Speed/Duplex configuration\n");
+ return -EINVAL;
+ }
+ return 0;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0058-igb-limit-minimum-mtu-to-68-to-keep-ip-bound-to-inte.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0058-igb-limit-minimum-mtu-to-68-to-keep-ip-bound-to-inte.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,34 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 27 Oct 2009 23:52:13 +0000
+Subject: [PATCH 058/165] igb: limit minimum mtu to 68 to keep ip bound to
+ interface
+
+commit c809d2276cb035228cd9e83e2ca7d2b902c61cef upstream.
+
+Limit the minimum mtu to 68 in order to prevent ip from being unbound from
+the interface.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 3 +--
+ 1 files changed, 1 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index d7b7961..6ee50fd 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -3709,8 +3709,7 @@ static int igb_change_mtu(struct net_device *netdev, int new_mtu)
+ int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN;
+ u32 rx_buffer_len, i;
+
+- if ((max_frame < ETH_ZLEN + ETH_FCS_LEN) ||
+- (max_frame > MAX_JUMBO_FRAME_SIZE)) {
++ if ((new_mtu < 68) || (max_frame > MAX_JUMBO_FRAME_SIZE)) {
+ dev_err(&pdev->dev, "Invalid MTU setting\n");
+ return -EINVAL;
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0059-igb-open-up-SCTP-checksum-offloads-to-all-MACs-82576.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0059-igb-open-up-SCTP-checksum-offloads-to-all-MACs-82576.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,33 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 27 Oct 2009 23:52:31 +0000
+Subject: [PATCH 059/165] igb: open up SCTP checksum offloads to all MACs
+ 82576 and newer
+
+commit 5b043fb08e1b9e10eef7cc41512462f99811e96e upstream.
+
+Going forward the plan is to have the MACs support SCTP checksum offloads
+so change the check from == to >=.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 6ee50fd..cac1d9b 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -1456,7 +1456,7 @@ static int __devinit igb_probe(struct pci_dev *pdev,
+ if (pci_using_dac)
+ netdev->features |= NETIF_F_HIGHDMA;
+
+- if (adapter->hw.mac.type == e1000_82576)
++ if (hw->mac.type >= e1000_82576)
+ netdev->features |= NETIF_F_SCTP_CSUM;
+
+ adapter->en_mng_pt = igb_enable_mng_pass_thru(hw);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0060-igb-cleanup-whitespace-issues-in-igb_main.c.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0060-igb-cleanup-whitespace-issues-in-igb_main.c.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,152 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 27 Oct 2009 23:52:50 +0000
+Subject: [PATCH 060/165] igb: cleanup whitespace issues in igb_main.c
+
+commit 559e9c4987e90e278db347b0a2ba423e7e496fd3 upstream.
+
+This patch goes through and cleans up whitespace issues in igb_main.c
+to help improve readability.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 41 +++++++++++++++++++----------------------
+ 1 files changed, 19 insertions(+), 22 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index cac1d9b..b7a2e0a 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -1006,7 +1006,6 @@ static void igb_release_hw_control(struct igb_adapter *adapter)
+ ctrl_ext & ~E1000_CTRL_EXT_DRV_LOAD);
+ }
+
+-
+ /**
+ * igb_get_hw_control - get control of the h/w from f/w
+ * @adapter: address of board private structure
+@@ -1067,7 +1066,6 @@ static void igb_configure(struct igb_adapter *adapter)
+ * igb_up - Open the interface and prepare it to handle traffic
+ * @adapter: board private structure
+ **/
+-
+ int igb_up(struct igb_adapter *adapter)
+ {
+ struct e1000_hw *hw = &adapter->hw;
+@@ -1288,7 +1286,7 @@ void igb_reset(struct igb_adapter *adapter)
+ }
+
+ static const struct net_device_ops igb_netdev_ops = {
+- .ndo_open = igb_open,
++ .ndo_open = igb_open,
+ .ndo_stop = igb_close,
+ .ndo_start_xmit = igb_xmit_frame_adv,
+ .ndo_get_stats = igb_get_stats,
+@@ -1444,7 +1442,6 @@ static int __devinit igb_probe(struct pci_dev *pdev,
+ netdev->features |= NETIF_F_IPV6_CSUM;
+ netdev->features |= NETIF_F_TSO;
+ netdev->features |= NETIF_F_TSO6;
+-
+ netdev->features |= NETIF_F_GRO;
+
+ netdev->vlan_features |= NETIF_F_TSO;
+@@ -1569,7 +1566,6 @@ static int __devinit igb_probe(struct pci_dev *pdev,
+ }
+
+ #endif
+-
+ switch (hw->mac.type) {
+ case e1000_82576:
+ /*
+@@ -1624,8 +1620,8 @@ static int __devinit igb_probe(struct pci_dev *pdev,
+ /* print bus type/speed/width info */
+ dev_info(&pdev->dev, "%s: (PCIe:%s:%s) %pM\n",
+ netdev->name,
+- ((hw->bus.speed == e1000_bus_speed_2500)
+- ? "2.5Gb/s" : "unknown"),
++ ((hw->bus.speed == e1000_bus_speed_2500) ? "2.5Gb/s" :
++ "unknown"),
+ ((hw->bus.width == e1000_bus_width_pcie_x4) ? "Width x4" :
+ (hw->bus.width == e1000_bus_width_pcie_x2) ? "Width x2" :
+ (hw->bus.width == e1000_bus_width_pcie_x1) ? "Width x1" :
+@@ -1658,8 +1654,8 @@ err_sw_init:
+ err_ioremap:
+ free_netdev(netdev);
+ err_alloc_etherdev:
+- pci_release_selected_regions(pdev, pci_select_bars(pdev,
+- IORESOURCE_MEM));
++ pci_release_selected_regions(pdev,
++ pci_select_bars(pdev, IORESOURCE_MEM));
+ err_pci_reg:
+ err_dma:
+ pci_disable_device(pdev);
+@@ -1723,11 +1719,12 @@ static void __devexit igb_remove(struct pci_dev *pdev)
+ dev_info(&pdev->dev, "IOV Disabled\n");
+ }
+ #endif
++
+ iounmap(hw->hw_addr);
+ if (hw->flash_address)
+ iounmap(hw->flash_address);
+- pci_release_selected_regions(pdev, pci_select_bars(pdev,
+- IORESOURCE_MEM));
++ pci_release_selected_regions(pdev,
++ pci_select_bars(pdev, IORESOURCE_MEM));
+
+ free_netdev(netdev);
+
+@@ -2288,9 +2285,7 @@ void igb_setup_rctl(struct igb_adapter *adapter)
+ */
+ rctl |= E1000_RCTL_SECRC;
+
+- /*
+- * disable store bad packets and clear size bits.
+- */
++ /* disable store bad packets and clear size bits. */
+ rctl &= ~(E1000_RCTL_SBP | E1000_RCTL_SZ_256);
+
+ /* enable LPE to prevent packets larger than max_frame_size */
+@@ -2916,7 +2911,8 @@ static void igb_watchdog(unsigned long data)
+ static void igb_watchdog_task(struct work_struct *work)
+ {
+ struct igb_adapter *adapter = container_of(work,
+- struct igb_adapter, watchdog_task);
++ struct igb_adapter,
++ watchdog_task);
+ struct e1000_hw *hw = &adapter->hw;
+ struct net_device *netdev = adapter->netdev;
+ struct igb_ring *tx_ring = adapter->tx_ring;
+@@ -2935,14 +2931,14 @@ static void igb_watchdog_task(struct work_struct *work)
+ /* Links status message must follow this format */
+ printk(KERN_INFO "igb: %s NIC Link is Up %d Mbps %s, "
+ "Flow Control: %s\n",
+- netdev->name,
+- adapter->link_speed,
+- adapter->link_duplex == FULL_DUPLEX ?
++ netdev->name,
++ adapter->link_speed,
++ adapter->link_duplex == FULL_DUPLEX ?
+ "Full Duplex" : "Half Duplex",
+- ((ctrl & E1000_CTRL_TFCE) && (ctrl &
+- E1000_CTRL_RFCE)) ? "RX/TX" : ((ctrl &
+- E1000_CTRL_RFCE) ? "RX" : ((ctrl &
+- E1000_CTRL_TFCE) ? "TX" : "None")));
++ ((ctrl & E1000_CTRL_TFCE) &&
++ (ctrl & E1000_CTRL_RFCE)) ? "RX/TX" :
++ ((ctrl & E1000_CTRL_RFCE) ? "RX" :
++ ((ctrl & E1000_CTRL_TFCE) ? "TX" : "None")));
+
+ /* tweak tx_queue_len according to speed/duplex and
+ * adjust the timeout factor */
+@@ -3724,6 +3720,7 @@ static int igb_change_mtu(struct net_device *netdev, int new_mtu)
+
+ /* igb_down has a dependency on max_frame_size */
+ adapter->max_frame_size = max_frame;
++
+ /* NOTE: netdev_alloc_skb reserves 16 bytes, and typically NET_IP_ALIGN
+ * means we reserve 2 more, this pushes us to allocate from the next
+ * larger slab size.
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0061-igb-Fix-warnings-in-igb_set_ringparam.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0061-igb-Fix-warnings-in-igb_set_ringparam.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,42 @@
+From: "David S. Miller" <davem at davemloft.net>
+Date: Wed, 28 Oct 2009 03:38:54 -0700
+Subject: [PATCH 061/165] igb: Fix warnings in igb_set_ringparam()
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+commit d6b9076f1b5dd22b63f0178923f420f4e0f81a8d upstream.
+
+drivers/net/igb/igb_ethtool.c: In function ‘igb_set_ringparam’:
+drivers/net/igb/igb_ethtool.c:744: warning: comparison of distinct pointer types lacks a cast
+drivers/net/igb/igb_ethtool.c:748: warning: comparison of distinct pointer types lacks a cast
+
+Casts were to u16 on the constant, but the type of new_{r,t}x_count is
+u32. Cast to u32 instead.
+
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_ethtool.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
+index 1518f56..fd8abc0 100644
+--- a/drivers/net/igb/igb_ethtool.c
++++ b/drivers/net/igb/igb_ethtool.c
+@@ -742,11 +742,11 @@ static int igb_set_ringparam(struct net_device *netdev,
+ return -EINVAL;
+
+ new_rx_count = min(ring->rx_pending, (u32)IGB_MAX_RXD);
+- new_rx_count = max(new_rx_count, (u16)IGB_MIN_RXD);
++ new_rx_count = max(new_rx_count, (u32)IGB_MIN_RXD);
+ new_rx_count = ALIGN(new_rx_count, REQ_RX_DESCRIPTOR_MULTIPLE);
+
+ new_tx_count = min(ring->tx_pending, (u32)IGB_MAX_TXD);
+- new_tx_count = max(new_tx_count, (u16)IGB_MIN_TXD);
++ new_tx_count = max(new_tx_count, (u32)IGB_MIN_TXD);
+ new_tx_count = ALIGN(new_tx_count, REQ_TX_DESCRIPTOR_MULTIPLE);
+
+ if ((new_tx_count == adapter->tx_ring_count) &&
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0062-igb-change-type-for-ring-sizes-to-u16-in-igb_set_rin.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0062-igb-change-type-for-ring-sizes-to-u16-in-igb_set_rin.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,47 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Thu, 12 Nov 2009 18:36:41 +0000
+Subject: [PATCH 062/165] igb: change type for ring sizes to u16 in
+ igb_set_ring_param
+
+commit 0e15439ae5fefe438056a26a00aa3c6a9de454e9 upstream.
+
+Change the type for the ring size values to u16 and use min/max_t instead of
+min/max.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_ethtool.c | 10 +++++-----
+ 1 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
+index fd8abc0..092c287 100644
+--- a/drivers/net/igb/igb_ethtool.c
++++ b/drivers/net/igb/igb_ethtool.c
+@@ -736,17 +736,17 @@ static int igb_set_ringparam(struct net_device *netdev,
+ struct igb_adapter *adapter = netdev_priv(netdev);
+ struct igb_ring *temp_ring;
+ int i, err = 0;
+- u32 new_rx_count, new_tx_count;
++ u16 new_rx_count, new_tx_count;
+
+ if ((ring->rx_mini_pending) || (ring->rx_jumbo_pending))
+ return -EINVAL;
+
+- new_rx_count = min(ring->rx_pending, (u32)IGB_MAX_RXD);
+- new_rx_count = max(new_rx_count, (u32)IGB_MIN_RXD);
++ new_rx_count = min_t(u32, ring->rx_pending, IGB_MAX_RXD);
++ new_rx_count = max_t(u16, new_rx_count, IGB_MIN_RXD);
+ new_rx_count = ALIGN(new_rx_count, REQ_RX_DESCRIPTOR_MULTIPLE);
+
+- new_tx_count = min(ring->tx_pending, (u32)IGB_MAX_TXD);
+- new_tx_count = max(new_tx_count, (u32)IGB_MIN_TXD);
++ new_tx_count = min_t(u32, ring->tx_pending, IGB_MAX_TXD);
++ new_tx_count = max_t(u16, new_tx_count, IGB_MIN_TXD);
+ new_tx_count = ALIGN(new_tx_count, REQ_TX_DESCRIPTOR_MULTIPLE);
+
+ if ((new_tx_count == adapter->tx_ring_count) &&
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0063-igb-move-timesync-init-into-a-seperate-function.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0063-igb-move-timesync-init-into-a-seperate-function.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,158 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Thu, 12 Nov 2009 18:37:00 +0000
+Subject: [PATCH 063/165] igb: move timesync init into a seperate function
+
+commit 115f459a53b0c56a699a76b34b82507452eb3df5 upstream.
+
+Current code is quite large and making igb_probe difficult to read.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 115 +++++++++++++++++++++++++-------------------
+ 1 files changed, 65 insertions(+), 50 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index b7a2e0a..f93f6f3 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -1566,56 +1566,6 @@ static int __devinit igb_probe(struct pci_dev *pdev,
+ }
+
+ #endif
+- switch (hw->mac.type) {
+- case e1000_82576:
+- /*
+- * Initialize hardware timer: we keep it running just in case
+- * that some program needs it later on.
+- */
+- memset(&adapter->cycles, 0, sizeof(adapter->cycles));
+- adapter->cycles.read = igb_read_clock;
+- adapter->cycles.mask = CLOCKSOURCE_MASK(64);
+- adapter->cycles.mult = 1;
+- /**
+- * Scale the NIC clock cycle by a large factor so that
+- * relatively small clock corrections can be added or
+- * substracted at each clock tick. The drawbacks of a large
+- * factor are a) that the clock register overflows more quickly
+- * (not such a big deal) and b) that the increment per tick has
+- * to fit into 24 bits. As a result we need to use a shift of
+- * 19 so we can fit a value of 16 into the TIMINCA register.
+- */
+- adapter->cycles.shift = IGB_82576_TSYNC_SHIFT;
+- wr32(E1000_TIMINCA,
+- (1 << E1000_TIMINCA_16NS_SHIFT) |
+- (16 << IGB_82576_TSYNC_SHIFT));
+-
+- /* Set registers so that rollover occurs soon to test this. */
+- wr32(E1000_SYSTIML, 0x00000000);
+- wr32(E1000_SYSTIMH, 0xFF800000);
+- wrfl();
+-
+- timecounter_init(&adapter->clock,
+- &adapter->cycles,
+- ktime_to_ns(ktime_get_real()));
+- /*
+- * Synchronize our NIC clock against system wall clock. NIC
+- * time stamp reading requires ~3us per sample, each sample
+- * was pretty stable even under load => only require 10
+- * samples for each offset comparison.
+- */
+- memset(&adapter->compare, 0, sizeof(adapter->compare));
+- adapter->compare.source = &adapter->clock;
+- adapter->compare.target = ktime_get_real;
+- adapter->compare.num_samples = 10;
+- timecompare_update(&adapter->compare, 0);
+- break;
+- case e1000_82575:
+- /* 82575 does not support timesync */
+- default:
+- break;
+- }
+-
+ dev_info(&pdev->dev, "Intel(R) Gigabit Ethernet Network Connection\n");
+ /* print bus type/speed/width info */
+ dev_info(&pdev->dev, "%s: (PCIe:%s:%s) %pM\n",
+@@ -1781,6 +1731,70 @@ static void __devinit igb_probe_vfs(struct igb_adapter * adapter)
+ #endif /* CONFIG_PCI_IOV */
+ }
+
++
++/**
++ * igb_init_hw_timer - Initialize hardware timer used with IEEE 1588 timestamp
++ * @adapter: board private structure to initialize
++ *
++ * igb_init_hw_timer initializes the function pointer and values for the hw
++ * timer found in hardware.
++ **/
++static void igb_init_hw_timer(struct igb_adapter *adapter)
++{
++ struct e1000_hw *hw = &adapter->hw;
++
++ switch (hw->mac.type) {
++ case e1000_82576:
++ /*
++ * Initialize hardware timer: we keep it running just in case
++ * that some program needs it later on.
++ */
++ memset(&adapter->cycles, 0, sizeof(adapter->cycles));
++ adapter->cycles.read = igb_read_clock;
++ adapter->cycles.mask = CLOCKSOURCE_MASK(64);
++ adapter->cycles.mult = 1;
++ /**
++ * Scale the NIC clock cycle by a large factor so that
++ * relatively small clock corrections can be added or
++ * substracted at each clock tick. The drawbacks of a large
++ * factor are a) that the clock register overflows more quickly
++ * (not such a big deal) and b) that the increment per tick has
++ * to fit into 24 bits. As a result we need to use a shift of
++ * 19 so we can fit a value of 16 into the TIMINCA register.
++ */
++ adapter->cycles.shift = IGB_82576_TSYNC_SHIFT;
++ wr32(E1000_TIMINCA,
++ (1 << E1000_TIMINCA_16NS_SHIFT) |
++ (16 << IGB_82576_TSYNC_SHIFT));
++
++ /* Set registers so that rollover occurs soon to test this. */
++ wr32(E1000_SYSTIML, 0x00000000);
++ wr32(E1000_SYSTIMH, 0xFF800000);
++ wrfl();
++
++ timecounter_init(&adapter->clock,
++ &adapter->cycles,
++ ktime_to_ns(ktime_get_real()));
++ /*
++ * Synchronize our NIC clock against system wall clock. NIC
++ * time stamp reading requires ~3us per sample, each sample
++ * was pretty stable even under load => only require 10
++ * samples for each offset comparison.
++ */
++ memset(&adapter->compare, 0, sizeof(adapter->compare));
++ adapter->compare.source = &adapter->clock;
++ adapter->compare.target = ktime_get_real;
++ adapter->compare.num_samples = 10;
++ timecompare_update(&adapter->compare, 0);
++ break;
++ case e1000_82575:
++ /* 82575 does not support timesync */
++ default:
++ break;
++ }
++
++}
++
+ /**
+ * igb_sw_init - Initialize general software structures (struct igb_adapter)
+ * @adapter: board private structure to initialize
+@@ -1816,6 +1830,7 @@ static int __devinit igb_sw_init(struct igb_adapter *adapter)
+ return -ENOMEM;
+ }
+
++ igb_init_hw_timer(adapter);
+ igb_probe_vfs(adapter);
+
+ /* Explicitly disable IRQ since the NIC can be in any state. */
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0064-igb-when-number-of-CPUs-4-combine-tx-rx-queues-to-al.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0064-igb-when-number-of-CPUs-4-combine-tx-rx-queues-to-al.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,148 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Thu, 12 Nov 2009 18:37:19 +0000
+Subject: [PATCH 064/165] igb: when number of CPUs > 4 combine tx/rx queues to
+ allow more queues
+
+commit a99955fc067f57cf3b627d4c74bf7952a2d51029 upstream.
+
+This patch makes it so that nics such as 82576 and newer can support more
+hardware queues when there are more than 4 cpus by combining a tx/rx queue
+pair onto one interrupt so that 8 queue pairs can be supported and thus
+allow for more queues.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb.h | 9 +++++----
+ drivers/net/igb/igb_main.c | 31 ++++++++++++++++++++++---------
+ 2 files changed, 27 insertions(+), 13 deletions(-)
+
+diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
+index 3298f5a..2bb9549 100644
+--- a/drivers/net/igb/igb.h
++++ b/drivers/net/igb/igb.h
+@@ -59,10 +59,10 @@ struct igb_adapter;
+ #define MAX_Q_VECTORS 8
+
+ /* Transmit and receive queues */
+-#define IGB_MAX_RX_QUEUES (adapter->vfs_allocated_count ? \
+- (adapter->vfs_allocated_count > 6 ? 1 : 2) : 4)
+-#define IGB_MAX_TX_QUEUES IGB_MAX_RX_QUEUES
+-#define IGB_ABS_MAX_TX_QUEUES 4
++#define IGB_MAX_RX_QUEUES (adapter->vfs_allocated_count ? 2 : \
++ (hw->mac.type > e1000_82575 ? 8 : 4))
++#define IGB_ABS_MAX_TX_QUEUES 8
++#define IGB_MAX_TX_QUEUES IGB_MAX_RX_QUEUES
+
+ #define IGB_MAX_VF_MC_ENTRIES 30
+ #define IGB_MAX_VF_FUNCTIONS 8
+@@ -315,6 +315,7 @@ struct igb_adapter {
+ u16 rx_ring_count;
+ unsigned int vfs_allocated_count;
+ struct vf_data_storage *vf_data;
++ u32 rss_queues;
+ };
+
+ #define IGB_FLAG_HAS_MSI (1 << 0)
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index f93f6f3..1cf15a7 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -296,10 +296,10 @@ static void igb_cache_ring_register(struct igb_adapter *adapter)
+ * and continue consuming queues in the same sequence
+ */
+ if (adapter->vfs_allocated_count) {
+- for (; i < adapter->num_rx_queues; i++)
++ for (; i < adapter->rss_queues; i++)
+ adapter->rx_ring[i].reg_idx = rbase_offset +
+ Q_IDX_82576(i);
+- for (; j < adapter->num_tx_queues; j++)
++ for (; j < adapter->rss_queues; j++)
+ adapter->tx_ring[j].reg_idx = rbase_offset +
+ Q_IDX_82576(j);
+ }
+@@ -618,14 +618,15 @@ static void igb_set_interrupt_capability(struct igb_adapter *adapter)
+ int numvecs, i;
+
+ /* Number of supported queues. */
+- adapter->num_rx_queues = min_t(u32, IGB_MAX_RX_QUEUES, num_online_cpus());
+- adapter->num_tx_queues = min_t(u32, IGB_MAX_TX_QUEUES, num_online_cpus());
++ adapter->num_rx_queues = adapter->rss_queues;
++ adapter->num_tx_queues = adapter->rss_queues;
+
+ /* start with one vector for every rx queue */
+ numvecs = adapter->num_rx_queues;
+
+ /* if tx handler is seperate add 1 for every tx queue */
+- numvecs += adapter->num_tx_queues;
++ if (!(adapter->flags & IGB_FLAG_QUEUE_PAIRS))
++ numvecs += adapter->num_tx_queues;
+
+ /* store the number of vectors reserved for queues */
+ adapter->num_q_vectors = numvecs;
+@@ -666,6 +667,7 @@ msi_only:
+ }
+ #endif
+ adapter->vfs_allocated_count = 0;
++ adapter->rss_queues = 1;
+ adapter->flags |= IGB_FLAG_QUEUE_PAIRS;
+ adapter->num_rx_queues = 1;
+ adapter->num_tx_queues = 1;
+@@ -1824,6 +1826,17 @@ static int __devinit igb_sw_init(struct igb_adapter *adapter)
+ adapter->vfs_allocated_count = max_vfs;
+
+ #endif /* CONFIG_PCI_IOV */
++ adapter->rss_queues = min_t(u32, IGB_MAX_RX_QUEUES, num_online_cpus());
++
++ /*
++ * if rss_queues > 4 or vfs are going to be allocated with rss_queues
++ * then we should combine the queues into a queue pair in order to
++ * conserve interrupts due to limited supply
++ */
++ if ((adapter->rss_queues > 4) ||
++ ((adapter->rss_queues > 1) && (adapter->vfs_allocated_count > 6)))
++ adapter->flags |= IGB_FLAG_QUEUE_PAIRS;
++
+ /* This call may decrease the number of queues */
+ if (igb_init_interrupt_scheme(adapter)) {
+ dev_err(&pdev->dev, "Unable to allocate memory for queues\n");
+@@ -2015,7 +2028,7 @@ static int igb_setup_all_tx_resources(struct igb_adapter *adapter)
+ }
+ }
+
+- for (i = 0; i < IGB_MAX_TX_QUEUES; i++) {
++ for (i = 0; i < IGB_ABS_MAX_TX_QUEUES; i++) {
+ int r_idx = i % adapter->num_tx_queues;
+ adapter->multi_tx_table[i] = &adapter->tx_ring[r_idx];
+ }
+@@ -2199,7 +2212,7 @@ static void igb_setup_mrqc(struct igb_adapter *adapter)
+ array_wr32(E1000_RSSRK(0), j, rsskey);
+ }
+
+- num_rx_queues = adapter->num_rx_queues;
++ num_rx_queues = adapter->rss_queues;
+
+ if (adapter->vfs_allocated_count) {
+ /* 82575 and 82576 supports 2 RSS queues for VMDq */
+@@ -2255,7 +2268,7 @@ static void igb_setup_mrqc(struct igb_adapter *adapter)
+ E1000_VT_CTL_DEFAULT_POOL_SHIFT;
+ wr32(E1000_VT_CTL, vtctl);
+ }
+- if (adapter->num_rx_queues > 1)
++ if (adapter->rss_queues > 1)
+ mrqc = E1000_MRQC_ENABLE_VMDQ_RSS_2Q;
+ else
+ mrqc = E1000_MRQC_ENABLE_VMDQ;
+@@ -2385,7 +2398,7 @@ static inline void igb_set_vmolr(struct igb_adapter *adapter, int vfn)
+ /* clear all bits that might not be set */
+ vmolr &= ~(E1000_VMOLR_BAM | E1000_VMOLR_RSSE);
+
+- if (adapter->num_rx_queues > 1 && vfn == adapter->vfs_allocated_count)
++ if (adapter->rss_queues > 1 && vfn == adapter->vfs_allocated_count)
+ vmolr |= E1000_VMOLR_RSSE; /* enable RSS */
+ /*
+ * for VMDq only allow the VFs and pool 0 to accept broadcast and
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0065-igb-Rework-how-netdev-stats-is-handled.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0065-igb-Rework-how-netdev-stats-is-handled.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,340 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Thu, 12 Nov 2009 18:37:38 +0000
+Subject: [PATCH 065/165] igb: Rework how netdev->stats is handled
+
+commit 128e45eb61b90c0c3094139cab6d00f67ff31377 upstream.
+
+This patch does some refactoring work that I felt was needed after reviewing
+the changes recently submitted relating to the replacement of net_stats with
+netdev->stats.
+
+This patch essentially creates two different collections of stats. The
+first handles the adapter specific states and is stored in gstring_stats,
+and the second is for netdev specific stats and is stored in
+gstring_net_stats.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_ethtool.c | 171 +++++++++++++++++++++--------------------
+ drivers/net/igb/igb_main.c | 40 +++++-----
+ 2 files changed, 108 insertions(+), 103 deletions(-)
+
+diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
+index 092c287..88e13f7 100644
+--- a/drivers/net/igb/igb_ethtool.c
++++ b/drivers/net/igb/igb_ethtool.c
+@@ -38,77 +38,88 @@
+
+ #include "igb.h"
+
+-enum {NETDEV_STATS, IGB_STATS};
+-
+ struct igb_stats {
+ char stat_string[ETH_GSTRING_LEN];
+- int type;
+ int sizeof_stat;
+ int stat_offset;
+ };
+
+-#define IGB_STAT(m) IGB_STATS, \
+- FIELD_SIZEOF(struct igb_adapter, m), \
+- offsetof(struct igb_adapter, m)
+-#define IGB_NETDEV_STAT(m) NETDEV_STATS, \
+- FIELD_SIZEOF(struct net_device, m), \
+- offsetof(struct net_device, m)
+-
++#define IGB_STAT(_name, _stat) { \
++ .stat_string = _name, \
++ .sizeof_stat = FIELD_SIZEOF(struct igb_adapter, _stat), \
++ .stat_offset = offsetof(struct igb_adapter, _stat) \
++}
+ static const struct igb_stats igb_gstrings_stats[] = {
+- { "rx_packets", IGB_STAT(stats.gprc) },
+- { "tx_packets", IGB_STAT(stats.gptc) },
+- { "rx_bytes", IGB_STAT(stats.gorc) },
+- { "tx_bytes", IGB_STAT(stats.gotc) },
+- { "rx_broadcast", IGB_STAT(stats.bprc) },
+- { "tx_broadcast", IGB_STAT(stats.bptc) },
+- { "rx_multicast", IGB_STAT(stats.mprc) },
+- { "tx_multicast", IGB_STAT(stats.mptc) },
+- { "rx_errors", IGB_NETDEV_STAT(stats.rx_errors) },
+- { "tx_errors", IGB_NETDEV_STAT(stats.tx_errors) },
+- { "tx_dropped", IGB_NETDEV_STAT(stats.tx_dropped) },
+- { "multicast", IGB_STAT(stats.mprc) },
+- { "collisions", IGB_STAT(stats.colc) },
+- { "rx_length_errors", IGB_NETDEV_STAT(stats.rx_length_errors) },
+- { "rx_over_errors", IGB_NETDEV_STAT(stats.rx_over_errors) },
+- { "rx_crc_errors", IGB_STAT(stats.crcerrs) },
+- { "rx_frame_errors", IGB_NETDEV_STAT(stats.rx_frame_errors) },
+- { "rx_no_buffer_count", IGB_STAT(stats.rnbc) },
+- { "rx_queue_drop_packet_count", IGB_NETDEV_STAT(stats.rx_fifo_errors) },
+- { "rx_missed_errors", IGB_STAT(stats.mpc) },
+- { "tx_aborted_errors", IGB_STAT(stats.ecol) },
+- { "tx_carrier_errors", IGB_STAT(stats.tncrs) },
+- { "tx_fifo_errors", IGB_NETDEV_STAT(stats.tx_fifo_errors) },
+- { "tx_heartbeat_errors", IGB_NETDEV_STAT(stats.tx_heartbeat_errors) },
+- { "tx_window_errors", IGB_STAT(stats.latecol) },
+- { "tx_abort_late_coll", IGB_STAT(stats.latecol) },
+- { "tx_deferred_ok", IGB_STAT(stats.dc) },
+- { "tx_single_coll_ok", IGB_STAT(stats.scc) },
+- { "tx_multi_coll_ok", IGB_STAT(stats.mcc) },
+- { "tx_timeout_count", IGB_STAT(tx_timeout_count) },
+- { "rx_long_length_errors", IGB_STAT(stats.roc) },
+- { "rx_short_length_errors", IGB_STAT(stats.ruc) },
+- { "rx_align_errors", IGB_STAT(stats.algnerrc) },
+- { "tx_tcp_seg_good", IGB_STAT(stats.tsctc) },
+- { "tx_tcp_seg_failed", IGB_STAT(stats.tsctfc) },
+- { "rx_flow_control_xon", IGB_STAT(stats.xonrxc) },
+- { "rx_flow_control_xoff", IGB_STAT(stats.xoffrxc) },
+- { "tx_flow_control_xon", IGB_STAT(stats.xontxc) },
+- { "tx_flow_control_xoff", IGB_STAT(stats.xofftxc) },
+- { "rx_long_byte_count", IGB_STAT(stats.gorc) },
+- { "tx_dma_out_of_sync", IGB_STAT(stats.doosync) },
+- { "tx_smbus", IGB_STAT(stats.mgptc) },
+- { "rx_smbus", IGB_STAT(stats.mgprc) },
+- { "dropped_smbus", IGB_STAT(stats.mgpdc) },
++ IGB_STAT("rx_packets", stats.gprc),
++ IGB_STAT("tx_packets", stats.gptc),
++ IGB_STAT("rx_bytes", stats.gorc),
++ IGB_STAT("tx_bytes", stats.gotc),
++ IGB_STAT("rx_broadcast", stats.bprc),
++ IGB_STAT("tx_broadcast", stats.bptc),
++ IGB_STAT("rx_multicast", stats.mprc),
++ IGB_STAT("tx_multicast", stats.mptc),
++ IGB_STAT("multicast", stats.mprc),
++ IGB_STAT("collisions", stats.colc),
++ IGB_STAT("rx_crc_errors", stats.crcerrs),
++ IGB_STAT("rx_no_buffer_count", stats.rnbc),
++ IGB_STAT("rx_missed_errors", stats.mpc),
++ IGB_STAT("tx_aborted_errors", stats.ecol),
++ IGB_STAT("tx_carrier_errors", stats.tncrs),
++ IGB_STAT("tx_window_errors", stats.latecol),
++ IGB_STAT("tx_abort_late_coll", stats.latecol),
++ IGB_STAT("tx_deferred_ok", stats.dc),
++ IGB_STAT("tx_single_coll_ok", stats.scc),
++ IGB_STAT("tx_multi_coll_ok", stats.mcc),
++ IGB_STAT("tx_timeout_count", tx_timeout_count),
++ IGB_STAT("rx_long_length_errors", stats.roc),
++ IGB_STAT("rx_short_length_errors", stats.ruc),
++ IGB_STAT("rx_align_errors", stats.algnerrc),
++ IGB_STAT("tx_tcp_seg_good", stats.tsctc),
++ IGB_STAT("tx_tcp_seg_failed", stats.tsctfc),
++ IGB_STAT("rx_flow_control_xon", stats.xonrxc),
++ IGB_STAT("rx_flow_control_xoff", stats.xoffrxc),
++ IGB_STAT("tx_flow_control_xon", stats.xontxc),
++ IGB_STAT("tx_flow_control_xoff", stats.xofftxc),
++ IGB_STAT("rx_long_byte_count", stats.gorc),
++ IGB_STAT("tx_dma_out_of_sync", stats.doosync),
++ IGB_STAT("tx_smbus", stats.mgptc),
++ IGB_STAT("rx_smbus", stats.mgprc),
++ IGB_STAT("dropped_smbus", stats.mgpdc),
++};
++
++#define IGB_NETDEV_STAT(_net_stat) { \
++ .stat_string = __stringify(_net_stat), \
++ .sizeof_stat = FIELD_SIZEOF(struct net_device_stats, _net_stat), \
++ .stat_offset = offsetof(struct net_device_stats, _net_stat) \
++}
++static const struct igb_stats igb_gstrings_net_stats[] = {
++ IGB_NETDEV_STAT(rx_errors),
++ IGB_NETDEV_STAT(tx_errors),
++ IGB_NETDEV_STAT(tx_dropped),
++ IGB_NETDEV_STAT(rx_length_errors),
++ IGB_NETDEV_STAT(rx_over_errors),
++ IGB_NETDEV_STAT(rx_frame_errors),
++ IGB_NETDEV_STAT(rx_fifo_errors),
++ IGB_NETDEV_STAT(tx_fifo_errors),
++ IGB_NETDEV_STAT(tx_heartbeat_errors)
+ };
+
++#define IGB_GLOBAL_STATS_LEN \
++ (sizeof(igb_gstrings_stats) / sizeof(struct igb_stats))
++#define IGB_NETDEV_STATS_LEN \
++ (sizeof(igb_gstrings_net_stats) / sizeof(struct igb_stats))
++#define IGB_RX_QUEUE_STATS_LEN \
++ (sizeof(struct igb_rx_queue_stats) / sizeof(u64))
++#define IGB_TX_QUEUE_STATS_LEN \
++ (sizeof(struct igb_tx_queue_stats) / sizeof(u64))
+ #define IGB_QUEUE_STATS_LEN \
+ ((((struct igb_adapter *)netdev_priv(netdev))->num_rx_queues * \
+- (sizeof(struct igb_rx_queue_stats) / sizeof(u64))) + \
++ IGB_RX_QUEUE_STATS_LEN) + \
+ (((struct igb_adapter *)netdev_priv(netdev))->num_tx_queues * \
+- (sizeof(struct igb_tx_queue_stats) / sizeof(u64))))
+-#define IGB_GLOBAL_STATS_LEN \
+- (sizeof(igb_gstrings_stats) / sizeof(struct igb_stats))
+-#define IGB_STATS_LEN (IGB_GLOBAL_STATS_LEN + IGB_QUEUE_STATS_LEN)
++ IGB_TX_QUEUE_STATS_LEN))
++#define IGB_STATS_LEN \
++ (IGB_GLOBAL_STATS_LEN + IGB_NETDEV_STATS_LEN + IGB_QUEUE_STATS_LEN)
++
+ static const char igb_gstrings_test[][ETH_GSTRING_LEN] = {
+ "Register test (offline)", "Eeprom test (offline)",
+ "Interrupt test (offline)", "Loopback test (offline)",
+@@ -1923,43 +1934,32 @@ static void igb_get_ethtool_stats(struct net_device *netdev,
+ struct ethtool_stats *stats, u64 *data)
+ {
+ struct igb_adapter *adapter = netdev_priv(netdev);
++ struct net_device_stats *net_stats = &netdev->stats;
+ u64 *queue_stat;
+- int stat_count_tx = sizeof(struct igb_tx_queue_stats) / sizeof(u64);
+- int stat_count_rx = sizeof(struct igb_rx_queue_stats) / sizeof(u64);
+- int j;
+- int i;
+- char *p = NULL;
++ int i, j, k;
++ char *p;
+
+ igb_update_stats(adapter);
+
+ for (i = 0; i < IGB_GLOBAL_STATS_LEN; i++) {
+- switch (igb_gstrings_stats[i].type) {
+- case NETDEV_STATS:
+- p = (char *) netdev +
+- igb_gstrings_stats[i].stat_offset;
+- break;
+- case IGB_STATS:
+- p = (char *) adapter +
+- igb_gstrings_stats[i].stat_offset;
+- break;
+- }
+-
++ p = (char *)adapter + igb_gstrings_stats[i].stat_offset;
+ data[i] = (igb_gstrings_stats[i].sizeof_stat ==
+ sizeof(u64)) ? *(u64 *)p : *(u32 *)p;
+ }
++ for (j = 0; j < IGB_NETDEV_STATS_LEN; j++, i++) {
++ p = (char *)net_stats + igb_gstrings_net_stats[j].stat_offset;
++ data[i] = (igb_gstrings_net_stats[j].sizeof_stat ==
++ sizeof(u64)) ? *(u64 *)p : *(u32 *)p;
++ }
+ for (j = 0; j < adapter->num_tx_queues; j++) {
+- int k;
+ queue_stat = (u64 *)&adapter->tx_ring[j].tx_stats;
+- for (k = 0; k < stat_count_tx; k++)
+- data[i + k] = queue_stat[k];
+- i += k;
++ for (k = 0; k < IGB_TX_QUEUE_STATS_LEN; k++, i++)
++ data[i] = queue_stat[k];
+ }
+ for (j = 0; j < adapter->num_rx_queues; j++) {
+- int k;
+ queue_stat = (u64 *)&adapter->rx_ring[j].rx_stats;
+- for (k = 0; k < stat_count_rx; k++)
+- data[i + k] = queue_stat[k];
+- i += k;
++ for (k = 0; k < IGB_RX_QUEUE_STATS_LEN; k++, i++)
++ data[i] = queue_stat[k];
+ }
+ }
+
+@@ -1980,6 +1980,11 @@ static void igb_get_strings(struct net_device *netdev, u32 stringset, u8 *data)
+ ETH_GSTRING_LEN);
+ p += ETH_GSTRING_LEN;
+ }
++ for (i = 0; i < IGB_NETDEV_STATS_LEN; i++) {
++ memcpy(p, igb_gstrings_net_stats[i].stat_string,
++ ETH_GSTRING_LEN);
++ p += ETH_GSTRING_LEN;
++ }
+ for (i = 0; i < adapter->num_tx_queues; i++) {
+ sprintf(p, "tx_queue_%u_packets", i);
+ p += ETH_GSTRING_LEN;
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 1cf15a7..c433b6b 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -3789,7 +3789,7 @@ static int igb_change_mtu(struct net_device *netdev, int new_mtu)
+
+ void igb_update_stats(struct igb_adapter *adapter)
+ {
+- struct net_device *netdev = adapter->netdev;
++ struct net_device_stats *net_stats = igb_get_stats(adapter->netdev);
+ struct e1000_hw *hw = &adapter->hw;
+ struct pci_dev *pdev = adapter->pdev;
+ u32 rnbc;
+@@ -3813,13 +3813,13 @@ void igb_update_stats(struct igb_adapter *adapter)
+ for (i = 0; i < adapter->num_rx_queues; i++) {
+ u32 rqdpc_tmp = rd32(E1000_RQDPC(i)) & 0x0FFF;
+ adapter->rx_ring[i].rx_stats.drops += rqdpc_tmp;
+- netdev->stats.rx_fifo_errors += rqdpc_tmp;
++ net_stats->rx_fifo_errors += rqdpc_tmp;
+ bytes += adapter->rx_ring[i].rx_stats.bytes;
+ packets += adapter->rx_ring[i].rx_stats.packets;
+ }
+
+- netdev->stats.rx_bytes = bytes;
+- netdev->stats.rx_packets = packets;
++ net_stats->rx_bytes = bytes;
++ net_stats->rx_packets = packets;
+
+ bytes = 0;
+ packets = 0;
+@@ -3827,8 +3827,8 @@ void igb_update_stats(struct igb_adapter *adapter)
+ bytes += adapter->tx_ring[i].tx_stats.bytes;
+ packets += adapter->tx_ring[i].tx_stats.packets;
+ }
+- netdev->stats.tx_bytes = bytes;
+- netdev->stats.tx_packets = packets;
++ net_stats->tx_bytes = bytes;
++ net_stats->tx_packets = packets;
+
+ /* read stats registers */
+ adapter->stats.crcerrs += rd32(E1000_CRCERRS);
+@@ -3865,7 +3865,7 @@ void igb_update_stats(struct igb_adapter *adapter)
+ rd32(E1000_GOTCH); /* clear GOTCL */
+ rnbc = rd32(E1000_RNBC);
+ adapter->stats.rnbc += rnbc;
+- netdev->stats.rx_fifo_errors += rnbc;
++ net_stats->rx_fifo_errors += rnbc;
+ adapter->stats.ruc += rd32(E1000_RUC);
+ adapter->stats.rfc += rd32(E1000_RFC);
+ adapter->stats.rjc += rd32(E1000_RJC);
+@@ -3906,29 +3906,29 @@ void igb_update_stats(struct igb_adapter *adapter)
+ adapter->stats.icrxdmtc += rd32(E1000_ICRXDMTC);
+
+ /* Fill out the OS statistics structure */
+- netdev->stats.multicast = adapter->stats.mprc;
+- netdev->stats.collisions = adapter->stats.colc;
++ net_stats->multicast = adapter->stats.mprc;
++ net_stats->collisions = adapter->stats.colc;
+
+ /* Rx Errors */
+
+ /* RLEC on some newer hardware can be incorrect so build
+ * our own version based on RUC and ROC */
+- netdev->stats.rx_errors = adapter->stats.rxerrc +
++ net_stats->rx_errors = adapter->stats.rxerrc +
+ adapter->stats.crcerrs + adapter->stats.algnerrc +
+ adapter->stats.ruc + adapter->stats.roc +
+ adapter->stats.cexterr;
+- netdev->stats.rx_length_errors = adapter->stats.ruc +
+- adapter->stats.roc;
+- netdev->stats.rx_crc_errors = adapter->stats.crcerrs;
+- netdev->stats.rx_frame_errors = adapter->stats.algnerrc;
+- netdev->stats.rx_missed_errors = adapter->stats.mpc;
++ net_stats->rx_length_errors = adapter->stats.ruc +
++ adapter->stats.roc;
++ net_stats->rx_crc_errors = adapter->stats.crcerrs;
++ net_stats->rx_frame_errors = adapter->stats.algnerrc;
++ net_stats->rx_missed_errors = adapter->stats.mpc;
+
+ /* Tx Errors */
+- netdev->stats.tx_errors = adapter->stats.ecol +
+- adapter->stats.latecol;
+- netdev->stats.tx_aborted_errors = adapter->stats.ecol;
+- netdev->stats.tx_window_errors = adapter->stats.latecol;
+- netdev->stats.tx_carrier_errors = adapter->stats.tncrs;
++ net_stats->tx_errors = adapter->stats.ecol +
++ adapter->stats.latecol;
++ net_stats->tx_aborted_errors = adapter->stats.ecol;
++ net_stats->tx_window_errors = adapter->stats.latecol;
++ net_stats->tx_carrier_errors = adapter->stats.tncrs;
+
+ /* Tx Dropped needs to be maintained elsewhere */
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0066-igb-removed-unused-tx-rx-total-bytes-packets-from-ad.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0066-igb-removed-unused-tx-rx-total-bytes-packets-from-ad.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,35 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Thu, 12 Nov 2009 18:37:56 +0000
+Subject: [PATCH 066/165] igb: removed unused tx/rx total bytes/packets from
+ adapter struct
+
+commit 971d1d3a7e9f03af870909fddfc3b2fc08e4f5b1 upstream.
+
+This patch removes unused variables total_tx_bytes, total_tx_packets,
+total_rx_bytes, and total_rx_packets from the adapter struct.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb.h | 4 ----
+ 1 files changed, 0 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
+index 2bb9549..63abd1c 100644
+--- a/drivers/net/igb/igb.h
++++ b/drivers/net/igb/igb.h
+@@ -249,10 +249,6 @@ struct igb_adapter {
+ u16 link_speed;
+ u16 link_duplex;
+
+- unsigned int total_tx_bytes;
+- unsigned int total_tx_packets;
+- unsigned int total_rx_bytes;
+- unsigned int total_rx_packets;
+ /* Interrupt Throttle Rate */
+ u32 rx_itr_setting;
+ u32 tx_itr_setting;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0067-igb-check-for-packets-on-all-tx-rings-when-link-is-d.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0067-igb-check-for-packets-on-all-tx-rings-when-link-is-d.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,69 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Thu, 12 Nov 2009 18:38:16 +0000
+Subject: [PATCH 067/165] igb: check for packets on all tx rings when link is
+ down
+
+commit dbabb065802a46d64b8869ba97674bfa90b55d83 upstream.
+
+We were previously only checking the first tx ring to see if it had any
+packets in it when the link when down. However we should be checking all
+of the rings so this patch makes it so that all of the rings are now being
+checked.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 23 ++++++++++++-----------
+ 1 files changed, 12 insertions(+), 11 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index c433b6b..2739ccd 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -2943,7 +2943,6 @@ static void igb_watchdog_task(struct work_struct *work)
+ watchdog_task);
+ struct e1000_hw *hw = &adapter->hw;
+ struct net_device *netdev = adapter->netdev;
+- struct igb_ring *tx_ring = adapter->tx_ring;
+ u32 link;
+ int i;
+
+@@ -3013,22 +3012,24 @@ static void igb_watchdog_task(struct work_struct *work)
+ igb_update_stats(adapter);
+ igb_update_adaptive(hw);
+
+- if (!netif_carrier_ok(netdev)) {
+- if (igb_desc_unused(tx_ring) + 1 < tx_ring->count) {
++ for (i = 0; i < adapter->num_tx_queues; i++) {
++ struct igb_ring *tx_ring = &adapter->tx_ring[i];
++ if (!netif_carrier_ok(netdev)) {
+ /* We've lost link, so the controller stops DMA,
+ * but we've got queued Tx work that's never going
+ * to get done, so reset controller to flush Tx.
+ * (Do the reset outside of interrupt context). */
+- adapter->tx_timeout_count++;
+- schedule_work(&adapter->reset_task);
+- /* return immediately since reset is imminent */
+- return;
++ if (igb_desc_unused(tx_ring) + 1 < tx_ring->count) {
++ adapter->tx_timeout_count++;
++ schedule_work(&adapter->reset_task);
++ /* return immediately since reset is imminent */
++ return;
++ }
+ }
+- }
+
+- /* Force detection of hung controller every watchdog period */
+- for (i = 0; i < adapter->num_tx_queues; i++)
+- adapter->tx_ring[i].detect_tx_hung = true;
++ /* Force detection of hung controller every watchdog period */
++ tx_ring->detect_tx_hung = true;
++ }
+
+ /* Cause software interrupt to ensure rx ring is cleaned */
+ if (adapter->msix_entries) {
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0068-igb-only-recycle-page-if-it-is-on-our-numa-node.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0068-igb-only-recycle-page-if-it-is-on-our-numa-node.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,42 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Thu, 12 Nov 2009 18:38:35 +0000
+Subject: [PATCH 068/165] igb: only recycle page if it is on our numa node
+
+commit d1eff35061b9346cb9bef2b79d9d99c8c096df13 upstream.
+
+This patch makes it so that we only recycle pages when they are from the
+local NUMA node. Non-local pages are freed and replaced with locally
+allocated pages.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 4 +++-
+ 1 files changed, 3 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 2739ccd..19827f4 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -4952,6 +4952,7 @@ static bool igb_clean_rx_irq_adv(struct igb_q_vector *q_vector,
+ struct sk_buff *skb;
+ bool cleaned = false;
+ int cleaned_count = 0;
++ int current_node = numa_node_id();
+ unsigned int total_bytes = 0, total_packets = 0;
+ unsigned int i;
+ u32 staterr;
+@@ -5006,7 +5007,8 @@ static bool igb_clean_rx_irq_adv(struct igb_q_vector *q_vector,
+ buffer_info->page_offset,
+ length);
+
+- if (page_count(buffer_info->page) != 1)
++ if ((page_count(buffer_info->page) != 1) ||
++ (page_to_nid(buffer_info->page) != current_node))
+ buffer_info->page = NULL;
+ else
+ get_page(buffer_info->page);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0069-drivers-net-request_irq-Remove-unnecessary-leading-f.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0069-drivers-net-request_irq-Remove-unnecessary-leading-f.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,127 @@
+From: Joe Perches <joe at perches.com>
+Date: Wed, 18 Nov 2009 23:29:17 -0800
+Subject: [PATCH 069/165] drivers/net: request_irq - Remove unnecessary
+ leading & from second arg
+
+commit a0607fd3a25ba1848a63a0d925e36d914735ab47 upstream.
+
+Not as fancy as coccinelle. Checkpatch errors ignored.
+Compile tested allyesconfig x86, not all files compiled.
+
+grep -rPl --include=*.[ch] "\brequest_irq\s*\([^,\)]+,\s*\&" drivers/net | while read file ; do \
+ perl -i -e 'local $/; while (<>) { s@(\brequest_irq\s*\([^,\)]+,\s*)\&@\1 at g ; print ; }' $file ;\
+done
+
+Signed-off-by: Joe Perches <joe at perches.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Restricted to drivers/net/igb{,vf}]
+---
+ drivers/net/igb/igb_ethtool.c | 8 ++++----
+ drivers/net/igb/igb_main.c | 8 ++++----
+ drivers/net/igbvf/netdev.c | 6 +++---
+ 3 files changed, 11 insertions(+), 11 deletions(-)
+
+diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
+index 88e13f7..2e238bf 100644
+--- a/drivers/net/igb/igb_ethtool.c
++++ b/drivers/net/igb/igb_ethtool.c
+@@ -1133,21 +1133,21 @@ static int igb_intr_test(struct igb_adapter *adapter, u64 *data)
+ /* Hook up test interrupt handler just for this test */
+ if (adapter->msix_entries) {
+ if (request_irq(adapter->msix_entries[0].vector,
+- &igb_test_intr, 0, netdev->name, adapter)) {
++ igb_test_intr, 0, netdev->name, adapter)) {
+ *data = 1;
+ return -1;
+ }
+ } else if (adapter->flags & IGB_FLAG_HAS_MSI) {
+ shared_int = false;
+ if (request_irq(irq,
+- &igb_test_intr, 0, netdev->name, adapter)) {
++ igb_test_intr, 0, netdev->name, adapter)) {
+ *data = 1;
+ return -1;
+ }
+- } else if (!request_irq(irq, &igb_test_intr, IRQF_PROBE_SHARED,
++ } else if (!request_irq(irq, igb_test_intr, IRQF_PROBE_SHARED,
+ netdev->name, adapter)) {
+ shared_int = false;
+- } else if (request_irq(irq, &igb_test_intr, IRQF_SHARED,
++ } else if (request_irq(irq, igb_test_intr, IRQF_SHARED,
+ netdev->name, adapter)) {
+ *data = 1;
+ return -1;
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 19827f4..1f08719 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -525,7 +525,7 @@ static int igb_request_msix(struct igb_adapter *adapter)
+ int i, err = 0, vector = 0;
+
+ err = request_irq(adapter->msix_entries[vector].vector,
+- &igb_msix_other, 0, netdev->name, adapter);
++ igb_msix_other, 0, netdev->name, adapter);
+ if (err)
+ goto out;
+ vector++;
+@@ -548,7 +548,7 @@ static int igb_request_msix(struct igb_adapter *adapter)
+ sprintf(q_vector->name, "%s-unused", netdev->name);
+
+ err = request_irq(adapter->msix_entries[vector].vector,
+- &igb_msix_ring, 0, q_vector->name,
++ igb_msix_ring, 0, q_vector->name,
+ q_vector);
+ if (err)
+ goto out;
+@@ -875,7 +875,7 @@ static int igb_request_irq(struct igb_adapter *adapter)
+ }
+
+ if (adapter->flags & IGB_FLAG_HAS_MSI) {
+- err = request_irq(adapter->pdev->irq, &igb_intr_msi, 0,
++ err = request_irq(adapter->pdev->irq, igb_intr_msi, 0,
+ netdev->name, adapter);
+ if (!err)
+ goto request_done;
+@@ -885,7 +885,7 @@ static int igb_request_irq(struct igb_adapter *adapter)
+ adapter->flags &= ~IGB_FLAG_HAS_MSI;
+ }
+
+- err = request_irq(adapter->pdev->irq, &igb_intr, IRQF_SHARED,
++ err = request_irq(adapter->pdev->irq, igb_intr, IRQF_SHARED,
+ netdev->name, adapter);
+
+ if (err)
+diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
+index fad7f34..e01f445 100644
+--- a/drivers/net/igbvf/netdev.c
++++ b/drivers/net/igbvf/netdev.c
+@@ -1043,7 +1043,7 @@ static int igbvf_request_msix(struct igbvf_adapter *adapter)
+ }
+
+ err = request_irq(adapter->msix_entries[vector].vector,
+- &igbvf_intr_msix_tx, 0, adapter->tx_ring->name,
++ igbvf_intr_msix_tx, 0, adapter->tx_ring->name,
+ netdev);
+ if (err)
+ goto out;
+@@ -1053,7 +1053,7 @@ static int igbvf_request_msix(struct igbvf_adapter *adapter)
+ vector++;
+
+ err = request_irq(adapter->msix_entries[vector].vector,
+- &igbvf_intr_msix_rx, 0, adapter->rx_ring->name,
++ igbvf_intr_msix_rx, 0, adapter->rx_ring->name,
+ netdev);
+ if (err)
+ goto out;
+@@ -1063,7 +1063,7 @@ static int igbvf_request_msix(struct igbvf_adapter *adapter)
+ vector++;
+
+ err = request_irq(adapter->msix_entries[vector].vector,
+- &igbvf_msix_other, 0, netdev->name, netdev);
++ igbvf_msix_other, 0, netdev->name, netdev);
+ if (err)
+ goto out;
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0070-igb-add-support-for-the-82580-phy.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0070-igb-add-support-for-the-82580-phy.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,339 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Thu, 19 Nov 2009 12:41:42 +0000
+Subject: [PATCH 070/165] igb: add support for the 82580 phy
+
+commit 2909c3f79d933b55bf2485addb1dca762210b6af upstream.
+
+This patch adds support for the phy included in the 82580 silicon family.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/e1000_hw.h | 1 +
+ drivers/net/igb/e1000_phy.c | 242 +++++++++++++++++++++++++++++++++++++++++++
+ drivers/net/igb/e1000_phy.h | 32 ++++++
+ 3 files changed, 275 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/igb/e1000_hw.h b/drivers/net/igb/e1000_hw.h
+index 2dc9294..5deda3e 100644
+--- a/drivers/net/igb/e1000_hw.h
++++ b/drivers/net/igb/e1000_hw.h
+@@ -93,6 +93,7 @@ enum e1000_phy_type {
+ e1000_phy_gg82563,
+ e1000_phy_igp_3,
+ e1000_phy_ife,
++ e1000_phy_82580,
+ };
+
+ enum e1000_bus_type {
+diff --git a/drivers/net/igb/e1000_phy.c b/drivers/net/igb/e1000_phy.c
+index 83b706c..b8fbc85 100644
+--- a/drivers/net/igb/e1000_phy.c
++++ b/drivers/net/igb/e1000_phy.c
+@@ -421,6 +421,57 @@ out:
+ }
+
+ /**
++ * igb_copper_link_setup_82580 - Setup 82580 PHY for copper link
++ * @hw: pointer to the HW structure
++ *
++ * Sets up Carrier-sense on Transmit and downshift values.
++ **/
++s32 igb_copper_link_setup_82580(struct e1000_hw *hw)
++{
++ struct e1000_phy_info *phy = &hw->phy;
++ s32 ret_val;
++ u16 phy_data;
++
++
++ if (phy->reset_disable) {
++ ret_val = 0;
++ goto out;
++ }
++
++ if (phy->type == e1000_phy_82580) {
++ ret_val = hw->phy.ops.reset(hw);
++ if (ret_val) {
++ hw_dbg("Error resetting the PHY.\n");
++ goto out;
++ }
++ }
++
++ /* Enable CRS on TX. This must be set for half-duplex operation. */
++ ret_val = phy->ops.read_reg(hw, I82580_CFG_REG, &phy_data);
++ if (ret_val)
++ goto out;
++
++ phy_data |= I82580_CFG_ASSERT_CRS_ON_TX;
++
++ /* Enable downshift */
++ phy_data |= I82580_CFG_ENABLE_DOWNSHIFT;
++
++ ret_val = phy->ops.write_reg(hw, I82580_CFG_REG, phy_data);
++ if (ret_val)
++ goto out;
++
++ /* Set number of link attempts before downshift */
++ ret_val = phy->ops.read_reg(hw, I82580_CTRL_REG, &phy_data);
++ if (ret_val)
++ goto out;
++ phy_data &= ~I82580_CTRL_DOWNSHIFT_MASK;
++ ret_val = phy->ops.write_reg(hw, I82580_CTRL_REG, phy_data);
++
++out:
++ return ret_val;
++}
++
++/**
+ * igb_copper_link_setup_m88 - Setup m88 PHY's for copper link
+ * @hw: pointer to the HW structure
+ *
+@@ -1888,3 +1939,194 @@ s32 igb_phy_init_script_igp3(struct e1000_hw *hw)
+ return 0;
+ }
+
++/**
++ * igb_check_polarity_82580 - Checks the polarity.
++ * @hw: pointer to the HW structure
++ *
++ * Success returns 0, Failure returns -E1000_ERR_PHY (-2)
++ *
++ * Polarity is determined based on the PHY specific status register.
++ **/
++s32 igb_check_polarity_82580(struct e1000_hw *hw)
++{
++ struct e1000_phy_info *phy = &hw->phy;
++ s32 ret_val;
++ u16 data;
++
++
++ ret_val = phy->ops.read_reg(hw, I82580_PHY_STATUS_2, &data);
++
++ if (!ret_val)
++ phy->cable_polarity = (data & I82580_PHY_STATUS2_REV_POLARITY)
++ ? e1000_rev_polarity_reversed
++ : e1000_rev_polarity_normal;
++
++ return ret_val;
++}
++
++/**
++ * igb_phy_force_speed_duplex_82580 - Force speed/duplex for I82580 PHY
++ * @hw: pointer to the HW structure
++ *
++ * Calls the PHY setup function to force speed and duplex. Clears the
++ * auto-crossover to force MDI manually. Waits for link and returns
++ * successful if link up is successful, else -E1000_ERR_PHY (-2).
++ **/
++s32 igb_phy_force_speed_duplex_82580(struct e1000_hw *hw)
++{
++ struct e1000_phy_info *phy = &hw->phy;
++ s32 ret_val;
++ u16 phy_data;
++ bool link;
++
++
++ ret_val = phy->ops.read_reg(hw, PHY_CONTROL, &phy_data);
++ if (ret_val)
++ goto out;
++
++ igb_phy_force_speed_duplex_setup(hw, &phy_data);
++
++ ret_val = phy->ops.write_reg(hw, PHY_CONTROL, phy_data);
++ if (ret_val)
++ goto out;
++
++ /*
++ * Clear Auto-Crossover to force MDI manually. 82580 requires MDI
++ * forced whenever speed and duplex are forced.
++ */
++ ret_val = phy->ops.read_reg(hw, I82580_PHY_CTRL_2, &phy_data);
++ if (ret_val)
++ goto out;
++
++ phy_data &= ~I82580_PHY_CTRL2_AUTO_MDIX;
++ phy_data &= ~I82580_PHY_CTRL2_FORCE_MDI_MDIX;
++
++ ret_val = phy->ops.write_reg(hw, I82580_PHY_CTRL_2, phy_data);
++ if (ret_val)
++ goto out;
++
++ hw_dbg("I82580_PHY_CTRL_2: %X\n", phy_data);
++
++ udelay(1);
++
++ if (phy->autoneg_wait_to_complete) {
++ hw_dbg("Waiting for forced speed/duplex link on 82580 phy\n");
++
++ ret_val = igb_phy_has_link(hw,
++ PHY_FORCE_LIMIT,
++ 100000,
++ &link);
++ if (ret_val)
++ goto out;
++
++ if (!link)
++ hw_dbg("Link taking longer than expected.\n");
++
++ /* Try once more */
++ ret_val = igb_phy_has_link(hw,
++ PHY_FORCE_LIMIT,
++ 100000,
++ &link);
++ if (ret_val)
++ goto out;
++ }
++
++out:
++ return ret_val;
++}
++
++/**
++ * igb_get_phy_info_82580 - Retrieve I82580 PHY information
++ * @hw: pointer to the HW structure
++ *
++ * Read PHY status to determine if link is up. If link is up, then
++ * set/determine 10base-T extended distance and polarity correction. Read
++ * PHY port status to determine MDI/MDIx and speed. Based on the speed,
++ * determine on the cable length, local and remote receiver.
++ **/
++s32 igb_get_phy_info_82580(struct e1000_hw *hw)
++{
++ struct e1000_phy_info *phy = &hw->phy;
++ s32 ret_val;
++ u16 data;
++ bool link;
++
++
++ ret_val = igb_phy_has_link(hw, 1, 0, &link);
++ if (ret_val)
++ goto out;
++
++ if (!link) {
++ hw_dbg("Phy info is only valid if link is up\n");
++ ret_val = -E1000_ERR_CONFIG;
++ goto out;
++ }
++
++ phy->polarity_correction = true;
++
++ ret_val = igb_check_polarity_82580(hw);
++ if (ret_val)
++ goto out;
++
++ ret_val = phy->ops.read_reg(hw, I82580_PHY_STATUS_2, &data);
++ if (ret_val)
++ goto out;
++
++ phy->is_mdix = (data & I82580_PHY_STATUS2_MDIX) ? true : false;
++
++ if ((data & I82580_PHY_STATUS2_SPEED_MASK) ==
++ I82580_PHY_STATUS2_SPEED_1000MBPS) {
++ ret_val = hw->phy.ops.get_cable_length(hw);
++ if (ret_val)
++ goto out;
++
++ ret_val = phy->ops.read_reg(hw, PHY_1000T_STATUS, &data);
++ if (ret_val)
++ goto out;
++
++ phy->local_rx = (data & SR_1000T_LOCAL_RX_STATUS)
++ ? e1000_1000t_rx_status_ok
++ : e1000_1000t_rx_status_not_ok;
++
++ phy->remote_rx = (data & SR_1000T_REMOTE_RX_STATUS)
++ ? e1000_1000t_rx_status_ok
++ : e1000_1000t_rx_status_not_ok;
++ } else {
++ phy->cable_length = E1000_CABLE_LENGTH_UNDEFINED;
++ phy->local_rx = e1000_1000t_rx_status_undefined;
++ phy->remote_rx = e1000_1000t_rx_status_undefined;
++ }
++
++out:
++ return ret_val;
++}
++
++/**
++ * igb_get_cable_length_82580 - Determine cable length for 82580 PHY
++ * @hw: pointer to the HW structure
++ *
++ * Reads the diagnostic status register and verifies result is valid before
++ * placing it in the phy_cable_length field.
++ **/
++s32 igb_get_cable_length_82580(struct e1000_hw *hw)
++{
++ struct e1000_phy_info *phy = &hw->phy;
++ s32 ret_val;
++ u16 phy_data, length;
++
++
++ ret_val = phy->ops.read_reg(hw, I82580_PHY_DIAG_STATUS, &phy_data);
++ if (ret_val)
++ goto out;
++
++ length = (phy_data & I82580_DSTATUS_CABLE_LENGTH) >>
++ I82580_DSTATUS_CABLE_LENGTH_SHIFT;
++
++ if (length == E1000_CABLE_LENGTH_UNDEFINED)
++ ret_val = -E1000_ERR_PHY;
++
++ phy->cable_length = length;
++
++out:
++ return ret_val;
++}
+diff --git a/drivers/net/igb/e1000_phy.h b/drivers/net/igb/e1000_phy.h
+index adb9436..e23b021 100644
+--- a/drivers/net/igb/e1000_phy.h
++++ b/drivers/net/igb/e1000_phy.h
+@@ -63,6 +63,11 @@ s32 igb_phy_has_link(struct e1000_hw *hw, u32 iterations,
+ s32 igb_phy_init_script_igp3(struct e1000_hw *hw);
+ s32 igb_read_phy_reg_i2c(struct e1000_hw *hw, u32 offset, u16 *data);
+ s32 igb_write_phy_reg_i2c(struct e1000_hw *hw, u32 offset, u16 data);
++s32 igb_copper_link_setup_82580(struct e1000_hw *hw);
++s32 igb_check_polarity_82580(struct e1000_hw *hw);
++s32 igb_get_phy_info_82580(struct e1000_hw *hw);
++s32 igb_phy_force_speed_duplex_82580(struct e1000_hw *hw);
++s32 igb_get_cable_length_82580(struct e1000_hw *hw);
+
+ /* IGP01E1000 Specific Registers */
+ #define IGP01E1000_PHY_PORT_CONFIG 0x10 /* Port Config */
+@@ -77,6 +82,33 @@ s32 igb_write_phy_reg_i2c(struct e1000_hw *hw, u32 offset, u16 data);
+ #define IGP01E1000_PSCR_FORCE_MDI_MDIX 0x2000 /* 0=MDI, 1=MDIX */
+ #define IGP01E1000_PSCFR_SMART_SPEED 0x0080
+
++#define I82580_ADDR_REG 16
++#define I82580_CFG_REG 22
++#define I82580_CFG_ASSERT_CRS_ON_TX (1 << 15)
++#define I82580_CFG_ENABLE_DOWNSHIFT (3 << 10) /* auto downshift 100/10 */
++#define I82580_CTRL_REG 23
++#define I82580_CTRL_DOWNSHIFT_MASK (7 << 10)
++
++/* 82580 specific PHY registers */
++#define I82580_PHY_CTRL_2 18
++#define I82580_PHY_LBK_CTRL 19
++#define I82580_PHY_STATUS_2 26
++#define I82580_PHY_DIAG_STATUS 31
++
++/* I82580 PHY Status 2 */
++#define I82580_PHY_STATUS2_REV_POLARITY 0x0400
++#define I82580_PHY_STATUS2_MDIX 0x0800
++#define I82580_PHY_STATUS2_SPEED_MASK 0x0300
++#define I82580_PHY_STATUS2_SPEED_1000MBPS 0x0200
++#define I82580_PHY_STATUS2_SPEED_100MBPS 0x0100
++
++/* I82580 PHY Control 2 */
++#define I82580_PHY_CTRL2_AUTO_MDIX 0x0400
++#define I82580_PHY_CTRL2_FORCE_MDI_MDIX 0x0200
++
++/* I82580 PHY Diagnostics Status */
++#define I82580_DSTATUS_CABLE_LENGTH 0x03FC
++#define I82580_DSTATUS_CABLE_LENGTH_SHIFT 2
+ /* Enable flexible speed on link-up */
+ #define IGP02E1000_PM_D0_LPLU 0x0002 /* For D0a states */
+ #define IGP02E1000_PM_D3_LPLU 0x0004 /* For all other states */
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0071-igb-add-support-for-82580-MAC.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0071-igb-add-support-for-82580-MAC.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,633 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Thu, 19 Nov 2009 12:42:01 +0000
+Subject: [PATCH 071/165] igb: add support for 82580 MAC
+
+commit bb2ac47bcfd47ed9431ff1676ec8d79250c941c9 upstream.
+
+This patch adds support for the 82580 MAC.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/e1000_82575.c | 302 ++++++++++++++++++++++++++++++++++-----
+ drivers/net/igb/e1000_82575.h | 6 +
+ drivers/net/igb/e1000_defines.h | 10 +-
+ drivers/net/igb/e1000_hw.h | 13 ++
+ drivers/net/igb/e1000_phy.c | 6 +-
+ drivers/net/igb/e1000_phy.h | 3 +-
+ drivers/net/igb/e1000_regs.h | 1 +
+ 7 files changed, 299 insertions(+), 42 deletions(-)
+
+diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c
+index 5d345e3..e8e9e91 100644
+--- a/drivers/net/igb/e1000_82575.c
++++ b/drivers/net/igb/e1000_82575.c
+@@ -46,7 +46,10 @@ static s32 igb_get_cfg_done_82575(struct e1000_hw *);
+ static s32 igb_init_hw_82575(struct e1000_hw *);
+ static s32 igb_phy_hw_reset_sgmii_82575(struct e1000_hw *);
+ static s32 igb_read_phy_reg_sgmii_82575(struct e1000_hw *, u32, u16 *);
++static s32 igb_read_phy_reg_82580(struct e1000_hw *, u32, u16 *);
++static s32 igb_write_phy_reg_82580(struct e1000_hw *, u32, u16);
+ static s32 igb_reset_hw_82575(struct e1000_hw *);
++static s32 igb_reset_hw_82580(struct e1000_hw *);
+ static s32 igb_set_d0_lplu_state_82575(struct e1000_hw *, bool);
+ static s32 igb_setup_copper_link_82575(struct e1000_hw *);
+ static s32 igb_setup_serdes_link_82575(struct e1000_hw *);
+@@ -62,6 +65,12 @@ static s32 igb_reset_init_script_82575(struct e1000_hw *);
+ static s32 igb_read_mac_addr_82575(struct e1000_hw *);
+ static s32 igb_set_pcie_completion_timeout(struct e1000_hw *hw);
+
++static const u16 e1000_82580_rxpbs_table[] =
++ { 36, 72, 144, 1, 2, 4, 8, 16,
++ 35, 70, 140 };
++#define E1000_82580_RXPBS_TABLE_SIZE \
++ (sizeof(e1000_82580_rxpbs_table)/sizeof(u16))
++
+ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
+ {
+ struct e1000_phy_info *phy = &hw->phy;
+@@ -88,6 +97,13 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
+ case E1000_DEV_ID_82576_SERDES_QUAD:
+ mac->type = e1000_82576;
+ break;
++ case E1000_DEV_ID_82580_COPPER:
++ case E1000_DEV_ID_82580_FIBER:
++ case E1000_DEV_ID_82580_SERDES:
++ case E1000_DEV_ID_82580_SGMII:
++ case E1000_DEV_ID_82580_COPPER_DUAL:
++ mac->type = e1000_82580;
++ break;
+ default:
+ return -E1000_ERR_MAC_INIT;
+ break;
+@@ -110,6 +126,7 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
+ dev_spec->sgmii_active = true;
+ ctrl_ext |= E1000_CTRL_I2C_ENA;
+ break;
++ case E1000_CTRL_EXT_LINK_MODE_1000BASE_KX:
+ case E1000_CTRL_EXT_LINK_MODE_PCIE_SERDES:
+ hw->phy.media_type = e1000_media_type_internal_serdes;
+ ctrl_ext |= E1000_CTRL_I2C_ENA;
+@@ -121,12 +138,26 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
+
+ wr32(E1000_CTRL_EXT, ctrl_ext);
+
++ /*
++ * if using i2c make certain the MDICNFG register is cleared to prevent
++ * communications from being misrouted to the mdic registers
++ */
++ if ((ctrl_ext & E1000_CTRL_I2C_ENA) && (hw->mac.type == e1000_82580))
++ wr32(E1000_MDICNFG, 0);
++
+ /* Set mta register count */
+ mac->mta_reg_count = 128;
+ /* Set rar entry count */
+ mac->rar_entry_count = E1000_RAR_ENTRIES_82575;
+ if (mac->type == e1000_82576)
+ mac->rar_entry_count = E1000_RAR_ENTRIES_82576;
++ if (mac->type == e1000_82580)
++ mac->rar_entry_count = E1000_RAR_ENTRIES_82580;
++ /* reset */
++ if (mac->type == e1000_82580)
++ mac->ops.reset_hw = igb_reset_hw_82580;
++ else
++ mac->ops.reset_hw = igb_reset_hw_82575;
+ /* Set if part includes ASF firmware */
+ mac->asf_firmware_present = true;
+ /* Set if manageability features are enabled. */
+@@ -194,6 +225,10 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
+ phy->ops.reset = igb_phy_hw_reset_sgmii_82575;
+ phy->ops.read_reg = igb_read_phy_reg_sgmii_82575;
+ phy->ops.write_reg = igb_write_phy_reg_sgmii_82575;
++ } else if (hw->mac.type == e1000_82580) {
++ phy->ops.reset = igb_phy_hw_reset;
++ phy->ops.read_reg = igb_read_phy_reg_82580;
++ phy->ops.write_reg = igb_write_phy_reg_82580;
+ } else {
+ phy->ops.reset = igb_phy_hw_reset;
+ phy->ops.read_reg = igb_read_phy_reg_igp;
+@@ -225,6 +260,12 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
+ phy->ops.set_d0_lplu_state = igb_set_d0_lplu_state_82575;
+ phy->ops.set_d3_lplu_state = igb_set_d3_lplu_state;
+ break;
++ case I82580_I_PHY_ID:
++ phy->type = e1000_phy_82580;
++ phy->ops.force_speed_duplex = igb_phy_force_speed_duplex_82580;
++ phy->ops.get_cable_length = igb_get_cable_length_82580;
++ phy->ops.get_phy_info = igb_get_phy_info_82580;
++ break;
+ default:
+ return -E1000_ERR_PHY;
+ }
+@@ -635,6 +676,10 @@ static s32 igb_get_cfg_done_82575(struct e1000_hw *hw)
+
+ if (hw->bus.func == 1)
+ mask = E1000_NVM_CFG_DONE_PORT_1;
++ else if (hw->bus.func == E1000_FUNC_2)
++ mask = E1000_NVM_CFG_DONE_PORT_2;
++ else if (hw->bus.func == E1000_FUNC_3)
++ mask = E1000_NVM_CFG_DONE_PORT_3;
+
+ while (timeout) {
+ if (rd32(E1000_EEMNGCTL) & mask)
+@@ -754,6 +799,10 @@ void igb_shutdown_serdes_link_82575(struct e1000_hw *hw)
+
+ if (hw->bus.func == E1000_FUNC_0)
+ hw->nvm.ops.read(hw, NVM_INIT_CONTROL3_PORT_A, 1, &eeprom_data);
++ else if (hw->mac.type == e1000_82580)
++ hw->nvm.ops.read(hw, NVM_INIT_CONTROL3_PORT_A +
++ NVM_82580_LAN_FUNC_OFFSET(hw->bus.func), 1,
++ &eeprom_data);
+ else if (hw->bus.func == E1000_FUNC_1)
+ hw->nvm.ops.read(hw, NVM_INIT_CONTROL3_PORT_B, 1, &eeprom_data);
+
+@@ -918,6 +967,9 @@ static s32 igb_setup_copper_link_82575(struct e1000_hw *hw)
+ goto out;
+
+ if (igb_sgmii_active_82575(hw) && !hw->phy.reset_disable) {
++ /* allow time for SFP cage time to power up phy */
++ msleep(300);
++
+ ret_val = hw->phy.ops.reset(hw);
+ if (ret_val) {
+ hw_dbg("Error resetting the PHY.\n");
+@@ -931,6 +983,9 @@ static s32 igb_setup_copper_link_82575(struct e1000_hw *hw)
+ case e1000_phy_igp_3:
+ ret_val = igb_copper_link_setup_igp(hw);
+ break;
++ case e1000_phy_82580:
++ ret_val = igb_copper_link_setup_82580(hw);
++ break;
+ default:
+ ret_val = -E1000_ERR_PHY;
+ break;
+@@ -955,7 +1010,8 @@ out:
+ **/
+ static s32 igb_setup_serdes_link_82575(struct e1000_hw *hw)
+ {
+- u32 ctrl_reg, reg;
++ u32 ctrl_ext, ctrl_reg, reg;
++ bool pcs_autoneg;
+
+ if ((hw->phy.media_type != e1000_media_type_internal_serdes) &&
+ !igb_sgmii_active_82575(hw))
+@@ -970,9 +1026,9 @@ static s32 igb_setup_serdes_link_82575(struct e1000_hw *hw)
+ wr32(E1000_SCTL, E1000_SCTL_DISABLE_SERDES_LOOPBACK);
+
+ /* power on the sfp cage if present */
+- reg = rd32(E1000_CTRL_EXT);
+- reg &= ~E1000_CTRL_EXT_SDP3_DATA;
+- wr32(E1000_CTRL_EXT, reg);
++ ctrl_ext = rd32(E1000_CTRL_EXT);
++ ctrl_ext &= ~E1000_CTRL_EXT_SDP3_DATA;
++ wr32(E1000_CTRL_EXT, ctrl_ext);
+
+ ctrl_reg = rd32(E1000_CTRL);
+ ctrl_reg |= E1000_CTRL_SLU;
+@@ -989,15 +1045,31 @@ static s32 igb_setup_serdes_link_82575(struct e1000_hw *hw)
+
+ reg = rd32(E1000_PCS_LCTL);
+
+- if (igb_sgmii_active_82575(hw)) {
+- /* allow time for SFP cage to power up phy */
+- msleep(300);
++ /* default pcs_autoneg to the same setting as mac autoneg */
++ pcs_autoneg = hw->mac.autoneg;
+
+- /* AN time out should be disabled for SGMII mode */
++ switch (ctrl_ext & E1000_CTRL_EXT_LINK_MODE_MASK) {
++ case E1000_CTRL_EXT_LINK_MODE_SGMII:
++ /* sgmii mode lets the phy handle forcing speed/duplex */
++ pcs_autoneg = true;
++ /* autoneg time out should be disabled for SGMII mode */
+ reg &= ~(E1000_PCS_LCTL_AN_TIMEOUT);
+- } else {
++ break;
++ case E1000_CTRL_EXT_LINK_MODE_1000BASE_KX:
++ /* disable PCS autoneg and support parallel detect only */
++ pcs_autoneg = false;
++ default:
++ /*
++ * non-SGMII modes only supports a speed of 1000/Full for the
++ * link so it is best to just force the MAC and let the pcs
++ * link either autoneg or be forced to 1000/Full
++ */
+ ctrl_reg |= E1000_CTRL_SPD_1000 | E1000_CTRL_FRCSPD |
+ E1000_CTRL_FD | E1000_CTRL_FRCDPX;
++
++ /* set speed of 1000/Full if speed/duplex is forced */
++ reg |= E1000_PCS_LCTL_FSV_1000 | E1000_PCS_LCTL_FDV_FULL;
++ break;
+ }
+
+ wr32(E1000_CTRL, ctrl_reg);
+@@ -1008,7 +1080,6 @@ static s32 igb_setup_serdes_link_82575(struct e1000_hw *hw)
+ * mode that will be compatible with older link partners and switches.
+ * However, both are supported by the hardware and some drivers/tools.
+ */
+-
+ reg &= ~(E1000_PCS_LCTL_AN_ENABLE | E1000_PCS_LCTL_FLV_LINK_UP |
+ E1000_PCS_LCTL_FSD | E1000_PCS_LCTL_FORCE_LINK);
+
+@@ -1018,34 +1089,18 @@ static s32 igb_setup_serdes_link_82575(struct e1000_hw *hw)
+ */
+ reg |= E1000_PCS_LCTL_FORCE_FCTRL;
+
+- /*
+- * we always set sgmii to autoneg since it is the phy that will be
+- * forcing the link and the serdes is just a go-between
+- */
+- if (hw->mac.autoneg || igb_sgmii_active_82575(hw)) {
++ if (pcs_autoneg) {
+ /* Set PCS register for autoneg */
+- reg |= E1000_PCS_LCTL_FSV_1000 | /* Force 1000 */
+- E1000_PCS_LCTL_FDV_FULL | /* SerDes Full dplx */
+- E1000_PCS_LCTL_AN_ENABLE | /* Enable Autoneg */
++ reg |= E1000_PCS_LCTL_AN_ENABLE | /* Enable Autoneg */
+ E1000_PCS_LCTL_AN_RESTART; /* Restart autoneg */
+- hw_dbg("Configuring Autoneg; PCS_LCTL = 0x%08X\n", reg);
++ hw_dbg("Configuring Autoneg:PCS_LCTL=0x%08X\n", reg);
+ } else {
+- /* Check for duplex first */
+- if (hw->mac.forced_speed_duplex & E1000_ALL_FULL_DUPLEX)
+- reg |= E1000_PCS_LCTL_FDV_FULL;
+-
+- /* No need to check for 1000/full since the spec states that
+- * it requires autoneg to be enabled */
+- /* Now set speed */
+- if (hw->mac.forced_speed_duplex & E1000_ALL_100_SPEED)
+- reg |= E1000_PCS_LCTL_FSV_100;
+-
+- /* Force speed and force link */
+- reg |= E1000_PCS_LCTL_FSD |
+- E1000_PCS_LCTL_FORCE_LINK |
+- E1000_PCS_LCTL_FLV_LINK_UP;
+-
+- hw_dbg("Configuring Forced Link; PCS_LCTL = 0x%08X\n", reg);
++ /* Set PCS register for forced link */
++ reg |= E1000_PCS_LCTL_FSD | /* Force Speed */
++ E1000_PCS_LCTL_FORCE_LINK | /* Force Link */
++ E1000_PCS_LCTL_FLV_LINK_UP; /* Force link value up */
++
++ hw_dbg("Configuring Forced Link:PCS_LCTL=0x%08X\n", reg);
+ }
+
+ wr32(E1000_PCS_LCTL, reg);
+@@ -1354,8 +1409,183 @@ void igb_vmdq_set_replication_pf(struct e1000_hw *hw, bool enable)
+ wr32(E1000_VT_CTL, vt_ctl);
+ }
+
++/**
++ * igb_read_phy_reg_82580 - Read 82580 MDI control register
++ * @hw: pointer to the HW structure
++ * @offset: register offset to be read
++ * @data: pointer to the read data
++ *
++ * Reads the MDI control register in the PHY at offset and stores the
++ * information read to data.
++ **/
++static s32 igb_read_phy_reg_82580(struct e1000_hw *hw, u32 offset, u16 *data)
++{
++ u32 mdicnfg = 0;
++ s32 ret_val;
++
++
++ ret_val = hw->phy.ops.acquire(hw);
++ if (ret_val)
++ goto out;
++
++ /*
++ * We config the phy address in MDICNFG register now. Same bits
++ * as before. The values in MDIC can be written but will be
++ * ignored. This allows us to call the old function after
++ * configuring the PHY address in the new register
++ */
++ mdicnfg = (hw->phy.addr << E1000_MDIC_PHY_SHIFT);
++ wr32(E1000_MDICNFG, mdicnfg);
++
++ ret_val = igb_read_phy_reg_mdic(hw, offset, data);
++
++ hw->phy.ops.release(hw);
++
++out:
++ return ret_val;
++}
++
++/**
++ * igb_write_phy_reg_82580 - Write 82580 MDI control register
++ * @hw: pointer to the HW structure
++ * @offset: register offset to write to
++ * @data: data to write to register at offset
++ *
++ * Writes data to MDI control register in the PHY at offset.
++ **/
++static s32 igb_write_phy_reg_82580(struct e1000_hw *hw, u32 offset, u16 data)
++{
++ u32 mdicnfg = 0;
++ s32 ret_val;
++
++
++ ret_val = hw->phy.ops.acquire(hw);
++ if (ret_val)
++ goto out;
++
++ /*
++ * We config the phy address in MDICNFG register now. Same bits
++ * as before. The values in MDIC can be written but will be
++ * ignored. This allows us to call the old function after
++ * configuring the PHY address in the new register
++ */
++ mdicnfg = (hw->phy.addr << E1000_MDIC_PHY_SHIFT);
++ wr32(E1000_MDICNFG, mdicnfg);
++
++ ret_val = igb_write_phy_reg_mdic(hw, offset, data);
++
++ hw->phy.ops.release(hw);
++
++out:
++ return ret_val;
++}
++
++/**
++ * igb_reset_hw_82580 - Reset hardware
++ * @hw: pointer to the HW structure
++ *
++ * This resets function or entire device (all ports, etc.)
++ * to a known state.
++ **/
++static s32 igb_reset_hw_82580(struct e1000_hw *hw)
++{
++ s32 ret_val = 0;
++ /* BH SW mailbox bit in SW_FW_SYNC */
++ u16 swmbsw_mask = E1000_SW_SYNCH_MB;
++ u32 ctrl, icr;
++ bool global_device_reset = hw->dev_spec._82575.global_device_reset;
++
++
++ hw->dev_spec._82575.global_device_reset = false;
++
++ /* Get current control state. */
++ ctrl = rd32(E1000_CTRL);
++
++ /*
++ * Prevent the PCI-E bus from sticking if there is no TLP connection
++ * on the last TLP read/write transaction when MAC is reset.
++ */
++ ret_val = igb_disable_pcie_master(hw);
++ if (ret_val)
++ hw_dbg("PCI-E Master disable polling has failed.\n");
++
++ hw_dbg("Masking off all interrupts\n");
++ wr32(E1000_IMC, 0xffffffff);
++ wr32(E1000_RCTL, 0);
++ wr32(E1000_TCTL, E1000_TCTL_PSP);
++ wrfl();
++
++ msleep(10);
++
++ /* Determine whether or not a global dev reset is requested */
++ if (global_device_reset &&
++ igb_acquire_swfw_sync_82575(hw, swmbsw_mask))
++ global_device_reset = false;
++
++ if (global_device_reset &&
++ !(rd32(E1000_STATUS) & E1000_STAT_DEV_RST_SET))
++ ctrl |= E1000_CTRL_DEV_RST;
++ else
++ ctrl |= E1000_CTRL_RST;
++
++ wr32(E1000_CTRL, ctrl);
++
++ /* Add delay to insure DEV_RST has time to complete */
++ if (global_device_reset)
++ msleep(5);
++
++ ret_val = igb_get_auto_rd_done(hw);
++ if (ret_val) {
++ /*
++ * When auto config read does not complete, do not
++ * return with an error. This can happen in situations
++ * where there is no eeprom and prevents getting link.
++ */
++ hw_dbg("Auto Read Done did not complete\n");
++ }
++
++ /* If EEPROM is not present, run manual init scripts */
++ if ((rd32(E1000_EECD) & E1000_EECD_PRES) == 0)
++ igb_reset_init_script_82575(hw);
++
++ /* clear global device reset status bit */
++ wr32(E1000_STATUS, E1000_STAT_DEV_RST_SET);
++
++ /* Clear any pending interrupt events. */
++ wr32(E1000_IMC, 0xffffffff);
++ icr = rd32(E1000_ICR);
++
++ /* Install any alternate MAC address into RAR0 */
++ ret_val = igb_check_alt_mac_addr(hw);
++
++ /* Release semaphore */
++ if (global_device_reset)
++ igb_release_swfw_sync_82575(hw, swmbsw_mask);
++
++ return ret_val;
++}
++
++/**
++ * igb_rxpbs_adjust_82580 - adjust RXPBS value to reflect actual RX PBA size
++ * @data: data received by reading RXPBS register
++ *
++ * The 82580 uses a table based approach for packet buffer allocation sizes.
++ * This function converts the retrieved value into the correct table value
++ * 0x0 0x1 0x2 0x3 0x4 0x5 0x6 0x7
++ * 0x0 36 72 144 1 2 4 8 16
++ * 0x8 35 70 140 rsv rsv rsv rsv rsv
++ */
++u16 igb_rxpbs_adjust_82580(u32 data)
++{
++ u16 ret_val = 0;
++
++ if (data < E1000_82580_RXPBS_TABLE_SIZE)
++ ret_val = e1000_82580_rxpbs_table[data];
++
++ return ret_val;
++}
++
+ static struct e1000_mac_operations e1000_mac_ops_82575 = {
+- .reset_hw = igb_reset_hw_82575,
+ .init_hw = igb_init_hw_82575,
+ .check_for_link = igb_check_for_link_82575,
+ .rar_set = igb_rar_set,
+diff --git a/drivers/net/igb/e1000_82575.h b/drivers/net/igb/e1000_82575.h
+index b3808ca..d51c992 100644
+--- a/drivers/net/igb/e1000_82575.h
++++ b/drivers/net/igb/e1000_82575.h
+@@ -38,6 +38,11 @@ extern void igb_rx_fifo_flush_82575(struct e1000_hw *hw);
+
+ #define E1000_RAR_ENTRIES_82575 16
+ #define E1000_RAR_ENTRIES_82576 24
++#define E1000_RAR_ENTRIES_82580 24
++
++#define E1000_SW_SYNCH_MB 0x00000100
++#define E1000_STAT_DEV_RST_SET 0x00100000
++#define E1000_CTRL_DEV_RST 0x20000000
+
+ /* SRRCTL bit definitions */
+ #define E1000_SRRCTL_BSIZEPKT_SHIFT 10 /* Shift _right_ */
+@@ -232,5 +237,6 @@ struct e1000_adv_tx_context_desc {
+ #define E1000_RXPBS_SIZE_MASK_82576 0x0000007F
+ void igb_vmdq_set_loopback_pf(struct e1000_hw *, bool);
+ void igb_vmdq_set_replication_pf(struct e1000_hw *, bool);
++u16 igb_rxpbs_adjust_82580(u32 data);
+
+ #endif
+diff --git a/drivers/net/igb/e1000_defines.h b/drivers/net/igb/e1000_defines.h
+index 48fcab0..c58c4fd 100644
+--- a/drivers/net/igb/e1000_defines.h
++++ b/drivers/net/igb/e1000_defines.h
+@@ -49,6 +49,7 @@
+ #define E1000_CTRL_EXT_PFRSTD 0x00004000
+ #define E1000_CTRL_EXT_LINK_MODE_MASK 0x00C00000
+ #define E1000_CTRL_EXT_LINK_MODE_PCIE_SERDES 0x00C00000
++#define E1000_CTRL_EXT_LINK_MODE_1000BASE_KX 0x00400000
+ #define E1000_CTRL_EXT_LINK_MODE_SGMII 0x00800000
+ #define E1000_CTRL_EXT_EIAME 0x01000000
+ #define E1000_CTRL_EXT_IRCA 0x00000001
+@@ -557,8 +558,12 @@
+ #define NVM_ALT_MAC_ADDR_PTR 0x0037
+ #define NVM_CHECKSUM_REG 0x003F
+
+-#define E1000_NVM_CFG_DONE_PORT_0 0x40000 /* MNG config cycle done */
+-#define E1000_NVM_CFG_DONE_PORT_1 0x80000 /* ...for second port */
++#define E1000_NVM_CFG_DONE_PORT_0 0x040000 /* MNG config cycle done */
++#define E1000_NVM_CFG_DONE_PORT_1 0x080000 /* ...for second port */
++#define E1000_NVM_CFG_DONE_PORT_2 0x100000 /* ...for third port */
++#define E1000_NVM_CFG_DONE_PORT_3 0x200000 /* ...for fourth port */
++
++#define NVM_82580_LAN_FUNC_OFFSET(a) (a ? (0x40 + (0x40 * a)) : 0)
+
+ /* Mask bits for fields in Word 0x0f of the NVM */
+ #define NVM_WORD0F_PAUSE_MASK 0x3000
+@@ -625,6 +630,7 @@
+ */
+ #define M88E1111_I_PHY_ID 0x01410CC0
+ #define IGP03E1000_E_PHY_ID 0x02A80390
++#define I82580_I_PHY_ID 0x015403A0
+ #define M88_VENDOR 0x0141
+
+ /* M88E1000 Specific Registers */
+diff --git a/drivers/net/igb/e1000_hw.h b/drivers/net/igb/e1000_hw.h
+index 5deda3e..dbaeb5f 100644
+--- a/drivers/net/igb/e1000_hw.h
++++ b/drivers/net/igb/e1000_hw.h
+@@ -47,19 +47,30 @@ struct e1000_hw;
+ #define E1000_DEV_ID_82575EB_COPPER 0x10A7
+ #define E1000_DEV_ID_82575EB_FIBER_SERDES 0x10A9
+ #define E1000_DEV_ID_82575GB_QUAD_COPPER 0x10D6
++#define E1000_DEV_ID_82580_COPPER 0x150E
++#define E1000_DEV_ID_82580_FIBER 0x150F
++#define E1000_DEV_ID_82580_SERDES 0x1510
++#define E1000_DEV_ID_82580_SGMII 0x1511
++#define E1000_DEV_ID_82580_COPPER_DUAL 0x1516
+
+ #define E1000_REVISION_2 2
+ #define E1000_REVISION_4 4
+
+ #define E1000_FUNC_0 0
+ #define E1000_FUNC_1 1
++#define E1000_FUNC_2 2
++#define E1000_FUNC_3 3
+
++#define E1000_ALT_MAC_ADDRESS_OFFSET_LAN0 0
+ #define E1000_ALT_MAC_ADDRESS_OFFSET_LAN1 3
++#define E1000_ALT_MAC_ADDRESS_OFFSET_LAN2 6
++#define E1000_ALT_MAC_ADDRESS_OFFSET_LAN3 9
+
+ enum e1000_mac_type {
+ e1000_undefined = 0,
+ e1000_82575,
+ e1000_82576,
++ e1000_82580,
+ e1000_num_macs /* List is 1-based, so subtract 1 for true count. */
+ };
+
+@@ -290,6 +301,7 @@ struct e1000_mac_operations {
+
+ struct e1000_phy_operations {
+ s32 (*acquire)(struct e1000_hw *);
++ s32 (*check_polarity)(struct e1000_hw *);
+ s32 (*check_reset_block)(struct e1000_hw *);
+ s32 (*force_speed_duplex)(struct e1000_hw *);
+ s32 (*get_cfg_done)(struct e1000_hw *hw);
+@@ -466,6 +478,7 @@ struct e1000_mbx_info {
+
+ struct e1000_dev_spec_82575 {
+ bool sgmii_active;
++ bool global_device_reset;
+ };
+
+ struct e1000_hw {
+diff --git a/drivers/net/igb/e1000_phy.c b/drivers/net/igb/e1000_phy.c
+index b8fbc85..5c9d73e 100644
+--- a/drivers/net/igb/e1000_phy.c
++++ b/drivers/net/igb/e1000_phy.c
+@@ -136,7 +136,7 @@ out:
+ * Reads the MDI control regsiter in the PHY at offset and stores the
+ * information read to data.
+ **/
+-static s32 igb_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data)
++s32 igb_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data)
+ {
+ struct e1000_phy_info *phy = &hw->phy;
+ u32 i, mdic = 0;
+@@ -194,7 +194,7 @@ out:
+ *
+ * Writes data to MDI control register in the PHY at offset.
+ **/
+-static s32 igb_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data)
++s32 igb_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data)
+ {
+ struct e1000_phy_info *phy = &hw->phy;
+ u32 i, mdic = 0;
+@@ -1947,7 +1947,7 @@ s32 igb_phy_init_script_igp3(struct e1000_hw *hw)
+ *
+ * Polarity is determined based on the PHY specific status register.
+ **/
+-s32 igb_check_polarity_82580(struct e1000_hw *hw)
++static s32 igb_check_polarity_82580(struct e1000_hw *hw)
+ {
+ struct e1000_phy_info *phy = &hw->phy;
+ s32 ret_val;
+diff --git a/drivers/net/igb/e1000_phy.h b/drivers/net/igb/e1000_phy.h
+index e23b021..555eb54 100644
+--- a/drivers/net/igb/e1000_phy.h
++++ b/drivers/net/igb/e1000_phy.h
+@@ -61,10 +61,11 @@ s32 igb_write_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 data);
+ s32 igb_phy_has_link(struct e1000_hw *hw, u32 iterations,
+ u32 usec_interval, bool *success);
+ s32 igb_phy_init_script_igp3(struct e1000_hw *hw);
++s32 igb_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data);
++s32 igb_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data);
+ s32 igb_read_phy_reg_i2c(struct e1000_hw *hw, u32 offset, u16 *data);
+ s32 igb_write_phy_reg_i2c(struct e1000_hw *hw, u32 offset, u16 data);
+ s32 igb_copper_link_setup_82580(struct e1000_hw *hw);
+-s32 igb_check_polarity_82580(struct e1000_hw *hw);
+ s32 igb_get_phy_info_82580(struct e1000_hw *hw);
+ s32 igb_phy_force_speed_duplex_82580(struct e1000_hw *hw);
+ s32 igb_get_cable_length_82580(struct e1000_hw *hw);
+diff --git a/drivers/net/igb/e1000_regs.h b/drivers/net/igb/e1000_regs.h
+index 934e03b..409c44b 100644
+--- a/drivers/net/igb/e1000_regs.h
++++ b/drivers/net/igb/e1000_regs.h
+@@ -34,6 +34,7 @@
+ #define E1000_EERD 0x00014 /* EEPROM Read - RW */
+ #define E1000_CTRL_EXT 0x00018 /* Extended Device Control - RW */
+ #define E1000_MDIC 0x00020 /* MDI Control - RW */
++#define E1000_MDICNFG 0x00E04 /* MDI Config - RW */
+ #define E1000_SCTL 0x00024 /* SerDes Control - RW */
+ #define E1000_FCAL 0x00028 /* Flow Control Address Low - RW */
+ #define E1000_FCAH 0x0002C /* Flow Control Address High -RW */
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0072-igb-Add-full-support-for-82580-devices.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0072-igb-Add-full-support-for-82580-devices.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,419 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Thu, 19 Nov 2009 12:42:21 +0000
+Subject: [PATCH 072/165] igb: Add full support for 82580 devices
+
+commit 55cac248caa4a5f181a11cd2f269a672bef3d3b5 upstream.
+
+This patch makes use of the 82580 PHY and MAC support added and adds a set
+of supported device IDs for said hardware.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/e1000_defines.h | 7 ++
+ drivers/net/igb/e1000_regs.h | 4 +
+ drivers/net/igb/igb.h | 1 +
+ drivers/net/igb/igb_ethtool.c | 53 ++++++++++++++++
+ drivers/net/igb/igb_main.c | 131 ++++++++++++++++++++++++++++++++++++++-
+ 5 files changed, 193 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/net/igb/e1000_defines.h b/drivers/net/igb/e1000_defines.h
+index c58c4fd..6e036ae 100644
+--- a/drivers/net/igb/e1000_defines.h
++++ b/drivers/net/igb/e1000_defines.h
+@@ -330,6 +330,7 @@
+ #define E1000_ICR_RXDMT0 0x00000010 /* rx desc min. threshold (0) */
+ #define E1000_ICR_RXT0 0x00000080 /* rx timer intr (ring 0) */
+ #define E1000_ICR_VMMB 0x00000100 /* VM MB event */
++#define E1000_ICR_DRSTA 0x40000000 /* Device Reset Asserted */
+ /* If this bit asserted, the driver should claim the interrupt */
+ #define E1000_ICR_INT_ASSERTED 0x80000000
+ /* LAN connected device generates an interrupt */
+@@ -371,6 +372,7 @@
+ #define E1000_IMS_RXSEQ E1000_ICR_RXSEQ /* rx sequence error */
+ #define E1000_IMS_RXDMT0 E1000_ICR_RXDMT0 /* rx desc min. threshold */
+ #define E1000_IMS_RXT0 E1000_ICR_RXT0 /* rx timer intr */
++#define E1000_IMS_DRSTA E1000_ICR_DRSTA /* Device Reset Asserted */
+ #define E1000_IMS_DOUTSYNC E1000_ICR_DOUTSYNC /* NIC DMA out of sync */
+
+ /* Extended Interrupt Mask Set */
+@@ -379,6 +381,7 @@
+ /* Interrupt Cause Set */
+ #define E1000_ICS_LSC E1000_ICR_LSC /* Link Status Change */
+ #define E1000_ICS_RXDMT0 E1000_ICR_RXDMT0 /* rx desc min. threshold */
++#define E1000_ICS_DRSTA E1000_ICR_DRSTA /* Device Reset Aserted */
+
+ /* Extended Interrupt Cause Set */
+
+@@ -717,4 +720,8 @@
+ #define E1000_VFTA_ENTRY_MASK 0x7F
+ #define E1000_VFTA_ENTRY_BIT_SHIFT_MASK 0x1F
+
++/* DMA Coalescing register fields */
++#define E1000_PCIEMISC_LX_DECISION 0x00000080 /* Lx power decision based
++ on DMA coal */
++
+ #endif
+diff --git a/drivers/net/igb/e1000_regs.h b/drivers/net/igb/e1000_regs.h
+index 409c44b..dd4e6ff 100644
+--- a/drivers/net/igb/e1000_regs.h
++++ b/drivers/net/igb/e1000_regs.h
+@@ -89,6 +89,8 @@
+ #define E1000_SYSTIML 0x0B600 /* System time register Low - RO */
+ #define E1000_SYSTIMH 0x0B604 /* System time register High - RO */
+ #define E1000_TIMINCA 0x0B608 /* Increment attributes register - RW */
++#define E1000_TSAUXC 0x0B640 /* Timesync Auxiliary Control register */
++#define E1000_SYSTIMR 0x0B6F8 /* System time register Residue */
+
+ /* Filtering Registers */
+ #define E1000_SAQF(_n) (0x5980 + 4 * (_n))
+@@ -318,4 +320,6 @@
+ #define array_rd32(reg, offset) \
+ (readl(hw->hw_addr + reg + ((offset) << 2)))
+
++/* DMA Coalescing registers */
++#define E1000_PCIEMISC 0x05BB8 /* PCIE misc config register */
+ #endif
+diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
+index 63abd1c..c458d9b 100644
+--- a/drivers/net/igb/igb.h
++++ b/drivers/net/igb/igb.h
+@@ -320,6 +320,7 @@ struct igb_adapter {
+ #define IGB_FLAG_QUEUE_PAIRS (1 << 3)
+
+ #define IGB_82576_TSYNC_SHIFT 19
++#define IGB_82580_TSYNC_SHIFT 24
+ enum e1000_state_t {
+ __IGB_TESTING,
+ __IGB_RESETTING,
+diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
+index 2e238bf..ac9d527 100644
+--- a/drivers/net/igb/igb_ethtool.c
++++ b/drivers/net/igb/igb_ethtool.c
+@@ -881,6 +881,49 @@ struct igb_reg_test {
+ #define TABLE64_TEST_LO 5
+ #define TABLE64_TEST_HI 6
+
++/* 82580 reg test */
++static struct igb_reg_test reg_test_82580[] = {
++ { E1000_FCAL, 0x100, 1, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
++ { E1000_FCAH, 0x100, 1, PATTERN_TEST, 0x0000FFFF, 0xFFFFFFFF },
++ { E1000_FCT, 0x100, 1, PATTERN_TEST, 0x0000FFFF, 0xFFFFFFFF },
++ { E1000_VET, 0x100, 1, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
++ { E1000_RDBAL(0), 0x100, 4, PATTERN_TEST, 0xFFFFFF80, 0xFFFFFFFF },
++ { E1000_RDBAH(0), 0x100, 4, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
++ { E1000_RDLEN(0), 0x100, 4, PATTERN_TEST, 0x000FFFF0, 0x000FFFFF },
++ { E1000_RDBAL(4), 0x40, 4, PATTERN_TEST, 0xFFFFFF80, 0xFFFFFFFF },
++ { E1000_RDBAH(4), 0x40, 4, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
++ { E1000_RDLEN(4), 0x40, 4, PATTERN_TEST, 0x000FFFF0, 0x000FFFFF },
++ /* RDH is read-only for 82580, only test RDT. */
++ { E1000_RDT(0), 0x100, 4, PATTERN_TEST, 0x0000FFFF, 0x0000FFFF },
++ { E1000_RDT(4), 0x40, 4, PATTERN_TEST, 0x0000FFFF, 0x0000FFFF },
++ { E1000_FCRTH, 0x100, 1, PATTERN_TEST, 0x0000FFF0, 0x0000FFF0 },
++ { E1000_FCTTV, 0x100, 1, PATTERN_TEST, 0x0000FFFF, 0x0000FFFF },
++ { E1000_TIPG, 0x100, 1, PATTERN_TEST, 0x3FFFFFFF, 0x3FFFFFFF },
++ { E1000_TDBAL(0), 0x100, 4, PATTERN_TEST, 0xFFFFFF80, 0xFFFFFFFF },
++ { E1000_TDBAH(0), 0x100, 4, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
++ { E1000_TDLEN(0), 0x100, 4, PATTERN_TEST, 0x000FFFF0, 0x000FFFFF },
++ { E1000_TDBAL(4), 0x40, 4, PATTERN_TEST, 0xFFFFFF80, 0xFFFFFFFF },
++ { E1000_TDBAH(4), 0x40, 4, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
++ { E1000_TDLEN(4), 0x40, 4, PATTERN_TEST, 0x000FFFF0, 0x000FFFFF },
++ { E1000_TDT(0), 0x100, 4, PATTERN_TEST, 0x0000FFFF, 0x0000FFFF },
++ { E1000_TDT(4), 0x40, 4, PATTERN_TEST, 0x0000FFFF, 0x0000FFFF },
++ { E1000_RCTL, 0x100, 1, SET_READ_TEST, 0xFFFFFFFF, 0x00000000 },
++ { E1000_RCTL, 0x100, 1, SET_READ_TEST, 0x04CFB0FE, 0x003FFFFB },
++ { E1000_RCTL, 0x100, 1, SET_READ_TEST, 0x04CFB0FE, 0xFFFFFFFF },
++ { E1000_TCTL, 0x100, 1, SET_READ_TEST, 0xFFFFFFFF, 0x00000000 },
++ { E1000_RA, 0, 16, TABLE64_TEST_LO,
++ 0xFFFFFFFF, 0xFFFFFFFF },
++ { E1000_RA, 0, 16, TABLE64_TEST_HI,
++ 0x83FFFFFF, 0xFFFFFFFF },
++ { E1000_RA2, 0, 8, TABLE64_TEST_LO,
++ 0xFFFFFFFF, 0xFFFFFFFF },
++ { E1000_RA2, 0, 8, TABLE64_TEST_HI,
++ 0x83FFFFFF, 0xFFFFFFFF },
++ { E1000_MTA, 0, 128, TABLE32_TEST,
++ 0xFFFFFFFF, 0xFFFFFFFF },
++ { 0, 0, 0, 0 }
++};
++
+ /* 82576 reg test */
+ static struct igb_reg_test reg_test_82576[] = {
+ { E1000_FCAL, 0x100, 1, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
+@@ -1013,6 +1056,10 @@ static int igb_reg_test(struct igb_adapter *adapter, u64 *data)
+ u32 i, toggle;
+
+ switch (adapter->hw.mac.type) {
++ case e1000_82580:
++ test = reg_test_82580;
++ toggle = 0x7FEFF3FF;
++ break;
+ case e1000_82576:
+ test = reg_test_82576;
+ toggle = 0x7FFFF3FF;
+@@ -1167,6 +1214,9 @@ static int igb_intr_test(struct igb_adapter *adapter, u64 *data)
+ case e1000_82576:
+ ics_mask = 0x77D4FBFD;
+ break;
++ case e1000_82580:
++ ics_mask = 0x77DCFED5;
++ break;
+ default:
+ ics_mask = 0x7FFFFFFF;
+ break;
+@@ -1338,6 +1388,9 @@ static int igb_integrated_phy_loopback(struct igb_adapter *adapter)
+ igb_write_phy_reg(hw, PHY_CONTROL, 0x9140);
+ /* autoneg off */
+ igb_write_phy_reg(hw, PHY_CONTROL, 0x8140);
++ } else if (hw->phy.type == e1000_phy_82580) {
++ /* enable MII loopback */
++ igb_write_phy_reg(hw, I82580_PHY_LBK_CTRL, 0x8041);
+ }
+
+ ctrl_reg = rd32(E1000_CTRL);
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 1f08719..3fcabcd 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -49,7 +49,7 @@
+ #endif
+ #include "igb.h"
+
+-#define DRV_VERSION "1.3.16-k2"
++#define DRV_VERSION "2.1.0-k2"
+ char igb_driver_name[] = "igb";
+ char igb_driver_version[] = DRV_VERSION;
+ static const char igb_driver_string[] =
+@@ -61,6 +61,11 @@ static const struct e1000_info *igb_info_tbl[] = {
+ };
+
+ static struct pci_device_id igb_pci_tbl[] = {
++ { PCI_VDEVICE(INTEL, E1000_DEV_ID_82580_COPPER), board_82575 },
++ { PCI_VDEVICE(INTEL, E1000_DEV_ID_82580_FIBER), board_82575 },
++ { PCI_VDEVICE(INTEL, E1000_DEV_ID_82580_SERDES), board_82575 },
++ { PCI_VDEVICE(INTEL, E1000_DEV_ID_82580_SGMII), board_82575 },
++ { PCI_VDEVICE(INTEL, E1000_DEV_ID_82580_COPPER_DUAL), board_82575 },
+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576), board_82575 },
+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_NS), board_82575 },
+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_NS_SERDES), board_82575 },
+@@ -195,6 +200,16 @@ static cycle_t igb_read_clock(const struct cyclecounter *tc)
+ u64 stamp = 0;
+ int shift = 0;
+
++ /*
++ * The timestamp latches on lowest register read. For the 82580
++ * the lowest register is SYSTIMR instead of SYSTIML. However we never
++ * adjusted TIMINCA so SYSTIMR will just read as all 0s so ignore it.
++ */
++ if (hw->mac.type == e1000_82580) {
++ stamp = rd32(E1000_SYSTIMR) >> 8;
++ shift = IGB_82580_TSYNC_SHIFT;
++ }
++
+ stamp |= (u64)rd32(E1000_SYSTIML) << shift;
+ stamp |= (u64)rd32(E1000_SYSTIMH) << (shift + 32);
+ return stamp;
+@@ -304,6 +319,7 @@ static void igb_cache_ring_register(struct igb_adapter *adapter)
+ Q_IDX_82576(j);
+ }
+ case e1000_82575:
++ case e1000_82580:
+ default:
+ for (; i < adapter->num_rx_queues; i++)
+ adapter->rx_ring[i].reg_idx = rbase_offset + i;
+@@ -443,6 +459,39 @@ static void igb_assign_vector(struct igb_q_vector *q_vector, int msix_vector)
+ }
+ q_vector->eims_value = 1 << msix_vector;
+ break;
++ case e1000_82580:
++ /* 82580 uses the same table-based approach as 82576 but has fewer
++ entries as a result we carry over for queues greater than 4. */
++ if (rx_queue > IGB_N0_QUEUE) {
++ index = (rx_queue >> 1);
++ ivar = array_rd32(E1000_IVAR0, index);
++ if (rx_queue & 0x1) {
++ /* vector goes into third byte of register */
++ ivar = ivar & 0xFF00FFFF;
++ ivar |= (msix_vector | E1000_IVAR_VALID) << 16;
++ } else {
++ /* vector goes into low byte of register */
++ ivar = ivar & 0xFFFFFF00;
++ ivar |= msix_vector | E1000_IVAR_VALID;
++ }
++ array_wr32(E1000_IVAR0, index, ivar);
++ }
++ if (tx_queue > IGB_N0_QUEUE) {
++ index = (tx_queue >> 1);
++ ivar = array_rd32(E1000_IVAR0, index);
++ if (tx_queue & 0x1) {
++ /* vector goes into high byte of register */
++ ivar = ivar & 0x00FFFFFF;
++ ivar |= (msix_vector | E1000_IVAR_VALID) << 24;
++ } else {
++ /* vector goes into second byte of register */
++ ivar = ivar & 0xFFFF00FF;
++ ivar |= (msix_vector | E1000_IVAR_VALID) << 8;
++ }
++ array_wr32(E1000_IVAR0, index, ivar);
++ }
++ q_vector->eims_value = 1 << msix_vector;
++ break;
+ default:
+ BUG();
+ break;
+@@ -484,6 +533,7 @@ static void igb_configure_msix(struct igb_adapter *adapter)
+ break;
+
+ case e1000_82576:
++ case e1000_82580:
+ /* Turn on MSI-X capability first, or our settings
+ * won't stick. And it will take days to debug. */
+ wr32(E1000_GPIE, E1000_GPIE_MSIX_MODE |
+@@ -866,6 +916,7 @@ static int igb_request_irq(struct igb_adapter *adapter)
+ E1000_EICR_TX_QUEUE0 |
+ E1000_EIMS_OTHER));
+ break;
++ case e1000_82580:
+ case e1000_82576:
+ wr32(E1000_IVAR0, E1000_IVAR_VALID);
+ break;
+@@ -959,10 +1010,15 @@ static void igb_irq_enable(struct igb_adapter *adapter)
+ wr32(E1000_MBVFIMR, 0xFF);
+ ims |= E1000_IMS_VMMB;
+ }
++ if (adapter->hw.mac.type == e1000_82580)
++ ims |= E1000_IMS_DRSTA;
++
+ wr32(E1000_IMS, ims);
+ } else {
+- wr32(E1000_IMS, IMS_ENABLE_MASK);
+- wr32(E1000_IAM, IMS_ENABLE_MASK);
++ wr32(E1000_IMS, IMS_ENABLE_MASK |
++ E1000_IMS_DRSTA);
++ wr32(E1000_IAM, IMS_ENABLE_MASK |
++ E1000_IMS_DRSTA);
+ }
+ }
+
+@@ -1184,6 +1240,10 @@ void igb_reset(struct igb_adapter *adapter)
+ * To take effect CTRL.RST is required.
+ */
+ switch (mac->type) {
++ case e1000_82580:
++ pba = rd32(E1000_RXPBS);
++ pba = igb_rxpbs_adjust_82580(pba);
++ break;
+ case e1000_82576:
+ pba = rd32(E1000_RXPBS);
+ pba &= E1000_RXPBS_SIZE_MASK_82576;
+@@ -1278,6 +1338,11 @@ void igb_reset(struct igb_adapter *adapter)
+ if (hw->mac.ops.init_hw(hw))
+ dev_err(&pdev->dev, "Hardware Error\n");
+
++ if (hw->mac.type == e1000_82580) {
++ u32 reg = rd32(E1000_PCIEMISC);
++ wr32(E1000_PCIEMISC,
++ reg & ~E1000_PCIEMISC_LX_DECISION);
++ }
+ igb_update_mng_vlan(adapter);
+
+ /* Enable h/w to recognize an 802.1Q VLAN Ethernet packet */
+@@ -1508,6 +1573,10 @@ static int __devinit igb_probe(struct pci_dev *pdev,
+
+ if (hw->bus.func == 0)
+ hw->nvm.ops.read(hw, NVM_INIT_CONTROL3_PORT_A, 1, &eeprom_data);
++ else if (hw->mac.type == e1000_82580)
++ hw->nvm.ops.read(hw, NVM_INIT_CONTROL3_PORT_A +
++ NVM_82580_LAN_FUNC_OFFSET(hw->bus.func), 1,
++ &eeprom_data);
+ else if (hw->bus.func == 1)
+ hw->nvm.ops.read(hw, NVM_INIT_CONTROL3_PORT_B, 1, &eeprom_data);
+
+@@ -1746,6 +1815,48 @@ static void igb_init_hw_timer(struct igb_adapter *adapter)
+ struct e1000_hw *hw = &adapter->hw;
+
+ switch (hw->mac.type) {
++ case e1000_82580:
++ memset(&adapter->cycles, 0, sizeof(adapter->cycles));
++ adapter->cycles.read = igb_read_clock;
++ adapter->cycles.mask = CLOCKSOURCE_MASK(64);
++ adapter->cycles.mult = 1;
++ /*
++ * The 82580 timesync updates the system timer every 8ns by 8ns
++ * and the value cannot be shifted. Instead we need to shift
++ * the registers to generate a 64bit timer value. As a result
++ * SYSTIMR/L/H, TXSTMPL/H, RXSTMPL/H all have to be shifted by
++ * 24 in order to generate a larger value for synchronization.
++ */
++ adapter->cycles.shift = IGB_82580_TSYNC_SHIFT;
++ /* disable system timer temporarily by setting bit 31 */
++ wr32(E1000_TSAUXC, 0x80000000);
++ wrfl();
++
++ /* Set registers so that rollover occurs soon to test this. */
++ wr32(E1000_SYSTIMR, 0x00000000);
++ wr32(E1000_SYSTIML, 0x80000000);
++ wr32(E1000_SYSTIMH, 0x000000FF);
++ wrfl();
++
++ /* enable system timer by clearing bit 31 */
++ wr32(E1000_TSAUXC, 0x0);
++ wrfl();
++
++ timecounter_init(&adapter->clock,
++ &adapter->cycles,
++ ktime_to_ns(ktime_get_real()));
++ /*
++ * Synchronize our NIC clock against system wall clock. NIC
++ * time stamp reading requires ~3us per sample, each sample
++ * was pretty stable even under load => only require 10
++ * samples for each offset comparison.
++ */
++ memset(&adapter->compare, 0, sizeof(adapter->compare));
++ adapter->compare.source = &adapter->clock;
++ adapter->compare.target = ktime_get_real;
++ adapter->compare.num_samples = 10;
++ timecompare_update(&adapter->compare, 0);
++ break;
+ case e1000_82576:
+ /*
+ * Initialize hardware timer: we keep it running just in case
+@@ -2217,6 +2328,10 @@ static void igb_setup_mrqc(struct igb_adapter *adapter)
+ if (adapter->vfs_allocated_count) {
+ /* 82575 and 82576 supports 2 RSS queues for VMDq */
+ switch (hw->mac.type) {
++ case e1000_82580:
++ num_rx_queues = 1;
++ shift = 0;
++ break;
+ case e1000_82576:
+ shift = 3;
+ num_rx_queues = 2;
+@@ -3694,6 +3809,9 @@ static void igb_tx_timeout(struct net_device *netdev)
+ /* Do the reset outside of interrupt context */
+ adapter->tx_timeout_count++;
+
++ if (hw->mac.type == e1000_82580)
++ hw->dev_spec._82575.global_device_reset = true;
++
+ schedule_work(&adapter->reset_task);
+ wr32(E1000_EICS,
+ (adapter->eims_enable_mask & ~adapter->eims_other));
+@@ -4700,6 +4818,13 @@ static void igb_systim_to_hwtstamp(struct igb_adapter *adapter,
+ {
+ u64 ns;
+
++ /*
++ * The 82580 starts with 1ns at bit 0 in RX/TXSTMPL, shift this up to
++ * 24 to match clock shift we setup earlier.
++ */
++ if (adapter->hw.mac.type == e1000_82580)
++ regval <<= IGB_82580_TSYNC_SHIFT;
++
+ ns = timecounter_cyc2time(&adapter->clock, regval);
+ timecompare_update(&adapter->compare, ns);
+ memset(shhwtstamps, 0, sizeof(struct skb_shared_hwtstamps));
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0073-igb-remove-use-of-skb_dma_map-from-driver.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0073-igb-remove-use-of-skb_dma_map-from-driver.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,165 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Wed, 2 Dec 2009 16:47:18 +0000
+Subject: [PATCH 073/165] igb: remove use of skb_dma_map from driver
+
+commit 6366ad331f436388129dfc044db871de79604e4d upstream.
+
+This change removes skb_dma_map/unmap calls from the igb driver due to the
+fact that the call is incompatible with iommu enabled kernels. In order to
+prevent warnings about using the wrong unmap call I have added a
+mapped_as_page value to the buffer_info structure to track if the mapped
+region is a page or a buffer.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb.h | 5 ++-
+ drivers/net/igb/igb_main.c | 69 +++++++++++++++++++++++++++++++++----------
+ 2 files changed, 56 insertions(+), 18 deletions(-)
+
+diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
+index c458d9b..b1c1eb8 100644
+--- a/drivers/net/igb/igb.h
++++ b/drivers/net/igb/igb.h
+@@ -137,12 +137,13 @@ struct igb_buffer {
+ unsigned long time_stamp;
+ u16 length;
+ u16 next_to_watch;
++ u16 mapped_as_page;
+ };
+ /* RX */
+ struct {
+ struct page *page;
+- u64 page_dma;
+- unsigned int page_offset;
++ dma_addr_t page_dma;
++ u16 page_offset;
+ };
+ };
+ };
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 3fcabcd..f4ff2f6 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -2654,16 +2654,27 @@ static void igb_free_all_tx_resources(struct igb_adapter *adapter)
+ void igb_unmap_and_free_tx_resource(struct igb_ring *tx_ring,
+ struct igb_buffer *buffer_info)
+ {
+- buffer_info->dma = 0;
++ if (buffer_info->dma) {
++ if (buffer_info->mapped_as_page)
++ pci_unmap_page(tx_ring->pdev,
++ buffer_info->dma,
++ buffer_info->length,
++ PCI_DMA_TODEVICE);
++ else
++ pci_unmap_single(tx_ring->pdev,
++ buffer_info->dma,
++ buffer_info->length,
++ PCI_DMA_TODEVICE);
++ buffer_info->dma = 0;
++ }
+ if (buffer_info->skb) {
+- skb_dma_unmap(&tx_ring->pdev->dev,
+- buffer_info->skb,
+- DMA_TO_DEVICE);
+ dev_kfree_skb_any(buffer_info->skb);
+ buffer_info->skb = NULL;
+ }
+ buffer_info->time_stamp = 0;
+- /* buffer_info must be completely set up in the transmit path */
++ buffer_info->length = 0;
++ buffer_info->next_to_watch = 0;
++ buffer_info->mapped_as_page = false;
+ }
+
+ /**
+@@ -3561,24 +3572,19 @@ static inline int igb_tx_map_adv(struct igb_ring *tx_ring, struct sk_buff *skb,
+ unsigned int len = skb_headlen(skb);
+ unsigned int count = 0, i;
+ unsigned int f;
+- dma_addr_t *map;
+
+ i = tx_ring->next_to_use;
+
+- if (skb_dma_map(&pdev->dev, skb, DMA_TO_DEVICE)) {
+- dev_err(&pdev->dev, "TX DMA map failed\n");
+- return 0;
+- }
+-
+- map = skb_shinfo(skb)->dma_maps;
+-
+ buffer_info = &tx_ring->buffer_info[i];
+ BUG_ON(len >= IGB_MAX_DATA_PER_TXD);
+ buffer_info->length = len;
+ /* set time_stamp *before* dma to help avoid a possible race */
+ buffer_info->time_stamp = jiffies;
+ buffer_info->next_to_watch = i;
+- buffer_info->dma = skb_shinfo(skb)->dma_head;
++ buffer_info->dma = pci_map_single(pdev, skb->data, len,
++ PCI_DMA_TODEVICE);
++ if (pci_dma_mapping_error(pdev, buffer_info->dma))
++ goto dma_error;
+
+ for (f = 0; f < skb_shinfo(skb)->nr_frags; f++) {
+ struct skb_frag_struct *frag;
+@@ -3595,7 +3601,15 @@ static inline int igb_tx_map_adv(struct igb_ring *tx_ring, struct sk_buff *skb,
+ buffer_info->length = len;
+ buffer_info->time_stamp = jiffies;
+ buffer_info->next_to_watch = i;
+- buffer_info->dma = map[count];
++ buffer_info->mapped_as_page = true;
++ buffer_info->dma = pci_map_page(pdev,
++ frag->page,
++ frag->page_offset,
++ len,
++ PCI_DMA_TODEVICE);
++ if (pci_dma_mapping_error(pdev, buffer_info->dma))
++ goto dma_error;
++
+ count++;
+ }
+
+@@ -3603,6 +3617,29 @@ static inline int igb_tx_map_adv(struct igb_ring *tx_ring, struct sk_buff *skb,
+ tx_ring->buffer_info[first].next_to_watch = i;
+
+ return ++count;
++
++dma_error:
++ dev_err(&pdev->dev, "TX DMA map failed\n");
++
++ /* clear timestamp and dma mappings for failed buffer_info mapping */
++ buffer_info->dma = 0;
++ buffer_info->time_stamp = 0;
++ buffer_info->length = 0;
++ buffer_info->next_to_watch = 0;
++ buffer_info->mapped_as_page = false;
++ count--;
++
++ /* clear timestamp and dma mappings for remaining portion of packet */
++ while (count >= 0) {
++ count--;
++ i--;
++ if (i < 0)
++ i += tx_ring->count;
++ buffer_info = &tx_ring->buffer_info[i];
++ igb_unmap_and_free_tx_resource(tx_ring, buffer_info);
++ }
++
++ return 0;
+ }
+
+ static inline void igb_tx_queue_adv(struct igb_ring *tx_ring,
+@@ -3755,7 +3792,7 @@ netdev_tx_t igb_xmit_frame_ring_adv(struct sk_buff *skb,
+ * has occured and we need to rewind the descriptor queue
+ */
+ count = igb_tx_map_adv(tx_ring, skb, first);
+- if (count <= 0) {
++ if (!count) {
+ dev_kfree_skb_any(skb);
+ tx_ring->buffer_info[first].time_stamp = 0;
+ tx_ring->next_to_use = first;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0074-igbvf-remove-skb_dma_map-unmap-call-from-drivers.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0074-igbvf-remove-skb_dma_map-unmap-call-from-drivers.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,142 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Wed, 2 Dec 2009 16:47:37 +0000
+Subject: [PATCH 074/165] igbvf: remove skb_dma_map/unmap call from drivers
+
+commit a7d5ca40ff56e2cd4e30bbe91f2d0deab6bfc006 upstream.
+
+This patch removes the skb_dma_map/unmap calls from the igbvf driver due to
+the fact that it does not play well with HW IOMMU when combined with
+transmitting cloned skbs.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igbvf/igbvf.h | 1 +
+ drivers/net/igbvf/netdev.c | 65 ++++++++++++++++++++++++++++++++++---------
+ 2 files changed, 52 insertions(+), 14 deletions(-)
+
+diff --git a/drivers/net/igbvf/igbvf.h b/drivers/net/igbvf/igbvf.h
+index 6012410..b48de85 100644
+--- a/drivers/net/igbvf/igbvf.h
++++ b/drivers/net/igbvf/igbvf.h
+@@ -117,6 +117,7 @@ struct igbvf_buffer {
+ unsigned long time_stamp;
+ u16 length;
+ u16 next_to_watch;
++ u16 mapped_as_page;
+ };
+ /* Rx */
+ struct {
+diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
+index e01f445..cf26f92 100644
+--- a/drivers/net/igbvf/netdev.c
++++ b/drivers/net/igbvf/netdev.c
+@@ -366,10 +366,20 @@ next_desc:
+ static void igbvf_put_txbuf(struct igbvf_adapter *adapter,
+ struct igbvf_buffer *buffer_info)
+ {
+- buffer_info->dma = 0;
++ if (buffer_info->dma) {
++ if (buffer_info->mapped_as_page)
++ pci_unmap_page(adapter->pdev,
++ buffer_info->dma,
++ buffer_info->length,
++ PCI_DMA_TODEVICE);
++ else
++ pci_unmap_single(adapter->pdev,
++ buffer_info->dma,
++ buffer_info->length,
++ PCI_DMA_TODEVICE);
++ buffer_info->dma = 0;
++ }
+ if (buffer_info->skb) {
+- skb_dma_unmap(&adapter->pdev->dev, buffer_info->skb,
+- DMA_TO_DEVICE);
+ dev_kfree_skb_any(buffer_info->skb);
+ buffer_info->skb = NULL;
+ }
+@@ -2088,27 +2098,24 @@ static inline int igbvf_tx_map_adv(struct igbvf_adapter *adapter,
+ unsigned int first)
+ {
+ struct igbvf_buffer *buffer_info;
++ struct pci_dev *pdev = adapter->pdev;
+ unsigned int len = skb_headlen(skb);
+ unsigned int count = 0, i;
+ unsigned int f;
+- dma_addr_t *map;
+
+ i = tx_ring->next_to_use;
+
+- if (skb_dma_map(&adapter->pdev->dev, skb, DMA_TO_DEVICE)) {
+- dev_err(&adapter->pdev->dev, "TX DMA map failed\n");
+- return 0;
+- }
+-
+- map = skb_shinfo(skb)->dma_maps;
+-
+ buffer_info = &tx_ring->buffer_info[i];
+ BUG_ON(len >= IGBVF_MAX_DATA_PER_TXD);
+ buffer_info->length = len;
+ /* set time_stamp *before* dma to help avoid a possible race */
+ buffer_info->time_stamp = jiffies;
+ buffer_info->next_to_watch = i;
+- buffer_info->dma = skb_shinfo(skb)->dma_head;
++ buffer_info->dma = pci_map_single(pdev, skb->data, len,
++ PCI_DMA_TODEVICE);
++ if (pci_dma_mapping_error(pdev, buffer_info->dma))
++ goto dma_error;
++
+
+ for (f = 0; f < skb_shinfo(skb)->nr_frags; f++) {
+ struct skb_frag_struct *frag;
+@@ -2125,14 +2132,44 @@ static inline int igbvf_tx_map_adv(struct igbvf_adapter *adapter,
+ buffer_info->length = len;
+ buffer_info->time_stamp = jiffies;
+ buffer_info->next_to_watch = i;
+- buffer_info->dma = map[count];
++ buffer_info->mapped_as_page = true;
++ buffer_info->dma = pci_map_page(pdev,
++ frag->page,
++ frag->page_offset,
++ len,
++ PCI_DMA_TODEVICE);
++ if (pci_dma_mapping_error(pdev, buffer_info->dma))
++ goto dma_error;
+ count++;
+ }
+
+ tx_ring->buffer_info[i].skb = skb;
+ tx_ring->buffer_info[first].next_to_watch = i;
+
+- return count + 1;
++ return ++count;
++
++dma_error:
++ dev_err(&pdev->dev, "TX DMA map failed\n");
++
++ /* clear timestamp and dma mappings for failed buffer_info mapping */
++ buffer_info->dma = 0;
++ buffer_info->time_stamp = 0;
++ buffer_info->length = 0;
++ buffer_info->next_to_watch = 0;
++ buffer_info->mapped_as_page = false;
++ count--;
++
++ /* clear timestamp and dma mappings for remaining portion of packet */
++ while (count >= 0) {
++ count--;
++ i--;
++ if (i < 0)
++ i += tx_ring->count;
++ buffer_info = &tx_ring->buffer_info[i];
++ igbvf_put_txbuf(adapter, buffer_info);
++ }
++
++ return 0;
+ }
+
+ static inline void igbvf_tx_queue_adv(struct igbvf_adapter *adapter,
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0075-drivers-net-Move-and-to-end-of-previous-line.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0075-drivers-net-Move-and-to-end-of-previous-line.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,57 @@
+From: Joe Perches <joe at perches.com>
+Date: Thu, 3 Dec 2009 07:58:21 +0000
+Subject: [PATCH 075/165] drivers/net: Move && and || to end of previous line
+
+commit 8e95a2026f3b43f7c3d676adaccd2de9532e8dcc upstream.
+
+Only files where David Miller is the primary git-signer.
+wireless, wimax, ixgbe, etc are not modified.
+
+Compile tested x86 allyesconfig only
+Not all files compiled (not x86 compatible)
+
+Added a few > 80 column lines, which I ignored.
+Existing checkpatch complaints ignored.
+
+Signed-off-by: Joe Perches <joe at perches.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Restricted to drivers/net/igb{,vf}]
+---
+ drivers/net/igb/igb_main.c | 5 ++---
+ drivers/net/igbvf/netdev.c | 4 ++--
+ 2 files changed, 4 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index f4ff2f6..fb644ce 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -4974,9 +4974,8 @@ static bool igb_clean_tx_irq(struct igb_q_vector *q_vector)
+ tx_ring->detect_tx_hung = false;
+ if (tx_ring->buffer_info[i].time_stamp &&
+ time_after(jiffies, tx_ring->buffer_info[i].time_stamp +
+- (adapter->tx_timeout_factor * HZ))
+- && !(rd32(E1000_STATUS) &
+- E1000_STATUS_TXOFF)) {
++ (adapter->tx_timeout_factor * HZ)) &&
++ !(rd32(E1000_STATUS) & E1000_STATUS_TXOFF)) {
+
+ /* detected Tx unit hang */
+ dev_err(&tx_ring->pdev->dev,
+diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
+index cf26f92..a127620 100644
+--- a/drivers/net/igbvf/netdev.c
++++ b/drivers/net/igbvf/netdev.c
+@@ -827,8 +827,8 @@ static bool igbvf_clean_tx_irq(struct igbvf_ring *tx_ring)
+ adapter->detect_tx_hung = false;
+ if (tx_ring->buffer_info[i].time_stamp &&
+ time_after(jiffies, tx_ring->buffer_info[i].time_stamp +
+- (adapter->tx_timeout_factor * HZ))
+- && !(er32(STATUS) & E1000_STATUS_TXOFF)) {
++ (adapter->tx_timeout_factor * HZ)) &&
++ !(er32(STATUS) & E1000_STATUS_TXOFF)) {
+
+ tx_desc = IGBVF_TX_DESC_ADV(*tx_ring, i);
+ /* detected Tx unit hang */
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0076-igb-fix-handling-of-mailbox-collisions-between-PF-VF.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0076-igb-fix-handling-of-mailbox-collisions-between-PF-VF.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,74 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Fri, 11 Dec 2009 22:57:34 -0800
+Subject: [PATCH 076/165] igb: fix handling of mailbox collisions between
+ PF/VF
+
+commit fef45f4ce221fc110f70716a00f40be697c5b254 upstream.
+
+This patch changes the handling of collisions between the use of the
+PF/VF sides of the mailbox.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 22 +++++++++++++---------
+ 1 files changed, 13 insertions(+), 9 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index fb644ce..bb264ee 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -4608,8 +4608,14 @@ static void igb_rcv_msg_from_vf(struct igb_adapter *adapter, u32 vf)
+
+ retval = igb_read_mbx(hw, msgbuf, E1000_VFMAILBOX_SIZE, vf);
+
+- if (retval)
++ if (retval) {
++ /* if receive failed revoke VF CTS stats and restart init */
+ dev_err(&pdev->dev, "Error receiving message from VF\n");
++ vf_data->flags &= ~IGB_VF_FLAG_CTS;
++ if (!time_after(jiffies, vf_data->last_nack + (2 * HZ)))
++ return;
++ goto out;
++ }
+
+ /* this is a message we already processed, do nothing */
+ if (msgbuf[0] & (E1000_VT_MSGTYPE_ACK | E1000_VT_MSGTYPE_NACK))
+@@ -4626,12 +4632,10 @@ static void igb_rcv_msg_from_vf(struct igb_adapter *adapter, u32 vf)
+ }
+
+ if (!(vf_data->flags & IGB_VF_FLAG_CTS)) {
+- msgbuf[0] = E1000_VT_MSGTYPE_NACK;
+- if (time_after(jiffies, vf_data->last_nack + (2 * HZ))) {
+- igb_write_mbx(hw, msgbuf, 1, vf);
+- vf_data->last_nack = jiffies;
+- }
+- return;
++ if (!time_after(jiffies, vf_data->last_nack + (2 * HZ)))
++ return;
++ retval = -1;
++ goto out;
+ }
+
+ switch ((msgbuf[0] & 0xFFFF)) {
+@@ -4656,14 +4660,14 @@ static void igb_rcv_msg_from_vf(struct igb_adapter *adapter, u32 vf)
+ break;
+ }
+
++ msgbuf[0] |= E1000_VT_MSGTYPE_CTS;
++out:
+ /* notify the VF of the results of what it sent us */
+ if (retval)
+ msgbuf[0] |= E1000_VT_MSGTYPE_NACK;
+ else
+ msgbuf[0] |= E1000_VT_MSGTYPE_ACK;
+
+- msgbuf[0] |= E1000_VT_MSGTYPE_CTS;
+-
+ igb_write_mbx(hw, msgbuf, 1, vf);
+ }
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0077-igbvf-avoid-reset-storms-due-to-mailbox-issues.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0077-igbvf-avoid-reset-storms-due-to-mailbox-issues.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,65 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Fri, 11 Dec 2009 22:58:14 -0800
+Subject: [PATCH 077/165] igbvf: avoid reset storms due to mailbox issues
+
+commit 7227909340477c1e5225bb2df76cdcc95b5e1da1 upstream.
+
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+
+This change makes it so that reset/interrupt storms can be avoided when
+there are mailbox issues. The new behavior is to only allow the device to
+trigger mailbox related resets only once every 10 seconds.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igbvf/igbvf.h | 1 +
+ drivers/net/igbvf/netdev.c | 8 +++++++-
+ 2 files changed, 8 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/igbvf/igbvf.h b/drivers/net/igbvf/igbvf.h
+index b48de85..fd2cca4 100644
+--- a/drivers/net/igbvf/igbvf.h
++++ b/drivers/net/igbvf/igbvf.h
+@@ -275,6 +275,7 @@ struct igbvf_adapter {
+ unsigned long led_status;
+
+ unsigned int flags;
++ unsigned long last_reset;
+ };
+
+ struct igbvf_info {
+diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
+index a127620..e9dd95f 100644
+--- a/drivers/net/igbvf/netdev.c
++++ b/drivers/net/igbvf/netdev.c
+@@ -1469,6 +1469,8 @@ static void igbvf_reset(struct igbvf_adapter *adapter)
+ memcpy(netdev->perm_addr, adapter->hw.mac.addr,
+ netdev->addr_len);
+ }
++
++ adapter->last_reset = jiffies;
+ }
+
+ int igbvf_up(struct igbvf_adapter *adapter)
+@@ -1812,11 +1814,15 @@ static bool igbvf_has_link(struct igbvf_adapter *adapter)
+ s32 ret_val = E1000_SUCCESS;
+ bool link_active;
+
++ /* If interface is down, stay link down */
++ if (test_bit(__IGBVF_DOWN, &adapter->state))
++ return false;
++
+ ret_val = hw->mac.ops.check_for_link(hw);
+ link_active = !hw->mac.get_link_status;
+
+ /* if check for link returns error we will need to reset */
+- if (ret_val)
++ if (ret_val && time_after(jiffies, adapter->last_reset + (10 * HZ)))
+ schedule_work(&adapter->reset_task);
+
+ return link_active;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0078-igb-do-not-force-pcs-link-when-in-KX-mode.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0078-igb-do-not-force-pcs-link-when-in-KX-mode.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,34 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Wed, 23 Dec 2009 13:20:47 +0000
+Subject: [PATCH 078/165] igb: do not force pcs link when in KX mode
+
+commit d68caec645b4b92f6a81985265b024bc94bce41f upstream.
+
+We were forcing the PCS link up in error when we are in KX mode. We should
+only be disabling autoneg, not forcing the link up.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/e1000_82575.c | 4 +---
+ 1 files changed, 1 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c
+index e8e9e91..c505b50 100644
+--- a/drivers/net/igb/e1000_82575.c
++++ b/drivers/net/igb/e1000_82575.c
+@@ -1096,9 +1096,7 @@ static s32 igb_setup_serdes_link_82575(struct e1000_hw *hw)
+ hw_dbg("Configuring Autoneg:PCS_LCTL=0x%08X\n", reg);
+ } else {
+ /* Set PCS register for forced link */
+- reg |= E1000_PCS_LCTL_FSD | /* Force Speed */
+- E1000_PCS_LCTL_FORCE_LINK | /* Force Link */
+- E1000_PCS_LCTL_FLV_LINK_UP; /* Force link value up */
++ reg |= E1000_PCS_LCTL_FSD; /* Force Speed */
+
+ hw_dbg("Configuring Forced Link:PCS_LCTL=0x%08X\n", reg);
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0079-igb-do-not-force-retry-count-to-1-on-82580-phy.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0079-igb-do-not-force-retry-count-to-1-on-82580-phy.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,42 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Wed, 23 Dec 2009 13:21:07 +0000
+Subject: [PATCH 079/165] igb: do not force retry count to 1 on 82580 phy
+
+commit 8c6af2995c14e71558c312b86955ae32272a03d8 upstream.
+
+This change resolves an issue seen in some configurations where the link
+may drop to 100Mb/s even though the link itself supports 1000Mb/s. The
+issue was root caused to the fact that we were only trying the link once.
+Now instead we will try up to 5 attempts on a faulty cable before
+downshifting to 100Mb/s.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/e1000_phy.c | 9 ---------
+ 1 files changed, 0 insertions(+), 9 deletions(-)
+
+diff --git a/drivers/net/igb/e1000_phy.c b/drivers/net/igb/e1000_phy.c
+index 5c9d73e..3670a66 100644
+--- a/drivers/net/igb/e1000_phy.c
++++ b/drivers/net/igb/e1000_phy.c
+@@ -457,15 +457,6 @@ s32 igb_copper_link_setup_82580(struct e1000_hw *hw)
+ phy_data |= I82580_CFG_ENABLE_DOWNSHIFT;
+
+ ret_val = phy->ops.write_reg(hw, I82580_CFG_REG, phy_data);
+- if (ret_val)
+- goto out;
+-
+- /* Set number of link attempts before downshift */
+- ret_val = phy->ops.read_reg(hw, I82580_CTRL_REG, &phy_data);
+- if (ret_val)
+- goto out;
+- phy_data &= ~I82580_CTRL_DOWNSHIFT_MASK;
+- ret_val = phy->ops.write_reg(hw, I82580_CTRL_REG, phy_data);
+
+ out:
+ return ret_val;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0080-igb-correctly-offset-82575-flow-control-watermarks-b.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0080-igb-correctly-offset-82575-flow-control-watermarks-b.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,41 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Wed, 23 Dec 2009 13:21:27 +0000
+Subject: [PATCH 080/165] igb: correctly offset 82575 flow control watermarks
+ by 16 bytes
+
+commit d405ea3ef2499eb46834418a643973c884ff7f30 upstream.
+
+The watermark values for the 82575 were not being set correctly. As a
+result the high and low watermark values were set to the same value which
+can lead to excess xon/xoff packets being generated.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 9 ++-------
+ 1 files changed, 2 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index bb264ee..095da34 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -1306,13 +1306,8 @@ void igb_reset(struct igb_adapter *adapter)
+ hwm = min(((pba << 10) * 9 / 10),
+ ((pba << 10) - 2 * adapter->max_frame_size));
+
+- if (mac->type < e1000_82576) {
+- fc->high_water = hwm & 0xFFF8; /* 8-byte granularity */
+- fc->low_water = fc->high_water - 8;
+- } else {
+- fc->high_water = hwm & 0xFFF0; /* 16-byte granularity */
+- fc->low_water = fc->high_water - 16;
+- }
++ fc->high_water = hwm & 0xFFF0; /* 16-byte granularity */
++ fc->low_water = fc->high_water - 16;
+ fc->pause_time = 0xFFFF;
+ fc->send_xon = 1;
+ fc->current_mode = fc->requested_mode;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0081-igb-check-both-function-bits-in-status-register-in-w.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0081-igb-check-both-function-bits-in-status-register-in-w.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,35 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Wed, 23 Dec 2009 13:21:46 +0000
+Subject: [PATCH 081/165] igb: check both function bits in status register in
+ wol exception
+
+commit 58b8b042509f53955ba660a4245e221c5405f124 upstream.
+
+The ethtool code for enabling Wake on Lan was not correctly checking the
+status register bits so as a result ports 0 and 2 were both being allowed
+to set WOL to enabled even though it is only supported on the first port
+for our adapters.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_ethtool.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
+index ac9d527..f771a6c 100644
+--- a/drivers/net/igb/igb_ethtool.c
++++ b/drivers/net/igb/igb_ethtool.c
+@@ -1795,7 +1795,7 @@ static int igb_wol_exclusion(struct igb_adapter *adapter,
+ /* dual port cards only support WoL on port A from now on
+ * unless it was enabled in the eeprom for port B
+ * so exclude FUNC_1 ports from having WoL enabled */
+- if (rd32(E1000_STATUS) & E1000_STATUS_FUNC_1 &&
++ if ((rd32(E1000_STATUS) & E1000_STATUS_FUNC_MASK) &&
+ !adapter->eeprom_wol) {
+ wol->supported = 0;
+ break;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0082-igbvf-Make-igbvf-error-message-more-informative.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0082-igbvf-Make-igbvf-error-message-more-informative.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,30 @@
+From: "Williams, Mitch A" <mitch.a.williams at intel.com>
+Date: Wed, 23 Dec 2009 13:22:43 +0000
+Subject: [PATCH 082/165] igbvf: Make igbvf error message more informative
+
+commit 1242b6f31e1d0688f1eb1dc78036dbd975bd6140 upstream.
+
+Signed-off-by: Mitch Williams <mitch.a.williams at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igbvf/netdev.c | 3 ++-
+ 1 files changed, 2 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
+index e9dd95f..0dbd032 100644
+--- a/drivers/net/igbvf/netdev.c
++++ b/drivers/net/igbvf/netdev.c
+@@ -2763,7 +2763,8 @@ static int __devinit igbvf_probe(struct pci_dev *pdev,
+ err = hw->mac.ops.reset_hw(hw);
+ if (err) {
+ dev_info(&pdev->dev,
+- "PF still in reset state, assigning new address\n");
++ "PF still in reset state, assigning new address."
++ " Is the PF interface up?\n");
+ random_ether_addr(hw->mac.addr);
+ } else {
+ err = hw->mac.ops.read_mac_addr(hw);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0083-drivers-net-igbvf-netdev.c-use-pM-to-shown-MAC-addre.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0083-drivers-net-igbvf-netdev.c-use-pM-to-shown-MAC-addre.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,49 @@
+From: H Hartley Sweeten <hsweeten at visionengravers.com>
+Date: Tue, 29 Dec 2009 20:02:29 -0800
+Subject: [PATCH 083/165] drivers/net/igbvf/netdev.c: use %pM to shown MAC
+ address
+
+commit 753cdc3304f0612766a81cddab9d8af01fcf8218 upstream.
+
+Use the %pM kernel extension to display the MAC address.
+
+Signed-off-by: H Hartley Sweeten <hsweeten at visionengravers.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igbvf/netdev.c | 13 +++----------
+ 1 files changed, 3 insertions(+), 10 deletions(-)
+
+diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
+index 0dbd032..77e13e4 100644
+--- a/drivers/net/igbvf/netdev.c
++++ b/drivers/net/igbvf/netdev.c
+@@ -2608,11 +2608,7 @@ static void igbvf_print_device_info(struct igbvf_adapter *adapter)
+ struct pci_dev *pdev = adapter->pdev;
+
+ dev_info(&pdev->dev, "Intel(R) 82576 Virtual Function\n");
+- dev_info(&pdev->dev, "Address: %02x:%02x:%02x:%02x:%02x:%02x\n",
+- /* MAC address */
+- netdev->dev_addr[0], netdev->dev_addr[1],
+- netdev->dev_addr[2], netdev->dev_addr[3],
+- netdev->dev_addr[4], netdev->dev_addr[5]);
++ dev_info(&pdev->dev, "Address: %pM\n", netdev->dev_addr);
+ dev_info(&pdev->dev, "MAC: %d\n", hw->mac.type);
+ }
+
+@@ -2778,11 +2774,8 @@ static int __devinit igbvf_probe(struct pci_dev *pdev,
+ memcpy(netdev->perm_addr, adapter->hw.mac.addr, netdev->addr_len);
+
+ if (!is_valid_ether_addr(netdev->perm_addr)) {
+- dev_err(&pdev->dev, "Invalid MAC Address: "
+- "%02x:%02x:%02x:%02x:%02x:%02x\n",
+- netdev->dev_addr[0], netdev->dev_addr[1],
+- netdev->dev_addr[2], netdev->dev_addr[3],
+- netdev->dev_addr[4], netdev->dev_addr[5]);
++ dev_err(&pdev->dev, "Invalid MAC Address: %pM\n",
++ netdev->dev_addr);
+ err = -EIO;
+ goto err_hw_init;
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0084-drivers-net-use-DEFINE_PCI_DEVICE_TABLE.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0084-drivers-net-use-DEFINE_PCI_DEVICE_TABLE.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,46 @@
+From: Alexey Dobriyan <adobriyan at gmail.com>
+Date: Thu, 7 Jan 2010 11:58:11 +0000
+Subject: [PATCH 084/165] drivers/net/: use DEFINE_PCI_DEVICE_TABLE()
+
+commit a3aa18842a5303fc28fcc4d57dbd16618bd830a0 upstream.
+
+Use DEFINE_PCI_DEVICE_TABLE() so we get place PCI ids table into correct section
+in every case.
+
+Signed-off-by: Alexey Dobriyan <adobriyan at gmail.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Restricted to drivers/net/igb{,vf}]
+---
+ drivers/net/igb/igb_main.c | 2 +-
+ drivers/net/igbvf/netdev.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 095da34..918511c 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -60,7 +60,7 @@ static const struct e1000_info *igb_info_tbl[] = {
+ [board_82575] = &e1000_82575_info,
+ };
+
+-static struct pci_device_id igb_pci_tbl[] = {
++static DEFINE_PCI_DEVICE_TABLE(igb_pci_tbl) = {
+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_82580_COPPER), board_82575 },
+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_82580_FIBER), board_82575 },
+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_82580_SERDES), board_82575 },
+diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
+index 77e13e4..a6c3920 100644
+--- a/drivers/net/igbvf/netdev.c
++++ b/drivers/net/igbvf/netdev.c
+@@ -2877,7 +2877,7 @@ static struct pci_error_handlers igbvf_err_handler = {
+ .resume = igbvf_io_resume,
+ };
+
+-static struct pci_device_id igbvf_pci_tbl[] = {
++static DEFINE_PCI_DEVICE_TABLE(igbvf_pci_tbl) = {
+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_VF), board_vf },
+ { } /* terminate list */
+ };
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0085-igb-add-support-for-device-reset-interrupt.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0085-igb-add-support-for-device-reset-interrupt.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,54 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Thu, 7 Jan 2010 17:41:00 +0000
+Subject: [PATCH 085/165] igb: add support for device reset interrupt
+
+commit 7f081d405adb5f905db11c6449319ab7c670722e upstream.
+
+This patch adds support for the global device reset interrupt. Without
+this change the drivers will report tx hangs on all ports when a global
+device reset occurs.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 9 +++++++++
+ 1 files changed, 9 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 918511c..52b8ec5 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -4105,6 +4105,9 @@ static irqreturn_t igb_msix_other(int irq, void *data)
+ u32 icr = rd32(E1000_ICR);
+ /* reading ICR causes bit 31 of EICR to be cleared */
+
++ if (icr & E1000_ICR_DRSTA)
++ schedule_work(&adapter->reset_task);
++
+ if (icr & E1000_ICR_DOUTSYNC) {
+ /* HW is reporting DMA is out of sync */
+ adapter->stats.doosync++;
+@@ -4728,6 +4731,9 @@ static irqreturn_t igb_intr_msi(int irq, void *data)
+
+ igb_write_itr(q_vector);
+
++ if (icr & E1000_ICR_DRSTA)
++ schedule_work(&adapter->reset_task);
++
+ if (icr & E1000_ICR_DOUTSYNC) {
+ /* HW is reporting DMA is out of sync */
+ adapter->stats.doosync++;
+@@ -4767,6 +4773,9 @@ static irqreturn_t igb_intr(int irq, void *data)
+ if (!(icr & E1000_ICR_INT_ASSERTED))
+ return IRQ_NONE;
+
++ if (icr & E1000_ICR_DRSTA)
++ schedule_work(&adapter->reset_task);
++
+ if (icr & E1000_ICR_DOUTSYNC) {
+ /* HW is reporting DMA is out of sync */
+ adapter->stats.doosync++;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0086-e1000-e1000e-igb-igbvf-ixgb-ixgbe-Fix-tests-of-unsig.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0086-e1000-e1000e-igb-igbvf-ixgb-ixgbe-Fix-tests-of-unsig.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,44 @@
+From: Roel Kluin <roel.kluin at gmail.com>
+Date: Tue, 19 Jan 2010 14:21:45 +0000
+Subject: [PATCH 086/165] e1000/e1000e/igb/igbvf/ixgb/ixgbe: Fix tests of
+ unsigned in *_tx_map()
+
+commit c1fa347f20f17f14a4a1575727fa24340e8a9117 upstream.
+
+The variable count and i are unsigned so the (<|>=)0 tests do not work.
+
+Signed-off-by: Roel Kluin <roel.kluin at gmail.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Restricted to drivers/net/igb{,vf}]
+---
+ drivers/net/igbvf/netdev.c | 10 +++++-----
+ 1 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
+index a6c3920..375194f 100644
+--- a/drivers/net/igbvf/netdev.c
++++ b/drivers/net/igbvf/netdev.c
+@@ -2163,14 +2163,14 @@ dma_error:
+ buffer_info->length = 0;
+ buffer_info->next_to_watch = 0;
+ buffer_info->mapped_as_page = false;
+- count--;
++ if (count)
++ count--;
+
+ /* clear timestamp and dma mappings for remaining portion of packet */
+- while (count >= 0) {
+- count--;
+- i--;
+- if (i < 0)
++ while (count--) {
++ if (i==0)
+ i += tx_ring->count;
++ i--;
+ buffer_info = &tx_ring->buffer_info[i];
+ igbvf_put_txbuf(adapter, buffer_info);
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0087-igb-igbvf-cleanup-exception-handling-in-tx_map_adv.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0087-igb-igbvf-cleanup-exception-handling-in-tx_map_adv.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,62 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Sat, 23 Jan 2010 01:35:00 -0800
+Subject: [PATCH 087/165] igb/igbvf: cleanup exception handling in tx_map_adv
+
+commit 8581145f39c39b00cd1b6a2dcb4ce5bf7d8d6070 upstream.
+
+After removing the skb_dma_map/unmap calls the exception handling in
+igb_tx_map_adv is not correct. The issue is that the count value was not
+being correctly handled so as a result we were not rewinding the ring as
+back as we should have been.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 2 +-
+ drivers/net/igbvf/netdev.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 52b8ec5..2e96204 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -3584,6 +3584,7 @@ static inline int igb_tx_map_adv(struct igb_ring *tx_ring, struct sk_buff *skb,
+ for (f = 0; f < skb_shinfo(skb)->nr_frags; f++) {
+ struct skb_frag_struct *frag;
+
++ count++;
+ i++;
+ if (i == tx_ring->count)
+ i = 0;
+@@ -3605,7 +3606,6 @@ static inline int igb_tx_map_adv(struct igb_ring *tx_ring, struct sk_buff *skb,
+ if (pci_dma_mapping_error(pdev, buffer_info->dma))
+ goto dma_error;
+
+- count++;
+ }
+
+ tx_ring->buffer_info[i].skb = skb;
+diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
+index 375194f..170a9f0 100644
+--- a/drivers/net/igbvf/netdev.c
++++ b/drivers/net/igbvf/netdev.c
+@@ -2126,6 +2126,7 @@ static inline int igbvf_tx_map_adv(struct igbvf_adapter *adapter,
+ for (f = 0; f < skb_shinfo(skb)->nr_frags; f++) {
+ struct skb_frag_struct *frag;
+
++ count++;
+ i++;
+ if (i == tx_ring->count)
+ i = 0;
+@@ -2146,7 +2147,6 @@ static inline int igbvf_tx_map_adv(struct igbvf_adapter *adapter,
+ PCI_DMA_TODEVICE);
+ if (pci_dma_mapping_error(pdev, buffer_info->dma))
+ goto dma_error;
+- count++;
+ }
+
+ tx_ring->buffer_info[i].skb = skb;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0088-net-Fix-IPv6-GSO-type-checks-in-Intel-ethernet-drive.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0088-net-Fix-IPv6-GSO-type-checks-in-Intel-ethernet-drive.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,51 @@
+From: Sridhar Samudrala <sri at us.ibm.com>
+Date: Sat, 23 Jan 2010 02:02:21 -0800
+Subject: [PATCH 088/165] net: Fix IPv6 GSO type checks in Intel ethernet
+ drivers
+
+commit 8e1e8a4779cb23c1d9f51e9223795e07ec54d77a upstream.
+
+Found this problem when testing IPv6 from a KVM guest to a remote
+host via e1000e device on the host.
+The following patch fixes the check for IPv6 GSO packet in Intel
+ethernet drivers to use skb_is_gso_v6(). SKB_GSO_DODGY is also set
+when packets are forwarded from a guest.
+
+Signed-off-by: Sridhar Samudrala <sri at us.ibm.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Restricted to drivers/net/igb{,vf}]
+---
+ drivers/net/igb/igb_main.c | 2 +-
+ drivers/net/igbvf/netdev.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 2e96204..cbfb016 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -3422,7 +3422,7 @@ static inline int igb_tso_adv(struct igb_ring *tx_ring,
+ iph->daddr, 0,
+ IPPROTO_TCP,
+ 0);
+- } else if (skb_shinfo(skb)->gso_type == SKB_GSO_TCPV6) {
++ } else if (skb_is_gso_v6(skb)) {
+ ipv6_hdr(skb)->payload_len = 0;
+ tcp_hdr(skb)->check = ~csum_ipv6_magic(&ipv6_hdr(skb)->saddr,
+ &ipv6_hdr(skb)->daddr,
+diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
+index 170a9f0..9a59ebd 100644
+--- a/drivers/net/igbvf/netdev.c
++++ b/drivers/net/igbvf/netdev.c
+@@ -1963,7 +1963,7 @@ static int igbvf_tso(struct igbvf_adapter *adapter,
+ iph->daddr, 0,
+ IPPROTO_TCP,
+ 0);
+- } else if (skb_shinfo(skb)->gso_type == SKB_GSO_TCPV6) {
++ } else if (skb_is_gso_v6(skb)) {
+ ipv6_hdr(skb)->payload_len = 0;
+ tcp_hdr(skb)->check = ~csum_ipv6_magic(&ipv6_hdr(skb)->saddr,
+ &ipv6_hdr(skb)->daddr,
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0089-igbvf-fix-issue-w-mapped_as_page-being-left-set-afte.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0089-igbvf-fix-issue-w-mapped_as_page-being-left-set-afte.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,33 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Wed, 27 Jan 2010 15:30:39 +0000
+Subject: [PATCH 089/165] igbvf: fix issue w/ mapped_as_page being left set
+ after unmap
+
+commit ac26d7d6aca9621f75f6954c159d2727c9c9cbd0 upstream.
+
+This change fixes an issue in igbvf with mapped_as_page being left set
+after a page is unmapped which results in buffers which are mapped via map
+single being unmapped as page.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igbvf/netdev.c | 1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
+index 9a59ebd..23ce07d 100644
+--- a/drivers/net/igbvf/netdev.c
++++ b/drivers/net/igbvf/netdev.c
+@@ -2117,6 +2117,7 @@ static inline int igbvf_tx_map_adv(struct igbvf_adapter *adapter,
+ /* set time_stamp *before* dma to help avoid a possible race */
+ buffer_info->time_stamp = jiffies;
+ buffer_info->next_to_watch = i;
++ buffer_info->mapped_as_page = false;
+ buffer_info->dma = pci_map_single(pdev, skb->data, len,
+ PCI_DMA_TODEVICE);
+ if (pci_dma_mapping_error(pdev, buffer_info->dma))
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0090-igb-make-certain-to-reassign-legacy-interrupt-vector.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0090-igb-make-certain-to-reassign-legacy-interrupt-vector.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,78 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Wed, 3 Feb 2010 21:59:51 +0000
+Subject: [PATCH 090/165] igb: make certain to reassign legacy interrupt
+ vectors after reset
+
+commit feeb2721a7a0bd0cfa5b8847f80aec93aa2cc00d upstream.
+
+This change corrects an issue that will cause false hangs when using either
+82575 or 82580 in legacy interrupt mode. The issue is caused when there is
+a slow traffic flow and an "ethtool -r" is executed while using legacy or
+MSI interrupts. MSI-X is not affected by this issue due to the fact that
+we were already reconfiguring the vectors after reset.
+
+If possible it would be best to push this for net-2.6 since it is resolving
+a bug but if that is not possible then net-next-2.6 will be fine.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 20 +++++---------------
+ 1 files changed, 5 insertions(+), 15 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index cbfb016..24d31af 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -421,6 +421,8 @@ static void igb_assign_vector(struct igb_q_vector *q_vector, int msix_vector)
+ msixbm = E1000_EICR_RX_QUEUE0 << rx_queue;
+ if (tx_queue > IGB_N0_QUEUE)
+ msixbm |= E1000_EICR_TX_QUEUE0 << tx_queue;
++ if (!adapter->msix_entries && msix_vector == 0)
++ msixbm |= E1000_EIMS_OTHER;
+ array_wr32(E1000_MSIXBM(0), msix_vector, msixbm);
+ q_vector->eims_value = msixbm;
+ break;
+@@ -877,7 +879,6 @@ static int igb_request_irq(struct igb_adapter *adapter)
+ {
+ struct net_device *netdev = adapter->netdev;
+ struct pci_dev *pdev = adapter->pdev;
+- struct e1000_hw *hw = &adapter->hw;
+ int err = 0;
+
+ if (adapter->msix_entries) {
+@@ -909,20 +910,7 @@ static int igb_request_irq(struct igb_adapter *adapter)
+ igb_setup_all_tx_resources(adapter);
+ igb_setup_all_rx_resources(adapter);
+ } else {
+- switch (hw->mac.type) {
+- case e1000_82575:
+- wr32(E1000_MSIXBM(0),
+- (E1000_EICR_RX_QUEUE0 |
+- E1000_EICR_TX_QUEUE0 |
+- E1000_EIMS_OTHER));
+- break;
+- case e1000_82580:
+- case e1000_82576:
+- wr32(E1000_IVAR0, E1000_IVAR_VALID);
+- break;
+- default:
+- break;
+- }
++ igb_assign_vector(adapter->q_vector[0], 0);
+ }
+
+ if (adapter->flags & IGB_FLAG_HAS_MSI) {
+@@ -1140,6 +1128,8 @@ int igb_up(struct igb_adapter *adapter)
+ }
+ if (adapter->msix_entries)
+ igb_configure_msix(adapter);
++ else
++ igb_assign_vector(adapter->q_vector[0], 0);
+
+ /* Clear any pending interrupts. */
+ rd32(E1000_ICR);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0091-tree-wide-Assorted-spelling-fixes.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0091-tree-wide-Assorted-spelling-fixes.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,35 @@
+From: Daniel Mack <daniel at caiaq.de>
+Date: Wed, 3 Feb 2010 08:01:28 +0800
+Subject: [PATCH 091/165] tree-wide: Assorted spelling fixes
+
+commit 3ad2f3fbb961429d2aa627465ae4829758bc7e07 upstream.
+
+In particular, several occurances of funny versions of 'success',
+'unknown', 'therefore', 'acknowledge', 'argument', 'achieve', 'address',
+'beginning', 'desirable', 'separate' and 'necessary' are fixed.
+
+Signed-off-by: Daniel Mack <daniel at caiaq.de>
+Cc: Joe Perches <joe at perches.com>
+Cc: Junio C Hamano <gitster at pobox.com>
+Signed-off-by: Jiri Kosina <jkosina at suse.cz>
+[bwh: Restricted to drivers/net/igb{,vf}]
+---
+ drivers/net/igb/igb_main.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 24d31af..2d3352d 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -676,7 +676,7 @@ static void igb_set_interrupt_capability(struct igb_adapter *adapter)
+ /* start with one vector for every rx queue */
+ numvecs = adapter->num_rx_queues;
+
+- /* if tx handler is seperate add 1 for every tx queue */
++ /* if tx handler is separate add 1 for every tx queue */
+ if (!(adapter->flags & IGB_FLAG_QUEUE_PAIRS))
+ numvecs += adapter->num_tx_queues;
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0092-net-use-netdev_mc_count-and-netdev_mc_empty-when-app.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0092-net-use-netdev_mc_count-and-netdev_mc_empty-when-app.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,87 @@
+From: Jiri Pirko <jpirko at redhat.com>
+Date: Mon, 8 Feb 2010 04:30:35 +0000
+Subject: [PATCH 092/165] net: use netdev_mc_count and netdev_mc_empty when
+ appropriate
+
+commit 4cd24eaf0c6ee7f0242e34ee77ec899f255e66b5 upstream.
+
+This patch replaces dev->mc_count in all drivers (hopefully I didn't miss
+anything). Used spatch and did small tweaks and conding style changes when
+it was suitable.
+
+Jirka
+
+Signed-off-by: Jiri Pirko <jpirko at redhat.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Restricted to drivers/net/igb{,vf}]
+---
+ drivers/net/igb/igb_main.c | 8 ++++----
+ drivers/net/igbvf/netdev.c | 6 +++---
+ 2 files changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 2d3352d..abe2b735 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -2848,14 +2848,14 @@ static int igb_write_mc_addr_list(struct net_device *netdev)
+ u32 vmolr = 0;
+ int i;
+
+- if (!netdev->mc_count) {
++ if (netdev_mc_empty(netdev)) {
+ /* nothing to program, so clear mc list */
+ igb_update_mc_addr_list(hw, NULL, 0);
+ igb_restore_vf_multicasts(adapter);
+ return 0;
+ }
+
+- mta_list = kzalloc(netdev->mc_count * 6, GFP_ATOMIC);
++ mta_list = kzalloc(netdev_mc_count(netdev) * 6, GFP_ATOMIC);
+ if (!mta_list)
+ return -ENOMEM;
+
+@@ -2865,7 +2865,7 @@ static int igb_write_mc_addr_list(struct net_device *netdev)
+ /* The shared function expects a packed array of only addresses. */
+ mc_ptr = netdev->mc_list;
+
+- for (i = 0; i < netdev->mc_count; i++) {
++ for (i = 0; i < netdev_mc_count(netdev); i++) {
+ if (!mc_ptr)
+ break;
+ memcpy(mta_list + (i*ETH_ALEN), mc_ptr->dmi_addr, ETH_ALEN);
+@@ -2874,7 +2874,7 @@ static int igb_write_mc_addr_list(struct net_device *netdev)
+ igb_update_mc_addr_list(hw, mta_list, i);
+ kfree(mta_list);
+
+- return netdev->mc_count;
++ return netdev_mc_count(netdev);
+ }
+
+ /**
+diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
+index 23ce07d..6029c40 100644
+--- a/drivers/net/igbvf/netdev.c
++++ b/drivers/net/igbvf/netdev.c
+@@ -1403,8 +1403,8 @@ static void igbvf_set_multi(struct net_device *netdev)
+ u8 *mta_list = NULL;
+ int i;
+
+- if (netdev->mc_count) {
+- mta_list = kmalloc(netdev->mc_count * 6, GFP_ATOMIC);
++ if (!netdev_mc_empty(netdev)) {
++ mta_list = kmalloc(netdev_mc_count(netdev) * 6, GFP_ATOMIC);
+ if (!mta_list) {
+ dev_err(&adapter->pdev->dev,
+ "failed to allocate multicast filter list\n");
+@@ -1415,7 +1415,7 @@ static void igbvf_set_multi(struct net_device *netdev)
+ /* prepare a packed array of only addresses. */
+ mc_ptr = netdev->mc_list;
+
+- for (i = 0; i < netdev->mc_count; i++) {
++ for (i = 0; i < netdev_mc_count(netdev); i++) {
+ if (!mc_ptr)
+ break;
+ memcpy(mta_list + (i*ETH_ALEN), mc_ptr->dmi_addr,
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0093-igb-remove-unecessary-q_vector-declarations-and-remo.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0093-igb-remove-unecessary-q_vector-declarations-and-remo.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,110 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Wed, 17 Feb 2010 01:00:41 +0000
+Subject: [PATCH 093/165] igb: remove unecessary q_vector declarations and
+ remove itr_shift
+
+commit 26b39276ca5ff4dbf3c07704e34fd820fd97decf upstream.
+
+This change removes the use of itr_shift since a mac type call can be
+used just as easily to identify the only HW that needs to have the itr
+shifted.
+
+In addition it removes two unecessary declarations of a q_vector
+pointer from the initialization path.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb.h | 1 -
+ drivers/net/igb/igb_main.c | 25 +++++++++++++------------
+ 2 files changed, 13 insertions(+), 13 deletions(-)
+
+diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
+index b1c1eb8..f119c8c 100644
+--- a/drivers/net/igb/igb.h
++++ b/drivers/net/igb/igb.h
+@@ -173,7 +173,6 @@ struct igb_q_vector {
+
+ u16 itr_val;
+ u8 set_itr;
+- u8 itr_shift;
+ void __iomem *itr_register;
+
+ char name[IFNAMSIZ + 9];
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index abe2b735..7c7898d 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -498,6 +498,12 @@ static void igb_assign_vector(struct igb_q_vector *q_vector, int msix_vector)
+ BUG();
+ break;
+ }
++
++ /* add q_vector eims value to global eims_enable_mask */
++ adapter->eims_enable_mask |= q_vector->eims_value;
++
++ /* configure q_vector to set itr on first interrupt */
++ q_vector->set_itr = 1;
+ }
+
+ /**
+@@ -555,11 +561,8 @@ static void igb_configure_msix(struct igb_adapter *adapter)
+
+ adapter->eims_enable_mask |= adapter->eims_other;
+
+- for (i = 0; i < adapter->num_q_vectors; i++) {
+- struct igb_q_vector *q_vector = adapter->q_vector[i];
+- igb_assign_vector(q_vector, vector++);
+- adapter->eims_enable_mask |= q_vector->eims_value;
+- }
++ for (i = 0; i < adapter->num_q_vectors; i++)
++ igb_assign_vector(adapter->q_vector[i], vector++);
+
+ wrfl();
+ }
+@@ -750,10 +753,8 @@ static int igb_alloc_q_vectors(struct igb_adapter *adapter)
+ if (!q_vector)
+ goto err_out;
+ q_vector->adapter = adapter;
+- q_vector->itr_shift = (hw->mac.type == e1000_82575) ? 16 : 0;
+ q_vector->itr_register = hw->hw_addr + E1000_EITR(0);
+ q_vector->itr_val = IGB_START_ITR;
+- q_vector->set_itr = 1;
+ netif_napi_add(adapter->netdev, &q_vector->napi, igb_poll, 64);
+ adapter->q_vector[v_idx] = q_vector;
+ }
+@@ -4127,6 +4128,7 @@ static irqreturn_t igb_msix_other(int irq, void *data)
+
+ static void igb_write_itr(struct igb_q_vector *q_vector)
+ {
++ struct igb_adapter *adapter = q_vector->adapter;
+ u32 itr_val = q_vector->itr_val & 0x7FFC;
+
+ if (!q_vector->set_itr)
+@@ -4135,8 +4137,8 @@ static void igb_write_itr(struct igb_q_vector *q_vector)
+ if (!itr_val)
+ itr_val = 0x4;
+
+- if (q_vector->itr_shift)
+- itr_val |= itr_val << q_vector->itr_shift;
++ if (adapter->hw.mac.type == e1000_82575)
++ itr_val |= itr_val << 16;
+ else
+ itr_val |= 0x8000000;
+
+@@ -4213,9 +4215,8 @@ static void igb_setup_dca(struct igb_adapter *adapter)
+ wr32(E1000_DCA_CTRL, E1000_DCA_CTRL_DCA_MODE_CB2);
+
+ for (i = 0; i < adapter->num_q_vectors; i++) {
+- struct igb_q_vector *q_vector = adapter->q_vector[i];
+- q_vector->cpu = -1;
+- igb_update_dca(q_vector);
++ adapter->q_vector[i]->cpu = -1;
++ igb_update_dca(adapter->q_vector[i]);
+ }
+ }
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0094-igb-add-support-for-wake-on-link.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0094-igb-add-support-for-wake-on-link.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,61 @@
+From: Nick Nunley <nicholasx.d.nunley at intel.com>
+Date: Wed, 17 Feb 2010 01:01:01 +0000
+Subject: [PATCH 094/165] igb: add support for wake-on-link
+
+commit 22939f0606e515799d83e1a29250917f94c8d07b upstream.
+
+This adds support for wake-on-link/phy activity to the ethtool
+interface.
+
+Signed-off-by: Nicholas Nunley <nicholasx.d.nunley at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_ethtool.c | 11 +++++++----
+ 1 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
+index f771a6c..145a8eb 100644
+--- a/drivers/net/igb/igb_ethtool.c
++++ b/drivers/net/igb/igb_ethtool.c
+@@ -1812,7 +1812,8 @@ static void igb_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
+ struct igb_adapter *adapter = netdev_priv(netdev);
+
+ wol->supported = WAKE_UCAST | WAKE_MCAST |
+- WAKE_BCAST | WAKE_MAGIC;
++ WAKE_BCAST | WAKE_MAGIC |
++ WAKE_PHY;
+ wol->wolopts = 0;
+
+ /* this function will set ->supported = 0 and return 1 if wol is not
+@@ -1835,15 +1836,15 @@ static void igb_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
+ wol->wolopts |= WAKE_BCAST;
+ if (adapter->wol & E1000_WUFC_MAG)
+ wol->wolopts |= WAKE_MAGIC;
+-
+- return;
++ if (adapter->wol & E1000_WUFC_LNKC)
++ wol->wolopts |= WAKE_PHY;
+ }
+
+ static int igb_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
+ {
+ struct igb_adapter *adapter = netdev_priv(netdev);
+
+- if (wol->wolopts & (WAKE_PHY | WAKE_ARP | WAKE_MAGICSECURE))
++ if (wol->wolopts & (WAKE_ARP | WAKE_MAGICSECURE))
+ return -EOPNOTSUPP;
+
+ if (igb_wol_exclusion(adapter, wol) ||
+@@ -1861,6 +1862,8 @@ static int igb_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
+ adapter->wol |= E1000_WUFC_BC;
+ if (wol->wolopts & WAKE_MAGIC)
+ adapter->wol |= E1000_WUFC_MAG;
++ if (wol->wolopts & WAKE_PHY)
++ adapter->wol |= E1000_WUFC_LNKC;
+ device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol);
+
+ return 0;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0095-igb-Report-link-status-in-ethtool-when-interface-is-.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0095-igb-Report-link-status-in-ethtool-when-interface-is-.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,86 @@
+From: Nick Nunley <nicholasx.d.nunley at intel.com>
+Date: Wed, 17 Feb 2010 01:01:21 +0000
+Subject: [PATCH 095/165] igb: Report link status in ethtool when interface is
+ down
+
+commit 3145535ac6e4769e587a38a67d888a10f24a7af9 upstream.
+
+With this change ethtool will correctly report link status when
+the interface is down. Currently ethtool reports the link as not
+detected when the interface is down.
+
+Signed-off-by: Nicholas Nunley <nicholasx.d.nunley at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb.h | 1 +
+ drivers/net/igb/igb_ethtool.c | 20 +++++++++++++++++++-
+ drivers/net/igb/igb_main.c | 2 +-
+ 3 files changed, 21 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
+index f119c8c..c81cc9a 100644
+--- a/drivers/net/igb/igb.h
++++ b/drivers/net/igb/igb.h
+@@ -353,6 +353,7 @@ extern void igb_unmap_and_free_tx_resource(struct igb_ring *,
+ struct igb_buffer *);
+ extern void igb_alloc_rx_buffers_adv(struct igb_ring *, int);
+ extern void igb_update_stats(struct igb_adapter *);
++extern bool igb_has_link(struct igb_adapter *adapter);
+ extern void igb_set_ethtool_ops(struct net_device *);
+
+ static inline s32 igb_reset_phy(struct e1000_hw *hw)
+diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
+index 145a8eb..4eea03b 100644
+--- a/drivers/net/igb/igb_ethtool.c
++++ b/drivers/net/igb/igb_ethtool.c
+@@ -234,6 +234,24 @@ static int igb_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
+ return 0;
+ }
+
++static u32 igb_get_link(struct net_device *netdev)
++{
++ struct igb_adapter *adapter = netdev_priv(netdev);
++ struct e1000_mac_info *mac = &adapter->hw.mac;
++
++ /*
++ * If the link is not reported up to netdev, interrupts are disabled,
++ * and so the physical link state may have changed since we last
++ * looked. Set get_link_status to make sure that the true link
++ * state is interrogated, rather than pulling a cached and possibly
++ * stale link state from the driver.
++ */
++ if (!netif_carrier_ok(netdev))
++ mac->get_link_status = 1;
++
++ return igb_has_link(adapter);
++}
++
+ static void igb_get_pauseparam(struct net_device *netdev,
+ struct ethtool_pauseparam *pause)
+ {
+@@ -2077,7 +2095,7 @@ static const struct ethtool_ops igb_ethtool_ops = {
+ .get_msglevel = igb_get_msglevel,
+ .set_msglevel = igb_set_msglevel,
+ .nway_reset = igb_nway_reset,
+- .get_link = ethtool_op_get_link,
++ .get_link = igb_get_link,
+ .get_eeprom_len = igb_get_eeprom_len,
+ .get_eeprom = igb_get_eeprom,
+ .set_eeprom = igb_set_eeprom,
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 7c7898d..f996e06 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -3005,7 +3005,7 @@ static void igb_update_phy_info(unsigned long data)
+ * igb_has_link - check shared code for link and determine up/down
+ * @adapter: pointer to driver private info
+ **/
+-static bool igb_has_link(struct igb_adapter *adapter)
++bool igb_has_link(struct igb_adapter *adapter)
+ {
+ struct e1000_hw *hw = &adapter->hw;
+ bool link_active = false;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0096-igb-ignore-EEPROM-APME-check-when-shutting-down-serd.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0096-igb-ignore-EEPROM-APME-check-when-shutting-down-serd.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,65 @@
+From: Nick Nunley <nicholasx.d.nunley at intel.com>
+Date: Wed, 17 Feb 2010 01:01:40 +0000
+Subject: [PATCH 096/165] igb: ignore EEPROM APME check when shutting down
+ serdes link
+
+commit 53c992fa8497286f24f279ebec5a8c7a58d4e68c upstream.
+
+Checking the EEPROM APME state unnecessarily prevents the link from
+shutting down. The standard power down routines should be
+sufficient to determine whether the serdes link can power down
+when going into D3.
+
+Signed-off-by: Nicholas Nunley <nicholasx.d.nunley at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/e1000_82575.c | 21 ++-------------------
+ 1 files changed, 2 insertions(+), 19 deletions(-)
+
+diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c
+index c505b50..59817bc 100644
+--- a/drivers/net/igb/e1000_82575.c
++++ b/drivers/net/igb/e1000_82575.c
+@@ -791,27 +791,12 @@ static s32 igb_get_pcs_speed_and_duplex_82575(struct e1000_hw *hw, u16 *speed,
+ void igb_shutdown_serdes_link_82575(struct e1000_hw *hw)
+ {
+ u32 reg;
+- u16 eeprom_data = 0;
+
+- if (hw->phy.media_type != e1000_media_type_internal_serdes ||
++ if (hw->phy.media_type != e1000_media_type_internal_serdes &&
+ igb_sgmii_active_82575(hw))
+ return;
+
+- if (hw->bus.func == E1000_FUNC_0)
+- hw->nvm.ops.read(hw, NVM_INIT_CONTROL3_PORT_A, 1, &eeprom_data);
+- else if (hw->mac.type == e1000_82580)
+- hw->nvm.ops.read(hw, NVM_INIT_CONTROL3_PORT_A +
+- NVM_82580_LAN_FUNC_OFFSET(hw->bus.func), 1,
+- &eeprom_data);
+- else if (hw->bus.func == E1000_FUNC_1)
+- hw->nvm.ops.read(hw, NVM_INIT_CONTROL3_PORT_B, 1, &eeprom_data);
+-
+- /*
+- * If APM is not enabled in the EEPROM and management interface is
+- * not enabled, then power down.
+- */
+- if (!(eeprom_data & E1000_NVM_APME_82575) &&
+- !igb_enable_mng_pass_thru(hw)) {
++ if (!igb_enable_mng_pass_thru(hw)) {
+ /* Disable PCS to turn off link */
+ reg = rd32(E1000_PCS_CFG0);
+ reg &= ~E1000_PCS_CFG_PCS_EN;
+@@ -826,8 +811,6 @@ void igb_shutdown_serdes_link_82575(struct e1000_hw *hw)
+ wrfl();
+ msleep(1);
+ }
+-
+- return;
+ }
+
+ /**
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0097-igb-Power-down-link-when-interface-is-down.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0097-igb-Power-down-link-when-interface-is-down.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,317 @@
+From: Nick Nunley <nicholasx.d.nunley at intel.com>
+Date: Wed, 17 Feb 2010 01:01:59 +0000
+Subject: [PATCH 097/165] igb: Power down link when interface is down
+
+commit 88a268c1a11a2e94b7c55a8cfe97892d845887c8 upstream.
+
+This changes the behavior of the driver to power down the link
+when the associated interface is down, unless management is enabled.
+
+Signed-off-by: Nicholas Nunley <nicholasx.d.nunley at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/e1000_82575.c | 44 +++++++++++++++++++++++++++++++++++++++
+ drivers/net/igb/e1000_82575.h | 2 +
+ drivers/net/igb/e1000_defines.h | 1 +
+ drivers/net/igb/e1000_phy.c | 35 +++++++++++++++++++++++++++++++
+ drivers/net/igb/e1000_phy.h | 2 +
+ drivers/net/igb/igb.h | 1 +
+ drivers/net/igb/igb_ethtool.c | 16 +++++++++++--
+ drivers/net/igb/igb_main.c | 39 +++++++++++++++++++++++++++-------
+ 8 files changed, 129 insertions(+), 11 deletions(-)
+
+diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c
+index 59817bc..9d7fa2f 100644
+--- a/drivers/net/igb/e1000_82575.c
++++ b/drivers/net/igb/e1000_82575.c
+@@ -727,6 +727,34 @@ static s32 igb_check_for_link_82575(struct e1000_hw *hw)
+ }
+
+ /**
++ * igb_power_up_serdes_link_82575 - Power up the serdes link after shutdown
++ * @hw: pointer to the HW structure
++ **/
++void igb_power_up_serdes_link_82575(struct e1000_hw *hw)
++{
++ u32 reg;
++
++
++ if ((hw->phy.media_type != e1000_media_type_internal_serdes) &&
++ !igb_sgmii_active_82575(hw))
++ return;
++
++ /* Enable PCS to turn on link */
++ reg = rd32(E1000_PCS_CFG0);
++ reg |= E1000_PCS_CFG_PCS_EN;
++ wr32(E1000_PCS_CFG0, reg);
++
++ /* Power up the laser */
++ reg = rd32(E1000_CTRL_EXT);
++ reg &= ~E1000_CTRL_EXT_SDP3_DATA;
++ wr32(E1000_CTRL_EXT, reg);
++
++ /* flush the write to verify completion */
++ wrfl();
++ msleep(1);
++}
++
++/**
+ * igb_get_pcs_speed_and_duplex_82575 - Retrieve current speed/duplex
+ * @hw: pointer to the HW structure
+ * @speed: stores the current speed
+@@ -1166,6 +1194,22 @@ out:
+ }
+
+ /**
++ * igb_power_down_phy_copper_82575 - Remove link during PHY power down
++ * @hw: pointer to the HW structure
++ *
++ * In the case of a PHY power down to save power, or to turn off link during a
++ * driver unload, or wake on lan is not enabled, remove the link.
++ **/
++void igb_power_down_phy_copper_82575(struct e1000_hw *hw)
++{
++ /* If the management interface is not enabled, then power down */
++ if (!(igb_enable_mng_pass_thru(hw) || igb_check_reset_block(hw)))
++ igb_power_down_phy_copper(hw);
++
++ return;
++}
++
++/**
+ * igb_clear_hw_cntrs_82575 - Clear device specific hardware counters
+ * @hw: pointer to the HW structure
+ *
+diff --git a/drivers/net/igb/e1000_82575.h b/drivers/net/igb/e1000_82575.h
+index d51c992..168c7c0 100644
+--- a/drivers/net/igb/e1000_82575.h
++++ b/drivers/net/igb/e1000_82575.h
+@@ -29,6 +29,8 @@
+ #define _E1000_82575_H_
+
+ extern void igb_shutdown_serdes_link_82575(struct e1000_hw *hw);
++extern void igb_power_up_serdes_link_82575(struct e1000_hw *hw);
++extern void igb_power_down_phy_copper_82575(struct e1000_hw *hw);
+ extern void igb_rx_fifo_flush_82575(struct e1000_hw *hw);
+
+ #define ID_LED_DEFAULT_82575_SERDES ((ID_LED_DEF1_DEF2 << 12) | \
+diff --git a/drivers/net/igb/e1000_defines.h b/drivers/net/igb/e1000_defines.h
+index 6e036ae..c017150 100644
+--- a/drivers/net/igb/e1000_defines.h
++++ b/drivers/net/igb/e1000_defines.h
+@@ -481,6 +481,7 @@
+ /* PHY Control Register */
+ #define MII_CR_FULL_DUPLEX 0x0100 /* FDX =1, half duplex =0 */
+ #define MII_CR_RESTART_AUTO_NEG 0x0200 /* Restart auto negotiation */
++#define MII_CR_POWER_DOWN 0x0800 /* Power down */
+ #define MII_CR_AUTO_NEG_EN 0x1000 /* Auto Neg Enable */
+ #define MII_CR_LOOPBACK 0x4000 /* 0 = normal, 1 = loopback */
+ #define MII_CR_RESET 0x8000 /* 0 = normal, 1 = PHY reset */
+diff --git a/drivers/net/igb/e1000_phy.c b/drivers/net/igb/e1000_phy.c
+index 3670a66..cf1f323 100644
+--- a/drivers/net/igb/e1000_phy.c
++++ b/drivers/net/igb/e1000_phy.c
+@@ -1931,6 +1931,41 @@ s32 igb_phy_init_script_igp3(struct e1000_hw *hw)
+ }
+
+ /**
++ * igb_power_up_phy_copper - Restore copper link in case of PHY power down
++ * @hw: pointer to the HW structure
++ *
++ * In the case of a PHY power down to save power, or to turn off link during a
++ * driver unload, restore the link to previous settings.
++ **/
++void igb_power_up_phy_copper(struct e1000_hw *hw)
++{
++ u16 mii_reg = 0;
++
++ /* The PHY will retain its settings across a power down/up cycle */
++ hw->phy.ops.read_reg(hw, PHY_CONTROL, &mii_reg);
++ mii_reg &= ~MII_CR_POWER_DOWN;
++ hw->phy.ops.write_reg(hw, PHY_CONTROL, mii_reg);
++}
++
++/**
++ * igb_power_down_phy_copper - Power down copper PHY
++ * @hw: pointer to the HW structure
++ *
++ * Power down PHY to save power when interface is down and wake on lan
++ * is not enabled.
++ **/
++void igb_power_down_phy_copper(struct e1000_hw *hw)
++{
++ u16 mii_reg = 0;
++
++ /* The PHY will retain its settings across a power down/up cycle */
++ hw->phy.ops.read_reg(hw, PHY_CONTROL, &mii_reg);
++ mii_reg |= MII_CR_POWER_DOWN;
++ hw->phy.ops.write_reg(hw, PHY_CONTROL, mii_reg);
++ msleep(1);
++}
++
++/**
+ * igb_check_polarity_82580 - Checks the polarity.
+ * @hw: pointer to the HW structure
+ *
+diff --git a/drivers/net/igb/e1000_phy.h b/drivers/net/igb/e1000_phy.h
+index 555eb54..565a6db 100644
+--- a/drivers/net/igb/e1000_phy.h
++++ b/drivers/net/igb/e1000_phy.h
+@@ -60,6 +60,8 @@ s32 igb_setup_copper_link(struct e1000_hw *hw);
+ s32 igb_write_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 data);
+ s32 igb_phy_has_link(struct e1000_hw *hw, u32 iterations,
+ u32 usec_interval, bool *success);
++void igb_power_up_phy_copper(struct e1000_hw *hw);
++void igb_power_down_phy_copper(struct e1000_hw *hw);
+ s32 igb_phy_init_script_igp3(struct e1000_hw *hw);
+ s32 igb_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data);
+ s32 igb_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data);
+diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
+index c81cc9a..c3def38 100644
+--- a/drivers/net/igb/igb.h
++++ b/drivers/net/igb/igb.h
+@@ -355,6 +355,7 @@ extern void igb_alloc_rx_buffers_adv(struct igb_ring *, int);
+ extern void igb_update_stats(struct igb_adapter *);
+ extern bool igb_has_link(struct igb_adapter *adapter);
+ extern void igb_set_ethtool_ops(struct net_device *);
++extern void igb_power_up_link(struct igb_adapter *);
+
+ static inline s32 igb_reset_phy(struct e1000_hw *hw)
+ {
+diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
+index 4eea03b..4852883 100644
+--- a/drivers/net/igb/igb_ethtool.c
++++ b/drivers/net/igb/igb_ethtool.c
+@@ -1722,6 +1722,9 @@ static void igb_diag_test(struct net_device *netdev,
+
+ dev_info(&adapter->pdev->dev, "offline testing starting\n");
+
++ /* power up link for link test */
++ igb_power_up_link(adapter);
++
+ /* Link test performed before hardware reset so autoneg doesn't
+ * interfere with test result */
+ if (igb_link_test(adapter, &data[4]))
+@@ -1745,6 +1748,8 @@ static void igb_diag_test(struct net_device *netdev,
+ eth_test->flags |= ETH_TEST_FL_FAILED;
+
+ igb_reset(adapter);
++ /* power up link for loopback test */
++ igb_power_up_link(adapter);
+ if (igb_loopback_test(adapter, &data[3]))
+ eth_test->flags |= ETH_TEST_FL_FAILED;
+
+@@ -1763,9 +1768,14 @@ static void igb_diag_test(struct net_device *netdev,
+ dev_open(netdev);
+ } else {
+ dev_info(&adapter->pdev->dev, "online testing starting\n");
+- /* Online tests */
+- if (igb_link_test(adapter, &data[4]))
+- eth_test->flags |= ETH_TEST_FL_FAILED;
++
++ /* PHY is powered down when interface is down */
++ if (!netif_carrier_ok(netdev)) {
++ data[4] = 0;
++ } else {
++ if (igb_link_test(adapter, &data[4]))
++ eth_test->flags |= ETH_TEST_FL_FAILED;
++ }
+
+ /* Online tests aren't run; pass by default */
+ data[0] = 0;
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index f996e06..3090660 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -1108,6 +1108,29 @@ static void igb_configure(struct igb_adapter *adapter)
+ adapter->tx_queue_len = netdev->tx_queue_len;
+ }
+
++/**
++ * igb_power_up_link - Power up the phy/serdes link
++ * @adapter: address of board private structure
++ **/
++void igb_power_up_link(struct igb_adapter *adapter)
++{
++ if (adapter->hw.phy.media_type == e1000_media_type_copper)
++ igb_power_up_phy_copper(&adapter->hw);
++ else
++ igb_power_up_serdes_link_82575(&adapter->hw);
++}
++
++/**
++ * igb_power_down_link - Power down the phy/serdes link
++ * @adapter: address of board private structure
++ */
++static void igb_power_down_link(struct igb_adapter *adapter)
++{
++ if (adapter->hw.phy.media_type == e1000_media_type_copper)
++ igb_power_down_phy_copper_82575(&adapter->hw);
++ else
++ igb_shutdown_serdes_link_82575(&adapter->hw);
++}
+
+ /**
+ * igb_up - Open the interface and prepare it to handle traffic
+@@ -1329,6 +1352,9 @@ void igb_reset(struct igb_adapter *adapter)
+ wr32(E1000_PCIEMISC,
+ reg & ~E1000_PCIEMISC_LX_DECISION);
+ }
++ if (!netif_running(adapter->netdev))
++ igb_power_down_link(adapter);
++
+ igb_update_mng_vlan(adapter);
+
+ /* Enable h/w to recognize an 802.1Q VLAN Ethernet packet */
+@@ -1707,9 +1733,6 @@ static void __devexit igb_remove(struct pci_dev *pdev)
+
+ unregister_netdev(netdev);
+
+- if (!igb_check_reset_block(hw))
+- igb_reset_phy(hw);
+-
+ igb_clear_interrupt_scheme(adapter);
+
+ #ifdef CONFIG_PCI_IOV
+@@ -1985,7 +2008,7 @@ static int igb_open(struct net_device *netdev)
+ if (err)
+ goto err_setup_rx;
+
+- /* e1000_power_up_phy(adapter); */
++ igb_power_up_link(adapter);
+
+ /* before we allocate an interrupt, we must be ready to handle it.
+ * Setting DEBUG_SHIRQ in the kernel makes it fire an interrupt
+@@ -2027,7 +2050,7 @@ static int igb_open(struct net_device *netdev)
+
+ err_req_irq:
+ igb_release_hw_control(adapter);
+- /* e1000_power_down_phy(adapter); */
++ igb_power_down_link(adapter);
+ igb_free_all_rx_resources(adapter);
+ err_setup_rx:
+ igb_free_all_tx_resources(adapter);
+@@ -5748,7 +5771,9 @@ static int __igb_shutdown(struct pci_dev *pdev, bool *enable_wake)
+
+ *enable_wake = wufc || adapter->en_mng_pt;
+ if (!*enable_wake)
+- igb_shutdown_serdes_link_82575(hw);
++ igb_power_down_link(adapter);
++ else
++ igb_power_up_link(adapter);
+
+ /* Release control of h/w to f/w. If f/w is AMT enabled, this
+ * would have already happened in close and is redundant. */
+@@ -5805,8 +5830,6 @@ static int igb_resume(struct pci_dev *pdev)
+ return -ENOMEM;
+ }
+
+- /* e1000_power_up_phy(adapter); */
+-
+ igb_reset(adapter);
+
+ /* let the f/w know that the h/w is now under the control of the
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0098-igb-call-pci_save_state-after-pci_restore_state.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0098-igb-call-pci_save_state-after-pci_restore_state.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,42 @@
+From: Nick Nunley <nicholasx.d.nunley at intel.com>
+Date: Wed, 17 Feb 2010 01:02:19 +0000
+Subject: [PATCH 098/165] igb: call pci_save_state after pci_restore_state
+
+commit b94f2d775a71ed09dc8ca2bf24c611bdce9e82e7 upstream.
+
+This patch adds calls to pci_save_state() immediately after
+calls to pci_restore_state(). Due to a change in the behavior
+of pci_restore_state() it is necessary to call pci_save_state()
+to keep the state_saved flag. This patch is based on a similar
+patch for ixgbe.
+
+Signed-off-by: Nicholas Nunley <nicholasx.d.nunley at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 3090660..8f6d19f 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -5813,6 +5813,7 @@ static int igb_resume(struct pci_dev *pdev)
+
+ pci_set_power_state(pdev, PCI_D0);
+ pci_restore_state(pdev);
++ pci_save_state(pdev);
+
+ err = pci_enable_device_mem(pdev);
+ if (err) {
+@@ -5938,6 +5939,7 @@ static pci_ers_result_t igb_io_slot_reset(struct pci_dev *pdev)
+ } else {
+ pci_set_master(pdev);
+ pci_restore_state(pdev);
++ pci_save_state(pdev);
+
+ pci_enable_wake(pdev, PCI_D3hot, 0);
+ pci_enable_wake(pdev, PCI_D3cold, 0);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0099-igb-Allocate-rings-seperately-instead-of-as-a-block.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0099-igb-Allocate-rings-seperately-instead-of-as-a-block.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,466 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Wed, 17 Feb 2010 01:02:39 +0000
+Subject: [PATCH 099/165] igb: Allocate rings seperately instead of as a block
+
+commit 3025a446b6d0255ae4399ca5f9b259bd1b51539e upstream.
+
+This change makes it so that the rings are allocated seperately. As a
+result we can allocate them on seperate nodes at some point in the future
+if we so desire.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb.h | 5 +-
+ drivers/net/igb/igb_ethtool.c | 46 +++++++++--------
+ drivers/net/igb/igb_main.c | 113 +++++++++++++++++++++--------------------
+ 3 files changed, 83 insertions(+), 81 deletions(-)
+
+diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
+index c3def38..8989d35 100644
+--- a/drivers/net/igb/igb.h
++++ b/drivers/net/igb/igb.h
+@@ -237,7 +237,6 @@ static inline int igb_desc_unused(struct igb_ring *ring)
+ }
+
+ /* board specific private data structure */
+-
+ struct igb_adapter {
+ struct timer_list watchdog_timer;
+ struct timer_list phy_info_timer;
+@@ -263,12 +262,12 @@ struct igb_adapter {
+ unsigned long led_status;
+
+ /* TX */
+- struct igb_ring *tx_ring; /* One per active queue */
++ struct igb_ring *tx_ring[16];
+ unsigned long tx_queue_len;
+ u32 tx_timeout_count;
+
+ /* RX */
+- struct igb_ring *rx_ring; /* One per active queue */
++ struct igb_ring *rx_ring[16];
+ int num_tx_queues;
+ int num_rx_queues;
+
+diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
+index 4852883..a4cead1 100644
+--- a/drivers/net/igb/igb_ethtool.c
++++ b/drivers/net/igb/igb_ethtool.c
+@@ -314,7 +314,7 @@ static int igb_set_pauseparam(struct net_device *netdev,
+ static u32 igb_get_rx_csum(struct net_device *netdev)
+ {
+ struct igb_adapter *adapter = netdev_priv(netdev);
+- return !!(adapter->rx_ring[0].flags & IGB_RING_FLAG_RX_CSUM);
++ return !!(adapter->rx_ring[0]->flags & IGB_RING_FLAG_RX_CSUM);
+ }
+
+ static int igb_set_rx_csum(struct net_device *netdev, u32 data)
+@@ -324,9 +324,9 @@ static int igb_set_rx_csum(struct net_device *netdev, u32 data)
+
+ for (i = 0; i < adapter->num_rx_queues; i++) {
+ if (data)
+- adapter->rx_ring[i].flags |= IGB_RING_FLAG_RX_CSUM;
++ adapter->rx_ring[i]->flags |= IGB_RING_FLAG_RX_CSUM;
+ else
+- adapter->rx_ring[i].flags &= ~IGB_RING_FLAG_RX_CSUM;
++ adapter->rx_ring[i]->flags &= ~IGB_RING_FLAG_RX_CSUM;
+ }
+
+ return 0;
+@@ -789,9 +789,9 @@ static int igb_set_ringparam(struct net_device *netdev,
+
+ if (!netif_running(adapter->netdev)) {
+ for (i = 0; i < adapter->num_tx_queues; i++)
+- adapter->tx_ring[i].count = new_tx_count;
++ adapter->tx_ring[i]->count = new_tx_count;
+ for (i = 0; i < adapter->num_rx_queues; i++)
+- adapter->rx_ring[i].count = new_rx_count;
++ adapter->rx_ring[i]->count = new_rx_count;
+ adapter->tx_ring_count = new_tx_count;
+ adapter->rx_ring_count = new_rx_count;
+ goto clear_reset;
+@@ -815,10 +815,10 @@ static int igb_set_ringparam(struct net_device *netdev,
+ * to the tx and rx ring structs.
+ */
+ if (new_tx_count != adapter->tx_ring_count) {
+- memcpy(temp_ring, adapter->tx_ring,
+- adapter->num_tx_queues * sizeof(struct igb_ring));
+-
+ for (i = 0; i < adapter->num_tx_queues; i++) {
++ memcpy(&temp_ring[i], adapter->tx_ring[i],
++ sizeof(struct igb_ring));
++
+ temp_ring[i].count = new_tx_count;
+ err = igb_setup_tx_resources(&temp_ring[i]);
+ if (err) {
+@@ -830,20 +830,21 @@ static int igb_set_ringparam(struct net_device *netdev,
+ }
+ }
+
+- for (i = 0; i < adapter->num_tx_queues; i++)
+- igb_free_tx_resources(&adapter->tx_ring[i]);
++ for (i = 0; i < adapter->num_tx_queues; i++) {
++ igb_free_tx_resources(adapter->tx_ring[i]);
+
+- memcpy(adapter->tx_ring, temp_ring,
+- adapter->num_tx_queues * sizeof(struct igb_ring));
++ memcpy(adapter->tx_ring[i], &temp_ring[i],
++ sizeof(struct igb_ring));
++ }
+
+ adapter->tx_ring_count = new_tx_count;
+ }
+
+- if (new_rx_count != adapter->rx_ring->count) {
+- memcpy(temp_ring, adapter->rx_ring,
+- adapter->num_rx_queues * sizeof(struct igb_ring));
+-
++ if (new_rx_count != adapter->rx_ring_count) {
+ for (i = 0; i < adapter->num_rx_queues; i++) {
++ memcpy(&temp_ring[i], adapter->rx_ring[i],
++ sizeof(struct igb_ring));
++
+ temp_ring[i].count = new_rx_count;
+ err = igb_setup_rx_resources(&temp_ring[i]);
+ if (err) {
+@@ -856,11 +857,12 @@ static int igb_set_ringparam(struct net_device *netdev,
+
+ }
+
+- for (i = 0; i < adapter->num_rx_queues; i++)
+- igb_free_rx_resources(&adapter->rx_ring[i]);
++ for (i = 0; i < adapter->num_rx_queues; i++) {
++ igb_free_rx_resources(adapter->rx_ring[i]);
+
+- memcpy(adapter->rx_ring, temp_ring,
+- adapter->num_rx_queues * sizeof(struct igb_ring));
++ memcpy(adapter->rx_ring[i], &temp_ring[i],
++ sizeof(struct igb_ring));
++ }
+
+ adapter->rx_ring_count = new_rx_count;
+ }
+@@ -2036,12 +2038,12 @@ static void igb_get_ethtool_stats(struct net_device *netdev,
+ sizeof(u64)) ? *(u64 *)p : *(u32 *)p;
+ }
+ for (j = 0; j < adapter->num_tx_queues; j++) {
+- queue_stat = (u64 *)&adapter->tx_ring[j].tx_stats;
++ queue_stat = (u64 *)&adapter->tx_ring[j]->tx_stats;
+ for (k = 0; k < IGB_TX_QUEUE_STATS_LEN; k++, i++)
+ data[i] = queue_stat[k];
+ }
+ for (j = 0; j < adapter->num_rx_queues; j++) {
+- queue_stat = (u64 *)&adapter->rx_ring[j].rx_stats;
++ queue_stat = (u64 *)&adapter->rx_ring[j]->rx_stats;
+ for (k = 0; k < IGB_RX_QUEUE_STATS_LEN; k++, i++)
+ data[i] = queue_stat[k];
+ }
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 8f6d19f..11192e9 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -312,31 +312,35 @@ static void igb_cache_ring_register(struct igb_adapter *adapter)
+ */
+ if (adapter->vfs_allocated_count) {
+ for (; i < adapter->rss_queues; i++)
+- adapter->rx_ring[i].reg_idx = rbase_offset +
+- Q_IDX_82576(i);
++ adapter->rx_ring[i]->reg_idx = rbase_offset +
++ Q_IDX_82576(i);
+ for (; j < adapter->rss_queues; j++)
+- adapter->tx_ring[j].reg_idx = rbase_offset +
+- Q_IDX_82576(j);
++ adapter->tx_ring[j]->reg_idx = rbase_offset +
++ Q_IDX_82576(j);
+ }
+ case e1000_82575:
+ case e1000_82580:
+ default:
+ for (; i < adapter->num_rx_queues; i++)
+- adapter->rx_ring[i].reg_idx = rbase_offset + i;
++ adapter->rx_ring[i]->reg_idx = rbase_offset + i;
+ for (; j < adapter->num_tx_queues; j++)
+- adapter->tx_ring[j].reg_idx = rbase_offset + j;
++ adapter->tx_ring[j]->reg_idx = rbase_offset + j;
+ break;
+ }
+ }
+
+ static void igb_free_queues(struct igb_adapter *adapter)
+ {
+- kfree(adapter->tx_ring);
+- kfree(adapter->rx_ring);
+-
+- adapter->tx_ring = NULL;
+- adapter->rx_ring = NULL;
++ int i;
+
++ for (i = 0; i < adapter->num_tx_queues; i++) {
++ kfree(adapter->tx_ring[i]);
++ adapter->tx_ring[i] = NULL;
++ }
++ for (i = 0; i < adapter->num_rx_queues; i++) {
++ kfree(adapter->rx_ring[i]);
++ adapter->rx_ring[i] = NULL;
++ }
+ adapter->num_rx_queues = 0;
+ adapter->num_tx_queues = 0;
+ }
+@@ -350,20 +354,13 @@ static void igb_free_queues(struct igb_adapter *adapter)
+ **/
+ static int igb_alloc_queues(struct igb_adapter *adapter)
+ {
++ struct igb_ring *ring;
+ int i;
+
+- adapter->tx_ring = kcalloc(adapter->num_tx_queues,
+- sizeof(struct igb_ring), GFP_KERNEL);
+- if (!adapter->tx_ring)
+- goto err;
+-
+- adapter->rx_ring = kcalloc(adapter->num_rx_queues,
+- sizeof(struct igb_ring), GFP_KERNEL);
+- if (!adapter->rx_ring)
+- goto err;
+-
+ for (i = 0; i < adapter->num_tx_queues; i++) {
+- struct igb_ring *ring = &(adapter->tx_ring[i]);
++ ring = kzalloc(sizeof(struct igb_ring), GFP_KERNEL);
++ if (!ring)
++ goto err;
+ ring->count = adapter->tx_ring_count;
+ ring->queue_index = i;
+ ring->pdev = adapter->pdev;
+@@ -371,10 +368,13 @@ static int igb_alloc_queues(struct igb_adapter *adapter)
+ /* For 82575, context index must be unique per ring. */
+ if (adapter->hw.mac.type == e1000_82575)
+ ring->flags = IGB_RING_FLAG_TX_CTX_IDX;
++ adapter->tx_ring[i] = ring;
+ }
+
+ for (i = 0; i < adapter->num_rx_queues; i++) {
+- struct igb_ring *ring = &(adapter->rx_ring[i]);
++ ring = kzalloc(sizeof(struct igb_ring), GFP_KERNEL);
++ if (!ring)
++ goto err;
+ ring->count = adapter->rx_ring_count;
+ ring->queue_index = i;
+ ring->pdev = adapter->pdev;
+@@ -384,6 +384,7 @@ static int igb_alloc_queues(struct igb_adapter *adapter)
+ /* set flag indicating ring supports SCTP checksum offload */
+ if (adapter->hw.mac.type >= e1000_82576)
+ ring->flags |= IGB_RING_FLAG_RX_SCTP_CSUM;
++ adapter->rx_ring[i] = ring;
+ }
+
+ igb_cache_ring_register(adapter);
+@@ -774,10 +775,9 @@ err_out:
+ static void igb_map_rx_ring_to_vector(struct igb_adapter *adapter,
+ int ring_idx, int v_idx)
+ {
+- struct igb_q_vector *q_vector;
++ struct igb_q_vector *q_vector = adapter->q_vector[v_idx];
+
+- q_vector = adapter->q_vector[v_idx];
+- q_vector->rx_ring = &adapter->rx_ring[ring_idx];
++ q_vector->rx_ring = adapter->rx_ring[ring_idx];
+ q_vector->rx_ring->q_vector = q_vector;
+ q_vector->itr_val = adapter->rx_itr_setting;
+ if (q_vector->itr_val && q_vector->itr_val <= 3)
+@@ -787,10 +787,9 @@ static void igb_map_rx_ring_to_vector(struct igb_adapter *adapter,
+ static void igb_map_tx_ring_to_vector(struct igb_adapter *adapter,
+ int ring_idx, int v_idx)
+ {
+- struct igb_q_vector *q_vector;
++ struct igb_q_vector *q_vector = adapter->q_vector[v_idx];
+
+- q_vector = adapter->q_vector[v_idx];
+- q_vector->tx_ring = &adapter->tx_ring[ring_idx];
++ q_vector->tx_ring = adapter->tx_ring[ring_idx];
+ q_vector->tx_ring->q_vector = q_vector;
+ q_vector->itr_val = adapter->tx_itr_setting;
+ if (q_vector->itr_val && q_vector->itr_val <= 3)
+@@ -1100,7 +1099,7 @@ static void igb_configure(struct igb_adapter *adapter)
+ * at least 1 descriptor unused to make sure
+ * next_to_use != next_to_clean */
+ for (i = 0; i < adapter->num_rx_queues; i++) {
+- struct igb_ring *ring = &adapter->rx_ring[i];
++ struct igb_ring *ring = adapter->rx_ring[i];
+ igb_alloc_rx_buffers_adv(ring, igb_desc_unused(ring));
+ }
+
+@@ -2138,19 +2137,19 @@ static int igb_setup_all_tx_resources(struct igb_adapter *adapter)
+ int i, err = 0;
+
+ for (i = 0; i < adapter->num_tx_queues; i++) {
+- err = igb_setup_tx_resources(&adapter->tx_ring[i]);
++ err = igb_setup_tx_resources(adapter->tx_ring[i]);
+ if (err) {
+ dev_err(&pdev->dev,
+ "Allocation for Tx Queue %u failed\n", i);
+ for (i--; i >= 0; i--)
+- igb_free_tx_resources(&adapter->tx_ring[i]);
++ igb_free_tx_resources(adapter->tx_ring[i]);
+ break;
+ }
+ }
+
+ for (i = 0; i < IGB_ABS_MAX_TX_QUEUES; i++) {
+ int r_idx = i % adapter->num_tx_queues;
+- adapter->multi_tx_table[i] = &adapter->tx_ring[r_idx];
++ adapter->multi_tx_table[i] = adapter->tx_ring[r_idx];
+ }
+ return err;
+ }
+@@ -2233,7 +2232,7 @@ static void igb_configure_tx(struct igb_adapter *adapter)
+ int i;
+
+ for (i = 0; i < adapter->num_tx_queues; i++)
+- igb_configure_tx_ring(adapter, &adapter->tx_ring[i]);
++ igb_configure_tx_ring(adapter, adapter->tx_ring[i]);
+ }
+
+ /**
+@@ -2291,12 +2290,12 @@ static int igb_setup_all_rx_resources(struct igb_adapter *adapter)
+ int i, err = 0;
+
+ for (i = 0; i < adapter->num_rx_queues; i++) {
+- err = igb_setup_rx_resources(&adapter->rx_ring[i]);
++ err = igb_setup_rx_resources(adapter->rx_ring[i]);
+ if (err) {
+ dev_err(&pdev->dev,
+ "Allocation for Rx Queue %u failed\n", i);
+ for (i--; i >= 0; i--)
+- igb_free_rx_resources(&adapter->rx_ring[i]);
++ igb_free_rx_resources(adapter->rx_ring[i]);
+ break;
+ }
+ }
+@@ -2620,7 +2619,7 @@ static void igb_configure_rx(struct igb_adapter *adapter)
+ /* Setup the HW Rx Head and Tail Descriptor Pointers and
+ * the Base and Length of the Rx Descriptor Ring */
+ for (i = 0; i < adapter->num_rx_queues; i++)
+- igb_configure_rx_ring(adapter, &adapter->rx_ring[i]);
++ igb_configure_rx_ring(adapter, adapter->rx_ring[i]);
+ }
+
+ /**
+@@ -2657,7 +2656,7 @@ static void igb_free_all_tx_resources(struct igb_adapter *adapter)
+ int i;
+
+ for (i = 0; i < adapter->num_tx_queues; i++)
+- igb_free_tx_resources(&adapter->tx_ring[i]);
++ igb_free_tx_resources(adapter->tx_ring[i]);
+ }
+
+ void igb_unmap_and_free_tx_resource(struct igb_ring *tx_ring,
+@@ -2724,7 +2723,7 @@ static void igb_clean_all_tx_rings(struct igb_adapter *adapter)
+ int i;
+
+ for (i = 0; i < adapter->num_tx_queues; i++)
+- igb_clean_tx_ring(&adapter->tx_ring[i]);
++ igb_clean_tx_ring(adapter->tx_ring[i]);
+ }
+
+ /**
+@@ -2761,7 +2760,7 @@ static void igb_free_all_rx_resources(struct igb_adapter *adapter)
+ int i;
+
+ for (i = 0; i < adapter->num_rx_queues; i++)
+- igb_free_rx_resources(&adapter->rx_ring[i]);
++ igb_free_rx_resources(adapter->rx_ring[i]);
+ }
+
+ /**
+@@ -2825,7 +2824,7 @@ static void igb_clean_all_rx_rings(struct igb_adapter *adapter)
+ int i;
+
+ for (i = 0; i < adapter->num_rx_queues; i++)
+- igb_clean_rx_ring(&adapter->rx_ring[i]);
++ igb_clean_rx_ring(adapter->rx_ring[i]);
+ }
+
+ /**
+@@ -3148,7 +3147,7 @@ static void igb_watchdog_task(struct work_struct *work)
+ igb_update_adaptive(hw);
+
+ for (i = 0; i < adapter->num_tx_queues; i++) {
+- struct igb_ring *tx_ring = &adapter->tx_ring[i];
++ struct igb_ring *tx_ring = adapter->tx_ring[i];
+ if (!netif_carrier_ok(netdev)) {
+ /* We've lost link, so the controller stops DMA,
+ * but we've got queued Tx work that's never going
+@@ -3344,13 +3343,13 @@ static void igb_set_itr(struct igb_adapter *adapter)
+
+ adapter->rx_itr = igb_update_itr(adapter,
+ adapter->rx_itr,
+- adapter->rx_ring->total_packets,
+- adapter->rx_ring->total_bytes);
++ q_vector->rx_ring->total_packets,
++ q_vector->rx_ring->total_bytes);
+
+ adapter->tx_itr = igb_update_itr(adapter,
+ adapter->tx_itr,
+- adapter->tx_ring->total_packets,
+- adapter->tx_ring->total_bytes);
++ q_vector->tx_ring->total_packets,
++ q_vector->tx_ring->total_bytes);
+ current_itr = max(adapter->rx_itr, adapter->tx_itr);
+
+ /* conservative mode (itr 3) eliminates the lowest_latency setting */
+@@ -3373,10 +3372,10 @@ static void igb_set_itr(struct igb_adapter *adapter)
+ }
+
+ set_itr_now:
+- adapter->rx_ring->total_bytes = 0;
+- adapter->rx_ring->total_packets = 0;
+- adapter->tx_ring->total_bytes = 0;
+- adapter->tx_ring->total_packets = 0;
++ q_vector->rx_ring->total_bytes = 0;
++ q_vector->rx_ring->total_packets = 0;
++ q_vector->tx_ring->total_bytes = 0;
++ q_vector->tx_ring->total_packets = 0;
+
+ if (new_itr != q_vector->itr_val) {
+ /* this attempts to bias the interrupt rate towards Bulk
+@@ -3935,7 +3934,7 @@ static int igb_change_mtu(struct net_device *netdev, int new_mtu)
+ netdev->mtu = new_mtu;
+
+ for (i = 0; i < adapter->num_rx_queues; i++)
+- adapter->rx_ring[i].rx_buffer_len = rx_buffer_len;
++ adapter->rx_ring[i]->rx_buffer_len = rx_buffer_len;
+
+ if (netif_running(netdev))
+ igb_up(adapter);
+@@ -3977,10 +3976,11 @@ void igb_update_stats(struct igb_adapter *adapter)
+ packets = 0;
+ for (i = 0; i < adapter->num_rx_queues; i++) {
+ u32 rqdpc_tmp = rd32(E1000_RQDPC(i)) & 0x0FFF;
+- adapter->rx_ring[i].rx_stats.drops += rqdpc_tmp;
++ struct igb_ring *ring = adapter->rx_ring[i];
++ ring->rx_stats.drops += rqdpc_tmp;
+ net_stats->rx_fifo_errors += rqdpc_tmp;
+- bytes += adapter->rx_ring[i].rx_stats.bytes;
+- packets += adapter->rx_ring[i].rx_stats.packets;
++ bytes += ring->rx_stats.bytes;
++ packets += ring->rx_stats.packets;
+ }
+
+ net_stats->rx_bytes = bytes;
+@@ -3989,8 +3989,9 @@ void igb_update_stats(struct igb_adapter *adapter)
+ bytes = 0;
+ packets = 0;
+ for (i = 0; i < adapter->num_tx_queues; i++) {
+- bytes += adapter->tx_ring[i].tx_stats.bytes;
+- packets += adapter->tx_ring[i].tx_stats.packets;
++ struct igb_ring *ring = adapter->tx_ring[i];
++ bytes += ring->tx_stats.bytes;
++ packets += ring->tx_stats.packets;
+ }
+ net_stats->tx_bytes = bytes;
+ net_stats->tx_packets = packets;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0100-igb-remove-adaptive-IFS-from-driver.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0100-igb-remove-adaptive-IFS-from-driver.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,201 @@
+From: Nick Nunley <nicholasx.d.nunley at intel.com>
+Date: Wed, 17 Feb 2010 01:02:59 +0000
+Subject: [PATCH 100/165] igb: remove adaptive IFS from driver
+
+commit 2d0b0f693578109aff347e055d47f2797c802261 upstream.
+
+Adaptive IFS support has been included in the igb driver since its
+initial release, but it is not a feature on any igb NICs. This patch
+removes it from the driver.
+
+Signed-off-by: Nicholas Nunley <nicholasx.d.nunley at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/e1000_defines.h | 6 ---
+ drivers/net/igb/e1000_hw.h | 7 ----
+ drivers/net/igb/e1000_mac.c | 70 ---------------------------------------
+ drivers/net/igb/e1000_mac.h | 2 -
+ drivers/net/igb/igb_main.c | 10 +----
+ 5 files changed, 2 insertions(+), 93 deletions(-)
+
+diff --git a/drivers/net/igb/e1000_defines.h b/drivers/net/igb/e1000_defines.h
+index c017150..fe6cf1b 100644
+--- a/drivers/net/igb/e1000_defines.h
++++ b/drivers/net/igb/e1000_defines.h
+@@ -313,12 +313,6 @@
+ #define E1000_PBA_34K 0x0022
+ #define E1000_PBA_64K 0x0040 /* 64KB */
+
+-#define IFS_MAX 80
+-#define IFS_MIN 40
+-#define IFS_RATIO 4
+-#define IFS_STEP 10
+-#define MIN_NUM_XMITS 1000
+-
+ /* SW Semaphore Register */
+ #define E1000_SWSM_SMBI 0x00000001 /* Driver Semaphore bit */
+ #define E1000_SWSM_SWESMBI 0x00000002 /* FW Semaphore bit */
+diff --git a/drivers/net/igb/e1000_hw.h b/drivers/net/igb/e1000_hw.h
+index dbaeb5f..4480052 100644
+--- a/drivers/net/igb/e1000_hw.h
++++ b/drivers/net/igb/e1000_hw.h
+@@ -339,19 +339,12 @@ struct e1000_mac_info {
+
+ enum e1000_mac_type type;
+
+- u32 collision_delta;
+ u32 ledctl_default;
+ u32 ledctl_mode1;
+ u32 ledctl_mode2;
+ u32 mc_filter_type;
+- u32 tx_packet_delta;
+ u32 txcw;
+
+- u16 current_ifs_val;
+- u16 ifs_max_val;
+- u16 ifs_min_val;
+- u16 ifs_ratio;
+- u16 ifs_step_size;
+ u16 mta_reg_count;
+ u16 uta_reg_count;
+
+diff --git a/drivers/net/igb/e1000_mac.c b/drivers/net/igb/e1000_mac.c
+index 2ad358a..2a8a886 100644
+--- a/drivers/net/igb/e1000_mac.c
++++ b/drivers/net/igb/e1000_mac.c
+@@ -1304,76 +1304,6 @@ out:
+ }
+
+ /**
+- * igb_reset_adaptive - Reset Adaptive Interframe Spacing
+- * @hw: pointer to the HW structure
+- *
+- * Reset the Adaptive Interframe Spacing throttle to default values.
+- **/
+-void igb_reset_adaptive(struct e1000_hw *hw)
+-{
+- struct e1000_mac_info *mac = &hw->mac;
+-
+- if (!mac->adaptive_ifs) {
+- hw_dbg("Not in Adaptive IFS mode!\n");
+- goto out;
+- }
+-
+- if (!mac->ifs_params_forced) {
+- mac->current_ifs_val = 0;
+- mac->ifs_min_val = IFS_MIN;
+- mac->ifs_max_val = IFS_MAX;
+- mac->ifs_step_size = IFS_STEP;
+- mac->ifs_ratio = IFS_RATIO;
+- }
+-
+- mac->in_ifs_mode = false;
+- wr32(E1000_AIT, 0);
+-out:
+- return;
+-}
+-
+-/**
+- * igb_update_adaptive - Update Adaptive Interframe Spacing
+- * @hw: pointer to the HW structure
+- *
+- * Update the Adaptive Interframe Spacing Throttle value based on the
+- * time between transmitted packets and time between collisions.
+- **/
+-void igb_update_adaptive(struct e1000_hw *hw)
+-{
+- struct e1000_mac_info *mac = &hw->mac;
+-
+- if (!mac->adaptive_ifs) {
+- hw_dbg("Not in Adaptive IFS mode!\n");
+- goto out;
+- }
+-
+- if ((mac->collision_delta * mac->ifs_ratio) > mac->tx_packet_delta) {
+- if (mac->tx_packet_delta > MIN_NUM_XMITS) {
+- mac->in_ifs_mode = true;
+- if (mac->current_ifs_val < mac->ifs_max_val) {
+- if (!mac->current_ifs_val)
+- mac->current_ifs_val = mac->ifs_min_val;
+- else
+- mac->current_ifs_val +=
+- mac->ifs_step_size;
+- wr32(E1000_AIT,
+- mac->current_ifs_val);
+- }
+- }
+- } else {
+- if (mac->in_ifs_mode &&
+- (mac->tx_packet_delta <= MIN_NUM_XMITS)) {
+- mac->current_ifs_val = 0;
+- mac->in_ifs_mode = false;
+- wr32(E1000_AIT, 0);
+- }
+- }
+-out:
+- return;
+-}
+-
+-/**
+ * igb_validate_mdi_setting - Verify MDI/MDIx settings
+ * @hw: pointer to the HW structure
+ *
+diff --git a/drivers/net/igb/e1000_mac.h b/drivers/net/igb/e1000_mac.h
+index bca17d8..601be99 100644
+--- a/drivers/net/igb/e1000_mac.h
++++ b/drivers/net/igb/e1000_mac.h
+@@ -67,8 +67,6 @@ void igb_mta_set(struct e1000_hw *hw, u32 hash_value);
+ void igb_put_hw_semaphore(struct e1000_hw *hw);
+ void igb_rar_set(struct e1000_hw *hw, u8 *addr, u32 index);
+ s32 igb_check_alt_mac_addr(struct e1000_hw *hw);
+-void igb_reset_adaptive(struct e1000_hw *hw);
+-void igb_update_adaptive(struct e1000_hw *hw);
+
+ bool igb_enable_mng_pass_thru(struct e1000_hw *hw);
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 11192e9..28a3d29 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -1359,7 +1359,6 @@ void igb_reset(struct igb_adapter *adapter)
+ /* Enable h/w to recognize an 802.1Q VLAN Ethernet packet */
+ wr32(E1000_VET, ETHERNET_IEEE_VLAN_TYPE);
+
+- igb_reset_adaptive(hw);
+ igb_get_phy_info(hw);
+ }
+
+@@ -1498,7 +1497,6 @@ static int __devinit igb_probe(struct pci_dev *pdev,
+ igb_get_bus_info_pcie(hw);
+
+ hw->phy.autoneg_wait_to_complete = false;
+- hw->mac.adaptive_ifs = true;
+
+ /* Copper options */
+ if (hw->phy.media_type == e1000_media_type_copper) {
+@@ -3144,7 +3142,6 @@ static void igb_watchdog_task(struct work_struct *work)
+ }
+
+ igb_update_stats(adapter);
+- igb_update_adaptive(hw);
+
+ for (i = 0; i < adapter->num_tx_queues; i++) {
+ struct igb_ring *tx_ring = adapter->tx_ring[i];
+@@ -4049,11 +4046,8 @@ void igb_update_stats(struct igb_adapter *adapter)
+ adapter->stats.mptc += rd32(E1000_MPTC);
+ adapter->stats.bptc += rd32(E1000_BPTC);
+
+- /* used for adaptive IFS */
+- hw->mac.tx_packet_delta = rd32(E1000_TPT);
+- adapter->stats.tpt += hw->mac.tx_packet_delta;
+- hw->mac.collision_delta = rd32(E1000_COLC);
+- adapter->stats.colc += hw->mac.collision_delta;
++ adapter->stats.tpt += rd32(E1000_TPT);
++ adapter->stats.colc += rd32(E1000_COLC);
+
+ adapter->stats.algnerrc += rd32(E1000_ALGNERRC);
+ adapter->stats.rxerrc += rd32(E1000_RXERRC);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0101-igb-cap-interrupts-at-20K-per-queue-when-in-itr-mode.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0101-igb-cap-interrupts-at-20K-per-queue-when-in-itr-mode.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,37 @@
+From: Nick Nunley <nicholasx.d.nunley at intel.com>
+Date: Wed, 17 Feb 2010 01:03:19 +0000
+Subject: [PATCH 101/165] igb: cap interrupts at 20K per queue when in itr
+ mode 3
+
+commit abe1c3638ccf8b68536afb52b111f6ad46d1cf71 upstream.
+
+In order to maintain similar performance between MSI-X and
+legacy/MSI interrupts, this patch reduces the number of interrupts
+when receiving small packets to 20K when in interrupt throttle
+rate mode 3.
+
+Signed-off-by: Nicholas Nunley <nicholasx.d.nunley at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 4 ++++
+ 1 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 28a3d29..08fc7b7 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -3245,6 +3245,10 @@ static void igb_update_ring_itr(struct igb_q_vector *q_vector)
+ else
+ new_val = avg_wire_size / 2;
+
++ /* when in itr mode 3 do not exceed 20K ints/sec */
++ if (adapter->rx_itr_setting == 3 && new_val < 196)
++ new_val = 196;
++
+ set_itr_val:
+ if (new_val != q_vector->itr_val) {
+ q_vector->itr_val = new_val;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0102-igb-only-support-SRRCTL_DROP_EN-when-using-multiple-.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0102-igb-only-support-SRRCTL_DROP_EN-when-using-multiple-.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,35 @@
+From: Nick Nunley <nicholasx.d.nunley at intel.com>
+Date: Wed, 17 Feb 2010 01:03:38 +0000
+Subject: [PATCH 102/165] igb: only support SRRCTL_DROP_EN when using multiple
+ queues
+
+commit e6bdb6fefc590ad2fb5f79e1d1d3660afbc7c8ff upstream.
+
+The SRRCTL.DROP_EN bit should only be set when we are supporting
+multiple queues. This bit is meant to prevent head of line blocking
+and is unnecessary in the single queue case.
+
+Signed-off-by: Nicholas Nunley <nicholasx.d.nunley at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 3 +++
+ 1 files changed, 3 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 08fc7b7..83530256 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -2581,6 +2581,9 @@ void igb_configure_rx_ring(struct igb_adapter *adapter,
+ E1000_SRRCTL_BSIZEPKT_SHIFT;
+ srrctl |= E1000_SRRCTL_DESCTYPE_ADV_ONEBUF;
+ }
++ /* Only set Drop Enable if we are supporting multiple queues */
++ if (adapter->vfs_allocated_count || adapter->num_rx_queues > 1)
++ srrctl |= E1000_SRRCTL_DROP_EN;
+
+ wr32(E1000_SRRCTL(reg_idx), srrctl);
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0103-igb-only-read-phy-specific-stats-if-in-internal-phy-.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0103-igb-only-read-phy-specific-stats-if-in-internal-phy-.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,50 @@
+From: Nick Nunley <nicholasx.d.nunley at intel.com>
+Date: Wed, 17 Feb 2010 01:03:58 +0000
+Subject: [PATCH 103/165] igb: only read phy specific stats if in internal phy
+ mode
+
+commit 43915c7c9a99e38406103d9c72b73edeaa19d0ff upstream.
+
+There are a couple statistics registers that are not meant to
+be read when in SGMII/serdes mode. This patch adds a check to
+verify mode before reading and updating these statistics.
+
+Signed-off-by: Nicholas Nunley <nicholasx.d.nunley at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 11 ++++++++---
+ 1 files changed, 8 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 83530256..1a64aa8 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -3960,7 +3960,7 @@ void igb_update_stats(struct igb_adapter *adapter)
+ struct net_device_stats *net_stats = igb_get_stats(adapter->netdev);
+ struct e1000_hw *hw = &adapter->hw;
+ struct pci_dev *pdev = adapter->pdev;
+- u32 rnbc;
++ u32 rnbc, reg;
+ u16 phy_tmp;
+ int i;
+ u64 bytes, packets;
+@@ -4057,8 +4057,13 @@ void igb_update_stats(struct igb_adapter *adapter)
+ adapter->stats.colc += rd32(E1000_COLC);
+
+ adapter->stats.algnerrc += rd32(E1000_ALGNERRC);
+- adapter->stats.rxerrc += rd32(E1000_RXERRC);
+- adapter->stats.tncrs += rd32(E1000_TNCRS);
++ /* read internal phy specific stats */
++ reg = rd32(E1000_CTRL_EXT);
++ if (!(reg & E1000_CTRL_EXT_LINK_MODE_MASK)) {
++ adapter->stats.rxerrc += rd32(E1000_RXERRC);
++ adapter->stats.tncrs += rd32(E1000_TNCRS);
++ }
++
+ adapter->stats.tsctc += rd32(E1000_TSCTC);
+ adapter->stats.tsctfc += rd32(E1000_TSCTFC);
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0104-igb-inline-igb_maybe_stop_tx.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0104-igb-inline-igb_maybe_stop_tx.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,33 @@
+From: Nick Nunley <nicholasx.d.nunley at intel.com>
+Date: Wed, 17 Feb 2010 01:04:18 +0000
+Subject: [PATCH 104/165] igb: inline igb_maybe_stop_tx
+
+commit 717ba0893508c2c8706c1408c152aa6d286d5d80 upstream.
+
+igb_maybe_stop_tx() is extremely small and appears in several spots in
+the tx hotpath. This change inlines the function for a possible
+performance boost.
+
+Signed-off-by: Nicholas Nunley <nicholasx.d.nunley at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 1a64aa8..ded1341 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -3743,7 +3743,7 @@ static int __igb_maybe_stop_tx(struct igb_ring *tx_ring, int size)
+ return 0;
+ }
+
+-static int igb_maybe_stop_tx(struct igb_ring *tx_ring, int size)
++static inline int igb_maybe_stop_tx(struct igb_ring *tx_ring, int size)
+ {
+ if (igb_desc_unused(tx_ring) >= size)
+ return 0;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0105-igb-move-gso_segs-into-buffer_info-structure.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0105-igb-move-gso_segs-into-buffer_info-structure.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,53 @@
+From: Nick Nunley <nicholasx.d.nunley at intel.com>
+Date: Wed, 17 Feb 2010 01:04:37 +0000
+Subject: [PATCH 105/165] igb: move gso_segs into buffer_info structure
+
+commit 40e90c26f573fa5082be6e046b346e19ab0cd25f upstream.
+
+This change moves gso_segs into the buffer_info structure to avoid
+a possible cache line miss in clean_tx_irq.
+
+Signed-off-by: Nicholas Nunley <nicholasx.d.nunley at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb.h | 1 +
+ drivers/net/igb/igb_main.c | 3 ++-
+ 2 files changed, 3 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
+index 8989d35..3ddf432 100644
+--- a/drivers/net/igb/igb.h
++++ b/drivers/net/igb/igb.h
+@@ -138,6 +138,7 @@ struct igb_buffer {
+ u16 length;
+ u16 next_to_watch;
+ u16 mapped_as_page;
++ u16 gso_segs;
+ };
+ /* RX */
+ struct {
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index ded1341..ac410d7 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -3626,6 +3626,7 @@ static inline int igb_tx_map_adv(struct igb_ring *tx_ring, struct sk_buff *skb,
+ }
+
+ tx_ring->buffer_info[i].skb = skb;
++ tx_ring->buffer_info[i].gso_segs = skb_shinfo(skb)->gso_segs ?: 1;
+ tx_ring->buffer_info[first].next_to_watch = i;
+
+ return ++count;
+@@ -4960,7 +4961,7 @@ static bool igb_clean_tx_irq(struct igb_q_vector *q_vector)
+ if (skb) {
+ unsigned int segs, bytecount;
+ /* gso_segs is currently only valid for tcp */
+- segs = skb_shinfo(skb)->gso_segs ?: 1;
++ segs = buffer_info->gso_segs;
+ /* multiply data chunks by size of headers */
+ bytecount = ((segs - 1) * skb_headlen(skb)) +
+ skb->len;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0106-igb-minor-type-cleanups.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0106-igb-minor-type-cleanups.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,58 @@
+From: Nick Nunley <nicholasx.d.nunley at intel.com>
+Date: Wed, 17 Feb 2010 01:04:56 +0000
+Subject: [PATCH 106/165] igb: minor type cleanups
+
+commit 91d4ee3382e78bd78e0251a56e2fa96b20c26e30 upstream.
+
+This change cleans up some instances where unsigned int and u32
+were being used interchangeably, and cleans up hdr_len which
+was being set to 0 twice.
+
+Signed-off-by: Nicholas Nunley <nicholasx.d.nunley at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 12 ++++++------
+ 1 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index ac410d7..2cb1bfe 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -3419,8 +3419,8 @@ static inline int igb_tso_adv(struct igb_ring *tx_ring,
+ int err;
+ struct igb_buffer *buffer_info;
+ u32 info = 0, tu_cmd = 0;
+- u32 mss_l4len_idx, l4len;
+- *hdr_len = 0;
++ u32 mss_l4len_idx;
++ u8 l4len;
+
+ if (skb_header_cloned(skb)) {
+ err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC);
+@@ -3656,7 +3656,7 @@ dma_error:
+ }
+
+ static inline void igb_tx_queue_adv(struct igb_ring *tx_ring,
+- int tx_flags, int count, u32 paylen,
++ u32 tx_flags, int count, u32 paylen,
+ u8 hdr_len)
+ {
+ union e1000_adv_tx_desc *tx_desc;
+@@ -3755,10 +3755,10 @@ netdev_tx_t igb_xmit_frame_ring_adv(struct sk_buff *skb,
+ struct igb_ring *tx_ring)
+ {
+ struct igb_adapter *adapter = netdev_priv(tx_ring->netdev);
+- unsigned int first;
+- unsigned int tx_flags = 0;
+- u8 hdr_len = 0;
+ int tso = 0, count;
++ u32 tx_flags = 0;
++ u16 first;
++ u8 hdr_len = 0;
+ union skb_shared_tx *shtx = skb_tx(skb);
+
+ /* need: 1 descriptor per page,
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0107-igb-remove-unused-vmolr-value.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0107-igb-remove-unused-vmolr-value.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,42 @@
+From: Nick Nunley <nicholasx.d.nunley at intel.com>
+Date: Wed, 17 Feb 2010 01:05:15 +0000
+Subject: [PATCH 107/165] igb: remove unused vmolr value
+
+commit d3eeb62ddd06ea20a054213cface92d328709285 upstream.
+
+In an earlier version of igb_write_mc_addr_list() the vmolr register
+was modified. This register is no longer accessed, although the variable
+still exists. This patch removes it from the function.
+
+Signed-off-by: Nicholas Nunley <nicholasx.d.nunley at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 4 ----
+ 1 files changed, 0 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 2cb1bfe..487c847 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -2869,7 +2869,6 @@ static int igb_write_mc_addr_list(struct net_device *netdev)
+ struct e1000_hw *hw = &adapter->hw;
+ struct dev_mc_list *mc_ptr = netdev->mc_list;
+ u8 *mta_list;
+- u32 vmolr = 0;
+ int i;
+
+ if (netdev_mc_empty(netdev)) {
+@@ -2883,9 +2882,6 @@ static int igb_write_mc_addr_list(struct net_device *netdev)
+ if (!mta_list)
+ return -ENOMEM;
+
+- /* set vmolr receive overflow multicast bit */
+- vmolr |= E1000_VMOLR_ROMPE;
+-
+ /* The shared function expects a packed array of only addresses. */
+ mc_ptr = netdev->mc_list;
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0108-igb-use-igb_free_q_vectors-to-cleanup-failure-in-igb.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0108-igb-use-igb_free_q_vectors-to-cleanup-failure-in-igb.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,49 @@
+From: Nick Nunley <nicholasx.d.nunley at intel.com>
+Date: Wed, 17 Feb 2010 01:05:35 +0000
+Subject: [PATCH 108/165] igb: use igb_free_q_vectors to cleanup failure in
+ igb_alloc_q_vectors
+
+commit fe0592b4be0ce362e87cefd4f6dbf12cb5704d1b upstream.
+
+This change makes it so that igb_free_q_vectors is reused in
+igb_alloc_q_vectors to handle the cleanup instead of unwinding
+through the allocations.
+
+Signed-off-by: Nicholas Nunley <nicholasx.d.nunley at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 10 +++-------
+ 1 files changed, 3 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 487c847..19c4c18 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -643,6 +643,8 @@ static void igb_free_q_vectors(struct igb_adapter *adapter)
+ for (v_idx = 0; v_idx < adapter->num_q_vectors; v_idx++) {
+ struct igb_q_vector *q_vector = adapter->q_vector[v_idx];
+ adapter->q_vector[v_idx] = NULL;
++ if (!q_vector)
++ continue;
+ netif_napi_del(&q_vector->napi);
+ kfree(q_vector);
+ }
+@@ -762,13 +764,7 @@ static int igb_alloc_q_vectors(struct igb_adapter *adapter)
+ return 0;
+
+ err_out:
+- while (v_idx) {
+- v_idx--;
+- q_vector = adapter->q_vector[v_idx];
+- netif_napi_del(&q_vector->napi);
+- kfree(q_vector);
+- adapter->q_vector[v_idx] = NULL;
+- }
++ igb_free_q_vectors(adapter);
+ return -ENOMEM;
+ }
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0109-igb-change-descriptor-control-thresholds.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0109-igb-change-descriptor-control-thresholds.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,42 @@
+From: Nick Nunley <nicholasx.d.nunley at intel.com>
+Date: Wed, 17 Feb 2010 01:05:56 +0000
+Subject: [PATCH 109/165] igb: change descriptor control thresholds
+
+commit 58fd62f525e1182fbb2f7566aecb4545720d9aad upstream.
+
+This change simplifies the code by setting RX_PTHRESH to 8 for
+all devices, as it was unlikely that there was any advantage to
+set it at 16 for earlier cards. Additionally TX_WTHRESH is
+set to 1 for the 82576 NIC to improve performance by enabling
+a minimal amount of write combining when writing back descriptors.
+
+Signed-off-by: Nicholas Nunley <nicholasx.d.nunley at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb.h | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
+index 3ddf432..ce527bd 100644
+--- a/drivers/net/igb/igb.h
++++ b/drivers/net/igb/igb.h
+@@ -92,13 +92,13 @@ struct vf_data_storage {
+ * descriptors until either it has this many to write back, or the
+ * ITR timer expires.
+ */
+-#define IGB_RX_PTHRESH (hw->mac.type <= e1000_82576 ? 16 : 8)
++#define IGB_RX_PTHRESH 8
+ #define IGB_RX_HTHRESH 8
+ #define IGB_RX_WTHRESH 1
+ #define IGB_TX_PTHRESH 8
+ #define IGB_TX_HTHRESH 1
+ #define IGB_TX_WTHRESH ((hw->mac.type == e1000_82576 && \
+- adapter->msix_entries) ? 0 : 16)
++ adapter->msix_entries) ? 1 : 16)
+
+ /* this is the size past which hardware will drop packets when setting LPE=0 */
+ #define MAXIMUM_ETHERNET_VLAN_SIZE 1522
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0110-igb-update-tx-DMA-mapping-error-handling.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0110-igb-update-tx-DMA-mapping-error-handling.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,41 @@
+From: Nick Nunley <nicholasx.d.nunley at intel.com>
+Date: Wed, 17 Feb 2010 01:06:16 +0000
+Subject: [PATCH 110/165] igb: update tx DMA mapping error handling
+
+commit a77ff709dd30a263f8154b05a8514b46098b42ba upstream.
+
+This updates the tx DMA mapping error handling code to
+resemble e1000e/ixgbe.
+
+Signed-off-by: Nicholas Nunley <nicholasx.d.nunley at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 8 +++-----
+ 1 files changed, 3 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 19c4c18..34d567c 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -3632,14 +3632,12 @@ dma_error:
+ buffer_info->length = 0;
+ buffer_info->next_to_watch = 0;
+ buffer_info->mapped_as_page = false;
+- count--;
+
+ /* clear timestamp and dma mappings for remaining portion of packet */
+- while (count >= 0) {
+- count--;
++ while (count--) {
++ if (i == 0)
++ i = tx_ring->count;
+ i--;
+- if (i < 0)
+- i += tx_ring->count;
+ buffer_info = &tx_ring->buffer_info[i];
+ igb_unmap_and_free_tx_resource(tx_ring, buffer_info);
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0111-net-convert-multiple-drivers-to-use-netdev_for_each_.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0111-net-convert-multiple-drivers-to-use-netdev_for_each_.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,72 @@
+From: Jiri Pirko <jpirko at redhat.com>
+Date: Mon, 22 Feb 2010 09:22:26 +0000
+Subject: [PATCH 111/165] net: convert multiple drivers to use
+ netdev_for_each_mc_addr, part4
+
+commit 48e2f183cb1709600012265a2e723f45a350d5fe upstream.
+
+Signed-off-by: Jiri Pirko <jpirko at redhat.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Restricted to drivers/net/igb{,vf}]
+---
+ drivers/net/igb/igb_main.c | 12 ++++--------
+ drivers/net/igbvf/netdev.c | 12 +++---------
+ 2 files changed, 7 insertions(+), 17 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 34d567c..2f5764d 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -2863,7 +2863,7 @@ static int igb_write_mc_addr_list(struct net_device *netdev)
+ {
+ struct igb_adapter *adapter = netdev_priv(netdev);
+ struct e1000_hw *hw = &adapter->hw;
+- struct dev_mc_list *mc_ptr = netdev->mc_list;
++ struct dev_mc_list *mc_ptr;
+ u8 *mta_list;
+ int i;
+
+@@ -2879,14 +2879,10 @@ static int igb_write_mc_addr_list(struct net_device *netdev)
+ return -ENOMEM;
+
+ /* The shared function expects a packed array of only addresses. */
+- mc_ptr = netdev->mc_list;
++ i = 0;
++ netdev_for_each_mc_addr(mc_ptr, netdev)
++ memcpy(mta_list + (i++ * ETH_ALEN), mc_ptr->dmi_addr, ETH_ALEN);
+
+- for (i = 0; i < netdev_mc_count(netdev); i++) {
+- if (!mc_ptr)
+- break;
+- memcpy(mta_list + (i*ETH_ALEN), mc_ptr->dmi_addr, ETH_ALEN);
+- mc_ptr = mc_ptr->next;
+- }
+ igb_update_mc_addr_list(hw, mta_list, i);
+ kfree(mta_list);
+
+diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
+index 6029c40..a77afd8 100644
+--- a/drivers/net/igbvf/netdev.c
++++ b/drivers/net/igbvf/netdev.c
+@@ -1413,15 +1413,9 @@ static void igbvf_set_multi(struct net_device *netdev)
+ }
+
+ /* prepare a packed array of only addresses. */
+- mc_ptr = netdev->mc_list;
+-
+- for (i = 0; i < netdev_mc_count(netdev); i++) {
+- if (!mc_ptr)
+- break;
+- memcpy(mta_list + (i*ETH_ALEN), mc_ptr->dmi_addr,
+- ETH_ALEN);
+- mc_ptr = mc_ptr->next;
+- }
++ i = 0;
++ netdev_for_each_mc_addr(mc_ptr, netdev)
++ memcpy(mta_list + (i++ * ETH_ALEN), mc_ptr->dmi_addr, ETH_ALEN);
+
+ hw->mac.ops.update_mc_addr_list(hw, mta_list, i, 0, 0);
+ kfree(mta_list);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0112-igb-Add-support-for-82576-ET2-Quad-Port-Server-Adapt.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0112-igb-Add-support-for-82576-ET2-Quad-Port-Server-Adapt.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,55 @@
+From: Carolyn Wyborny <carolyn.wyborny at intel.com>
+Date: Fri, 19 Mar 2010 06:07:48 +0000
+Subject: [PATCH 112/165] igb: Add support for 82576 ET2 Quad Port Server
+ Adapter
+
+commit b894fa2627e28c078740dc7041cd08c7e2c353ab upstream.
+
+Signed-off-by: Carolyn Wyborny <carolyn.wyborny at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/e1000_82575.c | 1 +
+ drivers/net/igb/e1000_hw.h | 1 +
+ drivers/net/igb/igb_main.c | 1 +
+ 3 files changed, 3 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c
+index 9d7fa2f..0bc990e 100644
+--- a/drivers/net/igb/e1000_82575.c
++++ b/drivers/net/igb/e1000_82575.c
+@@ -94,6 +94,7 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
+ case E1000_DEV_ID_82576_FIBER:
+ case E1000_DEV_ID_82576_SERDES:
+ case E1000_DEV_ID_82576_QUAD_COPPER:
++ case E1000_DEV_ID_82576_QUAD_COPPER_ET2:
+ case E1000_DEV_ID_82576_SERDES_QUAD:
+ mac->type = e1000_82576;
+ break;
+diff --git a/drivers/net/igb/e1000_hw.h b/drivers/net/igb/e1000_hw.h
+index 4480052..82a533f 100644
+--- a/drivers/net/igb/e1000_hw.h
++++ b/drivers/net/igb/e1000_hw.h
+@@ -41,6 +41,7 @@ struct e1000_hw;
+ #define E1000_DEV_ID_82576_FIBER 0x10E6
+ #define E1000_DEV_ID_82576_SERDES 0x10E7
+ #define E1000_DEV_ID_82576_QUAD_COPPER 0x10E8
++#define E1000_DEV_ID_82576_QUAD_COPPER_ET2 0x1526
+ #define E1000_DEV_ID_82576_NS 0x150A
+ #define E1000_DEV_ID_82576_NS_SERDES 0x1518
+ #define E1000_DEV_ID_82576_SERDES_QUAD 0x150D
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 2f5764d..ecc8527 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -72,6 +72,7 @@ static DEFINE_PCI_DEVICE_TABLE(igb_pci_tbl) = {
+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_FIBER), board_82575 },
+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_SERDES), board_82575 },
+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_SERDES_QUAD), board_82575 },
++ { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_QUAD_COPPER_ET2), board_82575 },
+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_QUAD_COPPER), board_82575 },
+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_82575EB_COPPER), board_82575 },
+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_82575EB_FIBER_SERDES), board_82575 },
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0113-igb-Do-not-overwrite-mdicnfg-register-when-accessing.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0113-igb-Do-not-overwrite-mdicnfg-register-when-accessing.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,75 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Mon, 22 Mar 2010 14:07:26 +0000
+Subject: [PATCH 113/165] igb: Do not overwrite mdicnfg register when
+ accessing 82580 phy
+
+commit 411f557c3accbaa1e2b378d29aeaffffbec39ccc upstream.
+
+This change removes the extra configuration we were doing on the mdicnfg
+register which should be set by EEPROM and which we should not need to
+write again afterwards. This code was a holdover from some earlier
+development work that was being done on a board with an incomplete EEPROM
+and is no longer needed now that the production EEPROMs are in place.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/e1000_82575.c | 20 --------------------
+ 1 files changed, 0 insertions(+), 20 deletions(-)
+
+diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c
+index 0bc990e..ea944f5 100644
+--- a/drivers/net/igb/e1000_82575.c
++++ b/drivers/net/igb/e1000_82575.c
+@@ -1446,7 +1446,6 @@ void igb_vmdq_set_replication_pf(struct e1000_hw *hw, bool enable)
+ **/
+ static s32 igb_read_phy_reg_82580(struct e1000_hw *hw, u32 offset, u16 *data)
+ {
+- u32 mdicnfg = 0;
+ s32 ret_val;
+
+
+@@ -1454,15 +1453,6 @@ static s32 igb_read_phy_reg_82580(struct e1000_hw *hw, u32 offset, u16 *data)
+ if (ret_val)
+ goto out;
+
+- /*
+- * We config the phy address in MDICNFG register now. Same bits
+- * as before. The values in MDIC can be written but will be
+- * ignored. This allows us to call the old function after
+- * configuring the PHY address in the new register
+- */
+- mdicnfg = (hw->phy.addr << E1000_MDIC_PHY_SHIFT);
+- wr32(E1000_MDICNFG, mdicnfg);
+-
+ ret_val = igb_read_phy_reg_mdic(hw, offset, data);
+
+ hw->phy.ops.release(hw);
+@@ -1481,7 +1471,6 @@ out:
+ **/
+ static s32 igb_write_phy_reg_82580(struct e1000_hw *hw, u32 offset, u16 data)
+ {
+- u32 mdicnfg = 0;
+ s32 ret_val;
+
+
+@@ -1489,15 +1478,6 @@ static s32 igb_write_phy_reg_82580(struct e1000_hw *hw, u32 offset, u16 data)
+ if (ret_val)
+ goto out;
+
+- /*
+- * We config the phy address in MDICNFG register now. Same bits
+- * as before. The values in MDIC can be written but will be
+- * ignored. This allows us to call the old function after
+- * configuring the PHY address in the new register
+- */
+- mdicnfg = (hw->phy.addr << E1000_MDIC_PHY_SHIFT);
+- wr32(E1000_MDICNFG, mdicnfg);
+-
+ ret_val = igb_write_phy_reg_mdic(hw, offset, data);
+
+ hw->phy.ops.release(hw);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0114-igb-cleanup-usage-of-virtualization-registers.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0114-igb-cleanup-usage-of-virtualization-registers.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,61 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Mon, 22 Mar 2010 14:07:46 +0000
+Subject: [PATCH 114/165] igb: cleanup usage of virtualization registers
+
+commit 52a1dd4d15cc28da5d3e9bfb1526c314d65fdff8 upstream.
+
+The igb driver was incorrectly attempting to write to registers that do not
+exist on 82580 hardware. This wasn't causing any issues that I can tell,
+but it is not recommended behavior either so I have changed this so we are
+determining which registers to write to based on mac type.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 28 ++++++++++++++++------------
+ 1 files changed, 16 insertions(+), 12 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index ecc8527..641e976 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -6028,19 +6028,23 @@ static void igb_vmm_control(struct igb_adapter *adapter)
+ struct e1000_hw *hw = &adapter->hw;
+ u32 reg;
+
+- /* replication is not supported for 82575 */
+- if (hw->mac.type == e1000_82575)
++ switch (hw->mac.type) {
++ case e1000_82575:
++ default:
++ /* replication is not supported for 82575 */
+ return;
+-
+- /* enable replication vlan tag stripping */
+- reg = rd32(E1000_RPLOLR);
+- reg |= E1000_RPLOLR_STRVLAN;
+- wr32(E1000_RPLOLR, reg);
+-
+- /* notify HW that the MAC is adding vlan tags */
+- reg = rd32(E1000_DTXCTL);
+- reg |= E1000_DTXCTL_VLAN_ADDED;
+- wr32(E1000_DTXCTL, reg);
++ case e1000_82576:
++ /* notify HW that the MAC is adding vlan tags */
++ reg = rd32(E1000_DTXCTL);
++ reg |= E1000_DTXCTL_VLAN_ADDED;
++ wr32(E1000_DTXCTL, reg);
++ case e1000_82580:
++ /* enable replication vlan tag stripping */
++ reg = rd32(E1000_RPLOLR);
++ reg |= E1000_RPLOLR_STRVLAN;
++ wr32(E1000_RPLOLR, reg);
++ break;
++ }
+
+ if (adapter->vfs_allocated_count) {
+ igb_vmdq_set_loopback_pf(hw, true);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0115-igb-add-support-for-Intel-I350-Gigabit-Network-Conne.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0115-igb-add-support-for-Intel-I350-Gigabit-Network-Conne.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,272 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Mon, 22 Mar 2010 14:08:06 +0000
+Subject: [PATCH 115/165] igb: add support for Intel I350 Gigabit Network
+ Connection
+
+commit d2ba2ed8fe3aa796a671a6922119d7171bb49515 upstream.
+
+This patch adds support for the the I350 Gigabit network connection which
+is the follow-on part to the 82580.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+CC: James Hearn <james.r.hearn at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/e1000_82575.c | 13 ++++++++-
+ drivers/net/igb/e1000_82575.h | 7 +++--
+ drivers/net/igb/e1000_defines.h | 1 +
+ drivers/net/igb/e1000_hw.h | 5 ++++
+ drivers/net/igb/igb_ethtool.c | 50 +++++++++++++++++++++++++++++++++++++++
+ drivers/net/igb/igb_main.c | 12 +++++++++
+ 6 files changed, 83 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c
+index ea944f5..430631f 100644
+--- a/drivers/net/igb/e1000_82575.c
++++ b/drivers/net/igb/e1000_82575.c
+@@ -105,6 +105,12 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
+ case E1000_DEV_ID_82580_COPPER_DUAL:
+ mac->type = e1000_82580;
+ break;
++ case E1000_DEV_ID_I350_COPPER:
++ case E1000_DEV_ID_I350_FIBER:
++ case E1000_DEV_ID_I350_SERDES:
++ case E1000_DEV_ID_I350_SGMII:
++ mac->type = e1000_i350;
++ break;
+ default:
+ return -E1000_ERR_MAC_INIT;
+ break;
+@@ -154,8 +160,10 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
+ mac->rar_entry_count = E1000_RAR_ENTRIES_82576;
+ if (mac->type == e1000_82580)
+ mac->rar_entry_count = E1000_RAR_ENTRIES_82580;
++ if (mac->type == e1000_i350)
++ mac->rar_entry_count = E1000_RAR_ENTRIES_I350;
+ /* reset */
+- if (mac->type == e1000_82580)
++ if (mac->type >= e1000_82580)
+ mac->ops.reset_hw = igb_reset_hw_82580;
+ else
+ mac->ops.reset_hw = igb_reset_hw_82575;
+@@ -226,7 +234,7 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
+ phy->ops.reset = igb_phy_hw_reset_sgmii_82575;
+ phy->ops.read_reg = igb_read_phy_reg_sgmii_82575;
+ phy->ops.write_reg = igb_write_phy_reg_sgmii_82575;
+- } else if (hw->mac.type == e1000_82580) {
++ } else if (hw->mac.type >= e1000_82580) {
+ phy->ops.reset = igb_phy_hw_reset;
+ phy->ops.read_reg = igb_read_phy_reg_82580;
+ phy->ops.write_reg = igb_write_phy_reg_82580;
+@@ -262,6 +270,7 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
+ phy->ops.set_d3_lplu_state = igb_set_d3_lplu_state;
+ break;
+ case I82580_I_PHY_ID:
++ case I350_I_PHY_ID:
+ phy->type = e1000_phy_82580;
+ phy->ops.force_speed_duplex = igb_phy_force_speed_duplex_82580;
+ phy->ops.get_cable_length = igb_get_cable_length_82580;
+diff --git a/drivers/net/igb/e1000_82575.h b/drivers/net/igb/e1000_82575.h
+index 168c7c0..c923cc8 100644
+--- a/drivers/net/igb/e1000_82575.h
++++ b/drivers/net/igb/e1000_82575.h
+@@ -38,9 +38,10 @@ extern void igb_rx_fifo_flush_82575(struct e1000_hw *hw);
+ (ID_LED_DEF1_DEF2 << 4) | \
+ (ID_LED_OFF1_ON2))
+
+-#define E1000_RAR_ENTRIES_82575 16
+-#define E1000_RAR_ENTRIES_82576 24
+-#define E1000_RAR_ENTRIES_82580 24
++#define E1000_RAR_ENTRIES_82575 16
++#define E1000_RAR_ENTRIES_82576 24
++#define E1000_RAR_ENTRIES_82580 24
++#define E1000_RAR_ENTRIES_I350 32
+
+ #define E1000_SW_SYNCH_MB 0x00000100
+ #define E1000_STAT_DEV_RST_SET 0x00100000
+diff --git a/drivers/net/igb/e1000_defines.h b/drivers/net/igb/e1000_defines.h
+index fe6cf1b..31d24e0 100644
+--- a/drivers/net/igb/e1000_defines.h
++++ b/drivers/net/igb/e1000_defines.h
+@@ -629,6 +629,7 @@
+ #define M88E1111_I_PHY_ID 0x01410CC0
+ #define IGP03E1000_E_PHY_ID 0x02A80390
+ #define I82580_I_PHY_ID 0x015403A0
++#define I350_I_PHY_ID 0x015403B0
+ #define M88_VENDOR 0x0141
+
+ /* M88E1000 Specific Registers */
+diff --git a/drivers/net/igb/e1000_hw.h b/drivers/net/igb/e1000_hw.h
+index 82a533f..593d5fa 100644
+--- a/drivers/net/igb/e1000_hw.h
++++ b/drivers/net/igb/e1000_hw.h
+@@ -53,6 +53,10 @@ struct e1000_hw;
+ #define E1000_DEV_ID_82580_SERDES 0x1510
+ #define E1000_DEV_ID_82580_SGMII 0x1511
+ #define E1000_DEV_ID_82580_COPPER_DUAL 0x1516
++#define E1000_DEV_ID_I350_COPPER 0x1521
++#define E1000_DEV_ID_I350_FIBER 0x1522
++#define E1000_DEV_ID_I350_SERDES 0x1523
++#define E1000_DEV_ID_I350_SGMII 0x1524
+
+ #define E1000_REVISION_2 2
+ #define E1000_REVISION_4 4
+@@ -72,6 +76,7 @@ enum e1000_mac_type {
+ e1000_82575,
+ e1000_82576,
+ e1000_82580,
++ e1000_i350,
+ e1000_num_macs /* List is 1-based, so subtract 1 for true count. */
+ };
+
+diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
+index a4cead1..1d4ee41 100644
+--- a/drivers/net/igb/igb_ethtool.c
++++ b/drivers/net/igb/igb_ethtool.c
+@@ -901,6 +901,49 @@ struct igb_reg_test {
+ #define TABLE64_TEST_LO 5
+ #define TABLE64_TEST_HI 6
+
++/* i350 reg test */
++static struct igb_reg_test reg_test_i350[] = {
++ { E1000_FCAL, 0x100, 1, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
++ { E1000_FCAH, 0x100, 1, PATTERN_TEST, 0x0000FFFF, 0xFFFFFFFF },
++ { E1000_FCT, 0x100, 1, PATTERN_TEST, 0x0000FFFF, 0xFFFFFFFF },
++ { E1000_VET, 0x100, 1, PATTERN_TEST, 0xFFFF0000, 0xFFFF0000 },
++ { E1000_RDBAL(0), 0x100, 4, PATTERN_TEST, 0xFFFFFF80, 0xFFFFFFFF },
++ { E1000_RDBAH(0), 0x100, 4, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
++ { E1000_RDLEN(0), 0x100, 4, PATTERN_TEST, 0x000FFFF0, 0x000FFFFF },
++ { E1000_RDBAL(4), 0x40, 4, PATTERN_TEST, 0xFFFFFF80, 0xFFFFFFFF },
++ { E1000_RDBAH(4), 0x40, 4, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
++ { E1000_RDLEN(4), 0x40, 4, PATTERN_TEST, 0x000FFFF0, 0x000FFFFF },
++ /* RDH is read-only for i350, only test RDT. */
++ { E1000_RDT(0), 0x100, 4, PATTERN_TEST, 0x0000FFFF, 0x0000FFFF },
++ { E1000_RDT(4), 0x40, 4, PATTERN_TEST, 0x0000FFFF, 0x0000FFFF },
++ { E1000_FCRTH, 0x100, 1, PATTERN_TEST, 0x0000FFF0, 0x0000FFF0 },
++ { E1000_FCTTV, 0x100, 1, PATTERN_TEST, 0x0000FFFF, 0x0000FFFF },
++ { E1000_TIPG, 0x100, 1, PATTERN_TEST, 0x3FFFFFFF, 0x3FFFFFFF },
++ { E1000_TDBAL(0), 0x100, 4, PATTERN_TEST, 0xFFFFFF80, 0xFFFFFFFF },
++ { E1000_TDBAH(0), 0x100, 4, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
++ { E1000_TDLEN(0), 0x100, 4, PATTERN_TEST, 0x000FFFF0, 0x000FFFFF },
++ { E1000_TDBAL(4), 0x40, 4, PATTERN_TEST, 0xFFFFFF80, 0xFFFFFFFF },
++ { E1000_TDBAH(4), 0x40, 4, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
++ { E1000_TDLEN(4), 0x40, 4, PATTERN_TEST, 0x000FFFF0, 0x000FFFFF },
++ { E1000_TDT(0), 0x100, 4, PATTERN_TEST, 0x0000FFFF, 0x0000FFFF },
++ { E1000_TDT(4), 0x40, 4, PATTERN_TEST, 0x0000FFFF, 0x0000FFFF },
++ { E1000_RCTL, 0x100, 1, SET_READ_TEST, 0xFFFFFFFF, 0x00000000 },
++ { E1000_RCTL, 0x100, 1, SET_READ_TEST, 0x04CFB0FE, 0x003FFFFB },
++ { E1000_RCTL, 0x100, 1, SET_READ_TEST, 0x04CFB0FE, 0xFFFFFFFF },
++ { E1000_TCTL, 0x100, 1, SET_READ_TEST, 0xFFFFFFFF, 0x00000000 },
++ { E1000_RA, 0, 16, TABLE64_TEST_LO,
++ 0xFFFFFFFF, 0xFFFFFFFF },
++ { E1000_RA, 0, 16, TABLE64_TEST_HI,
++ 0xC3FFFFFF, 0xFFFFFFFF },
++ { E1000_RA2, 0, 16, TABLE64_TEST_LO,
++ 0xFFFFFFFF, 0xFFFFFFFF },
++ { E1000_RA2, 0, 16, TABLE64_TEST_HI,
++ 0xC3FFFFFF, 0xFFFFFFFF },
++ { E1000_MTA, 0, 128, TABLE32_TEST,
++ 0xFFFFFFFF, 0xFFFFFFFF },
++ { 0, 0, 0, 0 }
++};
++
+ /* 82580 reg test */
+ static struct igb_reg_test reg_test_82580[] = {
+ { E1000_FCAL, 0x100, 1, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
+@@ -1076,6 +1119,10 @@ static int igb_reg_test(struct igb_adapter *adapter, u64 *data)
+ u32 i, toggle;
+
+ switch (adapter->hw.mac.type) {
++ case e1000_i350:
++ test = reg_test_i350;
++ toggle = 0x7FEFF3FF;
++ break;
+ case e1000_82580:
+ test = reg_test_82580;
+ toggle = 0x7FEFF3FF;
+@@ -1237,6 +1284,9 @@ static int igb_intr_test(struct igb_adapter *adapter, u64 *data)
+ case e1000_82580:
+ ics_mask = 0x77DCFED5;
+ break;
++ case e1000_i350:
++ ics_mask = 0x77DCFED5;
++ break;
+ default:
+ ics_mask = 0x7FFFFFFF;
+ break;
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 641e976..83ca7d5 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -61,6 +61,10 @@ static const struct e1000_info *igb_info_tbl[] = {
+ };
+
+ static DEFINE_PCI_DEVICE_TABLE(igb_pci_tbl) = {
++ { PCI_VDEVICE(INTEL, E1000_DEV_ID_I350_COPPER), board_82575 },
++ { PCI_VDEVICE(INTEL, E1000_DEV_ID_I350_FIBER), board_82575 },
++ { PCI_VDEVICE(INTEL, E1000_DEV_ID_I350_SERDES), board_82575 },
++ { PCI_VDEVICE(INTEL, E1000_DEV_ID_I350_SGMII), board_82575 },
+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_82580_COPPER), board_82575 },
+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_82580_FIBER), board_82575 },
+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_82580_SERDES), board_82575 },
+@@ -321,6 +325,7 @@ static void igb_cache_ring_register(struct igb_adapter *adapter)
+ }
+ case e1000_82575:
+ case e1000_82580:
++ case e1000_i350:
+ default:
+ for (; i < adapter->num_rx_queues; i++)
+ adapter->rx_ring[i]->reg_idx = rbase_offset + i;
+@@ -464,6 +469,7 @@ static void igb_assign_vector(struct igb_q_vector *q_vector, int msix_vector)
+ q_vector->eims_value = 1 << msix_vector;
+ break;
+ case e1000_82580:
++ case e1000_i350:
+ /* 82580 uses the same table-based approach as 82576 but has fewer
+ entries as a result we carry over for queues greater than 4. */
+ if (rx_queue > IGB_N0_QUEUE) {
+@@ -544,6 +550,7 @@ static void igb_configure_msix(struct igb_adapter *adapter)
+
+ case e1000_82576:
+ case e1000_82580:
++ case e1000_i350:
+ /* Turn on MSI-X capability first, or our settings
+ * won't stick. And it will take days to debug. */
+ wr32(E1000_GPIE, E1000_GPIE_MSIX_MODE |
+@@ -1250,6 +1257,7 @@ void igb_reset(struct igb_adapter *adapter)
+ * To take effect CTRL.RST is required.
+ */
+ switch (mac->type) {
++ case e1000_i350:
+ case e1000_82580:
+ pba = rd32(E1000_RXPBS);
+ pba = igb_rxpbs_adjust_82580(pba);
+@@ -1818,6 +1826,7 @@ static void igb_init_hw_timer(struct igb_adapter *adapter)
+ struct e1000_hw *hw = &adapter->hw;
+
+ switch (hw->mac.type) {
++ case e1000_i350:
+ case e1000_82580:
+ memset(&adapter->cycles, 0, sizeof(adapter->cycles));
+ adapter->cycles.read = igb_read_clock;
+@@ -2331,6 +2340,7 @@ static void igb_setup_mrqc(struct igb_adapter *adapter)
+ if (adapter->vfs_allocated_count) {
+ /* 82575 and 82576 supports 2 RSS queues for VMDq */
+ switch (hw->mac.type) {
++ case e1000_i350:
+ case e1000_82580:
+ num_rx_queues = 1;
+ shift = 0;
+@@ -6043,6 +6053,8 @@ static void igb_vmm_control(struct igb_adapter *adapter)
+ reg = rd32(E1000_RPLOLR);
+ reg |= E1000_RPLOLR_STRVLAN;
+ wr32(E1000_RPLOLR, reg);
++ case e1000_i350:
++ /* none of the above registers are supported by i350 */
+ break;
+ }
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0116-igb-count-Rx-FIFO-errors-correctly.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0116-igb-count-Rx-FIFO-errors-correctly.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,56 @@
+From: Mitch Williams <mitch.a.williams at intel.com>
+Date: Tue, 23 Mar 2010 18:34:38 +0000
+Subject: [PATCH 116/165] igb: count Rx FIFO errors correctly
+
+commit fa3d9a6d55014b5bce5575aeab1cf711cff748ab upstream.
+
+Don't aggregate rx_no_buffer_count into rx_fifo_errors. RNBC counts
+packets that get queued temporarily in the adapter's FIFO. These
+packets are not dropped and are not errors. The correct counter
+is rx_missed_errors (MPC).
+
+Signed-off-by: Mitch Williams <mitch.a.williams at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 10 +++++-----
+ 1 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 83ca7d5..e38ec36 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -3958,7 +3958,7 @@ void igb_update_stats(struct igb_adapter *adapter)
+ struct net_device_stats *net_stats = igb_get_stats(adapter->netdev);
+ struct e1000_hw *hw = &adapter->hw;
+ struct pci_dev *pdev = adapter->pdev;
+- u32 rnbc, reg;
++ u32 reg, mpc;
+ u16 phy_tmp;
+ int i;
+ u64 bytes, packets;
+@@ -4016,7 +4016,9 @@ void igb_update_stats(struct igb_adapter *adapter)
+ adapter->stats.symerrs += rd32(E1000_SYMERRS);
+ adapter->stats.sec += rd32(E1000_SEC);
+
+- adapter->stats.mpc += rd32(E1000_MPC);
++ mpc = rd32(E1000_MPC);
++ adapter->stats.mpc += mpc;
++ net_stats->rx_fifo_errors += mpc;
+ adapter->stats.scc += rd32(E1000_SCC);
+ adapter->stats.ecol += rd32(E1000_ECOL);
+ adapter->stats.mcc += rd32(E1000_MCC);
+@@ -4031,9 +4033,7 @@ void igb_update_stats(struct igb_adapter *adapter)
+ adapter->stats.gptc += rd32(E1000_GPTC);
+ adapter->stats.gotc += rd32(E1000_GOTCL);
+ rd32(E1000_GOTCH); /* clear GOTCL */
+- rnbc = rd32(E1000_RNBC);
+- adapter->stats.rnbc += rnbc;
+- net_stats->rx_fifo_errors += rnbc;
++ adapter->stats.rnbc += rd32(E1000_RNBC);
+ adapter->stats.ruc += rd32(E1000_RUC);
+ adapter->stats.rfc += rd32(E1000_RFC);
+ adapter->stats.rjc += rd32(E1000_RJC);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0117-igb-do-not-modify-tx_queue_len-on-link-speed-change.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0117-igb-do-not-modify-tx_queue_len-on-link-speed-change.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,76 @@
+From: Emil Tantilov <emil.s.tantilov at intel.com>
+Date: Tue, 23 Mar 2010 18:34:57 +0000
+Subject: [PATCH 117/165] igb: do not modify tx_queue_len on link speed change
+
+commit d07f3e375f608e52a1f8958fbde105bb27b7629a upstream.
+
+Previously the driver tweaked txqueuelen to avoid false Tx hang reports seen at half duplex.
+This had the effect of overriding user set values on link change/reset. Testing shows that
+adjusting only the timeout factor is sufficient to prevent Tx hang reports at half duplex.
+
+Based on e1000e patch by Franco Fichtner <franco at lastsummer.de>
+
+Signed-off-by: Emil Tantilov <emil.s.tantilov at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb.h | 1 -
+ drivers/net/igb/igb_main.c | 10 +---------
+ 2 files changed, 1 insertions(+), 10 deletions(-)
+
+diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
+index ce527bd..dc4f129 100644
+--- a/drivers/net/igb/igb.h
++++ b/drivers/net/igb/igb.h
+@@ -264,7 +264,6 @@ struct igb_adapter {
+
+ /* TX */
+ struct igb_ring *tx_ring[16];
+- unsigned long tx_queue_len;
+ u32 tx_timeout_count;
+
+ /* RX */
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index e38ec36..014c7d9 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -1106,9 +1106,6 @@ static void igb_configure(struct igb_adapter *adapter)
+ struct igb_ring *ring = adapter->rx_ring[i];
+ igb_alloc_rx_buffers_adv(ring, igb_desc_unused(ring));
+ }
+-
+-
+- adapter->tx_queue_len = netdev->tx_queue_len;
+ }
+
+ /**
+@@ -1214,7 +1211,6 @@ void igb_down(struct igb_adapter *adapter)
+ del_timer_sync(&adapter->watchdog_timer);
+ del_timer_sync(&adapter->phy_info_timer);
+
+- netdev->tx_queue_len = adapter->tx_queue_len;
+ netif_carrier_off(netdev);
+
+ /* record the stats before reset*/
+@@ -3101,17 +3097,13 @@ static void igb_watchdog_task(struct work_struct *work)
+ ((ctrl & E1000_CTRL_RFCE) ? "RX" :
+ ((ctrl & E1000_CTRL_TFCE) ? "TX" : "None")));
+
+- /* tweak tx_queue_len according to speed/duplex and
+- * adjust the timeout factor */
+- netdev->tx_queue_len = adapter->tx_queue_len;
++ /* adjust timeout factor according to speed/duplex */
+ adapter->tx_timeout_factor = 1;
+ switch (adapter->link_speed) {
+ case SPEED_10:
+- netdev->tx_queue_len = 10;
+ adapter->tx_timeout_factor = 14;
+ break;
+ case SPEED_100:
+- netdev->tx_queue_len = 100;
+ /* maybe add some timeout factor ? */
+ break;
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0118-igbvf-do-not-modify-tx_queue_len-on-link-speed-chang.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0118-igbvf-do-not-modify-tx_queue_len-on-link-speed-chang.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,81 @@
+From: Emil Tantilov <emil.s.tantilov at intel.com>
+Date: Thu, 25 Mar 2010 12:11:48 +0000
+Subject: [PATCH 118/165] igbvf: do not modify tx_queue_len on link speed
+ change
+
+commit a08af745e4c711d22aeadc2adade36958fe03ce8 upstream.
+
+Previously the driver tweaked txqueuelen to avoid false Tx hang reports seen at half duplex.
+This had the effect of overriding user set values on link change/reset. Testing shows that
+adjusting only the timeout factor is sufficient to prevent Tx hang reports at half duplex.
+
+Based on e1000e patch by Franco Fichtner <franco at lastsummer.de>
+
+CC: Franco Fichtner <franco at lastsummer.de>
+Signed-off-by: Emil Tantilov <emil.s.tantilov at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igbvf/igbvf.h | 1 -
+ drivers/net/igbvf/netdev.c | 11 +----------
+ 2 files changed, 1 insertions(+), 11 deletions(-)
+
+diff --git a/drivers/net/igbvf/igbvf.h b/drivers/net/igbvf/igbvf.h
+index fd2cca4..f7ae284 100644
+--- a/drivers/net/igbvf/igbvf.h
++++ b/drivers/net/igbvf/igbvf.h
+@@ -197,7 +197,6 @@ struct igbvf_adapter {
+ struct igbvf_ring *tx_ring /* One per active queue */
+ ____cacheline_aligned_in_smp;
+
+- unsigned long tx_queue_len;
+ unsigned int restart_queue;
+ u32 txd_cmd;
+
+diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
+index a77afd8..b41037e 100644
+--- a/drivers/net/igbvf/netdev.c
++++ b/drivers/net/igbvf/netdev.c
+@@ -1304,8 +1304,6 @@ static void igbvf_configure_tx(struct igbvf_adapter *adapter)
+
+ /* enable Report Status bit */
+ adapter->txd_cmd |= E1000_ADVTXD_DCMD_RS;
+-
+- adapter->tx_queue_len = adapter->netdev->tx_queue_len;
+ }
+
+ /**
+@@ -1524,7 +1522,6 @@ void igbvf_down(struct igbvf_adapter *adapter)
+
+ del_timer_sync(&adapter->watchdog_timer);
+
+- netdev->tx_queue_len = adapter->tx_queue_len;
+ netif_carrier_off(netdev);
+
+ /* record the stats before reset*/
+@@ -1857,21 +1854,15 @@ static void igbvf_watchdog_task(struct work_struct *work)
+ &adapter->link_duplex);
+ igbvf_print_link_info(adapter);
+
+- /*
+- * tweak tx_queue_len according to speed/duplex
+- * and adjust the timeout factor
+- */
+- netdev->tx_queue_len = adapter->tx_queue_len;
++ /* adjust timeout factor according to speed/duplex */
+ adapter->tx_timeout_factor = 1;
+ switch (adapter->link_speed) {
+ case SPEED_10:
+ txb2b = 0;
+- netdev->tx_queue_len = 10;
+ adapter->tx_timeout_factor = 16;
+ break;
+ case SPEED_100:
+ txb2b = 0;
+- netdev->tx_queue_len = 100;
+ /* maybe add some timeout factor ? */
+ break;
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0119-igb-use-correct-bits-to-identify-if-managability-is-.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0119-igb-use-correct-bits-to-identify-if-managability-is-.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,45 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Thu, 25 Mar 2010 17:15:06 +0000
+Subject: [PATCH 119/165] igb: use correct bits to identify if managability is
+ enabled
+
+commit e017b60316468f21a63bdd4affefaf81a7f988fd upstream.
+
+igb was previously checking the wrong bits in the MANC register to determine
+if managability was enabled. As a result it was incorrectly powering down and
+resetting the phy when it didn't need to.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/e1000_mac.c | 6 +++---
+ 1 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/net/igb/e1000_mac.c b/drivers/net/igb/e1000_mac.c
+index 2a8a886..be8d010 100644
+--- a/drivers/net/igb/e1000_mac.c
++++ b/drivers/net/igb/e1000_mac.c
+@@ -1367,7 +1367,8 @@ out:
+ * igb_enable_mng_pass_thru - Enable processing of ARP's
+ * @hw: pointer to the HW structure
+ *
+- * Verifies the hardware needs to allow ARPs to be processed by the host.
++ * Verifies the hardware needs to leave interface enabled so that frames can
++ * be directed to and from the management interface.
+ **/
+ bool igb_enable_mng_pass_thru(struct e1000_hw *hw)
+ {
+@@ -1380,8 +1381,7 @@ bool igb_enable_mng_pass_thru(struct e1000_hw *hw)
+
+ manc = rd32(E1000_MANC);
+
+- if (!(manc & E1000_MANC_RCV_TCO_EN) ||
+- !(manc & E1000_MANC_EN_MAC_ADDR_FILTER))
++ if (!(manc & E1000_MANC_RCV_TCO_EN))
+ goto out;
+
+ if (hw->mac.arc_subsystem_valid) {
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0120-include-cleanup-Update-gfp.h-and-slab.h-includes-to-.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0120-include-cleanup-Update-gfp.h-and-slab.h-includes-to-.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,154 @@
+From: Tejun Heo <tj at kernel.org>
+Date: Wed, 24 Mar 2010 17:04:11 +0900
+Subject: [PATCH 120/165] include cleanup: Update gfp.h and slab.h includes to
+ prepare for breaking implicit slab.h inclusion from
+ percpu.h
+
+commit 5a0e3ad6af8660be21ca98a971cd00f331318c05 upstream.
+
+percpu.h is included by sched.h and module.h and thus ends up being
+included when building most .c files. percpu.h includes slab.h which
+in turn includes gfp.h making everything defined by the two files
+universally available and complicating inclusion dependencies.
+
+percpu.h -> slab.h dependency is about to be removed. Prepare for
+this change by updating users of gfp and slab facilities include those
+headers directly instead of assuming availability. As this conversion
+needs to touch large number of source files, the following script is
+used as the basis of conversion.
+
+ http://userweb.kernel.org/~tj/misc/slabh-sweep.py
+
+The script does the followings.
+
+* Scan files for gfp and slab usages and update includes such that
+ only the necessary includes are there. ie. if only gfp is used,
+ gfp.h, if slab is used, slab.h.
+
+* When the script inserts a new include, it looks at the include
+ blocks and try to put the new include such that its order conforms
+ to its surrounding. It's put in the include block which contains
+ core kernel includes, in the same order that the rest are ordered -
+ alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
+ doesn't seem to be any matching order.
+
+* If the script can't find a place to put a new include (mostly
+ because the file doesn't have fitting include block), it prints out
+ an error message indicating which .h file needs to be added to the
+ file.
+
+The conversion was done in the following steps.
+
+1. The initial automatic conversion of all .c files updated slightly
+ over 4000 files, deleting around 700 includes and adding ~480 gfp.h
+ and ~3000 slab.h inclusions. The script emitted errors for ~400
+ files.
+
+2. Each error was manually checked. Some didn't need the inclusion,
+ some needed manual addition while adding it to implementation .h or
+ embedding .c file was more appropriate for others. This step added
+ inclusions to around 150 files.
+
+3. The script was run again and the output was compared to the edits
+ from #2 to make sure no file was left behind.
+
+4. Several build tests were done and a couple of problems were fixed.
+ e.g. lib/decompress_*.c used malloc/free() wrappers around slab
+ APIs requiring slab.h to be added manually.
+
+5. The script was run on all .h files but without automatically
+ editing them as sprinkling gfp.h and slab.h inclusions around .h
+ files could easily lead to inclusion dependency hell. Most gfp.h
+ inclusion directives were ignored as stuff from gfp.h was usually
+ wildly available and often used in preprocessor macros. Each
+ slab.h inclusion directive was examined and added manually as
+ necessary.
+
+6. percpu.h was updated not to include slab.h.
+
+7. Build test were done on the following configurations and failures
+ were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
+ distributed build env didn't work with gcov compiles) and a few
+ more options had to be turned off depending on archs to make things
+ build (like ipr on powerpc/64 which failed due to missing writeq).
+
+ * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
+ * powerpc and powerpc64 SMP allmodconfig
+ * sparc and sparc64 SMP allmodconfig
+ * ia64 SMP allmodconfig
+ * s390 SMP allmodconfig
+ * alpha SMP allmodconfig
+ * um on x86_64 SMP allmodconfig
+
+8. percpu.h modifications were reverted so that it could be applied as
+ a separate patch and serve as bisection point.
+
+Given the fact that I had only a couple of failures from tests on step
+6, I'm fairly confident about the coverage of this conversion patch.
+If there is a breakage, it's likely to be something in one of the arch
+headers which should be easily discoverable easily on most builds of
+the specific arch.
+
+Signed-off-by: Tejun Heo <tj at kernel.org>
+Guess-its-ok-by: Christoph Lameter <cl at linux-foundation.org>
+Cc: Ingo Molnar <mingo at redhat.com>
+Cc: Lee Schermerhorn <Lee.Schermerhorn at hp.com>
+[bwh: Restricted to drivers/net/igb{,vf}]
+---
+ drivers/net/igb/e1000_82575.c | 1 -
+ drivers/net/igb/igb_ethtool.c | 1 +
+ drivers/net/igb/igb_main.c | 1 +
+ drivers/net/igbvf/netdev.c | 1 +
+ 4 files changed, 3 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c
+index 430631f..3ef4955 100644
+--- a/drivers/net/igb/e1000_82575.c
++++ b/drivers/net/igb/e1000_82575.c
+@@ -30,7 +30,6 @@
+ */
+
+ #include <linux/types.h>
+-#include <linux/slab.h>
+ #include <linux/if_ether.h>
+
+ #include "e1000_mac.h"
+diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
+index 1d4ee41..2a43829 100644
+--- a/drivers/net/igb/igb_ethtool.c
++++ b/drivers/net/igb/igb_ethtool.c
+@@ -35,6 +35,7 @@
+ #include <linux/if_ether.h>
+ #include <linux/ethtool.h>
+ #include <linux/sched.h>
++#include <linux/slab.h>
+
+ #include "igb.h"
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 014c7d9..0b35337 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -32,6 +32,7 @@
+ #include <linux/pagemap.h>
+ #include <linux/netdevice.h>
+ #include <linux/ipv6.h>
++#include <linux/slab.h>
+ #include <net/checksum.h>
+ #include <net/ip6_checksum.h>
+ #include <linux/net_tstamp.h>
+diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
+index b41037e..1b1edad 100644
+--- a/drivers/net/igbvf/netdev.c
++++ b/drivers/net/igbvf/netdev.c
+@@ -35,6 +35,7 @@
+ #include <linux/netdevice.h>
+ #include <linux/tcp.h>
+ #include <linux/ipv6.h>
++#include <linux/slab.h>
+ #include <net/checksum.h>
+ #include <net/ip6_checksum.h>
+ #include <linux/mii.h>
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0121-igb-update-hw_debug-macro-to-make-use-of-netdev_dbg-.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0121-igb-update-hw_debug-macro-to-make-use-of-netdev_dbg-.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,109 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Thu, 25 Mar 2010 13:10:08 +0000
+Subject: [PATCH 121/165] igb: update hw_debug macro to make use of netdev_dbg
+ call
+
+commit c041076a9f79a7cf28e808f73cc76f24cbf97093 upstream.
+
+This change updates the igb driver to make use of the netdev_dbg function
+macros now provided in netdevice.h
+
+This is meant to be provided as an alternative to the patch provided by
+Joe Perches.
+
+It also removes igb_get_time_str since I found that it is unused code that
+is no longer used even in debug.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/e1000_hw.h | 12 +++++-------
+ drivers/net/igb/igb_main.c | 32 +++-----------------------------
+ 2 files changed, 8 insertions(+), 36 deletions(-)
+
+diff --git a/drivers/net/igb/e1000_hw.h b/drivers/net/igb/e1000_hw.h
+index 593d5fa..cb8db78 100644
+--- a/drivers/net/igb/e1000_hw.h
++++ b/drivers/net/igb/e1000_hw.h
+@@ -31,6 +31,7 @@
+ #include <linux/types.h>
+ #include <linux/delay.h>
+ #include <linux/io.h>
++#include <linux/netdevice.h>
+
+ #include "e1000_regs.h"
+ #include "e1000_defines.h"
+@@ -507,14 +508,11 @@ struct e1000_hw {
+ u8 revision_id;
+ };
+
+-#ifdef DEBUG
+-extern char *igb_get_hw_dev_name(struct e1000_hw *hw);
++extern struct net_device *igb_get_hw_dev(struct e1000_hw *hw);
+ #define hw_dbg(format, arg...) \
+- printk(KERN_DEBUG "%s: " format, igb_get_hw_dev_name(hw), ##arg)
+-#else
+-#define hw_dbg(format, arg...)
+-#endif
+-#endif
++ netdev_dbg(igb_get_hw_dev(hw), format, ##arg)
++
+ /* These functions must be implemented by drivers */
+ s32 igb_read_pcie_cap_reg(struct e1000_hw *hw, u32 reg, u16 *value);
+ s32 igb_write_pcie_cap_reg(struct e1000_hw *hw, u32 reg, u16 *value);
++#endif /* _E1000_HW_H_ */
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 0b35337..ee0c478 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -221,43 +221,17 @@ static cycle_t igb_read_clock(const struct cyclecounter *tc)
+ return stamp;
+ }
+
+-#ifdef DEBUG
+ /**
+- * igb_get_hw_dev_name - return device name string
++ * igb_get_hw_dev - return device
+ * used by hardware layer to print debugging information
+ **/
+-char *igb_get_hw_dev_name(struct e1000_hw *hw)
++struct net_device *igb_get_hw_dev(struct e1000_hw *hw)
+ {
+ struct igb_adapter *adapter = hw->back;
+- return adapter->netdev->name;
++ return adapter->netdev;
+ }
+
+ /**
+- * igb_get_time_str - format current NIC and system time as string
+- */
+-static char *igb_get_time_str(struct igb_adapter *adapter,
+- char buffer[160])
+-{
+- cycle_t hw = adapter->cycles.read(&adapter->cycles);
+- struct timespec nic = ns_to_timespec(timecounter_read(&adapter->clock));
+- struct timespec sys;
+- struct timespec delta;
+- getnstimeofday(&sys);
+-
+- delta = timespec_sub(nic, sys);
+-
+- sprintf(buffer,
+- "HW %llu, NIC %ld.%09lus, SYS %ld.%09lus, NIC-SYS %lds + %09luns",
+- hw,
+- (long)nic.tv_sec, nic.tv_nsec,
+- (long)sys.tv_sec, sys.tv_nsec,
+- (long)delta.tv_sec, delta.tv_nsec);
+-
+- return buffer;
+-}
+-#endif
+-
+-/**
+ * igb_init_module - Driver Registration Routine
+ *
+ * igb_init_module is the first routine called when the driver is
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0122-igb-add-per-packet-timestamping.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0122-igb-add-per-packet-timestamping.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,164 @@
+From: Nick Nunley <nicholasx.d.nunley at intel.com>
+Date: Fri, 26 Mar 2010 11:36:47 +0000
+Subject: [PATCH 122/165] igb: add per-packet timestamping
+
+commit 757b77e2b208490868cf21fd22d796eb9bd199c5 upstream.
+
+This patch adds support for per-packet timestamping for the
+82580 adapter. The rx timestamp code is also pulled out of the
+inlined rx hotpath and instead moved to a seperate function.
+
+This version adds a comment explaining the per-packet timestamping
+code added to igb_hwtstamp_ioctl().
+
+Signed-off-by: Nicholas Nunley <nicholasx.d.nunley at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/e1000_82575.h | 2 +
+ drivers/net/igb/igb.h | 2 +
+ drivers/net/igb/igb_main.c | 45 +++++++++++++++++++++++++++++++++-------
+ 3 files changed, 41 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/net/igb/e1000_82575.h b/drivers/net/igb/e1000_82575.h
+index c923cc8..d4980e4 100644
+--- a/drivers/net/igb/e1000_82575.h
++++ b/drivers/net/igb/e1000_82575.h
+@@ -53,6 +53,7 @@ extern void igb_rx_fifo_flush_82575(struct e1000_hw *hw);
+ #define E1000_SRRCTL_DESCTYPE_ADV_ONEBUF 0x02000000
+ #define E1000_SRRCTL_DESCTYPE_HDR_SPLIT_ALWAYS 0x0A000000
+ #define E1000_SRRCTL_DROP_EN 0x80000000
++#define E1000_SRRCTL_TIMESTAMP 0x40000000
+
+ #define E1000_MRQC_ENABLE_RSS_4Q 0x00000002
+ #define E1000_MRQC_ENABLE_VMDQ 0x00000003
+@@ -109,6 +110,7 @@ union e1000_adv_rx_desc {
+ #define E1000_RXDADV_HDRBUFLEN_MASK 0x7FE0
+ #define E1000_RXDADV_HDRBUFLEN_SHIFT 5
+ #define E1000_RXDADV_STAT_TS 0x10000 /* Pkt was time stamped */
++#define E1000_RXDADV_STAT_TSIP 0x08000 /* timestamp in packet */
+
+ /* Transmit Descriptor - Advanced */
+ union e1000_adv_tx_desc {
+diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
+index dc4f129..96b141b 100644
+--- a/drivers/net/igb/igb.h
++++ b/drivers/net/igb/igb.h
+@@ -104,6 +104,7 @@ struct vf_data_storage {
+ #define MAXIMUM_ETHERNET_VLAN_SIZE 1522
+
+ /* Supported Rx Buffer Sizes */
++#define IGB_RXBUFFER_64 64 /* Used for packet split */
+ #define IGB_RXBUFFER_128 128 /* Used for packet split */
+ #define IGB_RXBUFFER_1024 1024
+ #define IGB_RXBUFFER_2048 2048
+@@ -320,6 +321,7 @@ struct igb_adapter {
+
+ #define IGB_82576_TSYNC_SHIFT 19
+ #define IGB_82580_TSYNC_SHIFT 24
++#define IGB_TS_HDR_LEN 16
+ enum e1000_state_t {
+ __IGB_TESTING,
+ __IGB_RESETTING,
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index ee0c478..3e92d08 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -2559,6 +2559,8 @@ void igb_configure_rx_ring(struct igb_adapter *adapter,
+ E1000_SRRCTL_BSIZEPKT_SHIFT;
+ srrctl |= E1000_SRRCTL_DESCTYPE_ADV_ONEBUF;
+ }
++ if (hw->mac.type == e1000_82580)
++ srrctl |= E1000_SRRCTL_TIMESTAMP;
+ /* Only set Drop Enable if we are supporting multiple queues */
+ if (adapter->vfs_allocated_count || adapter->num_rx_queues > 1)
+ srrctl |= E1000_SRRCTL_DROP_EN;
+@@ -3888,6 +3890,9 @@ static int igb_change_mtu(struct net_device *netdev, int new_mtu)
+ * i.e. RXBUFFER_2048 --> size-4096 slab
+ */
+
++ if (adapter->hw.mac.type == e1000_82580)
++ max_frame += IGB_TS_HDR_LEN;
++
+ if (max_frame <= IGB_RXBUFFER_1024)
+ rx_buffer_len = IGB_RXBUFFER_1024;
+ else if (max_frame <= MAXIMUM_ETHERNET_VLAN_SIZE)
+@@ -3895,6 +3900,14 @@ static int igb_change_mtu(struct net_device *netdev, int new_mtu)
+ else
+ rx_buffer_len = IGB_RXBUFFER_128;
+
++ if ((max_frame == ETH_FRAME_LEN + ETH_FCS_LEN + IGB_TS_HDR_LEN) ||
++ (max_frame == MAXIMUM_ETHERNET_VLAN_SIZE + IGB_TS_HDR_LEN))
++ rx_buffer_len = MAXIMUM_ETHERNET_VLAN_SIZE + IGB_TS_HDR_LEN;
++
++ if ((adapter->hw.mac.type == e1000_82580) &&
++ (rx_buffer_len == IGB_RXBUFFER_128))
++ rx_buffer_len += IGB_RXBUFFER_64;
++
+ if (netif_running(netdev))
+ igb_down(adapter);
+
+@@ -5054,7 +5067,7 @@ static inline void igb_rx_checksum_adv(struct igb_ring *ring,
+ dev_dbg(&ring->pdev->dev, "cksum success: bits %08X\n", status_err);
+ }
+
+-static inline void igb_rx_hwtstamp(struct igb_q_vector *q_vector, u32 staterr,
++static void igb_rx_hwtstamp(struct igb_q_vector *q_vector, u32 staterr,
+ struct sk_buff *skb)
+ {
+ struct igb_adapter *adapter = q_vector->adapter;
+@@ -5072,13 +5085,18 @@ static inline void igb_rx_hwtstamp(struct igb_q_vector *q_vector, u32 staterr,
+ * If nothing went wrong, then it should have a skb_shared_tx that we
+ * can turn into a skb_shared_hwtstamps.
+ */
+- if (likely(!(staterr & E1000_RXDADV_STAT_TS)))
+- return;
+- if (!(rd32(E1000_TSYNCRXCTL) & E1000_TSYNCRXCTL_VALID))
+- return;
++ if (staterr & E1000_RXDADV_STAT_TSIP) {
++ u32 *stamp = (u32 *)skb->data;
++ regval = le32_to_cpu(*(stamp + 2));
++ regval |= (u64)le32_to_cpu(*(stamp + 3)) << 32;
++ skb_pull(skb, IGB_TS_HDR_LEN);
++ } else {
++ if(!(rd32(E1000_TSYNCRXCTL) & E1000_TSYNCRXCTL_VALID))
++ return;
+
+- regval = rd32(E1000_RXSTMPL);
+- regval |= (u64)rd32(E1000_RXSTMPH) << 32;
++ regval = rd32(E1000_RXSTMPL);
++ regval |= (u64)rd32(E1000_RXSTMPH) << 32;
++ }
+
+ igb_systim_to_hwtstamp(adapter, skb_hwtstamps(skb), regval);
+ }
+@@ -5186,7 +5204,8 @@ send_up:
+ goto next_desc;
+ }
+
+- igb_rx_hwtstamp(q_vector, staterr, skb);
++ if (staterr & (E1000_RXDADV_STAT_TSIP | E1000_RXDADV_STAT_TS))
++ igb_rx_hwtstamp(q_vector, staterr, skb);
+ total_bytes += skb->len;
+ total_packets++;
+
+@@ -5466,6 +5485,16 @@ static int igb_hwtstamp_ioctl(struct net_device *netdev,
+ return 0;
+ }
+
++ /*
++ * Per-packet timestamping only works if all packets are
++ * timestamped, so enable timestamping in all packets as
++ * long as one rx filter was configured.
++ */
++ if ((hw->mac.type == e1000_82580) && tsync_rx_ctl) {
++ tsync_rx_ctl = E1000_TSYNCRXCTL_ENABLED;
++ tsync_rx_ctl |= E1000_TSYNCRXCTL_TYPE_ALL;
++ }
++
+ /* enable/disable TX */
+ regval = rd32(E1000_TSYNCTXCTL);
+ regval &= ~E1000_TSYNCTXCTL_ENABLED;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0123-igb-modify-register-test-for-i350-to-reflect-read-on.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0123-igb-modify-register-test-for-i350-to-reflect-read-on.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,51 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Fri, 9 Apr 2010 09:53:08 +0000
+Subject: [PATCH 123/165] igb: modify register test for i350 to reflect read
+ only bits in RDLEN/TDLEN
+
+commit 1b6e66182dab42c42bdac72633dbe35b3dba8f69 upstream.
+
+The registers for RDLEN/TDLEN on i350 have the first 7 bits as read only.
+This is a change from previous hardware in which it was only the first 4
+bits that were read only.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_ethtool.c | 8 ++++----
+ 1 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
+index 2a43829..55670ae 100644
+--- a/drivers/net/igb/igb_ethtool.c
++++ b/drivers/net/igb/igb_ethtool.c
+@@ -910,10 +910,10 @@ static struct igb_reg_test reg_test_i350[] = {
+ { E1000_VET, 0x100, 1, PATTERN_TEST, 0xFFFF0000, 0xFFFF0000 },
+ { E1000_RDBAL(0), 0x100, 4, PATTERN_TEST, 0xFFFFFF80, 0xFFFFFFFF },
+ { E1000_RDBAH(0), 0x100, 4, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
+- { E1000_RDLEN(0), 0x100, 4, PATTERN_TEST, 0x000FFFF0, 0x000FFFFF },
++ { E1000_RDLEN(0), 0x100, 4, PATTERN_TEST, 0x000FFF80, 0x000FFFFF },
+ { E1000_RDBAL(4), 0x40, 4, PATTERN_TEST, 0xFFFFFF80, 0xFFFFFFFF },
+ { E1000_RDBAH(4), 0x40, 4, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
+- { E1000_RDLEN(4), 0x40, 4, PATTERN_TEST, 0x000FFFF0, 0x000FFFFF },
++ { E1000_RDLEN(4), 0x40, 4, PATTERN_TEST, 0x000FFF80, 0x000FFFFF },
+ /* RDH is read-only for i350, only test RDT. */
+ { E1000_RDT(0), 0x100, 4, PATTERN_TEST, 0x0000FFFF, 0x0000FFFF },
+ { E1000_RDT(4), 0x40, 4, PATTERN_TEST, 0x0000FFFF, 0x0000FFFF },
+@@ -922,10 +922,10 @@ static struct igb_reg_test reg_test_i350[] = {
+ { E1000_TIPG, 0x100, 1, PATTERN_TEST, 0x3FFFFFFF, 0x3FFFFFFF },
+ { E1000_TDBAL(0), 0x100, 4, PATTERN_TEST, 0xFFFFFF80, 0xFFFFFFFF },
+ { E1000_TDBAH(0), 0x100, 4, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
+- { E1000_TDLEN(0), 0x100, 4, PATTERN_TEST, 0x000FFFF0, 0x000FFFFF },
++ { E1000_TDLEN(0), 0x100, 4, PATTERN_TEST, 0x000FFF80, 0x000FFFFF },
+ { E1000_TDBAL(4), 0x40, 4, PATTERN_TEST, 0xFFFFFF80, 0xFFFFFFFF },
+ { E1000_TDBAH(4), 0x40, 4, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
+- { E1000_TDLEN(4), 0x40, 4, PATTERN_TEST, 0x000FFFF0, 0x000FFFFF },
++ { E1000_TDLEN(4), 0x40, 4, PATTERN_TEST, 0x000FFF80, 0x000FFFFF },
+ { E1000_TDT(0), 0x100, 4, PATTERN_TEST, 0x0000FFFF, 0x0000FFFF },
+ { E1000_TDT(4), 0x40, 4, PATTERN_TEST, 0x0000FFFF, 0x0000FFFF },
+ { E1000_RCTL, 0x100, 1, SET_READ_TEST, 0xFFFFFFFF, 0x00000000 },
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0124-igb-restrict-WoL-for-82576-ET2-Quad-Port-Server-Adap.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0124-igb-restrict-WoL-for-82576-ET2-Quad-Port-Server-Adap.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,46 @@
+From: Stefan Assmann <sassmann at redhat.com>
+Date: Fri, 9 Apr 2010 09:51:34 +0000
+Subject: [PATCH 124/165] igb: restrict WoL for 82576 ET2 Quad Port Server
+ Adapter
+
+commit d5aa22520dbb49e726420ca56b3dcfe56724d33e upstream.
+
+Restrict Wake-on-LAN to first port on 82576 ET2 quad port NICs, as it is
+only supported there.
+
+Signed-off-by: Stefan Assmann <sassmann at redhat.com>
+Acked-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_ethtool.c | 1 +
+ drivers/net/igb/igb_main.c | 1 +
+ 2 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
+index 55670ae..1b8fd7f 100644
+--- a/drivers/net/igb/igb_ethtool.c
++++ b/drivers/net/igb/igb_ethtool.c
+@@ -1864,6 +1864,7 @@ static int igb_wol_exclusion(struct igb_adapter *adapter,
+ retval = 0;
+ break;
+ case E1000_DEV_ID_82576_QUAD_COPPER:
++ case E1000_DEV_ID_82576_QUAD_COPPER_ET2:
+ /* quad port adapters only support WoL on port A */
+ if (!(adapter->flags & IGB_FLAG_QUAD_PORT_A)) {
+ wol->supported = 0;
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 3e92d08..cebe757 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -1584,6 +1584,7 @@ static int __devinit igb_probe(struct pci_dev *pdev,
+ adapter->eeprom_wol = 0;
+ break;
+ case E1000_DEV_ID_82576_QUAD_COPPER:
++ case E1000_DEV_ID_82576_QUAD_COPPER_ET2:
+ /* if quad port adapter, disable WoL on all but port A */
+ if (global_quad_port_a != 0)
+ adapter->eeprom_wol = 0;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0125-igb-double-increment-nr_frags.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0125-igb-double-increment-nr_frags.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,32 @@
+From: Koki Sanagi <sanagi.koki at jp.fujitsu.com>
+Date: Tue, 27 Apr 2010 01:01:19 +0000
+Subject: [PATCH 125/165] igb: double increment nr_frags
+
+commit aa913403fe76d463eff55ee9aa20605bfc7051a4 upstream.
+
+There is no need to increment nr_frags because skb_fill_page_desc increments
+it.
+
+Signed-off-by: Koki Sanagi <sanagi.koki at jp.fujitsu.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index cebe757..a0444d4 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -5176,7 +5176,7 @@ static bool igb_clean_rx_irq_adv(struct igb_q_vector *q_vector,
+ PAGE_SIZE / 2, PCI_DMA_FROMDEVICE);
+ buffer_info->page_dma = 0;
+
+- skb_fill_page_desc(skb, skb_shinfo(skb)->nr_frags++,
++ skb_fill_page_desc(skb, skb_shinfo(skb)->nr_frags,
+ buffer_info->page,
+ buffer_info->page_offset,
+ length);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0126-igbvf-double-increment-nr_frags.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0126-igbvf-double-increment-nr_frags.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,32 @@
+From: Koki Sanagi <sanagi.koki at jp.fujitsu.com>
+Date: Tue, 27 Apr 2010 01:01:39 +0000
+Subject: [PATCH 126/165] igbvf: double increment nr_frags
+
+commit ec857fd40da41d7c50d9a97e07e364c93b8b8e05 upstream.
+
+There is no need to increment nr_frags because skb_fill_page_desc increments
+it.
+
+Signed-off-by: Koki Sanagi <sanagi.koki at jp.fujitsu.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igbvf/netdev.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
+index 1b1edad..bdb14d4 100644
+--- a/drivers/net/igbvf/netdev.c
++++ b/drivers/net/igbvf/netdev.c
+@@ -289,7 +289,7 @@ static bool igbvf_clean_rx_irq(struct igbvf_adapter *adapter,
+ PCI_DMA_FROMDEVICE);
+ buffer_info->page_dma = 0;
+
+- skb_fill_page_desc(skb, skb_shinfo(skb)->nr_frags++,
++ skb_fill_page_desc(skb, skb_shinfo(skb)->nr_frags,
+ buffer_info->page,
+ buffer_info->page_offset,
+ length);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0127-igb-add-support-for-reporting-5GT-s-during-probe-on-.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0127-igb-add-support-for-reporting-5GT-s-during-probe-on-.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,108 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 27 Apr 2010 01:02:40 +0000
+Subject: [PATCH 127/165] igb: add support for reporting 5GT/s during probe on
+ PCIe Gen2
+
+commit ff846f52935e6c8dfb0c97df7c2c1bf777454684 upstream.
+
+This change corrects the fact that we were not reporting Gen2 link speeds
+when we were in fact connected at Gen2 rates.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/e1000_defines.h | 4 ----
+ drivers/net/igb/e1000_mac.c | 27 ++++++++++++++++++++-------
+ drivers/net/igb/igb_main.c | 1 +
+ include/linux/pci_regs.h | 3 +++
+ 4 files changed, 24 insertions(+), 11 deletions(-)
+
+diff --git a/drivers/net/igb/e1000_defines.h b/drivers/net/igb/e1000_defines.h
+index 31d24e0..24d9be6 100644
+--- a/drivers/net/igb/e1000_defines.h
++++ b/drivers/net/igb/e1000_defines.h
+@@ -610,11 +610,7 @@
+ #define IGP_LED3_MODE 0x07000000
+
+ /* PCI/PCI-X/PCI-EX Config space */
+-#define PCIE_LINK_STATUS 0x12
+ #define PCIE_DEVICE_CONTROL2 0x28
+-
+-#define PCIE_LINK_WIDTH_MASK 0x3F0
+-#define PCIE_LINK_WIDTH_SHIFT 4
+ #define PCIE_DEVICE_CONTROL2_16ms 0x0005
+
+ #define PHY_REVISION_MASK 0xFFFFFFF0
+diff --git a/drivers/net/igb/e1000_mac.c b/drivers/net/igb/e1000_mac.c
+index be8d010..90c5e01 100644
+--- a/drivers/net/igb/e1000_mac.c
++++ b/drivers/net/igb/e1000_mac.c
+@@ -53,17 +53,30 @@ s32 igb_get_bus_info_pcie(struct e1000_hw *hw)
+ u16 pcie_link_status;
+
+ bus->type = e1000_bus_type_pci_express;
+- bus->speed = e1000_bus_speed_2500;
+
+ ret_val = igb_read_pcie_cap_reg(hw,
+- PCIE_LINK_STATUS,
+- &pcie_link_status);
+- if (ret_val)
++ PCI_EXP_LNKSTA,
++ &pcie_link_status);
++ if (ret_val) {
+ bus->width = e1000_bus_width_unknown;
+- else
++ bus->speed = e1000_bus_speed_unknown;
++ } else {
++ switch (pcie_link_status & PCI_EXP_LNKSTA_CLS) {
++ case PCI_EXP_LNKSTA_CLS_2_5GB:
++ bus->speed = e1000_bus_speed_2500;
++ break;
++ case PCI_EXP_LNKSTA_CLS_5_0GB:
++ bus->speed = e1000_bus_speed_5000;
++ break;
++ default:
++ bus->speed = e1000_bus_speed_unknown;
++ break;
++ }
++
+ bus->width = (enum e1000_bus_width)((pcie_link_status &
+- PCIE_LINK_WIDTH_MASK) >>
+- PCIE_LINK_WIDTH_SHIFT);
++ PCI_EXP_LNKSTA_NLW) >>
++ PCI_EXP_LNKSTA_NLW_SHIFT);
++ }
+
+ reg = rd32(E1000_STATUS);
+ bus->func = (reg & E1000_STATUS_FUNC_MASK) >> E1000_STATUS_FUNC_SHIFT;
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index a0444d4..387b258 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -1628,6 +1628,7 @@ static int __devinit igb_probe(struct pci_dev *pdev,
+ dev_info(&pdev->dev, "%s: (PCIe:%s:%s) %pM\n",
+ netdev->name,
+ ((hw->bus.speed == e1000_bus_speed_2500) ? "2.5Gb/s" :
++ (hw->bus.speed == e1000_bus_speed_5000) ? "5.0Gb/s" :
+ "unknown"),
+ ((hw->bus.width == e1000_bus_width_pcie_x4) ? "Width x4" :
+ (hw->bus.width == e1000_bus_width_pcie_x2) ? "Width x2" :
+diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h
+index dd0bed4..9d8ee6a 100644
+--- a/include/linux/pci_regs.h
++++ b/include/linux/pci_regs.h
+@@ -437,7 +437,10 @@
+ #define PCI_EXP_LNKCTL_LABIE 0x0800 /* Lnk Autonomous Bandwidth Interrupt Enable */
+ #define PCI_EXP_LNKSTA 18 /* Link Status */
+ #define PCI_EXP_LNKSTA_CLS 0x000f /* Current Link Speed */
++#define PCI_EXP_LNKSTA_CLS_2_5GB 0x01 /* Current Link Speed 2.5GT/s */
++#define PCI_EXP_LNKSTA_CLS_5_0GB 0x02 /* Current Link Speed 5.0GT/s */
+ #define PCI_EXP_LNKSTA_NLW 0x03f0 /* Nogotiated Link Width */
++#define PCI_EXP_LNKSTA_NLW_SHIFT 4 /* start of NLW mask in link status */
+ #define PCI_EXP_LNKSTA_LT 0x0800 /* Link Training */
+ #define PCI_EXP_LNKSTA_SLC 0x1000 /* Slot Clock Configuration */
+ #define PCI_EXP_LNKSTA_DLLLA 0x2000 /* Data Link Layer Link Active */
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0128-igb-convert-igb-from-using-PCI-DMA-functions-to-usin.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0128-igb-convert-igb-from-using-PCI-DMA-functions-to-usin.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,397 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 27 Apr 2010 13:09:25 +0000
+Subject: [PATCH 128/165] igb: convert igb from using PCI DMA functions to
+ using DMA API functions
+
+commit 59d71989352deb71bc0bba83802820de765f6e25 upstream.
+
+This patch makes it so that igb now uses the DMA API functions instead of
+the PCI API functions. To do this the pci_dev pointer that was in the
+rings has been replaced with a device pointer, and as a result all
+references to [tr]x_ring->pdev have been replaced with [tr]x_ring->dev.
+
+This patch is based of of work originally done by Nicholas Nunley.
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb.h | 2 +-
+ drivers/net/igb/igb_ethtool.c | 8 ++--
+ drivers/net/igb/igb_main.c | 109 +++++++++++++++++++++--------------------
+ 3 files changed, 61 insertions(+), 58 deletions(-)
+
+diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
+index 96b141b..0953009 100644
+--- a/drivers/net/igb/igb.h
++++ b/drivers/net/igb/igb.h
+@@ -183,7 +183,7 @@ struct igb_q_vector {
+ struct igb_ring {
+ struct igb_q_vector *q_vector; /* backlink to q_vector */
+ struct net_device *netdev; /* back pointer to net_device */
+- struct pci_dev *pdev; /* pci device for dma mapping */
++ struct device *dev; /* device pointer for dma mapping */
+ dma_addr_t dma; /* phys address of the ring */
+ void *desc; /* descriptor ring memory */
+ unsigned int size; /* length of desc. ring in bytes */
+diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
+index 1b8fd7f..f2ebf927 100644
+--- a/drivers/net/igb/igb_ethtool.c
++++ b/drivers/net/igb/igb_ethtool.c
+@@ -1394,7 +1394,7 @@ static int igb_setup_desc_rings(struct igb_adapter *adapter)
+
+ /* Setup Tx descriptor ring and Tx buffers */
+ tx_ring->count = IGB_DEFAULT_TXD;
+- tx_ring->pdev = adapter->pdev;
++ tx_ring->dev = &adapter->pdev->dev;
+ tx_ring->netdev = adapter->netdev;
+ tx_ring->reg_idx = adapter->vfs_allocated_count;
+
+@@ -1408,7 +1408,7 @@ static int igb_setup_desc_rings(struct igb_adapter *adapter)
+
+ /* Setup Rx descriptor ring and Rx buffers */
+ rx_ring->count = IGB_DEFAULT_RXD;
+- rx_ring->pdev = adapter->pdev;
++ rx_ring->dev = &adapter->pdev->dev;
+ rx_ring->netdev = adapter->netdev;
+ rx_ring->rx_buffer_len = IGB_RXBUFFER_2048;
+ rx_ring->reg_idx = adapter->vfs_allocated_count;
+@@ -1604,10 +1604,10 @@ static int igb_clean_test_rings(struct igb_ring *rx_ring,
+ buffer_info = &rx_ring->buffer_info[rx_ntc];
+
+ /* unmap rx buffer, will be remapped by alloc_rx_buffers */
+- pci_unmap_single(rx_ring->pdev,
++ dma_unmap_single(rx_ring->dev,
+ buffer_info->dma,
+ rx_ring->rx_buffer_len,
+- PCI_DMA_FROMDEVICE);
++ DMA_FROM_DEVICE);
+ buffer_info->dma = 0;
+
+ /* verify contents of skb */
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 387b258..8f38add 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -344,7 +344,7 @@ static int igb_alloc_queues(struct igb_adapter *adapter)
+ goto err;
+ ring->count = adapter->tx_ring_count;
+ ring->queue_index = i;
+- ring->pdev = adapter->pdev;
++ ring->dev = &adapter->pdev->dev;
+ ring->netdev = adapter->netdev;
+ /* For 82575, context index must be unique per ring. */
+ if (adapter->hw.mac.type == e1000_82575)
+@@ -358,7 +358,7 @@ static int igb_alloc_queues(struct igb_adapter *adapter)
+ goto err;
+ ring->count = adapter->rx_ring_count;
+ ring->queue_index = i;
+- ring->pdev = adapter->pdev;
++ ring->dev = &adapter->pdev->dev;
+ ring->netdev = adapter->netdev;
+ ring->rx_buffer_len = MAXIMUM_ETHERNET_VLAN_SIZE;
+ ring->flags = IGB_RING_FLAG_RX_CSUM; /* enable rx checksum */
+@@ -1388,15 +1388,15 @@ static int __devinit igb_probe(struct pci_dev *pdev,
+ return err;
+
+ pci_using_dac = 0;
+- err = pci_set_dma_mask(pdev, DMA_BIT_MASK(64));
++ err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(64));
+ if (!err) {
+- err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
++ err = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64));
+ if (!err)
+ pci_using_dac = 1;
+ } else {
+- err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
++ err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
+ if (err) {
+- err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
++ err = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
+ if (err) {
+ dev_err(&pdev->dev, "No usable DMA "
+ "configuration, aborting\n");
+@@ -2070,7 +2070,7 @@ static int igb_close(struct net_device *netdev)
+ **/
+ int igb_setup_tx_resources(struct igb_ring *tx_ring)
+ {
+- struct pci_dev *pdev = tx_ring->pdev;
++ struct device *dev = tx_ring->dev;
+ int size;
+
+ size = sizeof(struct igb_buffer) * tx_ring->count;
+@@ -2083,9 +2083,10 @@ int igb_setup_tx_resources(struct igb_ring *tx_ring)
+ tx_ring->size = tx_ring->count * sizeof(union e1000_adv_tx_desc);
+ tx_ring->size = ALIGN(tx_ring->size, 4096);
+
+- tx_ring->desc = pci_alloc_consistent(pdev,
+- tx_ring->size,
+- &tx_ring->dma);
++ tx_ring->desc = dma_alloc_coherent(dev,
++ tx_ring->size,
++ &tx_ring->dma,
++ GFP_KERNEL);
+
+ if (!tx_ring->desc)
+ goto err;
+@@ -2096,7 +2097,7 @@ int igb_setup_tx_resources(struct igb_ring *tx_ring)
+
+ err:
+ vfree(tx_ring->buffer_info);
+- dev_err(&pdev->dev,
++ dev_err(dev,
+ "Unable to allocate memory for the transmit descriptor ring\n");
+ return -ENOMEM;
+ }
+@@ -2220,7 +2221,7 @@ static void igb_configure_tx(struct igb_adapter *adapter)
+ **/
+ int igb_setup_rx_resources(struct igb_ring *rx_ring)
+ {
+- struct pci_dev *pdev = rx_ring->pdev;
++ struct device *dev = rx_ring->dev;
+ int size, desc_len;
+
+ size = sizeof(struct igb_buffer) * rx_ring->count;
+@@ -2235,8 +2236,10 @@ int igb_setup_rx_resources(struct igb_ring *rx_ring)
+ rx_ring->size = rx_ring->count * desc_len;
+ rx_ring->size = ALIGN(rx_ring->size, 4096);
+
+- rx_ring->desc = pci_alloc_consistent(pdev, rx_ring->size,
+- &rx_ring->dma);
++ rx_ring->desc = dma_alloc_coherent(dev,
++ rx_ring->size,
++ &rx_ring->dma,
++ GFP_KERNEL);
+
+ if (!rx_ring->desc)
+ goto err;
+@@ -2249,8 +2252,8 @@ int igb_setup_rx_resources(struct igb_ring *rx_ring)
+ err:
+ vfree(rx_ring->buffer_info);
+ rx_ring->buffer_info = NULL;
+- dev_err(&pdev->dev, "Unable to allocate memory for "
+- "the receive descriptor ring\n");
++ dev_err(dev, "Unable to allocate memory for the receive descriptor"
++ " ring\n");
+ return -ENOMEM;
+ }
+
+@@ -2622,8 +2625,8 @@ void igb_free_tx_resources(struct igb_ring *tx_ring)
+ if (!tx_ring->desc)
+ return;
+
+- pci_free_consistent(tx_ring->pdev, tx_ring->size,
+- tx_ring->desc, tx_ring->dma);
++ dma_free_coherent(tx_ring->dev, tx_ring->size,
++ tx_ring->desc, tx_ring->dma);
+
+ tx_ring->desc = NULL;
+ }
+@@ -2647,15 +2650,15 @@ void igb_unmap_and_free_tx_resource(struct igb_ring *tx_ring,
+ {
+ if (buffer_info->dma) {
+ if (buffer_info->mapped_as_page)
+- pci_unmap_page(tx_ring->pdev,
++ dma_unmap_page(tx_ring->dev,
+ buffer_info->dma,
+ buffer_info->length,
+- PCI_DMA_TODEVICE);
++ DMA_TO_DEVICE);
+ else
+- pci_unmap_single(tx_ring->pdev,
++ dma_unmap_single(tx_ring->dev,
+ buffer_info->dma,
+ buffer_info->length,
+- PCI_DMA_TODEVICE);
++ DMA_TO_DEVICE);
+ buffer_info->dma = 0;
+ }
+ if (buffer_info->skb) {
+@@ -2726,8 +2729,8 @@ void igb_free_rx_resources(struct igb_ring *rx_ring)
+ if (!rx_ring->desc)
+ return;
+
+- pci_free_consistent(rx_ring->pdev, rx_ring->size,
+- rx_ring->desc, rx_ring->dma);
++ dma_free_coherent(rx_ring->dev, rx_ring->size,
++ rx_ring->desc, rx_ring->dma);
+
+ rx_ring->desc = NULL;
+ }
+@@ -2763,10 +2766,10 @@ static void igb_clean_rx_ring(struct igb_ring *rx_ring)
+ for (i = 0; i < rx_ring->count; i++) {
+ buffer_info = &rx_ring->buffer_info[i];
+ if (buffer_info->dma) {
+- pci_unmap_single(rx_ring->pdev,
++ dma_unmap_single(rx_ring->dev,
+ buffer_info->dma,
+ rx_ring->rx_buffer_len,
+- PCI_DMA_FROMDEVICE);
++ DMA_FROM_DEVICE);
+ buffer_info->dma = 0;
+ }
+
+@@ -2775,10 +2778,10 @@ static void igb_clean_rx_ring(struct igb_ring *rx_ring)
+ buffer_info->skb = NULL;
+ }
+ if (buffer_info->page_dma) {
+- pci_unmap_page(rx_ring->pdev,
++ dma_unmap_page(rx_ring->dev,
+ buffer_info->page_dma,
+ PAGE_SIZE / 2,
+- PCI_DMA_FROMDEVICE);
++ DMA_FROM_DEVICE);
+ buffer_info->page_dma = 0;
+ }
+ if (buffer_info->page) {
+@@ -3465,7 +3468,7 @@ static inline bool igb_tx_csum_adv(struct igb_ring *tx_ring,
+ struct sk_buff *skb, u32 tx_flags)
+ {
+ struct e1000_adv_tx_context_desc *context_desc;
+- struct pci_dev *pdev = tx_ring->pdev;
++ struct device *dev = tx_ring->dev;
+ struct igb_buffer *buffer_info;
+ u32 info = 0, tu_cmd = 0;
+ unsigned int i;
+@@ -3516,7 +3519,7 @@ static inline bool igb_tx_csum_adv(struct igb_ring *tx_ring,
+ break;
+ default:
+ if (unlikely(net_ratelimit()))
+- dev_warn(&pdev->dev,
++ dev_warn(dev,
+ "partial checksum but proto=%x!\n",
+ skb->protocol);
+ break;
+@@ -3550,7 +3553,7 @@ static inline int igb_tx_map_adv(struct igb_ring *tx_ring, struct sk_buff *skb,
+ unsigned int first)
+ {
+ struct igb_buffer *buffer_info;
+- struct pci_dev *pdev = tx_ring->pdev;
++ struct device *dev = tx_ring->dev;
+ unsigned int len = skb_headlen(skb);
+ unsigned int count = 0, i;
+ unsigned int f;
+@@ -3563,9 +3566,9 @@ static inline int igb_tx_map_adv(struct igb_ring *tx_ring, struct sk_buff *skb,
+ /* set time_stamp *before* dma to help avoid a possible race */
+ buffer_info->time_stamp = jiffies;
+ buffer_info->next_to_watch = i;
+- buffer_info->dma = pci_map_single(pdev, skb->data, len,
+- PCI_DMA_TODEVICE);
+- if (pci_dma_mapping_error(pdev, buffer_info->dma))
++ buffer_info->dma = dma_map_single(dev, skb->data, len,
++ DMA_TO_DEVICE);
++ if (dma_mapping_error(dev, buffer_info->dma))
+ goto dma_error;
+
+ for (f = 0; f < skb_shinfo(skb)->nr_frags; f++) {
+@@ -3585,12 +3588,12 @@ static inline int igb_tx_map_adv(struct igb_ring *tx_ring, struct sk_buff *skb,
+ buffer_info->time_stamp = jiffies;
+ buffer_info->next_to_watch = i;
+ buffer_info->mapped_as_page = true;
+- buffer_info->dma = pci_map_page(pdev,
++ buffer_info->dma = dma_map_page(dev,
+ frag->page,
+ frag->page_offset,
+ len,
+- PCI_DMA_TODEVICE);
+- if (pci_dma_mapping_error(pdev, buffer_info->dma))
++ DMA_TO_DEVICE);
++ if (dma_mapping_error(dev, buffer_info->dma))
+ goto dma_error;
+
+ }
+@@ -3602,7 +3605,7 @@ static inline int igb_tx_map_adv(struct igb_ring *tx_ring, struct sk_buff *skb,
+ return ++count;
+
+ dma_error:
+- dev_err(&pdev->dev, "TX DMA map failed\n");
++ dev_err(dev, "TX DMA map failed\n");
+
+ /* clear timestamp and dma mappings for failed buffer_info mapping */
+ buffer_info->dma = 0;
+@@ -4987,7 +4990,7 @@ static bool igb_clean_tx_irq(struct igb_q_vector *q_vector)
+ !(rd32(E1000_STATUS) & E1000_STATUS_TXOFF)) {
+
+ /* detected Tx unit hang */
+- dev_err(&tx_ring->pdev->dev,
++ dev_err(tx_ring->dev,
+ "Detected Tx Unit Hang\n"
+ " Tx Queue <%d>\n"
+ " TDH <%x>\n"
+@@ -5066,7 +5069,7 @@ static inline void igb_rx_checksum_adv(struct igb_ring *ring,
+ if (status_err & (E1000_RXD_STAT_TCPCS | E1000_RXD_STAT_UDPCS))
+ skb->ip_summed = CHECKSUM_UNNECESSARY;
+
+- dev_dbg(&ring->pdev->dev, "cksum success: bits %08X\n", status_err);
++ dev_dbg(ring->dev, "cksum success: bits %08X\n", status_err);
+ }
+
+ static void igb_rx_hwtstamp(struct igb_q_vector *q_vector, u32 staterr,
+@@ -5121,7 +5124,7 @@ static bool igb_clean_rx_irq_adv(struct igb_q_vector *q_vector,
+ {
+ struct igb_ring *rx_ring = q_vector->rx_ring;
+ struct net_device *netdev = rx_ring->netdev;
+- struct pci_dev *pdev = rx_ring->pdev;
++ struct device *dev = rx_ring->dev;
+ union e1000_adv_rx_desc *rx_desc , *next_rxd;
+ struct igb_buffer *buffer_info , *next_buffer;
+ struct sk_buff *skb;
+@@ -5161,9 +5164,9 @@ static bool igb_clean_rx_irq_adv(struct igb_q_vector *q_vector,
+ cleaned_count++;
+
+ if (buffer_info->dma) {
+- pci_unmap_single(pdev, buffer_info->dma,
++ dma_unmap_single(dev, buffer_info->dma,
+ rx_ring->rx_buffer_len,
+- PCI_DMA_FROMDEVICE);
++ DMA_FROM_DEVICE);
+ buffer_info->dma = 0;
+ if (rx_ring->rx_buffer_len >= IGB_RXBUFFER_1024) {
+ skb_put(skb, length);
+@@ -5173,8 +5176,8 @@ static bool igb_clean_rx_irq_adv(struct igb_q_vector *q_vector,
+ }
+
+ if (length) {
+- pci_unmap_page(pdev, buffer_info->page_dma,
+- PAGE_SIZE / 2, PCI_DMA_FROMDEVICE);
++ dma_unmap_page(dev, buffer_info->page_dma,
++ PAGE_SIZE / 2, DMA_FROM_DEVICE);
+ buffer_info->page_dma = 0;
+
+ skb_fill_page_desc(skb, skb_shinfo(skb)->nr_frags,
+@@ -5282,12 +5285,12 @@ void igb_alloc_rx_buffers_adv(struct igb_ring *rx_ring, int cleaned_count)
+ buffer_info->page_offset ^= PAGE_SIZE / 2;
+ }
+ buffer_info->page_dma =
+- pci_map_page(rx_ring->pdev, buffer_info->page,
++ dma_map_page(rx_ring->dev, buffer_info->page,
+ buffer_info->page_offset,
+ PAGE_SIZE / 2,
+- PCI_DMA_FROMDEVICE);
+- if (pci_dma_mapping_error(rx_ring->pdev,
+- buffer_info->page_dma)) {
++ DMA_FROM_DEVICE);
++ if (dma_mapping_error(rx_ring->dev,
++ buffer_info->page_dma)) {
+ buffer_info->page_dma = 0;
+ rx_ring->rx_stats.alloc_failed++;
+ goto no_buffers;
+@@ -5305,12 +5308,12 @@ void igb_alloc_rx_buffers_adv(struct igb_ring *rx_ring, int cleaned_count)
+ buffer_info->skb = skb;
+ }
+ if (!buffer_info->dma) {
+- buffer_info->dma = pci_map_single(rx_ring->pdev,
++ buffer_info->dma = dma_map_single(rx_ring->dev,
+ skb->data,
+ bufsz,
+- PCI_DMA_FROMDEVICE);
+- if (pci_dma_mapping_error(rx_ring->pdev,
+- buffer_info->dma)) {
++ DMA_FROM_DEVICE);
++ if (dma_mapping_error(rx_ring->dev,
++ buffer_info->dma)) {
+ buffer_info->dma = 0;
+ rx_ring->rx_stats.alloc_failed++;
+ goto no_buffers;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0129-igbvf-use-DMA-API-instead-of-PCI-DMA-functions.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0129-igbvf-use-DMA-API-instead-of-PCI-DMA-functions.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,211 @@
+From: Nick Nunley <nicholasx.d.nunley at intel.com>
+Date: Tue, 27 Apr 2010 13:09:44 +0000
+Subject: [PATCH 129/165] igbvf: use DMA API instead of PCI DMA functions
+
+commit 123e9f1afe7b86f7c719d1289434c5c040758334 upstream.
+
+Signed-off-by: Nicholas Nunley <nicholasx.d.nunley at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igbvf/netdev.c | 74 ++++++++++++++++++++++---------------------
+ 1 files changed, 38 insertions(+), 36 deletions(-)
+
+diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
+index bdb14d4..a82d000 100644
+--- a/drivers/net/igbvf/netdev.c
++++ b/drivers/net/igbvf/netdev.c
+@@ -164,10 +164,10 @@ static void igbvf_alloc_rx_buffers(struct igbvf_ring *rx_ring,
+ buffer_info->page_offset ^= PAGE_SIZE / 2;
+ }
+ buffer_info->page_dma =
+- pci_map_page(pdev, buffer_info->page,
++ dma_map_page(&pdev->dev, buffer_info->page,
+ buffer_info->page_offset,
+ PAGE_SIZE / 2,
+- PCI_DMA_FROMDEVICE);
++ DMA_FROM_DEVICE);
+ }
+
+ if (!buffer_info->skb) {
+@@ -178,9 +178,9 @@ static void igbvf_alloc_rx_buffers(struct igbvf_ring *rx_ring,
+ }
+
+ buffer_info->skb = skb;
+- buffer_info->dma = pci_map_single(pdev, skb->data,
++ buffer_info->dma = dma_map_single(&pdev->dev, skb->data,
+ bufsz,
+- PCI_DMA_FROMDEVICE);
++ DMA_FROM_DEVICE);
+ }
+ /* Refresh the desc even if buffer_addrs didn't change because
+ * each write-back erases this info. */
+@@ -268,25 +268,25 @@ static bool igbvf_clean_rx_irq(struct igbvf_adapter *adapter,
+ prefetch(skb->data - NET_IP_ALIGN);
+ buffer_info->skb = NULL;
+ if (!adapter->rx_ps_hdr_size) {
+- pci_unmap_single(pdev, buffer_info->dma,
++ dma_unmap_single(&pdev->dev, buffer_info->dma,
+ adapter->rx_buffer_len,
+- PCI_DMA_FROMDEVICE);
++ DMA_FROM_DEVICE);
+ buffer_info->dma = 0;
+ skb_put(skb, length);
+ goto send_up;
+ }
+
+ if (!skb_shinfo(skb)->nr_frags) {
+- pci_unmap_single(pdev, buffer_info->dma,
++ dma_unmap_single(&pdev->dev, buffer_info->dma,
+ adapter->rx_ps_hdr_size,
+- PCI_DMA_FROMDEVICE);
++ DMA_FROM_DEVICE);
+ skb_put(skb, hlen);
+ }
+
+ if (length) {
+- pci_unmap_page(pdev, buffer_info->page_dma,
++ dma_unmap_page(&pdev->dev, buffer_info->page_dma,
+ PAGE_SIZE / 2,
+- PCI_DMA_FROMDEVICE);
++ DMA_FROM_DEVICE);
+ buffer_info->page_dma = 0;
+
+ skb_fill_page_desc(skb, skb_shinfo(skb)->nr_frags,
+@@ -369,15 +369,15 @@ static void igbvf_put_txbuf(struct igbvf_adapter *adapter,
+ {
+ if (buffer_info->dma) {
+ if (buffer_info->mapped_as_page)
+- pci_unmap_page(adapter->pdev,
++ dma_unmap_page(&adapter->pdev->dev,
+ buffer_info->dma,
+ buffer_info->length,
+- PCI_DMA_TODEVICE);
++ DMA_TO_DEVICE);
+ else
+- pci_unmap_single(adapter->pdev,
++ dma_unmap_single(&adapter->pdev->dev,
+ buffer_info->dma,
+ buffer_info->length,
+- PCI_DMA_TODEVICE);
++ DMA_TO_DEVICE);
+ buffer_info->dma = 0;
+ }
+ if (buffer_info->skb) {
+@@ -438,8 +438,8 @@ int igbvf_setup_tx_resources(struct igbvf_adapter *adapter,
+ tx_ring->size = tx_ring->count * sizeof(union e1000_adv_tx_desc);
+ tx_ring->size = ALIGN(tx_ring->size, 4096);
+
+- tx_ring->desc = pci_alloc_consistent(pdev, tx_ring->size,
+- &tx_ring->dma);
++ tx_ring->desc = dma_alloc_coherent(&pdev->dev, tx_ring->size,
++ &tx_ring->dma, GFP_KERNEL);
+
+ if (!tx_ring->desc)
+ goto err;
+@@ -480,8 +480,8 @@ int igbvf_setup_rx_resources(struct igbvf_adapter *adapter,
+ rx_ring->size = rx_ring->count * desc_len;
+ rx_ring->size = ALIGN(rx_ring->size, 4096);
+
+- rx_ring->desc = pci_alloc_consistent(pdev, rx_ring->size,
+- &rx_ring->dma);
++ rx_ring->desc = dma_alloc_coherent(&pdev->dev, rx_ring->size,
++ &rx_ring->dma, GFP_KERNEL);
+
+ if (!rx_ring->desc)
+ goto err;
+@@ -549,7 +549,8 @@ void igbvf_free_tx_resources(struct igbvf_ring *tx_ring)
+ vfree(tx_ring->buffer_info);
+ tx_ring->buffer_info = NULL;
+
+- pci_free_consistent(pdev, tx_ring->size, tx_ring->desc, tx_ring->dma);
++ dma_free_coherent(&pdev->dev, tx_ring->size, tx_ring->desc,
++ tx_ring->dma);
+
+ tx_ring->desc = NULL;
+ }
+@@ -574,13 +575,13 @@ static void igbvf_clean_rx_ring(struct igbvf_ring *rx_ring)
+ buffer_info = &rx_ring->buffer_info[i];
+ if (buffer_info->dma) {
+ if (adapter->rx_ps_hdr_size){
+- pci_unmap_single(pdev, buffer_info->dma,
++ dma_unmap_single(&pdev->dev, buffer_info->dma,
+ adapter->rx_ps_hdr_size,
+- PCI_DMA_FROMDEVICE);
++ DMA_FROM_DEVICE);
+ } else {
+- pci_unmap_single(pdev, buffer_info->dma,
++ dma_unmap_single(&pdev->dev, buffer_info->dma,
+ adapter->rx_buffer_len,
+- PCI_DMA_FROMDEVICE);
++ DMA_FROM_DEVICE);
+ }
+ buffer_info->dma = 0;
+ }
+@@ -592,9 +593,10 @@ static void igbvf_clean_rx_ring(struct igbvf_ring *rx_ring)
+
+ if (buffer_info->page) {
+ if (buffer_info->page_dma)
+- pci_unmap_page(pdev, buffer_info->page_dma,
++ dma_unmap_page(&pdev->dev,
++ buffer_info->page_dma,
+ PAGE_SIZE / 2,
+- PCI_DMA_FROMDEVICE);
++ DMA_FROM_DEVICE);
+ put_page(buffer_info->page);
+ buffer_info->page = NULL;
+ buffer_info->page_dma = 0;
+@@ -2104,9 +2106,9 @@ static inline int igbvf_tx_map_adv(struct igbvf_adapter *adapter,
+ buffer_info->time_stamp = jiffies;
+ buffer_info->next_to_watch = i;
+ buffer_info->mapped_as_page = false;
+- buffer_info->dma = pci_map_single(pdev, skb->data, len,
+- PCI_DMA_TODEVICE);
+- if (pci_dma_mapping_error(pdev, buffer_info->dma))
++ buffer_info->dma = dma_map_single(&pdev->dev, skb->data, len,
++ DMA_TO_DEVICE);
++ if (dma_mapping_error(&pdev->dev, buffer_info->dma))
+ goto dma_error;
+
+
+@@ -2127,12 +2129,12 @@ static inline int igbvf_tx_map_adv(struct igbvf_adapter *adapter,
+ buffer_info->time_stamp = jiffies;
+ buffer_info->next_to_watch = i;
+ buffer_info->mapped_as_page = true;
+- buffer_info->dma = pci_map_page(pdev,
++ buffer_info->dma = dma_map_page(&pdev->dev,
+ frag->page,
+ frag->page_offset,
+ len,
+- PCI_DMA_TODEVICE);
+- if (pci_dma_mapping_error(pdev, buffer_info->dma))
++ DMA_TO_DEVICE);
++ if (dma_mapping_error(&pdev->dev, buffer_info->dma))
+ goto dma_error;
+ }
+
+@@ -2644,16 +2646,16 @@ static int __devinit igbvf_probe(struct pci_dev *pdev,
+ return err;
+
+ pci_using_dac = 0;
+- err = pci_set_dma_mask(pdev, DMA_BIT_MASK(64));
++ err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(64));
+ if (!err) {
+- err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
++ err = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64));
+ if (!err)
+ pci_using_dac = 1;
+ } else {
+- err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
++ err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
+ if (err) {
+- err = pci_set_consistent_dma_mask(pdev,
+- DMA_BIT_MASK(32));
++ err = dma_set_coherent_mask(&pdev->dev,
++ DMA_BIT_MASK(32));
+ if (err) {
+ dev_err(&pdev->dev, "No usable DMA "
+ "configuration, aborting\n");
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0130-igb-add-registers-etc.-printout-code-just-before-res.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0130-igb-add-registers-etc.-printout-code-just-before-res.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,372 @@
+From: Taku Izumi <izumi.taku at jp.fujitsu.com>
+Date: Tue, 27 Apr 2010 14:39:30 +0000
+Subject: [PATCH 130/165] igb: add registers etc. printout code just before
+ resetting adapters
+
+commit c97ec42a7a35d214e0c715f77e2ccdfe8ac5bf7c upstream.
+
+This patch adds registers (,tx/rx rings' status and so on) printout
+code just before resetting adapters. This will be helpful for detecting
+the root cause of adapters reset.
+
+Signed-off-by: Taku Izumi <izumi.taku at jp.fujitsu.com>
+Signed-off-by: Koki Sanagi <sanagi.koki at jp.fujitsu.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 332 ++++++++++++++++++++++++++++++++++++++++++++
+ 1 files changed, 332 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 8f38add..fd32715 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -195,6 +195,336 @@ MODULE_DESCRIPTION("Intel(R) Gigabit Ethernet Network Driver");
+ MODULE_LICENSE("GPL");
+ MODULE_VERSION(DRV_VERSION);
+
++struct igb_reg_info {
++ u32 ofs;
++ char *name;
++};
++
++static const struct igb_reg_info igb_reg_info_tbl[] = {
++
++ /* General Registers */
++ {E1000_CTRL, "CTRL"},
++ {E1000_STATUS, "STATUS"},
++ {E1000_CTRL_EXT, "CTRL_EXT"},
++
++ /* Interrupt Registers */
++ {E1000_ICR, "ICR"},
++
++ /* RX Registers */
++ {E1000_RCTL, "RCTL"},
++ {E1000_RDLEN(0), "RDLEN"},
++ {E1000_RDH(0), "RDH"},
++ {E1000_RDT(0), "RDT"},
++ {E1000_RXDCTL(0), "RXDCTL"},
++ {E1000_RDBAL(0), "RDBAL"},
++ {E1000_RDBAH(0), "RDBAH"},
++
++ /* TX Registers */
++ {E1000_TCTL, "TCTL"},
++ {E1000_TDBAL(0), "TDBAL"},
++ {E1000_TDBAH(0), "TDBAH"},
++ {E1000_TDLEN(0), "TDLEN"},
++ {E1000_TDH(0), "TDH"},
++ {E1000_TDT(0), "TDT"},
++ {E1000_TXDCTL(0), "TXDCTL"},
++ {E1000_TDFH, "TDFH"},
++ {E1000_TDFT, "TDFT"},
++ {E1000_TDFHS, "TDFHS"},
++ {E1000_TDFPC, "TDFPC"},
++
++ /* List Terminator */
++ {}
++};
++
++/*
++ * igb_regdump - register printout routine
++ */
++static void igb_regdump(struct e1000_hw *hw, struct igb_reg_info *reginfo)
++{
++ int n = 0;
++ char rname[16];
++ u32 regs[8];
++
++ switch (reginfo->ofs) {
++ case E1000_RDLEN(0):
++ for (n = 0; n < 4; n++)
++ regs[n] = rd32(E1000_RDLEN(n));
++ break;
++ case E1000_RDH(0):
++ for (n = 0; n < 4; n++)
++ regs[n] = rd32(E1000_RDH(n));
++ break;
++ case E1000_RDT(0):
++ for (n = 0; n < 4; n++)
++ regs[n] = rd32(E1000_RDT(n));
++ break;
++ case E1000_RXDCTL(0):
++ for (n = 0; n < 4; n++)
++ regs[n] = rd32(E1000_RXDCTL(n));
++ break;
++ case E1000_RDBAL(0):
++ for (n = 0; n < 4; n++)
++ regs[n] = rd32(E1000_RDBAL(n));
++ break;
++ case E1000_RDBAH(0):
++ for (n = 0; n < 4; n++)
++ regs[n] = rd32(E1000_RDBAH(n));
++ break;
++ case E1000_TDBAL(0):
++ for (n = 0; n < 4; n++)
++ regs[n] = rd32(E1000_RDBAL(n));
++ break;
++ case E1000_TDBAH(0):
++ for (n = 0; n < 4; n++)
++ regs[n] = rd32(E1000_TDBAH(n));
++ break;
++ case E1000_TDLEN(0):
++ for (n = 0; n < 4; n++)
++ regs[n] = rd32(E1000_TDLEN(n));
++ break;
++ case E1000_TDH(0):
++ for (n = 0; n < 4; n++)
++ regs[n] = rd32(E1000_TDH(n));
++ break;
++ case E1000_TDT(0):
++ for (n = 0; n < 4; n++)
++ regs[n] = rd32(E1000_TDT(n));
++ break;
++ case E1000_TXDCTL(0):
++ for (n = 0; n < 4; n++)
++ regs[n] = rd32(E1000_TXDCTL(n));
++ break;
++ default:
++ printk(KERN_INFO "%-15s %08x\n",
++ reginfo->name, rd32(reginfo->ofs));
++ return;
++ }
++
++ snprintf(rname, 16, "%s%s", reginfo->name, "[0-3]");
++ printk(KERN_INFO "%-15s ", rname);
++ for (n = 0; n < 4; n++)
++ printk(KERN_CONT "%08x ", regs[n]);
++ printk(KERN_CONT "\n");
++}
++
++/*
++ * igb_dump - Print registers, tx-rings and rx-rings
++ */
++static void igb_dump(struct igb_adapter *adapter)
++{
++ struct net_device *netdev = adapter->netdev;
++ struct e1000_hw *hw = &adapter->hw;
++ struct igb_reg_info *reginfo;
++ int n = 0;
++ struct igb_ring *tx_ring;
++ union e1000_adv_tx_desc *tx_desc;
++ struct my_u0 { u64 a; u64 b; } *u0;
++ struct igb_buffer *buffer_info;
++ struct igb_ring *rx_ring;
++ union e1000_adv_rx_desc *rx_desc;
++ u32 staterr;
++ int i = 0;
++
++ if (!netif_msg_hw(adapter))
++ return;
++
++ /* Print netdevice Info */
++ if (netdev) {
++ dev_info(&adapter->pdev->dev, "Net device Info\n");
++ printk(KERN_INFO "Device Name state "
++ "trans_start last_rx\n");
++ printk(KERN_INFO "%-15s %016lX %016lX %016lX\n",
++ netdev->name,
++ netdev->state,
++ netdev->trans_start,
++ netdev->last_rx);
++ }
++
++ /* Print Registers */
++ dev_info(&adapter->pdev->dev, "Register Dump\n");
++ printk(KERN_INFO " Register Name Value\n");
++ for (reginfo = (struct igb_reg_info *)igb_reg_info_tbl;
++ reginfo->name; reginfo++) {
++ igb_regdump(hw, reginfo);
++ }
++
++ /* Print TX Ring Summary */
++ if (!netdev || !netif_running(netdev))
++ goto exit;
++
++ dev_info(&adapter->pdev->dev, "TX Rings Summary\n");
++ printk(KERN_INFO "Queue [NTU] [NTC] [bi(ntc)->dma ]"
++ " leng ntw timestamp\n");
++ for (n = 0; n < adapter->num_tx_queues; n++) {
++ tx_ring = adapter->tx_ring[n];
++ buffer_info = &tx_ring->buffer_info[tx_ring->next_to_clean];
++ printk(KERN_INFO " %5d %5X %5X %016llX %04X %3X %016llX\n",
++ n, tx_ring->next_to_use, tx_ring->next_to_clean,
++ (u64)buffer_info->dma,
++ buffer_info->length,
++ buffer_info->next_to_watch,
++ (u64)buffer_info->time_stamp);
++ }
++
++ /* Print TX Rings */
++ if (!netif_msg_tx_done(adapter))
++ goto rx_ring_summary;
++
++ dev_info(&adapter->pdev->dev, "TX Rings Dump\n");
++
++ /* Transmit Descriptor Formats
++ *
++ * Advanced Transmit Descriptor
++ * +--------------------------------------------------------------+
++ * 0 | Buffer Address [63:0] |
++ * +--------------------------------------------------------------+
++ * 8 | PAYLEN | PORTS |CC|IDX | STA | DCMD |DTYP|MAC|RSV| DTALEN |
++ * +--------------------------------------------------------------+
++ * 63 46 45 40 39 38 36 35 32 31 24 15 0
++ */
++
++ for (n = 0; n < adapter->num_tx_queues; n++) {
++ tx_ring = adapter->tx_ring[n];
++ printk(KERN_INFO "------------------------------------\n");
++ printk(KERN_INFO "TX QUEUE INDEX = %d\n", tx_ring->queue_index);
++ printk(KERN_INFO "------------------------------------\n");
++ printk(KERN_INFO "T [desc] [address 63:0 ] "
++ "[PlPOCIStDDM Ln] [bi->dma ] "
++ "leng ntw timestamp bi->skb\n");
++
++ for (i = 0; tx_ring->desc && (i < tx_ring->count); i++) {
++ tx_desc = E1000_TX_DESC_ADV(*tx_ring, i);
++ buffer_info = &tx_ring->buffer_info[i];
++ u0 = (struct my_u0 *)tx_desc;
++ printk(KERN_INFO "T [0x%03X] %016llX %016llX %016llX"
++ " %04X %3X %016llX %p", i,
++ le64_to_cpu(u0->a),
++ le64_to_cpu(u0->b),
++ (u64)buffer_info->dma,
++ buffer_info->length,
++ buffer_info->next_to_watch,
++ (u64)buffer_info->time_stamp,
++ buffer_info->skb);
++ if (i == tx_ring->next_to_use &&
++ i == tx_ring->next_to_clean)
++ printk(KERN_CONT " NTC/U\n");
++ else if (i == tx_ring->next_to_use)
++ printk(KERN_CONT " NTU\n");
++ else if (i == tx_ring->next_to_clean)
++ printk(KERN_CONT " NTC\n");
++ else
++ printk(KERN_CONT "\n");
++
++ if (netif_msg_pktdata(adapter) && buffer_info->dma != 0)
++ print_hex_dump(KERN_INFO, "",
++ DUMP_PREFIX_ADDRESS,
++ 16, 1, phys_to_virt(buffer_info->dma),
++ buffer_info->length, true);
++ }
++ }
++
++ /* Print RX Rings Summary */
++rx_ring_summary:
++ dev_info(&adapter->pdev->dev, "RX Rings Summary\n");
++ printk(KERN_INFO "Queue [NTU] [NTC]\n");
++ for (n = 0; n < adapter->num_rx_queues; n++) {
++ rx_ring = adapter->rx_ring[n];
++ printk(KERN_INFO " %5d %5X %5X\n", n,
++ rx_ring->next_to_use, rx_ring->next_to_clean);
++ }
++
++ /* Print RX Rings */
++ if (!netif_msg_rx_status(adapter))
++ goto exit;
++
++ dev_info(&adapter->pdev->dev, "RX Rings Dump\n");
++
++ /* Advanced Receive Descriptor (Read) Format
++ * 63 1 0
++ * +-----------------------------------------------------+
++ * 0 | Packet Buffer Address [63:1] |A0/NSE|
++ * +----------------------------------------------+------+
++ * 8 | Header Buffer Address [63:1] | DD |
++ * +-----------------------------------------------------+
++ *
++ *
++ * Advanced Receive Descriptor (Write-Back) Format
++ *
++ * 63 48 47 32 31 30 21 20 17 16 4 3 0
++ * +------------------------------------------------------+
++ * 0 | Packet IP |SPH| HDR_LEN | RSV|Packet| RSS |
++ * | Checksum Ident | | | | Type | Type |
++ * +------------------------------------------------------+
++ * 8 | VLAN Tag | Length | Extended Error | Extended Status |
++ * +------------------------------------------------------+
++ * 63 48 47 32 31 20 19 0
++ */
++
++ for (n = 0; n < adapter->num_rx_queues; n++) {
++ rx_ring = adapter->rx_ring[n];
++ printk(KERN_INFO "------------------------------------\n");
++ printk(KERN_INFO "RX QUEUE INDEX = %d\n", rx_ring->queue_index);
++ printk(KERN_INFO "------------------------------------\n");
++ printk(KERN_INFO "R [desc] [ PktBuf A0] "
++ "[ HeadBuf DD] [bi->dma ] [bi->skb] "
++ "<-- Adv Rx Read format\n");
++ printk(KERN_INFO "RWB[desc] [PcsmIpSHl PtRs] "
++ "[vl er S cks ln] ---------------- [bi->skb] "
++ "<-- Adv Rx Write-Back format\n");
++
++ for (i = 0; i < rx_ring->count; i++) {
++ buffer_info = &rx_ring->buffer_info[i];
++ rx_desc = E1000_RX_DESC_ADV(*rx_ring, i);
++ u0 = (struct my_u0 *)rx_desc;
++ staterr = le32_to_cpu(rx_desc->wb.upper.status_error);
++ if (staterr & E1000_RXD_STAT_DD) {
++ /* Descriptor Done */
++ printk(KERN_INFO "RWB[0x%03X] %016llX "
++ "%016llX ---------------- %p", i,
++ le64_to_cpu(u0->a),
++ le64_to_cpu(u0->b),
++ buffer_info->skb);
++ } else {
++ printk(KERN_INFO "R [0x%03X] %016llX "
++ "%016llX %016llX %p", i,
++ le64_to_cpu(u0->a),
++ le64_to_cpu(u0->b),
++ (u64)buffer_info->dma,
++ buffer_info->skb);
++
++ if (netif_msg_pktdata(adapter)) {
++ print_hex_dump(KERN_INFO, "",
++ DUMP_PREFIX_ADDRESS,
++ 16, 1,
++ phys_to_virt(buffer_info->dma),
++ rx_ring->rx_buffer_len, true);
++ if (rx_ring->rx_buffer_len
++ < IGB_RXBUFFER_1024)
++ print_hex_dump(KERN_INFO, "",
++ DUMP_PREFIX_ADDRESS,
++ 16, 1,
++ phys_to_virt(
++ buffer_info->page_dma +
++ buffer_info->page_offset),
++ PAGE_SIZE/2, true);
++ }
++ }
++
++ if (i == rx_ring->next_to_use)
++ printk(KERN_CONT " NTU\n");
++ else if (i == rx_ring->next_to_clean)
++ printk(KERN_CONT " NTC\n");
++ else
++ printk(KERN_CONT "\n");
++
++ }
++ }
++
++exit:
++ return;
++}
++
++
+ /**
+ * igb_read_clock - read raw cycle counter (to be used by time counter)
+ */
+@@ -3843,6 +4173,8 @@ static void igb_reset_task(struct work_struct *work)
+ struct igb_adapter *adapter;
+ adapter = container_of(work, struct igb_adapter, reset_task);
+
++ igb_dump(adapter);
++ netdev_err(adapter->netdev, "Reset adapter\n");
+ igb_reinit_locked(adapter);
+ }
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0131-igb-Clean-up-left-over-prototype-of-igb_get_hw_dev_n.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0131-igb-Clean-up-left-over-prototype-of-igb_get_hw_dev_n.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,29 @@
+From: Emil Tantilov <emil.s.tantilov at intel.com>
+Date: Wed, 28 Apr 2010 14:24:51 -0700
+Subject: [PATCH 131/165] igb: Clean up left over prototype of
+ igb_get_hw_dev_name()
+
+commit cfc1fbb079b265bf69d4ceba590a2e2c1a1cde33 upstream.
+
+Signed-off-by: Emil Tantilov <emil.s.tantilov at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb.h | 1 -
+ 1 files changed, 0 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
+index 0953009..4d3681d 100644
+--- a/drivers/net/igb/igb.h
++++ b/drivers/net/igb/igb.h
+@@ -335,7 +335,6 @@ enum igb_boards {
+ extern char igb_driver_name[];
+ extern char igb_driver_version[];
+
+-extern char *igb_get_hw_dev_name(struct e1000_hw *hw);
+ extern int igb_up(struct igb_adapter *);
+ extern void igb_down(struct igb_adapter *);
+ extern void igb_reinit_locked(struct igb_adapter *);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0132-igb-reduce-cache-misses-on-tx-cleanup.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0132-igb-reduce-cache-misses-on-tx-cleanup.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,162 @@
+From: Nick Nunley <nicholasx.d.nunley at intel.com>
+Date: Tue, 4 May 2010 21:58:07 +0000
+Subject: [PATCH 132/165] igb: reduce cache misses on tx cleanup
+
+commit 2873957df0ead5b53fa00fddfb52ca3df38af4a9 upstream.
+
+This patch reduces the number of skb cache misses in the
+clean_tx_irq path, and results in an overall increase
+in tx packet throughput.
+
+Signed-off-by: Nicholas Nunley <nicholasx.d.nunley at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb.h | 4 ++-
+ drivers/net/igb/igb_main.c | 45 ++++++++++++++++++-------------------------
+ 2 files changed, 22 insertions(+), 27 deletions(-)
+
+diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
+index 4d3681d..de2e779 100644
+--- a/drivers/net/igb/igb.h
++++ b/drivers/net/igb/igb.h
+@@ -138,8 +138,10 @@ struct igb_buffer {
+ unsigned long time_stamp;
+ u16 length;
+ u16 next_to_watch;
+- u16 mapped_as_page;
++ unsigned int bytecount;
+ u16 gso_segs;
++ union skb_shared_tx shtx;
++ u8 mapped_as_page;
+ };
+ /* RX */
+ struct {
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index fd32715..f07361b 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -3884,34 +3884,33 @@ static inline int igb_tx_map_adv(struct igb_ring *tx_ring, struct sk_buff *skb,
+ {
+ struct igb_buffer *buffer_info;
+ struct device *dev = tx_ring->dev;
+- unsigned int len = skb_headlen(skb);
++ unsigned int hlen = skb_headlen(skb);
+ unsigned int count = 0, i;
+ unsigned int f;
++ u16 gso_segs = skb_shinfo(skb)->gso_segs ?: 1;
+
+ i = tx_ring->next_to_use;
+
+ buffer_info = &tx_ring->buffer_info[i];
+- BUG_ON(len >= IGB_MAX_DATA_PER_TXD);
+- buffer_info->length = len;
++ BUG_ON(hlen >= IGB_MAX_DATA_PER_TXD);
++ buffer_info->length = hlen;
+ /* set time_stamp *before* dma to help avoid a possible race */
+ buffer_info->time_stamp = jiffies;
+ buffer_info->next_to_watch = i;
+- buffer_info->dma = dma_map_single(dev, skb->data, len,
++ buffer_info->dma = dma_map_single(dev, skb->data, hlen,
+ DMA_TO_DEVICE);
+ if (dma_mapping_error(dev, buffer_info->dma))
+ goto dma_error;
+
+ for (f = 0; f < skb_shinfo(skb)->nr_frags; f++) {
+- struct skb_frag_struct *frag;
++ struct skb_frag_struct *frag = &skb_shinfo(skb)->frags[f];
++ unsigned int len = frag->size;
+
+ count++;
+ i++;
+ if (i == tx_ring->count)
+ i = 0;
+
+- frag = &skb_shinfo(skb)->frags[f];
+- len = frag->size;
+-
+ buffer_info = &tx_ring->buffer_info[i];
+ BUG_ON(len >= IGB_MAX_DATA_PER_TXD);
+ buffer_info->length = len;
+@@ -3929,7 +3928,10 @@ static inline int igb_tx_map_adv(struct igb_ring *tx_ring, struct sk_buff *skb,
+ }
+
+ tx_ring->buffer_info[i].skb = skb;
+- tx_ring->buffer_info[i].gso_segs = skb_shinfo(skb)->gso_segs ?: 1;
++ tx_ring->buffer_info[i].shtx = skb_shinfo(skb)->tx_flags;
++ /* multiply data chunks by size of headers */
++ tx_ring->buffer_info[i].bytecount = ((gso_segs - 1) * hlen) + skb->len;
++ tx_ring->buffer_info[i].gso_segs = gso_segs;
+ tx_ring->buffer_info[first].next_to_watch = i;
+
+ return ++count;
+@@ -5216,22 +5218,21 @@ static void igb_systim_to_hwtstamp(struct igb_adapter *adapter,
+ /**
+ * igb_tx_hwtstamp - utility function which checks for TX time stamp
+ * @q_vector: pointer to q_vector containing needed info
+- * @skb: packet that was just sent
++ * @buffer: pointer to igb_buffer structure
+ *
+ * If we were asked to do hardware stamping and such a time stamp is
+ * available, then it must have been for this skb here because we only
+ * allow only one such packet into the queue.
+ */
+-static void igb_tx_hwtstamp(struct igb_q_vector *q_vector, struct sk_buff *skb)
++static void igb_tx_hwtstamp(struct igb_q_vector *q_vector, struct igb_buffer *buffer_info)
+ {
+ struct igb_adapter *adapter = q_vector->adapter;
+- union skb_shared_tx *shtx = skb_tx(skb);
+ struct e1000_hw *hw = &adapter->hw;
+ struct skb_shared_hwtstamps shhwtstamps;
+ u64 regval;
+
+ /* if skb does not support hw timestamp or TX stamp not valid exit */
+- if (likely(!shtx->hardware) ||
++ if (likely(!buffer_info->shtx.hardware) ||
+ !(rd32(E1000_TSYNCTXCTL) & E1000_TSYNCTXCTL_VALID))
+ return;
+
+@@ -5239,7 +5240,7 @@ static void igb_tx_hwtstamp(struct igb_q_vector *q_vector, struct sk_buff *skb)
+ regval |= (u64)rd32(E1000_TXSTMPH) << 32;
+
+ igb_systim_to_hwtstamp(adapter, &shhwtstamps, regval);
+- skb_tstamp_tx(skb, &shhwtstamps);
++ skb_tstamp_tx(buffer_info->skb, &shhwtstamps);
+ }
+
+ /**
+@@ -5254,7 +5255,6 @@ static bool igb_clean_tx_irq(struct igb_q_vector *q_vector)
+ struct net_device *netdev = tx_ring->netdev;
+ struct e1000_hw *hw = &adapter->hw;
+ struct igb_buffer *buffer_info;
+- struct sk_buff *skb;
+ union e1000_adv_tx_desc *tx_desc, *eop_desc;
+ unsigned int total_bytes = 0, total_packets = 0;
+ unsigned int i, eop, count = 0;
+@@ -5270,19 +5270,12 @@ static bool igb_clean_tx_irq(struct igb_q_vector *q_vector)
+ tx_desc = E1000_TX_DESC_ADV(*tx_ring, i);
+ buffer_info = &tx_ring->buffer_info[i];
+ cleaned = (i == eop);
+- skb = buffer_info->skb;
+
+- if (skb) {
+- unsigned int segs, bytecount;
++ if (buffer_info->skb) {
++ total_bytes += buffer_info->bytecount;
+ /* gso_segs is currently only valid for tcp */
+- segs = buffer_info->gso_segs;
+- /* multiply data chunks by size of headers */
+- bytecount = ((segs - 1) * skb_headlen(skb)) +
+- skb->len;
+- total_packets += segs;
+- total_bytes += bytecount;
+-
+- igb_tx_hwtstamp(q_vector, skb);
++ total_packets += buffer_info->gso_segs;
++ igb_tx_hwtstamp(q_vector, buffer_info);
+ }
+
+ igb_unmap_and_free_tx_resource(tx_ring, buffer_info);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0133-drivers-net-Remove-unnecessary-returns-from-void-fun.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0133-drivers-net-Remove-unnecessary-returns-from-void-fun.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,83 @@
+From: Joe Perches <joe at perches.com>
+Date: Fri, 14 May 2010 00:19:28 -0700
+Subject: [PATCH 133/165] drivers/net: Remove unnecessary returns from void
+ function()s
+
+commit a4b770972b8f819e408d7cc3ae9637e15bff62f6 upstream.
+
+This patch removes from drivers/net/ all the unnecessary
+return; statements that precede the last closing brace of
+void functions.
+
+It does not remove the returns that are immediately
+preceded by a label as gcc doesn't like that.
+
+It also does not remove null void functions with return.
+
+Done via:
+$ grep -rP --include=*.[ch] -l "return;\n}" net/ | \
+ xargs perl -i -e 'local $/ ; while (<>) { s/\n[ \t\n]+return;\n}/\n}/g; print; }'
+
+with some cleanups by hand.
+
+Compile tested x86 allmodconfig only.
+
+Signed-off-by: Joe Perches <joe at perches.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Restricted to drivers/net/igb{,vf}]
+---
+ drivers/net/igb/e1000_82575.c | 2 --
+ drivers/net/igb/igb_main.c | 3 ---
+ drivers/net/igbvf/ethtool.c | 2 --
+ 3 files changed, 0 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c
+index 3ef4955..86438b5 100644
+--- a/drivers/net/igb/e1000_82575.c
++++ b/drivers/net/igb/e1000_82575.c
+@@ -1214,8 +1214,6 @@ void igb_power_down_phy_copper_82575(struct e1000_hw *hw)
+ /* If the management interface is not enabled, then power down */
+ if (!(igb_enable_mng_pass_thru(hw) || igb_check_reset_block(hw)))
+ igb_power_down_phy_copper(hw);
+-
+- return;
+ }
+
+ /**
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index f07361b..94da805 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -1048,7 +1048,6 @@ msi_only:
+ out:
+ /* Notify the stack of the (possibly) reduced Tx Queue count. */
+ adapter->netdev->real_num_tx_queues = adapter->num_tx_queues;
+- return;
+ }
+
+ /**
+@@ -3702,8 +3701,6 @@ set_itr_now:
+ q_vector->itr_val = new_itr;
+ q_vector->set_itr = 1;
+ }
+-
+- return;
+ }
+
+ #define IGB_TX_FLAGS_CSUM 0x00000001
+diff --git a/drivers/net/igbvf/ethtool.c b/drivers/net/igbvf/ethtool.c
+index 8afff07..103b3aa 100644
+--- a/drivers/net/igbvf/ethtool.c
++++ b/drivers/net/igbvf/ethtool.c
+@@ -390,8 +390,6 @@ static void igbvf_get_wol(struct net_device *netdev,
+ {
+ wol->supported = 0;
+ wol->wolopts = 0;
+-
+- return;
+ }
+
+ static int igbvf_set_wol(struct net_device *netdev,
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0134-igb-fix-PHY-config-access-on-82580.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0134-igb-fix-PHY-config-access-on-82580.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,60 @@
+From: Nick Nunley <nicholasx.d.nunley at intel.com>
+Date: Thu, 1 Jul 2010 13:37:54 +0000
+Subject: [PATCH 134/165] igb: fix PHY config access on 82580
+
+commit ede3ef0d940ef052466f42c849390b23c6859abc upstream.
+
+82580 NICs can have up to 4 functions. This fixes phy accesses
+to use the correct locks for functions 2 and 3.
+
+Signed-off-by: Nicholas Nunley <nicholasx.d.nunley at intel.com>
+Tested-by: Jeff Pieper <jeffrey.e.pieper at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/e1000_82575.c | 8 ++++++++
+ drivers/net/igb/e1000_defines.h | 2 ++
+ 2 files changed, 10 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c
+index 86438b5..06251a9 100644
+--- a/drivers/net/igb/e1000_82575.c
++++ b/drivers/net/igb/e1000_82575.c
+@@ -295,6 +295,10 @@ static s32 igb_acquire_phy_82575(struct e1000_hw *hw)
+
+ if (hw->bus.func == E1000_FUNC_1)
+ mask = E1000_SWFW_PHY1_SM;
++ else if (hw->bus.func == E1000_FUNC_2)
++ mask = E1000_SWFW_PHY2_SM;
++ else if (hw->bus.func == E1000_FUNC_3)
++ mask = E1000_SWFW_PHY3_SM;
+
+ return igb_acquire_swfw_sync_82575(hw, mask);
+ }
+@@ -312,6 +316,10 @@ static void igb_release_phy_82575(struct e1000_hw *hw)
+
+ if (hw->bus.func == E1000_FUNC_1)
+ mask = E1000_SWFW_PHY1_SM;
++ else if (hw->bus.func == E1000_FUNC_2)
++ mask = E1000_SWFW_PHY2_SM;
++ else if (hw->bus.func == E1000_FUNC_3)
++ mask = E1000_SWFW_PHY3_SM;
+
+ igb_release_swfw_sync_82575(hw, mask);
+ }
+diff --git a/drivers/net/igb/e1000_defines.h b/drivers/net/igb/e1000_defines.h
+index 24d9be6..90bc29d 100644
+--- a/drivers/net/igb/e1000_defines.h
++++ b/drivers/net/igb/e1000_defines.h
+@@ -164,6 +164,8 @@
+ #define E1000_SWFW_EEP_SM 0x1
+ #define E1000_SWFW_PHY0_SM 0x2
+ #define E1000_SWFW_PHY1_SM 0x4
++#define E1000_SWFW_PHY2_SM 0x20
++#define E1000_SWFW_PHY3_SM 0x40
+
+ /* FACTPS Definitions */
+ /* Device Control */
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0135-igb-Use-only-a-single-Tx-queue-in-SR-IOV-mode.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0135-igb-Use-only-a-single-Tx-queue-in-SR-IOV-mode.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,53 @@
+From: Greg Rose <gregory.v.rose at intel.com>
+Date: Thu, 1 Jul 2010 13:38:16 +0000
+Subject: [PATCH 135/165] igb: Use only a single Tx queue in SR-IOV mode
+
+commit 5fa8517f038d51d571981fb495206cc30ed91b06 upstream.
+
+The 82576 expects the second rx queue in any pool to receive L2 switch
+loop back packets sent from the second tx queue in another pool. The
+82576 VF driver does not enable the second rx queue so if the PF driver
+sends packets destined to a VF from its second tx queue then the VF
+driver will never see them. In SR-IOV mode limit the number of tx queues
+used by the PF driver to one. This patch fixes a bug reported in which
+the PF cannot communciate with the VF and should be considered for 2.6.34
+stable.
+
+CC: stable at kernel.org
+Signed-off-by: Greg Rose <gregory.v.rose at intel.com>
+Tested-by: Jeff Pieper <jeffrey.e.pieper at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 8 ++++----
+ 1 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 94da805..b62e1f0 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -624,9 +624,6 @@ static void igb_cache_ring_register(struct igb_adapter *adapter)
+ for (; i < adapter->rss_queues; i++)
+ adapter->rx_ring[i]->reg_idx = rbase_offset +
+ Q_IDX_82576(i);
+- for (; j < adapter->rss_queues; j++)
+- adapter->tx_ring[j]->reg_idx = rbase_offset +
+- Q_IDX_82576(j);
+ }
+ case e1000_82575:
+ case e1000_82580:
+@@ -990,7 +987,10 @@ static void igb_set_interrupt_capability(struct igb_adapter *adapter)
+
+ /* Number of supported queues. */
+ adapter->num_rx_queues = adapter->rss_queues;
+- adapter->num_tx_queues = adapter->rss_queues;
++ if (adapter->vfs_allocated_count)
++ adapter->num_tx_queues = 1;
++ else
++ adapter->num_tx_queues = adapter->rss_queues;
+
+ /* start with one vector for every rx queue */
+ numvecs = adapter->num_rx_queues;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0136-igb-Fix-Tx-hangs-seen-when-loading-igb-with-max_vfs-.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0136-igb-Fix-Tx-hangs-seen-when-loading-igb-with-max_vfs-.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,46 @@
+From: Emil Tantilov <emil.s.tantilov at intel.com>
+Date: Thu, 1 Jul 2010 13:38:40 +0000
+Subject: [PATCH 136/165] igb: Fix Tx hangs seen when loading igb with max_vfs
+ > 7.
+
+commit c0f2276f3601a96b29d4347c5938e9494e8e4e5d upstream.
+
+Check the value of max_vfs at the time of assignment of vfs_allocated_count.
+
+The previous check in igb_probe_vfs was too late as by that time the rx/tx
+rings were initialized with the wrong offset.
+
+Signed-off-by: Emil Tantilov <emil.s.tantilov at intel.com>
+Tested-by: Jeff Pieper <jeffrey.e.pieper at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 5 +----
+ 1 files changed, 1 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index b62e1f0..57374d7 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -2081,9 +2081,6 @@ static void __devinit igb_probe_vfs(struct igb_adapter * adapter)
+ #ifdef CONFIG_PCI_IOV
+ struct pci_dev *pdev = adapter->pdev;
+
+- if (adapter->vfs_allocated_count > 7)
+- adapter->vfs_allocated_count = 7;
+-
+ if (adapter->vfs_allocated_count) {
+ adapter->vf_data = kcalloc(adapter->vfs_allocated_count,
+ sizeof(struct vf_data_storage),
+@@ -2248,7 +2245,7 @@ static int __devinit igb_sw_init(struct igb_adapter *adapter)
+
+ #ifdef CONFIG_PCI_IOV
+ if (hw->mac.type == e1000_82576)
+- adapter->vfs_allocated_count = max_vfs;
++ adapter->vfs_allocated_count = (max_vfs > 7) ? 7 : max_vfs;
+
+ #endif /* CONFIG_PCI_IOV */
+ adapter->rss_queues = min_t(u32, IGB_MAX_RX_QUEUES, num_online_cpus());
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0137-igb-correct-link-test-not-being-run-when-link-is-dow.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0137-igb-correct-link-test-not-being-run-when-link-is-dow.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,44 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Thu, 1 Jul 2010 13:39:01 +0000
+Subject: [PATCH 137/165] igb: correct link test not being run when link is
+ down
+
+commit 8d420a1b3ea65357b6eb59e4e742248d2838e904 upstream.
+
+The igb online link test was always reporting pass because instead of
+checking for if_running it was checking for netif_carrier_ok.
+
+This change corrects the test so that it is run if the interface is running
+instead of checking for netif carrier ok.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Tested-by: Emil Tantilov <emil.s.tantilov at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_ethtool.c | 8 +++-----
+ 1 files changed, 3 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
+index f2ebf927..26bf6a1 100644
+--- a/drivers/net/igb/igb_ethtool.c
++++ b/drivers/net/igb/igb_ethtool.c
+@@ -1823,12 +1823,10 @@ static void igb_diag_test(struct net_device *netdev,
+ dev_info(&adapter->pdev->dev, "online testing starting\n");
+
+ /* PHY is powered down when interface is down */
+- if (!netif_carrier_ok(netdev)) {
++ if (if_running && igb_link_test(adapter, &data[4]))
++ eth_test->flags |= ETH_TEST_FL_FAILED;
++ else
+ data[4] = 0;
+- } else {
+- if (igb_link_test(adapter, &data[4]))
+- eth_test->flags |= ETH_TEST_FL_FAILED;
+- }
+
+ /* Online tests aren't run; pass by default */
+ data[0] = 0;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0138-igb-Add-comment.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0138-igb-Add-comment.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,35 @@
+From: Greg Rose <gregory.v.rose at intel.com>
+Date: Thu, 1 Jul 2010 13:39:23 +0000
+Subject: [PATCH 138/165] igb: Add comment
+
+commit de42edde131cd09a556f0b90373569d64b92ef99 upstream.
+
+Add explanatory comment to avoid confusion when a pointer is set
+to the second word of an array instead of the customary cast of a
+pointer to the beginning of the array.
+
+Signed-off-by: Greg Rose <gregory.v.rose at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 4 ++++
+ 1 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 57374d7..30a63e1 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -4905,6 +4905,10 @@ static void igb_vf_reset_msg(struct igb_adapter *adapter, u32 vf)
+
+ static int igb_set_vf_mac_addr(struct igb_adapter *adapter, u32 *msg, int vf)
+ {
++ /*
++ * The VF MAC Address is stored in a packed array of bytes
++ * starting at the second 32 bit word of the msg array
++ */
+ unsigned char *addr = (char *)&msg[1];
+ int err = -1;
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0139-igb-drop-support-for-UDP-hashing-w-RSS.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0139-igb-drop-support-for-UDP-hashing-w-RSS.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,50 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Thu, 1 Jul 2010 20:01:05 +0000
+Subject: [PATCH 139/165] igb: drop support for UDP hashing w/ RSS
+
+commit 4478a9cdf007a0418755a8a4016af8352fb1c1f3 upstream.
+
+This change removes UDP from the supported protocols for RSS hashing. The
+reason for removing this protocol is because IP fragmentation was causing a
+network flow to be broken into two streams, one for fragmented, and one for
+non-fragmented and this in turn was causing out-of-order issues.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 18 ++++++++++--------
+ 1 files changed, 10 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 30a63e1..406dde3 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -2707,14 +2707,16 @@ static void igb_setup_mrqc(struct igb_adapter *adapter)
+ }
+ igb_vmm_control(adapter);
+
+- mrqc |= (E1000_MRQC_RSS_FIELD_IPV4 |
+- E1000_MRQC_RSS_FIELD_IPV4_TCP);
+- mrqc |= (E1000_MRQC_RSS_FIELD_IPV6 |
+- E1000_MRQC_RSS_FIELD_IPV6_TCP);
+- mrqc |= (E1000_MRQC_RSS_FIELD_IPV4_UDP |
+- E1000_MRQC_RSS_FIELD_IPV6_UDP);
+- mrqc |= (E1000_MRQC_RSS_FIELD_IPV6_UDP_EX |
+- E1000_MRQC_RSS_FIELD_IPV6_TCP_EX);
++ /*
++ * Generate RSS hash based on TCP port numbers and/or
++ * IPv4/v6 src and dst addresses since UDP cannot be
++ * hashed reliably due to IP fragmentation
++ */
++ mrqc |= E1000_MRQC_RSS_FIELD_IPV4 |
++ E1000_MRQC_RSS_FIELD_IPV4_TCP |
++ E1000_MRQC_RSS_FIELD_IPV6 |
++ E1000_MRQC_RSS_FIELD_IPV6_TCP |
++ E1000_MRQC_RSS_FIELD_IPV6_TCP_EX;
+
+ wr32(E1000_MRQC, mrqc);
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0140-ixgbe-igb-catch-invalid-VF-settings.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0140-ixgbe-igb-catch-invalid-VF-settings.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,47 @@
+From: Andy Gospodarek <andy at greyhouse.net>
+Date: Wed, 21 Jul 2010 06:40:31 +0000
+Subject: [PATCH 140/165] ixgbe/igb: catch invalid VF settings
+
+commit bded64a7ff82f6af56426a4ff2483888e5ad5fe9 upstream.
+
+Some ixgbe cards put an invalid VF device ID in the PCIe SR-IOV
+capability. The ixgbe driver is only valid for PFs or non SR-IOV
+hardware. It seems that the same problem could occur on igb hardware as
+well, so if we discover we are trying to initialize a VF in ixbge_probe
+or igb_probe, print an error and exit.
+
+Based on a patch for ixgbe from Chris Wright <chrisw at sous-sol.org>.
+
+Signed-off-by: Andy Gospodarek <andy at greyhouse.net>
+Cc: Chris Wright <chrisw at sous-sol.org>
+Acked-by: Chris Wright <chrisw at sous-sol.org>
+Acked-by: Greg Rose <gregory.v.rose at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Restricted to drivers/net/igb]
+---
+ drivers/net/igb/igb_main.c | 9 +++++++++
+ 1 files changed, 9 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 406dde3..8929f32 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -1712,6 +1712,15 @@ static int __devinit igb_probe(struct pci_dev *pdev,
+ u16 eeprom_apme_mask = IGB_EEPROM_APME;
+ u32 part_num;
+
++ /* Catch broken hardware that put the wrong VF device ID in
++ * the PCIe SR-IOV capability.
++ */
++ if (pdev->is_virtfn) {
++ WARN(1, KERN_ERR "%s (%hx:%hx) should not be a VF!\n",
++ pci_name(pdev), pdev->vendor, pdev->device);
++ return -EINVAL;
++ }
++
+ err = pci_enable_device_mem(pdev);
+ if (err)
+ return err;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0141-igb-add-support-for-SGMII-based-MDIO-PHYs.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0141-igb-add-support-for-SGMII-based-MDIO-PHYs.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,178 @@
+From: Nick Nunley <nicholas.d.nunley at intel.com>
+Date: Mon, 26 Jul 2010 13:15:06 +0000
+Subject: [PATCH 141/165] igb: add support for SGMII-based MDIO PHYs
+
+commit 4085f746db1b7d6b292cf27cc713a13a1fcb2681 upstream.
+
+This patch adds support for external MDIO PHYs, in addition to
+the standard SFP support for SGMII PHYs over the I2C interface.
+
+Signed-off-by: Nicholas Nunley <nicholas.d.nunley at intel.com>
+Tested-by: Jeff Pieper <jeffrey.e.pieper at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/e1000_82575.c | 82 +++++++++++++++++++++++++++++++--------
+ drivers/net/igb/e1000_defines.h | 10 +++++
+ 2 files changed, 75 insertions(+), 17 deletions(-)
+
+diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c
+index 06251a9..2971438 100644
+--- a/drivers/net/igb/e1000_82575.c
++++ b/drivers/net/igb/e1000_82575.c
+@@ -70,6 +70,35 @@ static const u16 e1000_82580_rxpbs_table[] =
+ #define E1000_82580_RXPBS_TABLE_SIZE \
+ (sizeof(e1000_82580_rxpbs_table)/sizeof(u16))
+
++/**
++ * igb_sgmii_uses_mdio_82575 - Determine if I2C pins are for external MDIO
++ * @hw: pointer to the HW structure
++ *
++ * Called to determine if the I2C pins are being used for I2C or as an
++ * external MDIO interface since the two options are mutually exclusive.
++ **/
++static bool igb_sgmii_uses_mdio_82575(struct e1000_hw *hw)
++{
++ u32 reg = 0;
++ bool ext_mdio = false;
++
++ switch (hw->mac.type) {
++ case e1000_82575:
++ case e1000_82576:
++ reg = rd32(E1000_MDIC);
++ ext_mdio = !!(reg & E1000_MDIC_DEST);
++ break;
++ case e1000_82580:
++ case e1000_i350:
++ reg = rd32(E1000_MDICNFG);
++ ext_mdio = !!(reg & E1000_MDICNFG_EXT_MDIO);
++ break;
++ default:
++ break;
++ }
++ return ext_mdio;
++}
++
+ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
+ {
+ struct e1000_phy_info *phy = &hw->phy;
+@@ -144,13 +173,6 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
+
+ wr32(E1000_CTRL_EXT, ctrl_ext);
+
+- /*
+- * if using i2c make certain the MDICNFG register is cleared to prevent
+- * communications from being misrouted to the mdic registers
+- */
+- if ((ctrl_ext & E1000_CTRL_I2C_ENA) && (hw->mac.type == e1000_82580))
+- wr32(E1000_MDICNFG, 0);
+-
+ /* Set mta register count */
+ mac->mta_reg_count = 128;
+ /* Set rar entry count */
+@@ -229,18 +251,20 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
+ phy->reset_delay_us = 100;
+
+ /* PHY function pointers */
+- if (igb_sgmii_active_82575(hw)) {
+- phy->ops.reset = igb_phy_hw_reset_sgmii_82575;
+- phy->ops.read_reg = igb_read_phy_reg_sgmii_82575;
+- phy->ops.write_reg = igb_write_phy_reg_sgmii_82575;
++ if (igb_sgmii_active_82575(hw))
++ phy->ops.reset = igb_phy_hw_reset_sgmii_82575;
++ else
++ phy->ops.reset = igb_phy_hw_reset;
++
++ if (igb_sgmii_active_82575(hw) && !igb_sgmii_uses_mdio_82575(hw)) {
++ phy->ops.read_reg = igb_read_phy_reg_sgmii_82575;
++ phy->ops.write_reg = igb_write_phy_reg_sgmii_82575;
+ } else if (hw->mac.type >= e1000_82580) {
+- phy->ops.reset = igb_phy_hw_reset;
+- phy->ops.read_reg = igb_read_phy_reg_82580;
+- phy->ops.write_reg = igb_write_phy_reg_82580;
++ phy->ops.read_reg = igb_read_phy_reg_82580;
++ phy->ops.write_reg = igb_write_phy_reg_82580;
+ } else {
+- phy->ops.reset = igb_phy_hw_reset;
+- phy->ops.read_reg = igb_read_phy_reg_igp;
+- phy->ops.write_reg = igb_write_phy_reg_igp;
++ phy->ops.read_reg = igb_read_phy_reg_igp;
++ phy->ops.write_reg = igb_write_phy_reg_igp;
+ }
+
+ /* set lan id */
+@@ -400,6 +424,7 @@ static s32 igb_get_phy_id_82575(struct e1000_hw *hw)
+ s32 ret_val = 0;
+ u16 phy_id;
+ u32 ctrl_ext;
++ u32 mdic;
+
+ /*
+ * For SGMII PHYs, we try the list of possible addresses until
+@@ -414,6 +439,29 @@ static s32 igb_get_phy_id_82575(struct e1000_hw *hw)
+ goto out;
+ }
+
++ if (igb_sgmii_uses_mdio_82575(hw)) {
++ switch (hw->mac.type) {
++ case e1000_82575:
++ case e1000_82576:
++ mdic = rd32(E1000_MDIC);
++ mdic &= E1000_MDIC_PHY_MASK;
++ phy->addr = mdic >> E1000_MDIC_PHY_SHIFT;
++ break;
++ case e1000_82580:
++ case e1000_i350:
++ mdic = rd32(E1000_MDICNFG);
++ mdic &= E1000_MDICNFG_PHY_MASK;
++ phy->addr = mdic >> E1000_MDICNFG_PHY_SHIFT;
++ break;
++ default:
++ ret_val = -E1000_ERR_PHY;
++ goto out;
++ break;
++ }
++ ret_val = igb_get_phy_id(hw);
++ goto out;
++ }
++
+ /* Power on sgmii phy if it is disabled */
+ ctrl_ext = rd32(E1000_CTRL_EXT);
+ wr32(E1000_CTRL_EXT, ctrl_ext & ~E1000_CTRL_EXT_SDP3_DATA);
+diff --git a/drivers/net/igb/e1000_defines.h b/drivers/net/igb/e1000_defines.h
+index 90bc29d..1d4767f 100644
+--- a/drivers/net/igb/e1000_defines.h
++++ b/drivers/net/igb/e1000_defines.h
+@@ -468,6 +468,11 @@
+
+ #define E1000_TIMINCA_16NS_SHIFT 24
+
++#define E1000_MDICNFG_EXT_MDIO 0x80000000 /* MDI ext/int destination */
++#define E1000_MDICNFG_COM_MDIO 0x40000000 /* MDI shared w/ lan 0 */
++#define E1000_MDICNFG_PHY_MASK 0x03E00000
++#define E1000_MDICNFG_PHY_SHIFT 21
++
+ /* PCI Express Control */
+ #define E1000_GCR_CMPL_TMOUT_MASK 0x0000F000
+ #define E1000_GCR_CMPL_TMOUT_10ms 0x00001000
+@@ -698,12 +703,17 @@
+ #define M88EC018_EPSCR_DOWNSHIFT_COUNTER_5X 0x0800
+
+ /* MDI Control */
++#define E1000_MDIC_DATA_MASK 0x0000FFFF
++#define E1000_MDIC_REG_MASK 0x001F0000
+ #define E1000_MDIC_REG_SHIFT 16
++#define E1000_MDIC_PHY_MASK 0x03E00000
+ #define E1000_MDIC_PHY_SHIFT 21
+ #define E1000_MDIC_OP_WRITE 0x04000000
+ #define E1000_MDIC_OP_READ 0x08000000
+ #define E1000_MDIC_READY 0x10000000
++#define E1000_MDIC_INT_EN 0x20000000
+ #define E1000_MDIC_ERROR 0x40000000
++#define E1000_MDIC_DEST 0x80000000
+
+ /* SerDes Control */
+ #define E1000_GEN_CTL_READY 0x80000000
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0142-igb-restore-EEPROM-values-of-MDICNFG-on-reset-with-8.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0142-igb-restore-EEPROM-values-of-MDICNFG-on-reset-with-8.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,98 @@
+From: Nick Nunley <nicholas.d.nunley at intel.com>
+Date: Mon, 26 Jul 2010 13:15:29 +0000
+Subject: [PATCH 142/165] igb: restore EEPROM values of MDICNFG on reset with
+ 82580
+
+commit 08451e2587dc8d8c34cbbb8edc88a6e4fa8946e6 upstream.
+
+On a reset the MDICNFG.Destination and MDICNFG.COM_MDIO
+register fields are not restored to the EEPROM default.
+This patch modifies the reset code to read the EEPROM
+and restore the default values.
+
+Signed-off-by: Nicholas Nunley <nicholas.d.nunley at intel.com>
+Tested-by: Jeff Pieper <jeffrey.e.pieper at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/e1000_82575.c | 41 +++++++++++++++++++++++++++++++++++++++
+ drivers/net/igb/e1000_defines.h | 4 +++
+ 2 files changed, 45 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c
+index 2971438..cc58227 100644
+--- a/drivers/net/igb/e1000_82575.c
++++ b/drivers/net/igb/e1000_82575.c
+@@ -1549,6 +1549,43 @@ out:
+ }
+
+ /**
++ * igb_reset_mdicnfg_82580 - Reset MDICNFG destination and com_mdio bits
++ * @hw: pointer to the HW structure
++ *
++ * This resets the the MDICNFG.Destination and MDICNFG.Com_MDIO bits based on
++ * the values found in the EEPROM. This addresses an issue in which these
++ * bits are not restored from EEPROM after reset.
++ **/
++static s32 igb_reset_mdicnfg_82580(struct e1000_hw *hw)
++{
++ s32 ret_val = 0;
++ u32 mdicnfg;
++ u16 nvm_data;
++
++ if (hw->mac.type != e1000_82580)
++ goto out;
++ if (!igb_sgmii_active_82575(hw))
++ goto out;
++
++ ret_val = hw->nvm.ops.read(hw, NVM_INIT_CONTROL3_PORT_A +
++ NVM_82580_LAN_FUNC_OFFSET(hw->bus.func), 1,
++ &nvm_data);
++ if (ret_val) {
++ hw_dbg("NVM Read Error\n");
++ goto out;
++ }
++
++ mdicnfg = rd32(E1000_MDICNFG);
++ if (nvm_data & NVM_WORD24_EXT_MDIO)
++ mdicnfg |= E1000_MDICNFG_EXT_MDIO;
++ if (nvm_data & NVM_WORD24_COM_MDIO)
++ mdicnfg |= E1000_MDICNFG_COM_MDIO;
++ wr32(E1000_MDICNFG, mdicnfg);
++out:
++ return ret_val;
++}
++
++/**
+ * igb_reset_hw_82580 - Reset hardware
+ * @hw: pointer to the HW structure
+ *
+@@ -1623,6 +1660,10 @@ static s32 igb_reset_hw_82580(struct e1000_hw *hw)
+ wr32(E1000_IMC, 0xffffffff);
+ icr = rd32(E1000_ICR);
+
++ ret_val = igb_reset_mdicnfg_82580(hw);
++ if (ret_val)
++ hw_dbg("Could not reset MDICNFG based on EEPROM\n");
++
+ /* Install any alternate MAC address into RAR0 */
+ ret_val = igb_check_alt_mac_addr(hw);
+
+diff --git a/drivers/net/igb/e1000_defines.h b/drivers/net/igb/e1000_defines.h
+index 1d4767f..bbd2ec3 100644
+--- a/drivers/net/igb/e1000_defines.h
++++ b/drivers/net/igb/e1000_defines.h
+@@ -570,6 +570,10 @@
+
+ #define NVM_82580_LAN_FUNC_OFFSET(a) (a ? (0x40 + (0x40 * a)) : 0)
+
++/* Mask bits for fields in Word 0x24 of the NVM */
++#define NVM_WORD24_COM_MDIO 0x0008 /* MDIO interface shared */
++#define NVM_WORD24_EXT_MDIO 0x0004 /* MDIO accesses routed external */
++
+ /* Mask bits for fields in Word 0x0f of the NVM */
+ #define NVM_WORD0F_PAUSE_MASK 0x3000
+ #define NVM_WORD0F_ASM_DIR 0x2000
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0143-igbvf-ixgbevf-use-dev_hw_addr_random.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0143-igbvf-ixgbevf-use-dev_hw_addr_random.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,33 @@
+From: Stefan Assmann <sassmann at redhat.com>
+Date: Mon, 26 Jul 2010 23:24:50 +0000
+Subject: [PATCH 143/165] igbvf, ixgbevf: use dev_hw_addr_random
+
+commit 2c6952dfdda2f266f2f501792b8d6413caf25f7a upstream.
+
+Both igbvf and ixgbevf should set addr_assign_type to NET_ADDR_RANDOM
+so udev creates persistent net rules by matching the device path.
+Do this by using the dev_hw_addr_random helper function.
+
+Signed-off-by: Stefan Assmann <sassmann at redhat.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Restricted to drivers/net/igbvf]
+---
+ drivers/net/igbvf/netdev.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
+index a82d000..92fee61 100644
+--- a/drivers/net/igbvf/netdev.c
++++ b/drivers/net/igbvf/netdev.c
+@@ -2750,7 +2750,7 @@ static int __devinit igbvf_probe(struct pci_dev *pdev,
+ dev_info(&pdev->dev,
+ "PF still in reset state, assigning new address."
+ " Is the PF interface up?\n");
+- random_ether_addr(hw->mac.addr);
++ dev_hw_addr_random(adapter->netdev, hw->mac.addr);
+ } else {
+ err = hw->mac.ops.read_mac_addr(hw);
+ if (err) {
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0144-igb-Use-irq_synchronize-per-vector-when-using-MSI-X.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0144-igb-Use-irq_synchronize-per-vector-when-using-MSI-X.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,40 @@
+From: Emil Tantilov <emil.s.tantilov at intel.com>
+Date: Mon, 2 Aug 2010 14:40:52 +0000
+Subject: [PATCH 144/165] igb: Use irq_synchronize per vector when using MSI-X
+
+commit 81a618595a29af6aec615d093feac65ee7329b74 upstream.
+
+Synchronize all IRQs when using MSI-X. Similar to ixgbe.
+Issue was reported on e1000e, but the patch is also valid for igb.
+
+CC: Jean Delvare <jdelvare at suse.de>
+Signed-off-by: Emil Tantilov <emil.s.tantilov at intel.com>
+Tested-by: Jeff Pieper <jeffrey.e.pieper at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 8 +++++++-
+ 1 files changed, 7 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 8929f32..6ae5d5a 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -1284,7 +1284,13 @@ static void igb_irq_disable(struct igb_adapter *adapter)
+ wr32(E1000_IAM, 0);
+ wr32(E1000_IMC, ~0);
+ wrfl();
+- synchronize_irq(adapter->pdev->irq);
++ if (adapter->msix_entries) {
++ int i;
++ for (i = 0; i < adapter->num_q_vectors; i++)
++ synchronize_irq(adapter->msix_entries[i].vector);
++ } else {
++ synchronize_irq(adapter->pdev->irq);
++ }
+ }
+
+ /**
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0145-igb-Program-MDICNFG-register-prior-to-PHY-init.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0145-igb-Program-MDICNFG-register-prior-to-PHY-init.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,78 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Tue, 3 Aug 2010 11:50:08 +0000
+Subject: [PATCH 145/165] igb: Program MDICNFG register prior to PHY init
+
+commit 99870a73d406e5bd235bc8e5aca6893a68184881 upstream.
+
+This patch addresses an issue seen on 82580 in which the MDICNFG
+register will be reset during a single function reset and as a
+result we will be unable to communicate with the PHY. To correct
+the issue, added a call to reset_mdicnfg just prior to the first
+access of the MDICNFG register in sgnii_uses_mdio.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Tested-by: Jeff Pieper <jeffrey.e.pieper at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/e1000_82575.c | 18 +++++++++++-------
+ 1 files changed, 11 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c
+index cc58227..187622f 100644
+--- a/drivers/net/igb/e1000_82575.c
++++ b/drivers/net/igb/e1000_82575.c
+@@ -63,6 +63,7 @@ static bool igb_sgmii_active_82575(struct e1000_hw *);
+ static s32 igb_reset_init_script_82575(struct e1000_hw *);
+ static s32 igb_read_mac_addr_82575(struct e1000_hw *);
+ static s32 igb_set_pcie_completion_timeout(struct e1000_hw *hw);
++static s32 igb_reset_mdicnfg_82580(struct e1000_hw *hw);
+
+ static const u16 e1000_82580_rxpbs_table[] =
+ { 36, 72, 144, 1, 2, 4, 8, 16,
+@@ -159,20 +160,15 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
+ switch (ctrl_ext & E1000_CTRL_EXT_LINK_MODE_MASK) {
+ case E1000_CTRL_EXT_LINK_MODE_SGMII:
+ dev_spec->sgmii_active = true;
+- ctrl_ext |= E1000_CTRL_I2C_ENA;
+ break;
+ case E1000_CTRL_EXT_LINK_MODE_1000BASE_KX:
+ case E1000_CTRL_EXT_LINK_MODE_PCIE_SERDES:
+ hw->phy.media_type = e1000_media_type_internal_serdes;
+- ctrl_ext |= E1000_CTRL_I2C_ENA;
+ break;
+ default:
+- ctrl_ext &= ~E1000_CTRL_I2C_ENA;
+ break;
+ }
+
+- wr32(E1000_CTRL_EXT, ctrl_ext);
+-
+ /* Set mta register count */
+ mac->mta_reg_count = 128;
+ /* Set rar entry count */
+@@ -250,11 +246,19 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
+ phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT;
+ phy->reset_delay_us = 100;
+
++ ctrl_ext = rd32(E1000_CTRL_EXT);
++
+ /* PHY function pointers */
+- if (igb_sgmii_active_82575(hw))
++ if (igb_sgmii_active_82575(hw)) {
+ phy->ops.reset = igb_phy_hw_reset_sgmii_82575;
+- else
++ ctrl_ext |= E1000_CTRL_I2C_ENA;
++ } else {
+ phy->ops.reset = igb_phy_hw_reset;
++ ctrl_ext &= ~E1000_CTRL_I2C_ENA;
++ }
++
++ wr32(E1000_CTRL_EXT, ctrl_ext);
++ igb_reset_mdicnfg_82580(hw);
+
+ if (igb_sgmii_active_82575(hw) && !igb_sgmii_uses_mdio_82575(hw)) {
+ phy->ops.read_reg = igb_read_phy_reg_sgmii_82575;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0146-e100-e1000-igb-ixgb-Add-missing-read-memory-barrier.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0146-e100-e1000-igb-ixgb-Add-missing-read-memory-barrier.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,94 @@
+From: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Date: Sun, 8 Aug 2010 16:02:31 +0000
+Subject: [PATCH 146/165] e100/e1000*/igb*/ixgb*: Add missing read memory
+ barrier
+
+commit 2d0bb1c1f4524befe9f0fcf0d0cd3081a451223f upstream.
+
+Based on patches from Sonny Rao and Milton Miller...
+
+Combined the patches to fix up clean_tx_irq and clean_rx_irq.
+
+The PowerPC architecture does not require loads to independent bytes
+to be ordered without adding an explicit barrier.
+
+In ixgbe_clean_rx_irq we load the status bit then load the packet data.
+With packet split disabled if these loads go out of order we get a
+stale packet, but we will notice the bad sequence numbers and drop it.
+
+The problem occurs with packet split enabled where the TCP/IP header
+and data are in different descriptors. If the reads go out of order
+we may have data that doesn't match the TCP/IP header. Since we use
+hardware checksumming this bad data is never verified and it makes it
+all the way to the application.
+
+This bug was found during stress testing and adding this barrier has
+been shown to fix it. The bug can manifest as a data integrity issue
+(bad payload data) or as a BUG in skb_pull().
+
+This was a nasty bug to hunt down, if people agree with the fix I think
+it's a candidate for stable.
+
+Previously Submitted to e1000-devel only for ixgbe
+
+http://marc.info/?l=e1000-devel&m=126593062701537&w=3
+
+We've now seen this problem hit with other device drivers (e1000e mostly)
+So I'm resubmitting with fixes for other Intel Device Drivers with
+similar issues.
+
+CC: Milton Miller <miltonm at bga.com>
+CC: Anton Blanchard <anton at samba.org>
+CC: Sonny Rao <sonnyrao at us.ibm.com>
+CC: stable <stable at kernel.org>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Restricted to drivers/net/igb{,vf}]
+---
+ drivers/net/igb/igb_main.c | 2 ++
+ drivers/net/igbvf/netdev.c | 2 ++
+ 2 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 6ae5d5a..7858a95 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -5281,6 +5281,7 @@ static bool igb_clean_tx_irq(struct igb_q_vector *q_vector)
+
+ while ((eop_desc->wb.status & cpu_to_le32(E1000_TXD_STAT_DD)) &&
+ (count < tx_ring->count)) {
++ rmb(); /* read buffer_info after eop_desc status */
+ for (cleaned = false; !cleaned; count++) {
+ tx_desc = E1000_TX_DESC_ADV(*tx_ring, i);
+ buffer_info = &tx_ring->buffer_info[i];
+@@ -5486,6 +5487,7 @@ static bool igb_clean_rx_irq_adv(struct igb_q_vector *q_vector,
+ if (*work_done >= budget)
+ break;
+ (*work_done)++;
++ rmb(); /* read descriptor and rx_buffer_info after status DD */
+
+ skb = buffer_info->skb;
+ prefetch(skb->data - NET_IP_ALIGN);
+diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
+index 92fee61..8e44547 100644
+--- a/drivers/net/igbvf/netdev.c
++++ b/drivers/net/igbvf/netdev.c
+@@ -247,6 +247,7 @@ static bool igbvf_clean_rx_irq(struct igbvf_adapter *adapter,
+ if (*work_done >= work_to_do)
+ break;
+ (*work_done)++;
++ rmb(); /* read descriptor and rx_buffer_info after status DD */
+
+ buffer_info = &rx_ring->buffer_info[i];
+
+@@ -779,6 +780,7 @@ static bool igbvf_clean_tx_irq(struct igbvf_ring *tx_ring)
+
+ while ((eop_desc->wb.status & cpu_to_le32(E1000_TXD_STAT_DD)) &&
+ (count < tx_ring->count)) {
++ rmb(); /* read buffer_info after eop_desc status */
+ for (cleaned = false; !cleaned; count++) {
+ tx_desc = IGBVF_TX_DESC_ADV(*tx_ring, i);
+ buffer_info = &tx_ring->buffer_info[i];
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0147-Fix-spelling-fuction-function-in-comments.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0147-Fix-spelling-fuction-function-in-comments.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,40 @@
+From: Stefan Weil <weil at mail.berlios.de>
+Date: Fri, 6 Aug 2010 21:11:15 +0200
+Subject: [PATCH 147/165] Fix spelling fuction -> function in comments
+
+commit eef35c2d41ddcc653c20d26b977acaa45c811e1f upstream.
+
+To avoid more patches, I also fixed other spelling
+and grammar bugs when they were in the same or
+following line:
+
+successfull -> successful
+parse -> parses
+controler -> controller
+controlers -> controllers
+
+Cc: Jiri Kosina <trivial at kernel.org>
+Cc: linux-kernel at vger.kernel.org
+Signed-off-by: Stefan Weil <weil at mail.berlios.de>
+Signed-off-by: Jiri Kosina <jkosina at suse.cz>
+[bwh: Restricted to drivers/net/igb{,vf}]
+---
+ drivers/net/igb/igb_main.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 7858a95..17838d3 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -3512,7 +3512,7 @@ enum latency_range {
+ * Stores a new ITR value based on strictly on packet size. This
+ * algorithm is less sophisticated than that used in igb_update_itr,
+ * due to the difficulty of synchronizing statistics across multiple
+- * receive rings. The divisors and thresholds used by this fuction
++ * receive rings. The divisors and thresholds used by this function
+ * were determined based on theoretical maximum wire speed and testing
+ * data, in order to minimize response time while increasing bulk
+ * throughput.
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0148-drivers-net-Remove-address-use-from-assignments-of-f.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0148-drivers-net-Remove-address-use-from-assignments-of-f.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,57 @@
+From: Joe Perches <joe at perches.com>
+Date: Mon, 23 Aug 2010 18:20:03 +0000
+Subject: [PATCH 148/165] drivers/net: Remove address use from assignments of
+ function pointers
+
+commit c061b18df0f1fe3f50fe451dbbdc9ede3c19701a upstream.
+
+"foo = &function" is more commonly written "foo = function"
+
+Done with coccinelle script:
+
+// <smpl>
+ at r@
+identifier f;
+@@
+
+f(...) { ... }
+
+@@
+identifier r.f;
+@@
+
+- &f
++ f
+// </smpl>
+
+drivers/net/tehuti.c used a function and struct with the
+same name, the function was renamed.
+
+Compile tested x86 only.
+
+Signed-off-by: Joe Perches <joe at perches.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Restricted to drivers/net/igb{,vf}]
+---
+ drivers/net/igb/igb_main.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 17838d3..b7013c2 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -1878,9 +1878,9 @@ static int __devinit igb_probe(struct pci_dev *pdev,
+ goto err_eeprom;
+ }
+
+- setup_timer(&adapter->watchdog_timer, &igb_watchdog,
++ setup_timer(&adapter->watchdog_timer, igb_watchdog,
+ (unsigned long) adapter);
+- setup_timer(&adapter->phy_info_timer, &igb_update_phy_info,
++ setup_timer(&adapter->phy_info_timer, igb_update_phy_info,
+ (unsigned long) adapter);
+
+ INIT_WORK(&adapter->reset_task, igb_reset_task);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0149-igb-clear-VF_PROMISC-bits-instead-of-setting-all-oth.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0149-igb-clear-VF_PROMISC-bits-instead-of-setting-all-oth.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,41 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Wed, 22 Sep 2010 17:56:20 +0000
+Subject: [PATCH 149/165] igb: clear VF_PROMISC bits instead of setting all
+ other bits
+
+commit d85b9004bc2047d79248b167cc151ff9a4b509c3 upstream.
+
+This change corrects an issue in which we were setting all flag bits except
+for promisc instead of clearing the promisc bits due to the incorrect use
+of an |= instead of an &=.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Tested-by: Jeff Pieper <jeffrey.e.pieper at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 3 ++-
+ 1 files changed, 2 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index b7013c2..24a917d 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -4645,12 +4645,13 @@ static int igb_set_vf_promisc(struct igb_adapter *adapter, u32 *msgbuf, u32 vf)
+ u32 vmolr = rd32(E1000_VMOLR(vf));
+ struct vf_data_storage *vf_data = &adapter->vf_data[vf];
+
+- vf_data->flags |= ~(IGB_VF_FLAG_UNI_PROMISC |
++ vf_data->flags &= ~(IGB_VF_FLAG_UNI_PROMISC |
+ IGB_VF_FLAG_MULTI_PROMISC);
+ vmolr &= ~(E1000_VMOLR_ROPE | E1000_VMOLR_ROMPE | E1000_VMOLR_MPME);
+
+ if (*msgbuf & E1000_VF_SET_PROMISC_MULTICAST) {
+ vmolr |= E1000_VMOLR_MPME;
++ vf_data->flags |= IGB_VF_FLAG_MULTI_PROMISC;
+ *msgbuf &= ~E1000_VF_SET_PROMISC_MULTICAST;
+ } else {
+ /*
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0150-igb-Add-support-for-DH89xxCC.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0150-igb-Add-support-for-DH89xxCC.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,401 @@
+From: Joseph Gasparakis <joseph.gasparakis at intel.com>
+Date: Wed, 22 Sep 2010 17:56:44 +0000
+Subject: [PATCH 150/165] igb: Add support for DH89xxCC
+
+commit 308fb39a860c816be8741fe783ae7c64e9c1af5d upstream.
+
+This patch adds support for the Intel(r) DH89xxCC series. The new
+device will be using Intel(r) i347-AT4 and Marvell(r) M88E1322 and
+M88E1112 PHYs. Support for these devices has also been added here.
+
+Signed-off-by: Joseph Gasparakis <joseph.gasparakis at intel.com>
+Tested-by: Jeff Pieper <jeffrey.e.pieper at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/e1000_82575.c | 18 +++-
+ drivers/net/igb/e1000_defines.h | 31 ++++++
+ drivers/net/igb/e1000_hw.h | 2 +
+ drivers/net/igb/e1000_phy.c | 206 ++++++++++++++++++++++++++++++++++++---
+ drivers/net/igb/e1000_phy.h | 2 +
+ drivers/net/igb/igb_main.c | 2 +
+ 6 files changed, 247 insertions(+), 14 deletions(-)
+
+diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c
+index 187622f..bc183f5 100644
+--- a/drivers/net/igb/e1000_82575.c
++++ b/drivers/net/igb/e1000_82575.c
+@@ -132,6 +132,8 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
+ case E1000_DEV_ID_82580_SERDES:
+ case E1000_DEV_ID_82580_SGMII:
+ case E1000_DEV_ID_82580_COPPER_DUAL:
++ case E1000_DEV_ID_DH89XXCC_SGMII:
++ case E1000_DEV_ID_DH89XXCC_SERDES:
+ mac->type = e1000_82580;
+ break;
+ case E1000_DEV_ID_I350_COPPER:
+@@ -282,10 +284,18 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
+
+ /* Verify phy id and set remaining function pointers */
+ switch (phy->id) {
++ case I347AT4_E_PHY_ID:
++ case M88E1112_E_PHY_ID:
+ case M88E1111_I_PHY_ID:
+ phy->type = e1000_phy_m88;
+ phy->ops.get_phy_info = igb_get_phy_info_m88;
+- phy->ops.get_cable_length = igb_get_cable_length_m88;
++
++ if (phy->id == I347AT4_E_PHY_ID ||
++ phy->id == M88E1112_E_PHY_ID)
++ phy->ops.get_cable_length = igb_get_cable_length_m88_gen2;
++ else
++ phy->ops.get_cable_length = igb_get_cable_length_m88;
++
+ phy->ops.force_speed_duplex = igb_phy_force_speed_duplex_m88;
+ break;
+ case IGP03E1000_E_PHY_ID:
+@@ -1058,7 +1068,11 @@ static s32 igb_setup_copper_link_82575(struct e1000_hw *hw)
+ }
+ switch (hw->phy.type) {
+ case e1000_phy_m88:
+- ret_val = igb_copper_link_setup_m88(hw);
++ if (hw->phy.id == I347AT4_E_PHY_ID ||
++ hw->phy.id == M88E1112_E_PHY_ID)
++ ret_val = igb_copper_link_setup_m88_gen2(hw);
++ else
++ ret_val = igb_copper_link_setup_m88(hw);
+ break;
+ case e1000_phy_igp_3:
+ ret_val = igb_copper_link_setup_igp(hw);
+diff --git a/drivers/net/igb/e1000_defines.h b/drivers/net/igb/e1000_defines.h
+index bbd2ec3..6222279 100644
+--- a/drivers/net/igb/e1000_defines.h
++++ b/drivers/net/igb/e1000_defines.h
+@@ -634,6 +634,8 @@
+ * E = External
+ */
+ #define M88E1111_I_PHY_ID 0x01410CC0
++#define M88E1112_E_PHY_ID 0x01410C90
++#define I347AT4_E_PHY_ID 0x01410DC0
+ #define IGP03E1000_E_PHY_ID 0x02A80390
+ #define I82580_I_PHY_ID 0x015403A0
+ #define I350_I_PHY_ID 0x015403B0
+@@ -702,6 +704,35 @@
+ #define M88E1000_EPSCR_SLAVE_DOWNSHIFT_1X 0x0100
+ #define M88E1000_EPSCR_TX_CLK_25 0x0070 /* 25 MHz TX_CLK */
+
++/* Intel i347-AT4 Registers */
++
++#define I347AT4_PCDL 0x10 /* PHY Cable Diagnostics Length */
++#define I347AT4_PCDC 0x15 /* PHY Cable Diagnostics Control */
++#define I347AT4_PAGE_SELECT 0x16
++
++/* i347-AT4 Extended PHY Specific Control Register */
++
++/*
++ * Number of times we will attempt to autonegotiate before downshifting if we
++ * are the master
++ */
++#define I347AT4_PSCR_DOWNSHIFT_ENABLE 0x0800
++#define I347AT4_PSCR_DOWNSHIFT_MASK 0x7000
++#define I347AT4_PSCR_DOWNSHIFT_1X 0x0000
++#define I347AT4_PSCR_DOWNSHIFT_2X 0x1000
++#define I347AT4_PSCR_DOWNSHIFT_3X 0x2000
++#define I347AT4_PSCR_DOWNSHIFT_4X 0x3000
++#define I347AT4_PSCR_DOWNSHIFT_5X 0x4000
++#define I347AT4_PSCR_DOWNSHIFT_6X 0x5000
++#define I347AT4_PSCR_DOWNSHIFT_7X 0x6000
++#define I347AT4_PSCR_DOWNSHIFT_8X 0x7000
++
++/* i347-AT4 PHY Cable Diagnostics Control */
++#define I347AT4_PCDC_CABLE_LENGTH_UNIT 0x0400 /* 0=cm 1=meters */
++
++/* Marvell 1112 only registers */
++#define M88E1112_VCT_DSP_DISTANCE 0x001A
++
+ /* M88EC018 Rev 2 specific DownShift settings */
+ #define M88EC018_EPSCR_DOWNSHIFT_COUNTER_MASK 0x0E00
+ #define M88EC018_EPSCR_DOWNSHIFT_COUNTER_5X 0x0800
+diff --git a/drivers/net/igb/e1000_hw.h b/drivers/net/igb/e1000_hw.h
+index cb8db78..c0b017f 100644
+--- a/drivers/net/igb/e1000_hw.h
++++ b/drivers/net/igb/e1000_hw.h
+@@ -54,6 +54,8 @@ struct e1000_hw;
+ #define E1000_DEV_ID_82580_SERDES 0x1510
+ #define E1000_DEV_ID_82580_SGMII 0x1511
+ #define E1000_DEV_ID_82580_COPPER_DUAL 0x1516
++#define E1000_DEV_ID_DH89XXCC_SGMII 0x0436
++#define E1000_DEV_ID_DH89XXCC_SERDES 0x0438
+ #define E1000_DEV_ID_I350_COPPER 0x1521
+ #define E1000_DEV_ID_I350_FIBER 0x1522
+ #define E1000_DEV_ID_I350_SERDES 0x1523
+diff --git a/drivers/net/igb/e1000_phy.c b/drivers/net/igb/e1000_phy.c
+index cf1f323..ddd036a 100644
+--- a/drivers/net/igb/e1000_phy.c
++++ b/drivers/net/igb/e1000_phy.c
+@@ -570,6 +570,89 @@ out:
+ }
+
+ /**
++ * igb_copper_link_setup_m88_gen2 - Setup m88 PHY's for copper link
++ * @hw: pointer to the HW structure
++ *
++ * Sets up MDI/MDI-X and polarity for i347-AT4, m88e1322 and m88e1112 PHY's.
++ * Also enables and sets the downshift parameters.
++ **/
++s32 igb_copper_link_setup_m88_gen2(struct e1000_hw *hw)
++{
++ struct e1000_phy_info *phy = &hw->phy;
++ s32 ret_val;
++ u16 phy_data;
++
++ if (phy->reset_disable) {
++ ret_val = 0;
++ goto out;
++ }
++
++ /* Enable CRS on Tx. This must be set for half-duplex operation. */
++ ret_val = phy->ops.read_reg(hw, M88E1000_PHY_SPEC_CTRL, &phy_data);
++ if (ret_val)
++ goto out;
++
++ /*
++ * Options:
++ * MDI/MDI-X = 0 (default)
++ * 0 - Auto for all speeds
++ * 1 - MDI mode
++ * 2 - MDI-X mode
++ * 3 - Auto for 1000Base-T only (MDI-X for 10/100Base-T modes)
++ */
++ phy_data &= ~M88E1000_PSCR_AUTO_X_MODE;
++
++ switch (phy->mdix) {
++ case 1:
++ phy_data |= M88E1000_PSCR_MDI_MANUAL_MODE;
++ break;
++ case 2:
++ phy_data |= M88E1000_PSCR_MDIX_MANUAL_MODE;
++ break;
++ case 3:
++ /* M88E1112 does not support this mode) */
++ if (phy->id != M88E1112_E_PHY_ID) {
++ phy_data |= M88E1000_PSCR_AUTO_X_1000T;
++ break;
++ }
++ case 0:
++ default:
++ phy_data |= M88E1000_PSCR_AUTO_X_MODE;
++ break;
++ }
++
++ /*
++ * Options:
++ * disable_polarity_correction = 0 (default)
++ * Automatic Correction for Reversed Cable Polarity
++ * 0 - Disabled
++ * 1 - Enabled
++ */
++ phy_data &= ~M88E1000_PSCR_POLARITY_REVERSAL;
++ if (phy->disable_polarity_correction == 1)
++ phy_data |= M88E1000_PSCR_POLARITY_REVERSAL;
++
++ /* Enable downshift and setting it to X6 */
++ phy_data &= ~I347AT4_PSCR_DOWNSHIFT_MASK;
++ phy_data |= I347AT4_PSCR_DOWNSHIFT_6X;
++ phy_data |= I347AT4_PSCR_DOWNSHIFT_ENABLE;
++
++ ret_val = phy->ops.write_reg(hw, M88E1000_PHY_SPEC_CTRL, phy_data);
++ if (ret_val)
++ goto out;
++
++ /* Commit the changes. */
++ ret_val = igb_phy_sw_reset(hw);
++ if (ret_val) {
++ hw_dbg("Error committing the PHY changes\n");
++ goto out;
++ }
++
++out:
++ return ret_val;
++}
++
++/**
+ * igb_copper_link_setup_igp - Setup igp PHY's for copper link
+ * @hw: pointer to the HW structure
+ *
+@@ -1124,18 +1207,25 @@ s32 igb_phy_force_speed_duplex_m88(struct e1000_hw *hw)
+ goto out;
+
+ if (!link) {
+- /*
+- * We didn't get link.
+- * Reset the DSP and cross our fingers.
+- */
+- ret_val = phy->ops.write_reg(hw,
+- M88E1000_PHY_PAGE_SELECT,
+- 0x001d);
+- if (ret_val)
+- goto out;
+- ret_val = igb_phy_reset_dsp(hw);
+- if (ret_val)
+- goto out;
++ if (hw->phy.type != e1000_phy_m88 ||
++ hw->phy.id == I347AT4_E_PHY_ID ||
++ hw->phy.id == M88E1112_E_PHY_ID) {
++ hw_dbg("Link taking longer than expected.\n");
++ } else {
++
++ /*
++ * We didn't get link.
++ * Reset the DSP and cross our fingers.
++ */
++ ret_val = phy->ops.write_reg(hw,
++ M88E1000_PHY_PAGE_SELECT,
++ 0x001d);
++ if (ret_val)
++ goto out;
++ ret_val = igb_phy_reset_dsp(hw);
++ if (ret_val)
++ goto out;
++ }
+ }
+
+ /* Try once more */
+@@ -1145,6 +1235,11 @@ s32 igb_phy_force_speed_duplex_m88(struct e1000_hw *hw)
+ goto out;
+ }
+
++ if (hw->phy.type != e1000_phy_m88 ||
++ hw->phy.id == I347AT4_E_PHY_ID ||
++ hw->phy.id == M88E1112_E_PHY_ID)
++ goto out;
++
+ ret_val = phy->ops.read_reg(hw, M88E1000_EXT_PHY_SPEC_CTRL, &phy_data);
+ if (ret_val)
+ goto out;
+@@ -1557,6 +1652,93 @@ out:
+ return ret_val;
+ }
+
++s32 igb_get_cable_length_m88_gen2(struct e1000_hw *hw)
++{
++ struct e1000_phy_info *phy = &hw->phy;
++ s32 ret_val;
++ u16 phy_data, phy_data2, index, default_page, is_cm;
++
++ switch (hw->phy.id) {
++ case I347AT4_E_PHY_ID:
++ /* Remember the original page select and set it to 7 */
++ ret_val = phy->ops.read_reg(hw, I347AT4_PAGE_SELECT,
++ &default_page);
++ if (ret_val)
++ goto out;
++
++ ret_val = phy->ops.write_reg(hw, I347AT4_PAGE_SELECT, 0x07);
++ if (ret_val)
++ goto out;
++
++ /* Get cable length from PHY Cable Diagnostics Control Reg */
++ ret_val = phy->ops.read_reg(hw, (I347AT4_PCDL + phy->addr),
++ &phy_data);
++ if (ret_val)
++ goto out;
++
++ /* Check if the unit of cable length is meters or cm */
++ ret_val = phy->ops.read_reg(hw, I347AT4_PCDC, &phy_data2);
++ if (ret_val)
++ goto out;
++
++ is_cm = !(phy_data & I347AT4_PCDC_CABLE_LENGTH_UNIT);
++
++ /* Populate the phy structure with cable length in meters */
++ phy->min_cable_length = phy_data / (is_cm ? 100 : 1);
++ phy->max_cable_length = phy_data / (is_cm ? 100 : 1);
++ phy->cable_length = phy_data / (is_cm ? 100 : 1);
++
++ /* Reset the page selec to its original value */
++ ret_val = phy->ops.write_reg(hw, I347AT4_PAGE_SELECT,
++ default_page);
++ if (ret_val)
++ goto out;
++ break;
++ case M88E1112_E_PHY_ID:
++ /* Remember the original page select and set it to 5 */
++ ret_val = phy->ops.read_reg(hw, I347AT4_PAGE_SELECT,
++ &default_page);
++ if (ret_val)
++ goto out;
++
++ ret_val = phy->ops.write_reg(hw, I347AT4_PAGE_SELECT, 0x05);
++ if (ret_val)
++ goto out;
++
++ ret_val = phy->ops.read_reg(hw, M88E1112_VCT_DSP_DISTANCE,
++ &phy_data);
++ if (ret_val)
++ goto out;
++
++ index = (phy_data & M88E1000_PSSR_CABLE_LENGTH) >>
++ M88E1000_PSSR_CABLE_LENGTH_SHIFT;
++ if (index >= M88E1000_CABLE_LENGTH_TABLE_SIZE - 1) {
++ ret_val = -E1000_ERR_PHY;
++ goto out;
++ }
++
++ phy->min_cable_length = e1000_m88_cable_length_table[index];
++ phy->max_cable_length = e1000_m88_cable_length_table[index + 1];
++
++ phy->cable_length = (phy->min_cable_length +
++ phy->max_cable_length) / 2;
++
++ /* Reset the page select to its original value */
++ ret_val = phy->ops.write_reg(hw, I347AT4_PAGE_SELECT,
++ default_page);
++ if (ret_val)
++ goto out;
++
++ break;
++ default:
++ ret_val = -E1000_ERR_PHY;
++ goto out;
++ }
++
++out:
++ return ret_val;
++}
++
+ /**
+ * igb_get_cable_length_igp_2 - Determine cable length for igp2 PHY
+ * @hw: pointer to the HW structure
+diff --git a/drivers/net/igb/e1000_phy.h b/drivers/net/igb/e1000_phy.h
+index 565a6db..2cc1177 100644
+--- a/drivers/net/igb/e1000_phy.h
++++ b/drivers/net/igb/e1000_phy.h
+@@ -45,9 +45,11 @@ s32 igb_check_downshift(struct e1000_hw *hw);
+ s32 igb_check_reset_block(struct e1000_hw *hw);
+ s32 igb_copper_link_setup_igp(struct e1000_hw *hw);
+ s32 igb_copper_link_setup_m88(struct e1000_hw *hw);
++s32 igb_copper_link_setup_m88_gen2(struct e1000_hw *hw);
+ s32 igb_phy_force_speed_duplex_igp(struct e1000_hw *hw);
+ s32 igb_phy_force_speed_duplex_m88(struct e1000_hw *hw);
+ s32 igb_get_cable_length_m88(struct e1000_hw *hw);
++s32 igb_get_cable_length_m88_gen2(struct e1000_hw *hw);
+ s32 igb_get_cable_length_igp_2(struct e1000_hw *hw);
+ s32 igb_get_phy_id(struct e1000_hw *hw);
+ s32 igb_get_phy_info_igp(struct e1000_hw *hw);
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 24a917d..b5d4ea5 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -71,6 +71,8 @@ static DEFINE_PCI_DEVICE_TABLE(igb_pci_tbl) = {
+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_82580_SERDES), board_82575 },
+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_82580_SGMII), board_82575 },
+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_82580_COPPER_DUAL), board_82575 },
++ { PCI_VDEVICE(INTEL, E1000_DEV_ID_DH89XXCC_SGMII), board_82575 },
++ { PCI_VDEVICE(INTEL, E1000_DEV_ID_DH89XXCC_SERDES), board_82575 },
+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576), board_82575 },
+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_NS), board_82575 },
+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_NS_SERDES), board_82575 },
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0151-e1000-e1000e-igb-ixgb-ixgbe-set-NETIF_F_HIGHDMA-for-.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0151-e1000-e1000e-igb-ixgb-ixgbe-set-NETIF_F_HIGHDMA-for-.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,43 @@
+From: Yi Zou <yi.zou at intel.com>
+Date: Wed, 22 Sep 2010 17:57:58 +0000
+Subject: [PATCH 151/165] e1000/e1000e/igb/ixgb/ixgbe: set NETIF_F_HIGHDMA for
+ VLAN feature flags
+
+commit 7b872a55c40b7e6f5e257c252f96dde911bd7b2f upstream.
+
+If the netdev->features is set with NETIF_F_HIGHDMA, we should set the
+corresponding netdev->vlan_features as well to allow VLAN netdev created
+on top of the real netdev to be able to also benefit from HIGHDMA on 32bit
+system, reducing the performance hit that is caused by __skb_linearize(),
+particularly for large send. This is fixed in this patch for all Intel e1000,
+e1000e, igb, ixgbe, and ixgbe drivers since this should be beneficial
+to all devices supported by these drivers.
+
+Signed-off-by: Yi Zou <yi.zou at intel.com>
+Tested-by: Emil Tantilov <emil.s.tantilov at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Restricted to drivers/net/igb]
+---
+ drivers/net/igb/igb_main.c | 4 +++-
+ 1 files changed, 3 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index b5d4ea5..d75280d 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -1848,8 +1848,10 @@ static int __devinit igb_probe(struct pci_dev *pdev,
+ netdev->vlan_features |= NETIF_F_IPV6_CSUM;
+ netdev->vlan_features |= NETIF_F_SG;
+
+- if (pci_using_dac)
++ if (pci_using_dac) {
+ netdev->features |= NETIF_F_HIGHDMA;
++ netdev->vlan_features |= NETIF_F_HIGHDMA;
++ }
+
+ if (hw->mac.type >= e1000_82576)
+ netdev->features |= NETIF_F_SCTP_CSUM;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0152-drivers-net-return-operator-cleanup.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0152-drivers-net-return-operator-cleanup.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,61 @@
+From: Eric Dumazet <eric.dumazet at gmail.com>
+Date: Thu, 23 Sep 2010 05:40:09 +0000
+Subject: [PATCH 152/165] drivers/net: return operator cleanup
+
+commit 807540baae406c84dcb9c1c8ef07a56d2d2ae84a upstream.
+
+Change "return (EXPR);" to "return EXPR;"
+
+return is not a function, parentheses are not required.
+
+Signed-off-by: Eric Dumazet <eric.dumazet at gmail.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Restricted to drivers/net/igb{,vf}]
+---
+ drivers/net/igb/igb_main.c | 2 +-
+ drivers/net/igbvf/ethtool.c | 2 +-
+ drivers/net/igbvf/netdev.c | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index d75280d..aba64f5 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -5364,7 +5364,7 @@ static bool igb_clean_tx_irq(struct igb_q_vector *q_vector)
+ tx_ring->total_packets += total_packets;
+ tx_ring->tx_stats.bytes += total_bytes;
+ tx_ring->tx_stats.packets += total_packets;
+- return (count < tx_ring->count);
++ return count < tx_ring->count;
+ }
+
+ /**
+diff --git a/drivers/net/igbvf/ethtool.c b/drivers/net/igbvf/ethtool.c
+index 103b3aa..33add70 100644
+--- a/drivers/net/igbvf/ethtool.c
++++ b/drivers/net/igbvf/ethtool.c
+@@ -153,7 +153,7 @@ static int igbvf_set_rx_csum(struct net_device *netdev, u32 data)
+
+ static u32 igbvf_get_tx_csum(struct net_device *netdev)
+ {
+- return ((netdev->features & NETIF_F_IP_CSUM) != 0);
++ return (netdev->features & NETIF_F_IP_CSUM) != 0;
+ }
+
+ static int igbvf_set_tx_csum(struct net_device *netdev, u32 data)
+diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
+index 8e44547..ec38aec 100644
+--- a/drivers/net/igbvf/netdev.c
++++ b/drivers/net/igbvf/netdev.c
+@@ -844,7 +844,7 @@ static bool igbvf_clean_tx_irq(struct igbvf_ring *tx_ring)
+ }
+ adapter->net_stats.tx_bytes += total_bytes;
+ adapter->net_stats.tx_packets += total_packets;
+- return (count < tx_ring->count);
++ return count < tx_ring->count;
+ }
+
+ static irqreturn_t igbvf_msix_other(int irq, void *data)
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0153-igb-add-check-for-fiber-serdes-devices-to-igb_set_sp.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0153-igb-add-check-for-fiber-serdes-devices-to-igb_set_sp.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,36 @@
+From: Carolyn Wyborny <carolyn.wyborny at intel.com>
+Date: Tue, 12 Oct 2010 22:27:02 +0000
+Subject: [PATCH 153/165] igb: add check for fiber/serdes devices to
+ igb_set_spd_dplx;
+
+commit cd2638a86c7b90e77ce623c09de2a26177f2a5c1 upstream.
+
+Signed-off-by: Carolyn Wyborny <carolyn.wyborny at intel.com>
+Tested-by: Emil Tantilov <emil.s.tantilov at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igb/igb_main.c | 7 +++++++
+ 1 files changed, 7 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index aba64f5..f869e8a 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -6040,6 +6040,13 @@ int igb_set_spd_dplx(struct igb_adapter *adapter, u16 spddplx)
+
+ mac->autoneg = 0;
+
++ /* Fiber NIC's only allow 1000 Gbps Full duplex */
++ if ((adapter->hw.phy.media_type == e1000_media_type_internal_serdes) &&
++ spddplx != (SPEED_1000 + DUPLEX_FULL)) {
++ dev_err(&pdev->dev, "Unsupported Speed/Duplex configuration\n");
++ return -EINVAL;
++ }
++
+ switch (spddplx) {
+ case SPEED_10 + DUPLEX_HALF:
+ mac->forced_speed_duplex = ADVERTISE_10_HALF;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0154-igbvf-Remove-unneeded-pm_qos-calls.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0154-igbvf-Remove-unneeded-pm_qos-calls.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,49 @@
+From: Greg Rose <gregory.v.rose at intel.com>
+Date: Fri, 15 Oct 2010 17:26:47 +0000
+Subject: [PATCH 154/165] igbvf: Remove unneeded pm_qos* calls
+
+commit a7714338aa9332e569b38c7643dc4a7bb37a0ff5 upstream.
+
+Power Management Quality of Service is not supported or used by the VF
+driver.
+
+Signed-off-by: Greg Rose <gregory.v.rose at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Adjust for omitted pm_qos API changes]
+---
+ drivers/net/igbvf/netdev.c | 4 ----
+ 1 files changed, 0 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
+index ec38aec..d1e589e 100644
+--- a/drivers/net/igbvf/netdev.c
++++ b/drivers/net/igbvf/netdev.c
+@@ -41,7 +41,6 @@
+ #include <linux/mii.h>
+ #include <linux/ethtool.h>
+ #include <linux/if_vlan.h>
+-#include <linux/pm_qos_params.h>
+
+ #include "igbvf.h"
+
+@@ -2903,8 +2902,6 @@ static int __init igbvf_init_module(void)
+ printk(KERN_INFO "%s\n", igbvf_copyright);
+
+ ret = pci_register_driver(&igbvf_driver);
+- pm_qos_add_requirement(PM_QOS_CPU_DMA_LATENCY, igbvf_driver_name,
+- PM_QOS_DEFAULT_VALUE);
+
+ return ret;
+ }
+@@ -2919,7 +2916,6 @@ module_init(igbvf_init_module);
+ static void __exit igbvf_exit_module(void)
+ {
+ pci_unregister_driver(&igbvf_driver);
+- pm_qos_remove_requirement(PM_QOS_CPU_DMA_LATENCY, igbvf_driver_name);
+ }
+ module_exit(igbvf_exit_module);
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0155-igbvf-fix-panic-on-load.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0155-igbvf-fix-panic-on-load.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,45 @@
+From: Emil Tantilov <emil.s.tantilov at intel.com>
+Date: Thu, 28 Oct 2010 00:59:51 +0000
+Subject: [PATCH 155/165] igbvf: fix panic on load
+
+commit de7fe7874dc55e8226245c50f07dec3c7b285044 upstream.
+
+Introduced by commit:e6484930d7c73d324bccda7d43d131088da697b9
+net: allocate tx queues in register_netdevice
+
+Signed-off-by: Emil Tantilov <emil.s.tantilov at intel.com>
+Acked-by: Greg Rose <greg.v.rose at intel.com>
+Tested-by: Jeff Pieper <jeffrey.e.pieper at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/igbvf/netdev.c | 8 ++++----
+ 1 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
+index d1e589e..c4462b4 100644
+--- a/drivers/net/igbvf/netdev.c
++++ b/drivers/net/igbvf/netdev.c
+@@ -2783,15 +2783,15 @@ static int __devinit igbvf_probe(struct pci_dev *pdev,
+ /* reset the hardware with the new settings */
+ igbvf_reset(adapter);
+
+- /* tell the stack to leave us alone until igbvf_open() is called */
+- netif_carrier_off(netdev);
+- netif_stop_queue(netdev);
+-
+ strcpy(netdev->name, "eth%d");
+ err = register_netdev(netdev);
+ if (err)
+ goto err_hw_init;
+
++ /* tell the stack to leave us alone until igbvf_open() is called */
++ netif_carrier_off(netdev);
++ netif_stop_queue(netdev);
++
+ igbvf_print_device_info(adapter);
+
+ igbvf_initialize_last_counter_stats(adapter);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0156-igbvf-Update-version-and-Copyright.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0156-igbvf-Update-version-and-Copyright.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,173 @@
+From: Greg Rose <gregory.v.rose at intel.com>
+Date: Tue, 16 Nov 2010 19:41:35 -0800
+Subject: [PATCH 156/165] igbvf: Update version and Copyright
+
+commit 2c20ebbaed7f3f21506629ee931941a9bba199ab upstream.
+
+Update version string and copyright notice
+
+Signed-off-by: Greg Rose <gregory.v.rose at intel.com>
+Tested-by: Emil Tantilov <emil.s.tantilov at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+---
+ drivers/net/igbvf/Makefile | 2 +-
+ drivers/net/igbvf/defines.h | 2 +-
+ drivers/net/igbvf/ethtool.c | 2 +-
+ drivers/net/igbvf/igbvf.h | 2 +-
+ drivers/net/igbvf/mbx.c | 2 +-
+ drivers/net/igbvf/mbx.h | 2 +-
+ drivers/net/igbvf/netdev.c | 7 ++++---
+ drivers/net/igbvf/regs.h | 2 +-
+ drivers/net/igbvf/vf.c | 2 +-
+ drivers/net/igbvf/vf.h | 2 +-
+ 10 files changed, 13 insertions(+), 12 deletions(-)
+
+diff --git a/drivers/net/igbvf/Makefile b/drivers/net/igbvf/Makefile
+index c2f150d..0fa3db3 100644
+--- a/drivers/net/igbvf/Makefile
++++ b/drivers/net/igbvf/Makefile
+@@ -1,7 +1,7 @@
+ ################################################################################
+ #
+ # Intel(R) 82576 Virtual Function Linux driver
+-# Copyright(c) 2009 Intel Corporation.
++# Copyright(c) 2009 - 2010 Intel Corporation.
+ #
+ # This program is free software; you can redistribute it and/or modify it
+ # under the terms and conditions of the GNU General Public License,
+diff --git a/drivers/net/igbvf/defines.h b/drivers/net/igbvf/defines.h
+index 88a4753..79f2604 100644
+--- a/drivers/net/igbvf/defines.h
++++ b/drivers/net/igbvf/defines.h
+@@ -1,7 +1,7 @@
+ /*******************************************************************************
+
+ Intel(R) 82576 Virtual Function Linux driver
+- Copyright(c) 1999 - 2009 Intel Corporation.
++ Copyright(c) 1999 - 2010 Intel Corporation.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+diff --git a/drivers/net/igbvf/ethtool.c b/drivers/net/igbvf/ethtool.c
+index 33add70..abb3606 100644
+--- a/drivers/net/igbvf/ethtool.c
++++ b/drivers/net/igbvf/ethtool.c
+@@ -1,7 +1,7 @@
+ /*******************************************************************************
+
+ Intel(R) 82576 Virtual Function Linux driver
+- Copyright(c) 2009 Intel Corporation.
++ Copyright(c) 2009 - 2010 Intel Corporation.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+diff --git a/drivers/net/igbvf/igbvf.h b/drivers/net/igbvf/igbvf.h
+index f7ae284..9d4d63e 100644
+--- a/drivers/net/igbvf/igbvf.h
++++ b/drivers/net/igbvf/igbvf.h
+@@ -1,7 +1,7 @@
+ /*******************************************************************************
+
+ Intel(R) 82576 Virtual Function Linux driver
+- Copyright(c) 2009 Intel Corporation.
++ Copyright(c) 2009 - 2010 Intel Corporation.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+diff --git a/drivers/net/igbvf/mbx.c b/drivers/net/igbvf/mbx.c
+index 819a8ec..3d6f4cc 100644
+--- a/drivers/net/igbvf/mbx.c
++++ b/drivers/net/igbvf/mbx.c
+@@ -1,7 +1,7 @@
+ /*******************************************************************************
+
+ Intel(R) 82576 Virtual Function Linux driver
+- Copyright(c) 2009 Intel Corporation.
++ Copyright(c) 2009 - 2010 Intel Corporation.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+diff --git a/drivers/net/igbvf/mbx.h b/drivers/net/igbvf/mbx.h
+index 4938609..c2883c4 100644
+--- a/drivers/net/igbvf/mbx.h
++++ b/drivers/net/igbvf/mbx.h
+@@ -1,7 +1,7 @@
+ /*******************************************************************************
+
+ Intel(R) 82576 Virtual Function Linux driver
+- Copyright(c) 1999 - 2009 Intel Corporation.
++ Copyright(c) 1999 - 2010 Intel Corporation.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
+index c4462b4..324895f 100644
+--- a/drivers/net/igbvf/netdev.c
++++ b/drivers/net/igbvf/netdev.c
+@@ -1,7 +1,7 @@
+ /*******************************************************************************
+
+ Intel(R) 82576 Virtual Function Linux driver
+- Copyright(c) 2009 Intel Corporation.
++ Copyright(c) 2009 - 2010 Intel Corporation.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+@@ -44,12 +44,13 @@
+
+ #include "igbvf.h"
+
+-#define DRV_VERSION "1.0.0-k0"
++#define DRV_VERSION "1.0.8-k0"
+ char igbvf_driver_name[] = "igbvf";
+ const char igbvf_driver_version[] = DRV_VERSION;
+ static const char igbvf_driver_string[] =
+ "Intel(R) Virtual Function Network Driver";
+-static const char igbvf_copyright[] = "Copyright (c) 2009 Intel Corporation.";
++static const char igbvf_copyright[] =
++ "Copyright (c) 2009 - 2010 Intel Corporation.";
+
+ static int igbvf_poll(struct napi_struct *napi, int budget);
+ static void igbvf_reset(struct igbvf_adapter *);
+diff --git a/drivers/net/igbvf/regs.h b/drivers/net/igbvf/regs.h
+index b9e24ed..77e18d3 100644
+--- a/drivers/net/igbvf/regs.h
++++ b/drivers/net/igbvf/regs.h
+@@ -1,7 +1,7 @@
+ /*******************************************************************************
+
+ Intel(R) 82576 Virtual Function Linux driver
+- Copyright(c) 2009 Intel Corporation.
++ Copyright(c) 2009 - 2010 Intel Corporation.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+diff --git a/drivers/net/igbvf/vf.c b/drivers/net/igbvf/vf.c
+index a9a61ef..0cc13c6 100644
+--- a/drivers/net/igbvf/vf.c
++++ b/drivers/net/igbvf/vf.c
+@@ -1,7 +1,7 @@
+ /*******************************************************************************
+
+ Intel(R) 82576 Virtual Function Linux driver
+- Copyright(c) 2009 Intel Corporation.
++ Copyright(c) 2009 - 2010 Intel Corporation.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+diff --git a/drivers/net/igbvf/vf.h b/drivers/net/igbvf/vf.h
+index 1e8ce37..c36ea21 100644
+--- a/drivers/net/igbvf/vf.h
++++ b/drivers/net/igbvf/vf.h
+@@ -1,7 +1,7 @@
+ /*******************************************************************************
+
+ Intel(R) 82576 Virtual Function Linux driver
+- Copyright(c) 2009 Intel Corporation.
++ Copyright(c) 2009 - 2010 Intel Corporation.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0157-igbvf-Remove-some-dead-code-in-igbvf.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0157-igbvf-Remove-some-dead-code-in-igbvf.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,44 @@
+From: Julian Stecklina <jsteckli at os.inf.tu-dresden.de>
+Date: Tue, 16 Nov 2010 19:41:36 -0800
+Subject: [PATCH 157/165] igbvf: Remove some dead code in igbvf
+
+commit eca2a33c985eb19dd0ca4b37d66c7fb5d8b76308 upstream.
+
+Removed unused variable in igbvf.
+
+Signed-off-by: Julian Stecklina <jsteckli at os.inf.tu-dresden.de>
+Acked-by: Greg Rose <greg.v.rose at intel.com>
+Tested-by: Emil Tantilov <emil.s.tantilov at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+---
+ drivers/net/igbvf/netdev.c | 4 ----
+ 1 files changed, 0 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
+index 324895f..b3634cc 100644
+--- a/drivers/net/igbvf/netdev.c
++++ b/drivers/net/igbvf/netdev.c
+@@ -1852,8 +1852,6 @@ static void igbvf_watchdog_task(struct work_struct *work)
+
+ if (link) {
+ if (!netif_carrier_ok(netdev)) {
+- bool txb2b = 1;
+-
+ mac->ops.get_link_up_info(&adapter->hw,
+ &adapter->link_speed,
+ &adapter->link_duplex);
+@@ -1863,11 +1861,9 @@ static void igbvf_watchdog_task(struct work_struct *work)
+ adapter->tx_timeout_factor = 1;
+ switch (adapter->link_speed) {
+ case SPEED_10:
+- txb2b = 0;
+ adapter->tx_timeout_factor = 16;
+ break;
+ case SPEED_100:
+- txb2b = 0;
+ /* maybe add some timeout factor ? */
+ break;
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0158-Intel-Wired-LAN-drivers-Use-static-const.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0158-Intel-Wired-LAN-drivers-Use-static-const.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,43 @@
+From: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Date: Wed, 1 Dec 2010 19:59:50 +0000
+Subject: [PATCH 158/165] Intel Wired LAN drivers: Use static const
+
+commit 667445008db3f45a760c235d771be0c9671e59e5 upstream.
+
+Based on work by Joe Perches <joe at perches.com>
+
+Using static const to decrease data and overall object size.
+
+CC: Joe Perches <joe at perches.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Tested-by: Emil Tantilov <emil.s.tantilov at intel.com>
+[bwh: Restricted to drivers/net/igb{,vf}]
+---
+ drivers/net/igb/e1000_phy.c | 11 ++++++-----
+ 1 files changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/net/igb/e1000_phy.c b/drivers/net/igb/e1000_phy.c
+index ddd036a..6694bf3 100644
+--- a/drivers/net/igb/e1000_phy.c
++++ b/drivers/net/igb/e1000_phy.c
+@@ -1757,11 +1757,12 @@ s32 igb_get_cable_length_igp_2(struct e1000_hw *hw)
+ u16 phy_data, i, agc_value = 0;
+ u16 cur_agc_index, max_agc_index = 0;
+ u16 min_agc_index = IGP02E1000_CABLE_LENGTH_TABLE_SIZE - 1;
+- u16 agc_reg_array[IGP02E1000_PHY_CHANNEL_NUM] =
+- {IGP02E1000_PHY_AGC_A,
+- IGP02E1000_PHY_AGC_B,
+- IGP02E1000_PHY_AGC_C,
+- IGP02E1000_PHY_AGC_D};
++ static const u16 agc_reg_array[IGP02E1000_PHY_CHANNEL_NUM] = {
++ IGP02E1000_PHY_AGC_A,
++ IGP02E1000_PHY_AGC_B,
++ IGP02E1000_PHY_AGC_C,
++ IGP02E1000_PHY_AGC_D
++ };
+
+ /* Read the AGC registers for all channels */
+ for (i = 0; i < IGP02E1000_PHY_CHANNEL_NUM; i++) {
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0159-igb-Add-new-function-to-read-part-number-from-EEPROM.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0159-igb-Add-new-function-to-read-part-number-from-EEPROM.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,223 @@
+From: Carolyn Wyborny <carolyn.wyborny at intel.com>
+Date: Mon, 22 Nov 2010 17:17:21 +0000
+Subject: [PATCH 159/165] igb: Add new function to read part number from
+ EEPROM in string format
+
+commit 9835fd7321a67feba6432e63bf2cba43f5a56bd9 upstream.
+
+New adapters will have part numbers stored in string format rather than
+simple hex format. This function will read part number formats in either
+hex or string.
+
+Signed-off-by: Carolyn Wyborny <carolyn.wyborny at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+---
+ drivers/net/igb/e1000_defines.h | 7 +++
+ drivers/net/igb/e1000_nvm.c | 93 ++++++++++++++++++++++++++++++++++++---
+ drivers/net/igb/e1000_nvm.h | 2 +
+ drivers/net/igb/igb_main.c | 11 +++--
+ 4 files changed, 102 insertions(+), 11 deletions(-)
+
+diff --git a/drivers/net/igb/e1000_defines.h b/drivers/net/igb/e1000_defines.h
+index 6222279..6319ed9 100644
+--- a/drivers/net/igb/e1000_defines.h
++++ b/drivers/net/igb/e1000_defines.h
+@@ -419,6 +419,9 @@
+ #define E1000_ERR_SWFW_SYNC 13
+ #define E1000_NOT_IMPLEMENTED 14
+ #define E1000_ERR_MBX 15
++#define E1000_ERR_INVALID_ARGUMENT 16
++#define E1000_ERR_NO_SPACE 17
++#define E1000_ERR_NVM_PBA_SECTION 18
+
+ /* Loop limit on how long we wait for auto-negotiation to complete */
+ #define COPPER_LINK_UP_LIMIT 10
+@@ -580,11 +583,15 @@
+
+ /* Mask bits for fields in Word 0x1a of the NVM */
+
++/* length of string needed to store part num */
++#define E1000_PBANUM_LENGTH 11
++
+ /* For checksumming, the sum of all words in the NVM should equal 0xBABA. */
+ #define NVM_SUM 0xBABA
+
+ #define NVM_PBA_OFFSET_0 8
+ #define NVM_PBA_OFFSET_1 9
++#define NVM_PBA_PTR_GUARD 0xFAFA
+ #define NVM_WORD_SIZE_BASE_SHIFT 6
+
+ /* NVM Commands - Microwire */
+diff --git a/drivers/net/igb/e1000_nvm.c b/drivers/net/igb/e1000_nvm.c
+index d83b77fa..6b5cc2c 100644
+--- a/drivers/net/igb/e1000_nvm.c
++++ b/drivers/net/igb/e1000_nvm.c
+@@ -445,31 +445,112 @@ out:
+ }
+
+ /**
+- * igb_read_part_num - Read device part number
++ * igb_read_part_string - Read device part number
+ * @hw: pointer to the HW structure
+ * @part_num: pointer to device part number
++ * @part_num_size: size of part number buffer
+ *
+ * Reads the product board assembly (PBA) number from the EEPROM and stores
+ * the value in part_num.
+ **/
+-s32 igb_read_part_num(struct e1000_hw *hw, u32 *part_num)
++s32 igb_read_part_string(struct e1000_hw *hw, u8 *part_num, u32 part_num_size)
+ {
+- s32 ret_val;
++ s32 ret_val;
+ u16 nvm_data;
++ u16 pointer;
++ u16 offset;
++ u16 length;
++
++ if (part_num == NULL) {
++ hw_dbg("PBA string buffer was null\n");
++ ret_val = E1000_ERR_INVALID_ARGUMENT;
++ goto out;
++ }
+
+ ret_val = hw->nvm.ops.read(hw, NVM_PBA_OFFSET_0, 1, &nvm_data);
+ if (ret_val) {
+ hw_dbg("NVM Read Error\n");
+ goto out;
+ }
+- *part_num = (u32)(nvm_data << 16);
+
+- ret_val = hw->nvm.ops.read(hw, NVM_PBA_OFFSET_1, 1, &nvm_data);
++ ret_val = hw->nvm.ops.read(hw, NVM_PBA_OFFSET_1, 1, &pointer);
++ if (ret_val) {
++ hw_dbg("NVM Read Error\n");
++ goto out;
++ }
++
++ /*
++ * if nvm_data is not ptr guard the PBA must be in legacy format which
++ * means pointer is actually our second data word for the PBA number
++ * and we can decode it into an ascii string
++ */
++ if (nvm_data != NVM_PBA_PTR_GUARD) {
++ hw_dbg("NVM PBA number is not stored as string\n");
++
++ /* we will need 11 characters to store the PBA */
++ if (part_num_size < 11) {
++ hw_dbg("PBA string buffer too small\n");
++ return E1000_ERR_NO_SPACE;
++ }
++
++ /* extract hex string from data and pointer */
++ part_num[0] = (nvm_data >> 12) & 0xF;
++ part_num[1] = (nvm_data >> 8) & 0xF;
++ part_num[2] = (nvm_data >> 4) & 0xF;
++ part_num[3] = nvm_data & 0xF;
++ part_num[4] = (pointer >> 12) & 0xF;
++ part_num[5] = (pointer >> 8) & 0xF;
++ part_num[6] = '-';
++ part_num[7] = 0;
++ part_num[8] = (pointer >> 4) & 0xF;
++ part_num[9] = pointer & 0xF;
++
++ /* put a null character on the end of our string */
++ part_num[10] = '\0';
++
++ /* switch all the data but the '-' to hex char */
++ for (offset = 0; offset < 10; offset++) {
++ if (part_num[offset] < 0xA)
++ part_num[offset] += '0';
++ else if (part_num[offset] < 0x10)
++ part_num[offset] += 'A' - 0xA;
++ }
++
++ goto out;
++ }
++
++ ret_val = hw->nvm.ops.read(hw, pointer, 1, &length);
+ if (ret_val) {
+ hw_dbg("NVM Read Error\n");
+ goto out;
+ }
+- *part_num |= nvm_data;
++
++ if (length == 0xFFFF || length == 0) {
++ hw_dbg("NVM PBA number section invalid length\n");
++ ret_val = E1000_ERR_NVM_PBA_SECTION;
++ goto out;
++ }
++ /* check if part_num buffer is big enough */
++ if (part_num_size < (((u32)length * 2) - 1)) {
++ hw_dbg("PBA string buffer too small\n");
++ ret_val = E1000_ERR_NO_SPACE;
++ goto out;
++ }
++
++ /* trim pba length from start of string */
++ pointer++;
++ length--;
++
++ for (offset = 0; offset < length; offset++) {
++ ret_val = hw->nvm.ops.read(hw, pointer + offset, 1, &nvm_data);
++ if (ret_val) {
++ hw_dbg("NVM Read Error\n");
++ goto out;
++ }
++ part_num[offset * 2] = (u8)(nvm_data >> 8);
++ part_num[(offset * 2) + 1] = (u8)(nvm_data & 0xFF);
++ }
++ part_num[offset * 2] = '\0';
+
+ out:
+ return ret_val;
+diff --git a/drivers/net/igb/e1000_nvm.h b/drivers/net/igb/e1000_nvm.h
+index 1041c34..29c956a 100644
+--- a/drivers/net/igb/e1000_nvm.h
++++ b/drivers/net/igb/e1000_nvm.h
+@@ -32,6 +32,8 @@ s32 igb_acquire_nvm(struct e1000_hw *hw);
+ void igb_release_nvm(struct e1000_hw *hw);
+ s32 igb_read_mac_addr(struct e1000_hw *hw);
+ s32 igb_read_part_num(struct e1000_hw *hw, u32 *part_num);
++s32 igb_read_part_string(struct e1000_hw *hw, u8 *part_num,
++ u32 part_num_size);
+ s32 igb_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data);
+ s32 igb_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data);
+ s32 igb_validate_nvm_checksum(struct e1000_hw *hw);
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index f869e8a..066ab6e 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -1713,12 +1713,13 @@ static int __devinit igb_probe(struct pci_dev *pdev,
+ struct igb_adapter *adapter;
+ struct e1000_hw *hw;
+ u16 eeprom_data = 0;
++ s32 ret_val;
+ static int global_quad_port_a; /* global quad port a indication */
+ const struct e1000_info *ei = igb_info_tbl[ent->driver_data];
+ unsigned long mmio_start, mmio_len;
+ int err, pci_using_dac;
+ u16 eeprom_apme_mask = IGB_EEPROM_APME;
+- u32 part_num;
++ u8 part_str[E1000_PBANUM_LENGTH];
+
+ /* Catch broken hardware that put the wrong VF device ID in
+ * the PCIe SR-IOV capability.
+@@ -1984,10 +1985,10 @@ static int __devinit igb_probe(struct pci_dev *pdev,
+ "unknown"),
+ netdev->dev_addr);
+
+- igb_read_part_num(hw, &part_num);
+- dev_info(&pdev->dev, "%s: PBA No: %06x-%03x\n", netdev->name,
+- (part_num >> 8), (part_num & 0xff));
+-
++ ret_val = igb_read_part_string(hw, part_str, E1000_PBANUM_LENGTH);
++ if (ret_val)
++ strcpy(part_str, "Unknown");
++ dev_info(&pdev->dev, "%s: PBA No: %s\n", netdev->name, part_str);
+ dev_info(&pdev->dev,
+ "Using %s interrupts. %d rx queue(s), %d tx queue(s)\n",
+ adapter->msix_entries ? "MSI-X" :
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0160-igb-Some-fine-tuning.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0160-igb-Some-fine-tuning.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,75 @@
+From: "Gasparakis, Joseph" <joseph.gasparakis at intel.com>
+Date: Thu, 9 Dec 2010 01:41:01 +0000
+Subject: [PATCH 160/165] igb: Some fine tuning
+
+commit 1b5dda331ff8646a70d247cace45a60035937a9b upstream.
+
+This patch does the following:
+
+1. Changes the existing supported device id's so now DH89xxCC is not supported when EEPROM is not read.
+2. Adds two more device ids for DH89xxCC in backplane mode and SFP.
+3. Driver now initializes previously possibly uninitialized value in igb_reset_mdicnfg_82580().
+
+Signed-off-by: Joseph Gasparakis <joseph.gasparakis at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+---
+ drivers/net/igb/e1000_82575.c | 4 +++-
+ drivers/net/igb/e1000_hw.h | 6 ++++--
+ drivers/net/igb/igb_main.c | 2 ++
+ 3 files changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c
+index bc183f5..50f6e96 100644
+--- a/drivers/net/igb/e1000_82575.c
++++ b/drivers/net/igb/e1000_82575.c
+@@ -134,6 +134,8 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
+ case E1000_DEV_ID_82580_COPPER_DUAL:
+ case E1000_DEV_ID_DH89XXCC_SGMII:
+ case E1000_DEV_ID_DH89XXCC_SERDES:
++ case E1000_DEV_ID_DH89XXCC_BACKPLANE:
++ case E1000_DEV_ID_DH89XXCC_SFP:
+ mac->type = e1000_82580;
+ break;
+ case E1000_DEV_ID_I350_COPPER:
+@@ -1578,7 +1580,7 @@ static s32 igb_reset_mdicnfg_82580(struct e1000_hw *hw)
+ {
+ s32 ret_val = 0;
+ u32 mdicnfg;
+- u16 nvm_data;
++ u16 nvm_data = 0;
+
+ if (hw->mac.type != e1000_82580)
+ goto out;
+diff --git a/drivers/net/igb/e1000_hw.h b/drivers/net/igb/e1000_hw.h
+index c0b017f..e2638af 100644
+--- a/drivers/net/igb/e1000_hw.h
++++ b/drivers/net/igb/e1000_hw.h
+@@ -54,8 +54,10 @@ struct e1000_hw;
+ #define E1000_DEV_ID_82580_SERDES 0x1510
+ #define E1000_DEV_ID_82580_SGMII 0x1511
+ #define E1000_DEV_ID_82580_COPPER_DUAL 0x1516
+-#define E1000_DEV_ID_DH89XXCC_SGMII 0x0436
+-#define E1000_DEV_ID_DH89XXCC_SERDES 0x0438
++#define E1000_DEV_ID_DH89XXCC_SGMII 0x0438
++#define E1000_DEV_ID_DH89XXCC_SERDES 0x043A
++#define E1000_DEV_ID_DH89XXCC_BACKPLANE 0x043C
++#define E1000_DEV_ID_DH89XXCC_SFP 0x0440
+ #define E1000_DEV_ID_I350_COPPER 0x1521
+ #define E1000_DEV_ID_I350_FIBER 0x1522
+ #define E1000_DEV_ID_I350_SERDES 0x1523
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 066ab6e..2262af2 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -73,6 +73,8 @@ static DEFINE_PCI_DEVICE_TABLE(igb_pci_tbl) = {
+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_82580_COPPER_DUAL), board_82575 },
+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_DH89XXCC_SGMII), board_82575 },
+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_DH89XXCC_SERDES), board_82575 },
++ { PCI_VDEVICE(INTEL, E1000_DEV_ID_DH89XXCC_BACKPLANE), board_82575 },
++ { PCI_VDEVICE(INTEL, E1000_DEV_ID_DH89XXCC_SFP), board_82575 },
+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576), board_82575 },
+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_NS), board_82575 },
+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_NS_SERDES), board_82575 },
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0161-igb-Add-Anti-spoofing-feature-support.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0161-igb-Add-Anti-spoofing-feature-support.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,195 @@
+From: Greg Rose <gregory.v.rose at intel.com>
+Date: Sat, 6 Nov 2010 02:08:26 +0000
+Subject: [PATCH 161/165] igb: Add Anti-spoofing feature support
+
+commit 13800469d40bf4dc9fbed17f4692b2ebe94d4526 upstream.
+
+Add support for the anti-spoofing feature in the HW. Packets from
+VF devices with spoofed MAC addresses or VLAN tags will be blocked
+and an event generated. When the watchdog task runs it will call a
+function to check if any spoof events occurred. If an event was
+detected then a warning message is dumped to the system log.
+
+Signed-off-by: Greg Rose <gregory.v.rose at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+---
+ drivers/net/igb/e1000_82575.c | 33 ++++++++++++++++++++++++++++
+ drivers/net/igb/e1000_82575.h | 5 ++++
+ drivers/net/igb/e1000_regs.h | 1 +
+ drivers/net/igb/igb.h | 1 +
+ drivers/net/igb/igb_main.c | 47 +++++++++++++++++++++++++++++++++++++++++
+ 5 files changed, 87 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c
+index 50f6e96..0a2368f 100644
+--- a/drivers/net/igb/e1000_82575.c
++++ b/drivers/net/igb/e1000_82575.c
+@@ -1480,6 +1480,39 @@ out:
+ }
+
+ /**
++ * igb_vmdq_set_anti_spoofing_pf - enable or disable anti-spoofing
++ * @hw: pointer to the hardware struct
++ * @enable: state to enter, either enabled or disabled
++ * @pf: Physical Function pool - do not set anti-spoofing for the PF
++ *
++ * enables/disables L2 switch anti-spoofing functionality.
++ **/
++void igb_vmdq_set_anti_spoofing_pf(struct e1000_hw *hw, bool enable, int pf)
++{
++ u32 dtxswc;
++
++ switch (hw->mac.type) {
++ case e1000_82576:
++ case e1000_i350:
++ dtxswc = rd32(E1000_DTXSWC);
++ if (enable) {
++ dtxswc |= (E1000_DTXSWC_MAC_SPOOF_MASK |
++ E1000_DTXSWC_VLAN_SPOOF_MASK);
++ /* The PF can spoof - it has to in order to
++ * support emulation mode NICs */
++ dtxswc ^= (1 << pf | 1 << (pf + MAX_NUM_VFS));
++ } else {
++ dtxswc &= ~(E1000_DTXSWC_MAC_SPOOF_MASK |
++ E1000_DTXSWC_VLAN_SPOOF_MASK);
++ }
++ wr32(E1000_DTXSWC, dtxswc);
++ break;
++ default:
++ break;
++ }
++}
++
++/**
+ * igb_vmdq_set_loopback_pf - enable or disable vmdq loopback
+ * @hw: pointer to the hardware struct
+ * @enable: state to enter, either enabled or disabled
+diff --git a/drivers/net/igb/e1000_82575.h b/drivers/net/igb/e1000_82575.h
+index d4980e4..1518691 100644
+--- a/drivers/net/igb/e1000_82575.h
++++ b/drivers/net/igb/e1000_82575.h
+@@ -194,6 +194,10 @@ struct e1000_adv_tx_context_desc {
+ #define E1000_NVM_APME_82575 0x0400
+ #define MAX_NUM_VFS 8
+
++#define E1000_DTXSWC_MAC_SPOOF_MASK 0x000000FF /* Per VF MAC spoof control */
++#define E1000_DTXSWC_VLAN_SPOOF_MASK 0x0000FF00 /* Per VF VLAN spoof control */
++#define E1000_DTXSWC_LLE_MASK 0x00FF0000 /* Per VF Local LB enables */
++#define E1000_DTXSWC_VLAN_SPOOF_SHIFT 8
+ #define E1000_DTXSWC_VMDQ_LOOPBACK_EN (1 << 31) /* global VF LB enable */
+
+ /* Easy defines for setting default pool, would normally be left a zero */
+@@ -240,6 +244,7 @@ struct e1000_adv_tx_context_desc {
+
+ /* RX packet buffer size defines */
+ #define E1000_RXPBS_SIZE_MASK_82576 0x0000007F
++void igb_vmdq_set_anti_spoofing_pf(struct e1000_hw *, bool, int);
+ void igb_vmdq_set_loopback_pf(struct e1000_hw *, bool);
+ void igb_vmdq_set_replication_pf(struct e1000_hw *, bool);
+ u16 igb_rxpbs_adjust_82580(u32 data);
+diff --git a/drivers/net/igb/e1000_regs.h b/drivers/net/igb/e1000_regs.h
+index dd4e6ff..78be261 100644
+--- a/drivers/net/igb/e1000_regs.h
++++ b/drivers/net/igb/e1000_regs.h
+@@ -301,6 +301,7 @@
+ #define E1000_VFTE 0x00C90 /* VF Transmit Enables */
+ #define E1000_QDE 0x02408 /* Queue Drop Enable - RW */
+ #define E1000_DTXSWC 0x03500 /* DMA Tx Switch Control - RW */
++#define E1000_WVBR 0x03554 /* VM Wrong Behavior - RWS */
+ #define E1000_RPLOLR 0x05AF0 /* Replication Offload - RW */
+ #define E1000_UTA 0x0A000 /* Unicast Table Array - RW */
+ #define E1000_IOVTCL 0x05BBC /* IOV Control Register */
+diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
+index de2e779..0b99bd5 100644
+--- a/drivers/net/igb/igb.h
++++ b/drivers/net/igb/igb.h
+@@ -314,6 +314,7 @@ struct igb_adapter {
+ unsigned int vfs_allocated_count;
+ struct vf_data_storage *vf_data;
+ u32 rss_queues;
++ u32 wvbr;
+ };
+
+ #define IGB_FLAG_HAS_MSI (1 << 0)
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 2262af2..860830f 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -3343,6 +3343,45 @@ static void igb_set_rx_mode(struct net_device *netdev)
+ igb_restore_vf_multicasts(adapter);
+ }
+
++static void igb_check_wvbr(struct igb_adapter *adapter)
++{
++ struct e1000_hw *hw = &adapter->hw;
++ u32 wvbr = 0;
++
++ switch (hw->mac.type) {
++ case e1000_82576:
++ case e1000_i350:
++ if (!(wvbr = rd32(E1000_WVBR)))
++ return;
++ break;
++ default:
++ break;
++ }
++
++ adapter->wvbr |= wvbr;
++}
++
++#define IGB_STAGGERED_QUEUE_OFFSET 8
++
++static void igb_spoof_check(struct igb_adapter *adapter)
++{
++ int j;
++
++ if (!adapter->wvbr)
++ return;
++
++ for(j = 0; j < adapter->vfs_allocated_count; j++) {
++ if (adapter->wvbr & (1 << j) ||
++ adapter->wvbr & (1 << (j + IGB_STAGGERED_QUEUE_OFFSET))) {
++ dev_warn(&adapter->pdev->dev,
++ "Spoof event(s) detected on VF %d\n", j);
++ adapter->wvbr &=
++ ~((1 << j) |
++ (1 << (j + IGB_STAGGERED_QUEUE_OFFSET)));
++ }
++ }
++}
++
+ /* Need to wait a few seconds after link up to get diagnostic information from
+ * the phy */
+ static void igb_update_phy_info(unsigned long data)
+@@ -3500,6 +3539,8 @@ static void igb_watchdog_task(struct work_struct *work)
+ wr32(E1000_ICS, E1000_ICS_RXDMT0);
+ }
+
++ igb_spoof_check(adapter);
++
+ /* Reset the timer */
+ if (!test_bit(__IGB_DOWN, &adapter->state))
+ mod_timer(&adapter->watchdog_timer,
+@@ -4467,6 +4508,10 @@ static irqreturn_t igb_msix_other(int irq, void *data)
+ if (icr & E1000_ICR_DOUTSYNC) {
+ /* HW is reporting DMA is out of sync */
+ adapter->stats.doosync++;
++ /* The DMA Out of Sync is also indication of a spoof event
++ * in IOV mode. Check the Wrong VM Behavior register to
++ * see if it is really a spoof event. */
++ igb_check_wvbr(adapter);
+ }
+
+ /* Check for a mailbox event */
+@@ -6419,6 +6464,8 @@ static void igb_vmm_control(struct igb_adapter *adapter)
+ if (adapter->vfs_allocated_count) {
+ igb_vmdq_set_loopback_pf(hw, true);
+ igb_vmdq_set_replication_pf(hw, true);
++ igb_vmdq_set_anti_spoofing_pf(hw, true,
++ adapter->vfs_allocated_count);
+ } else {
+ igb_vmdq_set_loopback_pf(hw, false);
+ igb_vmdq_set_replication_pf(hw, false);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0162-igbvf-force-link-checking-when-mailbox-timeout-has-o.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0162-igbvf-force-link-checking-when-mailbox-timeout-has-o.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,37 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Thu, 18 Nov 2010 03:12:30 +0000
+Subject: [PATCH 162/165] igbvf: force link checking when mailbox timeout has
+ occurred
+
+commit 0e512bfc2c0cd6072387092f8d1ac8e1a758965b upstream.
+
+This change forces the link down when a mailbox timeout has occurred.
+Previously it was possible for a mailbox timeout to occur but for the
+interface to stay up. The problem with this was that it became possible
+for an interface to stay up and miss multiple requests resulting in a
+possible issue since the interface will be running in an unknown state.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+---
+ drivers/net/igbvf/vf.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/igbvf/vf.c b/drivers/net/igbvf/vf.c
+index 0cc13c6..74486a8 100644
+--- a/drivers/net/igbvf/vf.c
++++ b/drivers/net/igbvf/vf.c
+@@ -362,8 +362,8 @@ static s32 e1000_check_for_link_vf(struct e1000_hw *hw)
+ * or a virtual function reset
+ */
+
+- /* If we were hit with a reset drop the link */
+- if (!mbx->ops.check_for_rst(hw))
++ /* If we were hit with a reset or timeout drop the link */
++ if (!mbx->ops.check_for_rst(hw) || !mbx->timeout)
+ mac->get_link_status = true;
+
+ if (!mac->get_link_status)
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0163-igbvf-add-support-for-i350-VF-device.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0163-igbvf-add-support-for-i350-VF-device.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,80 @@
+From: "Williams, Mitch A" <mitch.a.williams at intel.com>
+Date: Thu, 9 Dec 2010 03:23:56 +0000
+Subject: [PATCH 163/165] igbvf: add support for i350 VF device
+
+commit 031d7952ee63e1aa679f7e87700e3281f4de4ba2 upstream.
+
+Add support to igbvf for the new i350 virtual function device.
+
+Signed-off-by: Mitch Williams <mitch.a.williams at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+---
+ drivers/net/igbvf/igbvf.h | 1 +
+ drivers/net/igbvf/netdev.c | 9 +++++++++
+ drivers/net/igbvf/vf.h | 2 ++
+ 3 files changed, 12 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/igbvf/igbvf.h b/drivers/net/igbvf/igbvf.h
+index 9d4d63e..990c329 100644
+--- a/drivers/net/igbvf/igbvf.h
++++ b/drivers/net/igbvf/igbvf.h
+@@ -97,6 +97,7 @@ struct igbvf_adapter;
+
+ enum igbvf_boards {
+ board_vf,
++ board_i350_vf,
+ };
+
+ struct igbvf_queue_stats {
+diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
+index b3634cc..5875249 100644
+--- a/drivers/net/igbvf/netdev.c
++++ b/drivers/net/igbvf/netdev.c
+@@ -64,8 +64,16 @@ static struct igbvf_info igbvf_vf_info = {
+ .init_ops = e1000_init_function_pointers_vf,
+ };
+
++static struct igbvf_info igbvf_i350_vf_info = {
++ .mac = e1000_vfadapt_i350,
++ .flags = 0,
++ .pba = 10,
++ .init_ops = e1000_init_function_pointers_vf,
++};
++
+ static const struct igbvf_info *igbvf_info_tbl[] = {
+ [board_vf] = &igbvf_vf_info,
++ [board_i350_vf] = &igbvf_i350_vf_info,
+ };
+
+ /**
+@@ -2866,6 +2874,7 @@ static struct pci_error_handlers igbvf_err_handler = {
+
+ static DEFINE_PCI_DEVICE_TABLE(igbvf_pci_tbl) = {
+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_VF), board_vf },
++ { PCI_VDEVICE(INTEL, E1000_DEV_ID_I350_VF), board_i350_vf },
+ { } /* terminate list */
+ };
+ MODULE_DEVICE_TABLE(pci, igbvf_pci_tbl);
+diff --git a/drivers/net/igbvf/vf.h b/drivers/net/igbvf/vf.h
+index c36ea21..d7ed58f 100644
+--- a/drivers/net/igbvf/vf.h
++++ b/drivers/net/igbvf/vf.h
+@@ -39,6 +39,7 @@
+ struct e1000_hw;
+
+ #define E1000_DEV_ID_82576_VF 0x10CA
++#define E1000_DEV_ID_I350_VF 0x1520
+ #define E1000_REVISION_0 0
+ #define E1000_REVISION_1 1
+ #define E1000_REVISION_2 2
+@@ -133,6 +134,7 @@ struct e1000_adv_tx_context_desc {
+ enum e1000_mac_type {
+ e1000_undefined = 0,
+ e1000_vfadapt,
++ e1000_vfadapt_i350,
+ e1000_num_macs /* List is 1-based, so subtract 1 for true count. */
+ };
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0164-igb-fix-sparse-warning.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0164-igb-fix-sparse-warning.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,30 @@
+From: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Date: Thu, 17 Feb 2011 18:47:48 +0000
+Subject: [PATCH 164/165] igb: fix sparse warning
+
+commit 9dc441f3c5a9ea1b9888ce15b1ccb3f30a79e323 upstream.
+
+Reported-by: Stephen Hemminger <shemminger at vyatta.com>
+Tested-by: Aaron Brown <aaron.f.brown at intel.com>
+
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+---
+ drivers/net/igbvf/vf.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/igbvf/vf.c b/drivers/net/igbvf/vf.c
+index 74486a8..af3822f 100644
+--- a/drivers/net/igbvf/vf.c
++++ b/drivers/net/igbvf/vf.c
+@@ -220,7 +220,7 @@ static u32 e1000_hash_mc_addr_vf(struct e1000_hw *hw, u8 *mc_addr)
+ * The parameter rar_count will usually be hw->mac.rar_entry_count
+ * unless there are workarounds that change this.
+ **/
+-void e1000_update_mc_addr_list_vf(struct e1000_hw *hw,
++static void e1000_update_mc_addr_list_vf(struct e1000_hw *hw,
+ u8 *mc_addr_list, u32 mc_addr_count,
+ u32 rar_used_count, u32 rar_count)
+ {
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/igb/0165-Revert-r8169-Fix-up-backport-of-r8169-keep-firmware-.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/igb/0165-Revert-r8169-Fix-up-backport-of-r8169-keep-firmware-.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,34 @@
+From: Debian kernel team <debian-kernel at lists.debian.org>
+Date: Sat, 21 May 2011 19:32:07 +0100
+Subject: [PATCH 165/165] Revert
+ "r8169-Fix-up-backport-of-r8169-keep-firmware-in-memo.patch"
+
+---
+ drivers/net/r8169.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index 1cbf195..350880f 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -1907,7 +1907,7 @@ static void rtl8168d_1_hw_phy_config(struct rtl8169_private *tp)
+
+ mdio_write(ioaddr, 0x1f, 0x0005);
+ mdio_write(ioaddr, 0x05, 0x001b);
+- if ((mdio_read(ioaddr, 0x06) != 0xbf00) ||
++ if ((mdio_read(tp, 0x06) != 0xbf00) ||
+ (rtl_apply_firmware(tp, FIRMWARE_8168D_1) < 0)) {
+ if (netif_msg_probe(tp))
+ printk(KERN_WARNING "%s: unable to apply firmware patch\n",
+@@ -2014,7 +2014,7 @@ static void rtl8168d_2_hw_phy_config(struct rtl8169_private *tp)
+
+ mdio_write(ioaddr, 0x1f, 0x0005);
+ mdio_write(ioaddr, 0x05, 0x001b);
+- if ((mdio_read(ioaddr, 0x06) != 0xb300) ||
++ if ((mdio_read(tp, 0x06) != 0xb300) ||
+ (rtl_apply_firmware(tp, FIRMWARE_8168D_2) < 0)) {
+ if (netif_msg_probe(tp))
+ printk(KERN_WARNING "%s: unable to apply firmware patch\n",
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/net-Add-netdev_alloc_skb_ip_align-helper.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/net-Add-netdev_alloc_skb_ip_align-helper.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,39 @@
+From: Eric Dumazet <eric.dumazet at gmail.com>
+Date: Wed, 7 Oct 2009 17:11:23 +0000
+Subject: [PATCH 1/6] net: Add netdev_alloc_skb_ip_align() helper
+
+commit 61321bbd6235ca9a40ba3bc249e8906cc66233c3 upstream.
+
+Instead of hardcoding NET_IP_ALIGN stuff in various network drivers,
+we can add a helper around netdev_alloc_skb()
+
+Signed-off-by: Eric Dumazet <eric.dumazet at gmail.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ include/linux/skbuff.h | 10 ++++++++++
+ 1 files changed, 10 insertions(+), 0 deletions(-)
+
+diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
+index 5297a90..7d02bbf 100644
+--- a/include/linux/skbuff.h
++++ b/include/linux/skbuff.h
+@@ -1489,6 +1489,16 @@ static inline struct sk_buff *netdev_alloc_skb(struct net_device *dev,
+ return __netdev_alloc_skb(dev, length, GFP_ATOMIC);
+ }
+
++static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev,
++ unsigned int length)
++{
++ struct sk_buff *skb = netdev_alloc_skb(dev, length + NET_IP_ALIGN);
++
++ if (NET_IP_ALIGN && skb)
++ skb_reserve(skb, NET_IP_ALIGN);
++ return skb;
++}
++
+ extern struct page *__netdev_alloc_page(struct net_device *dev, gfp_t gfp_mask);
+
+ /**
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/pm-Define-SET_SYSTEM_SLEEP_PM_OPS.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/pm-Define-SET_SYSTEM_SLEEP_PM_OPS.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,31 @@
+From: Ben Hutchings <ben at decadent.org.uk>
+Date: Thu, 19 May 2011 04:48:31 +0100
+Subject: [PATCH 3/6] pm: Define SET_SYSTEM_SLEEP_PM_OPS()
+
+From commit d690b2cd222afc75320b9b8e9da7df02e9e630ca upstream.
+---
+ include/linux/pm.h | 8 ++++++++
+ 1 files changed, 8 insertions(+), 0 deletions(-)
+
+diff --git a/include/linux/pm.h b/include/linux/pm.h
+index 3b7e04b..a0cc041 100644
+--- a/include/linux/pm.h
++++ b/include/linux/pm.h
+@@ -213,6 +213,14 @@ struct dev_pm_ops {
+ int (*runtime_idle)(struct device *dev);
+ };
+
++#define SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \
++ .suspend = suspend_fn, \
++ .resume = resume_fn, \
++ .freeze = suspend_fn, \
++ .thaw = resume_fn, \
++ .poweroff = suspend_fn, \
++ .restore = resume_fn,
++
+ /*
+ * Use this if you want to use the same suspend and resume callbacks for suspend
+ * to RAM and hibernation.
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0001-net-Use-netdev_alloc_skb_ip_align.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0001-net-Use-netdev_alloc_skb_ip_align.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,35 @@
+From: Eric Dumazet <eric.dumazet at gmail.com>
+Date: Tue, 13 Oct 2009 05:34:20 +0000
+Subject: [PATCH 01/47] net: Use netdev_alloc_skb_ip_align()
+
+commit 89d71a66c40d629e3b1285def543ab1425558cd5 upstream.
+
+Signed-off-by: Eric Dumazet <eric.dumazet at gmail.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Restricted to drivers/net/r8169.c]
+---
+ drivers/net/r8169.c | 3 +--
+ 1 files changed, 1 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index 63829ca..157968f 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -3826,13 +3826,12 @@ static inline bool rtl8169_try_rx_copy(struct sk_buff **sk_buff,
+ if (pkt_size >= rx_copybreak)
+ goto out;
+
+- skb = netdev_alloc_skb(tp->dev, pkt_size + NET_IP_ALIGN);
++ skb = netdev_alloc_skb_ip_align(tp->dev, pkt_size);
+ if (!skb)
+ goto out;
+
+ pci_dma_sync_single_for_cpu(tp->pci_dev, addr, pkt_size,
+ PCI_DMA_FROMDEVICE);
+- skb_reserve(skb, NET_IP_ALIGN);
+ skb_copy_from_linear_data(*sk_buff, skb->data, pkt_size);
+ *sk_buff = skb;
+ done = true;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0002-r8169-move-PHY-regs-tables-to-.rodata.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0002-r8169-move-PHY-regs-tables-to-.rodata.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,296 @@
+From: Alexey Dobriyan <adobriyan at gmail.com>
+Date: Wed, 25 Nov 2009 15:54:21 -0800
+Subject: [PATCH 02/47] r8169: move PHY regs tables to .rodata
+
+commit 350f75960c8ba317935b4274c56c16412e085b08 upstream.
+
+As side effect, consume less stack.
+
+ -rtl8169_get_mac_version [vmlinux]: 432
+ -rtl8169_init_one [vmlinux]: 376
+ +rtl8169_init_one [vmlinux]: 136
+
+Signed-off-by: Alexey Dobriyan <adobriyan at gmail.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Omit changes to firmware blobs previously removed]
+---
+ drivers/net/r8169.c | 60 +++++++++++++++++++++++++-------------------------
+ 1 files changed, 30 insertions(+), 30 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index 157968f..568e831 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -811,7 +811,7 @@ static int rtl8169_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
+ struct rtl8169_private *tp = netdev_priv(dev);
+ void __iomem *ioaddr = tp->mmio_addr;
+ unsigned int i;
+- static struct {
++ static const struct {
+ u32 opt;
+ u16 reg;
+ u8 mask;
+@@ -1294,7 +1294,7 @@ static void rtl8169_get_mac_version(struct rtl8169_private *tp,
+ *
+ * (RTL_R32(TxConfig) & 0x700000) == 0x200000 ? 8101Eb : 8101Ec
+ */
+- const struct {
++ static const struct {
+ u32 mask;
+ u32 val;
+ int mac_version;
+@@ -1368,7 +1368,7 @@ struct phy_reg {
+ u16 val;
+ };
+
+-static void rtl_phy_write(void __iomem *ioaddr, struct phy_reg *regs, int len)
++static void rtl_phy_write(void __iomem *ioaddr, const struct phy_reg *regs, int len)
+ {
+ while (len-- > 0) {
+ mdio_write(ioaddr, regs->reg, regs->val);
+@@ -1378,7 +1378,7 @@ static void rtl_phy_write(void __iomem *ioaddr, struct phy_reg *regs, int len)
+
+ static void rtl8169s_hw_phy_config(void __iomem *ioaddr)
+ {
+- struct phy_reg phy_reg_init[] = {
++ static const struct phy_reg phy_reg_init[] = {
+ { 0x1f, 0x0001 },
+ { 0x06, 0x006e },
+ { 0x08, 0x0708 },
+@@ -1445,7 +1445,7 @@ static void rtl8169s_hw_phy_config(void __iomem *ioaddr)
+
+ static void rtl8169sb_hw_phy_config(void __iomem *ioaddr)
+ {
+- struct phy_reg phy_reg_init[] = {
++ static const struct phy_reg phy_reg_init[] = {
+ { 0x1f, 0x0002 },
+ { 0x01, 0x90d0 },
+ { 0x1f, 0x0000 }
+@@ -1474,7 +1474,7 @@ static void rtl8169scd_hw_phy_config_quirk(struct rtl8169_private *tp,
+ static void rtl8169scd_hw_phy_config(struct rtl8169_private *tp,
+ void __iomem *ioaddr)
+ {
+- struct phy_reg phy_reg_init[] = {
++ static const struct phy_reg phy_reg_init[] = {
+ { 0x1f, 0x0001 },
+ { 0x04, 0x0000 },
+ { 0x03, 0x00a1 },
+@@ -1521,7 +1521,7 @@ static void rtl8169scd_hw_phy_config(struct rtl8169_private *tp,
+
+ static void rtl8169sce_hw_phy_config(void __iomem *ioaddr)
+ {
+- struct phy_reg phy_reg_init[] = {
++ static const struct phy_reg phy_reg_init[] = {
+ { 0x1f, 0x0001 },
+ { 0x04, 0x0000 },
+ { 0x03, 0x00a1 },
+@@ -1574,7 +1574,7 @@ static void rtl8169sce_hw_phy_config(void __iomem *ioaddr)
+
+ static void rtl8168bb_hw_phy_config(void __iomem *ioaddr)
+ {
+- struct phy_reg phy_reg_init[] = {
++ static const struct phy_reg phy_reg_init[] = {
+ { 0x10, 0xf41b },
+ { 0x1f, 0x0000 }
+ };
+@@ -1587,7 +1587,7 @@ static void rtl8168bb_hw_phy_config(void __iomem *ioaddr)
+
+ static void rtl8168bef_hw_phy_config(void __iomem *ioaddr)
+ {
+- struct phy_reg phy_reg_init[] = {
++ static const struct phy_reg phy_reg_init[] = {
+ { 0x1f, 0x0001 },
+ { 0x10, 0xf41b },
+ { 0x1f, 0x0000 }
+@@ -1598,7 +1598,7 @@ static void rtl8168bef_hw_phy_config(void __iomem *ioaddr)
+
+ static void rtl8168cp_1_hw_phy_config(void __iomem *ioaddr)
+ {
+- struct phy_reg phy_reg_init[] = {
++ static const struct phy_reg phy_reg_init[] = {
+ { 0x1f, 0x0000 },
+ { 0x1d, 0x0f00 },
+ { 0x1f, 0x0002 },
+@@ -1611,7 +1611,7 @@ static void rtl8168cp_1_hw_phy_config(void __iomem *ioaddr)
+
+ static void rtl8168cp_2_hw_phy_config(void __iomem *ioaddr)
+ {
+- struct phy_reg phy_reg_init[] = {
++ static const struct phy_reg phy_reg_init[] = {
+ { 0x1f, 0x0001 },
+ { 0x1d, 0x3d98 },
+ { 0x1f, 0x0000 }
+@@ -1626,7 +1626,7 @@ static void rtl8168cp_2_hw_phy_config(void __iomem *ioaddr)
+
+ static void rtl8168c_1_hw_phy_config(void __iomem *ioaddr)
+ {
+- struct phy_reg phy_reg_init[] = {
++ static const struct phy_reg phy_reg_init[] = {
+ { 0x1f, 0x0001 },
+ { 0x12, 0x2300 },
+ { 0x1f, 0x0002 },
+@@ -1655,7 +1655,7 @@ static void rtl8168c_1_hw_phy_config(void __iomem *ioaddr)
+
+ static void rtl8168c_2_hw_phy_config(void __iomem *ioaddr)
+ {
+- struct phy_reg phy_reg_init[] = {
++ static const struct phy_reg phy_reg_init[] = {
+ { 0x1f, 0x0001 },
+ { 0x12, 0x2300 },
+ { 0x03, 0x802f },
+@@ -1683,7 +1683,7 @@ static void rtl8168c_2_hw_phy_config(void __iomem *ioaddr)
+
+ static void rtl8168c_3_hw_phy_config(void __iomem *ioaddr)
+ {
+- struct phy_reg phy_reg_init[] = {
++ static const struct phy_reg phy_reg_init[] = {
+ { 0x1f, 0x0001 },
+ { 0x12, 0x2300 },
+ { 0x1d, 0x3d98 },
+@@ -1710,7 +1710,7 @@ static void rtl8168c_4_hw_phy_config(void __iomem *ioaddr)
+
+ static void rtl8168d_1_hw_phy_config(void __iomem *ioaddr)
+ {
+- static struct phy_reg phy_reg_init_0[] = {
++ static const struct phy_reg phy_reg_init_0[] = {
+ { 0x1f, 0x0001 },
+ { 0x06, 0x4064 },
+ { 0x07, 0x2863 },
+@@ -1729,7 +1729,7 @@ static void rtl8168d_1_hw_phy_config(void __iomem *ioaddr)
+ { 0x1a, 0x05ad },
+ { 0x14, 0x94c0 }
+ };
+- static struct phy_reg phy_reg_init_1[] = {
++ static const struct phy_reg phy_reg_init_1[] = {
+ { 0x1f, 0x0002 },
+ { 0x06, 0x5561 },
+ { 0x1f, 0x0005 },
+@@ -1746,7 +1746,7 @@ static void rtl8168d_1_hw_phy_config(void __iomem *ioaddr)
+ rtl_phy_write(ioaddr, phy_reg_init_1, ARRAY_SIZE(phy_reg_init_1));
+
+ if (rtl8168d_efuse_read(ioaddr, 0x01) == 0xb1) {
+- struct phy_reg phy_reg_init[] = {
++ static const struct phy_reg phy_reg_init[] = {
+ { 0x1f, 0x0002 },
+ { 0x05, 0x669a },
+ { 0x1f, 0x0005 },
+@@ -1761,7 +1761,7 @@ static void rtl8168d_1_hw_phy_config(void __iomem *ioaddr)
+ val = mdio_read(ioaddr, 0x0d);
+
+ if ((val & 0x00ff) != 0x006c) {
+- u32 set[] = {
++ static const u32 set[] = {
+ 0x0065, 0x0066, 0x0067, 0x0068,
+ 0x0069, 0x006a, 0x006b, 0x006c
+ };
+@@ -1774,7 +1774,7 @@ static void rtl8168d_1_hw_phy_config(void __iomem *ioaddr)
+ mdio_write(ioaddr, 0x0d, val | set[i]);
+ }
+ } else {
+- struct phy_reg phy_reg_init[] = {
++ static const struct phy_reg phy_reg_init[] = {
+ { 0x1f, 0x0002 },
+ { 0x05, 0x6662 },
+ { 0x1f, 0x0005 },
+@@ -1800,7 +1800,7 @@ static void rtl8168d_1_hw_phy_config(void __iomem *ioaddr)
+
+ static void rtl8168d_2_hw_phy_config(void __iomem *ioaddr)
+ {
+- static struct phy_reg phy_reg_init_0[] = {
++ static const struct phy_reg phy_reg_init_0[] = {
+ { 0x1f, 0x0001 },
+ { 0x06, 0x4064 },
+ { 0x07, 0x2863 },
+@@ -1829,7 +1829,7 @@ static void rtl8168d_2_hw_phy_config(void __iomem *ioaddr)
+ rtl_phy_write(ioaddr, phy_reg_init_0, ARRAY_SIZE(phy_reg_init_0));
+
+ if (rtl8168d_efuse_read(ioaddr, 0x01) == 0xb1) {
+- struct phy_reg phy_reg_init[] = {
++ static const struct phy_reg phy_reg_init[] = {
+ { 0x1f, 0x0002 },
+ { 0x05, 0x669a },
+ { 0x1f, 0x0005 },
+@@ -1857,7 +1857,7 @@ static void rtl8168d_2_hw_phy_config(void __iomem *ioaddr)
+ mdio_write(ioaddr, 0x0d, val | set[i]);
+ }
+ } else {
+- struct phy_reg phy_reg_init[] = {
++ static const struct phy_reg phy_reg_init[] = {
+ { 0x1f, 0x0002 },
+ { 0x05, 0x2642 },
+ { 0x1f, 0x0005 },
+@@ -1885,7 +1885,7 @@ static void rtl8168d_2_hw_phy_config(void __iomem *ioaddr)
+
+ static void rtl8168d_3_hw_phy_config(void __iomem *ioaddr)
+ {
+- struct phy_reg phy_reg_init[] = {
++ static const struct phy_reg phy_reg_init[] = {
+ { 0x1f, 0x0002 },
+ { 0x10, 0x0008 },
+ { 0x0d, 0x006c },
+@@ -1946,7 +1946,7 @@ static void rtl8168d_3_hw_phy_config(void __iomem *ioaddr)
+
+ static void rtl8102e_hw_phy_config(void __iomem *ioaddr)
+ {
+- struct phy_reg phy_reg_init[] = {
++ static const struct phy_reg phy_reg_init[] = {
+ { 0x1f, 0x0003 },
+ { 0x08, 0x441d },
+ { 0x01, 0x9100 },
+@@ -2766,7 +2766,7 @@ static void rtl_set_rx_max_size(void __iomem *ioaddr, unsigned int rx_buf_sz)
+
+ static void rtl8169_set_magic_reg(void __iomem *ioaddr, unsigned mac_version)
+ {
+- struct {
++ static const struct {
+ u32 mac_version;
+ u32 clk;
+ u32 val;
+@@ -2890,7 +2890,7 @@ struct ephy_info {
+ u16 bits;
+ };
+
+-static void rtl_ephy_init(void __iomem *ioaddr, struct ephy_info *e, int len)
++static void rtl_ephy_init(void __iomem *ioaddr, const struct ephy_info *e, int len)
+ {
+ u16 w;
+
+@@ -2961,7 +2961,7 @@ static void __rtl_hw_start_8168cp(void __iomem *ioaddr, struct pci_dev *pdev)
+
+ static void rtl_hw_start_8168cp_1(void __iomem *ioaddr, struct pci_dev *pdev)
+ {
+- static struct ephy_info e_info_8168cp[] = {
++ static const struct ephy_info e_info_8168cp[] = {
+ { 0x01, 0, 0x0001 },
+ { 0x02, 0x0800, 0x1000 },
+ { 0x03, 0, 0x0042 },
+@@ -3005,7 +3005,7 @@ static void rtl_hw_start_8168cp_3(void __iomem *ioaddr, struct pci_dev *pdev)
+
+ static void rtl_hw_start_8168c_1(void __iomem *ioaddr, struct pci_dev *pdev)
+ {
+- static struct ephy_info e_info_8168c_1[] = {
++ static const struct ephy_info e_info_8168c_1[] = {
+ { 0x02, 0x0800, 0x1000 },
+ { 0x03, 0, 0x0002 },
+ { 0x06, 0x0080, 0x0000 }
+@@ -3022,7 +3022,7 @@ static void rtl_hw_start_8168c_1(void __iomem *ioaddr, struct pci_dev *pdev)
+
+ static void rtl_hw_start_8168c_2(void __iomem *ioaddr, struct pci_dev *pdev)
+ {
+- static struct ephy_info e_info_8168c_2[] = {
++ static const struct ephy_info e_info_8168c_2[] = {
+ { 0x01, 0, 0x0001 },
+ { 0x03, 0x0400, 0x0220 }
+ };
+@@ -3166,7 +3166,7 @@ static void rtl_hw_start_8168(struct net_device *dev)
+
+ static void rtl_hw_start_8102e_1(void __iomem *ioaddr, struct pci_dev *pdev)
+ {
+- static struct ephy_info e_info_8102e_1[] = {
++ static const struct ephy_info e_info_8102e_1[] = {
+ { 0x01, 0, 0x6e65 },
+ { 0x02, 0, 0x091f },
+ { 0x03, 0, 0xc2f9 },
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0003-drivers-net-Move-and-to-end-of-previous-line.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0003-drivers-net-Move-and-to-end-of-previous-line.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,40 @@
+From: Joe Perches <joe at perches.com>
+Date: Thu, 3 Dec 2009 07:58:21 +0000
+Subject: [PATCH 03/47] drivers/net: Move && and || to end of previous line
+
+commit 8e95a2026f3b43f7c3d676adaccd2de9532e8dcc upstream.
+
+Only files where David Miller is the primary git-signer.
+wireless, wimax, ixgbe, etc are not modified.
+
+Compile tested x86 allyesconfig only
+Not all files compiled (not x86 compatible)
+
+Added a few > 80 column lines, which I ignored.
+Existing checkpatch complaints ignored.
+
+Signed-off-by: Joe Perches <joe at perches.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Restricted to drivers/net/r8169.c]
+---
+ drivers/net/r8169.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index 568e831..cca7870 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -4143,8 +4143,8 @@ static void rtl_set_rx_mode(struct net_device *dev)
+ AcceptBroadcast | AcceptMulticast | AcceptMyPhys |
+ AcceptAllPhys;
+ mc_filter[1] = mc_filter[0] = 0xffffffff;
+- } else if ((dev->mc_count > multicast_filter_limit)
+- || (dev->flags & IFF_ALLMULTI)) {
++ } else if ((dev->mc_count > multicast_filter_limit) ||
++ (dev->flags & IFF_ALLMULTI)) {
+ /* Too many to filter perfectly -- accept all multicasts. */
+ rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys;
+ mc_filter[1] = mc_filter[0] = 0xffffffff;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0004-const-constify-remaining-dev_pm_ops.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0004-const-constify-remaining-dev_pm_ops.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,30 @@
+From: Alexey Dobriyan <adobriyan at gmail.com>
+Date: Mon, 14 Dec 2009 18:00:08 -0800
+Subject: [PATCH 04/47] const: constify remaining dev_pm_ops
+
+commit 471452104b8520337ae2fb48c4e61cd4896e025d upstream.
+
+Signed-off-by: Alexey Dobriyan <adobriyan at gmail.com>
+Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
+[bwh: Restricted to drivers/net/r8169.c]
+---
+ drivers/net/r8169.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index cca7870..27436c4 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -4239,7 +4239,7 @@ out:
+ return 0;
+ }
+
+-static struct dev_pm_ops rtl8169_pm_ops = {
++static const struct dev_pm_ops rtl8169_pm_ops = {
+ .suspend = rtl8169_suspend,
+ .resume = rtl8169_resume,
+ .freeze = rtl8169_suspend,
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0005-drivers-net-r8169.c-use-pM-to-shown-MAC-address.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0005-drivers-net-r8169.c-use-pM-to-shown-MAC-address.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,39 @@
+From: H Hartley Sweeten <hsweeten at visionengravers.com>
+Date: Tue, 29 Dec 2009 20:10:01 -0800
+Subject: [PATCH 05/47] drivers/net/r8169.c: use %pM to shown MAC address
+
+commit 30a6ae8d477dc90254eb785d8ccff6dfe7d9082e upstream.
+
+Use the %pM kernel extension to display the MAC address.
+
+Signed-off-by: H Hartley Sweeten <hsweeten at visionengravers.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/r8169.c | 9 ++-------
+ 1 files changed, 2 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index 27436c4..ac62a75 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -2552,15 +2552,10 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
+ if (netif_msg_probe(tp)) {
+ u32 xid = RTL_R32(TxConfig) & 0x9cf0f8ff;
+
+- printk(KERN_INFO "%s: %s at 0x%lx, "
+- "%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x, "
+- "XID %08x IRQ %d\n",
++ printk(KERN_INFO "%s: %s at 0x%lx, %pM, XID %08x IRQ %d\n",
+ dev->name,
+ rtl_chip_info[tp->chipset].name,
+- dev->base_addr,
+- dev->dev_addr[0], dev->dev_addr[1],
+- dev->dev_addr[2], dev->dev_addr[3],
+- dev->dev_addr[4], dev->dev_addr[5], xid, dev->irq);
++ dev->base_addr, dev->dev_addr, xid, dev->irq);
+ }
+
+ rtl8169_init_phy(dev, tp);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0006-drivers-net-use-DEFINE_PCI_DEVICE_TABLE.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0006-drivers-net-use-DEFINE_PCI_DEVICE_TABLE.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,32 @@
+From: Alexey Dobriyan <adobriyan at gmail.com>
+Date: Thu, 7 Jan 2010 11:58:11 +0000
+Subject: [PATCH 06/47] drivers/net/: use DEFINE_PCI_DEVICE_TABLE()
+
+commit a3aa18842a5303fc28fcc4d57dbd16618bd830a0 upstream.
+
+Use DEFINE_PCI_DEVICE_TABLE() so we get place PCI ids table into correct section
+in every case.
+
+Signed-off-by: Alexey Dobriyan <adobriyan at gmail.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Restricted to drivers/net/r8169.c]
+---
+ drivers/net/r8169.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index ac62a75..c464ba8 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -169,7 +169,7 @@ static void rtl_hw_start_8169(struct net_device *);
+ static void rtl_hw_start_8168(struct net_device *);
+ static void rtl_hw_start_8101(struct net_device *);
+
+-static struct pci_device_id rtl8169_pci_tbl[] = {
++static DEFINE_PCI_DEVICE_TABLE(rtl8169_pci_tbl) = {
+ { PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8129), 0, 0, RTL_CFG_0 },
+ { PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8136), 0, 0, RTL_CFG_2 },
+ { PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8167), 0, 0, RTL_CFG_0 },
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0007-net-use-netdev_mc_count-and-netdev_mc_empty-when-app.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0007-net-use-netdev_mc_count-and-netdev_mc_empty-when-app.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,45 @@
+From: Jiri Pirko <jpirko at redhat.com>
+Date: Mon, 8 Feb 2010 04:30:35 +0000
+Subject: [PATCH 07/47] net: use netdev_mc_count and netdev_mc_empty when
+ appropriate
+
+commit 4cd24eaf0c6ee7f0242e34ee77ec899f255e66b5 upstream.
+
+This patch replaces dev->mc_count in all drivers (hopefully I didn't miss
+anything). Used spatch and did small tweaks and conding style changes when
+it was suitable.
+
+Jirka
+
+Signed-off-by: Jiri Pirko <jpirko at redhat.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Restricted to drivers/net/r8169.c]
+---
+ drivers/net/r8169.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index c464ba8..9700019 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -4138,7 +4138,7 @@ static void rtl_set_rx_mode(struct net_device *dev)
+ AcceptBroadcast | AcceptMulticast | AcceptMyPhys |
+ AcceptAllPhys;
+ mc_filter[1] = mc_filter[0] = 0xffffffff;
+- } else if ((dev->mc_count > multicast_filter_limit) ||
++ } else if ((netdev_mc_count(dev) > multicast_filter_limit) ||
+ (dev->flags & IFF_ALLMULTI)) {
+ /* Too many to filter perfectly -- accept all multicasts. */
+ rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys;
+@@ -4149,7 +4149,7 @@ static void rtl_set_rx_mode(struct net_device *dev)
+
+ rx_mode = AcceptBroadcast | AcceptMyPhys;
+ mc_filter[1] = mc_filter[0] = 0;
+- for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count;
++ for (i = 0, mclist = dev->mc_list; mclist && i < netdev_mc_count(dev);
+ i++, mclist = mclist->next) {
+ int bit_nr = ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26;
+ mc_filter[bit_nr >> 5] |= 1 << (bit_nr & 31);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0008-drivers-net-r8196.c-Use-netif_printk-macros.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0008-drivers-net-r8196.c-Use-netif_printk-macros.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,331 @@
+From: Joe Perches <joe at perches.com>
+Date: Tue, 9 Feb 2010 11:49:50 +0000
+Subject: [PATCH 08/47] drivers/net/r8196.c: Use netif_printk macros
+
+commit bf82c189a92f06967cf790d3ab0fc9827a9d00ff upstream.
+
+Simplify the logic a bit, make the message logs a bit more consistent.
+
+Signed-off-by: Joe Perches <joe at perches.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Adjust context for fixes cherry-picked in 2.6.32.y]
+---
+ drivers/net/r8169.c | 136 ++++++++++++++++++---------------------------------
+ 1 files changed, 48 insertions(+), 88 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index 9700019..d190827 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -761,12 +761,10 @@ static void rtl8169_check_link_status(struct net_device *dev,
+ spin_lock_irqsave(&tp->lock, flags);
+ if (tp->link_ok(ioaddr)) {
+ netif_carrier_on(dev);
+- if (netif_msg_ifup(tp))
+- printk(KERN_INFO PFX "%s: link up\n", dev->name);
++ netif_info(tp, ifup, dev, "link up\n");
+ } else {
+- if (netif_msg_ifdown(tp))
+- printk(KERN_INFO PFX "%s: link down\n", dev->name);
+ netif_carrier_off(dev);
++ netif_info(tp, ifdown, dev, "link down\n");
+ }
+ spin_unlock_irqrestore(&tp->lock, flags);
+ }
+@@ -879,11 +877,8 @@ static int rtl8169_set_speed_tbi(struct net_device *dev,
+ } else if (autoneg == AUTONEG_ENABLE)
+ RTL_W32(TBICSR, reg | TBINwEnable | TBINwRestart);
+ else {
+- if (netif_msg_link(tp)) {
+- printk(KERN_WARNING "%s: "
+- "incorrect speed setting refused in TBI mode\n",
+- dev->name);
+- }
++ netif_warn(tp, link, dev,
++ "incorrect speed setting refused in TBI mode\n");
+ ret = -EOPNOTSUPP;
+ }
+
+@@ -918,9 +913,9 @@ static int rtl8169_set_speed_xmii(struct net_device *dev,
+ (tp->mac_version != RTL_GIGA_MAC_VER_15) &&
+ (tp->mac_version != RTL_GIGA_MAC_VER_16)) {
+ giga_ctrl |= ADVERTISE_1000FULL | ADVERTISE_1000HALF;
+- } else if (netif_msg_link(tp)) {
+- printk(KERN_INFO "%s: PHY does not support 1000Mbps.\n",
+- dev->name);
++ } else {
++ netif_info(tp, link, dev,
++ "PHY does not support 1000Mbps\n");
+ }
+
+ bmcr = BMCR_ANENABLE | BMCR_ANRESTART;
+@@ -2059,8 +2054,7 @@ static void rtl8169_phy_timer(unsigned long __opaque)
+ if (tp->link_ok(ioaddr))
+ goto out_unlock;
+
+- if (netif_msg_link(tp))
+- printk(KERN_WARNING "%s: PHY reset until link up\n", dev->name);
++ netif_warn(tp, link, dev, "PHY reset until link up\n");
+
+ tp->phy_reset_enable(ioaddr);
+
+@@ -2130,8 +2124,7 @@ static void rtl8169_phy_reset(struct net_device *dev,
+ return;
+ msleep(1);
+ }
+- if (netif_msg_link(tp))
+- printk(KERN_ERR "%s: PHY reset failed.\n", dev->name);
++ netif_err(tp, link, dev, "PHY reset failed\n");
+ }
+
+ static void rtl8169_init_phy(struct net_device *dev, struct rtl8169_private *tp)
+@@ -2165,8 +2158,8 @@ static void rtl8169_init_phy(struct net_device *dev, struct rtl8169_private *tp)
+ */
+ rtl8169_set_speed(dev, AUTONEG_ENABLE, SPEED_1000, DUPLEX_FULL);
+
+- if ((RTL_R8(PHYstatus) & TBI_Enable) && netif_msg_link(tp))
+- printk(KERN_INFO PFX "%s: TBI auto-negotiating\n", dev->name);
++ if (RTL_R8(PHYstatus) & TBI_Enable)
++ netif_info(tp, link, dev, "TBI auto-negotiating\n");
+ }
+
+ static void rtl_rar_set(struct rtl8169_private *tp, u8 *addr)
+@@ -2376,8 +2369,7 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
+ /* enable device (incl. PCI PM wakeup and hotplug setup) */
+ rc = pci_enable_device(pdev);
+ if (rc < 0) {
+- if (netif_msg_probe(tp))
+- dev_err(&pdev->dev, "enable failure\n");
++ netif_err(tp, probe, dev, "enable failure\n");
+ goto err_out_free_dev_1;
+ }
+
+@@ -2387,29 +2379,24 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
+
+ /* make sure PCI base addr 1 is MMIO */
+ if (!(pci_resource_flags(pdev, region) & IORESOURCE_MEM)) {
+- if (netif_msg_probe(tp)) {
+- dev_err(&pdev->dev,
+- "region #%d not an MMIO resource, aborting\n",
+- region);
+- }
++ netif_err(tp, probe, dev,
++ "region #%d not an MMIO resource, aborting\n",
++ region);
+ rc = -ENODEV;
+ goto err_out_mwi_3;
+ }
+
+ /* check for weird/broken PCI region reporting */
+ if (pci_resource_len(pdev, region) < R8169_REGS_SIZE) {
+- if (netif_msg_probe(tp)) {
+- dev_err(&pdev->dev,
+- "Invalid PCI region size(s), aborting\n");
+- }
++ netif_err(tp, probe, dev,
++ "Invalid PCI region size(s), aborting\n");
+ rc = -ENODEV;
+ goto err_out_mwi_3;
+ }
+
+ rc = pci_request_regions(pdev, MODULENAME);
+ if (rc < 0) {
+- if (netif_msg_probe(tp))
+- dev_err(&pdev->dev, "could not request regions.\n");
++ netif_err(tp, probe, dev, "could not request regions\n");
+ goto err_out_mwi_3;
+ }
+
+@@ -2422,10 +2409,7 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
+ } else {
+ rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
+ if (rc < 0) {
+- if (netif_msg_probe(tp)) {
+- dev_err(&pdev->dev,
+- "DMA configuration failed.\n");
+- }
++ netif_err(tp, probe, dev, "DMA configuration failed\n");
+ goto err_out_free_res_4;
+ }
+ }
+@@ -2433,15 +2417,14 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
+ /* ioremap MMIO region */
+ ioaddr = ioremap(pci_resource_start(pdev, region), R8169_REGS_SIZE);
+ if (!ioaddr) {
+- if (netif_msg_probe(tp))
+- dev_err(&pdev->dev, "cannot remap MMIO, aborting\n");
++ netif_err(tp, probe, dev, "cannot remap MMIO, aborting\n");
+ rc = -EIO;
+ goto err_out_free_res_4;
+ }
+
+ tp->pcie_cap = pci_find_capability(pdev, PCI_CAP_ID_EXP);
+- if (!tp->pcie_cap && netif_msg_probe(tp))
+- dev_info(&pdev->dev, "no PCI Express capability\n");
++ if (!tp->pcie_cap)
++ netif_info(tp, probe, dev, "no PCI Express capability\n");
+
+ RTL_W16(IntrMask, 0x0000);
+
+@@ -2464,10 +2447,8 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
+
+ /* Use appropriate default if unknown */
+ if (tp->mac_version == RTL_GIGA_MAC_NONE) {
+- if (netif_msg_probe(tp)) {
+- dev_notice(&pdev->dev,
+- "unknown MAC, using family default\n");
+- }
++ netif_notice(tp, probe, dev,
++ "unknown MAC, using family default\n");
+ tp->mac_version = cfg->default_ver;
+ }
+
+@@ -2549,14 +2530,10 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
+
+ pci_set_drvdata(pdev, dev);
+
+- if (netif_msg_probe(tp)) {
+- u32 xid = RTL_R32(TxConfig) & 0x9cf0f8ff;
+-
+- printk(KERN_INFO "%s: %s at 0x%lx, %pM, XID %08x IRQ %d\n",
+- dev->name,
+- rtl_chip_info[tp->chipset].name,
+- dev->base_addr, dev->dev_addr, xid, dev->irq);
+- }
++ netif_info(tp, probe, dev, "%s at 0x%lx, %pM, XID %08x IRQ %d\n",
++ rtl_chip_info[tp->chipset].name,
++ dev->base_addr, dev->dev_addr,
++ (u32)(RTL_R32(TxConfig) & 0x9cf0f8ff), dev->irq);
+
+ rtl8169_init_phy(dev, tp);
+
+@@ -3510,10 +3487,10 @@ static void rtl8169_reinit_task(struct work_struct *work)
+
+ ret = rtl8169_open(dev);
+ if (unlikely(ret < 0)) {
+- if (net_ratelimit() && netif_msg_drv(tp)) {
+- printk(KERN_ERR PFX "%s: reinit failure (status = %d)."
+- " Rescheduling.\n", dev->name, ret);
+- }
++ if (net_ratelimit())
++ netif_err(tp, drv, dev,
++ "reinit failure (status = %d). Rescheduling\n",
++ ret);
+ rtl8169_schedule_work(dev, rtl8169_reinit_task);
+ }
+
+@@ -3543,10 +3520,8 @@ static void rtl8169_reset_task(struct work_struct *work)
+ netif_wake_queue(dev);
+ rtl8169_check_link_status(dev, tp, tp->mmio_addr);
+ } else {
+- if (net_ratelimit() && netif_msg_intr(tp)) {
+- printk(KERN_EMERG PFX "%s: Rx buffers shortage\n",
+- dev->name);
+- }
++ if (net_ratelimit())
++ netif_emerg(tp, intr, dev, "Rx buffers shortage\n");
+ rtl8169_schedule_work(dev, rtl8169_reset_task);
+ }
+
+@@ -3634,11 +3609,7 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
+ u32 opts1;
+
+ if (unlikely(TX_BUFFS_AVAIL(tp) < skb_shinfo(skb)->nr_frags)) {
+- if (netif_msg_drv(tp)) {
+- printk(KERN_ERR
+- "%s: BUG! Tx Ring full when queue awake!\n",
+- dev->name);
+- }
++ netif_err(tp, drv, dev, "BUG! Tx Ring full when queue awake!\n");
+ goto err_stop;
+ }
+
+@@ -3700,11 +3671,8 @@ static void rtl8169_pcierr_interrupt(struct net_device *dev)
+ pci_read_config_word(pdev, PCI_COMMAND, &pci_cmd);
+ pci_read_config_word(pdev, PCI_STATUS, &pci_status);
+
+- if (netif_msg_intr(tp)) {
+- printk(KERN_ERR
+- "%s: PCI error (cmd = 0x%04x, status = 0x%04x).\n",
+- dev->name, pci_cmd, pci_status);
+- }
++ netif_err(tp, intr, dev, "PCI error (cmd = 0x%04x, status = 0x%04x)\n",
++ pci_cmd, pci_status);
+
+ /*
+ * The recovery sequence below admits a very elaborated explanation:
+@@ -3728,8 +3696,7 @@ static void rtl8169_pcierr_interrupt(struct net_device *dev)
+
+ /* The infamous DAC f*ckup only happens at boot time */
+ if ((tp->cp_cmd & PCIDAC) && !tp->dirty_rx && !tp->cur_rx) {
+- if (netif_msg_intr(tp))
+- printk(KERN_INFO "%s: disabling PCI DAC.\n", dev->name);
++ netif_info(tp, intr, dev, "disabling PCI DAC\n");
+ tp->cp_cmd &= ~PCIDAC;
+ RTL_W16(CPlusCmd, tp->cp_cmd);
+ dev->features &= ~NETIF_F_HIGHDMA;
+@@ -3856,11 +3823,8 @@ static int rtl8169_rx_interrupt(struct net_device *dev,
+ if (status & DescOwn)
+ break;
+ if (unlikely(status & RxRES)) {
+- if (netif_msg_rx_err(tp)) {
+- printk(KERN_INFO
+- "%s: Rx ERROR. status = %08x\n",
+- dev->name, status);
+- }
++ netif_info(tp, rx_err, dev, "Rx ERROR. status = %08x\n",
++ status);
+ dev->stats.rx_errors++;
+ if (status & (RxRWT | RxRUNT))
+ dev->stats.rx_length_errors++;
+@@ -3923,8 +3887,8 @@ static int rtl8169_rx_interrupt(struct net_device *dev,
+ tp->cur_rx = cur_rx;
+
+ delta = rtl8169_rx_fill(tp, dev, tp->dirty_rx, tp->cur_rx, GFP_ATOMIC);
+- if (!delta && count && netif_msg_intr(tp))
+- printk(KERN_INFO "%s: no Rx buffer allocated\n", dev->name);
++ if (!delta && count)
++ netif_info(tp, intr, dev, "no Rx buffer allocated\n");
+ tp->dirty_rx += delta;
+
+ /*
+@@ -3934,8 +3898,8 @@ static int rtl8169_rx_interrupt(struct net_device *dev,
+ * after refill ?
+ * - how do others driver handle this condition (Uh oh...).
+ */
+- if ((tp->dirty_rx + NUM_RX_DESC == tp->cur_rx) && netif_msg_intr(tp))
+- printk(KERN_EMERG "%s: Rx buffers exhausted\n", dev->name);
++ if (tp->dirty_rx + NUM_RX_DESC == tp->cur_rx)
++ netif_emerg(tp, intr, dev, "Rx buffers exhausted\n");
+
+ return count;
+ }
+@@ -3991,10 +3955,9 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance)
+
+ if (likely(napi_schedule_prep(&tp->napi)))
+ __napi_schedule(&tp->napi);
+- else if (netif_msg_intr(tp)) {
+- printk(KERN_INFO "%s: interrupt %04x in poll\n",
+- dev->name, status);
+- }
++ else
++ netif_info(tp, intr, dev,
++ "interrupt %04x in poll\n", status);
+ }
+
+ /* We only get a new MSI interrupt when all active irq
+@@ -4130,10 +4093,7 @@ static void rtl_set_rx_mode(struct net_device *dev)
+
+ if (dev->flags & IFF_PROMISC) {
+ /* Unconditionally log net taps. */
+- if (netif_msg_link(tp)) {
+- printk(KERN_NOTICE "%s: Promiscuous mode enabled.\n",
+- dev->name);
+- }
++ netif_notice(tp, link, dev, "Promiscuous mode enabled\n");
+ rx_mode =
+ AcceptBroadcast | AcceptMulticast | AcceptMyPhys |
+ AcceptAllPhys;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0009-net-convert-multiple-drivers-to-use-netdev_for_each_.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0009-net-convert-multiple-drivers-to-use-netdev_for_each_.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,38 @@
+From: Jiri Pirko <jpirko at redhat.com>
+Date: Tue, 23 Feb 2010 09:19:49 +0000
+Subject: [PATCH 09/47] net: convert multiple drivers to use
+ netdev_for_each_mc_addr, part5 V2
+
+commit f9dcbcc9e338d08c0f7de7eba4eaafbbb7f81249 upstream.
+
+removed some needless checks and also corrected bug in lp486e (dmi was passed
+instead of dmi->dmi_addr)
+
+Signed-off-by: Jiri Pirko <jpirko at redhat.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Restricted to drivers/net/r8169.c]
+---
+ drivers/net/r8169.c | 4 +---
+ 1 files changed, 1 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index d190827..616329f 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -4105,12 +4105,10 @@ static void rtl_set_rx_mode(struct net_device *dev)
+ mc_filter[1] = mc_filter[0] = 0xffffffff;
+ } else {
+ struct dev_mc_list *mclist;
+- unsigned int i;
+
+ rx_mode = AcceptBroadcast | AcceptMyPhys;
+ mc_filter[1] = mc_filter[0] = 0;
+- for (i = 0, mclist = dev->mc_list; mclist && i < netdev_mc_count(dev);
+- i++, mclist = mclist->next) {
++ netdev_for_each_mc_addr(mclist, dev) {
+ int bit_nr = ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26;
+ mc_filter[bit_nr >> 5] |= 1 << (bit_nr & 31);
+ rx_mode |= AcceptMulticast;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0010-r8169-PCI-PM-Add-simplified-runtime-PM-support-rev.-.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0010-r8169-PCI-PM-Add-simplified-runtime-PM-support-rev.-.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,338 @@
+From: "Rafael J. Wysocki" <rjw at sisk.pl>
+Date: Sun, 14 Mar 2010 14:33:51 +0000
+Subject: [PATCH 10/47] r8169 / PCI / PM: Add simplified runtime PM support
+ (rev. 3)
+
+commit e175944115db6762d3e98520c709e5a87f933c61 upstream.
+
+Use the PCI runtime power management framework to add basic PCI
+runtime PM support to the r8169 driver. Namely, make the driver
+suspend the device when the link is not present and set it up for
+generating a wakeup event after the link has been detected again.
+[This feature is disabled until the user space enables it with the
+help of the /sys/devices/.../power/contol device attribute.]
+
+Signed-off-by: Rafael J. Wysocki <rjw at sisk.pl>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Adjust context for fixes cherry-picked in 2.6.32.y]
+---
+ drivers/net/r8169.c | 152 ++++++++++++++++++++++++++++++++++++++++++---------
+ 1 files changed, 125 insertions(+), 27 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index 616329f..86588e9 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -23,6 +23,7 @@
+ #include <linux/tcp.h>
+ #include <linux/init.h>
+ #include <linux/dma-mapping.h>
++#include <linux/pm_runtime.h>
+ #include <linux/pci-aspm.h>
+
+ #include <asm/system.h>
+@@ -510,6 +511,7 @@ struct rtl8169_private {
+
+ struct mii_if_info mii;
+ struct rtl8169_counters counters;
++ u32 saved_wolopts;
+ };
+
+ MODULE_AUTHOR("Realtek and the Linux r8169 crew <netdev at vger.kernel.org>");
+@@ -760,53 +762,61 @@ static void rtl8169_check_link_status(struct net_device *dev,
+
+ spin_lock_irqsave(&tp->lock, flags);
+ if (tp->link_ok(ioaddr)) {
++ /* This is to cancel a scheduled suspend if there's one. */
++ pm_request_resume(&tp->pci_dev->dev);
+ netif_carrier_on(dev);
+ netif_info(tp, ifup, dev, "link up\n");
+ } else {
+ netif_carrier_off(dev);
+ netif_info(tp, ifdown, dev, "link down\n");
++ pm_schedule_suspend(&tp->pci_dev->dev, 100);
+ }
+ spin_unlock_irqrestore(&tp->lock, flags);
+ }
+
+-static void rtl8169_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
++#define WAKE_ANY (WAKE_PHY | WAKE_MAGIC | WAKE_UCAST | WAKE_BCAST | WAKE_MCAST)
++
++static u32 __rtl8169_get_wol(struct rtl8169_private *tp)
+ {
+- struct rtl8169_private *tp = netdev_priv(dev);
+ void __iomem *ioaddr = tp->mmio_addr;
+ u8 options;
+-
+- wol->wolopts = 0;
+-
+-#define WAKE_ANY (WAKE_PHY | WAKE_MAGIC | WAKE_UCAST | WAKE_BCAST | WAKE_MCAST)
+- wol->supported = WAKE_ANY;
+-
+- spin_lock_irq(&tp->lock);
++ u32 wolopts = 0;
+
+ options = RTL_R8(Config1);
+ if (!(options & PMEnable))
+- goto out_unlock;
++ return 0;
+
+ options = RTL_R8(Config3);
+ if (options & LinkUp)
+- wol->wolopts |= WAKE_PHY;
++ wolopts |= WAKE_PHY;
+ if (options & MagicPacket)
+- wol->wolopts |= WAKE_MAGIC;
++ wolopts |= WAKE_MAGIC;
+
+ options = RTL_R8(Config5);
+ if (options & UWF)
+- wol->wolopts |= WAKE_UCAST;
++ wolopts |= WAKE_UCAST;
+ if (options & BWF)
+- wol->wolopts |= WAKE_BCAST;
++ wolopts |= WAKE_BCAST;
+ if (options & MWF)
+- wol->wolopts |= WAKE_MCAST;
++ wolopts |= WAKE_MCAST;
+
+-out_unlock:
+- spin_unlock_irq(&tp->lock);
++ return wolopts;
+ }
+
+-static int rtl8169_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
++static void rtl8169_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
+ {
+ struct rtl8169_private *tp = netdev_priv(dev);
++
++ spin_lock_irq(&tp->lock);
++
++ wol->supported = WAKE_ANY;
++ wol->wolopts = __rtl8169_get_wol(tp);
++
++ spin_unlock_irq(&tp->lock);
++}
++
++static void __rtl8169_set_wol(struct rtl8169_private *tp, u32 wolopts)
++{
+ void __iomem *ioaddr = tp->mmio_addr;
+ unsigned int i;
+ static const struct {
+@@ -823,23 +833,29 @@ static int rtl8169_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
+ { WAKE_ANY, Config5, LanWake }
+ };
+
+- spin_lock_irq(&tp->lock);
+-
+ RTL_W8(Cfg9346, Cfg9346_Unlock);
+
+ for (i = 0; i < ARRAY_SIZE(cfg); i++) {
+ u8 options = RTL_R8(cfg[i].reg) & ~cfg[i].mask;
+- if (wol->wolopts & cfg[i].opt)
++ if (wolopts & cfg[i].opt)
+ options |= cfg[i].mask;
+ RTL_W8(cfg[i].reg, options);
+ }
+
+ RTL_W8(Cfg9346, Cfg9346_Lock);
++}
++
++static int rtl8169_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
++{
++ struct rtl8169_private *tp = netdev_priv(dev);
++
++ spin_lock_irq(&tp->lock);
+
+ if (wol->wolopts)
+ tp->features |= RTL_FEATURE_WOL;
+ else
+ tp->features &= ~RTL_FEATURE_WOL;
++ __rtl8169_set_wol(tp, wol->wolopts);
+ device_set_wakeup_enable(&tp->pci_dev->dev, wol->wolopts);
+
+ spin_unlock_irq(&tp->lock);
+@@ -2546,6 +2562,12 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
+
+ device_set_wakeup_enable(&pdev->dev, tp->features & RTL_FEATURE_WOL);
+
++ if (pci_dev_run_wake(pdev)) {
++ pm_runtime_set_active(&pdev->dev);
++ pm_runtime_enable(&pdev->dev);
++ }
++ pm_runtime_idle(&pdev->dev);
++
+ out:
+ return rc;
+
+@@ -2568,10 +2590,18 @@ static void __devexit rtl8169_remove_one(struct pci_dev *pdev)
+ struct net_device *dev = pci_get_drvdata(pdev);
+ struct rtl8169_private *tp = netdev_priv(dev);
+
++ pm_runtime_get_sync(&pdev->dev);
++
+ flush_scheduled_work();
+
+ unregister_netdev(dev);
+
++ if (pci_dev_run_wake(pdev)) {
++ pm_runtime_disable(&pdev->dev);
++ pm_runtime_set_suspended(&pdev->dev);
++ }
++ pm_runtime_put_noidle(&pdev->dev);
++
+ /* restore original MAC address */
+ rtl_rar_set(tp, dev->perm_addr);
+
+@@ -2598,6 +2628,7 @@ static int rtl8169_open(struct net_device *dev)
+ struct pci_dev *pdev = tp->pci_dev;
+ int retval = -ENOMEM;
+
++ pm_runtime_get_sync(&pdev->dev);
+
+ /*
+ * Note that we use a magic value here, its wierd I know
+@@ -2618,7 +2649,7 @@ static int rtl8169_open(struct net_device *dev)
+ tp->TxDescArray = pci_alloc_consistent(pdev, R8169_TX_RING_BYTES,
+ &tp->TxPhyAddr);
+ if (!tp->TxDescArray)
+- goto out;
++ goto err_pm_runtime_put;
+
+ tp->RxDescArray = pci_alloc_consistent(pdev, R8169_RX_RING_BYTES,
+ &tp->RxPhyAddr);
+@@ -2645,6 +2676,9 @@ static int rtl8169_open(struct net_device *dev)
+
+ rtl8169_request_timer(dev);
+
++ tp->saved_wolopts = 0;
++ pm_runtime_put_noidle(&pdev->dev);
++
+ rtl8169_check_link_status(dev, tp, tp->mmio_addr);
+ out:
+ return retval;
+@@ -2654,9 +2688,13 @@ err_release_ring_2:
+ err_free_rx_1:
+ pci_free_consistent(pdev, R8169_RX_RING_BYTES, tp->RxDescArray,
+ tp->RxPhyAddr);
++ tp->RxDescArray = NULL;
+ err_free_tx_0:
+ pci_free_consistent(pdev, R8169_TX_RING_BYTES, tp->TxDescArray,
+ tp->TxPhyAddr);
++ tp->TxDescArray = NULL;
++err_pm_runtime_put:
++ pm_runtime_put_noidle(&pdev->dev);
+ goto out;
+ }
+
+@@ -4065,6 +4103,8 @@ static int rtl8169_close(struct net_device *dev)
+ struct rtl8169_private *tp = netdev_priv(dev);
+ struct pci_dev *pdev = tp->pci_dev;
+
++ pm_runtime_get_sync(&pdev->dev);
++
+ /* update counters before going down */
+ rtl8169_update_counters(dev);
+
+@@ -4079,6 +4119,8 @@ static int rtl8169_close(struct net_device *dev)
+ tp->TxDescArray = NULL;
+ tp->RxDescArray = NULL;
+
++ pm_runtime_put_sync(&pdev->dev);
++
+ return 0;
+ }
+
+@@ -4177,21 +4219,74 @@ static int rtl8169_suspend(struct device *device)
+ return 0;
+ }
+
++static void __rtl8169_resume(struct net_device *dev)
++{
++ netif_device_attach(dev);
++ rtl8169_schedule_work(dev, rtl8169_reset_task);
++}
++
+ static int rtl8169_resume(struct device *device)
+ {
+ struct pci_dev *pdev = to_pci_dev(device);
+ struct net_device *dev = pci_get_drvdata(pdev);
+
+- if (!netif_running(dev))
+- goto out;
++ if (netif_running(dev))
++ __rtl8169_resume(dev);
+
+- netif_device_attach(dev);
++ return 0;
++}
++
++static int rtl8169_runtime_suspend(struct device *device)
++{
++ struct pci_dev *pdev = to_pci_dev(device);
++ struct net_device *dev = pci_get_drvdata(pdev);
++ struct rtl8169_private *tp = netdev_priv(dev);
++
++ if (!tp->TxDescArray)
++ return 0;
++
++ spin_lock_irq(&tp->lock);
++ tp->saved_wolopts = __rtl8169_get_wol(tp);
++ __rtl8169_set_wol(tp, WAKE_ANY);
++ spin_unlock_irq(&tp->lock);
++
++ rtl8169_net_suspend(dev);
++
++ return 0;
++}
++
++static int rtl8169_runtime_resume(struct device *device)
++{
++ struct pci_dev *pdev = to_pci_dev(device);
++ struct net_device *dev = pci_get_drvdata(pdev);
++ struct rtl8169_private *tp = netdev_priv(dev);
++
++ if (!tp->TxDescArray)
++ return 0;
++
++ spin_lock_irq(&tp->lock);
++ __rtl8169_set_wol(tp, tp->saved_wolopts);
++ tp->saved_wolopts = 0;
++ spin_unlock_irq(&tp->lock);
++
++ __rtl8169_resume(dev);
+
+- rtl8169_schedule_work(dev, rtl8169_reset_task);
+-out:
+ return 0;
+ }
+
++static int rtl8169_runtime_idle(struct device *device)
++{
++ struct pci_dev *pdev = to_pci_dev(device);
++ struct net_device *dev = pci_get_drvdata(pdev);
++ struct rtl8169_private *tp = netdev_priv(dev);
++
++ if (!tp->TxDescArray)
++ return 0;
++
++ rtl8169_check_link_status(dev, tp, tp->mmio_addr);
++ return -EBUSY;
++}
++
+ static const struct dev_pm_ops rtl8169_pm_ops = {
+ .suspend = rtl8169_suspend,
+ .resume = rtl8169_resume,
+@@ -4199,6 +4294,9 @@ static const struct dev_pm_ops rtl8169_pm_ops = {
+ .thaw = rtl8169_resume,
+ .poweroff = rtl8169_suspend,
+ .restore = rtl8169_resume,
++ .runtime_suspend = rtl8169_runtime_suspend,
++ .runtime_resume = rtl8169_runtime_resume,
++ .runtime_idle = rtl8169_runtime_idle,
+ };
+
+ #define RTL8169_PM_OPS (&rtl8169_pm_ops)
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0011-r8169-Fix-rtl8169_rx_interrupt.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0011-r8169-Fix-rtl8169_rx_interrupt.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,89 @@
+From: Eric Dumazet <eric.dumazet at gmail.com>
+Date: Wed, 31 Mar 2010 02:08:31 +0000
+Subject: [PATCH 11/47] r8169: Fix rtl8169_rx_interrupt()
+
+commit 630b943c182d1aed69f244405131902fbcba7ec6 upstream.
+
+In case a reset is performed, rtl8169_rx_interrupt() is called from
+process context instead of softirq context. Special care must be taken
+to call appropriate network core services (netif_rx() instead of
+netif_receive_skb()). VLAN handling also corrected.
+
+Reported-by: Sergey Senozhatsky <sergey.senozhatsky at gmail.com>
+Tested-by: Sergey Senozhatsky <sergey.senozhatsky at gmail.com>
+Diagnosed-by: Oleg Nesterov <oleg at redhat.com>
+Signed-off-by: Eric Dumazet <eric.dumazet at gmail.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/r8169.c | 22 +++++++++++++++++-----
+ 1 files changed, 17 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index 86588e9..df7d3ee 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -1070,14 +1070,14 @@ static void rtl8169_vlan_rx_register(struct net_device *dev,
+ }
+
+ static int rtl8169_rx_vlan_skb(struct rtl8169_private *tp, struct RxDesc *desc,
+- struct sk_buff *skb)
++ struct sk_buff *skb, int polling)
+ {
+ u32 opts2 = le32_to_cpu(desc->opts2);
+ struct vlan_group *vlgrp = tp->vlgrp;
+ int ret;
+
+ if (vlgrp && (opts2 & RxVlanTag)) {
+- vlan_hwaccel_receive_skb(skb, vlgrp, swab16(opts2 & 0xffff));
++ __vlan_hwaccel_rx(skb, vlgrp, swab16(opts2 & 0xffff), polling);
+ ret = 0;
+ } else
+ ret = -1;
+@@ -1094,7 +1094,7 @@ static inline u32 rtl8169_tx_vlan_tag(struct rtl8169_private *tp,
+ }
+
+ static int rtl8169_rx_vlan_skb(struct rtl8169_private *tp, struct RxDesc *desc,
+- struct sk_buff *skb)
++ struct sk_buff *skb, int polling)
+ {
+ return -1;
+ }
+@@ -3839,12 +3839,20 @@ out:
+ return done;
+ }
+
++/*
++ * Warning : rtl8169_rx_interrupt() might be called :
++ * 1) from NAPI (softirq) context
++ * (polling = 1 : we should call netif_receive_skb())
++ * 2) from process context (rtl8169_reset_task())
++ * (polling = 0 : we must call netif_rx() instead)
++ */
+ static int rtl8169_rx_interrupt(struct net_device *dev,
+ struct rtl8169_private *tp,
+ void __iomem *ioaddr, u32 budget)
+ {
+ unsigned int cur_rx, rx_left;
+ unsigned int delta, count;
++ int polling = (budget != ~(u32)0) ? 1 : 0;
+
+ cur_rx = tp->cur_rx;
+ rx_left = NUM_RX_DESC + tp->dirty_rx - cur_rx;
+@@ -3906,8 +3914,12 @@ static int rtl8169_rx_interrupt(struct net_device *dev,
+ skb_put(skb, pkt_size);
+ skb->protocol = eth_type_trans(skb, dev);
+
+- if (rtl8169_rx_vlan_skb(tp, desc, skb) < 0)
+- netif_receive_skb(skb);
++ if (rtl8169_rx_vlan_skb(tp, desc, skb, polling) < 0) {
++ if (likely(polling))
++ netif_receive_skb(skb);
++ else
++ netif_rx(skb);
++ }
+
+ dev->stats.rx_bytes += pkt_size;
+ dev->stats.rx_packets++;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0012-r8169-failure-to-enable-mwi-should-not-be-fatal.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0012-r8169-failure-to-enable-mwi-should-not-be-fatal.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,125 @@
+From: =?UTF-8?q?fran=C3=A7ois=20romieu?= <romieu at fr.zoreil.com>
+Date: Mon, 26 Apr 2010 11:42:06 +0000
+Subject: [PATCH 12/47] r8169: failure to enable mwi should not be fatal
+
+commit 87aeec767e1de60d7f76abbb44df5372b0932b7b upstream.
+
+Few (6) network drivers enable mwi explicitly. Fewer worry about a
+failure.
+
+It is not a fix but it should avoid some annoyance like
+http://bugzilla.kernel.org/show_bug.cgi?id=15454
+
+Signed-off-by: Francois Romieu <romieu at fr.zoreil.com>
+Cc: Conrad Kostecki <conikost at gmx.de>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/r8169.c | 27 +++++++++++++--------------
+ 1 files changed, 13 insertions(+), 14 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index df7d3ee..d3de684 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -2124,6 +2124,7 @@ static void rtl8169_release_board(struct pci_dev *pdev, struct net_device *dev,
+ {
+ iounmap(ioaddr);
+ pci_release_regions(pdev);
++ pci_clear_mwi(pdev);
+ pci_disable_device(pdev);
+ free_netdev(dev);
+ }
+@@ -2389,9 +2390,8 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
+ goto err_out_free_dev_1;
+ }
+
+- rc = pci_set_mwi(pdev);
+- if (rc < 0)
+- goto err_out_disable_2;
++ if (pci_set_mwi(pdev) < 0)
++ netif_info(tp, probe, dev, "Mem-Wr-Inval unavailable\n");
+
+ /* make sure PCI base addr 1 is MMIO */
+ if (!(pci_resource_flags(pdev, region) & IORESOURCE_MEM)) {
+@@ -2399,7 +2399,7 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
+ "region #%d not an MMIO resource, aborting\n",
+ region);
+ rc = -ENODEV;
+- goto err_out_mwi_3;
++ goto err_out_mwi_2;
+ }
+
+ /* check for weird/broken PCI region reporting */
+@@ -2407,13 +2407,13 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
+ netif_err(tp, probe, dev,
+ "Invalid PCI region size(s), aborting\n");
+ rc = -ENODEV;
+- goto err_out_mwi_3;
++ goto err_out_mwi_2;
+ }
+
+ rc = pci_request_regions(pdev, MODULENAME);
+ if (rc < 0) {
+ netif_err(tp, probe, dev, "could not request regions\n");
+- goto err_out_mwi_3;
++ goto err_out_mwi_2;
+ }
+
+ tp->cp_cmd = PCIMulRW | RxChkSum;
+@@ -2426,7 +2426,7 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
+ rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
+ if (rc < 0) {
+ netif_err(tp, probe, dev, "DMA configuration failed\n");
+- goto err_out_free_res_4;
++ goto err_out_free_res_3;
+ }
+ }
+
+@@ -2435,7 +2435,7 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
+ if (!ioaddr) {
+ netif_err(tp, probe, dev, "cannot remap MMIO, aborting\n");
+ rc = -EIO;
+- goto err_out_free_res_4;
++ goto err_out_free_res_3;
+ }
+
+ tp->pcie_cap = pci_find_capability(pdev, PCI_CAP_ID_EXP);
+@@ -2477,7 +2477,7 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
+ if (i == ARRAY_SIZE(rtl_chip_info)) {
+ dev_err(&pdev->dev,
+ "driver bug, MAC version not found in rtl_chip_info\n");
+- goto err_out_msi_5;
++ goto err_out_msi_4;
+ }
+ tp->chipset = i;
+
+@@ -2542,7 +2542,7 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
+
+ rc = register_netdev(dev);
+ if (rc < 0)
+- goto err_out_msi_5;
++ goto err_out_msi_4;
+
+ pci_set_drvdata(pdev, dev);
+
+@@ -2571,14 +2571,13 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
+ out:
+ return rc;
+
+-err_out_msi_5:
++err_out_msi_4:
+ rtl_disable_msi(pdev, tp);
+ iounmap(ioaddr);
+-err_out_free_res_4:
++err_out_free_res_3:
+ pci_release_regions(pdev);
+-err_out_mwi_3:
++err_out_mwi_2:
+ pci_clear_mwi(pdev);
+-err_out_disable_2:
+ pci_disable_device(pdev);
+ err_out_free_dev_1:
+ free_netdev(dev);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0013-r8169-remove-unnecessary-cast-of-readl-s-return-valu.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0013-r8169-remove-unnecessary-cast-of-readl-s-return-valu.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,32 @@
+From: Junchang Wang <junchangwang at gmail.com>
+Date: Sun, 30 May 2010 02:26:07 +0000
+Subject: [PATCH 13/47] r8169: remove unnecessary cast of readl()'s return
+ value
+
+commit 06f555f35fcc917c2b3c32fe151ec370ad47db35 upstream.
+
+readl() returns a 32-bit integer on all platforms.
+There is no need to cast its return value.
+
+Signed-off-by: Junchang Wang <junchangwang at gmail.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/r8169.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index d3de684..31872dd 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -89,7 +89,7 @@ static const int multicast_filter_limit = 32;
+ #define RTL_W32(reg, val32) writel ((val32), ioaddr + (reg))
+ #define RTL_R8(reg) readb (ioaddr + (reg))
+ #define RTL_R16(reg) readw (ioaddr + (reg))
+-#define RTL_R32(reg) ((unsigned long) readl (ioaddr + (reg)))
++#define RTL_R32(reg) readl (ioaddr + (reg))
+
+ enum mac_version {
+ RTL_GIGA_MAC_NONE = 0x00,
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0014-r8169-incorrect-identifier-for-a-8168dp.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0014-r8169-incorrect-identifier-for-a-8168dp.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,34 @@
+From: Francois Romieu <romieu at fr.zoreil.com>
+Date: Sun, 11 Jul 2010 17:10:09 -0700
+Subject: [PATCH 14/47] r8169: incorrect identifier for a 8168dp
+
+commit 17c99297212a2d1b1779a08caf4b0d83a85545df upstream.
+
+Merge error.
+
+See CFG_METHOD_8 (0x3c800000 + 0x00300000) since version 8.002.00
+of Realtek's driver.
+
+Signed-off-by: Francois Romieu <romieu at fr.zoreil.com>
+Cc: Hayes <hayeswang at realtek.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/r8169.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index 31872dd..65fe2cd 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -1317,7 +1317,7 @@ static void rtl8169_get_mac_version(struct rtl8169_private *tp,
+ { 0x7c800000, 0x28000000, RTL_GIGA_MAC_VER_26 },
+
+ /* 8168C family. */
+- { 0x7cf00000, 0x3ca00000, RTL_GIGA_MAC_VER_24 },
++ { 0x7cf00000, 0x3cb00000, RTL_GIGA_MAC_VER_24 },
+ { 0x7cf00000, 0x3c900000, RTL_GIGA_MAC_VER_23 },
+ { 0x7cf00000, 0x3c800000, RTL_GIGA_MAC_VER_18 },
+ { 0x7c800000, 0x3c800000, RTL_GIGA_MAC_VER_24 },
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0015-r8169-fix-rx-checksum-offload.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0015-r8169-fix-rx-checksum-offload.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,63 @@
+From: Eric Dumazet <eric.dumazet at gmail.com>
+Date: Sun, 5 Sep 2010 20:04:05 -0700
+Subject: [PATCH 15/47] r8169: fix rx checksum offload
+
+commit adea1ac7effbddbe60a9de6d63462bfe79289e59 upstream.
+
+While porting GRO to r8169, I found this driver has a bug in its rx
+path.
+
+All skbs given to network stack had their ip_summed set to
+CHECKSUM_NONE, while hardware said they had correct TCP/UDP checksums.
+
+The reason is driver sets skb->ip_summed on the original skb before the
+copy eventually done by copybreak. The fresh skb gets the ip_summed =
+CHECKSUM_NONE value, forcing network stack to recompute checksum, and
+preventing my GRO patch to work.
+
+Fix is to make the ip_summed setting after skb copy.
+
+Note : rx_copybreak current value is 16383, so all frames are copied...
+
+Signed-off-by: Eric Dumazet <eric.dumazet at gmail.com>
+Acked-by: Francois Romieu <romieu at fr.zoreil.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/r8169.c | 6 ++----
+ 1 files changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index 65fe2cd..2799b38 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -3802,9 +3802,8 @@ static inline int rtl8169_fragmented_frame(u32 status)
+ return (status & (FirstFrag | LastFrag)) != (FirstFrag | LastFrag);
+ }
+
+-static inline void rtl8169_rx_csum(struct sk_buff *skb, struct RxDesc *desc)
++static inline void rtl8169_rx_csum(struct sk_buff *skb, u32 opts1)
+ {
+- u32 opts1 = le32_to_cpu(desc->opts1);
+ u32 status = opts1 & RxProtoMask;
+
+ if (((status == RxProtoTCP) && !(opts1 & TCPFail)) ||
+@@ -3898,8 +3897,6 @@ static int rtl8169_rx_interrupt(struct net_device *dev,
+ continue;
+ }
+
+- rtl8169_rx_csum(skb, desc);
+-
+ if (rtl8169_try_rx_copy(&skb, tp, pkt_size, addr)) {
+ pci_dma_sync_single_for_device(pdev, addr,
+ pkt_size, PCI_DMA_FROMDEVICE);
+@@ -3910,6 +3907,7 @@ static int rtl8169_rx_interrupt(struct net_device *dev,
+ tp->Rx_skbuff[entry] = NULL;
+ }
+
++ rtl8169_rx_csum(skb, status);
+ skb_put(skb, pkt_size);
+ skb->protocol = eth_type_trans(skb, dev);
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0016-r8169-add-gro-support.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0016-r8169-add-gro-support.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,56 @@
+From: Eric Dumazet <eric.dumazet at gmail.com>
+Date: Mon, 6 Sep 2010 18:46:39 +0000
+Subject: [PATCH 16/47] r8169: add gro support
+
+commit 2edae08e5b75269855fef3c74fe4292c066e7c33 upstream.
+
+- Use napi_gro_receive() and vlan_gro_receive()
+- Enable GRO by default
+
+Tested on a RTL8111/8168 adapter
+
+Signed-off-by: Eric Dumazet <eric.dumazet at gmail.com>
+Acked-by: Francois Romieu <romieu at fr.zoreil.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/r8169.c | 10 ++++++++--
+ 1 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index 2799b38..e4aa846 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -1077,7 +1077,12 @@ static int rtl8169_rx_vlan_skb(struct rtl8169_private *tp, struct RxDesc *desc,
+ int ret;
+
+ if (vlgrp && (opts2 & RxVlanTag)) {
+- __vlan_hwaccel_rx(skb, vlgrp, swab16(opts2 & 0xffff), polling);
++ u16 vtag = swab16(opts2 & 0xffff);
++
++ if (likely(polling))
++ vlan_gro_receive(&tp->napi, vlgrp, vtag, skb);
++ else
++ __vlan_hwaccel_rx(skb, vlgrp, vtag, polling);
+ ret = 0;
+ } else
+ ret = -1;
+@@ -2529,6 +2534,7 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
+ #ifdef CONFIG_R8169_VLAN
+ dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
+ #endif
++ dev->features |= NETIF_F_GRO;
+
+ tp->intr_mask = 0xffff;
+ tp->align = cfg->align;
+@@ -3913,7 +3919,7 @@ static int rtl8169_rx_interrupt(struct net_device *dev,
+
+ if (rtl8169_rx_vlan_skb(tp, desc, skb, polling) < 0) {
+ if (likely(polling))
+- netif_receive_skb(skb);
++ napi_gro_receive(&tp->napi, skb);
+ else
+ netif_rx(skb);
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0017-r8169-use-device-model-DMA-API.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0017-r8169-use-device-model-DMA-API.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,170 @@
+From: Stanislaw Gruszka <sgruszka at redhat.com>
+Date: Fri, 8 Oct 2010 04:25:01 +0000
+Subject: [PATCH 17/47] r8169: use device model DMA API
+
+commit 82553bb6218d2707d2e6446d7b2313dfd60b48a8 upstream.
+
+Use DMA API as PCI equivalents will be deprecated. This change also
+allow to allocate with GFP_KERNEL where possible.
+
+Tested-by: Neal Becker <ndbecker2 at gmail.com>
+Signed-off-by: Stanislaw Gruszka <sgruszka at redhat.com>
+Acked-by: Eric Dumazet <eric.dumazet at gmail.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/r8169.c | 53 +++++++++++++++++++++++++++-----------------------
+ 1 files changed, 29 insertions(+), 24 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index e4aa846..e3be391 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -1218,7 +1218,8 @@ static void rtl8169_update_counters(struct net_device *dev)
+ if ((RTL_R8(ChipCmd) & CmdRxEnb) == 0)
+ return;
+
+- counters = pci_alloc_consistent(tp->pci_dev, sizeof(*counters), &paddr);
++ counters = dma_alloc_coherent(&tp->pci_dev->dev, sizeof(*counters),
++ &paddr, GFP_KERNEL);
+ if (!counters)
+ return;
+
+@@ -1239,7 +1240,8 @@ static void rtl8169_update_counters(struct net_device *dev)
+ RTL_W32(CounterAddrLow, 0);
+ RTL_W32(CounterAddrHigh, 0);
+
+- pci_free_consistent(tp->pci_dev, sizeof(*counters), counters, paddr);
++ dma_free_coherent(&tp->pci_dev->dev, sizeof(*counters), counters,
++ paddr);
+ }
+
+ static void rtl8169_get_ethtool_stats(struct net_device *dev,
+@@ -2649,15 +2651,15 @@ static int rtl8169_open(struct net_device *dev)
+
+ /*
+ * Rx and Tx desscriptors needs 256 bytes alignment.
+- * pci_alloc_consistent provides more.
++ * dma_alloc_coherent provides more.
+ */
+- tp->TxDescArray = pci_alloc_consistent(pdev, R8169_TX_RING_BYTES,
+- &tp->TxPhyAddr);
++ tp->TxDescArray = dma_alloc_coherent(&pdev->dev, R8169_TX_RING_BYTES,
++ &tp->TxPhyAddr, GFP_KERNEL);
+ if (!tp->TxDescArray)
+ goto err_pm_runtime_put;
+
+- tp->RxDescArray = pci_alloc_consistent(pdev, R8169_RX_RING_BYTES,
+- &tp->RxPhyAddr);
++ tp->RxDescArray = dma_alloc_coherent(&pdev->dev, R8169_RX_RING_BYTES,
++ &tp->RxPhyAddr, GFP_KERNEL);
+ if (!tp->RxDescArray)
+ goto err_free_tx_0;
+
+@@ -2691,12 +2693,12 @@ out:
+ err_release_ring_2:
+ rtl8169_rx_clear(tp);
+ err_free_rx_1:
+- pci_free_consistent(pdev, R8169_RX_RING_BYTES, tp->RxDescArray,
+- tp->RxPhyAddr);
++ dma_free_coherent(&pdev->dev, R8169_RX_RING_BYTES, tp->RxDescArray,
++ tp->RxPhyAddr);
+ tp->RxDescArray = NULL;
+ err_free_tx_0:
+- pci_free_consistent(pdev, R8169_TX_RING_BYTES, tp->TxDescArray,
+- tp->TxPhyAddr);
++ dma_free_coherent(&pdev->dev, R8169_TX_RING_BYTES, tp->TxDescArray,
++ tp->TxPhyAddr);
+ tp->TxDescArray = NULL;
+ err_pm_runtime_put:
+ pm_runtime_put_noidle(&pdev->dev);
+@@ -3333,7 +3335,7 @@ static void rtl8169_free_rx_skb(struct rtl8169_private *tp,
+ {
+ struct pci_dev *pdev = tp->pci_dev;
+
+- pci_unmap_single(pdev, le64_to_cpu(desc->addr), tp->rx_buf_sz,
++ dma_unmap_single(&pdev->dev, le64_to_cpu(desc->addr), tp->rx_buf_sz,
+ PCI_DMA_FROMDEVICE);
+ dev_kfree_skb(*sk_buff);
+ *sk_buff = NULL;
+@@ -3372,7 +3374,7 @@ static struct sk_buff *rtl8169_alloc_rx_skb(struct pci_dev *pdev,
+
+ skb_reserve(skb, align ? ((pad - 1) & (unsigned long)skb->data) : pad);
+
+- mapping = pci_map_single(pdev, skb->data, rx_buf_sz,
++ mapping = dma_map_single(&pdev->dev, skb->data, rx_buf_sz,
+ PCI_DMA_FROMDEVICE);
+
+ rtl8169_map_to_asic(desc, mapping, rx_buf_sz);
+@@ -3457,7 +3459,8 @@ static void rtl8169_unmap_tx_skb(struct pci_dev *pdev, struct ring_info *tx_skb,
+ {
+ unsigned int len = tx_skb->len;
+
+- pci_unmap_single(pdev, le64_to_cpu(desc->addr), len, PCI_DMA_TODEVICE);
++ dma_unmap_single(&pdev->dev, le64_to_cpu(desc->addr), len,
++ PCI_DMA_TODEVICE);
+ desc->opts1 = 0x00;
+ desc->opts2 = 0x00;
+ desc->addr = 0x00;
+@@ -3601,7 +3604,8 @@ static int rtl8169_xmit_frags(struct rtl8169_private *tp, struct sk_buff *skb,
+ txd = tp->TxDescArray + entry;
+ len = frag->size;
+ addr = ((void *) page_address(frag->page)) + frag->page_offset;
+- mapping = pci_map_single(tp->pci_dev, addr, len, PCI_DMA_TODEVICE);
++ mapping = dma_map_single(&tp->pci_dev->dev, addr, len,
++ PCI_DMA_TODEVICE);
+
+ /* anti gcc 2.95.3 bugware (sic) */
+ status = opts1 | len | (RingEnd * !((entry + 1) % NUM_TX_DESC));
+@@ -3671,7 +3675,8 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
+ tp->tx_skb[entry].skb = skb;
+ }
+
+- mapping = pci_map_single(tp->pci_dev, skb->data, len, PCI_DMA_TODEVICE);
++ mapping = dma_map_single(&tp->pci_dev->dev, skb->data, len,
++ PCI_DMA_TODEVICE);
+
+ tp->tx_skb[entry].len = len;
+ txd->addr = cpu_to_le64(mapping);
+@@ -3834,8 +3839,8 @@ static inline bool rtl8169_try_rx_copy(struct sk_buff **sk_buff,
+ if (!skb)
+ goto out;
+
+- pci_dma_sync_single_for_cpu(tp->pci_dev, addr, pkt_size,
+- PCI_DMA_FROMDEVICE);
++ dma_sync_single_for_cpu(&tp->pci_dev->dev, addr, pkt_size,
++ PCI_DMA_FROMDEVICE);
+ skb_copy_from_linear_data(*sk_buff, skb->data, pkt_size);
+ *sk_buff = skb;
+ done = true;
+@@ -3904,11 +3909,11 @@ static int rtl8169_rx_interrupt(struct net_device *dev,
+ }
+
+ if (rtl8169_try_rx_copy(&skb, tp, pkt_size, addr)) {
+- pci_dma_sync_single_for_device(pdev, addr,
++ dma_sync_single_for_device(&pdev->dev, addr,
+ pkt_size, PCI_DMA_FROMDEVICE);
+ rtl8169_mark_to_asic(desc, tp->rx_buf_sz);
+ } else {
+- pci_unmap_single(pdev, addr, tp->rx_buf_sz,
++ dma_unmap_single(&pdev->dev, addr, tp->rx_buf_sz,
+ PCI_DMA_FROMDEVICE);
+ tp->Rx_skbuff[entry] = NULL;
+ }
+@@ -4127,10 +4132,10 @@ static int rtl8169_close(struct net_device *dev)
+
+ free_irq(dev->irq, dev);
+
+- pci_free_consistent(pdev, R8169_RX_RING_BYTES, tp->RxDescArray,
+- tp->RxPhyAddr);
+- pci_free_consistent(pdev, R8169_TX_RING_BYTES, tp->TxDescArray,
+- tp->TxPhyAddr);
++ dma_free_coherent(&pdev->dev, R8169_RX_RING_BYTES, tp->RxDescArray,
++ tp->RxPhyAddr);
++ dma_free_coherent(&pdev->dev, R8169_TX_RING_BYTES, tp->TxDescArray,
++ tp->TxPhyAddr);
+ tp->TxDescArray = NULL;
+ tp->RxDescArray = NULL;
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0018-r8169-use-50-less-ram-for-RX-ring.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0018-r8169-use-50-less-ram-for-RX-ring.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,382 @@
+From: Eric Dumazet <eric.dumazet at gmail.com>
+Date: Mon, 11 Oct 2010 11:17:47 +0000
+Subject: [PATCH 18/47] r8169: use 50% less ram for RX ring
+
+commit 6f0333b8fde44b8c04a53b2461504f0e8f1cebe6 upstream.
+
+Using standard skb allocations in r8169 leads to order-3 allocations (if
+PAGE_SIZE=4096), because NIC needs 16383 bytes, and skb overhead makes
+this bigger than 16384 -> 32768 bytes per "skb"
+
+Using kmalloc() permits to reduce memory requirements of one r8169 nic
+by 4Mbytes. (256 frames * 16Kbytes). This is fine since a hardware bug
+requires us to copy incoming frames, so we build real skb when doing
+this copy.
+
+Signed-off-by: Eric Dumazet <eric.dumazet at gmail.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/r8169.c | 183 ++++++++++++++++++---------------------------------
+ 1 files changed, 64 insertions(+), 119 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index e3be391..63f1da9 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -188,12 +188,7 @@ static DEFINE_PCI_DEVICE_TABLE(rtl8169_pci_tbl) = {
+
+ MODULE_DEVICE_TABLE(pci, rtl8169_pci_tbl);
+
+-/*
+- * we set our copybreak very high so that we don't have
+- * to allocate 16k frames all the time (see note in
+- * rtl8169_open()
+- */
+-static int rx_copybreak = 16383;
++static int rx_buf_sz = 16383;
+ static int use_dac;
+ static struct {
+ u32 msg_enable;
+@@ -485,10 +480,8 @@ struct rtl8169_private {
+ struct RxDesc *RxDescArray; /* 256-aligned Rx descriptor ring */
+ dma_addr_t TxPhyAddr;
+ dma_addr_t RxPhyAddr;
+- struct sk_buff *Rx_skbuff[NUM_RX_DESC]; /* Rx data buffers */
++ void *Rx_databuff[NUM_RX_DESC]; /* Rx data buffers */
+ struct ring_info tx_skb[NUM_TX_DESC]; /* Tx data buffers */
+- unsigned align;
+- unsigned rx_buf_sz;
+ struct timer_list timer;
+ u16 cp_cmd;
+ u16 intr_event;
+@@ -516,8 +509,6 @@ struct rtl8169_private {
+
+ MODULE_AUTHOR("Realtek and the Linux r8169 crew <netdev at vger.kernel.org>");
+ MODULE_DESCRIPTION("RealTek RTL-8169 Gigabit Ethernet driver");
+-module_param(rx_copybreak, int, 0);
+-MODULE_PARM_DESC(rx_copybreak, "Copy breakpoint for copy-only-tiny-frames");
+ module_param(use_dac, int, 0);
+ MODULE_PARM_DESC(use_dac, "Enable PCI DAC. Unsafe on 32 bit PCI slot.");
+ module_param_named(debug, debug.msg_enable, int, 0);
+@@ -2539,7 +2530,6 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
+ dev->features |= NETIF_F_GRO;
+
+ tp->intr_mask = 0xffff;
+- tp->align = cfg->align;
+ tp->hw_start = cfg->hw_start;
+ tp->intr_event = cfg->intr_event;
+ tp->napi_event = cfg->napi_event;
+@@ -2617,18 +2607,6 @@ static void __devexit rtl8169_remove_one(struct pci_dev *pdev)
+ pci_set_drvdata(pdev, NULL);
+ }
+
+-static void rtl8169_set_rxbufsize(struct rtl8169_private *tp,
+- unsigned int mtu)
+-{
+- unsigned int max_frame = mtu + VLAN_ETH_HLEN + ETH_FCS_LEN;
+-
+- if (max_frame != 16383)
+- printk(KERN_WARNING PFX "WARNING! Changing of MTU on this "
+- "NIC may lead to frame reception errors!\n");
+-
+- tp->rx_buf_sz = (max_frame > RX_BUF_SIZE) ? max_frame : RX_BUF_SIZE;
+-}
+-
+ static int rtl8169_open(struct net_device *dev)
+ {
+ struct rtl8169_private *tp = netdev_priv(dev);
+@@ -2638,18 +2616,6 @@ static int rtl8169_open(struct net_device *dev)
+ pm_runtime_get_sync(&pdev->dev);
+
+ /*
+- * Note that we use a magic value here, its wierd I know
+- * its done because, some subset of rtl8169 hardware suffers from
+- * a problem in which frames received that are longer than
+- * the size set in RxMaxSize register return garbage sizes
+- * when received. To avoid this we need to turn off filtering,
+- * which is done by setting a value of 16383 in the RxMaxSize register
+- * and allocating 16k frames to handle the largest possible rx value
+- * thats what the magic math below does.
+- */
+- rtl8169_set_rxbufsize(tp, 16383 - VLAN_ETH_HLEN - ETH_FCS_LEN);
+-
+- /*
+ * Rx and Tx desscriptors needs 256 bytes alignment.
+ * dma_alloc_coherent provides more.
+ */
+@@ -2825,7 +2791,7 @@ static void rtl_hw_start_8169(struct net_device *dev)
+
+ RTL_W8(EarlyTxThres, EarlyTxThld);
+
+- rtl_set_rx_max_size(ioaddr, tp->rx_buf_sz);
++ rtl_set_rx_max_size(ioaddr, rx_buf_sz);
+
+ if ((tp->mac_version == RTL_GIGA_MAC_VER_01) ||
+ (tp->mac_version == RTL_GIGA_MAC_VER_02) ||
+@@ -3086,7 +3052,7 @@ static void rtl_hw_start_8168(struct net_device *dev)
+
+ RTL_W8(EarlyTxThres, EarlyTxThld);
+
+- rtl_set_rx_max_size(ioaddr, tp->rx_buf_sz);
++ rtl_set_rx_max_size(ioaddr, rx_buf_sz);
+
+ tp->cp_cmd |= RTL_R16(CPlusCmd) | PktCntrDisable | INTT_1;
+
+@@ -3267,7 +3233,7 @@ static void rtl_hw_start_8101(struct net_device *dev)
+
+ RTL_W8(EarlyTxThres, EarlyTxThld);
+
+- rtl_set_rx_max_size(ioaddr, tp->rx_buf_sz);
++ rtl_set_rx_max_size(ioaddr, rx_buf_sz);
+
+ tp->cp_cmd |= rtl_rw_cpluscmd(ioaddr) | PCIMulRW;
+
+@@ -3308,8 +3274,6 @@ static int rtl8169_change_mtu(struct net_device *dev, int new_mtu)
+
+ rtl8169_down(dev);
+
+- rtl8169_set_rxbufsize(tp, dev->mtu);
+-
+ ret = rtl8169_init_ring(dev);
+ if (ret < 0)
+ goto out;
+@@ -3330,15 +3294,15 @@ static inline void rtl8169_make_unusable_by_asic(struct RxDesc *desc)
+ desc->opts1 &= ~cpu_to_le32(DescOwn | RsvdMask);
+ }
+
+-static void rtl8169_free_rx_skb(struct rtl8169_private *tp,
+- struct sk_buff **sk_buff, struct RxDesc *desc)
++static void rtl8169_free_rx_databuff(struct rtl8169_private *tp,
++ void **data_buff, struct RxDesc *desc)
+ {
+ struct pci_dev *pdev = tp->pci_dev;
+
+- dma_unmap_single(&pdev->dev, le64_to_cpu(desc->addr), tp->rx_buf_sz,
++ dma_unmap_single(&pdev->dev, le64_to_cpu(desc->addr), rx_buf_sz,
+ PCI_DMA_FROMDEVICE);
+- dev_kfree_skb(*sk_buff);
+- *sk_buff = NULL;
++ kfree(*data_buff);
++ *data_buff = NULL;
+ rtl8169_make_unusable_by_asic(desc);
+ }
+
+@@ -3357,33 +3321,34 @@ static inline void rtl8169_map_to_asic(struct RxDesc *desc, dma_addr_t mapping,
+ rtl8169_mark_to_asic(desc, rx_buf_sz);
+ }
+
+-static struct sk_buff *rtl8169_alloc_rx_skb(struct pci_dev *pdev,
++static inline void *rtl8169_align(void *data)
++{
++ return (void *)ALIGN((long)data, 16);
++}
++
++static struct sk_buff *rtl8169_alloc_rx_data(struct pci_dev *pdev,
+ struct net_device *dev,
+- struct RxDesc *desc, int rx_buf_sz,
+- unsigned int align, gfp_t gfp)
++ struct RxDesc *desc)
+ {
+- struct sk_buff *skb;
++ void *data;
+ dma_addr_t mapping;
+- unsigned int pad;
++ int node = dev->dev.parent ? dev_to_node(dev->dev.parent) : -1;
+
+- pad = align ? align : NET_IP_ALIGN;
++ data = kmalloc_node(rx_buf_sz, GFP_KERNEL, node);
++ if (!data)
++ return NULL;
+
+- skb = __netdev_alloc_skb(dev, rx_buf_sz + pad, gfp);
+- if (!skb)
+- goto err_out;
+-
+- skb_reserve(skb, align ? ((pad - 1) & (unsigned long)skb->data) : pad);
+-
+- mapping = dma_map_single(&pdev->dev, skb->data, rx_buf_sz,
++ if (rtl8169_align(data) != data) {
++ kfree(data);
++ data = kmalloc_node(rx_buf_sz + 15, GFP_KERNEL, node);
++ if (!data)
++ return NULL;
++ }
++ mapping = dma_map_single(&pdev->dev, rtl8169_align(data), rx_buf_sz,
+ PCI_DMA_FROMDEVICE);
+
+ rtl8169_map_to_asic(desc, mapping, rx_buf_sz);
+-out:
+- return skb;
+-
+-err_out:
+- rtl8169_make_unusable_by_asic(desc);
+- goto out;
++ return data;
+ }
+
+ static void rtl8169_rx_clear(struct rtl8169_private *tp)
+@@ -3391,8 +3356,8 @@ static void rtl8169_rx_clear(struct rtl8169_private *tp)
+ unsigned int i;
+
+ for (i = 0; i < NUM_RX_DESC; i++) {
+- if (tp->Rx_skbuff[i]) {
+- rtl8169_free_rx_skb(tp, tp->Rx_skbuff + i,
++ if (tp->Rx_databuff[i]) {
++ rtl8169_free_rx_databuff(tp, tp->Rx_databuff + i,
+ tp->RxDescArray + i);
+ }
+ }
+@@ -3404,21 +3369,21 @@ static u32 rtl8169_rx_fill(struct rtl8169_private *tp, struct net_device *dev,
+ u32 cur;
+
+ for (cur = start; end - cur != 0; cur++) {
+- struct sk_buff *skb;
++ void *data;
+ unsigned int i = cur % NUM_RX_DESC;
+
+ WARN_ON((s32)(end - cur) < 0);
+
+- if (tp->Rx_skbuff[i])
++ if (tp->Rx_databuff[i])
+ continue;
+
+- skb = rtl8169_alloc_rx_skb(tp->pci_dev, dev,
+- tp->RxDescArray + i,
+- tp->rx_buf_sz, tp->align, gfp);
+- if (!skb)
++ data = rtl8169_alloc_rx_data(tp->pci_dev, dev,
++ tp->RxDescArray + i);
++ if (!data) {
++ rtl8169_make_unusable_by_asic(tp->RxDescArray + i);
+ break;
+-
+- tp->Rx_skbuff[i] = skb;
++ }
++ tp->Rx_databuff[i] = data;
+ }
+ return cur - start;
+ }
+@@ -3440,7 +3405,7 @@ static int rtl8169_init_ring(struct net_device *dev)
+ rtl8169_init_ring_indexes(tp);
+
+ memset(tp->tx_skb, 0x0, NUM_TX_DESC * sizeof(struct ring_info));
+- memset(tp->Rx_skbuff, 0x0, NUM_RX_DESC * sizeof(struct sk_buff *));
++ memset(tp->Rx_databuff, 0x0, NUM_RX_DESC * sizeof(void *));
+
+ if (rtl8169_rx_fill(tp, dev, 0, NUM_RX_DESC, GFP_KERNEL) != NUM_RX_DESC)
+ goto err_out;
+@@ -3825,27 +3790,23 @@ static inline void rtl8169_rx_csum(struct sk_buff *skb, u32 opts1)
+ skb->ip_summed = CHECKSUM_NONE;
+ }
+
+-static inline bool rtl8169_try_rx_copy(struct sk_buff **sk_buff,
+- struct rtl8169_private *tp, int pkt_size,
+- dma_addr_t addr)
++static struct sk_buff *rtl8169_try_rx_copy(void *data,
++ struct rtl8169_private *tp,
++ int pkt_size,
++ dma_addr_t addr)
+ {
+ struct sk_buff *skb;
+- bool done = false;
+-
+- if (pkt_size >= rx_copybreak)
+- goto out;
+-
+- skb = netdev_alloc_skb_ip_align(tp->dev, pkt_size);
+- if (!skb)
+- goto out;
+
++ data = rtl8169_align(data);
+ dma_sync_single_for_cpu(&tp->pci_dev->dev, addr, pkt_size,
+ PCI_DMA_FROMDEVICE);
+- skb_copy_from_linear_data(*sk_buff, skb->data, pkt_size);
+- *sk_buff = skb;
+- done = true;
+-out:
+- return done;
++ prefetch(data);
++ skb = netdev_alloc_skb_ip_align(tp->dev, pkt_size);
++ if (skb)
++ memcpy(skb->data, data, pkt_size);
++ dma_sync_single_for_device(&tp->pci_dev->dev, addr, pkt_size,
++ PCI_DMA_FROMDEVICE);
++ return skb;
+ }
+
+ /*
+@@ -3860,7 +3821,7 @@ static int rtl8169_rx_interrupt(struct net_device *dev,
+ void __iomem *ioaddr, u32 budget)
+ {
+ unsigned int cur_rx, rx_left;
+- unsigned int delta, count;
++ unsigned int count;
+ int polling = (budget != ~(u32)0) ? 1 : 0;
+
+ cur_rx = tp->cur_rx;
+@@ -3889,12 +3850,11 @@ static int rtl8169_rx_interrupt(struct net_device *dev,
+ rtl8169_schedule_work(dev, rtl8169_reset_task);
+ dev->stats.rx_fifo_errors++;
+ }
+- rtl8169_mark_to_asic(desc, tp->rx_buf_sz);
++ rtl8169_mark_to_asic(desc, rx_buf_sz);
+ } else {
+- struct sk_buff *skb = tp->Rx_skbuff[entry];
++ struct sk_buff *skb;
+ dma_addr_t addr = le64_to_cpu(desc->addr);
+ int pkt_size = (status & 0x00001FFF) - 4;
+- struct pci_dev *pdev = tp->pci_dev;
+
+ /*
+ * The driver does not support incoming fragmented
+@@ -3904,18 +3864,16 @@ static int rtl8169_rx_interrupt(struct net_device *dev,
+ if (unlikely(rtl8169_fragmented_frame(status))) {
+ dev->stats.rx_dropped++;
+ dev->stats.rx_length_errors++;
+- rtl8169_mark_to_asic(desc, tp->rx_buf_sz);
++ rtl8169_mark_to_asic(desc, rx_buf_sz);
+ continue;
+ }
+
+- if (rtl8169_try_rx_copy(&skb, tp, pkt_size, addr)) {
+- dma_sync_single_for_device(&pdev->dev, addr,
+- pkt_size, PCI_DMA_FROMDEVICE);
+- rtl8169_mark_to_asic(desc, tp->rx_buf_sz);
+- } else {
+- dma_unmap_single(&pdev->dev, addr, tp->rx_buf_sz,
+- PCI_DMA_FROMDEVICE);
+- tp->Rx_skbuff[entry] = NULL;
++ skb = rtl8169_try_rx_copy(tp->Rx_databuff[entry],
++ tp, pkt_size, addr);
++ rtl8169_mark_to_asic(desc, rx_buf_sz);
++ if (!skb) {
++ dev->stats.rx_dropped++;
++ continue;
+ }
+
+ rtl8169_rx_csum(skb, status);
+@@ -3944,20 +3902,7 @@ static int rtl8169_rx_interrupt(struct net_device *dev,
+ count = cur_rx - tp->cur_rx;
+ tp->cur_rx = cur_rx;
+
+- delta = rtl8169_rx_fill(tp, dev, tp->dirty_rx, tp->cur_rx, GFP_ATOMIC);
+- if (!delta && count)
+- netif_info(tp, intr, dev, "no Rx buffer allocated\n");
+- tp->dirty_rx += delta;
+-
+- /*
+- * FIXME: until there is periodic timer to try and refill the ring,
+- * a temporary shortage may definitely kill the Rx process.
+- * - disable the asic to try and avoid an overflow and kick it again
+- * after refill ?
+- * - how do others driver handle this condition (Uh oh...).
+- */
+- if (tp->dirty_rx + NUM_RX_DESC == tp->cur_rx)
+- netif_emerg(tp, intr, dev, "Rx buffers exhausted\n");
++ tp->dirty_rx += count;
+
+ return count;
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0019-r8169-check-dma-mapping-failures.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0019-r8169-check-dma-mapping-failures.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,166 @@
+From: Stanislaw Gruszka <sgruszka at redhat.com>
+Date: Wed, 20 Oct 2010 22:25:36 +0000
+Subject: [PATCH 19/47] r8169: check dma mapping failures
+
+commit 3eafe50708deca10d155ccff597a91dcecc2d869 upstream.
+
+Check possible dma mapping errors and do clean up if it happens.
+
+Fix overwrap bug in rtl8169_tx_clear on the way.
+
+Signed-off-by: Stanislaw Gruszka <sgruszka at redhat.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/r8169.c | 66 +++++++++++++++++++++++++++++++++++++--------------
+ 1 files changed, 48 insertions(+), 18 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index 63f1da9..c7ba7c0 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -3344,11 +3344,18 @@ static struct sk_buff *rtl8169_alloc_rx_data(struct pci_dev *pdev,
+ if (!data)
+ return NULL;
+ }
++
+ mapping = dma_map_single(&pdev->dev, rtl8169_align(data), rx_buf_sz,
+ PCI_DMA_FROMDEVICE);
++ if (unlikely(dma_mapping_error(&pdev->dev, mapping)))
++ goto err_out;
+
+ rtl8169_map_to_asic(desc, mapping, rx_buf_sz);
+ return data;
++
++err_out:
++ kfree(data);
++ return NULL;
+ }
+
+ static void rtl8169_rx_clear(struct rtl8169_private *tp)
+@@ -3432,12 +3439,13 @@ static void rtl8169_unmap_tx_skb(struct pci_dev *pdev, struct ring_info *tx_skb,
+ tx_skb->len = 0;
+ }
+
+-static void rtl8169_tx_clear(struct rtl8169_private *tp)
++static void rtl8169_tx_clear_range(struct rtl8169_private *tp, u32 start,
++ unsigned int n)
+ {
+ unsigned int i;
+
+- for (i = tp->dirty_tx; i < tp->dirty_tx + NUM_TX_DESC; i++) {
+- unsigned int entry = i % NUM_TX_DESC;
++ for (i = 0; i < n; i++) {
++ unsigned int entry = (start + i) % NUM_TX_DESC;
+ struct ring_info *tx_skb = tp->tx_skb + entry;
+ unsigned int len = tx_skb->len;
+
+@@ -3453,6 +3461,11 @@ static void rtl8169_tx_clear(struct rtl8169_private *tp)
+ tp->dev->stats.tx_dropped++;
+ }
+ }
++}
++
++static void rtl8169_tx_clear(struct rtl8169_private *tp)
++{
++ rtl8169_tx_clear_range(tp, tp->dirty_tx, NUM_TX_DESC);
+ tp->cur_tx = tp->dirty_tx = 0;
+ }
+
+@@ -3571,6 +3584,8 @@ static int rtl8169_xmit_frags(struct rtl8169_private *tp, struct sk_buff *skb,
+ addr = ((void *) page_address(frag->page)) + frag->page_offset;
+ mapping = dma_map_single(&tp->pci_dev->dev, addr, len,
+ PCI_DMA_TODEVICE);
++ if (unlikely(dma_mapping_error(&tp->pci_dev->dev, mapping)))
++ goto err_out;
+
+ /* anti gcc 2.95.3 bugware (sic) */
+ status = opts1 | len | (RingEnd * !((entry + 1) % NUM_TX_DESC));
+@@ -3587,6 +3602,10 @@ static int rtl8169_xmit_frags(struct rtl8169_private *tp, struct sk_buff *skb,
+ }
+
+ return cur_frag;
++
++err_out:
++ rtl8169_tx_clear_range(tp, tp->cur_tx + 1, cur_frag);
++ return -EIO;
+ }
+
+ static inline u32 rtl8169_tso_csum(struct sk_buff *skb, struct net_device *dev)
+@@ -3613,40 +3632,44 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
+ struct net_device *dev)
+ {
+ struct rtl8169_private *tp = netdev_priv(dev);
+- unsigned int frags, entry = tp->cur_tx % NUM_TX_DESC;
++ unsigned int entry = tp->cur_tx % NUM_TX_DESC;
+ struct TxDesc *txd = tp->TxDescArray + entry;
+ void __iomem *ioaddr = tp->mmio_addr;
+ dma_addr_t mapping;
+ u32 status, len;
+ u32 opts1;
++ int frags;
+
+ if (unlikely(TX_BUFFS_AVAIL(tp) < skb_shinfo(skb)->nr_frags)) {
+ netif_err(tp, drv, dev, "BUG! Tx Ring full when queue awake!\n");
+- goto err_stop;
++ goto err_stop_0;
+ }
+
+ if (unlikely(le32_to_cpu(txd->opts1) & DescOwn))
+- goto err_stop;
++ goto err_stop_0;
++
++ len = skb_headlen(skb);
++ mapping = dma_map_single(&tp->pci_dev->dev, skb->data, len,
++ PCI_DMA_TODEVICE);
++ if (unlikely(dma_mapping_error(&tp->pci_dev->dev, mapping)))
++ goto err_dma_0;
++
++ tp->tx_skb[entry].len = len;
++ txd->addr = cpu_to_le64(mapping);
++ txd->opts2 = cpu_to_le32(rtl8169_tx_vlan_tag(tp, skb));
+
+ opts1 = DescOwn | rtl8169_tso_csum(skb, dev);
+
+ frags = rtl8169_xmit_frags(tp, skb, opts1);
+- if (frags) {
+- len = skb_headlen(skb);
++ if (frags < 0)
++ goto err_dma_1;
++ else if (frags)
+ opts1 |= FirstFrag;
+- } else {
+- len = skb->len;
++ else {
+ opts1 |= FirstFrag | LastFrag;
+ tp->tx_skb[entry].skb = skb;
+ }
+
+- mapping = dma_map_single(&tp->pci_dev->dev, skb->data, len,
+- PCI_DMA_TODEVICE);
+-
+- tp->tx_skb[entry].len = len;
+- txd->addr = cpu_to_le64(mapping);
+- txd->opts2 = cpu_to_le32(rtl8169_tx_vlan_tag(tp, skb));
+-
+ wmb();
+
+ /* anti gcc 2.95.3 bugware (sic) */
+@@ -3668,7 +3691,14 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
+
+ return NETDEV_TX_OK;
+
+-err_stop:
++err_dma_1:
++ rtl8169_unmap_tx_skb(tp->pci_dev, tp->tx_skb + entry, txd);
++err_dma_0:
++ dev_kfree_skb(skb);
++ dev->stats.tx_dropped++;
++ return NETDEV_TX_OK;
++
++err_stop_0:
+ netif_stop_queue(dev);
+ dev->stats.tx_dropped++;
+ return NETDEV_TX_BUSY;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0020-r8169-init-rx-ring-cleanup.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0020-r8169-init-rx-ring-cleanup.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,116 @@
+From: Stanislaw Gruszka <sgruszka at redhat.com>
+Date: Wed, 20 Oct 2010 22:25:37 +0000
+Subject: [PATCH 20/47] r8169: init rx ring cleanup
+
+commit 0ecbe1cadd406cb48424c796450bfaa18cb0b3ac upstream.
+
+Signed-off-by: Stanislaw Gruszka <sgruszka at redhat.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/r8169.c | 52 +++++++++++++++++++++-----------------------------
+ 1 files changed, 22 insertions(+), 30 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index c7ba7c0..f1d75d3 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -3326,12 +3326,12 @@ static inline void *rtl8169_align(void *data)
+ return (void *)ALIGN((long)data, 16);
+ }
+
+-static struct sk_buff *rtl8169_alloc_rx_data(struct pci_dev *pdev,
+- struct net_device *dev,
+- struct RxDesc *desc)
++static struct sk_buff *rtl8169_alloc_rx_data(struct rtl8169_private *tp,
++ struct RxDesc *desc)
+ {
+ void *data;
+ dma_addr_t mapping;
++ struct net_device *dev = tp->dev;
+ int node = dev->dev.parent ? dev_to_node(dev->dev.parent) : -1;
+
+ data = kmalloc_node(rx_buf_sz, GFP_KERNEL, node);
+@@ -3345,9 +3345,9 @@ static struct sk_buff *rtl8169_alloc_rx_data(struct pci_dev *pdev,
+ return NULL;
+ }
+
+- mapping = dma_map_single(&pdev->dev, rtl8169_align(data), rx_buf_sz,
++ mapping = dma_map_single(&tp->pci_dev->dev, rtl8169_align(data), rx_buf_sz,
+ PCI_DMA_FROMDEVICE);
+- if (unlikely(dma_mapping_error(&pdev->dev, mapping)))
++ if (unlikely(dma_mapping_error(&tp->pci_dev->dev, mapping)))
+ goto err_out;
+
+ rtl8169_map_to_asic(desc, mapping, rx_buf_sz);
+@@ -3370,34 +3370,35 @@ static void rtl8169_rx_clear(struct rtl8169_private *tp)
+ }
+ }
+
+-static u32 rtl8169_rx_fill(struct rtl8169_private *tp, struct net_device *dev,
+- u32 start, u32 end, gfp_t gfp)
++static inline void rtl8169_mark_as_last_descriptor(struct RxDesc *desc)
+ {
+- u32 cur;
++ desc->opts1 |= cpu_to_le32(RingEnd);
++}
+
+- for (cur = start; end - cur != 0; cur++) {
+- void *data;
+- unsigned int i = cur % NUM_RX_DESC;
++static int rtl8169_rx_fill(struct rtl8169_private *tp)
++{
++ unsigned int i;
+
+- WARN_ON((s32)(end - cur) < 0);
++ for (i = 0; i < NUM_RX_DESC; i++) {
++ void *data;
+
+ if (tp->Rx_databuff[i])
+ continue;
+
+- data = rtl8169_alloc_rx_data(tp->pci_dev, dev,
+- tp->RxDescArray + i);
++ data = rtl8169_alloc_rx_data(tp, tp->RxDescArray + i);
+ if (!data) {
+ rtl8169_make_unusable_by_asic(tp->RxDescArray + i);
+- break;
++ goto err_out;
+ }
+ tp->Rx_databuff[i] = data;
+ }
+- return cur - start;
+-}
+
+-static inline void rtl8169_mark_as_last_descriptor(struct RxDesc *desc)
+-{
+- desc->opts1 |= cpu_to_le32(RingEnd);
++ rtl8169_mark_as_last_descriptor(tp->RxDescArray + NUM_RX_DESC - 1);
++ return 0;
++
++err_out:
++ rtl8169_rx_clear(tp);
++ return -ENOMEM;
+ }
+
+ static void rtl8169_init_ring_indexes(struct rtl8169_private *tp)
+@@ -3414,16 +3415,7 @@ static int rtl8169_init_ring(struct net_device *dev)
+ memset(tp->tx_skb, 0x0, NUM_TX_DESC * sizeof(struct ring_info));
+ memset(tp->Rx_databuff, 0x0, NUM_RX_DESC * sizeof(void *));
+
+- if (rtl8169_rx_fill(tp, dev, 0, NUM_RX_DESC, GFP_KERNEL) != NUM_RX_DESC)
+- goto err_out;
+-
+- rtl8169_mark_as_last_descriptor(tp->RxDescArray + NUM_RX_DESC - 1);
+-
+- return 0;
+-
+-err_out:
+- rtl8169_rx_clear(tp);
+- return -ENOMEM;
++ return rtl8169_rx_fill(tp);
+ }
+
+ static void rtl8169_unmap_tx_skb(struct pci_dev *pdev, struct ring_info *tx_skb,
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0021-r8169-replace-PCI_DMA_-TO-FROM-DEVICE-to-DMA_-TO-FRO.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0021-r8169-replace-PCI_DMA_-TO-FROM-DEVICE-to-DMA_-TO-FRO.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,81 @@
+From: Stanislaw Gruszka <sgruszka at redhat.com>
+Date: Wed, 20 Oct 2010 22:25:38 +0000
+Subject: [PATCH 21/47] r8169: replace PCI_DMA_{TO,FROM}DEVICE to
+ DMA_{TO,FROM}_DEVICE
+
+commit 231aee63c1e270353fc0dc7fd4d5605a96562ec0 upstream.
+
+Signed-off-by: Stanislaw Gruszka <sgruszka at redhat.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/r8169.c | 14 +++++++-------
+ 1 files changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index f1d75d3..7d7a63e 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -3300,7 +3300,7 @@ static void rtl8169_free_rx_databuff(struct rtl8169_private *tp,
+ struct pci_dev *pdev = tp->pci_dev;
+
+ dma_unmap_single(&pdev->dev, le64_to_cpu(desc->addr), rx_buf_sz,
+- PCI_DMA_FROMDEVICE);
++ DMA_FROM_DEVICE);
+ kfree(*data_buff);
+ *data_buff = NULL;
+ rtl8169_make_unusable_by_asic(desc);
+@@ -3346,7 +3346,7 @@ static struct sk_buff *rtl8169_alloc_rx_data(struct rtl8169_private *tp,
+ }
+
+ mapping = dma_map_single(&tp->pci_dev->dev, rtl8169_align(data), rx_buf_sz,
+- PCI_DMA_FROMDEVICE);
++ DMA_FROM_DEVICE);
+ if (unlikely(dma_mapping_error(&tp->pci_dev->dev, mapping)))
+ goto err_out;
+
+@@ -3424,7 +3424,7 @@ static void rtl8169_unmap_tx_skb(struct pci_dev *pdev, struct ring_info *tx_skb,
+ unsigned int len = tx_skb->len;
+
+ dma_unmap_single(&pdev->dev, le64_to_cpu(desc->addr), len,
+- PCI_DMA_TODEVICE);
++ DMA_TO_DEVICE);
+ desc->opts1 = 0x00;
+ desc->opts2 = 0x00;
+ desc->addr = 0x00;
+@@ -3575,7 +3575,7 @@ static int rtl8169_xmit_frags(struct rtl8169_private *tp, struct sk_buff *skb,
+ len = frag->size;
+ addr = ((void *) page_address(frag->page)) + frag->page_offset;
+ mapping = dma_map_single(&tp->pci_dev->dev, addr, len,
+- PCI_DMA_TODEVICE);
++ DMA_TO_DEVICE);
+ if (unlikely(dma_mapping_error(&tp->pci_dev->dev, mapping)))
+ goto err_out;
+
+@@ -3642,7 +3642,7 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
+
+ len = skb_headlen(skb);
+ mapping = dma_map_single(&tp->pci_dev->dev, skb->data, len,
+- PCI_DMA_TODEVICE);
++ DMA_TO_DEVICE);
+ if (unlikely(dma_mapping_error(&tp->pci_dev->dev, mapping)))
+ goto err_dma_0;
+
+@@ -3821,13 +3821,13 @@ static struct sk_buff *rtl8169_try_rx_copy(void *data,
+
+ data = rtl8169_align(data);
+ dma_sync_single_for_cpu(&tp->pci_dev->dev, addr, pkt_size,
+- PCI_DMA_FROMDEVICE);
++ DMA_FROM_DEVICE);
+ prefetch(data);
+ skb = netdev_alloc_skb_ip_align(tp->dev, pkt_size);
+ if (skb)
+ memcpy(skb->data, data, pkt_size);
+ dma_sync_single_for_device(&tp->pci_dev->dev, addr, pkt_size,
+- PCI_DMA_FROMDEVICE);
++ DMA_FROM_DEVICE);
+ return skb;
+ }
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0022-r8169-use-pointer-to-struct-device-as-local-variable.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0022-r8169-use-pointer-to-struct-device-as-local-variable.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,187 @@
+From: Stanislaw Gruszka <sgruszka at redhat.com>
+Date: Wed, 20 Oct 2010 22:25:39 +0000
+Subject: [PATCH 22/47] r8169: use pointer to struct device as local variable
+
+commit 48addcc9edd551d09063148886bd6f3467d74c15 upstream.
+
+Signed-off-by: Stanislaw Gruszka <sgruszka at redhat.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/r8169.c | 51 +++++++++++++++++++++++++--------------------------
+ 1 files changed, 25 insertions(+), 26 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index 7d7a63e..99c62a6 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -1201,6 +1201,7 @@ static void rtl8169_update_counters(struct net_device *dev)
+ dma_addr_t paddr;
+ u32 cmd;
+ int wait = 1000;
++ struct device *d = &tp->pci_dev->dev;
+
+ /*
+ * Some chips are unable to dump tally counters when the receiver
+@@ -1209,8 +1210,7 @@ static void rtl8169_update_counters(struct net_device *dev)
+ if ((RTL_R8(ChipCmd) & CmdRxEnb) == 0)
+ return;
+
+- counters = dma_alloc_coherent(&tp->pci_dev->dev, sizeof(*counters),
+- &paddr, GFP_KERNEL);
++ counters = dma_alloc_coherent(d, sizeof(*counters), &paddr, GFP_KERNEL);
+ if (!counters)
+ return;
+
+@@ -1231,8 +1231,7 @@ static void rtl8169_update_counters(struct net_device *dev)
+ RTL_W32(CounterAddrLow, 0);
+ RTL_W32(CounterAddrHigh, 0);
+
+- dma_free_coherent(&tp->pci_dev->dev, sizeof(*counters), counters,
+- paddr);
++ dma_free_coherent(d, sizeof(*counters), counters, paddr);
+ }
+
+ static void rtl8169_get_ethtool_stats(struct net_device *dev,
+@@ -3297,10 +3296,9 @@ static inline void rtl8169_make_unusable_by_asic(struct RxDesc *desc)
+ static void rtl8169_free_rx_databuff(struct rtl8169_private *tp,
+ void **data_buff, struct RxDesc *desc)
+ {
+- struct pci_dev *pdev = tp->pci_dev;
+-
+- dma_unmap_single(&pdev->dev, le64_to_cpu(desc->addr), rx_buf_sz,
++ dma_unmap_single(&tp->pci_dev->dev, le64_to_cpu(desc->addr), rx_buf_sz,
+ DMA_FROM_DEVICE);
++
+ kfree(*data_buff);
+ *data_buff = NULL;
+ rtl8169_make_unusable_by_asic(desc);
+@@ -3331,6 +3329,7 @@ static struct sk_buff *rtl8169_alloc_rx_data(struct rtl8169_private *tp,
+ {
+ void *data;
+ dma_addr_t mapping;
++ struct device *d = &tp->pci_dev->dev;
+ struct net_device *dev = tp->dev;
+ int node = dev->dev.parent ? dev_to_node(dev->dev.parent) : -1;
+
+@@ -3345,9 +3344,9 @@ static struct sk_buff *rtl8169_alloc_rx_data(struct rtl8169_private *tp,
+ return NULL;
+ }
+
+- mapping = dma_map_single(&tp->pci_dev->dev, rtl8169_align(data), rx_buf_sz,
++ mapping = dma_map_single(d, rtl8169_align(data), rx_buf_sz,
+ DMA_FROM_DEVICE);
+- if (unlikely(dma_mapping_error(&tp->pci_dev->dev, mapping)))
++ if (unlikely(dma_mapping_error(d, mapping)))
+ goto err_out;
+
+ rtl8169_map_to_asic(desc, mapping, rx_buf_sz);
+@@ -3418,13 +3417,13 @@ static int rtl8169_init_ring(struct net_device *dev)
+ return rtl8169_rx_fill(tp);
+ }
+
+-static void rtl8169_unmap_tx_skb(struct pci_dev *pdev, struct ring_info *tx_skb,
++static void rtl8169_unmap_tx_skb(struct device *d, struct ring_info *tx_skb,
+ struct TxDesc *desc)
+ {
+ unsigned int len = tx_skb->len;
+
+- dma_unmap_single(&pdev->dev, le64_to_cpu(desc->addr), len,
+- DMA_TO_DEVICE);
++ dma_unmap_single(d, le64_to_cpu(desc->addr), len, DMA_TO_DEVICE);
++
+ desc->opts1 = 0x00;
+ desc->opts2 = 0x00;
+ desc->addr = 0x00;
+@@ -3444,7 +3443,7 @@ static void rtl8169_tx_clear_range(struct rtl8169_private *tp, u32 start,
+ if (len) {
+ struct sk_buff *skb = tx_skb->skb;
+
+- rtl8169_unmap_tx_skb(tp->pci_dev, tx_skb,
++ rtl8169_unmap_tx_skb(&tp->pci_dev->dev, tx_skb,
+ tp->TxDescArray + entry);
+ if (skb) {
+ dev_kfree_skb(skb);
+@@ -3561,6 +3560,7 @@ static int rtl8169_xmit_frags(struct rtl8169_private *tp, struct sk_buff *skb,
+ struct skb_shared_info *info = skb_shinfo(skb);
+ unsigned int cur_frag, entry;
+ struct TxDesc * uninitialized_var(txd);
++ struct device *d = &tp->pci_dev->dev;
+
+ entry = tp->cur_tx;
+ for (cur_frag = 0; cur_frag < info->nr_frags; cur_frag++) {
+@@ -3574,9 +3574,8 @@ static int rtl8169_xmit_frags(struct rtl8169_private *tp, struct sk_buff *skb,
+ txd = tp->TxDescArray + entry;
+ len = frag->size;
+ addr = ((void *) page_address(frag->page)) + frag->page_offset;
+- mapping = dma_map_single(&tp->pci_dev->dev, addr, len,
+- DMA_TO_DEVICE);
+- if (unlikely(dma_mapping_error(&tp->pci_dev->dev, mapping)))
++ mapping = dma_map_single(d, addr, len, DMA_TO_DEVICE);
++ if (unlikely(dma_mapping_error(d, mapping)))
+ goto err_out;
+
+ /* anti gcc 2.95.3 bugware (sic) */
+@@ -3627,6 +3626,7 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
+ unsigned int entry = tp->cur_tx % NUM_TX_DESC;
+ struct TxDesc *txd = tp->TxDescArray + entry;
+ void __iomem *ioaddr = tp->mmio_addr;
++ struct device *d = &tp->pci_dev->dev;
+ dma_addr_t mapping;
+ u32 status, len;
+ u32 opts1;
+@@ -3641,9 +3641,8 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
+ goto err_stop_0;
+
+ len = skb_headlen(skb);
+- mapping = dma_map_single(&tp->pci_dev->dev, skb->data, len,
+- DMA_TO_DEVICE);
+- if (unlikely(dma_mapping_error(&tp->pci_dev->dev, mapping)))
++ mapping = dma_map_single(d, skb->data, len, DMA_TO_DEVICE);
++ if (unlikely(dma_mapping_error(d, mapping)))
+ goto err_dma_0;
+
+ tp->tx_skb[entry].len = len;
+@@ -3684,7 +3683,7 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
+ return NETDEV_TX_OK;
+
+ err_dma_1:
+- rtl8169_unmap_tx_skb(tp->pci_dev, tp->tx_skb + entry, txd);
++ rtl8169_unmap_tx_skb(d, tp->tx_skb + entry, txd);
+ err_dma_0:
+ dev_kfree_skb(skb);
+ dev->stats.tx_dropped++;
+@@ -3766,8 +3765,8 @@ static void rtl8169_tx_interrupt(struct net_device *dev,
+ dev->stats.tx_bytes += len;
+ dev->stats.tx_packets++;
+
+- rtl8169_unmap_tx_skb(tp->pci_dev, tx_skb, tp->TxDescArray + entry);
+-
++ rtl8169_unmap_tx_skb(&tp->pci_dev->dev, tx_skb,
++ tp->TxDescArray + entry);
+ if (status & LastFrag) {
+ dev_kfree_skb(tx_skb->skb);
+ tx_skb->skb = NULL;
+@@ -3818,16 +3817,16 @@ static struct sk_buff *rtl8169_try_rx_copy(void *data,
+ dma_addr_t addr)
+ {
+ struct sk_buff *skb;
++ struct device *d = &tp->pci_dev->dev;
+
+ data = rtl8169_align(data);
+- dma_sync_single_for_cpu(&tp->pci_dev->dev, addr, pkt_size,
+- DMA_FROM_DEVICE);
++ dma_sync_single_for_cpu(d, addr, pkt_size, DMA_FROM_DEVICE);
+ prefetch(data);
+ skb = netdev_alloc_skb_ip_align(tp->dev, pkt_size);
+ if (skb)
+ memcpy(skb->data, data, pkt_size);
+- dma_sync_single_for_device(&tp->pci_dev->dev, addr, pkt_size,
+- DMA_FROM_DEVICE);
++ dma_sync_single_for_device(d, addr, pkt_size, DMA_FROM_DEVICE);
++
+ return skb;
+ }
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0023-r8169-do-not-account-fragments-as-packets.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0023-r8169-do-not-account-fragments-as-packets.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,57 @@
+From: Stanislaw Gruszka <sgruszka at redhat.com>
+Date: Wed, 20 Oct 2010 22:25:40 +0000
+Subject: [PATCH 23/47] r8169: do not account fragments as packets
+
+commit cac4b22f3d6a2601d896e9ae5147d173342c66f8 upstream.
+
+Only increase tx_{packets,dropped} statistics when transmit or drop
+full skb, not just fragment.
+
+Signed-off-by: Stanislaw Gruszka <sgruszka at redhat.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/r8169.c | 8 +++-----
+ 1 files changed, 3 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index 99c62a6..13615c0 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -3446,10 +3446,10 @@ static void rtl8169_tx_clear_range(struct rtl8169_private *tp, u32 start,
+ rtl8169_unmap_tx_skb(&tp->pci_dev->dev, tx_skb,
+ tp->TxDescArray + entry);
+ if (skb) {
++ tp->dev->stats.tx_dropped++;
+ dev_kfree_skb(skb);
+ tx_skb->skb = NULL;
+ }
+- tp->dev->stats.tx_dropped++;
+ }
+ }
+ }
+@@ -3754,7 +3754,6 @@ static void rtl8169_tx_interrupt(struct net_device *dev,
+ while (tx_left > 0) {
+ unsigned int entry = dirty_tx % NUM_TX_DESC;
+ struct ring_info *tx_skb = tp->tx_skb + entry;
+- u32 len = tx_skb->len;
+ u32 status;
+
+ rmb();
+@@ -3762,12 +3761,11 @@ static void rtl8169_tx_interrupt(struct net_device *dev,
+ if (status & DescOwn)
+ break;
+
+- dev->stats.tx_bytes += len;
+- dev->stats.tx_packets++;
+-
+ rtl8169_unmap_tx_skb(&tp->pci_dev->dev, tx_skb,
+ tp->TxDescArray + entry);
+ if (status & LastFrag) {
++ dev->stats.tx_packets++;
++ dev->stats.tx_bytes += tx_skb->skb->len;
+ dev_kfree_skb(tx_skb->skb);
+ tx_skb->skb = NULL;
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0024-r8169-changing-mtu-clean-up.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0024-r8169-changing-mtu-clean-up.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,104 @@
+From: Stanislaw Gruszka <sgruszka at redhat.com>
+Date: Wed, 20 Oct 2010 22:25:41 +0000
+Subject: [PATCH 24/47] r8169: changing mtu clean up
+
+commit 323bb6857533d7132e1d4fd9cc8edc599a06f5e6 upstream.
+
+Since we do not change rx buffer size any longer, we can
+clean up rtl8169_change_mtu and in consequence rtl8169_down.
+
+Signed-off-by: Stanislaw Gruszka <sgruszka at redhat.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/r8169.c | 47 ++++++-----------------------------------------
+ 1 files changed, 6 insertions(+), 41 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index 13615c0..df4b9f2 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -3260,31 +3260,11 @@ static void rtl_hw_start_8101(struct net_device *dev)
+
+ static int rtl8169_change_mtu(struct net_device *dev, int new_mtu)
+ {
+- struct rtl8169_private *tp = netdev_priv(dev);
+- int ret = 0;
+-
+ if (new_mtu < ETH_ZLEN || new_mtu > SafeMtu)
+ return -EINVAL;
+
+ dev->mtu = new_mtu;
+-
+- if (!netif_running(dev))
+- goto out;
+-
+- rtl8169_down(dev);
+-
+- ret = rtl8169_init_ring(dev);
+- if (ret < 0)
+- goto out;
+-
+- napi_enable(&tp->napi);
+-
+- rtl_hw_start(dev);
+-
+- rtl8169_request_timer(dev);
+-
+-out:
+- return ret;
++ return 0;
+ }
+
+ static inline void rtl8169_make_unusable_by_asic(struct RxDesc *desc)
+@@ -4038,7 +4018,6 @@ static void rtl8169_down(struct net_device *dev)
+ {
+ struct rtl8169_private *tp = netdev_priv(dev);
+ void __iomem *ioaddr = tp->mmio_addr;
+- unsigned int intrmask;
+
+ rtl8169_delete_timer(dev);
+
+@@ -4046,11 +4025,14 @@ static void rtl8169_down(struct net_device *dev)
+
+ napi_disable(&tp->napi);
+
+-core_down:
+ spin_lock_irq(&tp->lock);
+
+ rtl8169_asic_down(ioaddr);
+-
++ /*
++ * At this point device interrupts can not be enabled in any function,
++ * as netif_running is not true (rtl8169_interrupt, rtl8169_reset_task,
++ * rtl8169_reinit_task) and napi is disabled (rtl8169_poll).
++ */
+ rtl8169_rx_missed(dev, ioaddr);
+
+ spin_unlock_irq(&tp->lock);
+@@ -4060,23 +4042,6 @@ core_down:
+ /* Give a racing hard_start_xmit a few cycles to complete. */
+ synchronize_sched(); /* FIXME: should this be synchronize_irq()? */
+
+- /*
+- * And now for the 50k$ question: are IRQ disabled or not ?
+- *
+- * Two paths lead here:
+- * 1) dev->close
+- * -> netif_running() is available to sync the current code and the
+- * IRQ handler. See rtl8169_interrupt for details.
+- * 2) dev->change_mtu
+- * -> rtl8169_poll can not be issued again and re-enable the
+- * interruptions. Let's simply issue the IRQ down sequence again.
+- *
+- * No loop if hotpluged or major error (0xffff).
+- */
+- intrmask = RTL_R16(IntrMask);
+- if (intrmask && (intrmask != 0xffff))
+- goto core_down;
+-
+ rtl8169_tx_clear(tp);
+
+ rtl8169_rx_clear(tp);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0025-r8169-re-init-phy-on-resume.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0025-r8169-re-init-phy-on-resume.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,42 @@
+From: Stanislaw Gruszka <sgruszka at redhat.com>
+Date: Wed, 20 Oct 2010 22:25:42 +0000
+Subject: [PATCH 25/47] r8169: (re)init phy on resume
+
+commit fccec10b33503a2b1197c8e7a3abd30443bedb08 upstream.
+
+Fix switching device to low-speed mode after resume reported in:
+https://bugzilla.redhat.com/show_bug.cgi?id=502974
+
+Reported-and-tested-by: Laurentiu Badea <bugzilla-redhat at wotevah.com>
+Signed-off-by: Stanislaw Gruszka <sgruszka at redhat.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/r8169.c | 5 +++++
+ 1 files changed, 5 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index df4b9f2..403a25a 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -4178,6 +4178,9 @@ static int rtl8169_resume(struct device *device)
+ {
+ struct pci_dev *pdev = to_pci_dev(device);
+ struct net_device *dev = pci_get_drvdata(pdev);
++ struct rtl8169_private *tp = netdev_priv(dev);
++
++ rtl8169_init_phy(dev, tp);
+
+ if (netif_running(dev))
+ __rtl8169_resume(dev);
+@@ -4218,6 +4221,8 @@ static int rtl8169_runtime_resume(struct device *device)
+ tp->saved_wolopts = 0;
+ spin_unlock_irq(&tp->lock);
+
++ rtl8169_init_phy(dev, tp);
++
+ __rtl8169_resume(dev);
+
+ return 0;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0026-r8169-print-errors-when-dma-mapping-fail.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0026-r8169-print-errors-when-dma-mapping-fail.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,62 @@
+From: Stanislaw Gruszka <sgruszka at redhat.com>
+Date: Wed, 20 Oct 2010 22:25:43 +0000
+Subject: [PATCH 26/47] r8169: print errors when dma mapping fail
+
+commit d827d86b6fe87b420ef3c0685ab580290ae64beb upstream.
+
+If dma mapping fail we are dropping packages or fail to open device.
+But exact reason of drop/fail stays unknow for a user, so print errors.
+
+Signed-off-by: Stanislaw Gruszka <sgruszka at redhat.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/r8169.c | 16 +++++++++++++---
+ 1 files changed, 13 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index 403a25a..dc365f0 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -3326,8 +3326,11 @@ static struct sk_buff *rtl8169_alloc_rx_data(struct rtl8169_private *tp,
+
+ mapping = dma_map_single(d, rtl8169_align(data), rx_buf_sz,
+ DMA_FROM_DEVICE);
+- if (unlikely(dma_mapping_error(d, mapping)))
++ if (unlikely(dma_mapping_error(d, mapping))) {
++ if (net_ratelimit())
++ netif_err(tp, drv, tp->dev, "Failed to map RX DMA!\n");
+ goto err_out;
++ }
+
+ rtl8169_map_to_asic(desc, mapping, rx_buf_sz);
+ return data;
+@@ -3555,8 +3558,12 @@ static int rtl8169_xmit_frags(struct rtl8169_private *tp, struct sk_buff *skb,
+ len = frag->size;
+ addr = ((void *) page_address(frag->page)) + frag->page_offset;
+ mapping = dma_map_single(d, addr, len, DMA_TO_DEVICE);
+- if (unlikely(dma_mapping_error(d, mapping)))
++ if (unlikely(dma_mapping_error(d, mapping))) {
++ if (net_ratelimit())
++ netif_err(tp, drv, tp->dev,
++ "Failed to map TX fragments DMA!\n");
+ goto err_out;
++ }
+
+ /* anti gcc 2.95.3 bugware (sic) */
+ status = opts1 | len | (RingEnd * !((entry + 1) % NUM_TX_DESC));
+@@ -3622,8 +3629,11 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
+
+ len = skb_headlen(skb);
+ mapping = dma_map_single(d, skb->data, len, DMA_TO_DEVICE);
+- if (unlikely(dma_mapping_error(d, mapping)))
++ if (unlikely(dma_mapping_error(d, mapping))) {
++ if (net_ratelimit())
++ netif_err(tp, drv, dev, "Failed to map TX DMA!\n");
+ goto err_dma_0;
++ }
+
+ tp->tx_skb[entry].len = len;
+ txd->addr = cpu_to_le64(mapping);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0027-r8169-fix-sleeping-while-holding-spinlock.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0027-r8169-fix-sleeping-while-holding-spinlock.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,37 @@
+From: =?UTF-8?q?fran=C3=A7ois=20romieu?= <romieu at fr.zoreil.com>
+Date: Mon, 8 Nov 2010 13:23:58 +0000
+Subject: [PATCH 27/47] r8169: fix sleeping while holding spinlock.
+
+commit ea80907ff066edd1dd43c5fe90ae6677d15e6384 upstream.
+
+As device_set_wakeup_enable can now sleep, move the call to outside
+the critical section.
+
+Signed-off-by: Daniel J Blueman <daniel.blueman at gmail.com>
+Acked-by: Rafael J. Wysocki <rjw at sisk.pl>
+Acked-by: Andrew Hendry <andrew.hendry at gmail.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/r8169.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index dc365f0..ec0da6c 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -847,10 +847,10 @@ static int rtl8169_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
+ else
+ tp->features &= ~RTL_FEATURE_WOL;
+ __rtl8169_set_wol(tp, wol->wolopts);
+- device_set_wakeup_enable(&tp->pci_dev->dev, wol->wolopts);
+-
+ spin_unlock_irq(&tp->lock);
+
++ device_set_wakeup_enable(&tp->pci_dev->dev, wol->wolopts);
++
+ return 0;
+ }
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0028-r8169-fix-checksum-broken.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0028-r8169-fix-checksum-broken.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,42 @@
+From: Shan Wei <shanwei at cn.fujitsu.com>
+Date: Fri, 12 Nov 2010 00:15:25 +0000
+Subject: [PATCH 28/47] r8169: fix checksum broken
+
+commit d5d3ebe3be5c5123f2d444e186717f45284151e2 upstream.
+
+If r8196 received packets with invalid sctp/igmp(not tcp, udp) checksum, r8196 set skb->ip_summed
+wit CHECKSUM_UNNECESSARY. This cause that upper protocol don't check checksum field.
+
+I am not family with r8196 driver. I try to guess the meaning of RxProtoIP and IPFail.
+RxProtoIP stands for received IPv4 packet that upper protocol is not tcp and udp.
+!(opts1 & IPFail) is true means that driver correctly to check checksum in IPv4 header.
+
+If it's right, I think we should not set ip_summed wit CHECKSUM_UNNECESSARY for my sctp packets
+with invalid checksum.
+
+If it's not right, please tell me.
+
+Signed-off-by: Shan Wei <shanwei at cn.fujitsu.com>
+Acked-by: Francois Romieu <romieu at fr.zoreil.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/r8169.c | 3 +--
+ 1 files changed, 1 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index ec0da6c..8b0c88c 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -3792,8 +3792,7 @@ static inline void rtl8169_rx_csum(struct sk_buff *skb, u32 opts1)
+ u32 status = opts1 & RxProtoMask;
+
+ if (((status == RxProtoTCP) && !(opts1 & TCPFail)) ||
+- ((status == RxProtoUDP) && !(opts1 & UDPFail)) ||
+- ((status == RxProtoIP) && !(opts1 & IPFail)))
++ ((status == RxProtoUDP) && !(opts1 & UDPFail)))
+ skb->ip_summed = CHECKSUM_UNNECESSARY;
+ else
+ skb->ip_summed = CHECKSUM_NONE;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0029-r8169-Fix-runtime-power-management.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0029-r8169-Fix-runtime-power-management.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,93 @@
+From: "Rafael J. Wysocki" <rjw at sisk.pl>
+Date: Wed, 8 Dec 2010 15:32:14 +0000
+Subject: [PATCH 29/47] r8169: Fix runtime power management
+
+commit e4fbce740f078bbc925ba5c86648d9c883968479 upstream.
+
+I noticed that one of the post-2.6.36 patches broke runtime PM of the
+r8169 on my MSI Wind test machine in such a way that the link was not
+brought up after reconnecting the network cable.
+
+In the process of debugging the issue I realized that we only should
+invoke the runtime PM functions in rtl8169_check_link_status() when
+link change is reported and if we do so, the problem goes away.
+Moreover, this allows rtl8169_runtime_idle() to be simplified quite
+a bit.
+
+Signed-off-by: Rafael J. Wysocki <rjw at sisk.pl>
+Acked-by: Francois Romieu <romieu at fr.zoreil.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/r8169.c | 26 ++++++++++++++++----------
+ 1 files changed, 16 insertions(+), 10 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index 8b0c88c..50e7e5c 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -745,26 +745,36 @@ static void rtl8169_xmii_reset_enable(void __iomem *ioaddr)
+ mdio_write(ioaddr, MII_BMCR, val & 0xffff);
+ }
+
+-static void rtl8169_check_link_status(struct net_device *dev,
++static void __rtl8169_check_link_status(struct net_device *dev,
+ struct rtl8169_private *tp,
+- void __iomem *ioaddr)
++ void __iomem *ioaddr,
++ bool pm)
+ {
+ unsigned long flags;
+
+ spin_lock_irqsave(&tp->lock, flags);
+ if (tp->link_ok(ioaddr)) {
+ /* This is to cancel a scheduled suspend if there's one. */
+- pm_request_resume(&tp->pci_dev->dev);
++ if (pm)
++ pm_request_resume(&tp->pci_dev->dev);
+ netif_carrier_on(dev);
+ netif_info(tp, ifup, dev, "link up\n");
+ } else {
+ netif_carrier_off(dev);
+ netif_info(tp, ifdown, dev, "link down\n");
+- pm_schedule_suspend(&tp->pci_dev->dev, 100);
++ if (pm)
++ pm_schedule_suspend(&tp->pci_dev->dev, 100);
+ }
+ spin_unlock_irqrestore(&tp->lock, flags);
+ }
+
++static void rtl8169_check_link_status(struct net_device *dev,
++ struct rtl8169_private *tp,
++ void __iomem *ioaddr)
++{
++ __rtl8169_check_link_status(dev, tp, ioaddr, false);
++}
++
+ #define WAKE_ANY (WAKE_PHY | WAKE_MAGIC | WAKE_UCAST | WAKE_BCAST | WAKE_MCAST)
+
+ static u32 __rtl8169_get_wol(struct rtl8169_private *tp)
+@@ -3953,7 +3963,7 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance)
+ }
+
+ if (status & LinkChg)
+- rtl8169_check_link_status(dev, tp, ioaddr);
++ __rtl8169_check_link_status(dev, tp, ioaddr, true);
+
+ /* We need to see the lastest version of tp->intr_mask to
+ * avoid ignoring an MSI interrupt and having to wait for
+@@ -4243,11 +4253,7 @@ static int rtl8169_runtime_idle(struct device *device)
+ struct net_device *dev = pci_get_drvdata(pdev);
+ struct rtl8169_private *tp = netdev_priv(dev);
+
+- if (!tp->TxDescArray)
+- return 0;
+-
+- rtl8169_check_link_status(dev, tp, tp->mmio_addr);
+- return -EBUSY;
++ return tp->TxDescArray ? -EBUSY : 0;
+ }
+
+ static const struct dev_pm_ops rtl8169_pm_ops = {
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0030-drivers-net-.c-Use-static-const.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0030-drivers-net-.c-Use-static-const.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,31 @@
+From: Joe Perches <joe at perches.com>
+Date: Tue, 21 Dec 2010 02:16:08 -0800
+Subject: [PATCH 30/47] drivers/net/*.c: Use static const
+
+commit b6bc765067ece933cc3dc7f5e95665a89100b1d5 upstream.
+
+Using static const generally increases object text and decreases data size.
+It also generally decreases overall object size.
+
+Signed-off-by: Joe Perches <joe at perches.com>
+[bwh: Restricted to drivers/net/r8169.c]
+---
+ drivers/net/r8169.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index 50e7e5c..64bd0a4 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -1862,7 +1862,7 @@ static void rtl8168d_2_hw_phy_config(void __iomem *ioaddr)
+
+ val = mdio_read(ioaddr, 0x0d);
+ if ((val & 0x00ff) != 0x006c) {
+- u32 set[] = {
++ static const u32 set[] = {
+ 0x0065, 0x0066, 0x0067, 0x0068,
+ 0x0069, 0x006a, 0x006b, 0x006c
+ };
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0031-r8169-remove-the-firmware-of-RTL8111D.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0031-r8169-remove-the-firmware-of-RTL8111D.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,311 @@
+From: =?UTF-8?q?fran=C3=A7ois=20romieu?= <romieu at fr.zoreil.com>
+Date: Mon, 3 Jan 2011 15:07:31 +0000
+Subject: [PATCH 31/47] r8169: remove the firmware of RTL8111D.
+
+commit bca03d5f32c8ee9b5cfa1d32640a63fded6cb3c0 upstream.
+
+The binary file of the firmware is moved to linux-firmware repository.
+The firmwares are rtl_nic/rtl8168d-1.fw and rtl_nic/rtl8168d-2.fw.
+The driver goes along if the firmware couldn't be found. However, it
+is suggested to be done with the suitable firmware.
+
+Some wrong PHY parameters are directly corrected in the driver.
+
+Simple firmware checking added per Ben Hutchings suggestion.
+
+Signed-off-by: Hayes Wang <hayeswang at realtek.com>
+Signed-off-by: Francois Romieu <romieu at fr.zoreil.com>
+Cc: Ben Hutchings <benh at debian.org>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Adjust for prior removal of firmware]
+---
+ drivers/net/Kconfig | 1 +
+ drivers/net/r8169.c | 157 ++++++++++++++++++++++++++++++++++++++++++++-------
+ 2 files changed, 138 insertions(+), 20 deletions(-)
+
+diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
+index 4639380..bd4055b 100644
+--- a/drivers/net/Kconfig
++++ b/drivers/net/Kconfig
+@@ -2180,6 +2180,7 @@ config YELLOWFIN
+ config R8169
+ tristate "Realtek 8169 gigabit ethernet support"
+ depends on PCI
++ select FW_LOADER
+ select CRC32
+ select MII
+ ---help---
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index 64bd0a4..9455fd9 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -24,6 +24,7 @@
+ #include <linux/init.h>
+ #include <linux/dma-mapping.h>
+ #include <linux/pm_runtime.h>
++#include <linux/firmware.h>
+ #include <linux/pci-aspm.h>
+
+ #include <asm/system.h>
+@@ -34,6 +35,9 @@
+ #define MODULENAME "r8169"
+ #define PFX MODULENAME ": "
+
++#define FIRMWARE_8168D_1 "rtl_nic/rtl8168d-1.fw"
++#define FIRMWARE_8168D_2 "rtl_nic/rtl8168d-2.fw"
++
+ #ifdef RTL8169_DEBUG
+ #define assert(expr) \
+ if (!(expr)) { \
+@@ -515,6 +519,8 @@ module_param_named(debug, debug.msg_enable, int, 0);
+ MODULE_PARM_DESC(debug, "Debug verbosity level (0=none, ..., 16=all)");
+ MODULE_LICENSE("GPL");
+ MODULE_VERSION(RTL8169_VERSION);
++MODULE_FIRMWARE(FIRMWARE_8168D_1);
++MODULE_FIRMWARE(FIRMWARE_8168D_2);
+
+ static int rtl8169_open(struct net_device *dev);
+ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
+@@ -1394,6 +1400,65 @@ static void rtl_phy_write(void __iomem *ioaddr, const struct phy_reg *regs, int
+ }
+ }
+
++#define PHY_READ 0x00000000
++#define PHY_DATA_OR 0x10000000
++#define PHY_DATA_AND 0x20000000
++#define PHY_BJMPN 0x30000000
++#define PHY_READ_EFUSE 0x40000000
++#define PHY_READ_MAC_BYTE 0x50000000
++#define PHY_WRITE_MAC_BYTE 0x60000000
++#define PHY_CLEAR_READCOUNT 0x70000000
++#define PHY_WRITE 0x80000000
++#define PHY_READCOUNT_EQ_SKIP 0x90000000
++#define PHY_COMP_EQ_SKIPN 0xa0000000
++#define PHY_COMP_NEQ_SKIPN 0xb0000000
++#define PHY_WRITE_PREVIOUS 0xc0000000
++#define PHY_SKIPN 0xd0000000
++#define PHY_DELAY_MS 0xe0000000
++#define PHY_WRITE_ERI_WORD 0xf0000000
++
++static void
++rtl_phy_write_fw(struct rtl8169_private *tp, const struct firmware *fw)
++{
++ void __iomem *ioaddr = tp->mmio_addr;
++ __le32 *phytable = (__le32 *)fw->data;
++ struct net_device *dev = tp->dev;
++ size_t i;
++
++ if (fw->size % sizeof(*phytable)) {
++ netif_err(tp, probe, dev, "odd sized firmware %zd\n", fw->size);
++ return;
++ }
++
++ for (i = 0; i < fw->size / sizeof(*phytable); i++) {
++ u32 action = le32_to_cpu(phytable[i]);
++
++ if (!action)
++ break;
++
++ if ((action & 0xf0000000) != PHY_WRITE) {
++ netif_err(tp, probe, dev,
++ "unknown action 0x%08x\n", action);
++ return;
++ }
++ }
++
++ while (i-- != 0) {
++ u32 action = le32_to_cpu(*phytable);
++ u32 data = action & 0x0000ffff;
++ u32 reg = (action & 0x0fff0000) >> 16;
++
++ switch(action & 0xf0000000) {
++ case PHY_WRITE:
++ mdio_write(ioaddr, reg, data);
++ phytable++;
++ break;
++ default:
++ BUG();
++ }
++ }
++}
++
+ static void rtl8169s_hw_phy_config(void __iomem *ioaddr)
+ {
+ static const struct phy_reg phy_reg_init[] = {
+@@ -1726,9 +1791,10 @@ static void rtl8168c_4_hw_phy_config(void __iomem *ioaddr)
+ rtl8168c_3_hw_phy_config(ioaddr);
+ }
+
+-static void rtl8168d_1_hw_phy_config(void __iomem *ioaddr)
++static void rtl8168d_1_hw_phy_config(struct rtl8169_private *tp)
+ {
+ static const struct phy_reg phy_reg_init_0[] = {
++ /* Channel Estimation */
+ { 0x1f, 0x0001 },
+ { 0x06, 0x4064 },
+ { 0x07, 0x2863 },
+@@ -1745,24 +1811,41 @@ static void rtl8168d_1_hw_phy_config(void __iomem *ioaddr)
+ { 0x12, 0xf49f },
+ { 0x13, 0x070b },
+ { 0x1a, 0x05ad },
+- { 0x14, 0x94c0 }
+- };
+- static const struct phy_reg phy_reg_init_1[] = {
++ { 0x14, 0x94c0 },
++
++ /*
++ * Tx Error Issue
++ * enhance line driver power
++ */
+ { 0x1f, 0x0002 },
+ { 0x06, 0x5561 },
+ { 0x1f, 0x0005 },
+ { 0x05, 0x8332 },
+- { 0x06, 0x5561 }
++ { 0x06, 0x5561 },
++
++ /*
++ * Can not link to 1Gbps with bad cable
++ * Decrease SNR threshold form 21.07dB to 19.04dB
++ */
++ { 0x1f, 0x0001 },
++ { 0x17, 0x0cc0 },
++
++ { 0x1f, 0x0000 },
++ { 0x0d, 0xf880 }
+ };
++ void __iomem *ioaddr = tp->mmio_addr;
++ const struct firmware *fw;
+
+ rtl_phy_write(ioaddr, phy_reg_init_0, ARRAY_SIZE(phy_reg_init_0));
+
++ /*
++ * Rx Error Issue
++ * Fine Tune Switching regulator parameter
++ */
+ mdio_write(ioaddr, 0x1f, 0x0002);
+ mdio_plus_minus(ioaddr, 0x0b, 0x0010, 0x00ef);
+ mdio_plus_minus(ioaddr, 0x0c, 0xa200, 0x5d00);
+
+- rtl_phy_write(ioaddr, phy_reg_init_1, ARRAY_SIZE(phy_reg_init_1));
+-
+ if (rtl8168d_efuse_read(ioaddr, 0x01) == 0xb1) {
+ static const struct phy_reg phy_reg_init[] = {
+ { 0x1f, 0x0002 },
+@@ -1803,22 +1886,33 @@ static void rtl8168d_1_hw_phy_config(void __iomem *ioaddr)
+ rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
+ }
+
++ /* RSET couple improve */
+ mdio_write(ioaddr, 0x1f, 0x0002);
+ mdio_patch(ioaddr, 0x0d, 0x0300);
+ mdio_patch(ioaddr, 0x0f, 0x0010);
+
++ /* Fine tune PLL performance */
+ mdio_write(ioaddr, 0x1f, 0x0002);
+ mdio_plus_minus(ioaddr, 0x02, 0x0100, 0x0600);
+ mdio_plus_minus(ioaddr, 0x03, 0x0000, 0xe000);
+
+-#ifdef CONFIG_BROKEN
+- rtl_phy_write(ioaddr, phy_reg_init_2, ARRAY_SIZE(phy_reg_init_2));
+-#endif
++ mdio_write(ioaddr, 0x1f, 0x0005);
++ mdio_write(ioaddr, 0x05, 0x001b);
++ if (mdio_read(ioaddr, 0x06) == 0xbf00 &&
++ request_firmware(&fw, FIRMWARE_8168D_1, &tp->pci_dev->dev) == 0) {
++ rtl_phy_write_fw(tp, fw);
++ release_firmware(fw);
++ } else {
++ netif_warn(tp, probe, tp->dev, "unable to apply firmware patch\n");
++ }
++
++ mdio_write(ioaddr, 0x1f, 0x0000);
+ }
+
+-static void rtl8168d_2_hw_phy_config(void __iomem *ioaddr)
++static void rtl8168d_2_hw_phy_config(struct rtl8169_private *tp)
+ {
+ static const struct phy_reg phy_reg_init_0[] = {
++ /* Channel Estimation */
+ { 0x1f, 0x0001 },
+ { 0x06, 0x4064 },
+ { 0x07, 0x2863 },
+@@ -1837,12 +1931,28 @@ static void rtl8168d_2_hw_phy_config(void __iomem *ioaddr)
+ { 0x1a, 0x05ad },
+ { 0x14, 0x94c0 },
+
++ /*
++ * Tx Error Issue
++ * enhance line driver power
++ */
+ { 0x1f, 0x0002 },
+ { 0x06, 0x5561 },
+ { 0x1f, 0x0005 },
+ { 0x05, 0x8332 },
+- { 0x06, 0x5561 }
++ { 0x06, 0x5561 },
++
++ /*
++ * Can not link to 1Gbps with bad cable
++ * Decrease SNR threshold form 21.07dB to 19.04dB
++ */
++ { 0x1f, 0x0001 },
++ { 0x17, 0x0cc0 },
++
++ { 0x1f, 0x0000 },
++ { 0x0d, 0xf880 }
+ };
++ void __iomem *ioaddr = tp->mmio_addr;
++ const struct firmware *fw;
+
+ rtl_phy_write(ioaddr, phy_reg_init_0, ARRAY_SIZE(phy_reg_init_0));
+
+@@ -1886,19 +1996,26 @@ static void rtl8168d_2_hw_phy_config(void __iomem *ioaddr)
+ rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
+ }
+
++ /* Fine tune PLL performance */
+ mdio_write(ioaddr, 0x1f, 0x0002);
+ mdio_plus_minus(ioaddr, 0x02, 0x0100, 0x0600);
+ mdio_plus_minus(ioaddr, 0x03, 0x0000, 0xe000);
+
+- mdio_write(ioaddr, 0x1f, 0x0001);
+- mdio_write(ioaddr, 0x17, 0x0cc0);
+-
++ /* Switching regulator Slew rate */
+ mdio_write(ioaddr, 0x1f, 0x0002);
+ mdio_patch(ioaddr, 0x0f, 0x0017);
+
+-#ifdef CONFIG_BROKEN
+- rtl_phy_write(ioaddr, phy_reg_init_1, ARRAY_SIZE(phy_reg_init_1));
+-#endif
++ mdio_write(ioaddr, 0x1f, 0x0005);
++ mdio_write(ioaddr, 0x05, 0x001b);
++ if (mdio_read(ioaddr, 0x06) == 0xb300 &&
++ request_firmware(&fw, FIRMWARE_8168D_2, &tp->pci_dev->dev) == 0) {
++ rtl_phy_write_fw(tp, fw);
++ release_firmware(fw);
++ } else {
++ netif_warn(tp, probe, tp->dev, "unable to apply firmware patch\n");
++ }
++
++ mdio_write(ioaddr, 0x1f, 0x0000);
+ }
+
+ static void rtl8168d_3_hw_phy_config(void __iomem *ioaddr)
+@@ -2036,10 +2153,10 @@ static void rtl_hw_phy_config(struct net_device *dev)
+ rtl8168cp_2_hw_phy_config(ioaddr);
+ break;
+ case RTL_GIGA_MAC_VER_25:
+- rtl8168d_1_hw_phy_config(ioaddr);
++ rtl8168d_1_hw_phy_config(tp);
+ break;
+ case RTL_GIGA_MAC_VER_26:
+- rtl8168d_2_hw_phy_config(ioaddr);
++ rtl8168d_2_hw_phy_config(tp);
+ break;
+ case RTL_GIGA_MAC_VER_27:
+ rtl8168d_3_hw_phy_config(ioaddr);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0032-r8169-identify-different-registers.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0032-r8169-identify-different-registers.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,104 @@
+From: =?UTF-8?q?fran=C3=A7ois=20romieu?= <romieu at fr.zoreil.com>
+Date: Mon, 3 Jan 2011 15:07:42 +0000
+Subject: [PATCH 32/47] r8169: identify different registers.
+
+commit f0298f8143e89ac4da306e14b9aa1927e93916d0 upstream.
+
+Documentation (sort of).
+
+The location are the same, the values are the same but it is
+just accidental. Note that the 810x could cope with a smaller
+value as it does not support jumbo frames.
+
+Signed-off-by: Francois Romieu <romieu at fr.zoreil.com>
+Cc: Hayes <hayeswang at realtek.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/r8169.c | 22 ++++++++++++++--------
+ 1 files changed, 14 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index 9455fd9..7e4407a 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -68,7 +68,6 @@ static const int multicast_filter_limit = 32;
+ #define RX_FIFO_THRESH 7 /* 7 means NO threshold, Rx buffer level before first PCI xfer. */
+ #define RX_DMA_BURST 6 /* Maximum PCI burst, '6' is 1024 */
+ #define TX_DMA_BURST 6 /* Maximum PCI burst, '6' is 1024 */
+-#define EarlyTxThld 0x3F /* 0x3F means NO early transmit */
+ #define SafeMtu 0x1c20 /* ... actually life sucks beyond ~7k */
+ #define InterFrameGap 0x03 /* 3 means InterFrameGap = the shortest one */
+
+@@ -232,7 +231,14 @@ enum rtl_registers {
+ IntrMitigate = 0xe2,
+ RxDescAddrLow = 0xe4,
+ RxDescAddrHigh = 0xe8,
+- EarlyTxThres = 0xec,
++ EarlyTxThres = 0xec, /* 8169. Unit of 32 bytes. */
++
++#define NoEarlyTx 0x3f /* Max value : no early transmit. */
++
++ MaxTxPacketSize = 0xec, /* 8101/8168. Unit of 128 bytes. */
++
++#define TxPacketMax (8064 >> 7)
++
+ FuncEvent = 0xf0,
+ FuncEventMask = 0xf4,
+ FuncPresetState = 0xf8,
+@@ -2915,7 +2921,7 @@ static void rtl_hw_start_8169(struct net_device *dev)
+ (tp->mac_version == RTL_GIGA_MAC_VER_04))
+ RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb);
+
+- RTL_W8(EarlyTxThres, EarlyTxThld);
++ RTL_W8(EarlyTxThres, NoEarlyTx);
+
+ rtl_set_rx_max_size(ioaddr, rx_buf_sz);
+
+@@ -3050,7 +3056,7 @@ static void rtl_hw_start_8168bef(void __iomem *ioaddr, struct pci_dev *pdev)
+ {
+ rtl_hw_start_8168bb(ioaddr, pdev);
+
+- RTL_W8(EarlyTxThres, EarlyTxThld);
++ RTL_W8(MaxTxPacketSize, TxPacketMax);
+
+ RTL_W8(Config4, RTL_R8(Config4) & ~(1 << 0));
+ }
+@@ -3105,7 +3111,7 @@ static void rtl_hw_start_8168cp_3(void __iomem *ioaddr, struct pci_dev *pdev)
+ /* Magic. */
+ RTL_W8(DBG_REG, 0x20);
+
+- RTL_W8(EarlyTxThres, EarlyTxThld);
++ RTL_W8(MaxTxPacketSize, TxPacketMax);
+
+ rtl_tx_performance_tweak(pdev, 0x5 << MAX_READ_REQUEST_SHIFT);
+
+@@ -3161,7 +3167,7 @@ static void rtl_hw_start_8168d(void __iomem *ioaddr, struct pci_dev *pdev)
+
+ rtl_disable_clock_request(pdev);
+
+- RTL_W8(EarlyTxThres, EarlyTxThld);
++ RTL_W8(MaxTxPacketSize, TxPacketMax);
+
+ rtl_tx_performance_tweak(pdev, 0x5 << MAX_READ_REQUEST_SHIFT);
+
+@@ -3176,7 +3182,7 @@ static void rtl_hw_start_8168(struct net_device *dev)
+
+ RTL_W8(Cfg9346, Cfg9346_Unlock);
+
+- RTL_W8(EarlyTxThres, EarlyTxThld);
++ RTL_W8(MaxTxPacketSize, TxPacketMax);
+
+ rtl_set_rx_max_size(ioaddr, rx_buf_sz);
+
+@@ -3357,7 +3363,7 @@ static void rtl_hw_start_8101(struct net_device *dev)
+
+ RTL_W8(Cfg9346, Cfg9346_Unlock);
+
+- RTL_W8(EarlyTxThres, EarlyTxThld);
++ RTL_W8(MaxTxPacketSize, TxPacketMax);
+
+ rtl_set_rx_max_size(ioaddr, rx_buf_sz);
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0033-r8169-use-device-dependent-methods-to-access-the-MII.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0033-r8169-use-device-dependent-methods-to-access-the-MII.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,793 @@
+From: =?UTF-8?q?fran=C3=A7ois=20romieu?= <romieu at fr.zoreil.com>
+Date: Mon, 3 Jan 2011 15:07:55 +0000
+Subject: [PATCH 33/47] r8169: use device dependent methods to access the MII
+ registers.
+
+commit 4da19633429f67c794b013488348550f457298c4 upstream.
+
+Current mdio_{read/write} needs device specific information to work
+correctly with newer chipsets.
+
+Signed-off-by: Francois Romieu <romieu at fr.zoreil.com>
+Cc: Hayes <hayeswang at realtek.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/r8169.c | 307 ++++++++++++++++++++++++++-------------------------
+ 1 files changed, 157 insertions(+), 150 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index 7e4407a..80a0caa 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -503,9 +503,9 @@ struct rtl8169_private {
+ #endif
+ int (*set_speed)(struct net_device *, u8 autoneg, u16 speed, u8 duplex);
+ int (*get_settings)(struct net_device *, struct ethtool_cmd *);
+- void (*phy_reset_enable)(void __iomem *);
++ void (*phy_reset_enable)(struct rtl8169_private *tp);
+ void (*hw_start)(struct net_device *);
+- unsigned int (*phy_reset_pending)(void __iomem *);
++ unsigned int (*phy_reset_pending)(struct rtl8169_private *tp);
+ unsigned int (*link_ok)(void __iomem *);
+ int (*do_ioctl)(struct rtl8169_private *tp, struct mii_ioctl_data *data, int cmd);
+ int pcie_cap;
+@@ -548,7 +548,7 @@ static int rtl8169_poll(struct napi_struct *napi, int budget);
+ static const unsigned int rtl8169_rx_config =
+ (RX_FIFO_THRESH << RxCfgFIFOShift) | (RX_DMA_BURST << RxCfgDMAShift);
+
+-static void mdio_write(void __iomem *ioaddr, int reg_addr, int value)
++static void r8169_mdio_write(void __iomem *ioaddr, int reg_addr, int value)
+ {
+ int i;
+
+@@ -570,7 +570,7 @@ static void mdio_write(void __iomem *ioaddr, int reg_addr, int value)
+ udelay(20);
+ }
+
+-static int mdio_read(void __iomem *ioaddr, int reg_addr)
++static int r8169_mdio_read(void __iomem *ioaddr, int reg_addr)
+ {
+ int i, value = -1;
+
+@@ -596,34 +596,42 @@ static int mdio_read(void __iomem *ioaddr, int reg_addr)
+ return value;
+ }
+
+-static void mdio_patch(void __iomem *ioaddr, int reg_addr, int value)
++static void rtl_writephy(struct rtl8169_private *tp, int location, u32 val)
+ {
+- mdio_write(ioaddr, reg_addr, mdio_read(ioaddr, reg_addr) | value);
++ r8169_mdio_write(tp->mmio_addr, location, val);
+ }
+
+-static void mdio_plus_minus(void __iomem *ioaddr, int reg_addr, int p, int m)
++static int rtl_readphy(struct rtl8169_private *tp, int location)
++{
++ return r8169_mdio_read(tp->mmio_addr, location);
++}
++
++static void rtl_patchphy(struct rtl8169_private *tp, int reg_addr, int value)
++{
++ rtl_writephy(tp, reg_addr, rtl_readphy(tp, reg_addr) | value);
++}
++
++static void rtl_w1w0_phy(struct rtl8169_private *tp, int reg_addr, int p, int m)
+ {
+ int val;
+
+- val = mdio_read(ioaddr, reg_addr);
+- mdio_write(ioaddr, reg_addr, (val | p) & ~m);
++ val = rtl_readphy(tp, reg_addr);
++ rtl_writephy(tp, reg_addr, (val | p) & ~m);
+ }
+
+ static void rtl_mdio_write(struct net_device *dev, int phy_id, int location,
+ int val)
+ {
+ struct rtl8169_private *tp = netdev_priv(dev);
+- void __iomem *ioaddr = tp->mmio_addr;
+
+- mdio_write(ioaddr, location, val);
++ rtl_writephy(tp, location, val);
+ }
+
+ static int rtl_mdio_read(struct net_device *dev, int phy_id, int location)
+ {
+ struct rtl8169_private *tp = netdev_priv(dev);
+- void __iomem *ioaddr = tp->mmio_addr;
+
+- return mdio_read(ioaddr, location);
++ return rtl_readphy(tp, location);
+ }
+
+ static void rtl_ephy_write(void __iomem *ioaddr, int reg_addr, int value)
+@@ -724,14 +732,16 @@ static void rtl8169_asic_down(void __iomem *ioaddr)
+ RTL_R16(CPlusCmd);
+ }
+
+-static unsigned int rtl8169_tbi_reset_pending(void __iomem *ioaddr)
++static unsigned int rtl8169_tbi_reset_pending(struct rtl8169_private *tp)
+ {
++ void __iomem *ioaddr = tp->mmio_addr;
++
+ return RTL_R32(TBICSR) & TBIReset;
+ }
+
+-static unsigned int rtl8169_xmii_reset_pending(void __iomem *ioaddr)
++static unsigned int rtl8169_xmii_reset_pending(struct rtl8169_private *tp)
+ {
+- return mdio_read(ioaddr, MII_BMCR) & BMCR_RESET;
++ return rtl_readphy(tp, MII_BMCR) & BMCR_RESET;
+ }
+
+ static unsigned int rtl8169_tbi_link_ok(void __iomem *ioaddr)
+@@ -744,17 +754,19 @@ static unsigned int rtl8169_xmii_link_ok(void __iomem *ioaddr)
+ return RTL_R8(PHYstatus) & LinkStatus;
+ }
+
+-static void rtl8169_tbi_reset_enable(void __iomem *ioaddr)
++static void rtl8169_tbi_reset_enable(struct rtl8169_private *tp)
+ {
++ void __iomem *ioaddr = tp->mmio_addr;
++
+ RTL_W32(TBICSR, RTL_R32(TBICSR) | TBIReset);
+ }
+
+-static void rtl8169_xmii_reset_enable(void __iomem *ioaddr)
++static void rtl8169_xmii_reset_enable(struct rtl8169_private *tp)
+ {
+ unsigned int val;
+
+- val = mdio_read(ioaddr, MII_BMCR) | BMCR_RESET;
+- mdio_write(ioaddr, MII_BMCR, val & 0xffff);
++ val = rtl_readphy(tp, MII_BMCR) | BMCR_RESET;
++ rtl_writephy(tp, MII_BMCR, val & 0xffff);
+ }
+
+ static void __rtl8169_check_link_status(struct net_device *dev,
+@@ -918,18 +930,17 @@ static int rtl8169_set_speed_xmii(struct net_device *dev,
+ u8 autoneg, u16 speed, u8 duplex)
+ {
+ struct rtl8169_private *tp = netdev_priv(dev);
+- void __iomem *ioaddr = tp->mmio_addr;
+ int giga_ctrl, bmcr;
+
+ if (autoneg == AUTONEG_ENABLE) {
+ int auto_nego;
+
+- auto_nego = mdio_read(ioaddr, MII_ADVERTISE);
++ auto_nego = rtl_readphy(tp, MII_ADVERTISE);
+ auto_nego |= (ADVERTISE_10HALF | ADVERTISE_10FULL |
+ ADVERTISE_100HALF | ADVERTISE_100FULL);
+ auto_nego |= ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM;
+
+- giga_ctrl = mdio_read(ioaddr, MII_CTRL1000);
++ giga_ctrl = rtl_readphy(tp, MII_CTRL1000);
+ giga_ctrl &= ~(ADVERTISE_1000FULL | ADVERTISE_1000HALF);
+
+ /* The 8100e/8101e/8102e do Fast Ethernet only. */
+@@ -957,12 +968,12 @@ static int rtl8169_set_speed_xmii(struct net_device *dev,
+ * Vendor specific (0x1f) and reserved (0x0e) MII
+ * registers.
+ */
+- mdio_write(ioaddr, 0x1f, 0x0000);
+- mdio_write(ioaddr, 0x0e, 0x0000);
++ rtl_writephy(tp, 0x1f, 0x0000);
++ rtl_writephy(tp, 0x0e, 0x0000);
+ }
+
+- mdio_write(ioaddr, MII_ADVERTISE, auto_nego);
+- mdio_write(ioaddr, MII_CTRL1000, giga_ctrl);
++ rtl_writephy(tp, MII_ADVERTISE, auto_nego);
++ rtl_writephy(tp, MII_CTRL1000, giga_ctrl);
+ } else {
+ giga_ctrl = 0;
+
+@@ -976,21 +987,21 @@ static int rtl8169_set_speed_xmii(struct net_device *dev,
+ if (duplex == DUPLEX_FULL)
+ bmcr |= BMCR_FULLDPLX;
+
+- mdio_write(ioaddr, 0x1f, 0x0000);
++ rtl_writephy(tp, 0x1f, 0x0000);
+ }
+
+ tp->phy_1000_ctrl_reg = giga_ctrl;
+
+- mdio_write(ioaddr, MII_BMCR, bmcr);
++ rtl_writephy(tp, MII_BMCR, bmcr);
+
+ if ((tp->mac_version == RTL_GIGA_MAC_VER_02) ||
+ (tp->mac_version == RTL_GIGA_MAC_VER_03)) {
+ if ((speed == SPEED_100) && (autoneg != AUTONEG_ENABLE)) {
+- mdio_write(ioaddr, 0x17, 0x2138);
+- mdio_write(ioaddr, 0x0e, 0x0260);
++ rtl_writephy(tp, 0x17, 0x2138);
++ rtl_writephy(tp, 0x0e, 0x0260);
+ } else {
+- mdio_write(ioaddr, 0x17, 0x2108);
+- mdio_write(ioaddr, 0x0e, 0x0000);
++ rtl_writephy(tp, 0x17, 0x2108);
++ rtl_writephy(tp, 0x0e, 0x0000);
+ }
+ }
+
+@@ -1398,10 +1409,11 @@ struct phy_reg {
+ u16 val;
+ };
+
+-static void rtl_phy_write(void __iomem *ioaddr, const struct phy_reg *regs, int len)
++static void rtl_writephy_batch(struct rtl8169_private *tp,
++ const struct phy_reg *regs, int len)
+ {
+ while (len-- > 0) {
+- mdio_write(ioaddr, regs->reg, regs->val);
++ rtl_writephy(tp, regs->reg, regs->val);
+ regs++;
+ }
+ }
+@@ -1426,7 +1438,6 @@ static void rtl_phy_write(void __iomem *ioaddr, const struct phy_reg *regs, int
+ static void
+ rtl_phy_write_fw(struct rtl8169_private *tp, const struct firmware *fw)
+ {
+- void __iomem *ioaddr = tp->mmio_addr;
+ __le32 *phytable = (__le32 *)fw->data;
+ struct net_device *dev = tp->dev;
+ size_t i;
+@@ -1456,7 +1467,7 @@ rtl_phy_write_fw(struct rtl8169_private *tp, const struct firmware *fw)
+
+ switch(action & 0xf0000000) {
+ case PHY_WRITE:
+- mdio_write(ioaddr, reg, data);
++ rtl_writephy(tp, reg, data);
+ phytable++;
+ break;
+ default:
+@@ -1465,7 +1476,7 @@ rtl_phy_write_fw(struct rtl8169_private *tp, const struct firmware *fw)
+ }
+ }
+
+-static void rtl8169s_hw_phy_config(void __iomem *ioaddr)
++static void rtl8169s_hw_phy_config(struct rtl8169_private *tp)
+ {
+ static const struct phy_reg phy_reg_init[] = {
+ { 0x1f, 0x0001 },
+@@ -1529,10 +1540,10 @@ static void rtl8169s_hw_phy_config(void __iomem *ioaddr)
+ { 0x00, 0x9200 }
+ };
+
+- rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
++ rtl_writephy_batch(tp, phy_reg_init, ARRAY_SIZE(phy_reg_init));
+ }
+
+-static void rtl8169sb_hw_phy_config(void __iomem *ioaddr)
++static void rtl8169sb_hw_phy_config(struct rtl8169_private *tp)
+ {
+ static const struct phy_reg phy_reg_init[] = {
+ { 0x1f, 0x0002 },
+@@ -1540,11 +1551,10 @@ static void rtl8169sb_hw_phy_config(void __iomem *ioaddr)
+ { 0x1f, 0x0000 }
+ };
+
+- rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
++ rtl_writephy_batch(tp, phy_reg_init, ARRAY_SIZE(phy_reg_init));
+ }
+
+-static void rtl8169scd_hw_phy_config_quirk(struct rtl8169_private *tp,
+- void __iomem *ioaddr)
++static void rtl8169scd_hw_phy_config_quirk(struct rtl8169_private *tp)
+ {
+ struct pci_dev *pdev = tp->pci_dev;
+ u16 vendor_id, device_id;
+@@ -1555,13 +1565,12 @@ static void rtl8169scd_hw_phy_config_quirk(struct rtl8169_private *tp,
+ if ((vendor_id != PCI_VENDOR_ID_GIGABYTE) || (device_id != 0xe000))
+ return;
+
+- mdio_write(ioaddr, 0x1f, 0x0001);
+- mdio_write(ioaddr, 0x10, 0xf01b);
+- mdio_write(ioaddr, 0x1f, 0x0000);
++ rtl_writephy(tp, 0x1f, 0x0001);
++ rtl_writephy(tp, 0x10, 0xf01b);
++ rtl_writephy(tp, 0x1f, 0x0000);
+ }
+
+-static void rtl8169scd_hw_phy_config(struct rtl8169_private *tp,
+- void __iomem *ioaddr)
++static void rtl8169scd_hw_phy_config(struct rtl8169_private *tp)
+ {
+ static const struct phy_reg phy_reg_init[] = {
+ { 0x1f, 0x0001 },
+@@ -1603,12 +1612,12 @@ static void rtl8169scd_hw_phy_config(struct rtl8169_private *tp,
+ { 0x1f, 0x0000 }
+ };
+
+- rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
++ rtl_writephy_batch(tp, phy_reg_init, ARRAY_SIZE(phy_reg_init));
+
+- rtl8169scd_hw_phy_config_quirk(tp, ioaddr);
++ rtl8169scd_hw_phy_config_quirk(tp);
+ }
+
+-static void rtl8169sce_hw_phy_config(void __iomem *ioaddr)
++static void rtl8169sce_hw_phy_config(struct rtl8169_private *tp)
+ {
+ static const struct phy_reg phy_reg_init[] = {
+ { 0x1f, 0x0001 },
+@@ -1658,23 +1667,23 @@ static void rtl8169sce_hw_phy_config(void __iomem *ioaddr)
+ { 0x1f, 0x0000 }
+ };
+
+- rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
++ rtl_writephy_batch(tp, phy_reg_init, ARRAY_SIZE(phy_reg_init));
+ }
+
+-static void rtl8168bb_hw_phy_config(void __iomem *ioaddr)
++static void rtl8168bb_hw_phy_config(struct rtl8169_private *tp)
+ {
+ static const struct phy_reg phy_reg_init[] = {
+ { 0x10, 0xf41b },
+ { 0x1f, 0x0000 }
+ };
+
+- mdio_write(ioaddr, 0x1f, 0x0001);
+- mdio_patch(ioaddr, 0x16, 1 << 0);
++ rtl_writephy(tp, 0x1f, 0x0001);
++ rtl_patchphy(tp, 0x16, 1 << 0);
+
+- rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
++ rtl_writephy_batch(tp, phy_reg_init, ARRAY_SIZE(phy_reg_init));
+ }
+
+-static void rtl8168bef_hw_phy_config(void __iomem *ioaddr)
++static void rtl8168bef_hw_phy_config(struct rtl8169_private *tp)
+ {
+ static const struct phy_reg phy_reg_init[] = {
+ { 0x1f, 0x0001 },
+@@ -1682,10 +1691,10 @@ static void rtl8168bef_hw_phy_config(void __iomem *ioaddr)
+ { 0x1f, 0x0000 }
+ };
+
+- rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
++ rtl_writephy_batch(tp, phy_reg_init, ARRAY_SIZE(phy_reg_init));
+ }
+
+-static void rtl8168cp_1_hw_phy_config(void __iomem *ioaddr)
++static void rtl8168cp_1_hw_phy_config(struct rtl8169_private *tp)
+ {
+ static const struct phy_reg phy_reg_init[] = {
+ { 0x1f, 0x0000 },
+@@ -1695,10 +1704,10 @@ static void rtl8168cp_1_hw_phy_config(void __iomem *ioaddr)
+ { 0x1f, 0x0000 }
+ };
+
+- rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
++ rtl_writephy_batch(tp, phy_reg_init, ARRAY_SIZE(phy_reg_init));
+ }
+
+-static void rtl8168cp_2_hw_phy_config(void __iomem *ioaddr)
++static void rtl8168cp_2_hw_phy_config(struct rtl8169_private *tp)
+ {
+ static const struct phy_reg phy_reg_init[] = {
+ { 0x1f, 0x0001 },
+@@ -1706,14 +1715,14 @@ static void rtl8168cp_2_hw_phy_config(void __iomem *ioaddr)
+ { 0x1f, 0x0000 }
+ };
+
+- mdio_write(ioaddr, 0x1f, 0x0000);
+- mdio_patch(ioaddr, 0x14, 1 << 5);
+- mdio_patch(ioaddr, 0x0d, 1 << 5);
++ rtl_writephy(tp, 0x1f, 0x0000);
++ rtl_patchphy(tp, 0x14, 1 << 5);
++ rtl_patchphy(tp, 0x0d, 1 << 5);
+
+- rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
++ rtl_writephy_batch(tp, phy_reg_init, ARRAY_SIZE(phy_reg_init));
+ }
+
+-static void rtl8168c_1_hw_phy_config(void __iomem *ioaddr)
++static void rtl8168c_1_hw_phy_config(struct rtl8169_private *tp)
+ {
+ static const struct phy_reg phy_reg_init[] = {
+ { 0x1f, 0x0001 },
+@@ -1735,14 +1744,14 @@ static void rtl8168c_1_hw_phy_config(void __iomem *ioaddr)
+ { 0x09, 0x0000 }
+ };
+
+- rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
++ rtl_writephy_batch(tp, phy_reg_init, ARRAY_SIZE(phy_reg_init));
+
+- mdio_patch(ioaddr, 0x14, 1 << 5);
+- mdio_patch(ioaddr, 0x0d, 1 << 5);
+- mdio_write(ioaddr, 0x1f, 0x0000);
++ rtl_patchphy(tp, 0x14, 1 << 5);
++ rtl_patchphy(tp, 0x0d, 1 << 5);
++ rtl_writephy(tp, 0x1f, 0x0000);
+ }
+
+-static void rtl8168c_2_hw_phy_config(void __iomem *ioaddr)
++static void rtl8168c_2_hw_phy_config(struct rtl8169_private *tp)
+ {
+ static const struct phy_reg phy_reg_init[] = {
+ { 0x1f, 0x0001 },
+@@ -1762,15 +1771,15 @@ static void rtl8168c_2_hw_phy_config(void __iomem *ioaddr)
+ { 0x1f, 0x0000 }
+ };
+
+- rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
++ rtl_writephy_batch(tp, phy_reg_init, ARRAY_SIZE(phy_reg_init));
+
+- mdio_patch(ioaddr, 0x16, 1 << 0);
+- mdio_patch(ioaddr, 0x14, 1 << 5);
+- mdio_patch(ioaddr, 0x0d, 1 << 5);
+- mdio_write(ioaddr, 0x1f, 0x0000);
++ rtl_patchphy(tp, 0x16, 1 << 0);
++ rtl_patchphy(tp, 0x14, 1 << 5);
++ rtl_patchphy(tp, 0x0d, 1 << 5);
++ rtl_writephy(tp, 0x1f, 0x0000);
+ }
+
+-static void rtl8168c_3_hw_phy_config(void __iomem *ioaddr)
++static void rtl8168c_3_hw_phy_config(struct rtl8169_private *tp)
+ {
+ static const struct phy_reg phy_reg_init[] = {
+ { 0x1f, 0x0001 },
+@@ -1784,17 +1793,17 @@ static void rtl8168c_3_hw_phy_config(void __iomem *ioaddr)
+ { 0x1f, 0x0000 }
+ };
+
+- rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
++ rtl_writephy_batch(tp, phy_reg_init, ARRAY_SIZE(phy_reg_init));
+
+- mdio_patch(ioaddr, 0x16, 1 << 0);
+- mdio_patch(ioaddr, 0x14, 1 << 5);
+- mdio_patch(ioaddr, 0x0d, 1 << 5);
+- mdio_write(ioaddr, 0x1f, 0x0000);
++ rtl_patchphy(tp, 0x16, 1 << 0);
++ rtl_patchphy(tp, 0x14, 1 << 5);
++ rtl_patchphy(tp, 0x0d, 1 << 5);
++ rtl_writephy(tp, 0x1f, 0x0000);
+ }
+
+-static void rtl8168c_4_hw_phy_config(void __iomem *ioaddr)
++static void rtl8168c_4_hw_phy_config(struct rtl8169_private *tp)
+ {
+- rtl8168c_3_hw_phy_config(ioaddr);
++ rtl8168c_3_hw_phy_config(tp);
+ }
+
+ static void rtl8168d_1_hw_phy_config(struct rtl8169_private *tp)
+@@ -1842,15 +1851,15 @@ static void rtl8168d_1_hw_phy_config(struct rtl8169_private *tp)
+ void __iomem *ioaddr = tp->mmio_addr;
+ const struct firmware *fw;
+
+- rtl_phy_write(ioaddr, phy_reg_init_0, ARRAY_SIZE(phy_reg_init_0));
++ rtl_writephy_batch(tp, phy_reg_init_0, ARRAY_SIZE(phy_reg_init_0));
+
+ /*
+ * Rx Error Issue
+ * Fine Tune Switching regulator parameter
+ */
+- mdio_write(ioaddr, 0x1f, 0x0002);
+- mdio_plus_minus(ioaddr, 0x0b, 0x0010, 0x00ef);
+- mdio_plus_minus(ioaddr, 0x0c, 0xa200, 0x5d00);
++ rtl_writephy(tp, 0x1f, 0x0002);
++ rtl_w1w0_phy(tp, 0x0b, 0x0010, 0x00ef);
++ rtl_w1w0_phy(tp, 0x0c, 0xa200, 0x5d00);
+
+ if (rtl8168d_efuse_read(ioaddr, 0x01) == 0xb1) {
+ static const struct phy_reg phy_reg_init[] = {
+@@ -1863,9 +1872,9 @@ static void rtl8168d_1_hw_phy_config(struct rtl8169_private *tp)
+ };
+ int val;
+
+- rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
++ rtl_writephy_batch(tp, phy_reg_init, ARRAY_SIZE(phy_reg_init));
+
+- val = mdio_read(ioaddr, 0x0d);
++ val = rtl_readphy(tp, 0x0d);
+
+ if ((val & 0x00ff) != 0x006c) {
+ static const u32 set[] = {
+@@ -1874,11 +1883,11 @@ static void rtl8168d_1_hw_phy_config(struct rtl8169_private *tp)
+ };
+ int i;
+
+- mdio_write(ioaddr, 0x1f, 0x0002);
++ rtl_writephy(tp, 0x1f, 0x0002);
+
+ val &= 0xff00;
+ for (i = 0; i < ARRAY_SIZE(set); i++)
+- mdio_write(ioaddr, 0x0d, val | set[i]);
++ rtl_writephy(tp, 0x0d, val | set[i]);
+ }
+ } else {
+ static const struct phy_reg phy_reg_init[] = {
+@@ -1889,22 +1898,22 @@ static void rtl8168d_1_hw_phy_config(struct rtl8169_private *tp)
+ { 0x06, 0x6662 }
+ };
+
+- rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
++ rtl_writephy_batch(tp, phy_reg_init, ARRAY_SIZE(phy_reg_init));
+ }
+
+ /* RSET couple improve */
+- mdio_write(ioaddr, 0x1f, 0x0002);
+- mdio_patch(ioaddr, 0x0d, 0x0300);
+- mdio_patch(ioaddr, 0x0f, 0x0010);
++ rtl_writephy(tp, 0x1f, 0x0002);
++ rtl_patchphy(tp, 0x0d, 0x0300);
++ rtl_patchphy(tp, 0x0f, 0x0010);
+
+ /* Fine tune PLL performance */
+- mdio_write(ioaddr, 0x1f, 0x0002);
+- mdio_plus_minus(ioaddr, 0x02, 0x0100, 0x0600);
+- mdio_plus_minus(ioaddr, 0x03, 0x0000, 0xe000);
++ rtl_writephy(tp, 0x1f, 0x0002);
++ rtl_w1w0_phy(tp, 0x02, 0x0100, 0x0600);
++ rtl_w1w0_phy(tp, 0x03, 0x0000, 0xe000);
+
+- mdio_write(ioaddr, 0x1f, 0x0005);
+- mdio_write(ioaddr, 0x05, 0x001b);
+- if (mdio_read(ioaddr, 0x06) == 0xbf00 &&
++ rtl_writephy(tp, 0x1f, 0x0005);
++ rtl_writephy(tp, 0x05, 0x001b);
++ if (rtl_readphy(tp, 0x06) == 0xbf00 &&
+ request_firmware(&fw, FIRMWARE_8168D_1, &tp->pci_dev->dev) == 0) {
+ rtl_phy_write_fw(tp, fw);
+ release_firmware(fw);
+@@ -1912,7 +1921,7 @@ static void rtl8168d_1_hw_phy_config(struct rtl8169_private *tp)
+ netif_warn(tp, probe, tp->dev, "unable to apply firmware patch\n");
+ }
+
+- mdio_write(ioaddr, 0x1f, 0x0000);
++ rtl_writephy(tp, 0x1f, 0x0000);
+ }
+
+ static void rtl8168d_2_hw_phy_config(struct rtl8169_private *tp)
+@@ -1960,7 +1969,7 @@ static void rtl8168d_2_hw_phy_config(struct rtl8169_private *tp)
+ void __iomem *ioaddr = tp->mmio_addr;
+ const struct firmware *fw;
+
+- rtl_phy_write(ioaddr, phy_reg_init_0, ARRAY_SIZE(phy_reg_init_0));
++ rtl_writephy_batch(tp, phy_reg_init_0, ARRAY_SIZE(phy_reg_init_0));
+
+ if (rtl8168d_efuse_read(ioaddr, 0x01) == 0xb1) {
+ static const struct phy_reg phy_reg_init[] = {
+@@ -1974,9 +1983,9 @@ static void rtl8168d_2_hw_phy_config(struct rtl8169_private *tp)
+ };
+ int val;
+
+- rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
++ rtl_writephy_batch(tp, phy_reg_init, ARRAY_SIZE(phy_reg_init));
+
+- val = mdio_read(ioaddr, 0x0d);
++ val = rtl_readphy(tp, 0x0d);
+ if ((val & 0x00ff) != 0x006c) {
+ static const u32 set[] = {
+ 0x0065, 0x0066, 0x0067, 0x0068,
+@@ -1984,11 +1993,11 @@ static void rtl8168d_2_hw_phy_config(struct rtl8169_private *tp)
+ };
+ int i;
+
+- mdio_write(ioaddr, 0x1f, 0x0002);
++ rtl_writephy(tp, 0x1f, 0x0002);
+
+ val &= 0xff00;
+ for (i = 0; i < ARRAY_SIZE(set); i++)
+- mdio_write(ioaddr, 0x0d, val | set[i]);
++ rtl_writephy(tp, 0x0d, val | set[i]);
+ }
+ } else {
+ static const struct phy_reg phy_reg_init[] = {
+@@ -1999,21 +2008,21 @@ static void rtl8168d_2_hw_phy_config(struct rtl8169_private *tp)
+ { 0x06, 0x2642 }
+ };
+
+- rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
++ rtl_writephy_batch(tp, phy_reg_init, ARRAY_SIZE(phy_reg_init));
+ }
+
+ /* Fine tune PLL performance */
+- mdio_write(ioaddr, 0x1f, 0x0002);
+- mdio_plus_minus(ioaddr, 0x02, 0x0100, 0x0600);
+- mdio_plus_minus(ioaddr, 0x03, 0x0000, 0xe000);
++ rtl_writephy(tp, 0x1f, 0x0002);
++ rtl_w1w0_phy(tp, 0x02, 0x0100, 0x0600);
++ rtl_w1w0_phy(tp, 0x03, 0x0000, 0xe000);
+
+ /* Switching regulator Slew rate */
+- mdio_write(ioaddr, 0x1f, 0x0002);
+- mdio_patch(ioaddr, 0x0f, 0x0017);
++ rtl_writephy(tp, 0x1f, 0x0002);
++ rtl_patchphy(tp, 0x0f, 0x0017);
+
+- mdio_write(ioaddr, 0x1f, 0x0005);
+- mdio_write(ioaddr, 0x05, 0x001b);
+- if (mdio_read(ioaddr, 0x06) == 0xb300 &&
++ rtl_writephy(tp, 0x1f, 0x0005);
++ rtl_writephy(tp, 0x05, 0x001b);
++ if (rtl_readphy(tp, 0x06) == 0xb300 &&
+ request_firmware(&fw, FIRMWARE_8168D_2, &tp->pci_dev->dev) == 0) {
+ rtl_phy_write_fw(tp, fw);
+ release_firmware(fw);
+@@ -2021,10 +2030,10 @@ static void rtl8168d_2_hw_phy_config(struct rtl8169_private *tp)
+ netif_warn(tp, probe, tp->dev, "unable to apply firmware patch\n");
+ }
+
+- mdio_write(ioaddr, 0x1f, 0x0000);
++ rtl_writephy(tp, 0x1f, 0x0000);
+ }
+
+-static void rtl8168d_3_hw_phy_config(void __iomem *ioaddr)
++static void rtl8168d_3_hw_phy_config(struct rtl8169_private *tp)
+ {
+ static const struct phy_reg phy_reg_init[] = {
+ { 0x1f, 0x0002 },
+@@ -2082,10 +2091,10 @@ static void rtl8168d_3_hw_phy_config(void __iomem *ioaddr)
+ { 0x1f, 0x0000 }
+ };
+
+- rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
++ rtl_writephy_batch(tp, phy_reg_init, ARRAY_SIZE(phy_reg_init));
+ }
+
+-static void rtl8102e_hw_phy_config(void __iomem *ioaddr)
++static void rtl8102e_hw_phy_config(struct rtl8169_private *tp)
+ {
+ static const struct phy_reg phy_reg_init[] = {
+ { 0x1f, 0x0003 },
+@@ -2094,18 +2103,17 @@ static void rtl8102e_hw_phy_config(void __iomem *ioaddr)
+ { 0x1f, 0x0000 }
+ };
+
+- mdio_write(ioaddr, 0x1f, 0x0000);
+- mdio_patch(ioaddr, 0x11, 1 << 12);
+- mdio_patch(ioaddr, 0x19, 1 << 13);
+- mdio_patch(ioaddr, 0x10, 1 << 15);
++ rtl_writephy(tp, 0x1f, 0x0000);
++ rtl_patchphy(tp, 0x11, 1 << 12);
++ rtl_patchphy(tp, 0x19, 1 << 13);
++ rtl_patchphy(tp, 0x10, 1 << 15);
+
+- rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
++ rtl_writephy_batch(tp, phy_reg_init, ARRAY_SIZE(phy_reg_init));
+ }
+
+ static void rtl_hw_phy_config(struct net_device *dev)
+ {
+ struct rtl8169_private *tp = netdev_priv(dev);
+- void __iomem *ioaddr = tp->mmio_addr;
+
+ rtl8169_print_mac_version(tp);
+
+@@ -2114,49 +2122,49 @@ static void rtl_hw_phy_config(struct net_device *dev)
+ break;
+ case RTL_GIGA_MAC_VER_02:
+ case RTL_GIGA_MAC_VER_03:
+- rtl8169s_hw_phy_config(ioaddr);
++ rtl8169s_hw_phy_config(tp);
+ break;
+ case RTL_GIGA_MAC_VER_04:
+- rtl8169sb_hw_phy_config(ioaddr);
++ rtl8169sb_hw_phy_config(tp);
+ break;
+ case RTL_GIGA_MAC_VER_05:
+- rtl8169scd_hw_phy_config(tp, ioaddr);
++ rtl8169scd_hw_phy_config(tp);
+ break;
+ case RTL_GIGA_MAC_VER_06:
+- rtl8169sce_hw_phy_config(ioaddr);
++ rtl8169sce_hw_phy_config(tp);
+ break;
+ case RTL_GIGA_MAC_VER_07:
+ case RTL_GIGA_MAC_VER_08:
+ case RTL_GIGA_MAC_VER_09:
+- rtl8102e_hw_phy_config(ioaddr);
++ rtl8102e_hw_phy_config(tp);
+ break;
+ case RTL_GIGA_MAC_VER_11:
+- rtl8168bb_hw_phy_config(ioaddr);
++ rtl8168bb_hw_phy_config(tp);
+ break;
+ case RTL_GIGA_MAC_VER_12:
+- rtl8168bef_hw_phy_config(ioaddr);
++ rtl8168bef_hw_phy_config(tp);
+ break;
+ case RTL_GIGA_MAC_VER_17:
+- rtl8168bef_hw_phy_config(ioaddr);
++ rtl8168bef_hw_phy_config(tp);
+ break;
+ case RTL_GIGA_MAC_VER_18:
+- rtl8168cp_1_hw_phy_config(ioaddr);
++ rtl8168cp_1_hw_phy_config(tp);
+ break;
+ case RTL_GIGA_MAC_VER_19:
+- rtl8168c_1_hw_phy_config(ioaddr);
++ rtl8168c_1_hw_phy_config(tp);
+ break;
+ case RTL_GIGA_MAC_VER_20:
+- rtl8168c_2_hw_phy_config(ioaddr);
++ rtl8168c_2_hw_phy_config(tp);
+ break;
+ case RTL_GIGA_MAC_VER_21:
+- rtl8168c_3_hw_phy_config(ioaddr);
++ rtl8168c_3_hw_phy_config(tp);
+ break;
+ case RTL_GIGA_MAC_VER_22:
+- rtl8168c_4_hw_phy_config(ioaddr);
++ rtl8168c_4_hw_phy_config(tp);
+ break;
+ case RTL_GIGA_MAC_VER_23:
+ case RTL_GIGA_MAC_VER_24:
+- rtl8168cp_2_hw_phy_config(ioaddr);
++ rtl8168cp_2_hw_phy_config(tp);
+ break;
+ case RTL_GIGA_MAC_VER_25:
+ rtl8168d_1_hw_phy_config(tp);
+@@ -2165,7 +2173,7 @@ static void rtl_hw_phy_config(struct net_device *dev)
+ rtl8168d_2_hw_phy_config(tp);
+ break;
+ case RTL_GIGA_MAC_VER_27:
+- rtl8168d_3_hw_phy_config(ioaddr);
++ rtl8168d_3_hw_phy_config(tp);
+ break;
+
+ default:
+@@ -2188,7 +2196,7 @@ static void rtl8169_phy_timer(unsigned long __opaque)
+
+ spin_lock_irq(&tp->lock);
+
+- if (tp->phy_reset_pending(ioaddr)) {
++ if (tp->phy_reset_pending(tp)) {
+ /*
+ * A busy loop could burn quite a few cycles on nowadays CPU.
+ * Let's delay the execution of the timer for a few ticks.
+@@ -2202,7 +2210,7 @@ static void rtl8169_phy_timer(unsigned long __opaque)
+
+ netif_warn(tp, link, dev, "PHY reset until link up\n");
+
+- tp->phy_reset_enable(ioaddr);
++ tp->phy_reset_enable(tp);
+
+ out_mod_timer:
+ mod_timer(timer, jiffies + timeout);
+@@ -2262,12 +2270,11 @@ static void rtl8169_release_board(struct pci_dev *pdev, struct net_device *dev,
+ static void rtl8169_phy_reset(struct net_device *dev,
+ struct rtl8169_private *tp)
+ {
+- void __iomem *ioaddr = tp->mmio_addr;
+ unsigned int i;
+
+- tp->phy_reset_enable(ioaddr);
++ tp->phy_reset_enable(tp);
+ for (i = 0; i < 100; i++) {
+- if (!tp->phy_reset_pending(ioaddr))
++ if (!tp->phy_reset_pending(tp))
+ return;
+ msleep(1);
+ }
+@@ -2294,7 +2301,7 @@ static void rtl8169_init_phy(struct net_device *dev, struct rtl8169_private *tp)
+ dprintk("Set MAC Reg C+CR Offset 0x82h = 0x01h\n");
+ RTL_W8(0x82, 0x01);
+ dprintk("Set PHY Reg 0x0bh = 0x00h\n");
+- mdio_write(ioaddr, 0x0b, 0x0000); //w 0x0b 15 0 0
++ rtl_writephy(tp, 0x0b, 0x0000); //w 0x0b 15 0 0
+ }
+
+ rtl8169_phy_reset(dev, tp);
+@@ -2364,11 +2371,11 @@ static int rtl_xmii_ioctl(struct rtl8169_private *tp, struct mii_ioctl_data *dat
+ return 0;
+
+ case SIOCGMIIREG:
+- data->val_out = mdio_read(tp->mmio_addr, data->reg_num & 0x1f);
++ data->val_out = rtl_readphy(tp, data->reg_num & 0x1f);
+ return 0;
+
+ case SIOCSMIIREG:
+- mdio_write(tp->mmio_addr, data->reg_num & 0x1f, data->val_in);
++ rtl_writephy(tp, data->reg_num & 0x1f, data->val_in);
+ return 0;
+ }
+ return -EOPNOTSUPP;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0034-r8169-8168DP-specific-MII-registers-access-methods.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0034-r8169-8168DP-specific-MII-registers-access-methods.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,149 @@
+From: =?UTF-8?q?fran=C3=A7ois=20romieu?= <romieu at fr.zoreil.com>
+Date: Mon, 3 Jan 2011 15:08:04 +0000
+Subject: [PATCH 34/47] r8169: 8168DP specific MII registers access methods.
+
+commit c0e45c1ca3162acb2e77b3d9e152ce6e7b6fa3f5 upstream.
+
+Adapted from version 8.019.00 of Realtek's r8168 driver and
+amended per Hayes Wang's correction :
+- OCPDR_GPHY_REG_SHIFT must be 16, not 12
+- the reg should be at bit 16 ~ 22, whence OCPDR_REG_MASK
+
+Signed-off-by: Francois Romieu <romieu at fr.zoreil.com>
+Cc: Hayes <hayeswang at realtek.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/r8169.c | 83 +++++++++++++++++++++++++++++++++++++++++++++++++-
+ 1 files changed, 81 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index 80a0caa..848c8f0 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -278,6 +278,20 @@ enum rtl8168_8101_registers {
+ #define EFUSEAR_DATA_MASK 0xff
+ };
+
++enum rtl8168_registers {
++ EPHY_RXER_NUM = 0x7c,
++ OCPDR = 0xb0, /* OCP GPHY access */
++#define OCPDR_WRITE_CMD 0x80000000
++#define OCPDR_READ_CMD 0x00000000
++#define OCPDR_REG_MASK 0x7f
++#define OCPDR_GPHY_REG_SHIFT 16
++#define OCPDR_DATA_MASK 0xffff
++ OCPAR = 0xb4,
++#define OCPAR_FLAG 0x80000000
++#define OCPAR_GPHY_WRITE_CMD 0x8000f060
++#define OCPAR_GPHY_READ_CMD 0x0000f060
++};
++
+ enum rtl_register_content {
+ /* InterruptStatusBits */
+ SYSErr = 0x8000,
+@@ -501,6 +515,12 @@ struct rtl8169_private {
+ #ifdef CONFIG_R8169_VLAN
+ struct vlan_group *vlgrp;
+ #endif
++
++ struct mdio_ops {
++ void (*write)(void __iomem *, int, int);
++ int (*read)(void __iomem *, int);
++ } mdio_ops;
++
+ int (*set_speed)(struct net_device *, u8 autoneg, u16 speed, u8 duplex);
+ int (*get_settings)(struct net_device *, struct ethtool_cmd *);
+ void (*phy_reset_enable)(struct rtl8169_private *tp);
+@@ -596,14 +616,55 @@ static int r8169_mdio_read(void __iomem *ioaddr, int reg_addr)
+ return value;
+ }
+
++static void r8168dp_1_mdio_access(void __iomem *ioaddr, int reg_addr, u32 data)
++{
++ int i;
++
++ RTL_W32(OCPDR, data |
++ ((reg_addr & OCPDR_REG_MASK) << OCPDR_GPHY_REG_SHIFT));
++ RTL_W32(OCPAR, OCPAR_GPHY_WRITE_CMD);
++ RTL_W32(EPHY_RXER_NUM, 0);
++
++ for (i = 0; i < 100; i++) {
++ mdelay(1);
++ if (!(RTL_R32(OCPAR) & OCPAR_FLAG))
++ break;
++ }
++}
++
++static void r8168dp_1_mdio_write(void __iomem *ioaddr, int reg_addr, int value)
++{
++ r8168dp_1_mdio_access(ioaddr, reg_addr, OCPDR_WRITE_CMD |
++ (value & OCPDR_DATA_MASK));
++}
++
++static int r8168dp_1_mdio_read(void __iomem *ioaddr, int reg_addr)
++{
++ int i;
++
++ r8168dp_1_mdio_access(ioaddr, reg_addr, OCPDR_READ_CMD);
++
++ mdelay(1);
++ RTL_W32(OCPAR, OCPAR_GPHY_READ_CMD);
++ RTL_W32(EPHY_RXER_NUM, 0);
++
++ for (i = 0; i < 100; i++) {
++ mdelay(1);
++ if (RTL_R32(OCPAR) & OCPAR_FLAG)
++ break;
++ }
++
++ return RTL_R32(OCPDR) & OCPDR_DATA_MASK;
++}
++
+ static void rtl_writephy(struct rtl8169_private *tp, int location, u32 val)
+ {
+- r8169_mdio_write(tp->mmio_addr, location, val);
++ tp->mdio_ops.write(tp->mmio_addr, location, val);
+ }
+
+ static int rtl_readphy(struct rtl8169_private *tp, int location)
+ {
+- return r8169_mdio_read(tp->mmio_addr, location);
++ return tp->mdio_ops.read(tp->mmio_addr, location);
+ }
+
+ static void rtl_patchphy(struct rtl8169_private *tp, int reg_addr, int value)
+@@ -2475,6 +2536,22 @@ static const struct net_device_ops rtl8169_netdev_ops = {
+
+ };
+
++static void __devinit rtl_init_mdio_ops(struct rtl8169_private *tp)
++{
++ struct mdio_ops *ops = &tp->mdio_ops;
++
++ switch (tp->mac_version) {
++ case RTL_GIGA_MAC_VER_27:
++ ops->write = r8168dp_1_mdio_write;
++ ops->read = r8168dp_1_mdio_read;
++ break;
++ default:
++ ops->write = r8169_mdio_write;
++ ops->read = r8169_mdio_read;
++ break;
++ }
++}
++
+ static int __devinit
+ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
+ {
+@@ -2598,6 +2675,8 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
+ /* Identify chip attached to board */
+ rtl8169_get_mac_version(tp, ioaddr);
+
++ rtl_init_mdio_ops(tp);
++
+ /* Use appropriate default if unknown */
+ if (tp->mac_version == RTL_GIGA_MAC_NONE) {
+ netif_notice(tp, probe, dev,
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0035-r8169-phy-power-ops.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0035-r8169-phy-power-ops.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,253 @@
+From: =?UTF-8?q?fran=C3=A7ois=20romieu?= <romieu at fr.zoreil.com>
+Date: Mon, 3 Jan 2011 15:08:12 +0000
+Subject: [PATCH 35/47] r8169: phy power ops
+
+commit 065c27c184d64aeb9ae107c0ef7026ea3642b15b upstream.
+
+Bits from :
+- version 8.019.00 of Realtek's 8168 driver
+- version 1.019.00 of Realtek's 8101 driver
+
+Plain old 8169 (PCI) devices do not seem to need anything akin to it.
+
+Signed-off-by: Francois Romieu <romieu at fr.zoreil.com>
+Cc: Hayes <hayeswang at realtek.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/r8169.c | 167 ++++++++++++++++++++++++++++++++++++++++++++++++++-
+ 1 files changed, 166 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index 848c8f0..43efca6 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -259,7 +259,7 @@ enum rtl8168_8101_registers {
+ #define CSIAR_BYTE_ENABLE 0x0f
+ #define CSIAR_BYTE_ENABLE_SHIFT 12
+ #define CSIAR_ADDR_MASK 0x0fff
+-
++ PMCH = 0x6f,
+ EPHYAR = 0x80,
+ #define EPHYAR_FLAG 0x80000000
+ #define EPHYAR_WRITE_CMD 0x80000000
+@@ -521,6 +521,11 @@ struct rtl8169_private {
+ int (*read)(void __iomem *, int);
+ } mdio_ops;
+
++ struct pll_power_ops {
++ void (*down)(struct rtl8169_private *);
++ void (*up)(struct rtl8169_private *);
++ } pll_power_ops;
++
+ int (*set_speed)(struct net_device *, u8 autoneg, u16 speed, u8 duplex);
+ int (*get_settings)(struct net_device *, struct ethtool_cmd *);
+ void (*phy_reset_enable)(struct rtl8169_private *tp);
+@@ -2552,6 +2557,152 @@ static void __devinit rtl_init_mdio_ops(struct rtl8169_private *tp)
+ }
+ }
+
++static void r810x_phy_power_down(struct rtl8169_private *tp)
++{
++ rtl_writephy(tp, 0x1f, 0x0000);
++ rtl_writephy(tp, MII_BMCR, BMCR_PDOWN);
++}
++
++static void r810x_phy_power_up(struct rtl8169_private *tp)
++{
++ rtl_writephy(tp, 0x1f, 0x0000);
++ rtl_writephy(tp, MII_BMCR, BMCR_ANENABLE);
++}
++
++static void r810x_pll_power_down(struct rtl8169_private *tp)
++{
++ if (__rtl8169_get_wol(tp) & WAKE_ANY) {
++ rtl_writephy(tp, 0x1f, 0x0000);
++ rtl_writephy(tp, MII_BMCR, 0x0000);
++ return;
++ }
++
++ r810x_phy_power_down(tp);
++}
++
++static void r810x_pll_power_up(struct rtl8169_private *tp)
++{
++ r810x_phy_power_up(tp);
++}
++
++static void r8168_phy_power_up(struct rtl8169_private *tp)
++{
++ rtl_writephy(tp, 0x1f, 0x0000);
++ rtl_writephy(tp, 0x0e, 0x0000);
++ rtl_writephy(tp, MII_BMCR, BMCR_ANENABLE);
++}
++
++static void r8168_phy_power_down(struct rtl8169_private *tp)
++{
++ rtl_writephy(tp, 0x1f, 0x0000);
++ rtl_writephy(tp, 0x0e, 0x0200);
++ rtl_writephy(tp, MII_BMCR, BMCR_PDOWN);
++}
++
++static void r8168_pll_power_down(struct rtl8169_private *tp)
++{
++ void __iomem *ioaddr = tp->mmio_addr;
++
++ if (tp->mac_version == RTL_GIGA_MAC_VER_27)
++ return;
++
++ if (((tp->mac_version == RTL_GIGA_MAC_VER_23) ||
++ (tp->mac_version == RTL_GIGA_MAC_VER_24)) &&
++ (RTL_R16(CPlusCmd) & ASF)) {
++ return;
++ }
++
++ if (__rtl8169_get_wol(tp) & WAKE_ANY) {
++ rtl_writephy(tp, 0x1f, 0x0000);
++ rtl_writephy(tp, MII_BMCR, 0x0000);
++
++ RTL_W32(RxConfig, RTL_R32(RxConfig) |
++ AcceptBroadcast | AcceptMulticast | AcceptMyPhys);
++ return;
++ }
++
++ r8168_phy_power_down(tp);
++
++ switch (tp->mac_version) {
++ case RTL_GIGA_MAC_VER_25:
++ case RTL_GIGA_MAC_VER_26:
++ RTL_W8(PMCH, RTL_R8(PMCH) & ~0x80);
++ break;
++ }
++}
++
++static void r8168_pll_power_up(struct rtl8169_private *tp)
++{
++ void __iomem *ioaddr = tp->mmio_addr;
++
++ if (tp->mac_version == RTL_GIGA_MAC_VER_27)
++ return;
++
++ switch (tp->mac_version) {
++ case RTL_GIGA_MAC_VER_25:
++ case RTL_GIGA_MAC_VER_26:
++ RTL_W8(PMCH, RTL_R8(PMCH) | 0x80);
++ break;
++ }
++
++ r8168_phy_power_up(tp);
++}
++
++static void rtl_pll_power_op(struct rtl8169_private *tp,
++ void (*op)(struct rtl8169_private *))
++{
++ if (op)
++ op(tp);
++}
++
++static void rtl_pll_power_down(struct rtl8169_private *tp)
++{
++ rtl_pll_power_op(tp, tp->pll_power_ops.down);
++}
++
++static void rtl_pll_power_up(struct rtl8169_private *tp)
++{
++ rtl_pll_power_op(tp, tp->pll_power_ops.up);
++}
++
++static void __devinit rtl_init_pll_power_ops(struct rtl8169_private *tp)
++{
++ struct pll_power_ops *ops = &tp->pll_power_ops;
++
++ switch (tp->mac_version) {
++ case RTL_GIGA_MAC_VER_07:
++ case RTL_GIGA_MAC_VER_08:
++ case RTL_GIGA_MAC_VER_09:
++ case RTL_GIGA_MAC_VER_10:
++ case RTL_GIGA_MAC_VER_16:
++ ops->down = r810x_pll_power_down;
++ ops->up = r810x_pll_power_up;
++ break;
++
++ case RTL_GIGA_MAC_VER_11:
++ case RTL_GIGA_MAC_VER_12:
++ case RTL_GIGA_MAC_VER_17:
++ case RTL_GIGA_MAC_VER_18:
++ case RTL_GIGA_MAC_VER_19:
++ case RTL_GIGA_MAC_VER_20:
++ case RTL_GIGA_MAC_VER_21:
++ case RTL_GIGA_MAC_VER_22:
++ case RTL_GIGA_MAC_VER_23:
++ case RTL_GIGA_MAC_VER_24:
++ case RTL_GIGA_MAC_VER_25:
++ case RTL_GIGA_MAC_VER_26:
++ case RTL_GIGA_MAC_VER_27:
++ ops->down = r8168_pll_power_down;
++ ops->up = r8168_pll_power_up;
++ break;
++
++ default:
++ ops->down = NULL;
++ ops->up = NULL;
++ break;
++ }
++}
++
+ static int __devinit
+ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
+ {
+@@ -2676,6 +2827,7 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
+ rtl8169_get_mac_version(tp, ioaddr);
+
+ rtl_init_mdio_ops(tp);
++ rtl_init_pll_power_ops(tp);
+
+ /* Use appropriate default if unknown */
+ if (tp->mac_version == RTL_GIGA_MAC_NONE) {
+@@ -2863,6 +3015,8 @@ static int rtl8169_open(struct net_device *dev)
+
+ napi_enable(&tp->napi);
+
++ rtl_pll_power_up(tp);
++
+ rtl_hw_start(dev);
+
+ rtl8169_request_timer(dev);
+@@ -4273,6 +4427,8 @@ static void rtl8169_down(struct net_device *dev)
+ rtl8169_tx_clear(tp);
+
+ rtl8169_rx_clear(tp);
++
++ rtl_pll_power_down(tp);
+ }
+
+ static int rtl8169_close(struct net_device *dev)
+@@ -4377,9 +4533,13 @@ static struct net_device_stats *rtl8169_get_stats(struct net_device *dev)
+
+ static void rtl8169_net_suspend(struct net_device *dev)
+ {
++ struct rtl8169_private *tp = netdev_priv(dev);
++
+ if (!netif_running(dev))
+ return;
+
++ rtl_pll_power_down(tp);
++
+ netif_device_detach(dev);
+ netif_stop_queue(dev);
+ }
+@@ -4398,7 +4558,12 @@ static int rtl8169_suspend(struct device *device)
+
+ static void __rtl8169_resume(struct net_device *dev)
+ {
++ struct rtl8169_private *tp = netdev_priv(dev);
++
+ netif_device_attach(dev);
++
++ rtl_pll_power_up(tp);
++
+ rtl8169_schedule_work(dev, rtl8169_reset_task);
+ }
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0036-r8169-magic.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0036-r8169-magic.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,144 @@
+From: =?UTF-8?q?fran=C3=A7ois=20romieu?= <romieu at fr.zoreil.com>
+Date: Mon, 3 Jan 2011 15:08:21 +0000
+Subject: [PATCH 36/47] r8169: magic.
+
+commit b646d90053f887c1bc243191e693a9b02d09f2c2 upstream.
+
+Adapted from version 8.019.00 of Realtek's r8168 driver.
+
+Signed-off-by: Francois Romieu <romieu at fr.zoreil.com>
+Cc: Hayes <hayeswang at realtek.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Adjust context for omitted changes]
+---
+ drivers/net/r8169.c | 93 +++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 files changed, 93 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index 43efca6..70e12b3 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -279,6 +279,18 @@ enum rtl8168_8101_registers {
+ };
+
+ enum rtl8168_registers {
++ ERIDR = 0x70,
++ ERIAR = 0x74,
++#define ERIAR_FLAG 0x80000000
++#define ERIAR_WRITE_CMD 0x80000000
++#define ERIAR_READ_CMD 0x00000000
++#define ERIAR_ADDR_BYTE_ALIGN 4
++#define ERIAR_EXGMAC 0
++#define ERIAR_MSIX 1
++#define ERIAR_ASF 2
++#define ERIAR_TYPE_SHIFT 16
++#define ERIAR_BYTEEN 0x0f
++#define ERIAR_BYTEEN_SHIFT 12
+ EPHY_RXER_NUM = 0x7c,
+ OCPDR = 0xb0, /* OCP GPHY access */
+ #define OCPDR_WRITE_CMD 0x80000000
+@@ -573,6 +585,81 @@ static int rtl8169_poll(struct napi_struct *napi, int budget);
+ static const unsigned int rtl8169_rx_config =
+ (RX_FIFO_THRESH << RxCfgFIFOShift) | (RX_DMA_BURST << RxCfgDMAShift);
+
++static u32 ocp_read(struct rtl8169_private *tp, u8 mask, u16 reg)
++{
++ void __iomem *ioaddr = tp->mmio_addr;
++ int i;
++
++ RTL_W32(OCPAR, ((u32)mask & 0x0f) << 12 | (reg & 0x0fff));
++ for (i = 0; i < 20; i++) {
++ udelay(100);
++ if (RTL_R32(OCPAR) & OCPAR_FLAG)
++ break;
++ }
++ return RTL_R32(OCPDR);
++}
++
++static void ocp_write(struct rtl8169_private *tp, u8 mask, u16 reg, u32 data)
++{
++ void __iomem *ioaddr = tp->mmio_addr;
++ int i;
++
++ RTL_W32(OCPDR, data);
++ RTL_W32(OCPAR, OCPAR_FLAG | ((u32)mask & 0x0f) << 12 | (reg & 0x0fff));
++ for (i = 0; i < 20; i++) {
++ udelay(100);
++ if ((RTL_R32(OCPAR) & OCPAR_FLAG) == 0)
++ break;
++ }
++}
++
++static void rtl8168_oob_notify(void __iomem *ioaddr, u8 cmd)
++{
++ int i;
++
++ RTL_W8(ERIDR, cmd);
++ RTL_W32(ERIAR, 0x800010e8);
++ msleep(2);
++ for (i = 0; i < 5; i++) {
++ udelay(100);
++ if (!(RTL_R32(ERIDR) & ERIAR_FLAG))
++ break;
++ }
++
++ ocp_write(ioaddr, 0x1, 0x30, 0x00000001);
++}
++
++#define OOB_CMD_RESET 0x00
++#define OOB_CMD_DRIVER_START 0x05
++#define OOB_CMD_DRIVER_STOP 0x06
++
++static void rtl8168_driver_start(struct rtl8169_private *tp)
++{
++ int i;
++
++ rtl8168_oob_notify(tp, OOB_CMD_DRIVER_START);
++
++ for (i = 0; i < 10; i++) {
++ msleep(10);
++ if (ocp_read(tp, 0x0f, 0x0010) & 0x00000800)
++ break;
++ }
++}
++
++static void rtl8168_driver_stop(struct rtl8169_private *tp)
++{
++ int i;
++
++ rtl8168_oob_notify(tp, OOB_CMD_DRIVER_STOP);
++
++ for (i = 0; i < 10; i++) {
++ msleep(10);
++ if ((ocp_read(tp, 0x0f, 0x0010) & 0x00000800) == 0)
++ break;
++ }
++}
++
++
+ static void r8169_mdio_write(void __iomem *ioaddr, int reg_addr, int value)
+ {
+ int i;
+@@ -2919,6 +3006,9 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
+ dev->base_addr, dev->dev_addr,
+ (u32)(RTL_R32(TxConfig) & 0x9cf0f8ff), dev->irq);
+
++ if (tp->mac_version == RTL_GIGA_MAC_VER_27)
++ rtl8168_driver_start(tp);
++
+ rtl8169_init_phy(dev, tp);
+
+ /*
+@@ -2959,6 +3049,9 @@ static void __devexit rtl8169_remove_one(struct pci_dev *pdev)
+
+ pm_runtime_get_sync(&pdev->dev);
+
++ if (tp->mac_version == RTL_GIGA_MAC_VER_27)
++ rtl8168_driver_stop(tp);
++
+ flush_scheduled_work();
+
+ unregister_netdev(dev);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0037-r8169-rtl_csi_access_enable-rename.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0037-r8169-rtl_csi_access_enable-rename.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,125 @@
+From: =?UTF-8?q?fran=C3=A7ois=20romieu?= <romieu at fr.zoreil.com>
+Date: Mon, 3 Jan 2011 15:08:29 +0000
+Subject: [PATCH 37/47] r8169: rtl_csi_access_enable rename.
+
+commit 650e8d5d1fdd5e55869136e2df54287a4432d87f upstream.
+
+Newer 8168 needs a slightly different rtl_csi_access_enable.
+This patch separates some noise from the real thing.
+
+No functional change.
+
+Signed-off-by: Francois Romieu <romieu at fr.zoreil.com>
+Cc: Hayes <hayeswang at realtek.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/r8169.c | 27 ++++++++++++++++-----------
+ 1 files changed, 16 insertions(+), 11 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index 70e12b3..0233330 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -3324,12 +3324,17 @@ static void rtl_tx_performance_tweak(struct pci_dev *pdev, u16 force)
+ }
+ }
+
+-static void rtl_csi_access_enable(void __iomem *ioaddr)
++static void rtl_csi_access_enable(void __iomem *ioaddr, u32 bits)
+ {
+ u32 csi;
+
+ csi = rtl_csi_read(ioaddr, 0x070c) & 0x00ffffff;
+- rtl_csi_write(ioaddr, 0x070c, csi | 0x27000000);
++ rtl_csi_write(ioaddr, 0x070c, csi | bits);
++}
++
++static void rtl_csi_access_enable_2(void __iomem *ioaddr)
++{
++ rtl_csi_access_enable(ioaddr, 0x27000000);
+ }
+
+ struct ephy_info {
+@@ -3417,7 +3422,7 @@ static void rtl_hw_start_8168cp_1(void __iomem *ioaddr, struct pci_dev *pdev)
+ { 0x07, 0, 0x2000 }
+ };
+
+- rtl_csi_access_enable(ioaddr);
++ rtl_csi_access_enable_2(ioaddr);
+
+ rtl_ephy_init(ioaddr, e_info_8168cp, ARRAY_SIZE(e_info_8168cp));
+
+@@ -3426,7 +3431,7 @@ static void rtl_hw_start_8168cp_1(void __iomem *ioaddr, struct pci_dev *pdev)
+
+ static void rtl_hw_start_8168cp_2(void __iomem *ioaddr, struct pci_dev *pdev)
+ {
+- rtl_csi_access_enable(ioaddr);
++ rtl_csi_access_enable_2(ioaddr);
+
+ RTL_W8(Config3, RTL_R8(Config3) & ~Beacon_en);
+
+@@ -3437,7 +3442,7 @@ static void rtl_hw_start_8168cp_2(void __iomem *ioaddr, struct pci_dev *pdev)
+
+ static void rtl_hw_start_8168cp_3(void __iomem *ioaddr, struct pci_dev *pdev)
+ {
+- rtl_csi_access_enable(ioaddr);
++ rtl_csi_access_enable_2(ioaddr);
+
+ RTL_W8(Config3, RTL_R8(Config3) & ~Beacon_en);
+
+@@ -3459,7 +3464,7 @@ static void rtl_hw_start_8168c_1(void __iomem *ioaddr, struct pci_dev *pdev)
+ { 0x06, 0x0080, 0x0000 }
+ };
+
+- rtl_csi_access_enable(ioaddr);
++ rtl_csi_access_enable_2(ioaddr);
+
+ RTL_W8(DBG_REG, 0x06 | FIX_NAK_1 | FIX_NAK_2);
+
+@@ -3475,7 +3480,7 @@ static void rtl_hw_start_8168c_2(void __iomem *ioaddr, struct pci_dev *pdev)
+ { 0x03, 0x0400, 0x0220 }
+ };
+
+- rtl_csi_access_enable(ioaddr);
++ rtl_csi_access_enable_2(ioaddr);
+
+ rtl_ephy_init(ioaddr, e_info_8168c_2, ARRAY_SIZE(e_info_8168c_2));
+
+@@ -3489,14 +3494,14 @@ static void rtl_hw_start_8168c_3(void __iomem *ioaddr, struct pci_dev *pdev)
+
+ static void rtl_hw_start_8168c_4(void __iomem *ioaddr, struct pci_dev *pdev)
+ {
+- rtl_csi_access_enable(ioaddr);
++ rtl_csi_access_enable_2(ioaddr);
+
+ __rtl_hw_start_8168cp(ioaddr, pdev);
+ }
+
+ static void rtl_hw_start_8168d(void __iomem *ioaddr, struct pci_dev *pdev)
+ {
+- rtl_csi_access_enable(ioaddr);
++ rtl_csi_access_enable_2(ioaddr);
+
+ rtl_disable_clock_request(pdev);
+
+@@ -3626,7 +3631,7 @@ static void rtl_hw_start_8102e_1(void __iomem *ioaddr, struct pci_dev *pdev)
+ };
+ u8 cfg1;
+
+- rtl_csi_access_enable(ioaddr);
++ rtl_csi_access_enable_2(ioaddr);
+
+ RTL_W8(DBG_REG, FIX_NAK_1);
+
+@@ -3647,7 +3652,7 @@ static void rtl_hw_start_8102e_1(void __iomem *ioaddr, struct pci_dev *pdev)
+
+ static void rtl_hw_start_8102e_2(void __iomem *ioaddr, struct pci_dev *pdev)
+ {
+- rtl_csi_access_enable(ioaddr);
++ rtl_csi_access_enable_2(ioaddr);
+
+ rtl_tx_performance_tweak(pdev, 0x5 << MAX_READ_REQUEST_SHIFT);
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0038-r8169-more-8168dp-support.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0038-r8169-more-8168dp-support.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,315 @@
+From: =?UTF-8?q?fran=C3=A7ois=20romieu?= <romieu at fr.zoreil.com>
+Date: Mon, 3 Jan 2011 15:08:37 +0000
+Subject: [PATCH 38/47] r8169: more 8168dp support.
+
+commit e6de30d63eb17c5cbb7affdfc71df95286bfa7d9 upstream.
+
+Adapted from version 8.019.00 of Realtek's r8168 driver
+
+Signed-off-by: Francois Romieu <romieu at fr.zoreil.com>
+Cc: Hayes <hayeswang at realtek.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Adjust context for omitted changes]
+---
+ drivers/net/r8169.c | 145 +++++++++++++++++++++++++++++++++++++++++++++++---
+ 1 files changed, 136 insertions(+), 9 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index 0233330..6ab2fbe 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -122,7 +122,8 @@ enum mac_version {
+ RTL_GIGA_MAC_VER_24 = 0x18, // 8168CP
+ RTL_GIGA_MAC_VER_25 = 0x19, // 8168D
+ RTL_GIGA_MAC_VER_26 = 0x1a, // 8168D
+- RTL_GIGA_MAC_VER_27 = 0x1b // 8168DP
++ RTL_GIGA_MAC_VER_27 = 0x1b, // 8168DP
++ RTL_GIGA_MAC_VER_28 = 0x1c, // 8168DP
+ };
+
+ #define _R(NAME,MAC,MASK) \
+@@ -159,7 +160,8 @@ static const struct {
+ _R("RTL8168cp/8111cp", RTL_GIGA_MAC_VER_24, 0xff7e1880), // PCI-E
+ _R("RTL8168d/8111d", RTL_GIGA_MAC_VER_25, 0xff7e1880), // PCI-E
+ _R("RTL8168d/8111d", RTL_GIGA_MAC_VER_26, 0xff7e1880), // PCI-E
+- _R("RTL8168dp/8111dp", RTL_GIGA_MAC_VER_27, 0xff7e1880) // PCI-E
++ _R("RTL8168dp/8111dp", RTL_GIGA_MAC_VER_27, 0xff7e1880), // PCI-E
++ _R("RTL8168dp/8111dp", RTL_GIGA_MAC_VER_28, 0xff7e1880) // PCI-E
+ };
+ #undef _R
+
+@@ -302,6 +304,7 @@ enum rtl8168_registers {
+ #define OCPAR_FLAG 0x80000000
+ #define OCPAR_GPHY_WRITE_CMD 0x8000f060
+ #define OCPAR_GPHY_READ_CMD 0x0000f060
++ RDSAR1 = 0xd0 /* 8168c only. Undocumented on 8168dp */
+ };
+
+ enum rtl_register_content {
+@@ -749,6 +752,40 @@ static int r8168dp_1_mdio_read(void __iomem *ioaddr, int reg_addr)
+ return RTL_R32(OCPDR) & OCPDR_DATA_MASK;
+ }
+
++#define R8168DP_1_MDIO_ACCESS_BIT 0x00020000
++
++static void r8168dp_2_mdio_start(void __iomem *ioaddr)
++{
++ RTL_W32(0xd0, RTL_R32(0xd0) & ~R8168DP_1_MDIO_ACCESS_BIT);
++}
++
++static void r8168dp_2_mdio_stop(void __iomem *ioaddr)
++{
++ RTL_W32(0xd0, RTL_R32(0xd0) | R8168DP_1_MDIO_ACCESS_BIT);
++}
++
++static void r8168dp_2_mdio_write(void __iomem *ioaddr, int reg_addr, int value)
++{
++ r8168dp_2_mdio_start(ioaddr);
++
++ r8169_mdio_write(ioaddr, reg_addr, value);
++
++ r8168dp_2_mdio_stop(ioaddr);
++}
++
++static int r8168dp_2_mdio_read(void __iomem *ioaddr, int reg_addr)
++{
++ int value;
++
++ r8168dp_2_mdio_start(ioaddr);
++
++ value = r8169_mdio_read(ioaddr, reg_addr);
++
++ r8168dp_2_mdio_stop(ioaddr);
++
++ return value;
++}
++
+ static void rtl_writephy(struct rtl8169_private *tp, int location, u32 val)
+ {
+ tp->mdio_ops.write(tp->mmio_addr, location, val);
+@@ -1496,9 +1533,12 @@ static void rtl8169_get_mac_version(struct rtl8169_private *tp,
+ /* 8168D family. */
+ { 0x7cf00000, 0x28300000, RTL_GIGA_MAC_VER_26 },
+ { 0x7cf00000, 0x28100000, RTL_GIGA_MAC_VER_25 },
+- { 0x7c800000, 0x28800000, RTL_GIGA_MAC_VER_27 },
+ { 0x7c800000, 0x28000000, RTL_GIGA_MAC_VER_26 },
+
++ /* 8168DP family. */
++ { 0x7cf00000, 0x28800000, RTL_GIGA_MAC_VER_27 },
++ { 0x7cf00000, 0x28a00000, RTL_GIGA_MAC_VER_28 },
++
+ /* 8168C family. */
+ { 0x7cf00000, 0x3cb00000, RTL_GIGA_MAC_VER_24 },
+ { 0x7cf00000, 0x3c900000, RTL_GIGA_MAC_VER_23 },
+@@ -2247,6 +2287,22 @@ static void rtl8168d_3_hw_phy_config(struct rtl8169_private *tp)
+ rtl_writephy_batch(tp, phy_reg_init, ARRAY_SIZE(phy_reg_init));
+ }
+
++static void rtl8168d_4_hw_phy_config(struct rtl8169_private *tp)
++{
++ static const struct phy_reg phy_reg_init[] = {
++ { 0x1f, 0x0001 },
++ { 0x17, 0x0cc0 },
++
++ { 0x1f, 0x0007 },
++ { 0x1e, 0x002d },
++ { 0x18, 0x0040 },
++ { 0x1f, 0x0000 }
++ };
++
++ rtl_writephy_batch(tp, phy_reg_init, ARRAY_SIZE(phy_reg_init));
++ rtl_patchphy(tp, 0x0d, 1 << 5);
++}
++
+ static void rtl8102e_hw_phy_config(struct rtl8169_private *tp)
+ {
+ static const struct phy_reg phy_reg_init[] = {
+@@ -2328,6 +2384,9 @@ static void rtl_hw_phy_config(struct net_device *dev)
+ case RTL_GIGA_MAC_VER_27:
+ rtl8168d_3_hw_phy_config(tp);
+ break;
++ case RTL_GIGA_MAC_VER_28:
++ rtl8168d_4_hw_phy_config(tp);
++ break;
+
+ default:
+ break;
+@@ -2637,6 +2696,10 @@ static void __devinit rtl_init_mdio_ops(struct rtl8169_private *tp)
+ ops->write = r8168dp_1_mdio_write;
+ ops->read = r8168dp_1_mdio_read;
+ break;
++ case RTL_GIGA_MAC_VER_28:
++ ops->write = r8168dp_2_mdio_write;
++ ops->read = r8168dp_2_mdio_read;
++ break;
+ default:
+ ops->write = r8169_mdio_write;
+ ops->read = r8169_mdio_read;
+@@ -2779,6 +2842,7 @@ static void __devinit rtl_init_pll_power_ops(struct rtl8169_private *tp)
+ case RTL_GIGA_MAC_VER_25:
+ case RTL_GIGA_MAC_VER_26:
+ case RTL_GIGA_MAC_VER_27:
++ case RTL_GIGA_MAC_VER_28:
+ ops->down = r8168_pll_power_down;
+ ops->up = r8168_pll_power_up;
+ break;
+@@ -3006,8 +3070,10 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
+ dev->base_addr, dev->dev_addr,
+ (u32)(RTL_R32(TxConfig) & 0x9cf0f8ff), dev->irq);
+
+- if (tp->mac_version == RTL_GIGA_MAC_VER_27)
++ if ((tp->mac_version == RTL_GIGA_MAC_VER_27) ||
++ (tp->mac_version == RTL_GIGA_MAC_VER_28)) {
+ rtl8168_driver_start(tp);
++ }
+
+ rtl8169_init_phy(dev, tp);
+
+@@ -3049,8 +3115,10 @@ static void __devexit rtl8169_remove_one(struct pci_dev *pdev)
+
+ pm_runtime_get_sync(&pdev->dev);
+
+- if (tp->mac_version == RTL_GIGA_MAC_VER_27)
++ if ((tp->mac_version == RTL_GIGA_MAC_VER_27) ||
++ (tp->mac_version == RTL_GIGA_MAC_VER_28)) {
+ rtl8168_driver_stop(tp);
++ }
+
+ flush_scheduled_work();
+
+@@ -3136,11 +3204,19 @@ err_pm_runtime_put:
+ goto out;
+ }
+
+-static void rtl8169_hw_reset(void __iomem *ioaddr)
++static void rtl8169_hw_reset(struct rtl8169_private *tp)
+ {
++ void __iomem *ioaddr = tp->mmio_addr;
++
+ /* Disable interrupts */
+ rtl8169_irq_mask_and_ack(ioaddr);
+
++ if (tp->mac_version == RTL_GIGA_MAC_VER_28) {
++ while (RTL_R8(TxPoll) & NPQ)
++ udelay(20);
++
++ }
++
+ /* Reset the chipset */
+ RTL_W8(ChipCmd, CmdReset);
+
+@@ -3332,6 +3408,11 @@ static void rtl_csi_access_enable(void __iomem *ioaddr, u32 bits)
+ rtl_csi_write(ioaddr, 0x070c, csi | bits);
+ }
+
++static void rtl_csi_access_enable_1(void __iomem *ioaddr)
++{
++ rtl_csi_access_enable(ioaddr, 0x17000000);
++}
++
+ static void rtl_csi_access_enable_2(void __iomem *ioaddr)
+ {
+ rtl_csi_access_enable(ioaddr, 0x27000000);
+@@ -3369,6 +3450,21 @@ static void rtl_disable_clock_request(struct pci_dev *pdev)
+ }
+ }
+
++static void rtl_enable_clock_request(struct pci_dev *pdev)
++{
++ struct net_device *dev = pci_get_drvdata(pdev);
++ struct rtl8169_private *tp = netdev_priv(dev);
++ int cap = tp->pcie_cap;
++
++ if (cap) {
++ u16 ctl;
++
++ pci_read_config_word(pdev, cap + PCI_EXP_LNKCTL, &ctl);
++ ctl |= PCI_EXP_LNKCTL_CLKREQ_EN;
++ pci_write_config_word(pdev, cap + PCI_EXP_LNKCTL, ctl);
++ }
++}
++
+ #define R8168_CPCMD_QUIRK_MASK (\
+ EnableBist | \
+ Mac_dbgo_oe | \
+@@ -3512,6 +3608,32 @@ static void rtl_hw_start_8168d(void __iomem *ioaddr, struct pci_dev *pdev)
+ RTL_W16(CPlusCmd, RTL_R16(CPlusCmd) & ~R8168_CPCMD_QUIRK_MASK);
+ }
+
++static void rtl_hw_start_8168d_4(void __iomem *ioaddr, struct pci_dev *pdev)
++{
++ static const struct ephy_info e_info_8168d_4[] = {
++ { 0x0b, ~0, 0x48 },
++ { 0x19, 0x20, 0x50 },
++ { 0x0c, ~0, 0x20 }
++ };
++ int i;
++
++ rtl_csi_access_enable_1(ioaddr);
++
++ rtl_tx_performance_tweak(pdev, 0x5 << MAX_READ_REQUEST_SHIFT);
++
++ RTL_W8(MaxTxPacketSize, TxPacketMax);
++
++ for (i = 0; i < ARRAY_SIZE(e_info_8168d_4); i++) {
++ const struct ephy_info *e = e_info_8168d_4 + i;
++ u16 w;
++
++ w = rtl_ephy_read(ioaddr, e->offset);
++ rtl_ephy_write(ioaddr, 0x03, (w & e->mask) | e->bits);
++ }
++
++ rtl_enable_clock_request(pdev);
++}
++
+ static void rtl_hw_start_8168(struct net_device *dev)
+ {
+ struct rtl8169_private *tp = netdev_priv(dev);
+@@ -3590,6 +3712,10 @@ static void rtl_hw_start_8168(struct net_device *dev)
+ rtl_hw_start_8168d(ioaddr, pdev);
+ break;
+
++ case RTL_GIGA_MAC_VER_28:
++ rtl_hw_start_8168d_4(ioaddr, pdev);
++ break;
++
+ default:
+ printk(KERN_ERR PFX "%s: unknown chipset (mac_version = %d).\n",
+ dev->name, tp->mac_version);
+@@ -4002,7 +4128,7 @@ static void rtl8169_tx_timeout(struct net_device *dev)
+ {
+ struct rtl8169_private *tp = netdev_priv(dev);
+
+- rtl8169_hw_reset(tp->mmio_addr);
++ rtl8169_hw_reset(tp);
+
+ /* Let's wait a bit while any (async) irq lands on */
+ rtl8169_schedule_work(dev, rtl8169_reset_task);
+@@ -4160,7 +4286,6 @@ static void rtl8169_pcierr_interrupt(struct net_device *dev)
+ {
+ struct rtl8169_private *tp = netdev_priv(dev);
+ struct pci_dev *pdev = tp->pci_dev;
+- void __iomem *ioaddr = tp->mmio_addr;
+ u16 pci_status, pci_cmd;
+
+ pci_read_config_word(pdev, PCI_COMMAND, &pci_cmd);
+@@ -4191,13 +4316,15 @@ static void rtl8169_pcierr_interrupt(struct net_device *dev)
+
+ /* The infamous DAC f*ckup only happens at boot time */
+ if ((tp->cp_cmd & PCIDAC) && !tp->dirty_rx && !tp->cur_rx) {
++ void __iomem *ioaddr = tp->mmio_addr;
++
+ netif_info(tp, intr, dev, "disabling PCI DAC\n");
+ tp->cp_cmd &= ~PCIDAC;
+ RTL_W16(CPlusCmd, tp->cp_cmd);
+ dev->features &= ~NETIF_F_HIGHDMA;
+ }
+
+- rtl8169_hw_reset(ioaddr);
++ rtl8169_hw_reset(tp);
+
+ rtl8169_schedule_work(dev, rtl8169_reinit_task);
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0039-r8169-delay-phy-init-until-device-opens.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0039-r8169-delay-phy-init-until-device-opens.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,71 @@
+From: =?UTF-8?q?fran=C3=A7ois=20romieu?= <romieu at fr.zoreil.com>
+Date: Sat, 8 Jan 2011 02:17:26 +0000
+Subject: [PATCH 39/47] r8169: delay phy init until device opens.
+
+commit eee3a96c6368f47df8df5bd4ed1843600652b337 upstream.
+
+It workarounds the 60s firmware load failure timeout for the
+non-modular case.
+
+Signed-off-by: Francois Romieu <romieu at fr.zoreil.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/r8169.c | 21 +++++++++++----------
+ 1 files changed, 11 insertions(+), 10 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index 6ab2fbe..99dbe74 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -3075,15 +3075,6 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
+ rtl8168_driver_start(tp);
+ }
+
+- rtl8169_init_phy(dev, tp);
+-
+- /*
+- * Pretend we are using VLANs; This bypasses a nasty bug where
+- * Interrupts stop flowing on high load on 8110SCd controllers.
+- */
+- if (tp->mac_version == RTL_GIGA_MAC_VER_05)
+- RTL_W16(CPlusCmd, RTL_R16(CPlusCmd) | RxVlan);
+-
+ device_set_wakeup_enable(&pdev->dev, tp->features & RTL_FEATURE_WOL);
+
+ if (pci_dev_run_wake(pdev)) {
+@@ -3141,6 +3132,7 @@ static void __devexit rtl8169_remove_one(struct pci_dev *pdev)
+ static int rtl8169_open(struct net_device *dev)
+ {
+ struct rtl8169_private *tp = netdev_priv(dev);
++ void __iomem *ioaddr = tp->mmio_addr;
+ struct pci_dev *pdev = tp->pci_dev;
+ int retval = -ENOMEM;
+
+@@ -3176,6 +3168,15 @@ static int rtl8169_open(struct net_device *dev)
+
+ napi_enable(&tp->napi);
+
++ rtl8169_init_phy(dev, tp);
++
++ /*
++ * Pretend we are using VLANs; This bypasses a nasty bug where
++ * Interrupts stop flowing on high load on 8110SCd controllers.
++ */
++ if (tp->mac_version == RTL_GIGA_MAC_VER_05)
++ RTL_W16(CPlusCmd, RTL_R16(CPlusCmd) | RxVlan);
++
+ rtl_pll_power_up(tp);
+
+ rtl_hw_start(dev);
+@@ -3185,7 +3186,7 @@ static int rtl8169_open(struct net_device *dev)
+ tp->saved_wolopts = 0;
+ pm_runtime_put_noidle(&pdev->dev);
+
+- rtl8169_check_link_status(dev, tp, tp->mmio_addr);
++ rtl8169_check_link_status(dev, tp, ioaddr);
+ out:
+ return retval;
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0040-net-r8169-Update-the-function-of-parsing-firmware.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0040-net-r8169-Update-the-function-of-parsing-firmware.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,171 @@
+From: hayeswang <hayeswang at realtek.com>
+Date: Mon, 10 Jan 2011 02:07:25 +0000
+Subject: [PATCH 40/47] net/r8169: Update the function of parsing firmware
+
+commit 42b82dc19dfdcab931fb67175996a881ce254145 upstream.
+
+Update rtl_phy_write_fw function. The new function could
+parse the complex firmware which is used by RTL8111E and later.
+The new firmware may read data and do some operations, not just
+do writing only.
+
+Signed-off-by: Hayes Wang <hayeswang at realtek.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/r8169.c | 122 ++++++++++++++++++++++++++++++++++++++++++++++-----
+ 1 files changed, 110 insertions(+), 12 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index 99dbe74..3ecccda 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -1633,36 +1633,134 @@ rtl_phy_write_fw(struct rtl8169_private *tp, const struct firmware *fw)
+ {
+ __le32 *phytable = (__le32 *)fw->data;
+ struct net_device *dev = tp->dev;
+- size_t i;
++ size_t index, fw_size = fw->size / sizeof(*phytable);
++ u32 predata, count;
+
+ if (fw->size % sizeof(*phytable)) {
+ netif_err(tp, probe, dev, "odd sized firmware %zd\n", fw->size);
+ return;
+ }
+
+- for (i = 0; i < fw->size / sizeof(*phytable); i++) {
+- u32 action = le32_to_cpu(phytable[i]);
++ for (index = 0; index < fw_size; index++) {
++ u32 action = le32_to_cpu(phytable[index]);
++ u32 regno = (action & 0x0fff0000) >> 16;
+
+- if (!action)
++ switch(action & 0xf0000000) {
++ case PHY_READ:
++ case PHY_DATA_OR:
++ case PHY_DATA_AND:
++ case PHY_READ_EFUSE:
++ case PHY_CLEAR_READCOUNT:
++ case PHY_WRITE:
++ case PHY_WRITE_PREVIOUS:
++ case PHY_DELAY_MS:
+ break;
+
+- if ((action & 0xf0000000) != PHY_WRITE) {
+- netif_err(tp, probe, dev,
+- "unknown action 0x%08x\n", action);
++ case PHY_BJMPN:
++ if (regno > index) {
++ netif_err(tp, probe, tp->dev,
++ "Out of range of firmware\n");
++ return;
++ }
++ break;
++ case PHY_READCOUNT_EQ_SKIP:
++ if (index + 2 >= fw_size) {
++ netif_err(tp, probe, tp->dev,
++ "Out of range of firmware\n");
++ return;
++ }
++ break;
++ case PHY_COMP_EQ_SKIPN:
++ case PHY_COMP_NEQ_SKIPN:
++ case PHY_SKIPN:
++ if (index + 1 + regno >= fw_size) {
++ netif_err(tp, probe, tp->dev,
++ "Out of range of firmware\n");
++ return;
++ }
++ break;
++
++ case PHY_READ_MAC_BYTE:
++ case PHY_WRITE_MAC_BYTE:
++ case PHY_WRITE_ERI_WORD:
++ default:
++ netif_err(tp, probe, tp->dev,
++ "Invalid action 0x%08x\n", action);
+ return;
+ }
+ }
+
+- while (i-- != 0) {
+- u32 action = le32_to_cpu(*phytable);
++ predata = 0;
++ count = 0;
++
++ for (index = 0; index < fw_size; ) {
++ u32 action = le32_to_cpu(phytable[index]);
+ u32 data = action & 0x0000ffff;
+- u32 reg = (action & 0x0fff0000) >> 16;
++ u32 regno = (action & 0x0fff0000) >> 16;
++
++ if (!action)
++ break;
+
+ switch(action & 0xf0000000) {
++ case PHY_READ:
++ predata = rtl_readphy(tp, regno);
++ count++;
++ index++;
++ break;
++ case PHY_DATA_OR:
++ predata |= data;
++ index++;
++ break;
++ case PHY_DATA_AND:
++ predata &= data;
++ index++;
++ break;
++ case PHY_BJMPN:
++ index -= regno;
++ break;
++ case PHY_READ_EFUSE:
++ predata = rtl8168d_efuse_read(tp->mmio_addr, regno);
++ index++;
++ break;
++ case PHY_CLEAR_READCOUNT:
++ count = 0;
++ index++;
++ break;
+ case PHY_WRITE:
+- rtl_writephy(tp, reg, data);
+- phytable++;
++ rtl_writephy(tp, regno, data);
++ index++;
++ break;
++ case PHY_READCOUNT_EQ_SKIP:
++ if (count == data)
++ index += 2;
++ else
++ index += 1;
++ break;
++ case PHY_COMP_EQ_SKIPN:
++ if (predata == data)
++ index += regno;
++ index++;
++ break;
++ case PHY_COMP_NEQ_SKIPN:
++ if (predata != data)
++ index += regno;
++ index++;
++ break;
++ case PHY_WRITE_PREVIOUS:
++ rtl_writephy(tp, regno, predata);
++ index++;
+ break;
++ case PHY_SKIPN:
++ index += regno + 1;
++ break;
++ case PHY_DELAY_MS:
++ mdelay(data);
++ index++;
++ break;
++
++ case PHY_READ_MAC_BYTE:
++ case PHY_WRITE_MAC_BYTE:
++ case PHY_WRITE_ERI_WORD:
+ default:
+ BUG();
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0041-r8169-keep-firmware-in-memory.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0041-r8169-keep-firmware-in-memory.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,130 @@
+From: =?UTF-8?q?fran=C3=A7ois=20romieu?= <romieu at fr.zoreil.com>
+Date: Thu, 13 Jan 2011 13:07:53 +0000
+Subject: [PATCH 41/47] r8169: keep firmware in memory.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+commit f1e02ed109df5f99abf942b8ccc99960cb09dd38 upstream.
+
+The firmware agent is not available during resume. Loading the firmware
+during open() (see eee3a96c6368f47df8df5bd4ed1843600652b337) is not
+enough.
+
+close() is run during resume through rtl8169_reset_task(), whence the
+mildly natural release of firmware in the driver removal method instead.
+
+It will help with http://bugs.debian.org/609538. It will not avoid
+the 60 seconds delay when:
+- there is no firmware
+- the driver is loaded and the device is not up before a suspend/resume
+
+Signed-off-by: Francois Romieu <romieu at fr.zoreil.com>
+Tested-by: Jarek Kamiński <jarek at vilo.eu.org>
+Cc: Hayes <hayeswang at realtek.com>
+Cc: Ben Hutchings <benh at debian.org>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Adjust context for omitted changes]
+---
+ drivers/net/r8169.c | 43 +++++++++++++++++++++++++++++++------------
+ 1 files changed, 31 insertions(+), 12 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index 3ecccda..fcf328b 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -555,6 +555,8 @@ struct rtl8169_private {
+ struct mii_if_info mii;
+ struct rtl8169_counters counters;
+ u32 saved_wolopts;
++
++ const struct firmware *fw;
+ };
+
+ MODULE_AUTHOR("Realtek and the Linux r8169 crew <netdev at vger.kernel.org>");
+@@ -1767,6 +1769,29 @@ rtl_phy_write_fw(struct rtl8169_private *tp, const struct firmware *fw)
+ }
+ }
+
++static void rtl_release_firmware(struct rtl8169_private *tp)
++{
++ release_firmware(tp->fw);
++ tp->fw = NULL;
++}
++
++static int rtl_apply_firmware(struct rtl8169_private *tp, const char *fw_name)
++{
++ const struct firmware **fw = &tp->fw;
++ int rc = !*fw;
++
++ if (rc) {
++ rc = request_firmware(fw, fw_name, &tp->pci_dev->dev);
++ if (rc < 0)
++ goto out;
++ }
++
++ /* TODO: release firmware once rtl_phy_write_fw signals failures. */
++ rtl_phy_write_fw(tp, *fw);
++out:
++ return rc;
++}
++
+ static void rtl8169s_hw_phy_config(struct rtl8169_private *tp)
+ {
+ static const struct phy_reg phy_reg_init[] = {
+@@ -2140,7 +2165,6 @@ static void rtl8168d_1_hw_phy_config(struct rtl8169_private *tp)
+ { 0x0d, 0xf880 }
+ };
+ void __iomem *ioaddr = tp->mmio_addr;
+- const struct firmware *fw;
+
+ rtl_writephy_batch(tp, phy_reg_init_0, ARRAY_SIZE(phy_reg_init_0));
+
+@@ -2204,11 +2228,8 @@ static void rtl8168d_1_hw_phy_config(struct rtl8169_private *tp)
+
+ rtl_writephy(tp, 0x1f, 0x0005);
+ rtl_writephy(tp, 0x05, 0x001b);
+- if (rtl_readphy(tp, 0x06) == 0xbf00 &&
+- request_firmware(&fw, FIRMWARE_8168D_1, &tp->pci_dev->dev) == 0) {
+- rtl_phy_write_fw(tp, fw);
+- release_firmware(fw);
+- } else {
++ if ((rtl_readphy(tp, 0x06) != 0xbf00) ||
++ (rtl_apply_firmware(tp, FIRMWARE_8168D_1) < 0)) {
+ netif_warn(tp, probe, tp->dev, "unable to apply firmware patch\n");
+ }
+
+@@ -2258,7 +2279,6 @@ static void rtl8168d_2_hw_phy_config(struct rtl8169_private *tp)
+ { 0x0d, 0xf880 }
+ };
+ void __iomem *ioaddr = tp->mmio_addr;
+- const struct firmware *fw;
+
+ rtl_writephy_batch(tp, phy_reg_init_0, ARRAY_SIZE(phy_reg_init_0));
+
+@@ -2313,11 +2333,8 @@ static void rtl8168d_2_hw_phy_config(struct rtl8169_private *tp)
+
+ rtl_writephy(tp, 0x1f, 0x0005);
+ rtl_writephy(tp, 0x05, 0x001b);
+- if (rtl_readphy(tp, 0x06) == 0xb300 &&
+- request_firmware(&fw, FIRMWARE_8168D_2, &tp->pci_dev->dev) == 0) {
+- rtl_phy_write_fw(tp, fw);
+- release_firmware(fw);
+- } else {
++ if ((rtl_readphy(tp, 0x06) != 0xb300) ||
++ (rtl_apply_firmware(tp, FIRMWARE_8168D_2) < 0)) {
+ netif_warn(tp, probe, tp->dev, "unable to apply firmware patch\n");
+ }
+
+@@ -3211,6 +3228,8 @@ static void __devexit rtl8169_remove_one(struct pci_dev *pdev)
+
+ flush_scheduled_work();
+
++ rtl_release_firmware(tp);
++
+ unregister_netdev(dev);
+
+ if (pci_dev_run_wake(pdev)) {
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0042-r8169-RxFIFO-overflow-oddities-with-8168-chipsets.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0042-r8169-RxFIFO-overflow-oddities-with-8168-chipsets.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,85 @@
+From: Francois Romieu <romieu at fr.zoreil.com>
+Date: Thu, 3 Feb 2011 12:02:36 +0100
+Subject: [PATCH 42/47] r8169: RxFIFO overflow oddities with 8168 chipsets.
+
+commit 1519e57fe81c14bb8fa4855579f19264d1ef63b4 upstream.
+
+Some experiment-based action to prevent my 8168 chipsets locking-up hard
+in the irq handler under load (pktgen ~1Mpps). Apparently a reset is not
+always mandatory (is it at all ?).
+
+- RTL_GIGA_MAC_VER_12
+- RTL_GIGA_MAC_VER_25
+ Missed ~55% packets. Note:
+ - this is an old SiS 965L motherboard
+ - the 8168 chipset emits (lots of) control frames towards the sender
+
+- RTL_GIGA_MAC_VER_26
+ The chipset does not go into a frenzy of mac control pause when it
+ crashes yet but it can still be crashed. It needs more work.
+
+Signed-off-by: Francois Romieu <romieu at fr.zoreil.com>
+Cc: Ivan Vecera <ivecera at redhat.com>
+Cc: Hayes <hayeswang at realtek.com>
+---
+ drivers/net/r8169.c | 30 +++++++++++++++++++++---------
+ 1 files changed, 21 insertions(+), 9 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index fcf328b..3d3779c 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -974,7 +974,8 @@ static void __rtl8169_check_link_status(struct net_device *dev,
+ if (pm)
+ pm_request_resume(&tp->pci_dev->dev);
+ netif_carrier_on(dev);
+- netif_info(tp, ifup, dev, "link up\n");
++ if (net_ratelimit())
++ netif_info(tp, ifup, dev, "link up\n");
+ } else {
+ netif_carrier_off(dev);
+ netif_info(tp, ifdown, dev, "link down\n");
+@@ -4654,13 +4655,24 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance)
+ break;
+ }
+
+- /* Work around for rx fifo overflow */
+- if (unlikely(status & RxFIFOOver) &&
+- (tp->mac_version == RTL_GIGA_MAC_VER_11 ||
+- tp->mac_version == RTL_GIGA_MAC_VER_22)) {
+- netif_stop_queue(dev);
+- rtl8169_tx_timeout(dev);
+- break;
++ if (unlikely(status & RxFIFOOver)) {
++ switch (tp->mac_version) {
++ /* Work around for rx fifo overflow */
++ case RTL_GIGA_MAC_VER_11:
++ case RTL_GIGA_MAC_VER_22:
++ case RTL_GIGA_MAC_VER_26:
++ netif_stop_queue(dev);
++ rtl8169_tx_timeout(dev);
++ goto done;
++ /* Experimental science. Pktgen proof. */
++ case RTL_GIGA_MAC_VER_12:
++ case RTL_GIGA_MAC_VER_25:
++ if (status == RxFIFOOver)
++ goto done;
++ break;
++ default:
++ break;
++ }
+ }
+
+ if (unlikely(status & SYSErr)) {
+@@ -4696,7 +4708,7 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance)
+ (status & RxFIFOOver) ? (status | RxOverflow) : status);
+ status = RTL_R16(IntrStatus);
+ }
+-
++done:
+ return IRQ_RETVAL(handled);
+ }
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0043-r8169-prevent-RxFIFO-induced-loops-in-the-irq-handle.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0043-r8169-prevent-RxFIFO-induced-loops-in-the-irq-handle.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,40 @@
+From: Francois Romieu <romieu at fr.zoreil.com>
+Date: Thu, 3 Feb 2011 17:27:52 +0100
+Subject: [PATCH 43/47] r8169: prevent RxFIFO induced loops in the irq
+ handler.
+
+commit f60ac8e7ab7cbb413a0131d5665b053f9f386526 upstream.
+
+While the RxFIFO interruption is masked for most 8168, nothing prevents
+it to appear in the irq status word. This is no excuse to crash.
+
+Signed-off-by: Francois Romieu <romieu at fr.zoreil.com>
+Cc: Ivan Vecera <ivecera at redhat.com>
+Cc: Hayes <hayeswang at realtek.com>
+---
+ drivers/net/r8169.c | 9 +++++++++
+ 1 files changed, 9 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index 3d3779c..91aa567 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -4664,6 +4664,15 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance)
+ netif_stop_queue(dev);
+ rtl8169_tx_timeout(dev);
+ goto done;
++ /* Testers needed. */
++ case RTL_GIGA_MAC_VER_17:
++ case RTL_GIGA_MAC_VER_19:
++ case RTL_GIGA_MAC_VER_20:
++ case RTL_GIGA_MAC_VER_21:
++ case RTL_GIGA_MAC_VER_23:
++ case RTL_GIGA_MAC_VER_24:
++ case RTL_GIGA_MAC_VER_27:
++ case RTL_GIGA_MAC_VER_28:
+ /* Experimental science. Pktgen proof. */
+ case RTL_GIGA_MAC_VER_12:
+ case RTL_GIGA_MAC_VER_25:
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0044-drivers-net-Call-netif_carrier_off-at-the-end-of-the.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0044-drivers-net-Call-netif_carrier_off-at-the-end-of-the.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,38 @@
+From: Ivan Vecera <ivecera at redhat.com>
+Date: Tue, 15 Feb 2011 02:08:39 +0000
+Subject: [PATCH 44/47] drivers/net: Call netif_carrier_off at the end of the
+ probe
+
+commit 0d672e9f8ac320c6d1ea9103db6df7f99ea20361 upstream.
+
+Without calling of netif_carrier_off at the end of the probe the operstate
+is unknown when the device is initially opened. By default the carrier is
+on so when the device is opened and netif_carrier_on is called the link
+watch event is not fired and operstate remains zero (unknown).
+
+This patch fixes this behavior in forcedeth and r8169.
+
+Signed-off-by: Ivan Vecera <ivecera at redhat.com>
+Acked-by: Francois Romieu <romieu at fr.zoreil.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Restricted to drivers/net/r8169.c; adjusted for omitted changes]
+---
+ drivers/net/r8169.c | 2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index 91aa567..2c39add 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -3199,6 +3199,8 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
+ }
+ pm_runtime_idle(&pdev->dev);
+
++ netif_carrier_off(dev);
++
+ out:
+ return rc;
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0045-r8169-fix-incorrect-args-to-oob-notify.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0045-r8169-fix-incorrect-args-to-oob-notify.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,41 @@
+From: Hayes Wang <hayeswang at realtek.com>
+Date: Tue, 22 Feb 2011 17:26:20 +0800
+Subject: [PATCH 45/47] r8169: fix incorrect args to oob notify.
+
+commit fac5b3caa1f5bc07ecfb4f5ce98f8112638dc8fb upstream.
+
+It results in the wrong point address and influences RTL8168DP.
+
+Signed-off-by: Hayes Wang <hayeswang at realtek.com>
+Acked-by: Francois Romieu <romieu at fr.zoreil.com>
+---
+ drivers/net/r8169.c | 5 +++--
+ 1 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index 2c39add..e2fd60d 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -618,8 +618,9 @@ static void ocp_write(struct rtl8169_private *tp, u8 mask, u16 reg, u32 data)
+ }
+ }
+
+-static void rtl8168_oob_notify(void __iomem *ioaddr, u8 cmd)
++static void rtl8168_oob_notify(struct rtl8169_private *tp, u8 cmd)
+ {
++ void __iomem *ioaddr = tp->mmio_addr;
+ int i;
+
+ RTL_W8(ERIDR, cmd);
+@@ -631,7 +632,7 @@ static void rtl8168_oob_notify(void __iomem *ioaddr, u8 cmd)
+ break;
+ }
+
+- ocp_write(ioaddr, 0x1, 0x30, 0x00000001);
++ ocp_write(tp, 0x1, 0x30, 0x00000001);
+ }
+
+ #define OOB_CMD_RESET 0x00
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0046-r8169-correct-settings-of-rtl8102e.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0046-r8169-correct-settings-of-rtl8102e.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,99 @@
+From: Hayes Wang <hayeswang at realtek.com>
+Date: Tue, 22 Feb 2011 17:26:19 +0800
+Subject: [PATCH 46/47] r8169: correct settings of rtl8102e.
+
+commit d24e9aafe5d5dfdf6d114b29e67f8afd5fae5ef0 upstream.
+
+Adjust and remove certain settings of RTL8102E which are for previous chips.
+
+Signed-off-by: Hayes Wang <hayeswang at realtek.com>
+Acked-off-by: Francois Romieu <romieu at fr.zoreil.com>
+---
+ drivers/net/r8169.c | 20 ++++++--------------
+ 1 files changed, 6 insertions(+), 14 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index e2fd60d..377b60d 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -3049,7 +3049,7 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
+ goto err_out_mwi_2;
+ }
+
+- tp->cp_cmd = PCIMulRW | RxChkSum;
++ tp->cp_cmd = RxChkSum;
+
+ if ((sizeof(dma_addr_t) > 4) &&
+ !pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) && use_dac) {
+@@ -3862,8 +3862,7 @@ static void rtl_hw_start_8168(struct net_device *dev)
+ Cxpl_dbg_sel | \
+ ASF | \
+ PktCntrDisable | \
+- PCIDAC | \
+- PCIMulRW)
++ Mac_dbgo_sel)
+
+ static void rtl_hw_start_8102e_1(void __iomem *ioaddr, struct pci_dev *pdev)
+ {
+@@ -3893,8 +3892,6 @@ static void rtl_hw_start_8102e_1(void __iomem *ioaddr, struct pci_dev *pdev)
+ if ((cfg1 & LEDS0) && (cfg1 & LEDS1))
+ RTL_W8(Config1, cfg1 & ~LEDS0);
+
+- RTL_W16(CPlusCmd, RTL_R16(CPlusCmd) & ~R810X_CPCMD_QUIRK_MASK);
+-
+ rtl_ephy_init(ioaddr, e_info_8102e_1, ARRAY_SIZE(e_info_8102e_1));
+ }
+
+@@ -3906,8 +3903,6 @@ static void rtl_hw_start_8102e_2(void __iomem *ioaddr, struct pci_dev *pdev)
+
+ RTL_W8(Config1, MEMMAP | IOMAP | VPD | PMEnable);
+ RTL_W8(Config3, RTL_R8(Config3) & ~Beacon_en);
+-
+- RTL_W16(CPlusCmd, RTL_R16(CPlusCmd) & ~R810X_CPCMD_QUIRK_MASK);
+ }
+
+ static void rtl_hw_start_8102e_3(void __iomem *ioaddr, struct pci_dev *pdev)
+@@ -3933,6 +3928,8 @@ static void rtl_hw_start_8101(struct net_device *dev)
+ }
+ }
+
++ RTL_W8(Cfg9346, Cfg9346_Unlock);
++
+ switch (tp->mac_version) {
+ case RTL_GIGA_MAC_VER_07:
+ rtl_hw_start_8102e_1(ioaddr, pdev);
+@@ -3947,14 +3944,13 @@ static void rtl_hw_start_8101(struct net_device *dev)
+ break;
+ }
+
+- RTL_W8(Cfg9346, Cfg9346_Unlock);
++ RTL_W8(Cfg9346, Cfg9346_Lock);
+
+ RTL_W8(MaxTxPacketSize, TxPacketMax);
+
+ rtl_set_rx_max_size(ioaddr, rx_buf_sz);
+
+- tp->cp_cmd |= rtl_rw_cpluscmd(ioaddr) | PCIMulRW;
+-
++ tp->cp_cmd &= ~R810X_CPCMD_QUIRK_MASK;
+ RTL_W16(CPlusCmd, tp->cp_cmd);
+
+ RTL_W16(IntrMitigate, 0x0000);
+@@ -3964,14 +3960,10 @@ static void rtl_hw_start_8101(struct net_device *dev)
+ RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb);
+ rtl_set_rx_tx_config_registers(tp);
+
+- RTL_W8(Cfg9346, Cfg9346_Lock);
+-
+ RTL_R8(IntrMask);
+
+ rtl_set_rx_mode(dev);
+
+- RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb);
+-
+ RTL_W16(MultiIntr, RTL_R16(MultiIntr) & 0xf000);
+
+ RTL_W16(IntrMask, tp->intr_event);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0047-r8169-fix-RTL8168DP-power-off-issue.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/r8169/0047-r8169-fix-RTL8168DP-power-off-issue.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,73 @@
+From: Hayes Wang <hayeswang at realtek.com>
+Date: Tue, 22 Feb 2011 17:26:22 +0800
+Subject: [PATCH 47/47] r8169: fix RTL8168DP power off issue.
+
+commit 5d2e19572a66be1e349faba289b7bd049b85bc98 upstream.
+
+- fix the RTL8111DP turn off the power when DASH is enabled.
+- RTL_GIGA_MAC_VER_27 must wait for tx finish before reset.
+
+Signed-off-by: Hayes Wang <hayeswang at realtek.com>
+Acked-by: Francois Romieu <romieu at fr.zoreil.com>
+---
+ drivers/net/r8169.c | 17 ++++++++++++++---
+ 1 files changed, 14 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index 377b60d..ebc696d 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -2870,8 +2870,11 @@ static void r8168_pll_power_down(struct rtl8169_private *tp)
+ {
+ void __iomem *ioaddr = tp->mmio_addr;
+
+- if (tp->mac_version == RTL_GIGA_MAC_VER_27)
++ if (((tp->mac_version == RTL_GIGA_MAC_VER_27) ||
++ (tp->mac_version == RTL_GIGA_MAC_VER_28)) &&
++ (ocp_read(tp, 0x0f, 0x0010) & 0x00008000)) {
+ return;
++ }
+
+ if (((tp->mac_version == RTL_GIGA_MAC_VER_23) ||
+ (tp->mac_version == RTL_GIGA_MAC_VER_24)) &&
+@@ -2893,6 +2896,8 @@ static void r8168_pll_power_down(struct rtl8169_private *tp)
+ switch (tp->mac_version) {
+ case RTL_GIGA_MAC_VER_25:
+ case RTL_GIGA_MAC_VER_26:
++ case RTL_GIGA_MAC_VER_27:
++ case RTL_GIGA_MAC_VER_28:
+ RTL_W8(PMCH, RTL_R8(PMCH) & ~0x80);
+ break;
+ }
+@@ -2902,12 +2907,17 @@ static void r8168_pll_power_up(struct rtl8169_private *tp)
+ {
+ void __iomem *ioaddr = tp->mmio_addr;
+
+- if (tp->mac_version == RTL_GIGA_MAC_VER_27)
++ if (((tp->mac_version == RTL_GIGA_MAC_VER_27) ||
++ (tp->mac_version == RTL_GIGA_MAC_VER_28)) &&
++ (ocp_read(tp, 0x0f, 0x0010) & 0x00008000)) {
+ return;
++ }
+
+ switch (tp->mac_version) {
+ case RTL_GIGA_MAC_VER_25:
+ case RTL_GIGA_MAC_VER_26:
++ case RTL_GIGA_MAC_VER_27:
++ case RTL_GIGA_MAC_VER_28:
+ RTL_W8(PMCH, RTL_R8(PMCH) | 0x80);
+ break;
+ }
+@@ -3333,7 +3343,8 @@ static void rtl8169_hw_reset(struct rtl8169_private *tp)
+ /* Disable interrupts */
+ rtl8169_irq_mask_and_ack(ioaddr);
+
+- if (tp->mac_version == RTL_GIGA_MAC_VER_28) {
++ if (tp->mac_version == RTL_GIGA_MAC_VER_27 ||
++ tp->mac_version == RTL_GIGA_MAC_VER_28) {
+ while (RTL_R8(TxPoll) & NPQ)
+ udelay(20);
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0001-Revert-tg3-Fix-5906-transmit-hangs.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0001-Revert-tg3-Fix-5906-transmit-hangs.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,96 @@
+From: Ben Hutchings <ben at decadent.org.uk>
+Date: Sat, 21 May 2011 17:30:50 +0100
+Subject: [PATCH 001/207] Revert "tg3: Fix 5906 transmit hangs"
+
+This reverts commit 9d3ba2e2f7634d85cd891cdf3463723fa7651951, a
+backport of commit 92c6b8d16a36df3f28b2537bed2a56491fb08f11, in
+preparation to apply the upstream version.
+---
+ drivers/net/tg3.c | 21 +++++----------------
+ drivers/net/tg3.h | 3 ---
+ 2 files changed, 5 insertions(+), 19 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index fd6622c..cab401d 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -5392,7 +5392,7 @@ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb,
+ mss = 0;
+ if ((mss = skb_shinfo(skb)->gso_size) != 0) {
+ struct iphdr *iph;
+- u32 tcp_opt_len, ip_tcp_len, hdr_len;
++ int tcp_opt_len, ip_tcp_len, hdr_len;
+
+ if (skb_header_cloned(skb) &&
+ pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) {
+@@ -5423,10 +5423,8 @@ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb,
+ IPPROTO_TCP,
+ 0);
+
+- if (tp->tg3_flags2 & TG3_FLG2_HW_TSO_2)
+- mss |= hdr_len << 9;
+- else if ((tp->tg3_flags2 & TG3_FLG2_HW_TSO_1) ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705) {
++ if ((tp->tg3_flags2 & TG3_FLG2_HW_TSO) ||
++ (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705)) {
+ if (tcp_opt_len || iph->ihl > 5) {
+ int tsflags;
+
+@@ -5461,9 +5459,6 @@ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb,
+
+ would_hit_hwbug = 0;
+
+- if ((tp->tg3_flags3 & TG3_FLG3_SHORT_DMA_BUG) && len <= 8)
+- would_hit_hwbug = 1;
+-
+ if (tp->tg3_flags3 & TG3_FLG3_5701_DMA_BUG)
+ would_hit_hwbug = 1;
+ else if (tg3_4g_overflow_test(mapping, len))
+@@ -5487,10 +5482,6 @@ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb,
+
+ tnapi->tx_buffers[entry].skb = NULL;
+
+- if ((tp->tg3_flags3 & TG3_FLG3_SHORT_DMA_BUG) &&
+- len <= 8)
+- would_hit_hwbug = 1;
+-
+ if (tg3_4g_overflow_test(mapping, len))
+ would_hit_hwbug = 1;
+
+@@ -12618,9 +12609,6 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ }
+ }
+
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
+- tp->tg3_flags3 |= TG3_FLG3_SHORT_DMA_BUG;
+-
+ tp->irq_max = 1;
+
+ #ifdef TG3_NAPI
+@@ -13988,7 +13976,8 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
+ goto err_out_iounmap;
+ }
+
+- if (tp->tg3_flags3 & TG3_FLG3_5755_PLUS)
++ if ((tp->tg3_flags3 & TG3_FLG3_5755_PLUS) ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
+ dev->netdev_ops = &tg3_netdev_ops;
+ else
+ dev->netdev_ops = &tg3_netdev_ops_dma_bug;
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 529f55a..bab7940 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -2759,9 +2759,6 @@ struct tg3 {
+ #define TG3_FLG3_TOGGLE_10_100_L1PLLPD 0x00008000
+ #define TG3_FLG3_PHY_IS_FET 0x00010000
+ #define TG3_FLG3_ENABLE_RSS 0x00020000
+-#define TG3_FLG3_4G_DMA_BNDRY_BUG 0x00080000
+-#define TG3_FLG3_40BIT_DMA_LIMIT_BUG 0x00100000
+-#define TG3_FLG3_SHORT_DMA_BUG 0x00200000
+
+ struct timer_list timer;
+ u16 timer_counter;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0002-tg3-Assign-flags-to-fixes-in-start_xmit_dma_bug.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0002-tg3-Assign-flags-to-fixes-in-start_xmit_dma_bug.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,98 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 2 Nov 2009 12:33:33 +0000
+Subject: [PATCH 002/207] tg3: Assign flags to fixes in start_xmit_dma_bug
+
+commit 0e1406dd404ce55dbe8d68b4b5e2aed7e5c75fdb upstream.
+
+This patch adds a flag for each bug workaround in
+tg3_start_xmit_dma_bug(). This is prep work for the following patch.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 26 +++++++++++++++++++-------
+ drivers/net/tg3.h | 2 ++
+ 2 files changed, 21 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index cab401d..a23a64c 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -5124,7 +5124,8 @@ static int tigon3_dma_hwbug_workaround(struct tg3 *tp, struct sk_buff *skb,
+ /* Make sure new skb does not cross any 4G boundaries.
+ * Drop the packet if it does.
+ */
+- if (ret || tg3_4g_overflow_test(new_addr, new_skb->len)) {
++ if (ret || ((tp->tg3_flags3 & TG3_FLG3_4G_DMA_BNDRY_BUG) &&
++ tg3_4g_overflow_test(new_addr, new_skb->len))) {
+ if (!ret)
+ skb_dma_unmap(&tp->pdev->dev, new_skb,
+ DMA_TO_DEVICE);
+@@ -5459,9 +5460,15 @@ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb,
+
+ would_hit_hwbug = 0;
+
+- if (tp->tg3_flags3 & TG3_FLG3_5701_DMA_BUG)
++ if ((tp->tg3_flags3 & TG3_FLG3_4G_DMA_BNDRY_BUG) &&
++ tg3_4g_overflow_test(mapping, len))
++ would_hit_hwbug = 1;
++
++ if ((tp->tg3_flags3 & TG3_FLG3_40BIT_DMA_LIMIT_BUG) &&
++ tg3_40bit_overflow_test(tp, mapping, len))
+ would_hit_hwbug = 1;
+- else if (tg3_4g_overflow_test(mapping, len))
++
++ if (tp->tg3_flags3 & TG3_FLG3_5701_DMA_BUG)
+ would_hit_hwbug = 1;
+
+ tg3_set_txd(tnapi, entry, mapping, len, base_flags,
+@@ -5482,10 +5489,12 @@ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb,
+
+ tnapi->tx_buffers[entry].skb = NULL;
+
+- if (tg3_4g_overflow_test(mapping, len))
++ if ((tp->tg3_flags3 & TG3_FLG3_4G_DMA_BNDRY_BUG) &&
++ tg3_4g_overflow_test(mapping, len))
+ would_hit_hwbug = 1;
+
+- if (tg3_40bit_overflow_test(tp, mapping, len))
++ if ((tp->tg3_flags3 & TG3_FLG3_40BIT_DMA_LIMIT_BUG) &&
++ tg3_40bit_overflow_test(tp, mapping, len))
+ would_hit_hwbug = 1;
+
+ if (tp->tg3_flags2 & TG3_FLG2_HW_TSO)
+@@ -12611,12 +12620,15 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+
+ tp->irq_max = 1;
+
+-#ifdef TG3_NAPI
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) {
+ tp->tg3_flags |= TG3_FLAG_SUPPORT_MSIX;
+ tp->irq_max = TG3_IRQ_MAX_VECS;
+ }
+-#endif
++
++ if (!(tp->tg3_flags3 & TG3_FLG3_5755_PLUS)) {
++ tp->tg3_flags3 |= TG3_FLG3_4G_DMA_BNDRY_BUG;
++ tp->tg3_flags3 |= TG3_FLG3_40BIT_DMA_LIMIT_BUG;
++ }
+
+ if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS) ||
+ (tp->tg3_flags2 & TG3_FLG2_5780_CLASS) ||
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index bab7940..b603810 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -2759,6 +2759,8 @@ struct tg3 {
+ #define TG3_FLG3_TOGGLE_10_100_L1PLLPD 0x00008000
+ #define TG3_FLG3_PHY_IS_FET 0x00010000
+ #define TG3_FLG3_ENABLE_RSS 0x00020000
++#define TG3_FLG3_4G_DMA_BNDRY_BUG 0x00080000
++#define TG3_FLG3_40BIT_DMA_LIMIT_BUG 0x00100000
+
+ struct timer_list timer;
+ u16 timer_counter;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0003-tg3-Fix-5906-transmit-hangs.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0003-tg3-Fix-5906-transmit-hangs.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,106 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 2 Nov 2009 14:23:27 +0000
+Subject: [PATCH 003/207] tg3: Fix 5906 transmit hangs
+
+commit 92c6b8d16a36df3f28b2537bed2a56491fb08f11 upstream.
+
+The 5906 has trouble with fragments that are less than 8 bytes in size.
+This patch works around the problem by pivoting the 5906's transmit
+routine to tg3_start_xmit_dma_bug() and introducing a new SHORT_DMA_BUG
+flag that enables code to detect and react to the problematic condition.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 26 +++++++++++++++++++-------
+ drivers/net/tg3.h | 1 +
+ 2 files changed, 20 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index a23a64c..77def3a 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -5393,7 +5393,7 @@ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb,
+ mss = 0;
+ if ((mss = skb_shinfo(skb)->gso_size) != 0) {
+ struct iphdr *iph;
+- int tcp_opt_len, ip_tcp_len, hdr_len;
++ u32 tcp_opt_len, ip_tcp_len, hdr_len;
+
+ if (skb_header_cloned(skb) &&
+ pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) {
+@@ -5424,8 +5424,10 @@ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb,
+ IPPROTO_TCP,
+ 0);
+
+- if ((tp->tg3_flags2 & TG3_FLG2_HW_TSO) ||
+- (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705)) {
++ if (tp->tg3_flags2 & TG3_FLG2_HW_TSO_2)
++ mss |= hdr_len << 9;
++ else if ((tp->tg3_flags2 & TG3_FLG2_HW_TSO_1) ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705) {
+ if (tcp_opt_len || iph->ihl > 5) {
+ int tsflags;
+
+@@ -5460,6 +5462,9 @@ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb,
+
+ would_hit_hwbug = 0;
+
++ if ((tp->tg3_flags3 & TG3_FLG3_SHORT_DMA_BUG) && len <= 8)
++ would_hit_hwbug = 1;
++
+ if ((tp->tg3_flags3 & TG3_FLG3_4G_DMA_BNDRY_BUG) &&
+ tg3_4g_overflow_test(mapping, len))
+ would_hit_hwbug = 1;
+@@ -5489,6 +5494,10 @@ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb,
+
+ tnapi->tx_buffers[entry].skb = NULL;
+
++ if ((tp->tg3_flags3 & TG3_FLG3_SHORT_DMA_BUG) &&
++ len <= 8)
++ would_hit_hwbug = 1;
++
+ if ((tp->tg3_flags3 & TG3_FLG3_4G_DMA_BNDRY_BUG) &&
+ tg3_4g_overflow_test(mapping, len))
+ would_hit_hwbug = 1;
+@@ -12626,8 +12635,12 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ }
+
+ if (!(tp->tg3_flags3 & TG3_FLG3_5755_PLUS)) {
+- tp->tg3_flags3 |= TG3_FLG3_4G_DMA_BNDRY_BUG;
+- tp->tg3_flags3 |= TG3_FLG3_40BIT_DMA_LIMIT_BUG;
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
++ tp->tg3_flags3 |= TG3_FLG3_SHORT_DMA_BUG;
++ else {
++ tp->tg3_flags3 |= TG3_FLG3_4G_DMA_BNDRY_BUG;
++ tp->tg3_flags3 |= TG3_FLG3_40BIT_DMA_LIMIT_BUG;
++ }
+ }
+
+ if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS) ||
+@@ -13988,8 +14001,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
+ goto err_out_iounmap;
+ }
+
+- if ((tp->tg3_flags3 & TG3_FLG3_5755_PLUS) ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
++ if (tp->tg3_flags3 & TG3_FLG3_5755_PLUS)
+ dev->netdev_ops = &tg3_netdev_ops;
+ else
+ dev->netdev_ops = &tg3_netdev_ops_dma_bug;
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index b603810..a5568a1 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -2761,6 +2761,7 @@ struct tg3 {
+ #define TG3_FLG3_ENABLE_RSS 0x00020000
+ #define TG3_FLG3_4G_DMA_BNDRY_BUG 0x00080000
+ #define TG3_FLG3_40BIT_DMA_LIMIT_BUG 0x00100000
++#define TG3_FLG3_SHORT_DMA_BUG 0x00200000
+
+ struct timer_list timer;
+ u16 timer_counter;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0004-tg3-Fix-disappearing-57780-devices.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0004-tg3-Fix-disappearing-57780-devices.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,83 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 2 Nov 2009 14:24:02 +0000
+Subject: [PATCH 004/207] tg3: Fix disappearing 57780 devices
+
+commit f40386c8452f9eead9c5906bfffaaf59f3dc748f upstream.
+
+Under certain power saving conditions, 57780 asic rev devices might
+disappear from the system. The fix is to disallow the PCIe PLL from
+powering down.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 24 ++----------------------
+ drivers/net/tg3.h | 1 -
+ 2 files changed, 2 insertions(+), 23 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 77def3a..25bfe66 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -3243,15 +3243,6 @@ relink:
+ pci_write_config_word(tp->pdev,
+ tp->pcie_cap + PCI_EXP_LNKCTL,
+ newlnkctl);
+- } else if (tp->tg3_flags3 & TG3_FLG3_TOGGLE_10_100_L1PLLPD) {
+- u32 newreg, oldreg = tr32(TG3_PCIE_LNKCTL);
+- if (tp->link_config.active_speed == SPEED_100 ||
+- tp->link_config.active_speed == SPEED_10)
+- newreg = oldreg & ~TG3_PCIE_LNKCTL_L1_PLL_PD_EN;
+- else
+- newreg = oldreg | TG3_PCIE_LNKCTL_L1_PLL_PD_EN;
+- if (newreg != oldreg)
+- tw32(TG3_PCIE_LNKCTL, newreg);
+ }
+
+ if (current_link_up != netif_carrier_ok(tp->dev)) {
+@@ -7180,15 +7171,9 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ tw32(TG3_PCIE_EIDLE_DELAY, val | TG3_PCIE_EIDLE_DELAY_13_CLKS);
+
+ tw32(TG3_CORR_ERR_STAT, TG3_CORR_ERR_STAT_CLEAR);
+- }
+
+- if (tp->tg3_flags3 & TG3_FLG3_TOGGLE_10_100_L1PLLPD) {
+- val = tr32(TG3_PCIE_LNKCTL);
+- if (tp->tg3_flags3 & TG3_FLG3_CLKREQ_BUG)
+- val |= TG3_PCIE_LNKCTL_L1_PLL_PD_DIS;
+- else
+- val &= ~TG3_PCIE_LNKCTL_L1_PLL_PD_DIS;
+- tw32(TG3_PCIE_LNKCTL, val);
++ val = tr32(TG3_PCIE_LNKCTL) & ~TG3_PCIE_LNKCTL_L1_PLL_PD_EN;
++ tw32(TG3_PCIE_LNKCTL, val | TG3_PCIE_LNKCTL_L1_PLL_PD_DIS);
+ }
+
+ /* This works around an issue with Athlon chipsets on
+@@ -12952,11 +12937,6 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780)
+ tp->tg3_flags3 |= TG3_FLG3_USE_PHYLIB;
+
+- if ((tp->pci_chip_rev_id == CHIPREV_ID_57780_A1 &&
+- tr32(RCVLPC_STATS_ENABLE) & RCVLPC_STATSENAB_ASF_FIX) ||
+- tp->pci_chip_rev_id == CHIPREV_ID_57780_A0)
+- tp->tg3_flags3 |= TG3_FLG3_TOGGLE_10_100_L1PLLPD;
+-
+ err = tg3_mdio_init(tp);
+ if (err)
+ return err;
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index a5568a1..eb4ed82 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -2756,7 +2756,6 @@ struct tg3 {
+ #define TG3_FLG3_PHY_ENABLE_APD 0x00001000
+ #define TG3_FLG3_5755_PLUS 0x00002000
+ #define TG3_FLG3_NO_NVRAM 0x00004000
+-#define TG3_FLG3_TOGGLE_10_100_L1PLLPD 0x00008000
+ #define TG3_FLG3_PHY_IS_FET 0x00010000
+ #define TG3_FLG3_ENABLE_RSS 0x00020000
+ #define TG3_FLG3_4G_DMA_BNDRY_BUG 0x00080000
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0005-tg3-Convert-PHY_ADDR-TG3_PHY_MII_ADDR.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0005-tg3-Convert-PHY_ADDR-TG3_PHY_MII_ADDR.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,221 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 2 Nov 2009 14:24:36 +0000
+Subject: [PATCH 005/207] tg3: Convert PHY_ADDR => TG3_PHY_MII_ADDR
+
+commit 3f0e3ad72393db9c2932a2ca86cc1a49294bbc63 upstream.
+
+This patch renames the PHY_ADDR preprocessor definition. The following
+patch will identify a new member on the MDIO bus, so we want this
+preprocessor definition to be a little more descriptive.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 51 +++++++++++++++++++++++++++++----------------------
+ drivers/net/tg3.h | 2 +-
+ 2 files changed, 30 insertions(+), 23 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 25bfe66..2bffac2 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -937,7 +937,7 @@ static void tg3_mdio_config_5785(struct tg3 *tp)
+ u32 val;
+ struct phy_device *phydev;
+
+- phydev = tp->mdio_bus->phy_map[PHY_ADDR];
++ phydev = tp->mdio_bus->phy_map[TG3_PHY_MII_ADDR];
+ switch (phydev->drv->phy_id & phydev->drv->phy_id_mask) {
+ case TG3_PHY_ID_BCM50610:
+ val = MAC_PHYCFG2_50610_LED_MODES;
+@@ -1031,7 +1031,7 @@ static void tg3_mdio_start(struct tg3 *tp)
+ if (is_serdes)
+ tp->phy_addr += 7;
+ } else
+- tp->phy_addr = PHY_ADDR;
++ tp->phy_addr = TG3_PHY_MII_ADDR;
+
+ if ((tp->tg3_flags3 & TG3_FLG3_MDIOBUS_INITED) &&
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785)
+@@ -1062,7 +1062,7 @@ static int tg3_mdio_init(struct tg3 *tp)
+ tp->mdio_bus->read = &tg3_mdio_read;
+ tp->mdio_bus->write = &tg3_mdio_write;
+ tp->mdio_bus->reset = &tg3_mdio_reset;
+- tp->mdio_bus->phy_mask = ~(1 << PHY_ADDR);
++ tp->mdio_bus->phy_mask = ~(1 << TG3_PHY_MII_ADDR);
+ tp->mdio_bus->irq = &tp->mdio_irq[0];
+
+ for (i = 0; i < PHY_MAX_ADDR; i++)
+@@ -1084,7 +1084,7 @@ static int tg3_mdio_init(struct tg3 *tp)
+ return i;
+ }
+
+- phydev = tp->mdio_bus->phy_map[PHY_ADDR];
++ phydev = tp->mdio_bus->phy_map[TG3_PHY_MII_ADDR];
+
+ if (!phydev || !phydev->drv) {
+ printk(KERN_WARNING "%s: No PHY devices\n", tp->dev->name);
+@@ -1311,7 +1311,7 @@ static void tg3_setup_flow_control(struct tg3 *tp, u32 lcladv, u32 rmtadv)
+ u32 old_tx_mode = tp->tx_mode;
+
+ if (tp->tg3_flags3 & TG3_FLG3_USE_PHYLIB)
+- autoneg = tp->mdio_bus->phy_map[PHY_ADDR]->autoneg;
++ autoneg = tp->mdio_bus->phy_map[TG3_PHY_MII_ADDR]->autoneg;
+ else
+ autoneg = tp->link_config.autoneg;
+
+@@ -1348,7 +1348,7 @@ static void tg3_adjust_link(struct net_device *dev)
+ u8 oldflowctrl, linkmesg = 0;
+ u32 mac_mode, lcl_adv, rmt_adv;
+ struct tg3 *tp = netdev_priv(dev);
+- struct phy_device *phydev = tp->mdio_bus->phy_map[PHY_ADDR];
++ struct phy_device *phydev = tp->mdio_bus->phy_map[TG3_PHY_MII_ADDR];
+
+ spin_lock_bh(&tp->lock);
+
+@@ -1434,7 +1434,7 @@ static int tg3_phy_init(struct tg3 *tp)
+ /* Bring the PHY back to a known state. */
+ tg3_bmcr_reset(tp);
+
+- phydev = tp->mdio_bus->phy_map[PHY_ADDR];
++ phydev = tp->mdio_bus->phy_map[TG3_PHY_MII_ADDR];
+
+ /* Attach the MAC to the PHY. */
+ phydev = phy_connect(tp->dev, dev_name(&phydev->dev), tg3_adjust_link,
+@@ -1461,7 +1461,7 @@ static int tg3_phy_init(struct tg3 *tp)
+ SUPPORTED_Asym_Pause);
+ break;
+ default:
+- phy_disconnect(tp->mdio_bus->phy_map[PHY_ADDR]);
++ phy_disconnect(tp->mdio_bus->phy_map[TG3_PHY_MII_ADDR]);
+ return -EINVAL;
+ }
+
+@@ -1479,7 +1479,7 @@ static void tg3_phy_start(struct tg3 *tp)
+ if (!(tp->tg3_flags3 & TG3_FLG3_PHY_CONNECTED))
+ return;
+
+- phydev = tp->mdio_bus->phy_map[PHY_ADDR];
++ phydev = tp->mdio_bus->phy_map[TG3_PHY_MII_ADDR];
+
+ if (tp->link_config.phy_is_low_power) {
+ tp->link_config.phy_is_low_power = 0;
+@@ -1499,13 +1499,13 @@ static void tg3_phy_stop(struct tg3 *tp)
+ if (!(tp->tg3_flags3 & TG3_FLG3_PHY_CONNECTED))
+ return;
+
+- phy_stop(tp->mdio_bus->phy_map[PHY_ADDR]);
++ phy_stop(tp->mdio_bus->phy_map[TG3_PHY_MII_ADDR]);
+ }
+
+ static void tg3_phy_fini(struct tg3 *tp)
+ {
+ if (tp->tg3_flags3 & TG3_FLG3_PHY_CONNECTED) {
+- phy_disconnect(tp->mdio_bus->phy_map[PHY_ADDR]);
++ phy_disconnect(tp->mdio_bus->phy_map[TG3_PHY_MII_ADDR]);
+ tp->tg3_flags3 &= ~TG3_FLG3_PHY_CONNECTED;
+ }
+ }
+@@ -2474,7 +2474,7 @@ static int tg3_set_power_state(struct tg3 *tp, pci_power_t state)
+ struct phy_device *phydev;
+ u32 phyid, advertising;
+
+- phydev = tp->mdio_bus->phy_map[PHY_ADDR];
++ phydev = tp->mdio_bus->phy_map[TG3_PHY_MII_ADDR];
+
+ tp->link_config.phy_is_low_power = 1;
+
+@@ -9244,9 +9244,11 @@ static int tg3_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
+ struct tg3 *tp = netdev_priv(dev);
+
+ if (tp->tg3_flags3 & TG3_FLG3_USE_PHYLIB) {
++ struct phy_device *phydev;
+ if (!(tp->tg3_flags3 & TG3_FLG3_PHY_CONNECTED))
+ return -EAGAIN;
+- return phy_ethtool_gset(tp->mdio_bus->phy_map[PHY_ADDR], cmd);
++ phydev = tp->mdio_bus->phy_map[TG3_PHY_MII_ADDR];
++ return phy_ethtool_gset(phydev, cmd);
+ }
+
+ cmd->supported = (SUPPORTED_Autoneg);
+@@ -9285,9 +9287,11 @@ static int tg3_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
+ struct tg3 *tp = netdev_priv(dev);
+
+ if (tp->tg3_flags3 & TG3_FLG3_USE_PHYLIB) {
++ struct phy_device *phydev;
+ if (!(tp->tg3_flags3 & TG3_FLG3_PHY_CONNECTED))
+ return -EAGAIN;
+- return phy_ethtool_sset(tp->mdio_bus->phy_map[PHY_ADDR], cmd);
++ phydev = tp->mdio_bus->phy_map[TG3_PHY_MII_ADDR];
++ return phy_ethtool_sset(phydev, cmd);
+ }
+
+ if (cmd->autoneg != AUTONEG_ENABLE &&
+@@ -9470,7 +9474,7 @@ static int tg3_nway_reset(struct net_device *dev)
+ if (tp->tg3_flags3 & TG3_FLG3_USE_PHYLIB) {
+ if (!(tp->tg3_flags3 & TG3_FLG3_PHY_CONNECTED))
+ return -EAGAIN;
+- r = phy_start_aneg(tp->mdio_bus->phy_map[PHY_ADDR]);
++ r = phy_start_aneg(tp->mdio_bus->phy_map[TG3_PHY_MII_ADDR]);
+ } else {
+ u32 bmcr;
+
+@@ -9589,7 +9593,7 @@ static int tg3_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam
+ u32 newadv;
+ struct phy_device *phydev;
+
+- phydev = tp->mdio_bus->phy_map[PHY_ADDR];
++ phydev = tp->mdio_bus->phy_map[TG3_PHY_MII_ADDR];
+
+ if (epause->rx_pause) {
+ if (epause->tx_pause)
+@@ -10569,9 +10573,11 @@ static int tg3_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
+ int err;
+
+ if (tp->tg3_flags3 & TG3_FLG3_USE_PHYLIB) {
++ struct phy_device *phydev;
+ if (!(tp->tg3_flags3 & TG3_FLG3_PHY_CONNECTED))
+ return -EAGAIN;
+- return phy_mii_ioctl(tp->mdio_bus->phy_map[PHY_ADDR], data, cmd);
++ phydev = tp->mdio_bus->phy_map[TG3_PHY_MII_ADDR];
++ return phy_mii_ioctl(phydev, data, cmd);
+ }
+
+ switch(cmd) {
+@@ -14136,13 +14142,14 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
+ tg3_bus_string(tp, str),
+ dev->dev_addr);
+
+- if (tp->tg3_flags3 & TG3_FLG3_PHY_CONNECTED)
++ if (tp->tg3_flags3 & TG3_FLG3_PHY_CONNECTED) {
++ struct phy_device *phydev;
++ phydev = tp->mdio_bus->phy_map[TG3_PHY_MII_ADDR];
+ printk(KERN_INFO
+ "%s: attached PHY driver [%s] (mii_bus:phy_addr=%s)\n",
+- tp->dev->name,
+- tp->mdio_bus->phy_map[PHY_ADDR]->drv->name,
+- dev_name(&tp->mdio_bus->phy_map[PHY_ADDR]->dev));
+- else
++ tp->dev->name, phydev->drv->name,
++ dev_name(&phydev->dev));
++ } else
+ printk(KERN_INFO
+ "%s: attached PHY is %s (%s Ethernet) (WireSpeed[%d])\n",
+ tp->dev->name, tg3_phy_string(tp),
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index eb4ed82..40501cb 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -1954,7 +1954,7 @@
+ #define NIC_SRAM_MBUF_POOL_SIZE5705 0x0000e000
+
+ /* Currently this is fixed. */
+-#define PHY_ADDR 0x01
++#define TG3_PHY_MII_ADDR 0x01
+
+ /* Tigon3 specific PHY MII registers. */
+ #define TG3_BMCR_SPEED1000 0x0040
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0006-tg3-Prevent-a-PCIe-tx-glitch.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0006-tg3-Prevent-a-PCIe-tx-glitch.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,95 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 2 Nov 2009 14:25:06 +0000
+Subject: [PATCH 006/207] tg3: Prevent a PCIe tx glitch
+
+commit 52cdf8526fe24f11d300b75458ddee017f3f4c88 upstream.
+
+This patch prevents a PCIe tx glitch by allowing the transmitter to go
+to a low power state.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 24 ++++++++++++++++++++++++
+ drivers/net/tg3.h | 26 +++++++++++++++++++++++++-
+ 2 files changed, 49 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 2bffac2..6119149 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -6589,6 +6589,30 @@ static int tg3_chip_reset(struct tg3 *tp)
+
+ tg3_mdio_start(tp);
+
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780) {
++ u8 phy_addr;
++
++ phy_addr = tp->phy_addr;
++ tp->phy_addr = TG3_PHY_PCIE_ADDR;
++
++ tg3_writephy(tp, TG3_PCIEPHY_BLOCK_ADDR,
++ TG3_PCIEPHY_TXB_BLK << TG3_PCIEPHY_BLOCK_SHIFT);
++ val = TG3_PCIEPHY_TX0CTRL1_TXOCM | TG3_PCIEPHY_TX0CTRL1_RDCTL |
++ TG3_PCIEPHY_TX0CTRL1_TXCMV | TG3_PCIEPHY_TX0CTRL1_TKSEL |
++ TG3_PCIEPHY_TX0CTRL1_NB_EN;
++ tg3_writephy(tp, TG3_PCIEPHY_TX0CTRL1, val);
++ udelay(10);
++
++ tg3_writephy(tp, TG3_PCIEPHY_BLOCK_ADDR,
++ TG3_PCIEPHY_XGXS_BLK1 << TG3_PCIEPHY_BLOCK_SHIFT);
++ val = TG3_PCIEPHY_PWRMGMT4_LOWPWR_EN |
++ TG3_PCIEPHY_PWRMGMT4_L1PLLPD_EN;
++ tg3_writephy(tp, TG3_PCIEPHY_PWRMGMT4, val);
++ udelay(10);
++
++ tp->phy_addr = phy_addr;
++ }
++
+ if ((tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS) &&
+ tp->pci_chip_rev_id != CHIPREV_ID_5750_A0 &&
+ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5785 &&
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 40501cb..530c36b 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -1953,10 +1953,34 @@
+ #define NIC_SRAM_MBUF_POOL_BASE5705 0x00010000
+ #define NIC_SRAM_MBUF_POOL_SIZE5705 0x0000e000
+
++
+ /* Currently this is fixed. */
++#define TG3_PHY_PCIE_ADDR 0x00
+ #define TG3_PHY_MII_ADDR 0x01
+
+-/* Tigon3 specific PHY MII registers. */
++
++/*** Tigon3 specific PHY PCIE registers. ***/
++
++#define TG3_PCIEPHY_BLOCK_ADDR 0x1f
++#define TG3_PCIEPHY_XGXS_BLK1 0x0801
++#define TG3_PCIEPHY_TXB_BLK 0x0861
++#define TG3_PCIEPHY_BLOCK_SHIFT 4
++
++/* TG3_PCIEPHY_TXB_BLK */
++#define TG3_PCIEPHY_TX0CTRL1 0x15
++#define TG3_PCIEPHY_TX0CTRL1_TXOCM 0x0003
++#define TG3_PCIEPHY_TX0CTRL1_RDCTL 0x0008
++#define TG3_PCIEPHY_TX0CTRL1_TXCMV 0x0030
++#define TG3_PCIEPHY_TX0CTRL1_TKSEL 0x0040
++#define TG3_PCIEPHY_TX0CTRL1_NB_EN 0x0400
++
++/* TG3_PCIEPHY_XGXS_BLK1 */
++#define TG3_PCIEPHY_PWRMGMT4 0x1a
++#define TG3_PCIEPHY_PWRMGMT4_L1PLLPD_EN 0x0038
++#define TG3_PCIEPHY_PWRMGMT4_LOWPWR_EN 0x4000
++
++
++/*** Tigon3 specific PHY MII registers. ***/
+ #define TG3_BMCR_SPEED1000 0x0040
+
+ #define MII_TG3_CTRL 0x09 /* 1000-baseT control register */
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0007-tg3-Add-more-PCI-DMA-map-error-checking.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0007-tg3-Add-more-PCI-DMA-map-error-checking.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,67 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 2 Nov 2009 14:25:31 +0000
+Subject: [PATCH 007/207] tg3: Add more PCI DMA map error checking
+
+commit a21771dd189b340328c573da9e005068e8a74c53 upstream.
+
+This patch adds code to check the status of pci_map_single() before
+allowing rx buffers to be used. It also converts the pci_map_single()
+call in tg3_run_loopback() to use skb_dma_map() instead.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: Benjamin Li <benli at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 14 +++++++++++---
+ 1 files changed, 11 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 6119149..31b6602 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -4426,6 +4426,10 @@ static int tg3_alloc_rx_skb(struct tg3_napi *tnapi, u32 opaque_key,
+
+ mapping = pci_map_single(tp->pdev, skb->data, skb_size,
+ PCI_DMA_FROMDEVICE);
++ if (pci_dma_mapping_error(tp->pdev, mapping)) {
++ dev_kfree_skb(skb);
++ return -EIO;
++ }
+
+ map->skb = skb;
+ pci_unmap_addr_set(map, mapping, mapping);
+@@ -10370,7 +10374,10 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode)
+ for (i = 14; i < tx_len; i++)
+ tx_data[i] = (u8) (i & 0xff);
+
+- map = pci_map_single(tp->pdev, skb->data, tx_len, PCI_DMA_TODEVICE);
++ if (skb_dma_map(&tp->pdev->dev, skb, DMA_TO_DEVICE)) {
++ dev_kfree_skb(skb);
++ return -EIO;
++ }
+
+ tw32_f(HOSTCC_MODE, tp->coalesce_mode | HOSTCC_MODE_ENABLE |
+ rnapi->coal_now);
+@@ -10381,7 +10388,8 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode)
+
+ num_pkts = 0;
+
+- tg3_set_txd(tnapi, tnapi->tx_prod, map, tx_len, 0, 1);
++ tg3_set_txd(tnapi, tnapi->tx_prod,
++ skb_shinfo(skb)->dma_head, tx_len, 0, 1);
+
+ tnapi->tx_prod++;
+ num_pkts++;
+@@ -10405,7 +10413,7 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode)
+ break;
+ }
+
+- pci_unmap_single(tp->pdev, map, tx_len, PCI_DMA_TODEVICE);
++ skb_dma_unmap(&tp->pdev->dev, skb, DMA_TO_DEVICE);
+ dev_kfree_skb(skb);
+
+ if (tx_idx != tnapi->tx_prod)
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0008-tg3-Improve-5785-PCIe-performance.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0008-tg3-Improve-5785-PCIe-performance.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,49 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 2 Nov 2009 14:26:03 +0000
+Subject: [PATCH 008/207] tg3: Improve 5785 PCIe performance
+
+commit 788a035e6061a66c6c77059c417fdc6234e140ff upstream.
+
+This patch improves 5785 performance by allowing the write DMA engine to
+request larger DMA burst sizes than it otherwise would.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 3 +++
+ drivers/net/tg3.h | 3 ++-
+ 2 files changed, 5 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 31b6602..4631856 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -7633,6 +7633,9 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ if (tp->tg3_flags3 & TG3_FLG3_5755_PLUS)
+ val |= WDMAC_MODE_STATUS_TAG_FIX;
+
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785)
++ val |= WDMAC_MODE_BURST_ALL_DATA;
++
+ tw32_f(WDMAC_MODE, val);
+ udelay(40);
+
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 530c36b..68431da 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -1264,8 +1264,9 @@
+ #define WDMAC_MODE_FIFOURUN_ENAB 0x00000080
+ #define WDMAC_MODE_FIFOOREAD_ENAB 0x00000100
+ #define WDMAC_MODE_LNGREAD_ENAB 0x00000200
+-#define WDMAC_MODE_RX_ACCEL 0x00000400
++#define WDMAC_MODE_RX_ACCEL 0x00000400
+ #define WDMAC_MODE_STATUS_TAG_FIX 0x20000000
++#define WDMAC_MODE_BURST_ALL_DATA 0xc0000000
+ #define WDMAC_STATUS 0x00004c04
+ #define WDMAC_STATUS_TGTABORT 0x00000004
+ #define WDMAC_STATUS_MSTABORT 0x00000008
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0009-tg3-Add-AC131-power-down-support.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0009-tg3-Add-AC131-power-down-support.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,67 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 2 Nov 2009 14:26:38 +0000
+Subject: [PATCH 009/207] tg3: Add AC131 power down support
+
+commit 0e5f784c77197edf29d2770b518dc78777d5a480 upstream.
+
+The AC131 does not respect the power down bit (bit 11) of the MII
+Control Register (reg 0x0). Instead, software is required to put the
+phy into standby power down mode through the shadow register set. This
+patch implements support for the AC131 standby power down mode.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 20 ++++++++++++++++++++
+ drivers/net/tg3.h | 3 +++
+ 2 files changed, 23 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 4631856..a7cf85b 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -2149,6 +2149,26 @@ static void tg3_power_down_phy(struct tg3 *tp, bool do_low_power)
+ tw32_f(GRC_MISC_CFG, val | GRC_MISC_CFG_EPHY_IDDQ);
+ udelay(40);
+ return;
++ } else if (tp->tg3_flags3 & TG3_FLG3_PHY_IS_FET) {
++ u32 phytest;
++ if (!tg3_readphy(tp, MII_TG3_FET_TEST, &phytest)) {
++ u32 phy;
++
++ tg3_writephy(tp, MII_ADVERTISE, 0);
++ tg3_writephy(tp, MII_BMCR,
++ BMCR_ANENABLE | BMCR_ANRESTART);
++
++ tg3_writephy(tp, MII_TG3_FET_TEST,
++ phytest | MII_TG3_FET_SHADOW_EN);
++ if (!tg3_readphy(tp, MII_TG3_FET_SHDW_AUXMODE4, &phy)) {
++ phy |= MII_TG3_FET_SHDW_AUXMODE4_SBPD;
++ tg3_writephy(tp,
++ MII_TG3_FET_SHDW_AUXMODE4,
++ phy);
++ }
++ tg3_writephy(tp, MII_TG3_FET_TEST, phytest);
++ }
++ return;
+ } else if (do_low_power) {
+ tg3_writephy(tp, MII_TG3_EXT_CTRL,
+ MII_TG3_EXT_CTRL_FORCE_LED_OFF);
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 68431da..9999345 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -2080,6 +2080,9 @@
+ #define MII_TG3_FET_SHDW_MISCCTRL 0x10
+ #define MII_TG3_FET_SHDW_MISCCTRL_MDIX 0x4000
+
++#define MII_TG3_FET_SHDW_AUXMODE4 0x1a
++#define MII_TG3_FET_SHDW_AUXMODE4_SBPD 0x0008
++
+ #define MII_TG3_FET_SHDW_AUXSTAT2 0x1b
+ #define MII_TG3_FET_SHDW_AUXSTAT2_APD 0x0020
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0010-tg3-5785-Set-port-mode-to-MII-when-link-down.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0010-tg3-5785-Set-port-mode-to-MII-when-link-down.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,36 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 2 Nov 2009 14:27:02 +0000
+Subject: [PATCH 010/207] tg3: 5785: Set port mode to MII when link down
+
+commit c3df0748ee43101dfc5c94d1f61ddfca0ff5baa4 upstream.
+
+This patch sets the port mode to MII when the link is down for the 5785.
+Setting the port mode to MII instead of GMII saves power.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 5 ++++-
+ 1 files changed, 4 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index a7cf85b..f503e2b 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -1363,8 +1363,11 @@ static void tg3_adjust_link(struct net_device *dev)
+
+ if (phydev->speed == SPEED_100 || phydev->speed == SPEED_10)
+ mac_mode |= MAC_MODE_PORT_MODE_MII;
+- else
++ else if (phydev->speed == SPEED_1000 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5785)
+ mac_mode |= MAC_MODE_PORT_MODE_GMII;
++ else
++ mac_mode |= MAC_MODE_PORT_MODE_MII;
+
+ if (phydev->duplex == DUPLEX_HALF)
+ mac_mode |= MAC_MODE_HALF_DUPLEX;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0011-tg3-Extend-loopback-test-timeout.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0011-tg3-Extend-loopback-test-timeout.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,35 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 2 Nov 2009 14:27:34 +0000
+Subject: [PATCH 011/207] tg3: Extend loopback test timeout
+
+commit 303fc9218246a748304c005e629d658927cf12d0 upstream.
+
+This patch extends the loopback test timeout from 250 usec to 350 usec.
+When the 5785 is paired against an AC131 phy, the older timeout is
+just a little too close to the expected performance based on timings.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index f503e2b..356d3d7 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -10425,8 +10425,8 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode)
+
+ udelay(10);
+
+- /* 250 usec to allow enough time on some 10/100 Mbps devices. */
+- for (i = 0; i < 25; i++) {
++ /* 350 usec to allow enough time on some 10/100 Mbps devices. */
++ for (i = 0; i < 35; i++) {
+ tw32_f(HOSTCC_MODE, tp->coalesce_mode | HOSTCC_MODE_ENABLE |
+ coal_now);
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0012-broadcom-Isolate-phy-dsp-accesses.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0012-broadcom-Isolate-phy-dsp-accesses.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,159 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 2 Nov 2009 14:28:04 +0000
+Subject: [PATCH 012/207] broadcom: Isolate phy dsp accesses
+
+commit 47b1b53b41d63f27b308981fde307d415e514431 upstream.
+
+This patch consolidates the code that requires the SMDSP clock to be
+enabled into a single function that (hopefully) makes the dependency
+obvious.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/phy/broadcom.c | 90 ++++++++++++++++++++-----------------------
+ 1 files changed, 42 insertions(+), 48 deletions(-)
+
+diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c
+index f46815d..ce904d7 100644
+--- a/drivers/net/phy/broadcom.c
++++ b/drivers/net/phy/broadcom.c
+@@ -237,53 +237,78 @@ static int bcm54xx_auxctl_write(struct phy_device *phydev, u16 regnum, u16 val)
+ return phy_write(phydev, MII_BCM54XX_AUX_CTL, regnum | val);
+ }
+
++/* Needs SMDSP clock enabled via bcm54xx_phydsp_config() */
+ static int bcm50610_a0_workaround(struct phy_device *phydev)
+ {
+ int err;
+
+- err = bcm54xx_auxctl_write(phydev,
+- MII_BCM54XX_AUXCTL_SHDWSEL_AUXCTL,
+- MII_BCM54XX_AUXCTL_ACTL_SMDSP_ENA |
+- MII_BCM54XX_AUXCTL_ACTL_TX_6DB);
+- if (err < 0)
+- return err;
+-
+ err = bcm54xx_exp_write(phydev, MII_BCM54XX_EXP_EXP08,
+ MII_BCM54XX_EXP_EXP08_RJCT_2MHZ |
+ MII_BCM54XX_EXP_EXP08_EARLY_DAC_WAKE);
+ if (err < 0)
+- goto error;
++ return err;
+
+ err = bcm54xx_exp_write(phydev, MII_BCM54XX_EXP_AADJ1CH0,
+ MII_BCM54XX_EXP_AADJ1CH0_SWP_ABCD_OEN |
+ MII_BCM54XX_EXP_AADJ1CH0_SWSEL_THPF);
+ if (err < 0)
+- goto error;
++ return err;
+
+ err = bcm54xx_exp_write(phydev, MII_BCM54XX_EXP_AADJ1CH3,
+ MII_BCM54XX_EXP_AADJ1CH3_ADCCKADJ);
+ if (err < 0)
+- goto error;
++ return err;
+
+ err = bcm54xx_exp_write(phydev, MII_BCM54XX_EXP_EXP75,
+ MII_BCM54XX_EXP_EXP75_VDACCTRL);
+ if (err < 0)
+- goto error;
++ return err;
+
+ err = bcm54xx_exp_write(phydev, MII_BCM54XX_EXP_EXP96,
+ MII_BCM54XX_EXP_EXP96_MYST);
+ if (err < 0)
+- goto error;
++ return err;
+
+ err = bcm54xx_exp_write(phydev, MII_BCM54XX_EXP_EXP97,
+ MII_BCM54XX_EXP_EXP97_MYST);
+
++ return err;
++}
++
++static int bcm54xx_phydsp_config(struct phy_device *phydev)
++{
++ int err, err2;
++
++ /* Enable the SMDSP clock */
++ err = bcm54xx_auxctl_write(phydev,
++ MII_BCM54XX_AUXCTL_SHDWSEL_AUXCTL,
++ MII_BCM54XX_AUXCTL_ACTL_SMDSP_ENA |
++ MII_BCM54XX_AUXCTL_ACTL_TX_6DB);
++ if (err < 0)
++ return err;
++
++ if (phydev->drv->phy_id == PHY_ID_BCM50610)
++ err = bcm50610_a0_workaround(phydev);
++
++ if (BRCM_PHY_MODEL(phydev) == PHY_ID_BCM57780) {
++ int val;
++
++ val = bcm54xx_exp_read(phydev, MII_BCM54XX_EXP_EXP75);
++ if (val < 0)
++ goto error;
++
++ val |= MII_BCM54XX_EXP_EXP75_CM_OSC;
++ err = bcm54xx_exp_write(phydev, MII_BCM54XX_EXP_EXP75, val);
++ }
++
+ error:
+- bcm54xx_auxctl_write(phydev,
+- MII_BCM54XX_AUXCTL_SHDWSEL_AUXCTL,
+- MII_BCM54XX_AUXCTL_ACTL_TX_6DB);
++ /* Disable the SMDSP clock */
++ err2 = bcm54xx_auxctl_write(phydev,
++ MII_BCM54XX_AUXCTL_SHDWSEL_AUXCTL,
++ MII_BCM54XX_AUXCTL_ACTL_TX_6DB);
+
+- return err;
++ /* Return the first error reported. */
++ return err ? err : err2;
+ }
+
+ static int bcm54xx_config_init(struct phy_device *phydev)
+@@ -308,38 +333,7 @@ static int bcm54xx_config_init(struct phy_device *phydev)
+ if (err < 0)
+ return err;
+
+- if (phydev->drv->phy_id == PHY_ID_BCM50610) {
+- err = bcm50610_a0_workaround(phydev);
+- if (err < 0)
+- return err;
+- }
+-
+- if (BRCM_PHY_MODEL(phydev) == PHY_ID_BCM57780) {
+- int err2;
+-
+- err = bcm54xx_auxctl_write(phydev,
+- MII_BCM54XX_AUXCTL_SHDWSEL_AUXCTL,
+- MII_BCM54XX_AUXCTL_ACTL_SMDSP_ENA |
+- MII_BCM54XX_AUXCTL_ACTL_TX_6DB);
+- if (err < 0)
+- return err;
+-
+- reg = bcm54xx_exp_read(phydev, MII_BCM54XX_EXP_EXP75);
+- if (reg < 0)
+- goto error;
+-
+- reg |= MII_BCM54XX_EXP_EXP75_CM_OSC;
+- err = bcm54xx_exp_write(phydev, MII_BCM54XX_EXP_EXP75, reg);
+-
+-error:
+- err2 = bcm54xx_auxctl_write(phydev,
+- MII_BCM54XX_AUXCTL_SHDWSEL_AUXCTL,
+- MII_BCM54XX_AUXCTL_ACTL_TX_6DB);
+- if (err)
+- return err;
+- if (err2)
+- return err2;
+- }
++ bcm54xx_phydsp_config(phydev);
+
+ return 0;
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0013-broadcom-Fix-slow-link-problem.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0013-broadcom-Fix-slow-link-problem.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,59 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 2 Nov 2009 14:28:33 +0000
+Subject: [PATCH 013/207] broadcom: Fix slow link problem
+
+commit 219c6efefaa3f5cd05db52cda50402b2e1c9ae21 upstream.
+
+When a 50610 or 50610M is paired against particular remote partners,
+link is slow to come up. This patch works around the problem.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/phy/broadcom.c | 22 ++++++++++++++--------
+ 1 files changed, 14 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c
+index ce904d7..66e32d2 100644
+--- a/drivers/net/phy/broadcom.c
++++ b/drivers/net/phy/broadcom.c
+@@ -242,12 +242,6 @@ static int bcm50610_a0_workaround(struct phy_device *phydev)
+ {
+ int err;
+
+- err = bcm54xx_exp_write(phydev, MII_BCM54XX_EXP_EXP08,
+- MII_BCM54XX_EXP_EXP08_RJCT_2MHZ |
+- MII_BCM54XX_EXP_EXP08_EARLY_DAC_WAKE);
+- if (err < 0)
+- return err;
+-
+ err = bcm54xx_exp_write(phydev, MII_BCM54XX_EXP_AADJ1CH0,
+ MII_BCM54XX_EXP_AADJ1CH0_SWP_ABCD_OEN |
+ MII_BCM54XX_EXP_AADJ1CH0_SWSEL_THPF);
+@@ -287,8 +281,20 @@ static int bcm54xx_phydsp_config(struct phy_device *phydev)
+ if (err < 0)
+ return err;
+
+- if (phydev->drv->phy_id == PHY_ID_BCM50610)
+- err = bcm50610_a0_workaround(phydev);
++ if (BRCM_PHY_MODEL(phydev) == PHY_ID_BCM50610 ||
++ BRCM_PHY_MODEL(phydev) == PHY_ID_BCM50610M) {
++ /* Clear bit 9 to fix a phy interop issue. */
++ err = bcm54xx_exp_write(phydev, MII_BCM54XX_EXP_EXP08,
++ MII_BCM54XX_EXP_EXP08_RJCT_2MHZ);
++ if (err < 0)
++ goto error;
++
++ if (phydev->drv->phy_id == PHY_ID_BCM50610) {
++ err = bcm50610_a0_workaround(phydev);
++ if (err < 0)
++ goto error;
++ }
++ }
+
+ if (BRCM_PHY_MODEL(phydev) == PHY_ID_BCM57780) {
+ int val;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0014-tg3-Add-50610M-phy-ID-for-5785.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0014-tg3-Add-50610M-phy-ID-for-5785.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,51 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 2 Nov 2009 14:29:34 +0000
+Subject: [PATCH 014/207] tg3: Add 50610M phy ID for 5785
+
+commit c73430d04ec75962e20e186d34c40b6d999f0968 upstream.
+
+This patch adds the 50610M phy ID for 5785.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 2 ++
+ drivers/net/tg3.h | 1 +
+ 2 files changed, 3 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 356d3d7..26d2108 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -940,6 +940,7 @@ static void tg3_mdio_config_5785(struct tg3 *tp)
+ phydev = tp->mdio_bus->phy_map[TG3_PHY_MII_ADDR];
+ switch (phydev->drv->phy_id & phydev->drv->phy_id_mask) {
+ case TG3_PHY_ID_BCM50610:
++ case TG3_PHY_ID_BCM50610M:
+ val = MAC_PHYCFG2_50610_LED_MODES;
+ break;
+ case TG3_PHY_ID_BCMAC131:
+@@ -1098,6 +1099,7 @@ static int tg3_mdio_init(struct tg3 *tp)
+ phydev->interface = PHY_INTERFACE_MODE_GMII;
+ break;
+ case TG3_PHY_ID_BCM50610:
++ case TG3_PHY_ID_BCM50610M:
+ if (tp->tg3_flags3 & TG3_FLG3_RGMII_STD_IBND_DISABLE)
+ phydev->dev_flags |= PHY_BRCM_STD_IBND_DISABLE;
+ if (tp->tg3_flags3 & TG3_FLG3_RGMII_EXT_IBND_RX_EN)
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 9999345..d770da1 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -2864,6 +2864,7 @@ struct tg3 {
+ #define PHY_REV_BCM5401_C0 0x6
+ #define PHY_REV_BCM5411_X0 0x1 /* Found on Netgear GA302T */
+ #define TG3_PHY_ID_BCM50610 0x143bd60
++#define TG3_PHY_ID_BCM50610M 0x143bd70
+ #define TG3_PHY_ID_BCMAC131 0x143bc70
+ #define TG3_PHY_ID_RTL8211C 0x001cc910
+ #define TG3_PHY_ID_RTL8201E 0x00008200
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0015-broadcom-Consolidate-dev_flags-definitions.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0015-broadcom-Consolidate-dev_flags-definitions.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,72 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 2 Nov 2009 14:30:00 +0000
+Subject: [PATCH 015/207] broadcom: Consolidate dev_flags definitions
+
+commit 8649f13d2d810406da444a6101906041b796fbde upstream.
+
+This patch moves all the dev_flags enumerations outside the broadcom.c
+file to include/linux/brcmphy.h. The existing flags were not used yet
+and have been re-enumerated to avoid conflicts.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/phy/broadcom.c | 11 +----------
+ include/linux/brcmphy.h | 17 +++++++++++------
+ 2 files changed, 12 insertions(+), 16 deletions(-)
+
+diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c
+index 66e32d2..a2a7814 100644
+--- a/drivers/net/phy/broadcom.c
++++ b/drivers/net/phy/broadcom.c
+@@ -16,6 +16,7 @@
+
+ #include <linux/module.h>
+ #include <linux/phy.h>
++#include <linux/brcmphy.h>
+
+ #define PHY_ID_BCM50610 0x0143bd60
+ #define PHY_ID_BCM50610M 0x0143bd70
+@@ -138,16 +139,6 @@
+ #define BCM5482_SSD_SGMII_SLAVE_EN 0x0002 /* Slave mode enable */
+ #define BCM5482_SSD_SGMII_SLAVE_AD 0x0001 /* Slave auto-detection */
+
+-/*
+- * Device flags for PHYs that can be configured for different operating
+- * modes.
+- */
+-#define PHY_BCM_FLAGS_VALID 0x80000000
+-#define PHY_BCM_FLAGS_INTF_XAUI 0x00000020
+-#define PHY_BCM_FLAGS_INTF_SGMII 0x00000010
+-#define PHY_BCM_FLAGS_MODE_1000BX 0x00000002
+-#define PHY_BCM_FLAGS_MODE_COPPER 0x00000001
+-
+
+ /*****************************************************************************/
+ /* Fast Ethernet Transceiver definitions. */
+diff --git a/include/linux/brcmphy.h b/include/linux/brcmphy.h
+index 9b64b6d..daa1480 100644
+--- a/include/linux/brcmphy.h
++++ b/include/linux/brcmphy.h
+@@ -1,6 +1,11 @@
+-#define PHY_BRCM_WIRESPEED_ENABLE 0x00000001
+-#define PHY_BRCM_AUTO_PWRDWN_ENABLE 0x00000002
+-#define PHY_BRCM_APD_CLK125_ENABLE 0x00000004
+-#define PHY_BRCM_STD_IBND_DISABLE 0x00000008
+-#define PHY_BRCM_EXT_IBND_RX_ENABLE 0x00000010
+-#define PHY_BRCM_EXT_IBND_TX_ENABLE 0x00000020
++#define PHY_BCM_FLAGS_MODE_COPPER 0x00000001
++#define PHY_BCM_FLAGS_MODE_1000BX 0x00000002
++#define PHY_BCM_FLAGS_INTF_SGMII 0x00000010
++#define PHY_BCM_FLAGS_INTF_XAUI 0x00000020
++#define PHY_BRCM_WIRESPEED_ENABLE 0x00000100
++#define PHY_BRCM_AUTO_PWRDWN_ENABLE 0x00000200
++#define PHY_BRCM_APD_CLK125_ENABLE 0x00000400
++#define PHY_BRCM_STD_IBND_DISABLE 0x00000800
++#define PHY_BRCM_EXT_IBND_RX_ENABLE 0x00001000
++#define PHY_BRCM_EXT_IBND_TX_ENABLE 0x00002000
++#define PHY_BCM_FLAGS_VALID 0x80000000
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0016-tg3-broadcom-Add-PHY_BRCM_CLEAR_RGMII_MODE-flag.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0016-tg3-broadcom-Add-PHY_BRCM_CLEAR_RGMII_MODE-flag.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,73 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 2 Nov 2009 14:30:40 +0000
+Subject: [PATCH 016/207] tg3 / broadcom: Add PHY_BRCM_CLEAR_RGMII_MODE flag
+
+commit 63a14ce449dd6d647de2725809159eb072b2c44f upstream.
+
+Broadcom 50610M parts changed the default definitions of the RGMII mode
+shadow register. The 5785 needs the RGMII mode selection bits [4:3]
+cleared.
+
+The default value of the remaining bits in this register are zero.
+Rather than unnecessarily burn an extra bit in the dev_flags member in
+an attempt to enumerate all possible combinations, this patch take a
+more course grained approach and labels the option as "clear all bits".
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/phy/broadcom.c | 6 ++++++
+ drivers/net/tg3.c | 1 +
+ include/linux/brcmphy.h | 1 +
+ 3 files changed, 8 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c
+index a2a7814..dcec7a6 100644
+--- a/drivers/net/phy/broadcom.c
++++ b/drivers/net/phy/broadcom.c
+@@ -105,6 +105,7 @@
+ #define BCM5482_SHD_LEDS1_LED3(src) ((src & 0xf) << 4)
+ /* LED1 / ~LINKSPD[1] selector */
+ #define BCM5482_SHD_LEDS1_LED1(src) ((src & 0xf) << 0)
++#define BCM54XX_SHD_RGMII_MODE 0x0b /* 01011: RGMII Mode Selector */
+ #define BCM5482_SHD_SSD 0x14 /* 10100: Secondary SerDes control */
+ #define BCM5482_SHD_SSD_LEDM 0x0008 /* SSD LED Mode enable */
+ #define BCM5482_SHD_SSD_EN 0x0001 /* SSD enable */
+@@ -330,6 +331,11 @@ static int bcm54xx_config_init(struct phy_device *phydev)
+ if (err < 0)
+ return err;
+
++ if ((BRCM_PHY_MODEL(phydev) == PHY_ID_BCM50610 ||
++ BRCM_PHY_MODEL(phydev) == PHY_ID_BCM50610M) &&
++ (phydev->dev_flags & PHY_BRCM_CLEAR_RGMII_MODE))
++ bcm54xx_shadow_write(phydev, BCM54XX_SHD_RGMII_MODE, 0);
++
+ bcm54xx_phydsp_config(phydev);
+
+ return 0;
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 26d2108..c788fb5 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -1100,6 +1100,7 @@ static int tg3_mdio_init(struct tg3 *tp)
+ break;
+ case TG3_PHY_ID_BCM50610:
+ case TG3_PHY_ID_BCM50610M:
++ phydev->dev_flags |= PHY_BRCM_CLEAR_RGMII_MODE;
+ if (tp->tg3_flags3 & TG3_FLG3_RGMII_STD_IBND_DISABLE)
+ phydev->dev_flags |= PHY_BRCM_STD_IBND_DISABLE;
+ if (tp->tg3_flags3 & TG3_FLG3_RGMII_EXT_IBND_RX_EN)
+diff --git a/include/linux/brcmphy.h b/include/linux/brcmphy.h
+index daa1480..6e7ffce 100644
+--- a/include/linux/brcmphy.h
++++ b/include/linux/brcmphy.h
+@@ -8,4 +8,5 @@
+ #define PHY_BRCM_STD_IBND_DISABLE 0x00000800
+ #define PHY_BRCM_EXT_IBND_RX_ENABLE 0x00001000
+ #define PHY_BRCM_EXT_IBND_TX_ENABLE 0x00002000
++#define PHY_BRCM_CLEAR_RGMII_MODE 0x00004000
+ #define PHY_BCM_FLAGS_VALID 0x80000000
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0017-tg3-broadcom-Refine-AC131-APD-support.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0017-tg3-broadcom-Refine-AC131-APD-support.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,53 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 2 Nov 2009 14:31:11 +0000
+Subject: [PATCH 017/207] tg3 / broadcom: Refine AC131 APD support
+
+commit cdd4e09d692bd4f3457b3789279005e112b7696d upstream.
+
+Auto power-down (APD) support is a power-saving feature. It should be
+selectively enabled since it might expose MAC bugs. This patch changes
+the code to enable APD only if the PHY_BRCM_AUTO_PWRDWN_ENABLE flag is
+set. The tg3 driver was changed to set this bit.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/phy/broadcom.c | 8 +++++---
+ drivers/net/tg3.c | 1 +
+ 2 files changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c
+index dcec7a6..76bbece 100644
+--- a/drivers/net/phy/broadcom.c
++++ b/drivers/net/phy/broadcom.c
+@@ -561,9 +561,11 @@ static int brcm_fet_config_init(struct phy_device *phydev)
+ if (err < 0)
+ goto done;
+
+- /* Enable auto power down */
+- err = brcm_phy_setbits(phydev, MII_BRCM_FET_SHDW_AUXSTAT2,
+- MII_BRCM_FET_SHDW_AS2_APDE);
++ if (phydev->dev_flags & PHY_BRCM_AUTO_PWRDWN_ENABLE) {
++ /* Enable auto power down */
++ err = brcm_phy_setbits(phydev, MII_BRCM_FET_SHDW_AUXSTAT2,
++ MII_BRCM_FET_SHDW_AS2_APDE);
++ }
+
+ done:
+ /* Disable shadow register access */
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index c788fb5..fd1a85a 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -1114,6 +1114,7 @@ static int tg3_mdio_init(struct tg3 *tp)
+ case TG3_PHY_ID_RTL8201E:
+ case TG3_PHY_ID_BCMAC131:
+ phydev->interface = PHY_INTERFACE_MODE_MII;
++ phydev->dev_flags |= PHY_BRCM_AUTO_PWRDWN_ENABLE;
+ tp->tg3_flags3 |= TG3_FLG3_PHY_IS_FET;
+ break;
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0018-tg3-broadcom-Add-code-to-disable-rxc-refclk.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0018-tg3-broadcom-Add-code-to-disable-rxc-refclk.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,153 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 2 Nov 2009 14:31:39 +0000
+Subject: [PATCH 018/207] tg3 / broadcom: Add code to disable rxc refclk
+
+commit 32e5a8d651c0dbb02bf82ca954206282e44c4b11 upstream.
+
+The 5785 does not use the RXC reference clock. Turning it off is
+desirable as it saves power.
+
+By default, the 50610 enables the RXC reference clock and the 50610M
+disables it. Presumably this is one of the reasons why the hardware
+architect chose one over the other.
+
+Adding a "rx reference clock disable" flag is not the ideal way to
+describe the option, as it would force the MAC using a 50610M to set
+the flag. Ideally we want the flags to represent opt-in behavior that
+deviates from hardware defaults. Furthermore, the lack of a
+"disable" flag implies that the requester wants the rx reference clock
+enabled, which doesn't necessarily follow.
+
+By presenting the option as a passive statement (rx reference clock
+unused) rather than a command, I hope to convey an opt-in option to
+disable the rx reference clock that falls back to hardware defaults if
+not set. A secondary benefit of this is that it keeps the
+intelligence about phy defaults in the broadcom module where it belongs
+and allows the broadcom module more latitude should a bug arise.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/phy/broadcom.c | 43 +++++++++++++++++++++++++++++++++++++++++++
+ drivers/net/tg3.c | 3 ++-
+ include/linux/brcmphy.h | 2 +-
+ 3 files changed, 46 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c
+index 76bbece..abd7429 100644
+--- a/drivers/net/phy/broadcom.c
++++ b/drivers/net/phy/broadcom.c
+@@ -25,6 +25,9 @@
+ #define BRCM_PHY_MODEL(phydev) \
+ ((phydev)->drv->phy_id & (phydev)->drv->phy_id_mask)
+
++#define BRCM_PHY_REV(phydev) \
++ ((phydev)->drv->phy_id & ~((phydev)->drv->phy_id_mask))
++
+
+ #define MII_BCM54XX_ECR 0x10 /* BCM54xx extended control register */
+ #define MII_BCM54XX_ECR_IM 0x1000 /* Interrupt mask */
+@@ -95,11 +98,16 @@
+ #define BCM_LED_SRC_OFF 0xe /* Tied high */
+ #define BCM_LED_SRC_ON 0xf /* Tied low */
+
++
+ /*
+ * BCM5482: Shadow registers
+ * Shadow values go into bits [14:10] of register 0x1c to select a shadow
+ * register to access.
+ */
++/* 00101: Spare Control Register 3 */
++#define BCM54XX_SHD_SCR3 0x05
++#define BCM54XX_SHD_SCR3_DEF_CLK125 0x0001
++
+ #define BCM5482_SHD_LEDS1 0x0d /* 01101: LED Selector 1 */
+ /* LED3 / ~LINKSPD[2] selector */
+ #define BCM5482_SHD_LEDS1_LED3(src) ((src & 0xf) << 4)
+@@ -112,6 +120,7 @@
+ #define BCM5482_SHD_MODE 0x1f /* 11111: Mode Control Register */
+ #define BCM5482_SHD_MODE_1000BX 0x0001 /* Enable 1000BASE-X registers */
+
++
+ /*
+ * EXPANSION SHADOW ACCESS REGISTERS. (PHY REG 0x15, 0x16, and 0x17)
+ */
+@@ -309,6 +318,37 @@ error:
+ return err ? err : err2;
+ }
+
++static void bcm54xx_adjust_rxrefclk(struct phy_device *phydev)
++{
++ u32 val, orig;
++
++ /* Abort if we are using an untested phy. */
++ if (BRCM_PHY_MODEL(phydev) != PHY_ID_BCM50610 ||
++ BRCM_PHY_MODEL(phydev) != PHY_ID_BCM50610M)
++ return;
++
++ val = bcm54xx_shadow_read(phydev, BCM54XX_SHD_SCR3);
++ if (val < 0)
++ return;
++
++ orig = val;
++
++ if (phydev->dev_flags & PHY_BRCM_RX_REFCLK_UNUSED) {
++ if ((BRCM_PHY_MODEL(phydev) == PHY_ID_BCM50610 ||
++ BRCM_PHY_MODEL(phydev) == PHY_ID_BCM50610M) &&
++ BRCM_PHY_REV(phydev) >= 0x3) {
++ /* Here, bit 0 _disables_ CLK125 when set */
++ val |= BCM54XX_SHD_SCR3_DEF_CLK125;
++ } else {
++ /* Here, bit 0 _enables_ CLK125 when set */
++ val &= ~BCM54XX_SHD_SCR3_DEF_CLK125;
++ }
++ }
++
++ if (orig != val)
++ bcm54xx_shadow_write(phydev, BCM54XX_SHD_SCR3, val);
++}
++
+ static int bcm54xx_config_init(struct phy_device *phydev)
+ {
+ int reg, err;
+@@ -336,6 +376,9 @@ static int bcm54xx_config_init(struct phy_device *phydev)
+ (phydev->dev_flags & PHY_BRCM_CLEAR_RGMII_MODE))
+ bcm54xx_shadow_write(phydev, BCM54XX_SHD_RGMII_MODE, 0);
+
++ if (phydev->dev_flags & PHY_BRCM_RX_REFCLK_UNUSED)
++ bcm54xx_adjust_rxrefclk(phydev);
++
+ bcm54xx_phydsp_config(phydev);
+
+ return 0;
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index fd1a85a..81a9d09 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -1100,7 +1100,8 @@ static int tg3_mdio_init(struct tg3 *tp)
+ break;
+ case TG3_PHY_ID_BCM50610:
+ case TG3_PHY_ID_BCM50610M:
+- phydev->dev_flags |= PHY_BRCM_CLEAR_RGMII_MODE;
++ phydev->dev_flags |= PHY_BRCM_CLEAR_RGMII_MODE |
++ PHY_BRCM_RX_REFCLK_UNUSED;
+ if (tp->tg3_flags3 & TG3_FLG3_RGMII_STD_IBND_DISABLE)
+ phydev->dev_flags |= PHY_BRCM_STD_IBND_DISABLE;
+ if (tp->tg3_flags3 & TG3_FLG3_RGMII_EXT_IBND_RX_EN)
+diff --git a/include/linux/brcmphy.h b/include/linux/brcmphy.h
+index 6e7ffce..5943227 100644
+--- a/include/linux/brcmphy.h
++++ b/include/linux/brcmphy.h
+@@ -4,7 +4,7 @@
+ #define PHY_BCM_FLAGS_INTF_XAUI 0x00000020
+ #define PHY_BRCM_WIRESPEED_ENABLE 0x00000100
+ #define PHY_BRCM_AUTO_PWRDWN_ENABLE 0x00000200
+-#define PHY_BRCM_APD_CLK125_ENABLE 0x00000400
++#define PHY_BRCM_RX_REFCLK_UNUSED 0x00000400
+ #define PHY_BRCM_STD_IBND_DISABLE 0x00000800
+ #define PHY_BRCM_EXT_IBND_RX_ENABLE 0x00001000
+ #define PHY_BRCM_EXT_IBND_TX_ENABLE 0x00002000
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0019-tg3-broadcom-Add-APD-support-for-GPHYs.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0019-tg3-broadcom-Add-APD-support-for-GPHYs.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,131 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 2 Nov 2009 14:32:12 +0000
+Subject: [PATCH 019/207] tg3 / broadcom: Add APD support for GPHYs
+
+commit c704dc23cac0e433796bfe0a1fe2f1a64da11ac7 upstream.
+
+This patch adds an RXC auto power-down feature to the code that supports
+the gphys.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/phy/broadcom.c | 51 ++++++++++++++++++++++++++++++++++++-------
+ drivers/net/tg3.c | 4 ++-
+ 2 files changed, 45 insertions(+), 10 deletions(-)
+
+diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c
+index abd7429..7198192 100644
+--- a/drivers/net/phy/broadcom.c
++++ b/drivers/net/phy/broadcom.c
+@@ -107,6 +107,11 @@
+ /* 00101: Spare Control Register 3 */
+ #define BCM54XX_SHD_SCR3 0x05
+ #define BCM54XX_SHD_SCR3_DEF_CLK125 0x0001
++#define BCM54XX_SHD_SCR3_DLLAPD_DIS 0x0002
++
++/* 01010: Auto Power-Down */
++#define BCM54XX_SHD_APD 0x0a
++#define BCM54XX_SHD_APD_EN 0x0020
+
+ #define BCM5482_SHD_LEDS1 0x0d /* 01101: LED Selector 1 */
+ /* LED3 / ~LINKSPD[2] selector */
+@@ -321,9 +326,11 @@ error:
+ static void bcm54xx_adjust_rxrefclk(struct phy_device *phydev)
+ {
+ u32 val, orig;
++ bool clk125en = true;
+
+ /* Abort if we are using an untested phy. */
+- if (BRCM_PHY_MODEL(phydev) != PHY_ID_BCM50610 ||
++ if (BRCM_PHY_MODEL(phydev) != PHY_ID_BCM57780 ||
++ BRCM_PHY_MODEL(phydev) != PHY_ID_BCM50610 ||
+ BRCM_PHY_MODEL(phydev) != PHY_ID_BCM50610M)
+ return;
+
+@@ -333,20 +340,45 @@ static void bcm54xx_adjust_rxrefclk(struct phy_device *phydev)
+
+ orig = val;
+
+- if (phydev->dev_flags & PHY_BRCM_RX_REFCLK_UNUSED) {
+- if ((BRCM_PHY_MODEL(phydev) == PHY_ID_BCM50610 ||
+- BRCM_PHY_MODEL(phydev) == PHY_ID_BCM50610M) &&
+- BRCM_PHY_REV(phydev) >= 0x3) {
+- /* Here, bit 0 _disables_ CLK125 when set */
+- val |= BCM54XX_SHD_SCR3_DEF_CLK125;
+- } else {
++ if ((BRCM_PHY_MODEL(phydev) == PHY_ID_BCM50610 ||
++ BRCM_PHY_MODEL(phydev) == PHY_ID_BCM50610M) &&
++ BRCM_PHY_REV(phydev) >= 0x3) {
++ /*
++ * Here, bit 0 _disables_ CLK125 when set.
++ * This bit is set by default.
++ */
++ clk125en = false;
++ } else {
++ if (phydev->dev_flags & PHY_BRCM_RX_REFCLK_UNUSED) {
+ /* Here, bit 0 _enables_ CLK125 when set */
+ val &= ~BCM54XX_SHD_SCR3_DEF_CLK125;
++ clk125en = false;
+ }
+ }
+
++ if (clk125en == false ||
++ (phydev->dev_flags & PHY_BRCM_AUTO_PWRDWN_ENABLE))
++ val &= ~BCM54XX_SHD_SCR3_DLLAPD_DIS;
++ else
++ val |= BCM54XX_SHD_SCR3_DLLAPD_DIS;
++
+ if (orig != val)
+ bcm54xx_shadow_write(phydev, BCM54XX_SHD_SCR3, val);
++
++ val = bcm54xx_shadow_read(phydev, BCM54XX_SHD_APD);
++ if (val < 0)
++ return;
++
++ orig = val;
++
++ if (clk125en == false ||
++ (phydev->dev_flags & PHY_BRCM_AUTO_PWRDWN_ENABLE))
++ val |= BCM54XX_SHD_APD_EN;
++ else
++ val &= ~BCM54XX_SHD_APD_EN;
++
++ if (orig != val)
++ bcm54xx_shadow_write(phydev, BCM54XX_SHD_APD, val);
+ }
+
+ static int bcm54xx_config_init(struct phy_device *phydev)
+@@ -376,7 +408,8 @@ static int bcm54xx_config_init(struct phy_device *phydev)
+ (phydev->dev_flags & PHY_BRCM_CLEAR_RGMII_MODE))
+ bcm54xx_shadow_write(phydev, BCM54XX_SHD_RGMII_MODE, 0);
+
+- if (phydev->dev_flags & PHY_BRCM_RX_REFCLK_UNUSED)
++ if ((phydev->dev_flags & PHY_BRCM_RX_REFCLK_UNUSED) ||
++ (phydev->dev_flags & PHY_BRCM_AUTO_PWRDWN_ENABLE))
+ bcm54xx_adjust_rxrefclk(phydev);
+
+ bcm54xx_phydsp_config(phydev);
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 81a9d09..cc6042e 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -1097,11 +1097,13 @@ static int tg3_mdio_init(struct tg3 *tp)
+ switch (phydev->drv->phy_id & phydev->drv->phy_id_mask) {
+ case TG3_PHY_ID_BCM57780:
+ phydev->interface = PHY_INTERFACE_MODE_GMII;
++ phydev->dev_flags |= PHY_BRCM_AUTO_PWRDWN_ENABLE;
+ break;
+ case TG3_PHY_ID_BCM50610:
+ case TG3_PHY_ID_BCM50610M:
+ phydev->dev_flags |= PHY_BRCM_CLEAR_RGMII_MODE |
+- PHY_BRCM_RX_REFCLK_UNUSED;
++ PHY_BRCM_RX_REFCLK_UNUSED |
++ PHY_BRCM_AUTO_PWRDWN_ENABLE;
+ if (tp->tg3_flags3 & TG3_FLG3_RGMII_STD_IBND_DISABLE)
+ phydev->dev_flags |= PHY_BRCM_STD_IBND_DISABLE;
+ if (tp->tg3_flags3 & TG3_FLG3_RGMII_EXT_IBND_RX_EN)
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0020-tg3-broadcom-Optionally-disable-TXC-if-no-link.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0020-tg3-broadcom-Optionally-disable-TXC-if-no-link.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,73 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 2 Nov 2009 14:32:38 +0000
+Subject: [PATCH 020/207] tg3 / broadcom: Optionally disable TXC if no link
+
+commit 52fae0837153e86e4dabaf5df517a0b8b7a20bd7 upstream.
+
+This patch adds code to disable the TXC and RXC reference clocks if link
+is not available.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/phy/broadcom.c | 5 +++++
+ drivers/net/tg3.c | 1 +
+ include/linux/brcmphy.h | 1 +
+ 3 files changed, 7 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c
+index 7198192..f433a2e 100644
+--- a/drivers/net/phy/broadcom.c
++++ b/drivers/net/phy/broadcom.c
+@@ -108,6 +108,7 @@
+ #define BCM54XX_SHD_SCR3 0x05
+ #define BCM54XX_SHD_SCR3_DEF_CLK125 0x0001
+ #define BCM54XX_SHD_SCR3_DLLAPD_DIS 0x0002
++#define BCM54XX_SHD_SCR3_TRDDAPD 0x0004
+
+ /* 01010: Auto Power-Down */
+ #define BCM54XX_SHD_APD 0x0a
+@@ -362,6 +363,9 @@ static void bcm54xx_adjust_rxrefclk(struct phy_device *phydev)
+ else
+ val |= BCM54XX_SHD_SCR3_DLLAPD_DIS;
+
++ if (phydev->dev_flags & PHY_BRCM_DIS_TXCRXC_NOENRGY)
++ val |= BCM54XX_SHD_SCR3_TRDDAPD;
++
+ if (orig != val)
+ bcm54xx_shadow_write(phydev, BCM54XX_SHD_SCR3, val);
+
+@@ -409,6 +413,7 @@ static int bcm54xx_config_init(struct phy_device *phydev)
+ bcm54xx_shadow_write(phydev, BCM54XX_SHD_RGMII_MODE, 0);
+
+ if ((phydev->dev_flags & PHY_BRCM_RX_REFCLK_UNUSED) ||
++ (phydev->dev_flags & PHY_BRCM_DIS_TXCRXC_NOENRGY) ||
+ (phydev->dev_flags & PHY_BRCM_AUTO_PWRDWN_ENABLE))
+ bcm54xx_adjust_rxrefclk(phydev);
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index cc6042e..718ecc9 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -1103,6 +1103,7 @@ static int tg3_mdio_init(struct tg3 *tp)
+ case TG3_PHY_ID_BCM50610M:
+ phydev->dev_flags |= PHY_BRCM_CLEAR_RGMII_MODE |
+ PHY_BRCM_RX_REFCLK_UNUSED |
++ PHY_BRCM_DIS_TXCRXC_NOENRGY |
+ PHY_BRCM_AUTO_PWRDWN_ENABLE;
+ if (tp->tg3_flags3 & TG3_FLG3_RGMII_STD_IBND_DISABLE)
+ phydev->dev_flags |= PHY_BRCM_STD_IBND_DISABLE;
+diff --git a/include/linux/brcmphy.h b/include/linux/brcmphy.h
+index 5943227..2b31b91 100644
+--- a/include/linux/brcmphy.h
++++ b/include/linux/brcmphy.h
+@@ -9,4 +9,5 @@
+ #define PHY_BRCM_EXT_IBND_RX_ENABLE 0x00001000
+ #define PHY_BRCM_EXT_IBND_TX_ENABLE 0x00002000
+ #define PHY_BRCM_CLEAR_RGMII_MODE 0x00004000
++#define PHY_BRCM_DIS_TXCRXC_NOENRGY 0x00008000
+ #define PHY_BCM_FLAGS_VALID 0x80000000
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0021-tg3-Update-version-to-3.103.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0021-tg3-Update-version-to-3.103.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,33 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 2 Nov 2009 14:33:03 +0000
+Subject: [PATCH 021/207] tg3: Update version to 3.103
+
+commit 123b43e9716115302a0095e14f2c545811712715 upstream.
+
+This patch updates the tg3 version to 3.103.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 718ecc9..b4dba62 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -68,8 +68,8 @@
+
+ #define DRV_MODULE_NAME "tg3"
+ #define PFX DRV_MODULE_NAME ": "
+-#define DRV_MODULE_VERSION "3.102"
+-#define DRV_MODULE_RELDATE "September 1, 2009"
++#define DRV_MODULE_VERSION "3.103"
++#define DRV_MODULE_RELDATE "November 2, 2009"
+
+ #define TG3_DEF_MAC_MODE 0
+ #define TG3_DEF_RX_MODE 0
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0022-tg3-Add-5717-phy-ID.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0022-tg3-Add-5717-phy-ID.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,52 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Fri, 13 Nov 2009 13:03:33 +0000
+Subject: [PATCH 022/207] tg3: Add 5717 phy ID
+
+commit c2060fe1f36565e60e622662a4519babd3b72f68 upstream.
+
+This patch adds the 5717 phy ID.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 1 +
+ drivers/net/tg3.h | 3 ++-
+ 2 files changed, 3 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index b4dba62..5781707 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -13756,6 +13756,7 @@ static char * __devinit tg3_phy_string(struct tg3 *tp)
+ case PHY_ID_BCM5756: return "5722/5756";
+ case PHY_ID_BCM5906: return "5906";
+ case PHY_ID_BCM5761: return "5761";
++ case PHY_ID_BCM5717: return "5717";
+ case PHY_ID_BCM8002: return "8002/serdes";
+ case 0: return "serdes";
+ default: return "unknown";
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index d770da1..e0a8b61 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -2855,6 +2855,7 @@ struct tg3 {
+ #define PHY_ID_BCM5756 0xbc050ed0
+ #define PHY_ID_BCM5784 0xbc050fa0
+ #define PHY_ID_BCM5761 0xbc050fd0
++#define PHY_ID_BCM5717 0x5c0d8a00
+ #define PHY_ID_BCM5906 0xdc00ac40
+ #define PHY_ID_BCM8002 0x60010140
+ #define PHY_ID_INVALID 0xffffffff
+@@ -2896,7 +2897,7 @@ struct tg3 {
+ (X) == PHY_ID_BCM5780 || (X) == PHY_ID_BCM5787 || \
+ (X) == PHY_ID_BCM5755 || (X) == PHY_ID_BCM5756 || \
+ (X) == PHY_ID_BCM5906 || (X) == PHY_ID_BCM5761 || \
+- (X) == PHY_ID_BCM8002)
++ (X) == PHY_ID_BCM5717 || (X) == PHY_ID_BCM8002)
+
+ struct tg3_hw_stats *hw_stats;
+ dma_addr_t stats_mapping;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0023-tg3-Don-t-touch-RCB-nic-addresses.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0023-tg3-Don-t-touch-RCB-nic-addresses.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,48 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Fri, 13 Nov 2009 13:03:34 +0000
+Subject: [PATCH 023/207] tg3: Don't touch RCB nic addresses
+
+commit 87668d352aa8d135bd695a050f18bbfc7b50b506 upstream.
+
+This patch avoids reprogramming the RCB NIC addresses for all 5755 and
+later devices. The address is incorrect for 5717 devices and should be
+correct by default for all other affected devices.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 10 ++++++----
+ 1 files changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 5781707..db9e567d 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -7404,8 +7404,9 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ ((u64) tpr->rx_std_mapping >> 32));
+ tw32(RCVDBDI_STD_BD + TG3_BDINFO_HOST_ADDR + TG3_64BIT_REG_LOW,
+ ((u64) tpr->rx_std_mapping & 0xffffffff));
+- tw32(RCVDBDI_STD_BD + TG3_BDINFO_NIC_ADDR,
+- NIC_SRAM_RX_BUFFER_DESC);
++ if (!(tp->tg3_flags3 & TG3_FLG3_5755_PLUS))
++ tw32(RCVDBDI_STD_BD + TG3_BDINFO_NIC_ADDR,
++ NIC_SRAM_RX_BUFFER_DESC);
+
+ /* Disable the mini ring */
+ if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS))
+@@ -7428,8 +7429,9 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ tw32(RCVDBDI_JUMBO_BD + TG3_BDINFO_MAXLEN_FLAGS,
+ (RX_JUMBO_MAX_SIZE << BDINFO_FLAGS_MAXLEN_SHIFT) |
+ BDINFO_FLAGS_USE_EXT_RECV);
+- tw32(RCVDBDI_JUMBO_BD + TG3_BDINFO_NIC_ADDR,
+- NIC_SRAM_RX_JUMBO_BUFFER_DESC);
++ if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS))
++ tw32(RCVDBDI_JUMBO_BD + TG3_BDINFO_NIC_ADDR,
++ NIC_SRAM_RX_JUMBO_BUFFER_DESC);
+ } else {
+ tw32(RCVDBDI_JUMBO_BD + TG3_BDINFO_MAXLEN_FLAGS,
+ BDINFO_FLAGS_DISABLED);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0024-tg3-Napify-tg3_start_xmit_dma_bug.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0024-tg3-Napify-tg3_start_xmit_dma_bug.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,110 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Fri, 13 Nov 2009 13:03:35 +0000
+Subject: [PATCH 024/207] tg3: Napify tg3_start_xmit_dma_bug()
+
+commit 24f4efd4e6c89a4093d0b8653d6669e45de45001 upstream.
+
+This patch converts tg3_start_xmit_dma_bug() to accomodate multiple NAPI
+instances. This is prep work for a later patch in this series.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 32 +++++++++++++++++++-------------
+ 1 files changed, 19 insertions(+), 13 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index db9e567d..b58fc6a 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -5119,11 +5119,11 @@ static inline int tg3_40bit_overflow_test(struct tg3 *tp, dma_addr_t mapping,
+ static void tg3_set_txd(struct tg3_napi *, int, dma_addr_t, int, u32, u32);
+
+ /* Workaround 4GB and 40-bit hardware DMA bugs. */
+-static int tigon3_dma_hwbug_workaround(struct tg3 *tp, struct sk_buff *skb,
+- u32 last_plus_one, u32 *start,
+- u32 base_flags, u32 mss)
++static int tigon3_dma_hwbug_workaround(struct tg3_napi *tnapi,
++ struct sk_buff *skb, u32 last_plus_one,
++ u32 *start, u32 base_flags, u32 mss)
+ {
+- struct tg3_napi *tnapi = &tp->napi[0];
++ struct tg3 *tp = tnapi->tp;
+ struct sk_buff *new_skb;
+ dma_addr_t new_addr = 0;
+ u32 entry = *start;
+@@ -5392,9 +5392,13 @@ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb,
+ struct skb_shared_info *sp;
+ int would_hit_hwbug;
+ dma_addr_t mapping;
+- struct tg3_napi *tnapi = &tp->napi[0];
++ struct tg3_napi *tnapi;
++ struct netdev_queue *txq;
+
+- len = skb_headlen(skb);
++ txq = netdev_get_tx_queue(dev, skb_get_queue_mapping(skb));
++ tnapi = &tp->napi[skb_get_queue_mapping(skb)];
++ if (tp->tg3_flags2 & TG3_FLG2_USING_MSIX)
++ tnapi++;
+
+ /* We are running in BH disabled context with netif_tx_lock
+ * and TX reclaim runs via tp->napi.poll inside of a software
+@@ -5402,8 +5406,8 @@ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb,
+ * no IRQ context deadlocks to worry about either. Rejoice!
+ */
+ if (unlikely(tg3_tx_avail(tnapi) <= (skb_shinfo(skb)->nr_frags + 1))) {
+- if (!netif_queue_stopped(dev)) {
+- netif_stop_queue(dev);
++ if (!netif_tx_queue_stopped(txq)) {
++ netif_tx_stop_queue(txq);
+
+ /* This is a hard error, log it. */
+ printk(KERN_ERR PFX "%s: BUG! Tx Ring full when "
+@@ -5416,7 +5420,7 @@ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb,
+ base_flags = 0;
+ if (skb->ip_summed == CHECKSUM_PARTIAL)
+ base_flags |= TXD_FLAG_TCPUDP_CSUM;
+- mss = 0;
++
+ if ((mss = skb_shinfo(skb)->gso_size) != 0) {
+ struct iphdr *iph;
+ u32 tcp_opt_len, ip_tcp_len, hdr_len;
+@@ -5488,6 +5492,8 @@ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb,
+
+ would_hit_hwbug = 0;
+
++ len = skb_headlen(skb);
++
+ if ((tp->tg3_flags3 & TG3_FLG3_SHORT_DMA_BUG) && len <= 8)
+ would_hit_hwbug = 1;
+
+@@ -5553,7 +5559,7 @@ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb,
+ /* If the workaround fails due to memory/mapping
+ * failure, silently drop this packet.
+ */
+- if (tigon3_dma_hwbug_workaround(tp, skb, last_plus_one,
++ if (tigon3_dma_hwbug_workaround(tnapi, skb, last_plus_one,
+ &start, base_flags, mss))
+ goto out_unlock;
+
+@@ -5561,13 +5567,13 @@ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb,
+ }
+
+ /* Packets are ready, update Tx producer idx local and on card. */
+- tw32_tx_mbox(MAILBOX_SNDHOST_PROD_IDX_0 + TG3_64BIT_REG_LOW, entry);
++ tw32_tx_mbox(tnapi->prodmbox, entry);
+
+ tnapi->tx_prod = entry;
+ if (unlikely(tg3_tx_avail(tnapi) <= (MAX_SKB_FRAGS + 1))) {
+- netif_stop_queue(dev);
++ netif_tx_stop_queue(txq);
+ if (tg3_tx_avail(tnapi) > TG3_TX_WAKEUP_THRESH(tnapi))
+- netif_wake_queue(tp->dev);
++ netif_tx_wake_queue(txq);
+ }
+
+ out_unlock:
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0025-tg3-Move-TG3_FLG2_PROTECTED_NVRAM-to-tg3_flags3.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0025-tg3-Move-TG3_FLG2_PROTECTED_NVRAM-to-tg3_flags3.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,99 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Fri, 13 Nov 2009 13:03:36 +0000
+Subject: [PATCH 025/207] tg3: Move TG3_FLG2_PROTECTED_NVRAM to tg3_flags3
+
+commit f66a29b03a2637ff052f2b8a81a5417fa44e228b upstream.
+
+We need room for another TSO flag and it would be most efficient if it
+resided in tg3_flags2. This patch moves the TG3_FLG2_PROTECTED_NVRAM
+to tg3_flags3 to make room.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 12 ++++++------
+ drivers/net/tg3.h | 2 +-
+ 2 files changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index b58fc6a..6c60ef7 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -2249,7 +2249,7 @@ static void tg3_nvram_unlock(struct tg3 *tp)
+ static void tg3_enable_nvram_access(struct tg3 *tp)
+ {
+ if ((tp->tg3_flags2 & TG3_FLG2_5750_PLUS) &&
+- !(tp->tg3_flags2 & TG3_FLG2_PROTECTED_NVRAM)) {
++ !(tp->tg3_flags3 & TG3_FLG3_PROTECTED_NVRAM)) {
+ u32 nvaccess = tr32(NVRAM_ACCESS);
+
+ tw32(NVRAM_ACCESS, nvaccess | ACCESS_ENABLE);
+@@ -2260,7 +2260,7 @@ static void tg3_enable_nvram_access(struct tg3 *tp)
+ static void tg3_disable_nvram_access(struct tg3 *tp)
+ {
+ if ((tp->tg3_flags2 & TG3_FLG2_5750_PLUS) &&
+- !(tp->tg3_flags2 & TG3_FLG2_PROTECTED_NVRAM)) {
++ !(tp->tg3_flags3 & TG3_FLG3_PROTECTED_NVRAM)) {
+ u32 nvaccess = tr32(NVRAM_ACCESS);
+
+ tw32(NVRAM_ACCESS, nvaccess & ~ACCESS_ENABLE);
+@@ -10971,7 +10971,7 @@ static void __devinit tg3_get_5752_nvram_info(struct tg3 *tp)
+
+ /* NVRAM protection for TPM */
+ if (nvcfg1 & (1 << 27))
+- tp->tg3_flags2 |= TG3_FLG2_PROTECTED_NVRAM;
++ tp->tg3_flags3 |= TG3_FLG3_PROTECTED_NVRAM;
+
+ switch (nvcfg1 & NVRAM_CFG1_5752VENDOR_MASK) {
+ case FLASH_5752VENDOR_ATMEL_EEPROM_64KHZ:
+@@ -11012,7 +11012,7 @@ static void __devinit tg3_get_5755_nvram_info(struct tg3 *tp)
+
+ /* NVRAM protection for TPM */
+ if (nvcfg1 & (1 << 27)) {
+- tp->tg3_flags2 |= TG3_FLG2_PROTECTED_NVRAM;
++ tp->tg3_flags3 |= TG3_FLG3_PROTECTED_NVRAM;
+ protect = 1;
+ }
+
+@@ -11106,7 +11106,7 @@ static void __devinit tg3_get_5761_nvram_info(struct tg3 *tp)
+
+ /* NVRAM protection for TPM */
+ if (nvcfg1 & (1 << 27)) {
+- tp->tg3_flags2 |= TG3_FLG2_PROTECTED_NVRAM;
++ tp->tg3_flags3 |= TG3_FLG3_PROTECTED_NVRAM;
+ protect = 1;
+ }
+
+@@ -11608,7 +11608,7 @@ static int tg3_nvram_write_block(struct tg3 *tp, u32 offset, u32 len, u8 *buf)
+
+ tg3_enable_nvram_access(tp);
+ if ((tp->tg3_flags2 & TG3_FLG2_5750_PLUS) &&
+- !(tp->tg3_flags2 & TG3_FLG2_PROTECTED_NVRAM))
++ !(tp->tg3_flags3 & TG3_FLG3_PROTECTED_NVRAM))
+ tw32(NVRAM_WRITE1, 0x406);
+
+ grc_mode = tr32(GRC_MODE);
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index e0a8b61..590a692 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -2753,7 +2753,6 @@ struct tg3 {
+ #define TG3_FLG2_SERDES_PREEMPHASIS 0x00020000
+ #define TG3_FLG2_5705_PLUS 0x00040000
+ #define TG3_FLG2_5750_PLUS 0x00080000
+-#define TG3_FLG2_PROTECTED_NVRAM 0x00100000
+ #define TG3_FLG2_USING_MSI 0x00200000
+ #define TG3_FLG2_USING_MSIX 0x00400000
+ #define TG3_FLG2_USING_MSI_OR_MSIX (TG3_FLG2_USING_MSI | \
+@@ -2773,6 +2772,7 @@ struct tg3 {
+ u32 tg3_flags3;
+ #define TG3_FLG3_NO_NVRAM_ADDR_TRANS 0x00000001
+ #define TG3_FLG3_ENABLE_APE 0x00000002
++#define TG3_FLG3_PROTECTED_NVRAM 0x00000004
+ #define TG3_FLG3_5701_DMA_BUG 0x00000008
+ #define TG3_FLG3_USE_PHYLIB 0x00000010
+ #define TG3_FLG3_MDIOBUS_INITED 0x00000020
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0026-tg3-Refine-TSO-and-MSI-discovery.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0026-tg3-Refine-TSO-and-MSI-discovery.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,115 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Fri, 13 Nov 2009 13:03:37 +0000
+Subject: [PATCH 026/207] tg3: Refine TSO and MSI discovery
+
+commit 507399f18ea5810de42f0ea228c14305a8f67512 upstream.
+
+This patch consolidates the TSO capability discovery code into its own
+code block. The code that decides whether or not to allow TSO is then
+cleaned up. Finally, the patch consolidates all MSI and MSIX
+capability code into a single code block.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 64 ++++++++++++++++++++++++++++------------------------
+ 1 files changed, 34 insertions(+), 30 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 6c60ef7..7318c8f 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -12670,6 +12670,27 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ tp->dev->features |= NETIF_F_IPV6_CSUM;
+ }
+
++ /* Determine TSO capabilities */
++ if ((tp->tg3_flags3 & TG3_FLG3_5755_PLUS) ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
++ tp->tg3_flags2 |= TG3_FLG2_HW_TSO_2;
++ else if (tp->tg3_flags2 & TG3_FLG2_5750_PLUS) {
++ tp->tg3_flags2 |= TG3_FLG2_HW_TSO_1 | TG3_FLG2_TSO_BUG;
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750 &&
++ tp->pci_chip_rev_id >= CHIPREV_ID_5750_C2)
++ tp->tg3_flags2 &= ~TG3_FLG2_TSO_BUG;
++ } else if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5700 &&
++ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5701 &&
++ tp->pci_chip_rev_id != CHIPREV_ID_5705_A0) {
++ tp->tg3_flags2 |= TG3_FLG2_TSO_BUG;
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705)
++ tp->fw_needed = FIRMWARE_TG3TSO5;
++ else
++ tp->fw_needed = FIRMWARE_TG3TSO;
++ }
++
++ tp->irq_max = 1;
++
+ if (tp->tg3_flags2 & TG3_FLG2_5750_PLUS) {
+ tp->tg3_flags |= TG3_FLAG_SUPPORT_MSI;
+ if (GET_CHIP_REV(tp->pci_chip_rev_id) == CHIPREV_5750_AX ||
+@@ -12681,22 +12702,13 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+
+ if ((tp->tg3_flags3 & TG3_FLG3_5755_PLUS) ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) {
+- tp->tg3_flags2 |= TG3_FLG2_HW_TSO_2;
+ tp->tg3_flags2 |= TG3_FLG2_1SHOT_MSI;
+- } else {
+- tp->tg3_flags2 |= TG3_FLG2_HW_TSO_1 | TG3_FLG2_TSO_BUG;
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) ==
+- ASIC_REV_5750 &&
+- tp->pci_chip_rev_id >= CHIPREV_ID_5750_C2)
+- tp->tg3_flags2 &= ~TG3_FLG2_TSO_BUG;
+ }
+- }
+-
+- tp->irq_max = 1;
+
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) {
+- tp->tg3_flags |= TG3_FLAG_SUPPORT_MSIX;
+- tp->irq_max = TG3_IRQ_MAX_VECS;
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) {
++ tp->tg3_flags |= TG3_FLAG_SUPPORT_MSIX;
++ tp->irq_max = TG3_IRQ_MAX_VECS;
++ }
+ }
+
+ if (!(tp->tg3_flags3 & TG3_FLG3_5755_PLUS)) {
+@@ -14109,25 +14121,17 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
+
+ tg3_init_bufmgr_config(tp);
+
+- if (tp->pci_chip_rev_id == CHIPREV_ID_5701_A0)
+- tp->fw_needed = FIRMWARE_TG3;
+-
+- if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) {
++ /* Selectively allow TSO based on operating conditions */
++ if ((tp->tg3_flags2 & TG3_FLG2_HW_TSO) ||
++ (tp->fw_needed && !(tp->tg3_flags & TG3_FLAG_ENABLE_ASF)))
+ tp->tg3_flags2 |= TG3_FLG2_TSO_CAPABLE;
++ else {
++ tp->tg3_flags2 &= ~(TG3_FLG2_TSO_CAPABLE | TG3_FLG2_TSO_BUG);
++ tp->fw_needed = NULL;
+ }
+- else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700 ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701 ||
+- tp->pci_chip_rev_id == CHIPREV_ID_5705_A0 ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906 ||
+- (tp->tg3_flags & TG3_FLAG_ENABLE_ASF) != 0) {
+- tp->tg3_flags2 &= ~TG3_FLG2_TSO_CAPABLE;
+- } else {
+- tp->tg3_flags2 |= TG3_FLG2_TSO_CAPABLE | TG3_FLG2_TSO_BUG;
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705)
+- tp->fw_needed = FIRMWARE_TG3TSO5;
+- else
+- tp->fw_needed = FIRMWARE_TG3TSO;
+- }
++
++ if (tp->pci_chip_rev_id == CHIPREV_ID_5701_A0)
++ tp->fw_needed = FIRMWARE_TG3;
+
+ /* TSO is on by default on chips that support hardware TSO.
+ * Firmware TSO on older chips gives lower performance, so it
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0027-tg3-Add-new-HW_TSO_3-flag-for-5717.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0027-tg3-Add-new-HW_TSO_3-flag-for-5717.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,143 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Fri, 13 Nov 2009 13:03:38 +0000
+Subject: [PATCH 027/207] tg3: Add new HW_TSO_3 flag for 5717
+
+commit e849cdc309de4a1e49dc3c23c6c36da91b990c9f upstream.
+
+The 5717 sets up TSO slightly differently in the transmit path. It
+looks like this method will be the new way of doing things. This patch
+defines a flag to indicate this.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 41 +++++++++++++++++++++++------------------
+ drivers/net/tg3.h | 5 ++++-
+ 2 files changed, 27 insertions(+), 19 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 7318c8f..9f7129d 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -5206,7 +5206,7 @@ static void tg3_set_txd(struct tg3_napi *tnapi, int entry,
+ }
+
+ /* hard_start_xmit for devices that don't have any bugs and
+- * support TG3_FLG2_HW_TSO_2 only.
++ * support TG3_FLG2_HW_TSO_2 and TG3_FLG2_HW_TSO_3 only.
+ */
+ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb,
+ struct net_device *dev)
+@@ -5265,7 +5265,7 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb,
+ hdrlen = ip_tcp_len + tcp_opt_len;
+ }
+
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) {
++ if (tp->tg3_flags2 & TG3_FLG2_HW_TSO_3) {
+ mss |= (hdrlen & 0xc) << 12;
+ if (hdrlen & 0x10)
+ base_flags |= 0x00000010;
+@@ -7523,7 +7523,8 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ if (tp->tg3_flags2 & TG3_FLG2_HW_TSO)
+ rdmac_mode |= RDMAC_MODE_IPV4_LSO_EN;
+
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 ||
++ if ((tp->tg3_flags2 & TG3_FLG2_HW_TSO_3) ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780)
+ rdmac_mode |= RDMAC_MODE_IPV6_LSO_EN;
+
+@@ -9514,15 +9515,16 @@ static int tg3_set_tso(struct net_device *dev, u32 value)
+ return 0;
+ }
+ if ((dev->features & NETIF_F_IPV6_CSUM) &&
+- (tp->tg3_flags2 & TG3_FLG2_HW_TSO_2)) {
++ ((tp->tg3_flags2 & TG3_FLG2_HW_TSO_2) ||
++ (tp->tg3_flags2 & TG3_FLG2_HW_TSO_3))) {
+ if (value) {
+ dev->features |= NETIF_F_TSO6;
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 ||
++ if ((tp->tg3_flags2 & TG3_FLG2_HW_TSO_3) ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 ||
+ (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 &&
+ GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5784_AX) ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717)
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780)
+ dev->features |= NETIF_F_TSO_ECN;
+ } else
+ dev->features &= ~(NETIF_F_TSO6 | NETIF_F_TSO_ECN);
+@@ -12671,8 +12673,10 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ }
+
+ /* Determine TSO capabilities */
+- if ((tp->tg3_flags3 & TG3_FLG3_5755_PLUS) ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717)
++ tp->tg3_flags2 |= TG3_FLG2_HW_TSO_3;
++ else if ((tp->tg3_flags3 & TG3_FLG3_5755_PLUS) ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
+ tp->tg3_flags2 |= TG3_FLG2_HW_TSO_2;
+ else if (tp->tg3_flags2 & TG3_FLG2_5750_PLUS) {
+ tp->tg3_flags2 |= TG3_FLG2_HW_TSO_1 | TG3_FLG2_TSO_BUG;
+@@ -14137,22 +14141,23 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
+ * Firmware TSO on older chips gives lower performance, so it
+ * is off by default, but can be enabled using ethtool.
+ */
+- if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) {
+- if (dev->features & NETIF_F_IP_CSUM)
+- dev->features |= NETIF_F_TSO;
+- if ((dev->features & NETIF_F_IPV6_CSUM) &&
+- (tp->tg3_flags2 & TG3_FLG2_HW_TSO_2))
++ if ((tp->tg3_flags2 & TG3_FLG2_HW_TSO) &&
++ (dev->features & NETIF_F_IP_CSUM))
++ dev->features |= NETIF_F_TSO;
++
++ if ((tp->tg3_flags2 & TG3_FLG2_HW_TSO_2) ||
++ (tp->tg3_flags2 & TG3_FLG2_HW_TSO_3)) {
++ if (dev->features & NETIF_F_IPV6_CSUM)
+ dev->features |= NETIF_F_TSO6;
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 ||
++ if ((tp->tg3_flags2 & TG3_FLG2_HW_TSO_3) ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 ||
+ (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 &&
+ GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5784_AX) ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717)
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780)
+ dev->features |= NETIF_F_TSO_ECN;
+ }
+
+-
+ if (tp->pci_chip_rev_id == CHIPREV_ID_5705_A1 &&
+ !(tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE) &&
+ !(tr32(TG3PCI_PCISTATE) & PCISTATE_BUS_SPEED_HIGH)) {
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 590a692..5fe5760 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -2753,6 +2753,7 @@ struct tg3 {
+ #define TG3_FLG2_SERDES_PREEMPHASIS 0x00020000
+ #define TG3_FLG2_5705_PLUS 0x00040000
+ #define TG3_FLG2_5750_PLUS 0x00080000
++#define TG3_FLG2_HW_TSO_3 0x00100000
+ #define TG3_FLG2_USING_MSI 0x00200000
+ #define TG3_FLG2_USING_MSIX 0x00400000
+ #define TG3_FLG2_USING_MSI_OR_MSIX (TG3_FLG2_USING_MSI | \
+@@ -2764,7 +2765,9 @@ struct tg3 {
+ #define TG3_FLG2_ICH_WORKAROUND 0x02000000
+ #define TG3_FLG2_5780_CLASS 0x04000000
+ #define TG3_FLG2_HW_TSO_2 0x08000000
+-#define TG3_FLG2_HW_TSO (TG3_FLG2_HW_TSO_1 | TG3_FLG2_HW_TSO_2)
++#define TG3_FLG2_HW_TSO (TG3_FLG2_HW_TSO_1 | \
++ TG3_FLG2_HW_TSO_2 | \
++ TG3_FLG2_HW_TSO_3)
+ #define TG3_FLG2_1SHOT_MSI 0x10000000
+ #define TG3_FLG2_PHY_JITTER_BUG 0x20000000
+ #define TG3_FLG2_NO_FWARE_REPORTED 0x40000000
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0028-tg3-Use-tg3_start_xmit_dma_bug-for-5717-A0.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0028-tg3-Use-tg3_start_xmit_dma_bug-for-5717-A0.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,91 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Fri, 13 Nov 2009 13:03:39 +0000
+Subject: [PATCH 028/207] tg3: Use tg3_start_xmit_dma_bug for 5717 A0
+
+commit 615774fe598f8ee971a8dfeb1f2ec4211241c433 upstream.
+
+The A0 revision of the 5717 has problems with short packet fragments.
+It needs to use the tg3_start_xmit_dma_bug() routine.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 27 ++++++++++++++++++---------
+ drivers/net/tg3.h | 1 +
+ 2 files changed, 19 insertions(+), 9 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 9f7129d..47e365f 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -5454,7 +5454,12 @@ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb,
+ IPPROTO_TCP,
+ 0);
+
+- if (tp->tg3_flags2 & TG3_FLG2_HW_TSO_2)
++ if (tp->tg3_flags2 & TG3_FLG2_HW_TSO_3) {
++ mss |= (hdr_len & 0xc) << 12;
++ if (hdr_len & 0x10)
++ base_flags |= 0x00000010;
++ base_flags |= (hdr_len & 0x3e0) << 5;
++ } else if (tp->tg3_flags2 & TG3_FLG2_HW_TSO_2)
+ mss |= hdr_len << 9;
+ else if ((tp->tg3_flags2 & TG3_FLG2_HW_TSO_1) ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705) {
+@@ -5479,6 +5484,10 @@ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb,
+ (vlan_tx_tag_get(skb) << 16));
+ #endif
+
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 &&
++ !mss && skb->len > ETH_DATA_LEN)
++ base_flags |= TXD_FLAG_JMB_PKT;
++
+ if (skb_dma_map(&tp->pdev->dev, skb, DMA_TO_DEVICE)) {
+ dev_kfree_skb(skb);
+ goto out_unlock;
+@@ -12715,13 +12724,12 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ }
+ }
+
+- if (!(tp->tg3_flags3 & TG3_FLG3_5755_PLUS)) {
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
+- tp->tg3_flags3 |= TG3_FLG3_SHORT_DMA_BUG;
+- else {
+- tp->tg3_flags3 |= TG3_FLG3_4G_DMA_BNDRY_BUG;
+- tp->tg3_flags3 |= TG3_FLG3_40BIT_DMA_LIMIT_BUG;
+- }
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
++ tp->tg3_flags3 |= TG3_FLG3_SHORT_DMA_BUG;
++ else if (!(tp->tg3_flags3 & TG3_FLG3_5755_PLUS)) {
++ tp->tg3_flags3 |= TG3_FLG3_4G_DMA_BNDRY_BUG;
++ tp->tg3_flags3 |= TG3_FLG3_40BIT_DMA_LIMIT_BUG;
+ }
+
+ if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS) ||
+@@ -14078,7 +14086,8 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
+ goto err_out_iounmap;
+ }
+
+- if (tp->tg3_flags3 & TG3_FLG3_5755_PLUS)
++ if ((tp->tg3_flags3 & TG3_FLG3_5755_PLUS) &&
++ tp->pci_chip_rev_id != CHIPREV_ID_5717_A0)
+ dev->netdev_ops = &tg3_netdev_ops;
+ else
+ dev->netdev_ops = &tg3_netdev_ops_dma_bug;
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 5fe5760..e7916bd 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -103,6 +103,7 @@
+ #define CHIPREV_ID_5906_A1 0xc001
+ #define CHIPREV_ID_57780_A0 0x57780000
+ #define CHIPREV_ID_57780_A1 0x57780001
++#define CHIPREV_ID_5717_A0 0x05717000
+ #define GET_ASIC_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 12)
+ #define ASIC_REV_5700 0x07
+ #define ASIC_REV_5701 0x00
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0029-tg3-Allow-DMAs-to-cross-cacheline-boundaries.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0029-tg3-Allow-DMAs-to-cross-cacheline-boundaries.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,94 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Fri, 13 Nov 2009 13:03:40 +0000
+Subject: [PATCH 029/207] tg3: Allow DMAs to cross cacheline boundaries
+
+commit cbf9ca6cf8304beb640a948709c4672bc1d5a55f upstream.
+
+By default, the 5717 (and future chips) break up PCIe DMA packets across
+cacheline boundaries. This isn't necessary on x86. This patch
+selectively loosens the restriction.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 20 +++++++++++++++-----
+ drivers/net/tg3.h | 3 +--
+ 2 files changed, 16 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 47e365f..55d536f 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -7294,9 +7294,12 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ if (err)
+ return err;
+
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5784 &&
+- GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5761 &&
+- GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717) {
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) {
++ val = tr32(TG3PCI_DMA_RW_CTRL) &
++ ~DMA_RWCTRL_DIS_CACHE_ALIGNMENT;
++ tw32(TG3PCI_DMA_RW_CTRL, val | tp->dma_rwctrl);
++ } else if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5784 &&
++ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5761) {
+ /* This value is determined during the probe time DMA
+ * engine test, tg3_test_dma.
+ */
+@@ -13330,6 +13333,11 @@ static u32 __devinit tg3_calc_dma_bndry(struct tg3 *tp, u32 val)
+ #endif
+ #endif
+
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) {
++ val = goal ? 0 : DMA_RWCTRL_DIS_CACHE_ALIGNMENT;
++ goto out;
++ }
++
+ if (!goal)
+ goto out;
+
+@@ -13524,7 +13532,7 @@ static int __devinit tg3_test_dma(struct tg3 *tp)
+ {
+ dma_addr_t buf_dma;
+ u32 *buf, saved_dma_rwctrl;
+- int ret;
++ int ret = 0;
+
+ buf = pci_alloc_consistent(tp->pdev, TEST_BUFFER_SIZE, &buf_dma);
+ if (!buf) {
+@@ -13537,6 +13545,9 @@ static int __devinit tg3_test_dma(struct tg3 *tp)
+
+ tp->dma_rwctrl = tg3_calc_dma_bndry(tp, tp->dma_rwctrl);
+
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717)
++ goto out;
++
+ if (tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS) {
+ /* DMA read watermark not used on PCIE */
+ tp->dma_rwctrl |= 0x00180000;
+@@ -13609,7 +13620,6 @@ static int __devinit tg3_test_dma(struct tg3 *tp)
+ tg3_switch_clocks(tp);
+ #endif
+
+- ret = 0;
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5700 &&
+ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5701)
+ goto out;
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index e7916bd..42fefa1 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -142,8 +142,7 @@
+ #define METAL_REV_B1 0x01
+ #define METAL_REV_B2 0x02
+ #define TG3PCI_DMA_RW_CTRL 0x0000006c
+-#define DMA_RWCTRL_MIN_DMA 0x000000ff
+-#define DMA_RWCTRL_MIN_DMA_SHIFT 0
++#define DMA_RWCTRL_DIS_CACHE_ALIGNMENT 0x00000001
+ #define DMA_RWCTRL_READ_BNDRY_MASK 0x00000700
+ #define DMA_RWCTRL_READ_BNDRY_DISAB 0x00000000
+ #define DMA_RWCTRL_READ_BNDRY_16 0x00000100
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0030-tg3-Create-tg3_poll_msix-for-non-zero-MSIX-vecs.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0030-tg3-Create-tg3_poll_msix-for-non-zero-MSIX-vecs.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,142 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Fri, 13 Nov 2009 13:03:41 +0000
+Subject: [PATCH 030/207] tg3: Create tg3_poll_msix() for non-zero MSIX vecs
+
+commit 35f2d7d0d7c222a580da0ed91c8d70c54267620a upstream.
+
+This patch gives all non-zero MSIX vectors their own NAPI handler. This
+will make NAPI handling for those vectors slightly more efficient.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++------
+ 1 files changed, 60 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 55d536f..8e39e91 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -4706,18 +4706,17 @@ next_pkt_nopost:
+ return received;
+ }
+
+-static int tg3_poll_work(struct tg3_napi *tnapi, int work_done, int budget)
++static void tg3_poll_link(struct tg3 *tp)
+ {
+- struct tg3 *tp = tnapi->tp;
+- struct tg3_hw_status *sblk = tnapi->hw_status;
+-
+ /* handle link change and other phy events */
+ if (!(tp->tg3_flags &
+ (TG3_FLAG_USE_LINKCHG_REG |
+ TG3_FLAG_POLL_SERDES))) {
++ struct tg3_hw_status *sblk = tp->napi[0].hw_status;
++
+ if (sblk->status & SD_STATUS_LINK_CHG) {
+ sblk->status = SD_STATUS_UPDATED |
+- (sblk->status & ~SD_STATUS_LINK_CHG);
++ (sblk->status & ~SD_STATUS_LINK_CHG);
+ spin_lock(&tp->lock);
+ if (tp->tg3_flags3 & TG3_FLG3_USE_PHYLIB) {
+ tw32_f(MAC_STATUS,
+@@ -4731,6 +4730,11 @@ static int tg3_poll_work(struct tg3_napi *tnapi, int work_done, int budget)
+ spin_unlock(&tp->lock);
+ }
+ }
++}
++
++static int tg3_poll_work(struct tg3_napi *tnapi, int work_done, int budget)
++{
++ struct tg3 *tp = tnapi->tp;
+
+ /* run TX completion thread */
+ if (tnapi->hw_status->idx[0].tx_consumer != tnapi->tx_cons) {
+@@ -4749,6 +4753,50 @@ static int tg3_poll_work(struct tg3_napi *tnapi, int work_done, int budget)
+ return work_done;
+ }
+
++static int tg3_poll_msix(struct napi_struct *napi, int budget)
++{
++ struct tg3_napi *tnapi = container_of(napi, struct tg3_napi, napi);
++ struct tg3 *tp = tnapi->tp;
++ int work_done = 0;
++ struct tg3_hw_status *sblk = tnapi->hw_status;
++
++ while (1) {
++ work_done = tg3_poll_work(tnapi, work_done, budget);
++
++ if (unlikely(tp->tg3_flags & TG3_FLAG_TX_RECOVERY_PENDING))
++ goto tx_recovery;
++
++ if (unlikely(work_done >= budget))
++ break;
++
++ /* tp->last_tag is used in tg3_restart_ints() below
++ * to tell the hw how much work has been processed,
++ * so we must read it before checking for more work.
++ */
++ tnapi->last_tag = sblk->status_tag;
++ tnapi->last_irq_tag = tnapi->last_tag;
++ rmb();
++
++ /* check for RX/TX work to do */
++ if (sblk->idx[0].tx_consumer == tnapi->tx_cons &&
++ *(tnapi->rx_rcb_prod_idx) == tnapi->rx_rcb_ptr) {
++ napi_complete(napi);
++ /* Reenable interrupts. */
++ tw32_mailbox(tnapi->int_mbox, tnapi->last_tag << 24);
++ mmiowb();
++ break;
++ }
++ }
++
++ return work_done;
++
++tx_recovery:
++ /* work_done is guaranteed to be less than budget. */
++ napi_complete(napi);
++ schedule_work(&tp->reset_task);
++ return work_done;
++}
++
+ static int tg3_poll(struct napi_struct *napi, int budget)
+ {
+ struct tg3_napi *tnapi = container_of(napi, struct tg3_napi, napi);
+@@ -4757,6 +4805,8 @@ static int tg3_poll(struct napi_struct *napi, int budget)
+ struct tg3_hw_status *sblk = tnapi->hw_status;
+
+ while (1) {
++ tg3_poll_link(tp);
++
+ work_done = tg3_poll_work(tnapi, work_done, budget);
+
+ if (unlikely(tp->tg3_flags & TG3_FLAG_TX_RECOVERY_PENDING))
+@@ -14058,10 +14108,13 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
+ tnapi->consmbox = rcvmbx;
+ tnapi->prodmbox = sndmbx;
+
+- if (i)
++ if (i) {
+ tnapi->coal_now = HOSTCC_MODE_COAL_VEC1_NOW << (i - 1);
+- else
++ netif_napi_add(dev, &tnapi->napi, tg3_poll_msix, 64);
++ } else {
+ tnapi->coal_now = HOSTCC_MODE_NOW;
++ netif_napi_add(dev, &tnapi->napi, tg3_poll, 64);
++ }
+
+ if (!(tp->tg3_flags & TG3_FLAG_SUPPORT_MSIX))
+ break;
+@@ -14084,7 +14137,6 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
+ sndmbx += 0xc;
+ }
+
+- netif_napi_add(dev, &tp->napi[0].napi, tg3_poll, 64);
+ dev->ethtool_ops = &tg3_ethtool_ops;
+ dev->watchdog_timeo = TG3_TX_TIMEOUT;
+ dev->irq = pdev->irq;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0031-tg3-Move-napi_add-calls-below-tg3_get_invariants.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0031-tg3-Move-napi_add-calls-below-tg3_get_invariants.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,134 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Fri, 13 Nov 2009 13:03:42 +0000
+Subject: [PATCH 031/207] tg3: Move napi_add calls below tg3_get_invariants
+
+commit 78f90dcf184b8225a24217605c4289f1986451a3 upstream.
+
+tg3_get_invariants(), among other things, discovers whether or not
+the device is MSI-X capable and how many interrupts it supports.
+This discovery needs to happen before registering NAPI instances with
+netdev. This patch moves the code block that calls napi_add later in
+tg3_init_one() so that tg3_get_invariants() has a chance to run first.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 94 ++++++++++++++++++++++++++--------------------------
+ 1 files changed, 47 insertions(+), 47 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 8e39e91..05bd983 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -14090,53 +14090,6 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
+ tp->rx_pending = TG3_DEF_RX_RING_PENDING;
+ tp->rx_jumbo_pending = TG3_DEF_RX_JUMBO_RING_PENDING;
+
+- intmbx = MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW;
+- rcvmbx = MAILBOX_RCVRET_CON_IDX_0 + TG3_64BIT_REG_LOW;
+- sndmbx = MAILBOX_SNDHOST_PROD_IDX_0 + TG3_64BIT_REG_LOW;
+- for (i = 0; i < TG3_IRQ_MAX_VECS; i++) {
+- struct tg3_napi *tnapi = &tp->napi[i];
+-
+- tnapi->tp = tp;
+- tnapi->tx_pending = TG3_DEF_TX_RING_PENDING;
+-
+- tnapi->int_mbox = intmbx;
+- if (i < 4)
+- intmbx += 0x8;
+- else
+- intmbx += 0x4;
+-
+- tnapi->consmbox = rcvmbx;
+- tnapi->prodmbox = sndmbx;
+-
+- if (i) {
+- tnapi->coal_now = HOSTCC_MODE_COAL_VEC1_NOW << (i - 1);
+- netif_napi_add(dev, &tnapi->napi, tg3_poll_msix, 64);
+- } else {
+- tnapi->coal_now = HOSTCC_MODE_NOW;
+- netif_napi_add(dev, &tnapi->napi, tg3_poll, 64);
+- }
+-
+- if (!(tp->tg3_flags & TG3_FLAG_SUPPORT_MSIX))
+- break;
+-
+- /*
+- * If we support MSIX, we'll be using RSS. If we're using
+- * RSS, the first vector only handles link interrupts and the
+- * remaining vectors handle rx and tx interrupts. Reuse the
+- * mailbox values for the next iteration. The values we setup
+- * above are still useful for the single vectored mode.
+- */
+- if (!i)
+- continue;
+-
+- rcvmbx += 0x8;
+-
+- if (sndmbx & 0x4)
+- sndmbx -= 0x4;
+- else
+- sndmbx += 0xc;
+- }
+-
+ dev->ethtool_ops = &tg3_ethtool_ops;
+ dev->watchdog_timeo = TG3_TX_TIMEOUT;
+ dev->irq = pdev->irq;
+@@ -14279,6 +14232,53 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
+ tp->tg3_flags |= TG3_FLAG_PAUSE_AUTONEG;
+ tp->link_config.flowctrl = FLOW_CTRL_TX | FLOW_CTRL_RX;
+
++ intmbx = MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW;
++ rcvmbx = MAILBOX_RCVRET_CON_IDX_0 + TG3_64BIT_REG_LOW;
++ sndmbx = MAILBOX_SNDHOST_PROD_IDX_0 + TG3_64BIT_REG_LOW;
++ for (i = 0; i < TG3_IRQ_MAX_VECS; i++) {
++ struct tg3_napi *tnapi = &tp->napi[i];
++
++ tnapi->tp = tp;
++ tnapi->tx_pending = TG3_DEF_TX_RING_PENDING;
++
++ tnapi->int_mbox = intmbx;
++ if (i < 4)
++ intmbx += 0x8;
++ else
++ intmbx += 0x4;
++
++ tnapi->consmbox = rcvmbx;
++ tnapi->prodmbox = sndmbx;
++
++ if (i) {
++ tnapi->coal_now = HOSTCC_MODE_COAL_VEC1_NOW << (i - 1);
++ netif_napi_add(dev, &tnapi->napi, tg3_poll_msix, 64);
++ } else {
++ tnapi->coal_now = HOSTCC_MODE_NOW;
++ netif_napi_add(dev, &tnapi->napi, tg3_poll, 64);
++ }
++
++ if (!(tp->tg3_flags & TG3_FLAG_SUPPORT_MSIX))
++ break;
++
++ /*
++ * If we support MSIX, we'll be using RSS. If we're using
++ * RSS, the first vector only handles link interrupts and the
++ * remaining vectors handle rx and tx interrupts. Reuse the
++ * mailbox values for the next iteration. The values we setup
++ * above are still useful for the single vectored mode.
++ */
++ if (!i)
++ continue;
++
++ rcvmbx += 0x8;
++
++ if (sndmbx & 0x4)
++ sndmbx -= 0x4;
++ else
++ sndmbx += 0xc;
++ }
++
+ tg3_init_coal(tp);
+
+ pci_set_drvdata(pdev, dev);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0032-tg3-Make-tg3_alloc_rx_skb-a-dst-only-operation.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0032-tg3-Make-tg3_alloc_rx_skb-a-dst-only-operation.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,119 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Fri, 13 Nov 2009 13:03:43 +0000
+Subject: [PATCH 032/207] tg3: Make tg3_alloc_rx_skb() a dst-only operation
+
+commit afc081f83c59a7cf2c025a3ed89d011b5db556eb upstream.
+
+This patch removes the source index parameter of tg3_alloc_rx_skb(). A
+later patch will make it possible for the source and destination
+producer rings to be different. This patch opts to make
+tg3_alloc_rx_skb() a destination-only implementation and move the code
+sensitive to the difference elsewhere.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 22 +++++++++-------------
+ 1 files changed, 9 insertions(+), 13 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 05bd983..5ac7292 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -4409,7 +4409,7 @@ static void tg3_tx(struct tg3_napi *tnapi)
+ * (to fetch the error flags, vlan tag, checksum, and opaque cookie).
+ */
+ static int tg3_alloc_rx_skb(struct tg3_napi *tnapi, u32 opaque_key,
+- int src_idx, u32 dest_idx_unmasked)
++ u32 dest_idx_unmasked)
+ {
+ struct tg3 *tp = tnapi->tp;
+ struct tg3_rx_buffer_desc *desc;
+@@ -4425,8 +4425,6 @@ static int tg3_alloc_rx_skb(struct tg3_napi *tnapi, u32 opaque_key,
+ dest_idx = dest_idx_unmasked % TG3_RX_RING_SIZE;
+ desc = &tpr->rx_std[dest_idx];
+ map = &tpr->rx_std_buffers[dest_idx];
+- if (src_idx >= 0)
+- src_map = &tpr->rx_std_buffers[src_idx];
+ skb_size = tp->rx_pkt_map_sz;
+ break;
+
+@@ -4434,8 +4432,6 @@ static int tg3_alloc_rx_skb(struct tg3_napi *tnapi, u32 opaque_key,
+ dest_idx = dest_idx_unmasked % TG3_RX_JUMBO_RING_SIZE;
+ desc = &tpr->rx_jmb[dest_idx].std;
+ map = &tpr->rx_jmb_buffers[dest_idx];
+- if (src_idx >= 0)
+- src_map = &tpr->rx_jmb_buffers[src_idx];
+ skb_size = TG3_RX_JMB_MAP_SZ;
+ break;
+
+@@ -4465,9 +4461,6 @@ static int tg3_alloc_rx_skb(struct tg3_napi *tnapi, u32 opaque_key,
+ map->skb = skb;
+ pci_unmap_addr_set(map, mapping, mapping);
+
+- if (src_map != NULL)
+- src_map->skb = NULL;
+-
+ desc->addr_hi = ((u64)mapping >> 32);
+ desc->addr_lo = ((u64)mapping & 0xffffffff);
+
+@@ -4559,6 +4552,7 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)
+ work_mask = 0;
+ received = 0;
+ while (sw_idx != hw_idx && budget > 0) {
++ struct ring_info *ri;
+ struct tg3_rx_buffer_desc *desc = &tnapi->rx_rcb[sw_idx];
+ unsigned int len;
+ struct sk_buff *skb;
+@@ -4568,13 +4562,13 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)
+ desc_idx = desc->opaque & RXD_OPAQUE_INDEX_MASK;
+ opaque_key = desc->opaque & RXD_OPAQUE_RING_MASK;
+ if (opaque_key == RXD_OPAQUE_RING_STD) {
+- struct ring_info *ri = &tpr->rx_std_buffers[desc_idx];
++ ri = &tpr->rx_std_buffers[desc_idx];
+ dma_addr = pci_unmap_addr(ri, mapping);
+ skb = ri->skb;
+ post_ptr = &tpr->rx_std_ptr;
+ rx_std_posted++;
+ } else if (opaque_key == RXD_OPAQUE_RING_JUMBO) {
+- struct ring_info *ri = &tpr->rx_jmb_buffers[desc_idx];
++ ri = &tpr->rx_jmb_buffers[desc_idx];
+ dma_addr = pci_unmap_addr(ri, mapping);
+ skb = ri->skb;
+ post_ptr = &tpr->rx_jmb_ptr;
+@@ -4607,10 +4601,12 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)
+ int skb_size;
+
+ skb_size = tg3_alloc_rx_skb(tnapi, opaque_key,
+- desc_idx, *post_ptr);
++ *post_ptr);
+ if (skb_size < 0)
+ goto drop_it;
+
++ ri->skb = NULL;
++
+ pci_unmap_single(tp->pdev, dma_addr, skb_size,
+ PCI_DMA_FROMDEVICE);
+
+@@ -5774,7 +5770,7 @@ static int tg3_rx_prodring_alloc(struct tg3 *tp,
+
+ /* Now allocate fresh SKBs for each rx ring. */
+ for (i = 0; i < tp->rx_pending; i++) {
+- if (tg3_alloc_rx_skb(tnapi, RXD_OPAQUE_RING_STD, -1, i) < 0) {
++ if (tg3_alloc_rx_skb(tnapi, RXD_OPAQUE_RING_STD, i) < 0) {
+ printk(KERN_WARNING PFX
+ "%s: Using a smaller RX standard ring, "
+ "only %d out of %d buffers were allocated "
+@@ -5806,7 +5802,7 @@ static int tg3_rx_prodring_alloc(struct tg3 *tp,
+
+ for (i = 0; i < tp->rx_jumbo_pending; i++) {
+ if (tg3_alloc_rx_skb(tnapi, RXD_OPAQUE_RING_JUMBO,
+- -1, i) < 0) {
++ i) < 0) {
+ printk(KERN_WARNING PFX
+ "%s: Using a smaller RX jumbo ring, "
+ "only %d out of %d buffers were "
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0033-tg3-Add-prodring-parameter-to-tg3_alloc_rx_skb.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0033-tg3-Add-prodring-parameter-to-tg3_alloc_rx_skb.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,141 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Fri, 13 Nov 2009 13:03:44 +0000
+Subject: [PATCH 033/207] tg3: Add prodring parameter to tg3_alloc_rx_skb()
+
+commit a3896167160ce9ad1eadeb88fd2f3971888444ae upstream.
+
+This patch changes the tg3_alloc_rx_skb() implementation to accept the
+destination producer ring set pointer as a parameter rather than
+assuming the source and destination producer rings are the same.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 41 +++++++++++++++++++++--------------------
+ 1 files changed, 21 insertions(+), 20 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 5ac7292..01d9a67 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -4408,8 +4408,9 @@ static void tg3_tx(struct tg3_napi *tnapi)
+ * buffers the cpu only reads the last cacheline of the RX descriptor
+ * (to fetch the error flags, vlan tag, checksum, and opaque cookie).
+ */
+-static int tg3_alloc_rx_skb(struct tg3_napi *tnapi, u32 opaque_key,
+- u32 dest_idx_unmasked)
++static int tg3_alloc_rx_skb(struct tg3_napi *tnapi,
++ struct tg3_rx_prodring_set *tpr,
++ u32 opaque_key, u32 dest_idx_unmasked)
+ {
+ struct tg3 *tp = tnapi->tp;
+ struct tg3_rx_buffer_desc *desc;
+@@ -4417,7 +4418,6 @@ static int tg3_alloc_rx_skb(struct tg3_napi *tnapi, u32 opaque_key,
+ struct sk_buff *skb;
+ dma_addr_t mapping;
+ int skb_size, dest_idx;
+- struct tg3_rx_prodring_set *tpr = &tp->prodring[0];
+
+ src_map = NULL;
+ switch (opaque_key) {
+@@ -4471,30 +4471,32 @@ static int tg3_alloc_rx_skb(struct tg3_napi *tnapi, u32 opaque_key,
+ * members of the RX descriptor are invariant. See notes above
+ * tg3_alloc_rx_skb for full details.
+ */
+-static void tg3_recycle_rx(struct tg3_napi *tnapi, u32 opaque_key,
+- int src_idx, u32 dest_idx_unmasked)
++static void tg3_recycle_rx(struct tg3_napi *tnapi,
++ struct tg3_rx_prodring_set *dpr,
++ u32 opaque_key, int src_idx,
++ u32 dest_idx_unmasked)
+ {
+ struct tg3 *tp = tnapi->tp;
+ struct tg3_rx_buffer_desc *src_desc, *dest_desc;
+ struct ring_info *src_map, *dest_map;
+ int dest_idx;
+- struct tg3_rx_prodring_set *tpr = &tp->prodring[0];
++ struct tg3_rx_prodring_set *spr = &tp->prodring[0];
+
+ switch (opaque_key) {
+ case RXD_OPAQUE_RING_STD:
+ dest_idx = dest_idx_unmasked % TG3_RX_RING_SIZE;
+- dest_desc = &tpr->rx_std[dest_idx];
+- dest_map = &tpr->rx_std_buffers[dest_idx];
+- src_desc = &tpr->rx_std[src_idx];
+- src_map = &tpr->rx_std_buffers[src_idx];
++ dest_desc = &dpr->rx_std[dest_idx];
++ dest_map = &dpr->rx_std_buffers[dest_idx];
++ src_desc = &spr->rx_std[src_idx];
++ src_map = &spr->rx_std_buffers[src_idx];
+ break;
+
+ case RXD_OPAQUE_RING_JUMBO:
+ dest_idx = dest_idx_unmasked % TG3_RX_JUMBO_RING_SIZE;
+- dest_desc = &tpr->rx_jmb[dest_idx].std;
+- dest_map = &tpr->rx_jmb_buffers[dest_idx];
+- src_desc = &tpr->rx_jmb[src_idx].std;
+- src_map = &tpr->rx_jmb_buffers[src_idx];
++ dest_desc = &dpr->rx_jmb[dest_idx].std;
++ dest_map = &dpr->rx_jmb_buffers[dest_idx];
++ src_desc = &spr->rx_jmb[src_idx].std;
++ src_map = &spr->rx_jmb_buffers[src_idx];
+ break;
+
+ default:
+@@ -4506,7 +4508,6 @@ static void tg3_recycle_rx(struct tg3_napi *tnapi, u32 opaque_key,
+ pci_unmap_addr(src_map, mapping));
+ dest_desc->addr_hi = src_desc->addr_hi;
+ dest_desc->addr_lo = src_desc->addr_lo;
+-
+ src_map->skb = NULL;
+ }
+
+@@ -4580,7 +4581,7 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)
+ if ((desc->err_vlan & RXD_ERR_MASK) != 0 &&
+ (desc->err_vlan != RXD_ERR_ODD_NIBBLE_RCVD_MII)) {
+ drop_it:
+- tg3_recycle_rx(tnapi, opaque_key,
++ tg3_recycle_rx(tnapi, tpr, opaque_key,
+ desc_idx, *post_ptr);
+ drop_it_no_recycle:
+ /* Other statistics kept track of by card. */
+@@ -4600,7 +4601,7 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)
+ ) {
+ int skb_size;
+
+- skb_size = tg3_alloc_rx_skb(tnapi, opaque_key,
++ skb_size = tg3_alloc_rx_skb(tnapi, tpr, opaque_key,
+ *post_ptr);
+ if (skb_size < 0)
+ goto drop_it;
+@@ -4614,7 +4615,7 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)
+ } else {
+ struct sk_buff *copy_skb;
+
+- tg3_recycle_rx(tnapi, opaque_key,
++ tg3_recycle_rx(tnapi, tpr, opaque_key,
+ desc_idx, *post_ptr);
+
+ copy_skb = netdev_alloc_skb(tp->dev,
+@@ -5770,7 +5771,7 @@ static int tg3_rx_prodring_alloc(struct tg3 *tp,
+
+ /* Now allocate fresh SKBs for each rx ring. */
+ for (i = 0; i < tp->rx_pending; i++) {
+- if (tg3_alloc_rx_skb(tnapi, RXD_OPAQUE_RING_STD, i) < 0) {
++ if (tg3_alloc_rx_skb(tnapi, tpr, RXD_OPAQUE_RING_STD, i) < 0) {
+ printk(KERN_WARNING PFX
+ "%s: Using a smaller RX standard ring, "
+ "only %d out of %d buffers were allocated "
+@@ -5801,7 +5802,7 @@ static int tg3_rx_prodring_alloc(struct tg3 *tp,
+ }
+
+ for (i = 0; i < tp->rx_jumbo_pending; i++) {
+- if (tg3_alloc_rx_skb(tnapi, RXD_OPAQUE_RING_JUMBO,
++ if (tg3_alloc_rx_skb(tnapi, tpr, RXD_OPAQUE_RING_JUMBO,
+ i) < 0) {
+ printk(KERN_WARNING PFX
+ "%s: Using a smaller RX jumbo ring, "
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0034-tg3-tg3_alloc_rx_skb-tnapi-tp.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0034-tg3-tg3_alloc_rx_skb-tnapi-tp.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,71 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Fri, 13 Nov 2009 13:03:45 +0000
+Subject: [PATCH 034/207] tg3: tg3_alloc_rx_skb(tnapi => tp)
+
+commit 86b21e59c9a65c8e46d35ac6c4220f63639828c6 upstream.
+
+This patch converts the tnapi argument of tg3_alloc_rx_skb() to tp. The
+level of indirection is unnecessary.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 11 ++++-------
+ 1 files changed, 4 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 01d9a67..9db23b3 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -4408,11 +4408,9 @@ static void tg3_tx(struct tg3_napi *tnapi)
+ * buffers the cpu only reads the last cacheline of the RX descriptor
+ * (to fetch the error flags, vlan tag, checksum, and opaque cookie).
+ */
+-static int tg3_alloc_rx_skb(struct tg3_napi *tnapi,
+- struct tg3_rx_prodring_set *tpr,
++static int tg3_alloc_rx_skb(struct tg3 *tp, struct tg3_rx_prodring_set *tpr,
+ u32 opaque_key, u32 dest_idx_unmasked)
+ {
+- struct tg3 *tp = tnapi->tp;
+ struct tg3_rx_buffer_desc *desc;
+ struct ring_info *map, *src_map;
+ struct sk_buff *skb;
+@@ -4601,7 +4599,7 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)
+ ) {
+ int skb_size;
+
+- skb_size = tg3_alloc_rx_skb(tnapi, tpr, opaque_key,
++ skb_size = tg3_alloc_rx_skb(tp, tpr, opaque_key,
+ *post_ptr);
+ if (skb_size < 0)
+ goto drop_it;
+@@ -5744,7 +5742,6 @@ static int tg3_rx_prodring_alloc(struct tg3 *tp,
+ struct tg3_rx_prodring_set *tpr)
+ {
+ u32 i, rx_pkt_dma_sz;
+- struct tg3_napi *tnapi = &tp->napi[0];
+
+ /* Zero out all descriptors. */
+ memset(tpr->rx_std, 0, TG3_RX_RING_BYTES);
+@@ -5771,7 +5768,7 @@ static int tg3_rx_prodring_alloc(struct tg3 *tp,
+
+ /* Now allocate fresh SKBs for each rx ring. */
+ for (i = 0; i < tp->rx_pending; i++) {
+- if (tg3_alloc_rx_skb(tnapi, tpr, RXD_OPAQUE_RING_STD, i) < 0) {
++ if (tg3_alloc_rx_skb(tp, tpr, RXD_OPAQUE_RING_STD, i) < 0) {
+ printk(KERN_WARNING PFX
+ "%s: Using a smaller RX standard ring, "
+ "only %d out of %d buffers were allocated "
+@@ -5802,7 +5799,7 @@ static int tg3_rx_prodring_alloc(struct tg3 *tp,
+ }
+
+ for (i = 0; i < tp->rx_jumbo_pending; i++) {
+- if (tg3_alloc_rx_skb(tnapi, tpr, RXD_OPAQUE_RING_JUMBO,
++ if (tg3_alloc_rx_skb(tp, tpr, RXD_OPAQUE_RING_JUMBO,
+ i) < 0) {
+ printk(KERN_WARNING PFX
+ "%s: Using a smaller RX jumbo ring, "
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0035-tg3-rename-rx_-std-jmb-_ptr.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0035-tg3-rename-rx_-std-jmb-_ptr.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,90 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Fri, 13 Nov 2009 13:03:46 +0000
+Subject: [PATCH 035/207] tg3: rename rx_[std|jmb]_ptr
+
+commit 411da6407e778bf946911df08bb5afc505422f31 upstream.
+
+A later patch is going to add consumer indicies for the producer rings.
+To keep things readable, this patch renames rx_[std|jmb]_ptr to
+rx_[std|jmb]_prod_idx.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 16 ++++++++--------
+ drivers/net/tg3.h | 4 ++--
+ 2 files changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 9db23b3..ef08f18 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -4564,13 +4564,13 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)
+ ri = &tpr->rx_std_buffers[desc_idx];
+ dma_addr = pci_unmap_addr(ri, mapping);
+ skb = ri->skb;
+- post_ptr = &tpr->rx_std_ptr;
++ post_ptr = &tpr->rx_std_prod_idx;
+ rx_std_posted++;
+ } else if (opaque_key == RXD_OPAQUE_RING_JUMBO) {
+ ri = &tpr->rx_jmb_buffers[desc_idx];
+ dma_addr = pci_unmap_addr(ri, mapping);
+ skb = ri->skb;
+- post_ptr = &tpr->rx_jmb_ptr;
++ post_ptr = &tpr->rx_jmb_prod_idx;
+ } else
+ goto next_pkt_nopost;
+
+@@ -4687,12 +4687,12 @@ next_pkt_nopost:
+
+ /* Refill RX ring(s). */
+ if (work_mask & RXD_OPAQUE_RING_STD) {
+- sw_idx = tpr->rx_std_ptr % TG3_RX_RING_SIZE;
++ sw_idx = tpr->rx_std_prod_idx % TG3_RX_RING_SIZE;
+ tw32_rx_mbox(MAILBOX_RCV_STD_PROD_IDX + TG3_64BIT_REG_LOW,
+ sw_idx);
+ }
+ if (work_mask & RXD_OPAQUE_RING_JUMBO) {
+- sw_idx = tpr->rx_jmb_ptr % TG3_RX_JUMBO_RING_SIZE;
++ sw_idx = tpr->rx_jmb_prod_idx % TG3_RX_JUMBO_RING_SIZE;
+ tw32_rx_mbox(MAILBOX_RCV_JUMBO_PROD_IDX + TG3_64BIT_REG_LOW,
+ sw_idx);
+ }
+@@ -7509,14 +7509,14 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+
+ tw32(RCVDBDI_STD_BD + TG3_BDINFO_MAXLEN_FLAGS, val);
+
+- tpr->rx_std_ptr = tp->rx_pending;
++ tpr->rx_std_prod_idx = tp->rx_pending;
+ tw32_rx_mbox(MAILBOX_RCV_STD_PROD_IDX + TG3_64BIT_REG_LOW,
+- tpr->rx_std_ptr);
++ tpr->rx_std_prod_idx);
+
+- tpr->rx_jmb_ptr = (tp->tg3_flags & TG3_FLAG_JUMBO_RING_ENABLE) ?
++ tpr->rx_jmb_prod_idx = (tp->tg3_flags & TG3_FLAG_JUMBO_RING_ENABLE) ?
+ tp->rx_jumbo_pending : 0;
+ tw32_rx_mbox(MAILBOX_RCV_JUMBO_PROD_IDX + TG3_64BIT_REG_LOW,
+- tpr->rx_jmb_ptr);
++ tpr->rx_jmb_prod_idx);
+
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) {
+ tw32(STD_REPLENISH_LWM, 32);
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 42fefa1..e0b86ba 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -2570,8 +2570,8 @@ struct tg3_ethtool_stats {
+ };
+
+ struct tg3_rx_prodring_set {
+- u32 rx_std_ptr;
+- u32 rx_jmb_ptr;
++ u32 rx_std_prod_idx;
++ u32 rx_jmb_prod_idx;
+ struct tg3_rx_buffer_desc *rx_std;
+ struct tg3_ext_rx_buffer_desc *rx_jmb;
+ struct ring_info *rx_std_buffers;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0036-tg3-Consider-rx_std_prod_idx-a-hw-mailbox.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0036-tg3-Consider-rx_std_prod_idx-a-hw-mailbox.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,77 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Fri, 13 Nov 2009 13:03:47 +0000
+Subject: [PATCH 036/207] tg3: Consider rx_std_prod_idx a hw mailbox
+
+commit 4361935afe3abc3e5a93006b99197fac1fabbd50 upstream.
+
+This patch changes how the code uses the rx_std_prod_idx member. In the
+following patch, the code will be changed so that it will act just like
+a hardware mailbox. This patch prepares the code so that memory barriers
+can be more easily inserted.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 15 +++++++++------
+ 1 files changed, 9 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index ef08f18..726dbbe 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -4537,6 +4537,7 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)
+ {
+ struct tg3 *tp = tnapi->tp;
+ u32 work_mask, rx_std_posted = 0;
++ u32 std_prod_idx, jmb_prod_idx;
+ u32 sw_idx = tnapi->rx_rcb_ptr;
+ u16 hw_idx;
+ int received;
+@@ -4550,6 +4551,8 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)
+ rmb();
+ work_mask = 0;
+ received = 0;
++ std_prod_idx = tpr->rx_std_prod_idx;
++ jmb_prod_idx = tpr->rx_jmb_prod_idx;
+ while (sw_idx != hw_idx && budget > 0) {
+ struct ring_info *ri;
+ struct tg3_rx_buffer_desc *desc = &tnapi->rx_rcb[sw_idx];
+@@ -4564,13 +4567,13 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)
+ ri = &tpr->rx_std_buffers[desc_idx];
+ dma_addr = pci_unmap_addr(ri, mapping);
+ skb = ri->skb;
+- post_ptr = &tpr->rx_std_prod_idx;
++ post_ptr = &std_prod_idx;
+ rx_std_posted++;
+ } else if (opaque_key == RXD_OPAQUE_RING_JUMBO) {
+ ri = &tpr->rx_jmb_buffers[desc_idx];
+ dma_addr = pci_unmap_addr(ri, mapping);
+ skb = ri->skb;
+- post_ptr = &tpr->rx_jmb_prod_idx;
++ post_ptr = &jmb_prod_idx;
+ } else
+ goto next_pkt_nopost;
+
+@@ -4687,14 +4690,14 @@ next_pkt_nopost:
+
+ /* Refill RX ring(s). */
+ if (work_mask & RXD_OPAQUE_RING_STD) {
+- sw_idx = tpr->rx_std_prod_idx % TG3_RX_RING_SIZE;
++ tpr->rx_std_prod_idx = std_prod_idx % TG3_RX_RING_SIZE;
+ tw32_rx_mbox(MAILBOX_RCV_STD_PROD_IDX + TG3_64BIT_REG_LOW,
+- sw_idx);
++ tpr->rx_std_prod_idx);
+ }
+ if (work_mask & RXD_OPAQUE_RING_JUMBO) {
+- sw_idx = tpr->rx_jmb_prod_idx % TG3_RX_JUMBO_RING_SIZE;
++ tpr->rx_jmb_prod_idx = jmb_prod_idx % TG3_RX_JUMBO_RING_SIZE;
+ tw32_rx_mbox(MAILBOX_RCV_JUMBO_PROD_IDX + TG3_64BIT_REG_LOW,
+- sw_idx);
++ tpr->rx_jmb_prod_idx);
+ }
+ mmiowb();
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0037-tg3-Lay-proucer-ring-handling-groundwork.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0037-tg3-Lay-proucer-ring-handling-groundwork.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,199 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Fri, 13 Nov 2009 13:03:48 +0000
+Subject: [PATCH 037/207] tg3: Lay proucer ring handling groundwork
+
+commit 2b2cdb65bec42d38268b2ac115876b066afa7f95 upstream.
+
+The patch increases the number of producer rings available and
+implements the constructor and destructor code that deals with them.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 85 ++++++++++++++++++++++++++++++----------------------
+ drivers/net/tg3.h | 2 +-
+ 2 files changed, 50 insertions(+), 37 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 726dbbe..72d622a 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -137,6 +137,12 @@
+ #define TG3_RX_STD_MAP_SZ TG3_RX_DMA_TO_MAP_SZ(TG3_RX_STD_DMA_SZ)
+ #define TG3_RX_JMB_MAP_SZ TG3_RX_DMA_TO_MAP_SZ(TG3_RX_JMB_DMA_SZ)
+
++#define TG3_RX_STD_BUFF_RING_SIZE \
++ (sizeof(struct ring_info) * TG3_RX_RING_SIZE)
++
++#define TG3_RX_JMB_BUFF_RING_SIZE \
++ (sizeof(struct ring_info) * TG3_RX_JUMBO_RING_SIZE)
++
+ /* minimum number of free TX descriptors required to wake up TX process */
+ #define TG3_TX_WAKEUP_THRESH(tnapi) ((tnapi)->tx_pending / 4)
+
+@@ -4397,6 +4403,17 @@ static void tg3_tx(struct tg3_napi *tnapi)
+ }
+ }
+
++static void tg3_rx_skb_free(struct tg3 *tp, struct ring_info *ri, u32 map_sz)
++{
++ if (!ri->skb)
++ return;
++
++ pci_unmap_single(tp->pdev, pci_unmap_addr(ri, mapping),
++ map_sz, PCI_DMA_FROMDEVICE);
++ dev_kfree_skb_any(ri->skb);
++ ri->skb = NULL;
++}
++
+ /* Returns size of skb allocated or < 0 on error.
+ *
+ * We only need to fill in the address because the other members
+@@ -5701,36 +5718,18 @@ static void tg3_rx_prodring_free(struct tg3 *tp,
+ struct tg3_rx_prodring_set *tpr)
+ {
+ int i;
+- struct ring_info *rxp;
+
+- for (i = 0; i < TG3_RX_RING_SIZE; i++) {
+- rxp = &tpr->rx_std_buffers[i];
++ if (tpr != &tp->prodring[0])
++ return;
+
+- if (rxp->skb == NULL)
+- continue;
+-
+- pci_unmap_single(tp->pdev,
+- pci_unmap_addr(rxp, mapping),
+- tp->rx_pkt_map_sz,
+- PCI_DMA_FROMDEVICE);
+- dev_kfree_skb_any(rxp->skb);
+- rxp->skb = NULL;
+- }
++ for (i = 0; i < TG3_RX_RING_SIZE; i++)
++ tg3_rx_skb_free(tp, &tpr->rx_std_buffers[i],
++ tp->rx_pkt_map_sz);
+
+ if (tp->tg3_flags & TG3_FLAG_JUMBO_CAPABLE) {
+- for (i = 0; i < TG3_RX_JUMBO_RING_SIZE; i++) {
+- rxp = &tpr->rx_jmb_buffers[i];
+-
+- if (rxp->skb == NULL)
+- continue;
+-
+- pci_unmap_single(tp->pdev,
+- pci_unmap_addr(rxp, mapping),
+- TG3_RX_JMB_MAP_SZ,
+- PCI_DMA_FROMDEVICE);
+- dev_kfree_skb_any(rxp->skb);
+- rxp->skb = NULL;
+- }
++ for (i = 0; i < TG3_RX_JUMBO_RING_SIZE; i++)
++ tg3_rx_skb_free(tp, &tpr->rx_jmb_buffers[i],
++ TG3_RX_JMB_MAP_SZ);
+ }
+ }
+
+@@ -5746,6 +5745,14 @@ static int tg3_rx_prodring_alloc(struct tg3 *tp,
+ {
+ u32 i, rx_pkt_dma_sz;
+
++ if (tpr != &tp->prodring[0]) {
++ memset(&tpr->rx_std_buffers[0], 0, TG3_RX_STD_BUFF_RING_SIZE);
++ if (tp->tg3_flags & TG3_FLAG_JUMBO_CAPABLE)
++ memset(&tpr->rx_jmb_buffers[0], 0,
++ TG3_RX_JMB_BUFF_RING_SIZE);
++ goto done;
++ }
++
+ /* Zero out all descriptors. */
+ memset(tpr->rx_std, 0, TG3_RX_RING_BYTES);
+
+@@ -5847,8 +5854,7 @@ static void tg3_rx_prodring_fini(struct tg3 *tp,
+ static int tg3_rx_prodring_init(struct tg3 *tp,
+ struct tg3_rx_prodring_set *tpr)
+ {
+- tpr->rx_std_buffers = kzalloc(sizeof(struct ring_info) *
+- TG3_RX_RING_SIZE, GFP_KERNEL);
++ tpr->rx_std_buffers = kzalloc(TG3_RX_STD_BUFF_RING_SIZE, GFP_KERNEL);
+ if (!tpr->rx_std_buffers)
+ return -ENOMEM;
+
+@@ -5858,8 +5864,7 @@ static int tg3_rx_prodring_init(struct tg3 *tp,
+ goto err_out;
+
+ if (tp->tg3_flags & TG3_FLAG_JUMBO_CAPABLE) {
+- tpr->rx_jmb_buffers = kzalloc(sizeof(struct ring_info) *
+- TG3_RX_JUMBO_RING_SIZE,
++ tpr->rx_jmb_buffers = kzalloc(TG3_RX_JMB_BUFF_RING_SIZE,
+ GFP_KERNEL);
+ if (!tpr->rx_jmb_buffers)
+ goto err_out;
+@@ -5915,9 +5920,10 @@ static void tg3_free_rings(struct tg3 *tp)
+
+ dev_kfree_skb_any(skb);
+ }
+- }
+
+- tg3_rx_prodring_free(tp, &tp->prodring[0]);
++ if (tp->irq_cnt == 1 || j != tp->irq_cnt - 1)
++ tg3_rx_prodring_free(tp, &tp->prodring[j]);
++ }
+ }
+
+ /* Initialize tx/rx rings for packet processing.
+@@ -5951,9 +5957,13 @@ static int tg3_init_rings(struct tg3 *tp)
+ tnapi->rx_rcb_ptr = 0;
+ if (tnapi->rx_rcb)
+ memset(tnapi->rx_rcb, 0, TG3_RX_RCB_RING_BYTES(tp));
++
++ if ((tp->irq_cnt == 1 || i != tp->irq_cnt - 1) &&
++ tg3_rx_prodring_alloc(tp, &tp->prodring[i]))
++ return -ENOMEM;
+ }
+
+- return tg3_rx_prodring_alloc(tp, &tp->prodring[0]);
++ return 0;
+ }
+
+ /*
+@@ -5997,7 +6007,8 @@ static void tg3_free_consistent(struct tg3 *tp)
+ tp->hw_stats = NULL;
+ }
+
+- tg3_rx_prodring_fini(tp, &tp->prodring[0]);
++ for (i = 0; i < (tp->irq_cnt == 1 ? 1 : tp->irq_cnt - 1); i++)
++ tg3_rx_prodring_fini(tp, &tp->prodring[i]);
+ }
+
+ /*
+@@ -6008,8 +6019,10 @@ static int tg3_alloc_consistent(struct tg3 *tp)
+ {
+ int i;
+
+- if (tg3_rx_prodring_init(tp, &tp->prodring[0]))
+- return -ENOMEM;
++ for (i = 0; i < (tp->irq_cnt == 1 ? 1 : tp->irq_cnt - 1); i++) {
++ if (tg3_rx_prodring_init(tp, &tp->prodring[i]))
++ goto err_out;
++ }
+
+ tp->hw_stats = pci_alloc_consistent(tp->pdev,
+ sizeof(struct tg3_hw_stats),
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index e0b86ba..715df2b 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -2682,7 +2682,7 @@ struct tg3 {
+ struct vlan_group *vlgrp;
+ #endif
+
+- struct tg3_rx_prodring_set prodring[1];
++ struct tg3_rx_prodring_set prodring[TG3_IRQ_MAX_VECS - 1];
+
+
+ /* begin "everything else" cacheline(s) section */
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0038-tg3-Create-aliases-for-rx-producer-mailbox-regs.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0038-tg3-Create-aliases-for-rx-producer-mailbox-regs.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,94 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Fri, 13 Nov 2009 13:03:49 +0000
+Subject: [PATCH 038/207] tg3: Create aliases for rx producer mailbox regs
+
+commit 66711e66639776685aeaad774488be1857abce26 upstream.
+
+The rx producer mailbox registers are used in several spots in the code.
+The addition of TG3_64BIT_REG_LOW makes register references
+uncomfortably long. This patch creates an alias for the standard and
+jumbo ring producer index registers to make the code cleaner.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 18 ++++++------------
+ drivers/net/tg3.h | 4 ++++
+ 2 files changed, 10 insertions(+), 12 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 72d622a..0c24dbd 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -402,7 +402,7 @@ static void tg3_write_indirect_mbox(struct tg3 *tp, u32 off, u32 val)
+ TG3_64BIT_REG_LOW, val);
+ return;
+ }
+- if (off == (MAILBOX_RCV_STD_PROD_IDX + TG3_64BIT_REG_LOW)) {
++ if (off == TG3_RX_STD_PROD_IDX_REG) {
+ pci_write_config_dword(tp->pdev, TG3PCI_STD_RING_PROD_IDX +
+ TG3_64BIT_REG_LOW, val);
+ return;
+@@ -4684,9 +4684,7 @@ next_pkt:
+
+ if (unlikely(rx_std_posted >= tp->rx_std_max_post)) {
+ u32 idx = *post_ptr % TG3_RX_RING_SIZE;
+-
+- tw32_rx_mbox(MAILBOX_RCV_STD_PROD_IDX +
+- TG3_64BIT_REG_LOW, idx);
++ tw32_rx_mbox(TG3_RX_STD_PROD_IDX_REG, idx);
+ work_mask &= ~RXD_OPAQUE_RING_STD;
+ rx_std_posted = 0;
+ }
+@@ -4708,13 +4706,11 @@ next_pkt_nopost:
+ /* Refill RX ring(s). */
+ if (work_mask & RXD_OPAQUE_RING_STD) {
+ tpr->rx_std_prod_idx = std_prod_idx % TG3_RX_RING_SIZE;
+- tw32_rx_mbox(MAILBOX_RCV_STD_PROD_IDX + TG3_64BIT_REG_LOW,
+- tpr->rx_std_prod_idx);
++ tw32_rx_mbox(TG3_RX_STD_PROD_IDX_REG, tpr->rx_std_prod_idx);
+ }
+ if (work_mask & RXD_OPAQUE_RING_JUMBO) {
+ tpr->rx_jmb_prod_idx = jmb_prod_idx % TG3_RX_JUMBO_RING_SIZE;
+- tw32_rx_mbox(MAILBOX_RCV_JUMBO_PROD_IDX + TG3_64BIT_REG_LOW,
+- tpr->rx_jmb_prod_idx);
++ tw32_rx_mbox(TG3_RX_JMB_PROD_IDX_REG, tpr->rx_jmb_prod_idx);
+ }
+ mmiowb();
+
+@@ -7526,13 +7522,11 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ tw32(RCVDBDI_STD_BD + TG3_BDINFO_MAXLEN_FLAGS, val);
+
+ tpr->rx_std_prod_idx = tp->rx_pending;
+- tw32_rx_mbox(MAILBOX_RCV_STD_PROD_IDX + TG3_64BIT_REG_LOW,
+- tpr->rx_std_prod_idx);
++ tw32_rx_mbox(TG3_RX_STD_PROD_IDX_REG, tpr->rx_std_prod_idx);
+
+ tpr->rx_jmb_prod_idx = (tp->tg3_flags & TG3_FLAG_JUMBO_RING_ENABLE) ?
+ tp->rx_jumbo_pending : 0;
+- tw32_rx_mbox(MAILBOX_RCV_JUMBO_PROD_IDX + TG3_64BIT_REG_LOW,
+- tpr->rx_jmb_prod_idx);
++ tw32_rx_mbox(TG3_RX_JMB_PROD_IDX_REG, tpr->rx_jmb_prod_idx);
+
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) {
+ tw32(STD_REPLENISH_LWM, 32);
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 715df2b..bbfbc5e 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -242,7 +242,11 @@
+ #define MAILBOX_GENERAL_7 0x00000258 /* 64-bit */
+ #define MAILBOX_RELOAD_STAT 0x00000260 /* 64-bit */
+ #define MAILBOX_RCV_STD_PROD_IDX 0x00000268 /* 64-bit */
++#define TG3_RX_STD_PROD_IDX_REG (MAILBOX_RCV_STD_PROD_IDX + \
++ TG3_64BIT_REG_LOW)
+ #define MAILBOX_RCV_JUMBO_PROD_IDX 0x00000270 /* 64-bit */
++#define TG3_RX_JMB_PROD_IDX_REG (MAILBOX_RCV_JUMBO_PROD_IDX + \
++ TG3_64BIT_REG_LOW)
+ #define MAILBOX_RCV_MINI_PROD_IDX 0x00000278 /* 64-bit */
+ #define MAILBOX_RCVRET_CON_IDX_0 0x00000280 /* 64-bit */
+ #define MAILBOX_RCVRET_CON_IDX_1 0x00000288 /* 64-bit */
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0039-tg3-Add-rx-prod-ring-consolidation.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0039-tg3-Add-rx-prod-ring-consolidation.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,283 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Fri, 13 Nov 2009 13:03:50 +0000
+Subject: [PATCH 039/207] tg3: Add rx prod ring consolidation
+
+commit b196c7e45f30cbcd38c83386bc8a04a21477f8d3 upstream.
+
+This patch adds code to funnel each MSI-X vector's rx packet buffers
+into a single set of producer rings which will then be submitted to the
+hardware.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 171 +++++++++++++++++++++++++++++++++++++++++++++++++---
+ drivers/net/tg3.h | 3 +
+ 2 files changed, 164 insertions(+), 10 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 0c24dbd..5537deb 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -4558,7 +4558,7 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)
+ u32 sw_idx = tnapi->rx_rcb_ptr;
+ u16 hw_idx;
+ int received;
+- struct tg3_rx_prodring_set *tpr = &tp->prodring[0];
++ struct tg3_rx_prodring_set *tpr = tnapi->prodring;
+
+ hw_idx = *(tnapi->rx_rcb_prod_idx);
+ /*
+@@ -4581,13 +4581,13 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)
+ desc_idx = desc->opaque & RXD_OPAQUE_INDEX_MASK;
+ opaque_key = desc->opaque & RXD_OPAQUE_RING_MASK;
+ if (opaque_key == RXD_OPAQUE_RING_STD) {
+- ri = &tpr->rx_std_buffers[desc_idx];
++ ri = &tp->prodring[0].rx_std_buffers[desc_idx];
+ dma_addr = pci_unmap_addr(ri, mapping);
+ skb = ri->skb;
+ post_ptr = &std_prod_idx;
+ rx_std_posted++;
+ } else if (opaque_key == RXD_OPAQUE_RING_JUMBO) {
+- ri = &tpr->rx_jmb_buffers[desc_idx];
++ ri = &tp->prodring[0].rx_jmb_buffers[desc_idx];
+ dma_addr = pci_unmap_addr(ri, mapping);
+ skb = ri->skb;
+ post_ptr = &jmb_prod_idx;
+@@ -4704,15 +4704,30 @@ next_pkt_nopost:
+ tw32_rx_mbox(tnapi->consmbox, sw_idx);
+
+ /* Refill RX ring(s). */
+- if (work_mask & RXD_OPAQUE_RING_STD) {
++ if (!(tp->tg3_flags3 & TG3_FLG3_ENABLE_RSS) || tnapi == &tp->napi[1]) {
++ if (work_mask & RXD_OPAQUE_RING_STD) {
++ tpr->rx_std_prod_idx = std_prod_idx % TG3_RX_RING_SIZE;
++ tw32_rx_mbox(TG3_RX_STD_PROD_IDX_REG,
++ tpr->rx_std_prod_idx);
++ }
++ if (work_mask & RXD_OPAQUE_RING_JUMBO) {
++ tpr->rx_jmb_prod_idx = jmb_prod_idx %
++ TG3_RX_JUMBO_RING_SIZE;
++ tw32_rx_mbox(TG3_RX_JMB_PROD_IDX_REG,
++ tpr->rx_jmb_prod_idx);
++ }
++ mmiowb();
++ } else if (work_mask) {
++ /* rx_std_buffers[] and rx_jmb_buffers[] entries must be
++ * updated before the producer indices can be updated.
++ */
++ smp_wmb();
++
+ tpr->rx_std_prod_idx = std_prod_idx % TG3_RX_RING_SIZE;
+- tw32_rx_mbox(TG3_RX_STD_PROD_IDX_REG, tpr->rx_std_prod_idx);
+- }
+- if (work_mask & RXD_OPAQUE_RING_JUMBO) {
+ tpr->rx_jmb_prod_idx = jmb_prod_idx % TG3_RX_JUMBO_RING_SIZE;
+- tw32_rx_mbox(TG3_RX_JMB_PROD_IDX_REG, tpr->rx_jmb_prod_idx);
++
++ napi_schedule(&tp->napi[1].napi);
+ }
+- mmiowb();
+
+ return received;
+ }
+@@ -4743,6 +4758,93 @@ static void tg3_poll_link(struct tg3 *tp)
+ }
+ }
+
++static void tg3_rx_prodring_xfer(struct tg3 *tp,
++ struct tg3_rx_prodring_set *dpr,
++ struct tg3_rx_prodring_set *spr)
++{
++ u32 si, di, cpycnt, src_prod_idx;
++ int i;
++
++ while (1) {
++ src_prod_idx = spr->rx_std_prod_idx;
++
++ /* Make sure updates to the rx_std_buffers[] entries and the
++ * standard producer index are seen in the correct order.
++ */
++ smp_rmb();
++
++ if (spr->rx_std_cons_idx == src_prod_idx)
++ break;
++
++ if (spr->rx_std_cons_idx < src_prod_idx)
++ cpycnt = src_prod_idx - spr->rx_std_cons_idx;
++ else
++ cpycnt = TG3_RX_RING_SIZE - spr->rx_std_cons_idx;
++
++ cpycnt = min(cpycnt, TG3_RX_RING_SIZE - dpr->rx_std_prod_idx);
++
++ si = spr->rx_std_cons_idx;
++ di = dpr->rx_std_prod_idx;
++
++ memcpy(&dpr->rx_std_buffers[di],
++ &spr->rx_std_buffers[si],
++ cpycnt * sizeof(struct ring_info));
++
++ for (i = 0; i < cpycnt; i++, di++, si++) {
++ struct tg3_rx_buffer_desc *sbd, *dbd;
++ sbd = &spr->rx_std[si];
++ dbd = &dpr->rx_std[di];
++ dbd->addr_hi = sbd->addr_hi;
++ dbd->addr_lo = sbd->addr_lo;
++ }
++
++ spr->rx_std_cons_idx = (spr->rx_std_cons_idx + cpycnt) %
++ TG3_RX_RING_SIZE;
++ dpr->rx_std_prod_idx = (dpr->rx_std_prod_idx + cpycnt) %
++ TG3_RX_RING_SIZE;
++ }
++
++ while (1) {
++ src_prod_idx = spr->rx_jmb_prod_idx;
++
++ /* Make sure updates to the rx_jmb_buffers[] entries and
++ * the jumbo producer index are seen in the correct order.
++ */
++ smp_rmb();
++
++ if (spr->rx_jmb_cons_idx == src_prod_idx)
++ break;
++
++ if (spr->rx_jmb_cons_idx < src_prod_idx)
++ cpycnt = src_prod_idx - spr->rx_jmb_cons_idx;
++ else
++ cpycnt = TG3_RX_JUMBO_RING_SIZE - spr->rx_jmb_cons_idx;
++
++ cpycnt = min(cpycnt,
++ TG3_RX_JUMBO_RING_SIZE - dpr->rx_jmb_prod_idx);
++
++ si = spr->rx_jmb_cons_idx;
++ di = dpr->rx_jmb_prod_idx;
++
++ memcpy(&dpr->rx_jmb_buffers[di],
++ &spr->rx_jmb_buffers[si],
++ cpycnt * sizeof(struct ring_info));
++
++ for (i = 0; i < cpycnt; i++, di++, si++) {
++ struct tg3_rx_buffer_desc *sbd, *dbd;
++ sbd = &spr->rx_jmb[si].std;
++ dbd = &dpr->rx_jmb[di].std;
++ dbd->addr_hi = sbd->addr_hi;
++ dbd->addr_lo = sbd->addr_lo;
++ }
++
++ spr->rx_jmb_cons_idx = (spr->rx_jmb_cons_idx + cpycnt) %
++ TG3_RX_JUMBO_RING_SIZE;
++ dpr->rx_jmb_prod_idx = (dpr->rx_jmb_prod_idx + cpycnt) %
++ TG3_RX_JUMBO_RING_SIZE;
++ }
++}
++
+ static int tg3_poll_work(struct tg3_napi *tnapi, int work_done, int budget)
+ {
+ struct tg3 *tp = tnapi->tp;
+@@ -4761,6 +4863,30 @@ static int tg3_poll_work(struct tg3_napi *tnapi, int work_done, int budget)
+ if (*(tnapi->rx_rcb_prod_idx) != tnapi->rx_rcb_ptr)
+ work_done += tg3_rx(tnapi, budget - work_done);
+
++ if ((tp->tg3_flags3 & TG3_FLG3_ENABLE_RSS) && tnapi == &tp->napi[1]) {
++ int i;
++ u32 std_prod_idx = tp->prodring[0].rx_std_prod_idx;
++ u32 jmb_prod_idx = tp->prodring[0].rx_jmb_prod_idx;
++
++ for (i = 2; i < tp->irq_cnt; i++)
++ tg3_rx_prodring_xfer(tp, tnapi->prodring,
++ tp->napi[i].prodring);
++
++ wmb();
++
++ if (std_prod_idx != tp->prodring[0].rx_std_prod_idx) {
++ u32 mbox = TG3_RX_STD_PROD_IDX_REG;
++ tw32_rx_mbox(mbox, tp->prodring[0].rx_std_prod_idx);
++ }
++
++ if (jmb_prod_idx != tp->prodring[0].rx_jmb_prod_idx) {
++ u32 mbox = TG3_RX_JMB_PROD_IDX_REG;
++ tw32_rx_mbox(mbox, tp->prodring[0].rx_jmb_prod_idx);
++ }
++
++ mmiowb();
++ }
++
+ return work_done;
+ }
+
+@@ -5715,8 +5841,23 @@ static void tg3_rx_prodring_free(struct tg3 *tp,
+ {
+ int i;
+
+- if (tpr != &tp->prodring[0])
++ if (tpr != &tp->prodring[0]) {
++ for (i = tpr->rx_std_cons_idx; i != tpr->rx_std_prod_idx;
++ i = (i + 1) % TG3_RX_RING_SIZE)
++ tg3_rx_skb_free(tp, &tpr->rx_std_buffers[i],
++ tp->rx_pkt_map_sz);
++
++ if (tp->tg3_flags & TG3_FLAG_JUMBO_CAPABLE) {
++ for (i = tpr->rx_jmb_cons_idx;
++ i != tpr->rx_jmb_prod_idx;
++ i = (i + 1) % TG3_RX_JUMBO_RING_SIZE) {
++ tg3_rx_skb_free(tp, &tpr->rx_jmb_buffers[i],
++ TG3_RX_JMB_MAP_SZ);
++ }
++ }
++
+ return;
++ }
+
+ for (i = 0; i < TG3_RX_RING_SIZE; i++)
+ tg3_rx_skb_free(tp, &tpr->rx_std_buffers[i],
+@@ -5741,6 +5882,11 @@ static int tg3_rx_prodring_alloc(struct tg3 *tp,
+ {
+ u32 i, rx_pkt_dma_sz;
+
++ tpr->rx_std_cons_idx = 0;
++ tpr->rx_std_prod_idx = 0;
++ tpr->rx_jmb_cons_idx = 0;
++ tpr->rx_jmb_prod_idx = 0;
++
+ if (tpr != &tp->prodring[0]) {
+ memset(&tpr->rx_std_buffers[0], 0, TG3_RX_STD_BUFF_RING_SIZE);
+ if (tp->tg3_flags & TG3_FLAG_JUMBO_CAPABLE)
+@@ -6062,6 +6208,11 @@ static int tg3_alloc_consistent(struct tg3 *tp)
+ break;
+ }
+
++ if (tp->irq_cnt == 1)
++ tnapi->prodring = &tp->prodring[0];
++ else if (i)
++ tnapi->prodring = &tp->prodring[i - 1];
++
+ /*
+ * If multivector RSS is enabled, vector 0 does not handle
+ * rx or tx interrupts. Don't allocate any resources for it.
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index bbfbc5e..6be46ab 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -2575,7 +2575,9 @@ struct tg3_ethtool_stats {
+
+ struct tg3_rx_prodring_set {
+ u32 rx_std_prod_idx;
++ u32 rx_std_cons_idx;
+ u32 rx_jmb_prod_idx;
++ u32 rx_jmb_cons_idx;
+ struct tg3_rx_buffer_desc *rx_std;
+ struct tg3_ext_rx_buffer_desc *rx_jmb;
+ struct ring_info *rx_std_buffers;
+@@ -2603,6 +2605,7 @@ struct tg3_napi {
+ u32 consmbox;
+ u32 rx_rcb_ptr;
+ u16 *rx_rcb_prod_idx;
++ struct tg3_rx_prodring_set *prodring;
+
+ struct tg3_rx_buffer_desc *rx_rcb;
+ struct tg3_tx_buffer_desc *tx_ring;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0040-tg3-Fix-DIDs-Enable-5717-support.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0040-tg3-Fix-DIDs-Enable-5717-support.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,66 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Fri, 13 Nov 2009 13:03:51 +0000
+Subject: [PATCH 040/207] tg3: Fix DIDs, Enable 5717 support
+
+commit 5001e2f638011859c1351f9fe57ca4e545a15c47 upstream.
+
+This patch fixes the 5717 variant device ID enumerations and adds those
+DIDs to the PCI ID table.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 10 ++++++----
+ drivers/net/tg3.h | 7 +++----
+ 2 files changed, 9 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 5537deb..ea68f36 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -241,6 +241,9 @@ static struct pci_device_id tg3_pci_tbl[] = {
+ {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_57760)},
+ {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_57790)},
+ {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_57788)},
++ {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_5717)},
++ {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_5718)},
++ {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_5724)},
+ {PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_9DXX)},
+ {PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_9MXX)},
+ {PCI_DEVICE(PCI_VENDOR_ID_ALTIMA, PCI_DEVICE_ID_ALTIMA_AC1000)},
+@@ -12703,10 +12706,9 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_USE_PROD_ID_REG) {
+ u32 prod_id_asic_rev;
+
+- if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_5717C ||
+- tp->pdev->device == TG3PCI_DEVICE_TIGON3_5717S ||
+- tp->pdev->device == TG3PCI_DEVICE_TIGON3_5718C ||
+- tp->pdev->device == TG3PCI_DEVICE_TIGON3_5718S)
++ if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_5717 ||
++ tp->pdev->device == TG3PCI_DEVICE_TIGON3_5718 ||
++ tp->pdev->device == TG3PCI_DEVICE_TIGON3_5724)
+ pci_read_config_dword(tp->pdev,
+ TG3PCI_GEN2_PRODID_ASICREV,
+ &prod_id_asic_rev);
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 6be46ab..453a34f 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -46,10 +46,9 @@
+ #define TG3PCI_DEVICE_TIGON3_57788 0x1691
+ #define TG3PCI_DEVICE_TIGON3_5785_G 0x1699 /* GPHY */
+ #define TG3PCI_DEVICE_TIGON3_5785_F 0x16a0 /* 10/100 only */
+-#define TG3PCI_DEVICE_TIGON3_5717C 0x1655
+-#define TG3PCI_DEVICE_TIGON3_5717S 0x1656
+-#define TG3PCI_DEVICE_TIGON3_5718C 0x1665
+-#define TG3PCI_DEVICE_TIGON3_5718S 0x1666
++#define TG3PCI_DEVICE_TIGON3_5717 0x1655
++#define TG3PCI_DEVICE_TIGON3_5718 0x1656
++#define TG3PCI_DEVICE_TIGON3_5724 0x165c
+ /* 0x04 --> 0x64 unused */
+ #define TG3PCI_MSI_DATA 0x00000064
+ /* 0x66 --> 0x68 unused */
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0041-tg3-Update-version-to-3.104.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0041-tg3-Update-version-to-3.104.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,33 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Fri, 13 Nov 2009 13:03:52 +0000
+Subject: [PATCH 041/207] tg3: Update version to 3.104
+
+commit c5d5d1721763842a516529e553433d13b11c3f31 upstream.
+
+This patch updates the tg3 version to 3.104.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index ea68f36..3d70943 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -68,8 +68,8 @@
+
+ #define DRV_MODULE_NAME "tg3"
+ #define PFX DRV_MODULE_NAME ": "
+-#define DRV_MODULE_VERSION "3.103"
+-#define DRV_MODULE_RELDATE "November 2, 2009"
++#define DRV_MODULE_VERSION "3.104"
++#define DRV_MODULE_RELDATE "November 13, 2009"
+
+ #define TG3_DEF_MAC_MODE 0
+ #define TG3_DEF_RX_MODE 0
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0042-tg3-remove-use-of-skb_dma_map-unmap.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0042-tg3-remove-use-of-skb_dma_map-unmap.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,404 @@
+From: Alexander Duyck <alexander.h.duyck at intel.com>
+Date: Wed, 2 Dec 2009 16:48:38 +0000
+Subject: [PATCH 042/207] tg3: remove use of skb_dma_map/unmap
+
+commit f4188d8affc8267a0f0f1b587a4d0a4b9b7f2999 upstream.
+
+Due to the fact that skb_dma_map/unmap do not work correctly when a HW
+IOMMU is enabled it has been recommended to go about removing the calls
+from the network device drivers.
+
+Signed-off-by: Alexander Duyck <alexander.h.duyck at intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+CC: Matt Carlson <mcarlson at broadcom.com>
+CC: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 173 ++++++++++++++++++++++++++++++++++++++++-------------
+ drivers/net/tg3.h | 6 +--
+ 2 files changed, 132 insertions(+), 47 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 3d70943..5318af2 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -4357,7 +4357,7 @@ static void tg3_tx(struct tg3_napi *tnapi)
+ txq = netdev_get_tx_queue(tp->dev, index);
+
+ while (sw_idx != hw_idx) {
+- struct tx_ring_info *ri = &tnapi->tx_buffers[sw_idx];
++ struct ring_info *ri = &tnapi->tx_buffers[sw_idx];
+ struct sk_buff *skb = ri->skb;
+ int i, tx_bug = 0;
+
+@@ -4366,7 +4366,10 @@ static void tg3_tx(struct tg3_napi *tnapi)
+ return;
+ }
+
+- skb_dma_unmap(&tp->pdev->dev, skb, DMA_TO_DEVICE);
++ pci_unmap_single(tp->pdev,
++ pci_unmap_addr(ri, mapping),
++ skb_headlen(skb),
++ PCI_DMA_TODEVICE);
+
+ ri->skb = NULL;
+
+@@ -4376,6 +4379,11 @@ static void tg3_tx(struct tg3_napi *tnapi)
+ ri = &tnapi->tx_buffers[sw_idx];
+ if (unlikely(ri->skb != NULL || sw_idx == hw_idx))
+ tx_bug = 1;
++
++ pci_unmap_page(tp->pdev,
++ pci_unmap_addr(ri, mapping),
++ skb_shinfo(skb)->frags[i].size,
++ PCI_DMA_TODEVICE);
+ sw_idx = NEXT_TX(sw_idx);
+ }
+
+@@ -5334,17 +5342,21 @@ static int tigon3_dma_hwbug_workaround(struct tg3_napi *tnapi,
+ } else {
+ /* New SKB is guaranteed to be linear. */
+ entry = *start;
+- ret = skb_dma_map(&tp->pdev->dev, new_skb, DMA_TO_DEVICE);
+- new_addr = skb_shinfo(new_skb)->dma_head;
++ new_addr = pci_map_single(tp->pdev, new_skb->data, new_skb->len,
++ PCI_DMA_TODEVICE);
++ /* Make sure the mapping succeeded */
++ if (pci_dma_mapping_error(tp->pdev, new_addr)) {
++ ret = -1;
++ dev_kfree_skb(new_skb);
++ new_skb = NULL;
+
+ /* Make sure new skb does not cross any 4G boundaries.
+ * Drop the packet if it does.
+ */
+- if (ret || ((tp->tg3_flags3 & TG3_FLG3_4G_DMA_BNDRY_BUG) &&
+- tg3_4g_overflow_test(new_addr, new_skb->len))) {
+- if (!ret)
+- skb_dma_unmap(&tp->pdev->dev, new_skb,
+- DMA_TO_DEVICE);
++ } else if ((tp->tg3_flags3 & TG3_FLG3_4G_DMA_BNDRY_BUG) &&
++ tg3_4g_overflow_test(new_addr, new_skb->len)) {
++ pci_unmap_single(tp->pdev, new_addr, new_skb->len,
++ PCI_DMA_TODEVICE);
+ ret = -1;
+ dev_kfree_skb(new_skb);
+ new_skb = NULL;
+@@ -5358,15 +5370,28 @@ static int tigon3_dma_hwbug_workaround(struct tg3_napi *tnapi,
+ /* Now clean up the sw ring entries. */
+ i = 0;
+ while (entry != last_plus_one) {
++ int len;
++
+ if (i == 0)
+- tnapi->tx_buffers[entry].skb = new_skb;
++ len = skb_headlen(skb);
+ else
++ len = skb_shinfo(skb)->frags[i-1].size;
++
++ pci_unmap_single(tp->pdev,
++ pci_unmap_addr(&tnapi->tx_buffers[entry],
++ mapping),
++ len, PCI_DMA_TODEVICE);
++ if (i == 0) {
++ tnapi->tx_buffers[entry].skb = new_skb;
++ pci_unmap_addr_set(&tnapi->tx_buffers[entry], mapping,
++ new_addr);
++ } else {
+ tnapi->tx_buffers[entry].skb = NULL;
++ }
+ entry = NEXT_TX(entry);
+ i++;
+ }
+
+- skb_dma_unmap(&tp->pdev->dev, skb, DMA_TO_DEVICE);
+ dev_kfree_skb(skb);
+
+ return ret;
+@@ -5403,10 +5428,11 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb,
+ {
+ struct tg3 *tp = netdev_priv(dev);
+ u32 len, entry, base_flags, mss;
+- struct skb_shared_info *sp;
+ dma_addr_t mapping;
+ struct tg3_napi *tnapi;
+ struct netdev_queue *txq;
++ unsigned int i, last;
++
+
+ txq = netdev_get_tx_queue(dev, skb_get_queue_mapping(skb));
+ tnapi = &tp->napi[skb_get_queue_mapping(skb)];
+@@ -5477,18 +5503,17 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb,
+ (vlan_tx_tag_get(skb) << 16));
+ #endif
+
+- if (skb_dma_map(&tp->pdev->dev, skb, DMA_TO_DEVICE)) {
++ len = skb_headlen(skb);
++
++ /* Queue skb data, a.k.a. the main skb fragment. */
++ mapping = pci_map_single(tp->pdev, skb->data, len, PCI_DMA_TODEVICE);
++ if (pci_dma_mapping_error(tp->pdev, mapping)) {
+ dev_kfree_skb(skb);
+ goto out_unlock;
+ }
+
+- sp = skb_shinfo(skb);
+-
+- mapping = sp->dma_head;
+-
+ tnapi->tx_buffers[entry].skb = skb;
+-
+- len = skb_headlen(skb);
++ pci_unmap_addr_set(&tnapi->tx_buffers[entry], mapping, mapping);
+
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 &&
+ !mss && skb->len > ETH_DATA_LEN)
+@@ -5501,15 +5526,21 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb,
+
+ /* Now loop through additional data fragments, and queue them. */
+ if (skb_shinfo(skb)->nr_frags > 0) {
+- unsigned int i, last;
+-
+ last = skb_shinfo(skb)->nr_frags - 1;
+ for (i = 0; i <= last; i++) {
+ skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
+
+ len = frag->size;
+- mapping = sp->dma_maps[i];
++ mapping = pci_map_page(tp->pdev,
++ frag->page,
++ frag->page_offset,
++ len, PCI_DMA_TODEVICE);
++ if (pci_dma_mapping_error(tp->pdev, mapping))
++ goto dma_error;
++
+ tnapi->tx_buffers[entry].skb = NULL;
++ pci_unmap_addr_set(&tnapi->tx_buffers[entry], mapping,
++ mapping);
+
+ tg3_set_txd(tnapi, entry, mapping, len,
+ base_flags, (i == last) | (mss << 1));
+@@ -5532,6 +5563,27 @@ out_unlock:
+ mmiowb();
+
+ return NETDEV_TX_OK;
++
++dma_error:
++ last = i;
++ entry = tnapi->tx_prod;
++ tnapi->tx_buffers[entry].skb = NULL;
++ pci_unmap_single(tp->pdev,
++ pci_unmap_addr(&tnapi->tx_buffers[entry], mapping),
++ skb_headlen(skb),
++ PCI_DMA_TODEVICE);
++ for (i = 0; i <= last; i++) {
++ skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
++ entry = NEXT_TX(entry);
++
++ pci_unmap_page(tp->pdev,
++ pci_unmap_addr(&tnapi->tx_buffers[entry],
++ mapping),
++ frag->size, PCI_DMA_TODEVICE);
++ }
++
++ dev_kfree_skb(skb);
++ return NETDEV_TX_OK;
+ }
+
+ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *,
+@@ -5579,11 +5631,12 @@ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb,
+ {
+ struct tg3 *tp = netdev_priv(dev);
+ u32 len, entry, base_flags, mss;
+- struct skb_shared_info *sp;
+ int would_hit_hwbug;
+ dma_addr_t mapping;
+ struct tg3_napi *tnapi;
+ struct netdev_queue *txq;
++ unsigned int i, last;
++
+
+ txq = netdev_get_tx_queue(dev, skb_get_queue_mapping(skb));
+ tnapi = &tp->napi[skb_get_queue_mapping(skb)];
+@@ -5678,21 +5731,19 @@ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb,
+ !mss && skb->len > ETH_DATA_LEN)
+ base_flags |= TXD_FLAG_JMB_PKT;
+
+- if (skb_dma_map(&tp->pdev->dev, skb, DMA_TO_DEVICE)) {
++ len = skb_headlen(skb);
++
++ mapping = pci_map_single(tp->pdev, skb->data, len, PCI_DMA_TODEVICE);
++ if (pci_dma_mapping_error(tp->pdev, mapping)) {
+ dev_kfree_skb(skb);
+ goto out_unlock;
+ }
+
+- sp = skb_shinfo(skb);
+-
+- mapping = sp->dma_head;
+-
+ tnapi->tx_buffers[entry].skb = skb;
++ pci_unmap_addr_set(&tnapi->tx_buffers[entry], mapping, mapping);
+
+ would_hit_hwbug = 0;
+
+- len = skb_headlen(skb);
+-
+ if ((tp->tg3_flags3 & TG3_FLG3_SHORT_DMA_BUG) && len <= 8)
+ would_hit_hwbug = 1;
+
+@@ -5714,16 +5765,21 @@ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb,
+
+ /* Now loop through additional data fragments, and queue them. */
+ if (skb_shinfo(skb)->nr_frags > 0) {
+- unsigned int i, last;
+-
+ last = skb_shinfo(skb)->nr_frags - 1;
+ for (i = 0; i <= last; i++) {
+ skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
+
+ len = frag->size;
+- mapping = sp->dma_maps[i];
++ mapping = pci_map_page(tp->pdev,
++ frag->page,
++ frag->page_offset,
++ len, PCI_DMA_TODEVICE);
+
+ tnapi->tx_buffers[entry].skb = NULL;
++ pci_unmap_addr_set(&tnapi->tx_buffers[entry], mapping,
++ mapping);
++ if (pci_dma_mapping_error(tp->pdev, mapping))
++ goto dma_error;
+
+ if ((tp->tg3_flags3 & TG3_FLG3_SHORT_DMA_BUG) &&
+ len <= 8)
+@@ -5779,6 +5835,27 @@ out_unlock:
+ mmiowb();
+
+ return NETDEV_TX_OK;
++
++dma_error:
++ last = i;
++ entry = tnapi->tx_prod;
++ tnapi->tx_buffers[entry].skb = NULL;
++ pci_unmap_single(tp->pdev,
++ pci_unmap_addr(&tnapi->tx_buffers[entry], mapping),
++ skb_headlen(skb),
++ PCI_DMA_TODEVICE);
++ for (i = 0; i <= last; i++) {
++ skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
++ entry = NEXT_TX(entry);
++
++ pci_unmap_page(tp->pdev,
++ pci_unmap_addr(&tnapi->tx_buffers[entry],
++ mapping),
++ frag->size, PCI_DMA_TODEVICE);
++ }
++
++ dev_kfree_skb(skb);
++ return NETDEV_TX_OK;
+ }
+
+ static inline void tg3_set_mtu(struct net_device *dev, struct tg3 *tp,
+@@ -6046,8 +6123,9 @@ static void tg3_free_rings(struct tg3 *tp)
+ continue;
+
+ for (i = 0; i < TG3_TX_RING_SIZE; ) {
+- struct tx_ring_info *txp;
++ struct ring_info *txp;
+ struct sk_buff *skb;
++ unsigned int k;
+
+ txp = &tnapi->tx_buffers[i];
+ skb = txp->skb;
+@@ -6057,11 +6135,22 @@ static void tg3_free_rings(struct tg3 *tp)
+ continue;
+ }
+
+- skb_dma_unmap(&tp->pdev->dev, skb, DMA_TO_DEVICE);
+-
++ pci_unmap_single(tp->pdev,
++ pci_unmap_addr(txp, mapping),
++ skb_headlen(skb),
++ PCI_DMA_TODEVICE);
+ txp->skb = NULL;
+
+- i += skb_shinfo(skb)->nr_frags + 1;
++ i++;
++
++ for (k = 0; k < skb_shinfo(skb)->nr_frags; k++) {
++ txp = &tnapi->tx_buffers[i & (TG3_TX_RING_SIZE - 1)];
++ pci_unmap_page(tp->pdev,
++ pci_unmap_addr(txp, mapping),
++ skb_shinfo(skb)->frags[k].size,
++ PCI_DMA_TODEVICE);
++ i++;
++ }
+
+ dev_kfree_skb_any(skb);
+ }
+@@ -6231,7 +6320,7 @@ static int tg3_alloc_consistent(struct tg3 *tp)
+
+ memset(tnapi->rx_rcb, 0, TG3_RX_RCB_RING_BYTES(tp));
+
+- tnapi->tx_buffers = kzalloc(sizeof(struct tx_ring_info) *
++ tnapi->tx_buffers = kzalloc(sizeof(struct ring_info) *
+ TG3_TX_RING_SIZE, GFP_KERNEL);
+ if (!tnapi->tx_buffers)
+ goto err_out;
+@@ -10638,7 +10727,8 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode)
+ for (i = 14; i < tx_len; i++)
+ tx_data[i] = (u8) (i & 0xff);
+
+- if (skb_dma_map(&tp->pdev->dev, skb, DMA_TO_DEVICE)) {
++ map = pci_map_single(tp->pdev, skb->data, tx_len, PCI_DMA_TODEVICE);
++ if (pci_dma_mapping_error(tp->pdev, map)) {
+ dev_kfree_skb(skb);
+ return -EIO;
+ }
+@@ -10652,8 +10742,7 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode)
+
+ num_pkts = 0;
+
+- tg3_set_txd(tnapi, tnapi->tx_prod,
+- skb_shinfo(skb)->dma_head, tx_len, 0, 1);
++ tg3_set_txd(tnapi, tnapi->tx_prod, map, tx_len, 0, 1);
+
+ tnapi->tx_prod++;
+ num_pkts++;
+@@ -10677,7 +10766,7 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode)
+ break;
+ }
+
+- skb_dma_unmap(&tp->pdev->dev, skb, DMA_TO_DEVICE);
++ pci_unmap_single(tp->pdev, map, tx_len, PCI_DMA_TODEVICE);
+ dev_kfree_skb(skb);
+
+ if (tx_idx != tnapi->tx_prod)
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 453a34f..8972523 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -2441,10 +2441,6 @@ struct ring_info {
+ DECLARE_PCI_UNMAP_ADDR(mapping)
+ };
+
+-struct tx_ring_info {
+- struct sk_buff *skb;
+-};
+-
+ struct tg3_config_info {
+ u32 flags;
+ };
+@@ -2608,7 +2604,7 @@ struct tg3_napi {
+
+ struct tg3_rx_buffer_desc *rx_rcb;
+ struct tg3_tx_buffer_desc *tx_ring;
+- struct tx_ring_info *tx_buffers;
++ struct ring_info *tx_buffers;
+
+ dma_addr_t status_mapping;
+ dma_addr_t rx_rcb_mapping;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0043-drivers-net-Move-and-to-end-of-previous-line.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0043-drivers-net-Move-and-to-end-of-previous-line.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,49 @@
+From: Joe Perches <joe at perches.com>
+Date: Thu, 3 Dec 2009 07:58:21 +0000
+Subject: [PATCH 043/207] drivers/net: Move && and || to end of previous line
+
+commit 8e95a2026f3b43f7c3d676adaccd2de9532e8dcc upstream.
+
+Only files where David Miller is the primary git-signer.
+wireless, wimax, ixgbe, etc are not modified.
+
+Compile tested x86 allyesconfig only
+Not all files compiled (not x86 compatible)
+
+Added a few > 80 column lines, which I ignored.
+Existing checkpatch complaints ignored.
+
+Signed-off-by: Joe Perches <joe at perches.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Restricted to drivers/net/tg3.{c,h}]
+---
+ drivers/net/tg3.c | 13 ++++++-------
+ 1 files changed, 6 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 5318af2..9d7b0bd 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -4621,13 +4621,12 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)
+ len = ((desc->idx_len & RXD_LEN_MASK) >> RXD_LEN_SHIFT) -
+ ETH_FCS_LEN;
+
+- if (len > RX_COPY_THRESHOLD
+- && tp->rx_offset == NET_IP_ALIGN
+- /* rx_offset will likely not equal NET_IP_ALIGN
+- * if this is a 5701 card running in PCI-X mode
+- * [see tg3_get_invariants()]
+- */
+- ) {
++ if (len > RX_COPY_THRESHOLD &&
++ tp->rx_offset == NET_IP_ALIGN) {
++ /* rx_offset will likely not equal NET_IP_ALIGN
++ * if this is a 5701 card running in PCI-X mode
++ * [see tg3_get_invariants()]
++ */
+ int skb_size;
+
+ skb_size = tg3_alloc_rx_skb(tp, tpr, opaque_key,
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0044-tg3-Make-TSS-enable-independent-of-MSI-X-enable.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0044-tg3-Make-TSS-enable-independent-of-MSI-X-enable.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,222 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Thu, 3 Dec 2009 08:36:20 +0000
+Subject: [PATCH 044/207] tg3: Make TSS enable independent of MSI-X enable
+
+commit 19cfaecc094781da273b5cd1411ee46589898d0e upstream.
+
+The 57765 asic rev has MSI-X capability, but does not support TSS. This
+patch changes the tx paths so that TSS is explicitly mentioned, rather
+than implied through the ENABLE_MSIX flag.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 91 ++++++++++++++++++++++++++++++++--------------------
+ drivers/net/tg3.h | 1 +
+ 2 files changed, 57 insertions(+), 35 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 9d7b0bd..c877165 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -4351,7 +4351,7 @@ static void tg3_tx(struct tg3_napi *tnapi)
+ struct netdev_queue *txq;
+ int index = tnapi - tp->napi;
+
+- if (tp->tg3_flags2 & TG3_FLG2_USING_MSIX)
++ if (tp->tg3_flags3 & TG3_FLG3_ENABLE_TSS)
+ index--;
+
+ txq = netdev_get_tx_queue(tp->dev, index);
+@@ -5435,7 +5435,7 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb,
+
+ txq = netdev_get_tx_queue(dev, skb_get_queue_mapping(skb));
+ tnapi = &tp->napi[skb_get_queue_mapping(skb)];
+- if (tp->tg3_flags2 & TG3_FLG2_USING_MSIX)
++ if (tp->tg3_flags3 & TG3_FLG3_ENABLE_TSS)
+ tnapi++;
+
+ /* We are running in BH disabled context with netif_tx_lock
+@@ -5639,7 +5639,7 @@ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb,
+
+ txq = netdev_get_tx_queue(dev, skb_get_queue_mapping(skb));
+ tnapi = &tp->napi[skb_get_queue_mapping(skb)];
+- if (tp->tg3_flags2 & TG3_FLG2_USING_MSIX)
++ if (tp->tg3_flags3 & TG3_FLG3_ENABLE_TSS)
+ tnapi++;
+
+ /* We are running in BH disabled context with netif_tx_lock
+@@ -6278,6 +6278,24 @@ static int tg3_alloc_consistent(struct tg3 *tp)
+ memset(tnapi->hw_status, 0, TG3_HW_STATUS_SIZE);
+ sblk = tnapi->hw_status;
+
++ /* If multivector TSS is enabled, vector 0 does not handle
++ * tx interrupts. Don't allocate any resources for it.
++ */
++ if ((!i && !(tp->tg3_flags3 & TG3_FLG3_ENABLE_TSS)) ||
++ (i && (tp->tg3_flags3 & TG3_FLG3_ENABLE_TSS))) {
++ tnapi->tx_buffers = kzalloc(sizeof(struct ring_info) *
++ TG3_TX_RING_SIZE,
++ GFP_KERNEL);
++ if (!tnapi->tx_buffers)
++ goto err_out;
++
++ tnapi->tx_ring = pci_alloc_consistent(tp->pdev,
++ TG3_TX_RING_BYTES,
++ &tnapi->tx_desc_mapping);
++ if (!tnapi->tx_ring)
++ goto err_out;
++ }
++
+ /*
+ * When RSS is enabled, the status block format changes
+ * slightly. The "rx_jumbo_consumer", "reserved",
+@@ -6318,17 +6336,6 @@ static int tg3_alloc_consistent(struct tg3 *tp)
+ goto err_out;
+
+ memset(tnapi->rx_rcb, 0, TG3_RX_RCB_RING_BYTES(tp));
+-
+- tnapi->tx_buffers = kzalloc(sizeof(struct ring_info) *
+- TG3_TX_RING_SIZE, GFP_KERNEL);
+- if (!tnapi->tx_buffers)
+- goto err_out;
+-
+- tnapi->tx_ring = pci_alloc_consistent(tp->pdev,
+- TG3_TX_RING_BYTES,
+- &tnapi->tx_desc_mapping);
+- if (!tnapi->tx_ring)
+- goto err_out;
+ }
+
+ return 0;
+@@ -7316,19 +7323,21 @@ static void __tg3_set_coalesce(struct tg3 *tp, struct ethtool_coalesce *ec)
+ {
+ int i;
+
+- if (!(tp->tg3_flags2 & TG3_FLG2_USING_MSIX)) {
++ if (!(tp->tg3_flags3 & TG3_FLG3_ENABLE_TSS)) {
+ tw32(HOSTCC_TXCOL_TICKS, ec->tx_coalesce_usecs);
+ tw32(HOSTCC_TXMAX_FRAMES, ec->tx_max_coalesced_frames);
+ tw32(HOSTCC_TXCOAL_MAXF_INT, ec->tx_max_coalesced_frames_irq);
+-
+- tw32(HOSTCC_RXCOL_TICKS, ec->rx_coalesce_usecs);
+- tw32(HOSTCC_RXMAX_FRAMES, ec->rx_max_coalesced_frames);
+- tw32(HOSTCC_RXCOAL_MAXF_INT, ec->rx_max_coalesced_frames_irq);
+ } else {
+ tw32(HOSTCC_TXCOL_TICKS, 0);
+ tw32(HOSTCC_TXMAX_FRAMES, 0);
+ tw32(HOSTCC_TXCOAL_MAXF_INT, 0);
++ }
+
++ if (!(tp->tg3_flags2 & TG3_FLG2_USING_MSIX)) {
++ tw32(HOSTCC_RXCOL_TICKS, ec->rx_coalesce_usecs);
++ tw32(HOSTCC_RXMAX_FRAMES, ec->rx_max_coalesced_frames);
++ tw32(HOSTCC_RXCOAL_MAXF_INT, ec->rx_max_coalesced_frames_irq);
++ } else {
+ tw32(HOSTCC_RXCOL_TICKS, 0);
+ tw32(HOSTCC_RXMAX_FRAMES, 0);
+ tw32(HOSTCC_RXCOAL_MAXF_INT, 0);
+@@ -7351,25 +7360,31 @@ static void __tg3_set_coalesce(struct tg3 *tp, struct ethtool_coalesce *ec)
+
+ reg = HOSTCC_RXCOL_TICKS_VEC1 + i * 0x18;
+ tw32(reg, ec->rx_coalesce_usecs);
+- reg = HOSTCC_TXCOL_TICKS_VEC1 + i * 0x18;
+- tw32(reg, ec->tx_coalesce_usecs);
+ reg = HOSTCC_RXMAX_FRAMES_VEC1 + i * 0x18;
+ tw32(reg, ec->rx_max_coalesced_frames);
+- reg = HOSTCC_TXMAX_FRAMES_VEC1 + i * 0x18;
+- tw32(reg, ec->tx_max_coalesced_frames);
+ reg = HOSTCC_RXCOAL_MAXF_INT_VEC1 + i * 0x18;
+ tw32(reg, ec->rx_max_coalesced_frames_irq);
+- reg = HOSTCC_TXCOAL_MAXF_INT_VEC1 + i * 0x18;
+- tw32(reg, ec->tx_max_coalesced_frames_irq);
++
++ if (tp->tg3_flags3 & TG3_FLG3_ENABLE_TSS) {
++ reg = HOSTCC_TXCOL_TICKS_VEC1 + i * 0x18;
++ tw32(reg, ec->tx_coalesce_usecs);
++ reg = HOSTCC_TXMAX_FRAMES_VEC1 + i * 0x18;
++ tw32(reg, ec->tx_max_coalesced_frames);
++ reg = HOSTCC_TXCOAL_MAXF_INT_VEC1 + i * 0x18;
++ tw32(reg, ec->tx_max_coalesced_frames_irq);
++ }
+ }
+
+ for (; i < tp->irq_max - 1; i++) {
+ tw32(HOSTCC_RXCOL_TICKS_VEC1 + i * 0x18, 0);
+- tw32(HOSTCC_TXCOL_TICKS_VEC1 + i * 0x18, 0);
+ tw32(HOSTCC_RXMAX_FRAMES_VEC1 + i * 0x18, 0);
+- tw32(HOSTCC_TXMAX_FRAMES_VEC1 + i * 0x18, 0);
+ tw32(HOSTCC_RXCOAL_MAXF_INT_VEC1 + i * 0x18, 0);
+- tw32(HOSTCC_TXCOAL_MAXF_INT_VEC1 + i * 0x18, 0);
++
++ if (tp->tg3_flags3 & TG3_FLG3_ENABLE_TSS) {
++ tw32(HOSTCC_TXCOL_TICKS_VEC1 + i * 0x18, 0);
++ tw32(HOSTCC_TXMAX_FRAMES_VEC1 + i * 0x18, 0);
++ tw32(HOSTCC_TXCOAL_MAXF_INT_VEC1 + i * 0x18, 0);
++ }
+ }
+ }
+
+@@ -7470,17 +7485,19 @@ static void tg3_rings_reset(struct tg3 *tp)
+ /* Clear status block in ram. */
+ memset(tnapi->hw_status, 0, TG3_HW_STATUS_SIZE);
+
+- tg3_set_bdinfo(tp, txrcb, tnapi->tx_desc_mapping,
+- (TG3_TX_RING_SIZE <<
+- BDINFO_FLAGS_MAXLEN_SHIFT),
+- NIC_SRAM_TX_BUFFER_DESC);
++ if (tnapi->tx_ring) {
++ tg3_set_bdinfo(tp, txrcb, tnapi->tx_desc_mapping,
++ (TG3_TX_RING_SIZE <<
++ BDINFO_FLAGS_MAXLEN_SHIFT),
++ NIC_SRAM_TX_BUFFER_DESC);
++ txrcb += TG3_BDINFO_SIZE;
++ }
+
+ tg3_set_bdinfo(tp, rxrcb, tnapi->rx_rcb_mapping,
+ (TG3_RX_RCB_RING_SIZE(tp) <<
+ BDINFO_FLAGS_MAXLEN_SHIFT), 0);
+
+ stblk += 8;
+- txrcb += TG3_BDINFO_SIZE;
+ rxrcb += TG3_BDINFO_SIZE;
+ }
+ }
+@@ -8023,7 +8040,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ if (tp->tg3_flags2 & TG3_FLG2_HW_TSO)
+ tw32(SNDDATAI_MODE, SNDDATAI_MODE_ENABLE | 0x8);
+ val = SNDBDI_MODE_ENABLE | SNDBDI_MODE_ATTN_ENABLE;
+- if (tp->tg3_flags2 & TG3_FLG2_USING_MSIX)
++ if (tp->tg3_flags3 & TG3_FLG3_ENABLE_TSS)
+ val |= SNDBDI_MODE_MULTI_TXQ_EN;
+ tw32(SNDBDI_MODE, val);
+ tw32(SNDBDS_MODE, SNDBDS_MODE_ENABLE | SNDBDS_MODE_ATTN_ENABLE);
+@@ -8632,7 +8649,11 @@ static bool tg3_enable_msix(struct tg3 *tp)
+ for (i = 0; i < tp->irq_max; i++)
+ tp->napi[i].irq_vec = msix_ent[i].vector;
+
+- tp->dev->real_num_tx_queues = tp->irq_cnt - 1;
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) {
++ tp->tg3_flags3 |= TG3_FLG3_ENABLE_TSS;
++ tp->dev->real_num_tx_queues = tp->irq_cnt - 1;
++ } else
++ tp->dev->real_num_tx_queues = 1;
+
+ return true;
+ }
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 8972523..8035583 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -2791,6 +2791,7 @@ struct tg3 {
+ #define TG3_FLG3_NO_NVRAM 0x00004000
+ #define TG3_FLG3_PHY_IS_FET 0x00010000
+ #define TG3_FLG3_ENABLE_RSS 0x00020000
++#define TG3_FLG3_ENABLE_TSS 0x00040000
+ #define TG3_FLG3_4G_DMA_BNDRY_BUG 0x00080000
+ #define TG3_FLG3_40BIT_DMA_LIMIT_BUG 0x00100000
+ #define TG3_FLG3_SHORT_DMA_BUG 0x00200000
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0045-tg3-Add-57765-asic-rev.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0045-tg3-Add-57765-asic-rev.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,299 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Thu, 3 Dec 2009 08:36:21 +0000
+Subject: [PATCH 045/207] tg3: Add 57765 asic rev
+
+commit b703df6f628ab63eaa875232551b1f2f0503b9af upstream.
+
+This patch adds the 57765 asic revision.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 72 +++++++++++++++++++++++++++++++++++++++--------------
+ drivers/net/tg3.h | 9 ++++++
+ 2 files changed, 62 insertions(+), 19 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index c877165..2e993bb 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -5514,7 +5514,7 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb,
+ tnapi->tx_buffers[entry].skb = skb;
+ pci_unmap_addr_set(&tnapi->tx_buffers[entry], mapping, mapping);
+
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 &&
++ if ((tp->tg3_flags3 & TG3_FLG3_USE_JUMBO_BDFLAG) &&
+ !mss && skb->len > ETH_DATA_LEN)
+ base_flags |= TXD_FLAG_JMB_PKT;
+
+@@ -5726,7 +5726,7 @@ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb,
+ (vlan_tx_tag_get(skb) << 16));
+ #endif
+
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 &&
++ if ((tp->tg3_flags3 & TG3_FLG3_USE_JUMBO_BDFLAG) &&
+ !mss && skb->len > ETH_DATA_LEN)
+ base_flags |= TXD_FLAG_JMB_PKT;
+
+@@ -6971,7 +6971,8 @@ static int tg3_chip_reset(struct tg3 *tp)
+ if ((tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS) &&
+ tp->pci_chip_rev_id != CHIPREV_ID_5750_A0 &&
+ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5785 &&
+- GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717) {
++ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717 &&
++ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_57765) {
+ val = tr32(0x7c00);
+
+ tw32(0x7c00, val | (1 << 25));
+@@ -7398,6 +7399,8 @@ static void tg3_rings_reset(struct tg3 *tp)
+ /* Disable all transmit rings but the first. */
+ if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS))
+ limit = NIC_SRAM_SEND_RCB + TG3_BDINFO_SIZE * 16;
++ else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
++ limit = NIC_SRAM_SEND_RCB + TG3_BDINFO_SIZE * 2;
+ else
+ limit = NIC_SRAM_SEND_RCB + TG3_BDINFO_SIZE;
+
+@@ -7412,7 +7415,8 @@ static void tg3_rings_reset(struct tg3 *tp)
+ limit = NIC_SRAM_RCV_RET_RCB + TG3_BDINFO_SIZE * 17;
+ else if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS))
+ limit = NIC_SRAM_RCV_RET_RCB + TG3_BDINFO_SIZE * 16;
+- else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755)
++ else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
+ limit = NIC_SRAM_RCV_RET_RCB + TG3_BDINFO_SIZE * 4;
+ else
+ limit = NIC_SRAM_RCV_RET_RCB + TG3_BDINFO_SIZE;
+@@ -7609,7 +7613,8 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ if (err)
+ return err;
+
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) {
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) {
+ val = tr32(TG3PCI_DMA_RW_CTRL) &
+ ~DMA_RWCTRL_DIS_CACHE_ALIGNMENT;
+ tw32(TG3PCI_DMA_RW_CTRL, val | tp->dma_rwctrl);
+@@ -7770,7 +7775,8 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ BDINFO_FLAGS_DISABLED);
+ }
+
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717)
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
+ val = (RX_STD_MAX_SIZE_5705 << BDINFO_FLAGS_MAXLEN_SHIFT) |
+ (RX_STD_MAX_SIZE << 2);
+ else
+@@ -7787,7 +7793,8 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ tp->rx_jumbo_pending : 0;
+ tw32_rx_mbox(TG3_RX_JMB_PROD_IDX_REG, tpr->rx_jmb_prod_idx);
+
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) {
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) {
+ tw32(STD_REPLENISH_LWM, 32);
+ tw32(JMB_REPLENISH_LWM, 16);
+ }
+@@ -8464,7 +8471,8 @@ static int tg3_test_interrupt(struct tg3 *tp)
+ * Turn off MSI one shot mode. Otherwise this test has no
+ * observable way to know whether the interrupt was delivered.
+ */
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 &&
++ if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) &&
+ (tp->tg3_flags2 & TG3_FLG2_USING_MSI)) {
+ val = tr32(MSGINT_MODE) | MSGINT_MODE_ONE_SHOT_DISABLE;
+ tw32(MSGINT_MODE, val);
+@@ -8507,7 +8515,8 @@ static int tg3_test_interrupt(struct tg3 *tp)
+
+ if (intr_ok) {
+ /* Reenable MSI one shot mode. */
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 &&
++ if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) &&
+ (tp->tg3_flags2 & TG3_FLG2_USING_MSI)) {
+ val = tr32(MSGINT_MODE) & ~MSGINT_MODE_ONE_SHOT_DISABLE;
+ tw32(MSGINT_MODE, val);
+@@ -8804,6 +8813,7 @@ static int tg3_open(struct net_device *dev)
+ }
+
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717 &&
++ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_57765 &&
+ (tp->tg3_flags2 & TG3_FLG2_USING_MSI) &&
+ (tp->tg3_flags2 & TG3_FLG2_1SHOT_MSI)) {
+ u32 val = tr32(PCIE_TRANSACTION_CFG);
+@@ -11698,7 +11708,8 @@ static void __devinit tg3_nvram_init(struct tg3 *tp)
+ tg3_get_5761_nvram_info(tp);
+ else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
+ tg3_get_5906_nvram_info(tp);
+- else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780)
++ else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
+ tg3_get_57780_nvram_info(tp);
+ else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717)
+ tg3_get_5717_nvram_info(tp);
+@@ -12532,6 +12543,8 @@ out_not_found:
+ else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 &&
+ tp->pdev->device == TG3PCI_DEVICE_TIGON3_57788)
+ strcpy(tp->board_part_number, "BCM57788");
++ else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
++ strcpy(tp->board_part_number, "BCM57765");
+ else
+ strcpy(tp->board_part_number, "none");
+ }
+@@ -12821,6 +12834,15 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ pci_read_config_dword(tp->pdev,
+ TG3PCI_GEN2_PRODID_ASICREV,
+ &prod_id_asic_rev);
++ else if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_57781 ||
++ tp->pdev->device == TG3PCI_DEVICE_TIGON3_57785 ||
++ tp->pdev->device == TG3PCI_DEVICE_TIGON3_57761 ||
++ tp->pdev->device == TG3PCI_DEVICE_TIGON3_57765 ||
++ tp->pdev->device == TG3PCI_DEVICE_TIGON3_57791 ||
++ tp->pdev->device == TG3PCI_DEVICE_TIGON3_57795)
++ pci_read_config_dword(tp->pdev,
++ TG3PCI_GEN15_PRODID_ASICREV,
++ &prod_id_asic_rev);
+ else
+ pci_read_config_dword(tp->pdev, TG3PCI_PRODID_ASICREV,
+ &prod_id_asic_rev);
+@@ -12974,7 +12996,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717)
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
+ tp->tg3_flags3 |= TG3_FLG3_5755_PLUS;
+
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750 ||
+@@ -13001,7 +13024,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ }
+
+ /* Determine TSO capabilities */
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717)
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
+ tp->tg3_flags2 |= TG3_FLG2_HW_TSO_3;
+ else if ((tp->tg3_flags3 & TG3_FLG3_5755_PLUS) ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
+@@ -13037,7 +13061,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ tp->tg3_flags2 |= TG3_FLG2_1SHOT_MSI;
+ }
+
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) {
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) {
+ tp->tg3_flags |= TG3_FLAG_SUPPORT_MSIX;
+ tp->irq_max = TG3_IRQ_MAX_VECS;
+ }
+@@ -13051,9 +13076,13 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ tp->tg3_flags3 |= TG3_FLG3_40BIT_DMA_LIMIT_BUG;
+ }
+
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
++ tp->tg3_flags3 |= TG3_FLG3_USE_JUMBO_BDFLAG;
++
+ if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS) ||
+ (tp->tg3_flags2 & TG3_FLG2_5780_CLASS) ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717)
++ (tp->tg3_flags3 & TG3_FLG3_USE_JUMBO_BDFLAG))
+ tp->tg3_flags |= TG3_FLAG_JUMBO_CAPABLE;
+
+ pci_read_config_dword(tp->pdev, TG3PCI_PCISTATE,
+@@ -13246,7 +13275,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717)
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
+ tp->tg3_flags |= TG3_FLAG_CPMU_PRESENT;
+
+ /* Set up tp->grc_local_ctrl before calling tg3_set_power_state().
+@@ -13325,7 +13355,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ !(tp->tg3_flags3 & TG3_FLG3_PHY_IS_FET) &&
+ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5785 &&
+ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_57780 &&
+- GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717) {
++ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717 &&
++ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_57765) {
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 ||
+@@ -13649,7 +13680,8 @@ static u32 __devinit tg3_calc_dma_bndry(struct tg3 *tp, u32 val)
+ #endif
+ #endif
+
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) {
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) {
+ val = goal ? 0 : DMA_RWCTRL_DIS_CACHE_ALIGNMENT;
+ goto out;
+ }
+@@ -13861,7 +13893,8 @@ static int __devinit tg3_test_dma(struct tg3 *tp)
+
+ tp->dma_rwctrl = tg3_calc_dma_bndry(tp, tp->dma_rwctrl);
+
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717)
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
+ goto out;
+
+ if (tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS) {
+@@ -14054,7 +14087,8 @@ static void __devinit tg3_init_link_config(struct tg3 *tp)
+ static void __devinit tg3_init_bufmgr_config(struct tg3 *tp)
+ {
+ if (tp->tg3_flags2 & TG3_FLG2_5705_PLUS &&
+- GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717) {
++ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717 &&
++ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_57765) {
+ tp->bufmgr_config.mbuf_read_dma_low_water =
+ DEFAULT_MB_RDMA_LOW_WATER_5705;
+ tp->bufmgr_config.mbuf_mac_rx_low_water =
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 8035583..6a2c310 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -49,6 +49,12 @@
+ #define TG3PCI_DEVICE_TIGON3_5717 0x1655
+ #define TG3PCI_DEVICE_TIGON3_5718 0x1656
+ #define TG3PCI_DEVICE_TIGON3_5724 0x165c
++#define TG3PCI_DEVICE_TIGON3_57781 0x16b1
++#define TG3PCI_DEVICE_TIGON3_57785 0x16b5
++#define TG3PCI_DEVICE_TIGON3_57761 0x16b0
++#define TG3PCI_DEVICE_TIGON3_57765 0x16b4
++#define TG3PCI_DEVICE_TIGON3_57791 0x16b2
++#define TG3PCI_DEVICE_TIGON3_57795 0x16b6
+ /* 0x04 --> 0x64 unused */
+ #define TG3PCI_MSI_DATA 0x00000064
+ /* 0x66 --> 0x68 unused */
+@@ -122,6 +128,7 @@
+ #define ASIC_REV_5785 0x5785
+ #define ASIC_REV_57780 0x57780
+ #define ASIC_REV_5717 0x5717
++#define ASIC_REV_57765 0x57785
+ #define GET_CHIP_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 8)
+ #define CHIPREV_5700_AX 0x70
+ #define CHIPREV_5700_BX 0x71
+@@ -220,6 +227,7 @@
+ /* 0xc0 --> 0xf4 unused */
+
+ #define TG3PCI_GEN2_PRODID_ASICREV 0x000000f4
++#define TG3PCI_GEN15_PRODID_ASICREV 0x000000fc
+ /* 0xf8 --> 0x200 unused */
+
+ #define TG3_CORR_ERR_STAT 0x00000110
+@@ -2795,6 +2803,7 @@ struct tg3 {
+ #define TG3_FLG3_4G_DMA_BNDRY_BUG 0x00080000
+ #define TG3_FLG3_40BIT_DMA_LIMIT_BUG 0x00100000
+ #define TG3_FLG3_SHORT_DMA_BUG 0x00200000
++#define TG3_FLG3_USE_JUMBO_BDFLAG 0x00400000
+
+ struct timer_list timer;
+ u16 timer_counter;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0046-tg3-Add-some-VPD-preprocessor-constants.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0046-tg3-Add-some-VPD-preprocessor-constants.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,136 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Thu, 3 Dec 2009 08:36:22 +0000
+Subject: [PATCH 046/207] tg3: Add some VPD preprocessor constants
+
+commit 141518c95870228da4e050fbe31a8f0c9df82c72 upstream.
+
+This patch cleans up the VPD code by creating preprocessor definitions
+and using them in the place of hardcoded constants.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 15 ++++++++-------
+ drivers/net/tg3.h | 10 ++++++++--
+ include/linux/ethtool.h | 3 ++-
+ 3 files changed, 18 insertions(+), 10 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 2e993bb..534f8a7 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -12434,7 +12434,7 @@ skip_phy_reset:
+
+ static void __devinit tg3_read_partno(struct tg3 *tp)
+ {
+- unsigned char vpd_data[256]; /* in little-endian format */
++ unsigned char vpd_data[TG3_NVM_VPD_LEN]; /* in little-endian format */
+ unsigned int i;
+ u32 magic;
+
+@@ -12443,14 +12443,14 @@ static void __devinit tg3_read_partno(struct tg3 *tp)
+ goto out_not_found;
+
+ if (magic == TG3_EEPROM_MAGIC) {
+- for (i = 0; i < 256; i += 4) {
++ for (i = 0; i < TG3_NVM_VPD_LEN; i += 4) {
+ u32 tmp;
+
+ /* The data is in little-endian format in NVRAM.
+ * Use the big-endian read routines to preserve
+ * the byte order as it exists in NVRAM.
+ */
+- if (tg3_nvram_read_be32(tp, 0x100 + i, &tmp))
++ if (tg3_nvram_read_be32(tp, TG3_NVM_VPD_OFF + i, &tmp))
+ goto out_not_found;
+
+ memcpy(&vpd_data[i], &tmp, sizeof(tmp));
+@@ -12459,7 +12459,7 @@ static void __devinit tg3_read_partno(struct tg3 *tp)
+ int vpd_cap;
+
+ vpd_cap = pci_find_capability(tp->pdev, PCI_CAP_ID_VPD);
+- for (i = 0; i < 256; i += 4) {
++ for (i = 0; i < TG3_NVM_VPD_LEN; i += 4) {
+ u32 tmp, j = 0;
+ __le32 v;
+ u16 tmp16;
+@@ -12484,7 +12484,7 @@ static void __devinit tg3_read_partno(struct tg3 *tp)
+ }
+
+ /* Now parse and find the part number. */
+- for (i = 0; i < 254; ) {
++ for (i = 0; i < TG3_NVM_VPD_LEN - 2; ) {
+ unsigned char val = vpd_data[i];
+ unsigned int block_end;
+
+@@ -12503,7 +12503,7 @@ static void __devinit tg3_read_partno(struct tg3 *tp)
+ (vpd_data[i + 2] << 8)));
+ i += 3;
+
+- if (block_end > 256)
++ if (block_end > TG3_NVM_VPD_LEN)
+ goto out_not_found;
+
+ while (i < (block_end - 2)) {
+@@ -12512,7 +12512,8 @@ static void __devinit tg3_read_partno(struct tg3 *tp)
+ int partno_len = vpd_data[i + 2];
+
+ i += 3;
+- if (partno_len > 24 || (partno_len + i) > 256)
++ if (partno_len > TG3_BPN_SIZE ||
++ (partno_len + i) > TG3_NVM_VPD_LEN)
+ goto out_not_found;
+
+ memcpy(tp->board_part_number,
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 6a2c310..cd30889 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -1821,6 +1821,11 @@
+
+ #define TG3_OTP_DEFAULT 0x286c1640
+
++
++/* Hardware Legacy NVRAM layout */
++#define TG3_NVM_VPD_OFF 0x100
++#define TG3_NVM_VPD_LEN 256
++
+ /* Hardware Selfboot NVRAM layout */
+ #define TG3_NVM_HWSB_CFG1 0x00000004
+ #define TG3_NVM_HWSB_CFG1_MAJMSK 0xf8000000
+@@ -2893,8 +2898,9 @@ struct tg3 {
+ u32 led_ctrl;
+ u32 phy_otp;
+
+- char board_part_number[24];
+-#define TG3_VER_SIZE 32
++#define TG3_BPN_SIZE 24
++ char board_part_number[TG3_BPN_SIZE];
++#define TG3_VER_SIZE ETHTOOL_FWVERS_LEN
+ char fw_ver[TG3_VER_SIZE];
+ u32 nic_sram_data_cfg;
+ u32 pci_clock_ctrl;
+diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
+index ef6eb55..6ab8f51 100644
+--- a/include/linux/ethtool.h
++++ b/include/linux/ethtool.h
+@@ -49,13 +49,14 @@ static inline __u32 ethtool_cmd_speed(struct ethtool_cmd *ep)
+ return (ep->speed_hi << 16) | ep->speed;
+ }
+
++#define ETHTOOL_FWVERS_LEN 32
+ #define ETHTOOL_BUSINFO_LEN 32
+ /* these strings are set to whatever the driver author decides... */
+ struct ethtool_drvinfo {
+ __u32 cmd;
+ char driver[32]; /* driver short name, "tulip", "eepro100" */
+ char version[32]; /* driver version string */
+- char fw_version[32]; /* firmware version string, if applicable */
++ char fw_version[ETHTOOL_FWVERS_LEN]; /* firmware version string */
+ char bus_info[ETHTOOL_BUSINFO_LEN]; /* Bus info for this IF. */
+ /* For PCI devices, use pci_name(pci_dev). */
+ char reserved1[32];
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0047-tg3-Use-pci_read_vpd-instead-of-private-method.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0047-tg3-Use-pci_read_vpd-instead-of-private-method.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,69 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Thu, 3 Dec 2009 08:36:23 +0000
+Subject: [PATCH 047/207] tg3: Use pci_read_vpd() instead of private method
+
+commit 94c982bd9f07b801f03cebe32b20f893b4ad6d27 upstream.
+
+If the driver needs to use PCI configuration space to read the VPD data,
+the accesses could collide with the pci_read_vpd() function. This patch
+converts the driver to use pci_read_vpd() to avoid any potential
+collisions.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 35 ++++++++++++-----------------------
+ 1 files changed, 12 insertions(+), 23 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 534f8a7..0c8ce6b 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -12456,31 +12456,20 @@ static void __devinit tg3_read_partno(struct tg3 *tp)
+ memcpy(&vpd_data[i], &tmp, sizeof(tmp));
+ }
+ } else {
+- int vpd_cap;
+-
+- vpd_cap = pci_find_capability(tp->pdev, PCI_CAP_ID_VPD);
+- for (i = 0; i < TG3_NVM_VPD_LEN; i += 4) {
+- u32 tmp, j = 0;
+- __le32 v;
+- u16 tmp16;
+-
+- pci_write_config_word(tp->pdev, vpd_cap + PCI_VPD_ADDR,
+- i);
+- while (j++ < 100) {
+- pci_read_config_word(tp->pdev, vpd_cap +
+- PCI_VPD_ADDR, &tmp16);
+- if (tmp16 & 0x8000)
+- break;
+- msleep(1);
+- }
+- if (!(tmp16 & 0x8000))
++ ssize_t cnt;
++ unsigned int pos = 0, i = 0;
++
++ for (; pos < TG3_NVM_VPD_LEN && i < 3; i++, pos += cnt) {
++ cnt = pci_read_vpd(tp->pdev, pos,
++ TG3_NVM_VPD_LEN - pos,
++ &vpd_data[pos]);
++ if (cnt == -ETIMEDOUT || -EINTR)
++ cnt = 0;
++ else if (cnt < 0)
+ goto out_not_found;
+-
+- pci_read_config_dword(tp->pdev, vpd_cap + PCI_VPD_DATA,
+- &tmp);
+- v = cpu_to_le32(tmp);
+- memcpy(&vpd_data[i], &v, sizeof(v));
+ }
++ if (pos != TG3_NVM_VPD_LEN)
++ goto out_not_found;
+ }
+
+ /* Now parse and find the part number. */
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0048-tg3-Clean-tg3_init_one.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0048-tg3-Clean-tg3_init_one.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,52 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Thu, 3 Dec 2009 08:36:24 +0000
+Subject: [PATCH 048/207] tg3: Clean tg3_init_one()
+
+commit 026a6c21646cf77ea838f3c121de29cdf948ca71 upstream.
+
+Tg3's firmware is no longer loaded from tg3_init_one(). Remove the
+error path that releases the firmware back to the system.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 8 ++------
+ 1 files changed, 2 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 0c8ce6b..de29a9c 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -14483,7 +14483,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
+ if (err) {
+ printk(KERN_ERR PFX "Could not obtain valid ethernet address, "
+ "aborting.\n");
+- goto err_out_fw;
++ goto err_out_iounmap;
+ }
+
+ if (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE) {
+@@ -14492,7 +14492,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
+ printk(KERN_ERR PFX "Cannot map APE registers, "
+ "aborting.\n");
+ err = -ENOMEM;
+- goto err_out_fw;
++ goto err_out_iounmap;
+ }
+
+ tg3_ape_lock_init(tp);
+@@ -14623,10 +14623,6 @@ err_out_apeunmap:
+ tp->aperegs = NULL;
+ }
+
+-err_out_fw:
+- if (tp->fw)
+- release_firmware(tp->fw);
+-
+ err_out_iounmap:
+ if (tp->regs) {
+ iounmap(tp->regs);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0049-tg3-Update-version-to-3.105.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0049-tg3-Update-version-to-3.105.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,33 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Thu, 3 Dec 2009 08:36:25 +0000
+Subject: [PATCH 049/207] tg3: Update version to 3.105
+
+commit cceea982ef78cf358b70f3412a6799f153211e14 upstream.
+
+This patch updates the tg3 version to 3.105.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index de29a9c..7cfc286f 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -68,8 +68,8 @@
+
+ #define DRV_MODULE_NAME "tg3"
+ #define PFX DRV_MODULE_NAME ": "
+-#define DRV_MODULE_VERSION "3.104"
+-#define DRV_MODULE_RELDATE "November 13, 2009"
++#define DRV_MODULE_VERSION "3.105"
++#define DRV_MODULE_RELDATE "December 2, 2009"
+
+ #define TG3_DEF_MAC_MODE 0
+ #define TG3_DEF_RX_MODE 0
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0050-broadcom-bcm54xx_shadow_read-errors-ignored-in-bcm54.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0050-broadcom-bcm54xx_shadow_read-errors-ignored-in-bcm54.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,33 @@
+From: Roel Kluin <roel.kluin at gmail.com>
+Date: Fri, 18 Dec 2009 20:16:10 -0800
+Subject: [PATCH 050/207] broadcom: bcm54xx_shadow_read() errors ignored in
+ bcm54xx_adjust_rxrefclk()
+
+commit 5ee6f6a17cfde9c3141e4d57cf88b5cdf638b463 upstream.
+
+If not signed read errors are ignored.
+
+Signed-off-by: Roel Kluin <roel.kluin at gmail.com>
+Acked-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/phy/broadcom.c | 3 ++-
+ 1 files changed, 2 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c
+index f433a2e..996ec9e 100644
+--- a/drivers/net/phy/broadcom.c
++++ b/drivers/net/phy/broadcom.c
+@@ -326,7 +326,8 @@ error:
+
+ static void bcm54xx_adjust_rxrefclk(struct phy_device *phydev)
+ {
+- u32 val, orig;
++ u32 orig;
++ int val;
+ bool clk125en = true;
+
+ /* Abort if we are using an untested phy. */
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0051-broadcom-Fix-confusion-in-bcm54xx_adjust_rxrefclk.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0051-broadcom-Fix-confusion-in-bcm54xx_adjust_rxrefclk.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,33 @@
+From: roel kluin <roel.kluin at gmail.com>
+Date: Wed, 30 Dec 2009 06:43:06 +0000
+Subject: [PATCH 051/207] broadcom: Fix &&/|| confusion in
+ bcm54xx_adjust_rxrefclk()
+
+commit 7ec4e7d3cfee9d7846dbd02ad442c40cb58512e8 upstream.
+
+This always evaluates to true.
+
+Signed-off-by: Roel Kluin <roel.kluin at gmail.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/phy/broadcom.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c
+index 996ec9e..f1939c3 100644
+--- a/drivers/net/phy/broadcom.c
++++ b/drivers/net/phy/broadcom.c
+@@ -331,8 +331,8 @@ static void bcm54xx_adjust_rxrefclk(struct phy_device *phydev)
+ bool clk125en = true;
+
+ /* Abort if we are using an untested phy. */
+- if (BRCM_PHY_MODEL(phydev) != PHY_ID_BCM57780 ||
+- BRCM_PHY_MODEL(phydev) != PHY_ID_BCM50610 ||
++ if (BRCM_PHY_MODEL(phydev) != PHY_ID_BCM57780 &&
++ BRCM_PHY_MODEL(phydev) != PHY_ID_BCM50610 &&
+ BRCM_PHY_MODEL(phydev) != PHY_ID_BCM50610M)
+ return;
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0052-drivers-net-use-DEFINE_PCI_DEVICE_TABLE.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0052-drivers-net-use-DEFINE_PCI_DEVICE_TABLE.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,32 @@
+From: Alexey Dobriyan <adobriyan at gmail.com>
+Date: Thu, 7 Jan 2010 11:58:11 +0000
+Subject: [PATCH 052/207] drivers/net/: use DEFINE_PCI_DEVICE_TABLE()
+
+commit a3aa18842a5303fc28fcc4d57dbd16618bd830a0 upstream.
+
+Use DEFINE_PCI_DEVICE_TABLE() so we get place PCI ids table into correct section
+in every case.
+
+Signed-off-by: Alexey Dobriyan <adobriyan at gmail.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Restricted to drivers/net/tg3.{c,h}]
+---
+ drivers/net/tg3.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 7cfc286f..f61c4f3 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -174,7 +174,7 @@ static int tg3_debug = -1; /* -1 == use TG3_DEF_MSG_ENABLE as value */
+ module_param(tg3_debug, int, 0);
+ MODULE_PARM_DESC(tg3_debug, "Tigon3 bitmapped debugging message enable value");
+
+-static struct pci_device_id tg3_pci_tbl[] = {
++static DEFINE_PCI_DEVICE_TABLE(tg3_pci_tbl) = {
+ {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5700)},
+ {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5701)},
+ {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5702)},
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0053-tg3-Fix-std-prod-ring-nicaddr-for-5787-and-57765.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0053-tg3-Fix-std-prod-ring-nicaddr-for-5787-and-57765.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,38 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Tue, 12 Jan 2010 10:11:36 +0000
+Subject: [PATCH 053/207] tg3: Fix std prod ring nicaddr for 5787 and 57765
+
+commit 13fa95b0398d65885a79c6e95a09976ee9f8c009 upstream.
+
+Commit 87668d352aa8d135bd695a050f18bbfc7b50b506, titled "tg3: Don't
+touch RCB nic addresses", tried to avoid assigning the nic address of
+the standard producer ring. Unfortunately, the default nic address is
+not correct for the 5787, the 5755M, or the 57765. This patch
+reenables the old behavior and opts out of the assignment only
+for the 5717.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Tested-by: Chow Loong Jin <hyperair at ubuntu.com>
+Tested-by: Dmitry Torokhov <dtor at mail.ru>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index f61c4f3..da91b81 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -7742,7 +7742,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ ((u64) tpr->rx_std_mapping >> 32));
+ tw32(RCVDBDI_STD_BD + TG3_BDINFO_HOST_ADDR + TG3_64BIT_REG_LOW,
+ ((u64) tpr->rx_std_mapping & 0xffffffff));
+- if (!(tp->tg3_flags3 & TG3_FLG3_5755_PLUS))
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717)
+ tw32(RCVDBDI_STD_BD + TG3_BDINFO_NIC_ADDR,
+ NIC_SRAM_RX_BUFFER_DESC);
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0054-tg3-Fix-std-rx-prod-ring-handling.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0054-tg3-Fix-std-rx-prod-ring-handling.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,50 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Tue, 12 Jan 2010 10:11:37 +0000
+Subject: [PATCH 054/207] tg3: Fix std rx prod ring handling
+
+commit 86cfe4ff02a51294cb2c974a8bedc7f648491df9 upstream.
+
+There are some tg3 devices that require the driver to post new rx
+buffers in smaller increments. Commit
+4361935afe3abc3e5a93006b99197fac1fabbd50, "tg3: Consider
+rx_std_prod_idx a hw mailbox" changed how the driver tracks the rx
+producer ring updates, but it does not make any special considerations
+for the above-mentioned devices. For those devices, it is possible for
+the driver to hit the special case path, which updates the hardware
+mailbox register but skips updating the shadow software mailbox member.
+If the special case path represents the final mailbox update for this
+ISR iteration, the hardware and software mailbox values will be out of
+sync. Ultimately, this will cause the driver to use a stale mailbox
+value on the next iteration, which will appear to the hardware as a
+large rx buffer update. Bad things ensue.
+
+The fix is to update the software shadow mailbox member when the special
+case path is taken.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Reported-by: Dmitry Torokhov <dmitry.torokhov at gmail.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 5 +++--
+ 1 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index da91b81..e1f33ea 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -4693,8 +4693,9 @@ next_pkt:
+ (*post_ptr)++;
+
+ if (unlikely(rx_std_posted >= tp->rx_std_max_post)) {
+- u32 idx = *post_ptr % TG3_RX_RING_SIZE;
+- tw32_rx_mbox(TG3_RX_STD_PROD_IDX_REG, idx);
++ tpr->rx_std_prod_idx = std_prod_idx % TG3_RX_RING_SIZE;
++ tw32_rx_mbox(TG3_RX_STD_PROD_IDX_REG,
++ tpr->rx_std_prod_idx);
+ work_mask &= ~RXD_OPAQUE_RING_STD;
+ rx_std_posted = 0;
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0055-tg3-Add-reliable-serdes-detection-for-5717-A0.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0055-tg3-Add-reliable-serdes-detection-for-5717-A0.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,61 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Tue, 12 Jan 2010 10:11:38 +0000
+Subject: [PATCH 055/207] tg3: Add reliable serdes detection for 5717 A0
+
+commit d1ec96af77df611d1728f3bb70289f83a02df1ea upstream.
+
+The serdes status bit does not work as intended for the 5717 A0.
+This patch implements an alternative detection scheme that will only be
+valid for A0 revisions.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 9 +++++++--
+ drivers/net/tg3.h | 2 ++
+ 2 files changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index e1f33ea..9f5c7f4 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -1037,7 +1037,11 @@ static void tg3_mdio_start(struct tg3 *tp)
+ else
+ tp->phy_addr = 1;
+
+- is_serdes = tr32(SG_DIG_STATUS) & SG_DIG_IS_SERDES;
++ if (tp->pci_chip_rev_id != CHIPREV_ID_5717_A0)
++ is_serdes = tr32(SG_DIG_STATUS) & SG_DIG_IS_SERDES;
++ else
++ is_serdes = tr32(TG3_CPMU_PHY_STRAP) &
++ TG3_CPMU_PHY_STRAP_IS_SERDES;
+ if (is_serdes)
+ tp->phy_addr += 7;
+ } else
+@@ -12124,7 +12128,8 @@ static void __devinit tg3_get_eeprom_hw_cfg(struct tg3 *tp)
+
+ tp->phy_id = eeprom_phy_id;
+ if (eeprom_phy_serdes) {
+- if (tp->tg3_flags2 & TG3_FLG2_5780_CLASS)
++ if ((tp->tg3_flags2 & TG3_FLG2_5780_CLASS) ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717)
+ tp->tg3_flags2 |= TG3_FLG2_MII_SERDES;
+ else
+ tp->tg3_flags2 |= TG3_FLG2_PHY_SERDES;
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index cd30889..43ed41b 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -1054,6 +1054,8 @@
+ #define CPMU_MUTEX_REQ_DRIVER 0x00001000
+ #define TG3_CPMU_MUTEX_GNT 0x00003660
+ #define CPMU_MUTEX_GNT_DRIVER 0x00001000
++#define TG3_CPMU_PHY_STRAP 0x00003664
++#define TG3_CPMU_PHY_STRAP_IS_SERDES 0x00000020
+ /* 0x3664 --> 0x3800 unused */
+
+ /* Mbuf cluster free registers */
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0056-tg3-Disable-5717-serdes-and-B0-support.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0056-tg3-Disable-5717-serdes-and-B0-support.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,38 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Tue, 12 Jan 2010 10:11:39 +0000
+Subject: [PATCH 056/207] tg3: Disable 5717 serdes and B0 support
+
+commit 55dffe79b34e2af98bd1315f1e00c2fc6a7a7078 upstream.
+
+The B0 revision of the 5717 will not get enough testing by the time
+2.6.33 ships. Since the kernel is already at RC3, serdes support
+will require too many patches to fix. For these reasons, this patch
+disables 5717 serdes support and will refuse to attach to all 5717
+devices that are later than an A0 revision.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 5 +++++
+ 1 files changed, 5 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 9f5c7f4..346b3a3 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -13391,6 +13391,11 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ if (err)
+ return err;
+
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 &&
++ (tp->pci_chip_rev_id != CHIPREV_ID_5717_A0 ||
++ (tp->tg3_flags2 & TG3_FLG2_MII_SERDES)))
++ return -ENOTSUPP;
++
+ /* Initialize data/descriptor byte/word swapping. */
+ val = tr32(GRC_MODE);
+ val &= GRC_MODE_HOST_STACKUP;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0057-tg3-Update-copyright-and-driver-version.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0057-tg3-Update-copyright-and-driver-version.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,56 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Tue, 12 Jan 2010 10:11:40 +0000
+Subject: [PATCH 057/207] tg3: Update copyright and driver version
+
+commit ba5b0bfa06b6fbee03c6889046e9adcefa5d2c20 upstream.
+
+This patch updates the copyright notice for 2010 and updates the version
+number to 3.106.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 6 +++---
+ drivers/net/tg3.h | 1 +
+ 2 files changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 346b3a3..0e6bac0 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -4,7 +4,7 @@
+ * Copyright (C) 2001, 2002, 2003, 2004 David S. Miller (davem at redhat.com)
+ * Copyright (C) 2001, 2002, 2003 Jeff Garzik (jgarzik at pobox.com)
+ * Copyright (C) 2004 Sun Microsystems Inc.
+- * Copyright (C) 2005-2009 Broadcom Corporation.
++ * Copyright (C) 2005-2010 Broadcom Corporation.
+ *
+ * Firmware is:
+ * Derived from proprietary unpublished source code,
+@@ -68,8 +68,8 @@
+
+ #define DRV_MODULE_NAME "tg3"
+ #define PFX DRV_MODULE_NAME ": "
+-#define DRV_MODULE_VERSION "3.105"
+-#define DRV_MODULE_RELDATE "December 2, 2009"
++#define DRV_MODULE_VERSION "3.106"
++#define DRV_MODULE_RELDATE "January 12, 2010"
+
+ #define TG3_DEF_MAC_MODE 0
+ #define TG3_DEF_RX_MODE 0
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 43ed41b..8a16791 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -4,6 +4,7 @@
+ * Copyright (C) 2001, 2002, 2003, 2004 David S. Miller (davem at redhat.com)
+ * Copyright (C) 2001 Jeff Garzik (jgarzik at pobox.com)
+ * Copyright (C) 2004 Sun Microsystems Inc.
++ * Copyright (C) 2007-2010 Broadcom Corporation.
+ */
+
+ #ifndef _T3_H
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0058-tg3-Enable-PLL-PD-when-CLKREQ-disabled-for-5717A0.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0058-tg3-Enable-PLL-PD-when-CLKREQ-disabled-for-5717A0.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,103 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Wed, 20 Jan 2010 16:58:02 +0000
+Subject: [PATCH 058/207] tg3: Enable PLL PD when CLKREQ disabled for 5717A0
+
+commit 614b05900ec3516b835cd06f848ef6bc915beeea upstream.
+
+PCIe PLL power down cannot be used if CLKREQ is enabled because data
+corruption will occur. If CLKREQ is disabled though, enabling PCIE P1
+PLL power-down saves some power.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: Michael Chan <mchan at broadcom.com>
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 16 ++++++++++++++++
+ drivers/net/tg3.h | 14 ++++++++++++++
+ 2 files changed, 30 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 0e6bac0..fe09b96 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -7574,6 +7574,20 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ tw32(TG3_PCIE_LNKCTL, val | TG3_PCIE_LNKCTL_L1_PLL_PD_DIS);
+ }
+
++ if (tp->tg3_flags3 & TG3_FLG3_L1PLLPD_EN) {
++ u32 grc_mode = tr32(GRC_MODE);
++
++ /* Access the lower 1K of PL PCIE block registers. */
++ val = grc_mode & ~GRC_MODE_PCIE_PORT_MASK;
++ tw32(GRC_MODE, val | GRC_MODE_PCIE_PL_SEL);
++
++ val = tr32(TG3_PCIE_TLDLPL_PORT + TG3_PCIE_PL_LO_PHYCTL1);
++ tw32(TG3_PCIE_TLDLPL_PORT + TG3_PCIE_PL_LO_PHYCTL1,
++ val | TG3_PCIE_PL_LO_PHYCTL1_L1PLLPD_EN);
++
++ tw32(GRC_MODE, grc_mode);
++ }
++
+ /* This works around an issue with Athlon chipsets on
+ * B3 tigon3 silicon. This bit has no effect on any
+ * other revision. But do not set this on PCI Express
+@@ -13103,6 +13117,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ tp->pci_chip_rev_id == CHIPREV_ID_57780_A0 ||
+ tp->pci_chip_rev_id == CHIPREV_ID_57780_A1)
+ tp->tg3_flags3 |= TG3_FLG3_CLKREQ_BUG;
++ } else if (tp->pci_chip_rev_id == CHIPREV_ID_5717_A0) {
++ tp->tg3_flags3 |= TG3_FLG3_L1PLLPD_EN;
+ }
+ } else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785) {
+ tp->tg3_flags2 |= TG3_FLG2_PCI_EXPRESS;
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 8a16791..4f4d0ac 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -1543,6 +1543,8 @@
+ #define GRC_MODE_HOST_SENDBDS 0x00020000
+ #define GRC_MODE_NO_TX_PHDR_CSUM 0x00100000
+ #define GRC_MODE_NVRAM_WR_ENABLE 0x00200000
++#define GRC_MODE_PCIE_TL_SEL 0x00000000
++#define GRC_MODE_PCIE_PL_SEL 0x00400000
+ #define GRC_MODE_NO_RX_PHDR_CSUM 0x00800000
+ #define GRC_MODE_IRQ_ON_TX_CPU_ATTN 0x01000000
+ #define GRC_MODE_IRQ_ON_RX_CPU_ATTN 0x02000000
+@@ -1550,7 +1552,13 @@
+ #define GRC_MODE_IRQ_ON_DMA_ATTN 0x08000000
+ #define GRC_MODE_IRQ_ON_FLOW_ATTN 0x10000000
+ #define GRC_MODE_4X_NIC_SEND_RINGS 0x20000000
++#define GRC_MODE_PCIE_DL_SEL 0x20000000
+ #define GRC_MODE_MCAST_FRM_ENABLE 0x40000000
++#define GRC_MODE_PCIE_HI_1K_EN 0x80000000
++#define GRC_MODE_PCIE_PORT_MASK (GRC_MODE_PCIE_TL_SEL | \
++ GRC_MODE_PCIE_PL_SEL | \
++ GRC_MODE_PCIE_DL_SEL | \
++ GRC_MODE_PCIE_HI_1K_EN)
+ #define GRC_MISC_CFG 0x00006804
+ #define GRC_MISC_CFG_CORECLK_RESET 0x00000001
+ #define GRC_MISC_CFG_PRESCALAR_MASK 0x000000fe
+@@ -1804,6 +1812,11 @@
+ /* 0x7e74 --> 0x8000 unused */
+
+
++/* Alternate PCIE definitions */
++#define TG3_PCIE_TLDLPL_PORT 0x00007c00
++#define TG3_PCIE_PL_LO_PHYCTL1 0x00000004
++#define TG3_PCIE_PL_LO_PHYCTL1_L1PLLPD_EN 0x00001000
++
+ /* OTP bit definitions */
+ #define TG3_OTP_AGCTGT_MASK 0x000000e0
+ #define TG3_OTP_AGCTGT_SHIFT 1
+@@ -2812,6 +2825,7 @@ struct tg3 {
+ #define TG3_FLG3_40BIT_DMA_LIMIT_BUG 0x00100000
+ #define TG3_FLG3_SHORT_DMA_BUG 0x00200000
+ #define TG3_FLG3_USE_JUMBO_BDFLAG 0x00400000
++#define TG3_FLG3_L1PLLPD_EN 0x00800000
+
+ struct timer_list timer;
+ u16 timer_counter;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0059-tg3-Improve-internal-resource-allocations.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0059-tg3-Improve-internal-resource-allocations.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,88 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Wed, 20 Jan 2010 16:58:03 +0000
+Subject: [PATCH 059/207] tg3: Improve internal resource allocations
+
+commit 666bc831cf820e16cbd0c2d5be780c512b1afe15 upstream.
+
+The 5717 and the 57765 have more resources at their disposal internally.
+This patch tunes the driver to get better performance. The adjustments
+made here only apply to the 57765 and 5717 asic revs.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 25 +++++++++++++++++++++----
+ drivers/net/tg3.h | 4 ++++
+ 2 files changed, 25 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index fe09b96..e257152 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -8157,7 +8157,11 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ /* Prevent chip from dropping frames when flow control
+ * is enabled.
+ */
+- tw32_f(MAC_LOW_WMARK_MAX_RX_FRAME, 2);
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
++ val = 1;
++ else
++ val = 2;
++ tw32_f(MAC_LOW_WMARK_MAX_RX_FRAME, val);
+
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704 &&
+ (tp->tg3_flags2 & TG3_FLG2_PHY_SERDES)) {
+@@ -14103,9 +14107,22 @@ static void __devinit tg3_init_link_config(struct tg3 *tp)
+
+ static void __devinit tg3_init_bufmgr_config(struct tg3 *tp)
+ {
+- if (tp->tg3_flags2 & TG3_FLG2_5705_PLUS &&
+- GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717 &&
+- GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_57765) {
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) {
++ tp->bufmgr_config.mbuf_read_dma_low_water =
++ DEFAULT_MB_RDMA_LOW_WATER_5705;
++ tp->bufmgr_config.mbuf_mac_rx_low_water =
++ DEFAULT_MB_MACRX_LOW_WATER_57765;
++ tp->bufmgr_config.mbuf_high_water =
++ DEFAULT_MB_HIGH_WATER_57765;
++
++ tp->bufmgr_config.mbuf_read_dma_low_water_jumbo =
++ DEFAULT_MB_RDMA_LOW_WATER_5705;
++ tp->bufmgr_config.mbuf_mac_rx_low_water_jumbo =
++ DEFAULT_MB_MACRX_LOW_WATER_JUMBO_57765;
++ tp->bufmgr_config.mbuf_high_water_jumbo =
++ DEFAULT_MB_HIGH_WATER_JUMBO_57765;
++ } else if (tp->tg3_flags2 & TG3_FLG2_5705_PLUS) {
+ tp->bufmgr_config.mbuf_read_dma_low_water =
+ DEFAULT_MB_RDMA_LOW_WATER_5705;
+ tp->bufmgr_config.mbuf_mac_rx_low_water =
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 4f4d0ac..ad35329 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -1206,14 +1206,18 @@
+ #define DEFAULT_MB_MACRX_LOW_WATER 0x00000020
+ #define DEFAULT_MB_MACRX_LOW_WATER_5705 0x00000010
+ #define DEFAULT_MB_MACRX_LOW_WATER_5906 0x00000004
++#define DEFAULT_MB_MACRX_LOW_WATER_57765 0x0000002a
+ #define DEFAULT_MB_MACRX_LOW_WATER_JUMBO 0x00000098
+ #define DEFAULT_MB_MACRX_LOW_WATER_JUMBO_5780 0x0000004b
++#define DEFAULT_MB_MACRX_LOW_WATER_JUMBO_57765 0x0000007e
+ #define BUFMGR_MB_HIGH_WATER 0x00004418
+ #define DEFAULT_MB_HIGH_WATER 0x00000060
+ #define DEFAULT_MB_HIGH_WATER_5705 0x00000060
+ #define DEFAULT_MB_HIGH_WATER_5906 0x00000010
++#define DEFAULT_MB_HIGH_WATER_57765 0x000000a0
+ #define DEFAULT_MB_HIGH_WATER_JUMBO 0x0000017c
+ #define DEFAULT_MB_HIGH_WATER_JUMBO_5780 0x00000096
++#define DEFAULT_MB_HIGH_WATER_JUMBO_57765 0x000000ea
+ #define BUFMGR_RX_MB_ALLOC_REQ 0x0000441c
+ #define BUFMGR_MB_ALLOC_BIT 0x10000000
+ #define BUFMGR_RX_MB_ALLOC_RESP 0x00004420
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0060-tg3-Add-5717-serdes-phy-ID.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0060-tg3-Add-5717-serdes-phy-ID.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,59 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Wed, 20 Jan 2010 16:58:04 +0000
+Subject: [PATCH 060/207] tg3: Add 5717 serdes phy ID
+
+commit 9b952f51d019db37276bdb2924e776ca09132fc1 upstream.
+
+The serdes and copper phys of the 5717 asic rev have different phy IDs.
+This patch adds the serdes phy ID.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 3 ++-
+ drivers/net/tg3.h | 6 ++++--
+ 2 files changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index e257152..d3ad22a 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -14182,7 +14182,8 @@ static char * __devinit tg3_phy_string(struct tg3 *tp)
+ case PHY_ID_BCM5756: return "5722/5756";
+ case PHY_ID_BCM5906: return "5906";
+ case PHY_ID_BCM5761: return "5761";
+- case PHY_ID_BCM5717: return "5717";
++ case PHY_ID_BCM5718C: return "5718C";
++ case PHY_ID_BCM5718S: return "5718S";
+ case PHY_ID_BCM8002: return "8002/serdes";
+ case 0: return "serdes";
+ default: return "unknown";
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index ad35329..9368f5d 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -2896,7 +2896,8 @@ struct tg3 {
+ #define PHY_ID_BCM5756 0xbc050ed0
+ #define PHY_ID_BCM5784 0xbc050fa0
+ #define PHY_ID_BCM5761 0xbc050fd0
+-#define PHY_ID_BCM5717 0x5c0d8a00
++#define PHY_ID_BCM5718C 0x5c0d8a00
++#define PHY_ID_BCM5718S 0xbc050ff0
+ #define PHY_ID_BCM5906 0xdc00ac40
+ #define PHY_ID_BCM8002 0x60010140
+ #define PHY_ID_INVALID 0xffffffff
+@@ -2939,7 +2940,8 @@ struct tg3 {
+ (X) == PHY_ID_BCM5780 || (X) == PHY_ID_BCM5787 || \
+ (X) == PHY_ID_BCM5755 || (X) == PHY_ID_BCM5756 || \
+ (X) == PHY_ID_BCM5906 || (X) == PHY_ID_BCM5761 || \
+- (X) == PHY_ID_BCM5717 || (X) == PHY_ID_BCM8002)
++ (X) == PHY_ID_BCM5718C || (X) == PHY_ID_BCM5718S || \
++ (X) == PHY_ID_BCM8002)
+
+ struct tg3_hw_stats *hw_stats;
+ dma_addr_t stats_mapping;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0061-tg3-Abort-phy-init-for-5717-serdes-devices.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0061-tg3-Abort-phy-init-for-5717-serdes-devices.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,49 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Wed, 20 Jan 2010 16:58:05 +0000
+Subject: [PATCH 061/207] tg3: Abort phy init for 5717 serdes devices
+
+commit ecf1410b9d70b3034e5955e92bb0c3e02ff21e9c upstream.
+
+The 5717 serdes devices have a different phy register layout than all
+other previous serdes devices. This patch aborts the phy init sequence
+in tg3_phy_reset() if the device is a 5717 serdes. It also aborts the
+tg3_phy_toggle_apd() operation. Most other operations in the MII_SERDES
+path are O.K.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 8 +++++++-
+ 1 files changed, 7 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index d3ad22a..b30f51c 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -1564,7 +1564,9 @@ static void tg3_phy_toggle_apd(struct tg3 *tp, bool enable)
+ {
+ u32 reg;
+
+- if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS))
++ if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS) ||
++ (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 &&
++ (tp->tg3_flags2 & TG3_FLG2_MII_SERDES)))
+ return;
+
+ if (tp->tg3_flags3 & TG3_FLG3_PHY_IS_FET) {
+@@ -1939,6 +1941,10 @@ static int tg3_phy_reset(struct tg3 *tp)
+ }
+ }
+
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 &&
++ (tp->tg3_flags2 & TG3_FLG2_MII_SERDES))
++ return 0;
++
+ tg3_phy_apply_otp(tp);
+
+ if (tp->tg3_flags3 & TG3_FLG3_PHY_ENABLE_APD)
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0062-tg3-Fix-5717-and-57765-memory-selftests.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0062-tg3-Fix-5717-and-57765-memory-selftests.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,55 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Wed, 20 Jan 2010 16:58:06 +0000
+Subject: [PATCH 062/207] tg3: Fix 5717 and 57765 memory selftests
+
+commit 8b5a6c42e1f2277433aeefa9ee5a0c1a2473b7d8 upstream.
+
+Both the 5717 and the 57765 will fail 'ethtool -t' selftests at the
+memory selftest portion. The memory map for these two devices differs
+from the rest of the asic revs and each other. This patch adds a new
+memory map to use for memory selftests.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 17 ++++++++++++++++-
+ 1 files changed, 16 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index b30f51c..f153100 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -10665,12 +10665,27 @@ static int tg3_test_memory(struct tg3 *tp)
+ { 0x00008000, 0x01000},
+ { 0x00010000, 0x01000},
+ { 0xffffffff, 0x00000}
++ }, mem_tbl_5717[] = {
++ { 0x00000200, 0x00008},
++ { 0x00010000, 0x0a000},
++ { 0x00020000, 0x13c00},
++ { 0xffffffff, 0x00000}
++ }, mem_tbl_57765[] = {
++ { 0x00000200, 0x00008},
++ { 0x00004000, 0x00800},
++ { 0x00006000, 0x09800},
++ { 0x00010000, 0x0a000},
++ { 0xffffffff, 0x00000}
+ };
+ struct mem_entry *mem_tbl;
+ int err = 0;
+ int i;
+
+- if (tp->tg3_flags3 & TG3_FLG3_5755_PLUS)
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717)
++ mem_tbl = mem_tbl_5717;
++ else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
++ mem_tbl = mem_tbl_57765;
++ else if (tp->tg3_flags3 & TG3_FLG3_5755_PLUS)
+ mem_tbl = mem_tbl_5755;
+ else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
+ mem_tbl = mem_tbl_5906;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0063-tg3-Supply-a-nicaddr-for-57765-jumbo-RCB.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0063-tg3-Supply-a-nicaddr-for-57765-jumbo-RCB.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,35 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Wed, 20 Jan 2010 16:58:07 +0000
+Subject: [PATCH 063/207] tg3: Supply a nicaddr for 57765 jumbo RCB
+
+commit 5fd68fbdaf75505a2400826c7f314a1f3121a5f7 upstream.
+
+The 57765 needs the driver to supply a nic address to the jumbo RCB,
+just like all other devices except the 5717. This patch changes the
+test to single out the 5717 rather than maintain a lengthy whitelist of
+asic revs.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index f153100..5cfc228 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -7792,7 +7792,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ tw32(RCVDBDI_JUMBO_BD + TG3_BDINFO_MAXLEN_FLAGS,
+ (RX_JUMBO_MAX_SIZE << BDINFO_FLAGS_MAXLEN_SHIFT) |
+ BDINFO_FLAGS_USE_EXT_RECV);
+- if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS))
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717)
+ tw32(RCVDBDI_JUMBO_BD + TG3_BDINFO_NIC_ADDR,
+ NIC_SRAM_RX_JUMBO_BUFFER_DESC);
+ } else {
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0064-tg3-Fix-tx-mailbox-initialization.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0064-tg3-Fix-tx-mailbox-initialization.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,41 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Wed, 20 Jan 2010 16:58:08 +0000
+Subject: [PATCH 064/207] tg3: Fix tx mailbox initialization
+
+commit c2353a3214ff5813c4b719b3cdacbe939b1c63a0 upstream.
+
+If a device supports MSI-X interrupts, the driver assumes TSS will be
+available. This is not true for the 57765. This patch changes the code
+so that only the default tx mailbox is initialized if TSS is not
+available.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 5 ++++-
+ 1 files changed, 4 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 5cfc228..8d24150 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -7445,10 +7445,13 @@ static void tg3_rings_reset(struct tg3 *tp)
+ for (i = 1; i < TG3_IRQ_MAX_VECS; i++) {
+ tp->napi[i].tx_prod = 0;
+ tp->napi[i].tx_cons = 0;
+- tw32_mailbox(tp->napi[i].prodmbox, 0);
++ if (tp->tg3_flags3 & TG3_FLG3_ENABLE_TSS)
++ tw32_mailbox(tp->napi[i].prodmbox, 0);
+ tw32_rx_mbox(tp->napi[i].consmbox, 0);
+ tw32_mailbox_f(tp->napi[i].int_mbox, 1);
+ }
++ if (!(tp->tg3_flags3 & TG3_FLG3_ENABLE_TSS))
++ tw32_mailbox(tp->napi[0].prodmbox, 0);
+ } else {
+ tp->napi[0].tx_prod = 0;
+ tp->napi[0].tx_cons = 0;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0065-tg3-Turn-off-the-debug-UART-for-57765.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0065-tg3-Turn-off-the-debug-UART-for-57765.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,34 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Wed, 20 Jan 2010 16:58:09 +0000
+Subject: [PATCH 065/207] tg3: Turn off the debug UART for 57765
+
+commit cb4ed1fd8af963101a59c8c5fef97cbbf5f3fb88 upstream.
+
+If the debug UART is left enabled, the LEDs will not work properly.
+This patch disables the debug UART.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 3 ++-
+ 1 files changed, 2 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 8d24150..b29a1b3 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -13335,7 +13335,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ tp->grc_local_ctrl |= GRC_LCLCTRL_GPIO_OE3;
+
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780)
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
+ tp->grc_local_ctrl |= GRC_LCLCTRL_GPIO_UART_SEL;
+
+ if (tp->pdev->device == PCI_DEVICE_ID_TIGON3_5761 ||
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0066-tg3-Bypass-power-source-switching-for-57765.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0066-tg3-Bypass-power-source-switching-for-57765.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,36 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Wed, 20 Jan 2010 16:58:10 +0000
+Subject: [PATCH 066/207] tg3: Bypass power source switching for 57765
+
+commit 334355aa590c4b58750015c2f5710cd5074f45dd upstream.
+
+The 57765 repurposes all the GPIOs normally used to switch power sources
+when configured as a NIC device. This patch changes the code to avoid
+touching the GPIOs for this asic rev.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 4 +++-
+ 1 files changed, 3 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index b29a1b3..61400dd 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -2025,7 +2025,9 @@ static void tg3_frob_aux_power(struct tg3 *tp)
+ {
+ struct tg3 *tp_peer = tp;
+
+- if ((tp->tg3_flags2 & TG3_FLG2_IS_NIC) == 0)
++ /* The GPIOs do something completely different on 57765. */
++ if ((tp->tg3_flags2 & TG3_FLG2_IS_NIC) == 0 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
+ return;
+
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704 ||
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0067-tg3-Add-57765-phy-ID-and-enable-devices.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0067-tg3-Add-57765-phy-ID-and-enable-devices.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,67 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Wed, 20 Jan 2010 16:58:11 +0000
+Subject: [PATCH 067/207] tg3: Add 57765 phy ID and enable devices.
+
+commit b0f752210c0aa5e3d9ece4cbfefdc43092a68b83 upstream.
+
+This patch rounds out the 57765 asic rev support by adding the 57765 phy
+ID and entering the 57765 device IDs in the pci table.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 7 +++++++
+ drivers/net/tg3.h | 3 ++-
+ 2 files changed, 9 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 61400dd..7f05703 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -244,6 +244,12 @@ static DEFINE_PCI_DEVICE_TABLE(tg3_pci_tbl) = {
+ {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_5717)},
+ {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_5718)},
+ {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_5724)},
++ {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_57781)},
++ {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_57785)},
++ {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_57761)},
++ {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_57765)},
++ {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_57791)},
++ {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_57795)},
+ {PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_9DXX)},
+ {PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_9MXX)},
+ {PCI_DEVICE(PCI_VENDOR_ID_ALTIMA, PCI_DEVICE_ID_ALTIMA_AC1000)},
+@@ -14211,6 +14217,7 @@ static char * __devinit tg3_phy_string(struct tg3 *tp)
+ case PHY_ID_BCM5761: return "5761";
+ case PHY_ID_BCM5718C: return "5718C";
+ case PHY_ID_BCM5718S: return "5718S";
++ case PHY_ID_BCM57765: return "57765";
+ case PHY_ID_BCM8002: return "8002/serdes";
+ case 0: return "serdes";
+ default: return "unknown";
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 9368f5d..e7f6214 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -2898,6 +2898,7 @@ struct tg3 {
+ #define PHY_ID_BCM5761 0xbc050fd0
+ #define PHY_ID_BCM5718C 0x5c0d8a00
+ #define PHY_ID_BCM5718S 0xbc050ff0
++#define PHY_ID_BCM57765 0x5c0d8a40
+ #define PHY_ID_BCM5906 0xdc00ac40
+ #define PHY_ID_BCM8002 0x60010140
+ #define PHY_ID_INVALID 0xffffffff
+@@ -2941,7 +2942,7 @@ struct tg3 {
+ (X) == PHY_ID_BCM5755 || (X) == PHY_ID_BCM5756 || \
+ (X) == PHY_ID_BCM5906 || (X) == PHY_ID_BCM5761 || \
+ (X) == PHY_ID_BCM5718C || (X) == PHY_ID_BCM5718S || \
+- (X) == PHY_ID_BCM8002)
++ (X) == PHY_ID_BCM57765 || (X) == PHY_ID_BCM8002)
+
+ struct tg3_hw_stats *hw_stats;
+ dma_addr_t stats_mapping;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0068-net-use-netdev_mc_count-and-netdev_mc_empty-when-app.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0068-net-use-netdev_mc_count-and-netdev_mc_empty-when-app.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,45 @@
+From: Jiri Pirko <jpirko at redhat.com>
+Date: Mon, 8 Feb 2010 04:30:35 +0000
+Subject: [PATCH 068/207] net: use netdev_mc_count and netdev_mc_empty when
+ appropriate
+
+commit 4cd24eaf0c6ee7f0242e34ee77ec899f255e66b5 upstream.
+
+This patch replaces dev->mc_count in all drivers (hopefully I didn't miss
+anything). Used spatch and did small tweaks and conding style changes when
+it was suitable.
+
+Jirka
+
+Signed-off-by: Jiri Pirko <jpirko at redhat.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Restricted to drivers/net/tg3.{c,h}]
+---
+ drivers/net/tg3.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 7f05703..e66d68f 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -9431,7 +9431,7 @@ static void __tg3_set_rx_mode(struct net_device *dev)
+ } else if (dev->flags & IFF_ALLMULTI) {
+ /* Accept all multicast. */
+ tg3_set_multi (tp, 1);
+- } else if (dev->mc_count < 1) {
++ } else if (netdev_mc_empty(dev)) {
+ /* Reject all multicast. */
+ tg3_set_multi (tp, 0);
+ } else {
+@@ -9443,7 +9443,7 @@ static void __tg3_set_rx_mode(struct net_device *dev)
+ u32 bit;
+ u32 crc;
+
+- for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count;
++ for (i = 0, mclist = dev->mc_list; mclist && i < netdev_mc_count(dev);
+ i++, mclist = mclist->next) {
+
+ crc = calc_crc (mclist->dmi_addr, ETH_ALEN);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0069-tg3-Give-MSI-X-vec-1-rx-backlog-space.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0069-tg3-Give-MSI-X-vec-1-rx-backlog-space.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,155 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Fri, 12 Feb 2010 14:47:05 +0000
+Subject: [PATCH 069/207] tg3: Give MSI-X vec 1 rx backlog space
+
+commit e4af1af900328e4aa71cd5df75bb22669ab11522 upstream.
+
+RSS ring 1 is responsible for submitting new rx buffers to the
+hardware on behalf of all the other RSS rx return rings. Up until now
+this ring submitted its new rx buffers to the producer ring directly.
+The following patch will require that this ring have a place to put
+backlogged rx packets. As a consequence, it can no longer submit new
+buffers to the producer ring.
+
+This patch adds code to allocate an extra shadow producer ring for this
+RSS ring and adds RSS ring 1 to the list of rings needing buffer
+transfers.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: Michael Chan <mchan at broadcom.com>
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 46 +++++++++++++++++++++-------------------------
+ drivers/net/tg3.h | 2 +-
+ 2 files changed, 22 insertions(+), 26 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index e66d68f..eab518b 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -4733,7 +4733,7 @@ next_pkt_nopost:
+ tw32_rx_mbox(tnapi->consmbox, sw_idx);
+
+ /* Refill RX ring(s). */
+- if (!(tp->tg3_flags3 & TG3_FLG3_ENABLE_RSS) || tnapi == &tp->napi[1]) {
++ if (!(tp->tg3_flags3 & TG3_FLG3_ENABLE_RSS)) {
+ if (work_mask & RXD_OPAQUE_RING_STD) {
+ tpr->rx_std_prod_idx = std_prod_idx % TG3_RX_RING_SIZE;
+ tw32_rx_mbox(TG3_RX_STD_PROD_IDX_REG,
+@@ -4755,7 +4755,8 @@ next_pkt_nopost:
+ tpr->rx_std_prod_idx = std_prod_idx % TG3_RX_RING_SIZE;
+ tpr->rx_jmb_prod_idx = jmb_prod_idx % TG3_RX_JUMBO_RING_SIZE;
+
+- napi_schedule(&tp->napi[1].napi);
++ if (tnapi != &tp->napi[1])
++ napi_schedule(&tp->napi[1].napi);
+ }
+
+ return received;
+@@ -4893,25 +4894,23 @@ static int tg3_poll_work(struct tg3_napi *tnapi, int work_done, int budget)
+ work_done += tg3_rx(tnapi, budget - work_done);
+
+ if ((tp->tg3_flags3 & TG3_FLG3_ENABLE_RSS) && tnapi == &tp->napi[1]) {
++ struct tg3_rx_prodring_set *dpr = &tp->prodring[0];
+ int i;
+- u32 std_prod_idx = tp->prodring[0].rx_std_prod_idx;
+- u32 jmb_prod_idx = tp->prodring[0].rx_jmb_prod_idx;
++ u32 std_prod_idx = dpr->rx_std_prod_idx;
++ u32 jmb_prod_idx = dpr->rx_jmb_prod_idx;
+
+- for (i = 2; i < tp->irq_cnt; i++)
+- tg3_rx_prodring_xfer(tp, tnapi->prodring,
+- tp->napi[i].prodring);
++ for (i = 1; i < tp->irq_cnt; i++)
++ tg3_rx_prodring_xfer(tp, dpr, tp->napi[i].prodring);
+
+ wmb();
+
+- if (std_prod_idx != tp->prodring[0].rx_std_prod_idx) {
+- u32 mbox = TG3_RX_STD_PROD_IDX_REG;
+- tw32_rx_mbox(mbox, tp->prodring[0].rx_std_prod_idx);
+- }
++ if (std_prod_idx != dpr->rx_std_prod_idx)
++ tw32_rx_mbox(TG3_RX_STD_PROD_IDX_REG,
++ dpr->rx_std_prod_idx);
+
+- if (jmb_prod_idx != tp->prodring[0].rx_jmb_prod_idx) {
+- u32 mbox = TG3_RX_JMB_PROD_IDX_REG;
+- tw32_rx_mbox(mbox, tp->prodring[0].rx_jmb_prod_idx);
+- }
++ if (jmb_prod_idx != dpr->rx_jmb_prod_idx)
++ tw32_rx_mbox(TG3_RX_JMB_PROD_IDX_REG,
++ dpr->rx_jmb_prod_idx);
+
+ mmiowb();
+ }
+@@ -6173,8 +6172,7 @@ static void tg3_free_rings(struct tg3 *tp)
+ dev_kfree_skb_any(skb);
+ }
+
+- if (tp->irq_cnt == 1 || j != tp->irq_cnt - 1)
+- tg3_rx_prodring_free(tp, &tp->prodring[j]);
++ tg3_rx_prodring_free(tp, &tp->prodring[j]);
+ }
+ }
+
+@@ -6210,9 +6208,10 @@ static int tg3_init_rings(struct tg3 *tp)
+ if (tnapi->rx_rcb)
+ memset(tnapi->rx_rcb, 0, TG3_RX_RCB_RING_BYTES(tp));
+
+- if ((tp->irq_cnt == 1 || i != tp->irq_cnt - 1) &&
+- tg3_rx_prodring_alloc(tp, &tp->prodring[i]))
++ if (tg3_rx_prodring_alloc(tp, &tp->prodring[i])) {
++ tg3_free_rings(tp);
+ return -ENOMEM;
++ }
+ }
+
+ return 0;
+@@ -6259,7 +6258,7 @@ static void tg3_free_consistent(struct tg3 *tp)
+ tp->hw_stats = NULL;
+ }
+
+- for (i = 0; i < (tp->irq_cnt == 1 ? 1 : tp->irq_cnt - 1); i++)
++ for (i = 0; i < tp->irq_cnt; i++)
+ tg3_rx_prodring_fini(tp, &tp->prodring[i]);
+ }
+
+@@ -6271,7 +6270,7 @@ static int tg3_alloc_consistent(struct tg3 *tp)
+ {
+ int i;
+
+- for (i = 0; i < (tp->irq_cnt == 1 ? 1 : tp->irq_cnt - 1); i++) {
++ for (i = 0; i < tp->irq_cnt; i++) {
+ if (tg3_rx_prodring_init(tp, &tp->prodring[i]))
+ goto err_out;
+ }
+@@ -6336,10 +6335,7 @@ static int tg3_alloc_consistent(struct tg3 *tp)
+ break;
+ }
+
+- if (tp->irq_cnt == 1)
+- tnapi->prodring = &tp->prodring[0];
+- else if (i)
+- tnapi->prodring = &tp->prodring[i - 1];
++ tnapi->prodring = &tp->prodring[i];
+
+ /*
+ * If multivector RSS is enabled, vector 0 does not handle
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index e7f6214..88a87bb 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -2717,7 +2717,7 @@ struct tg3 {
+ struct vlan_group *vlgrp;
+ #endif
+
+- struct tg3_rx_prodring_set prodring[TG3_IRQ_MAX_VECS - 1];
++ struct tg3_rx_prodring_set prodring[TG3_IRQ_MAX_VECS];
+
+
+ /* begin "everything else" cacheline(s) section */
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0070-tg3-Prevent-rx-producer-ring-overruns.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0070-tg3-Prevent-rx-producer-ring-overruns.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,86 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Fri, 12 Feb 2010 14:47:06 +0000
+Subject: [PATCH 070/207] tg3: Prevent rx producer ring overruns
+
+commit e92967bfb1f4fa7da7c425df9239c4bb615dec30 upstream.
+
+When operating in RSS mode, it is possible for one rx return ring to
+submit enough rx buffers back to the hardware such that it inadvertently
+overwrites data needed by another rx return ring. This patch addresses
+the problem by looking for non-NULL skb pointers in the
+rx_[std|jmb]_buffers rings that parallel the rx producer rings.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: Michael Chan <mchan at broadcom.com>
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 38 ++++++++++++++++++++++++++++++++++++++
+ 1 files changed, 38 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index eab518b..4fc1a36 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -4552,6 +4552,12 @@ static void tg3_recycle_rx(struct tg3_napi *tnapi,
+ pci_unmap_addr(src_map, mapping));
+ dest_desc->addr_hi = src_desc->addr_hi;
+ dest_desc->addr_lo = src_desc->addr_lo;
++
++ /* Ensure that the update to the skb happens after the physical
++ * addresses have been transferred to the new BD location.
++ */
++ smp_wmb();
++
+ src_map->skb = NULL;
+ }
+
+@@ -4816,6 +4822,22 @@ static void tg3_rx_prodring_xfer(struct tg3 *tp,
+ si = spr->rx_std_cons_idx;
+ di = dpr->rx_std_prod_idx;
+
++ for (i = di; i < di + cpycnt; i++) {
++ if (dpr->rx_std_buffers[i].skb) {
++ cpycnt = i - di;
++ break;
++ }
++ }
++
++ if (!cpycnt)
++ break;
++
++ /* Ensure that updates to the rx_std_buffers ring and the
++ * shadowed hardware producer ring from tg3_recycle_skb() are
++ * ordered correctly WRT the skb check above.
++ */
++ smp_rmb();
++
+ memcpy(&dpr->rx_std_buffers[di],
+ &spr->rx_std_buffers[si],
+ cpycnt * sizeof(struct ring_info));
+@@ -4856,6 +4878,22 @@ static void tg3_rx_prodring_xfer(struct tg3 *tp,
+ si = spr->rx_jmb_cons_idx;
+ di = dpr->rx_jmb_prod_idx;
+
++ for (i = di; i < di + cpycnt; i++) {
++ if (dpr->rx_jmb_buffers[i].skb) {
++ cpycnt = i - di;
++ break;
++ }
++ }
++
++ if (!cpycnt)
++ break;
++
++ /* Ensure that updates to the rx_jmb_buffers ring and the
++ * shadowed hardware producer ring from tg3_recycle_skb() are
++ * ordered correctly WRT the skb check above.
++ */
++ smp_rmb();
++
+ memcpy(&dpr->rx_jmb_buffers[di],
+ &spr->rx_jmb_buffers[si],
+ cpycnt * sizeof(struct ring_info));
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0071-tg3-Unwedge-stuck-MSI-X-vectors.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0071-tg3-Unwedge-stuck-MSI-X-vectors.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,151 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Fri, 12 Feb 2010 14:47:07 +0000
+Subject: [PATCH 071/207] tg3: Unwedge stuck MSI-X vectors
+
+commit f89f38b8ec3171664314669a1396ab70b43e8961 upstream.
+
+The previous patch changed the code so that new rx buffer submissions to
+the hardware stall if a new submission would overwrite data needed by an
+unserviced rx packet. On very busy 5717 and 57765 asic rev devices,
+there is a corner case where the hardware will fail to assert an MSI-X
+interrupt for rx traffic. If that vector's interrupt never has another
+reason to assert, any rx buffers held will never be serviced. If the
+buffers are never serviced and the hardware consumes all the available
+rx packets for other rx rings, deadlock will result.
+
+The most reliable and least intrusive way to work around the problem is
+to detect the case where new submissions would overwrite existing data
+and force all rx interrupt vectors to fire.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 29 +++++++++++++++++++----------
+ drivers/net/tg3.h | 1 +
+ 2 files changed, 20 insertions(+), 10 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 4fc1a36..436cd2a 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -642,7 +642,6 @@ static void tg3_disable_ints(struct tg3 *tp)
+ static void tg3_enable_ints(struct tg3 *tp)
+ {
+ int i;
+- u32 coal_now = 0;
+
+ tp->irq_sync = 0;
+ wmb();
+@@ -650,13 +649,14 @@ static void tg3_enable_ints(struct tg3 *tp)
+ tw32(TG3PCI_MISC_HOST_CTRL,
+ (tp->misc_host_ctrl & ~MISC_HOST_CTRL_MASK_PCI_INT));
+
++ tp->coal_now = tp->coalesce_mode | HOSTCC_MODE_ENABLE;
+ for (i = 0; i < tp->irq_cnt; i++) {
+ struct tg3_napi *tnapi = &tp->napi[i];
+ tw32_mailbox_f(tnapi->int_mbox, tnapi->last_tag << 24);
+ if (tp->tg3_flags2 & TG3_FLG2_1SHOT_MSI)
+ tw32_mailbox_f(tnapi->int_mbox, tnapi->last_tag << 24);
+
+- coal_now |= tnapi->coal_now;
++ tp->coal_now |= tnapi->coal_now;
+ }
+
+ /* Force an initial interrupt */
+@@ -664,8 +664,9 @@ static void tg3_enable_ints(struct tg3 *tp)
+ (tp->napi[0].hw_status->status & SD_STATUS_UPDATED))
+ tw32(GRC_LOCAL_CTRL, tp->grc_local_ctrl | GRC_LCLCTRL_SETINT);
+ else
+- tw32(HOSTCC_MODE, tp->coalesce_mode |
+- HOSTCC_MODE_ENABLE | coal_now);
++ tw32(HOSTCC_MODE, tp->coal_now);
++
++ tp->coal_now &= ~(tp->napi[0].coal_now | tp->napi[1].coal_now);
+ }
+
+ static inline unsigned int tg3_has_work(struct tg3_napi *tnapi)
+@@ -4794,12 +4795,12 @@ static void tg3_poll_link(struct tg3 *tp)
+ }
+ }
+
+-static void tg3_rx_prodring_xfer(struct tg3 *tp,
+- struct tg3_rx_prodring_set *dpr,
+- struct tg3_rx_prodring_set *spr)
++static int tg3_rx_prodring_xfer(struct tg3 *tp,
++ struct tg3_rx_prodring_set *dpr,
++ struct tg3_rx_prodring_set *spr)
+ {
+ u32 si, di, cpycnt, src_prod_idx;
+- int i;
++ int i, err = 0;
+
+ while (1) {
+ src_prod_idx = spr->rx_std_prod_idx;
+@@ -4825,6 +4826,7 @@ static void tg3_rx_prodring_xfer(struct tg3 *tp,
+ for (i = di; i < di + cpycnt; i++) {
+ if (dpr->rx_std_buffers[i].skb) {
+ cpycnt = i - di;
++ err = -ENOSPC;
+ break;
+ }
+ }
+@@ -4881,6 +4883,7 @@ static void tg3_rx_prodring_xfer(struct tg3 *tp,
+ for (i = di; i < di + cpycnt; i++) {
+ if (dpr->rx_jmb_buffers[i].skb) {
+ cpycnt = i - di;
++ err = -ENOSPC;
+ break;
+ }
+ }
+@@ -4911,6 +4914,8 @@ static void tg3_rx_prodring_xfer(struct tg3 *tp,
+ dpr->rx_jmb_prod_idx = (dpr->rx_jmb_prod_idx + cpycnt) %
+ TG3_RX_JUMBO_RING_SIZE;
+ }
++
++ return err;
+ }
+
+ static int tg3_poll_work(struct tg3_napi *tnapi, int work_done, int budget)
+@@ -4933,12 +4938,13 @@ static int tg3_poll_work(struct tg3_napi *tnapi, int work_done, int budget)
+
+ if ((tp->tg3_flags3 & TG3_FLG3_ENABLE_RSS) && tnapi == &tp->napi[1]) {
+ struct tg3_rx_prodring_set *dpr = &tp->prodring[0];
+- int i;
++ int i, err = 0;
+ u32 std_prod_idx = dpr->rx_std_prod_idx;
+ u32 jmb_prod_idx = dpr->rx_jmb_prod_idx;
+
+ for (i = 1; i < tp->irq_cnt; i++)
+- tg3_rx_prodring_xfer(tp, dpr, tp->napi[i].prodring);
++ err |= tg3_rx_prodring_xfer(tp, dpr,
++ tp->napi[i].prodring);
+
+ wmb();
+
+@@ -4951,6 +4957,9 @@ static int tg3_poll_work(struct tg3_napi *tnapi, int work_done, int budget)
+ dpr->rx_jmb_prod_idx);
+
+ mmiowb();
++
++ if (err)
++ tw32_f(HOSTCC_MODE, tp->coal_now);
+ }
+
+ return work_done;
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 88a87bb..cc8bf7d 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -2699,6 +2699,7 @@ struct tg3 {
+ struct net_device *dev;
+ struct pci_dev *pdev;
+
++ u32 coal_now;
+ u32 msg_enable;
+
+ /* begin "tx thread" cacheline section */
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0072-tg3-Fix-57765-A0-bootcode-race-condition.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0072-tg3-Fix-57765-A0-bootcode-race-condition.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,55 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Fri, 12 Feb 2010 14:47:08 +0000
+Subject: [PATCH 072/207] tg3: Fix 57765 A0 bootcode race condition
+
+commit 6b10c1653e425e30cff7f41d0e6f9743bfa9810f upstream.
+
+On A0 revision of 57765 asic rev devices, the bootcode will perform some
+hardware operations, after the magic signature is presented, that will
+collide with setup operations performed by the driver. The best way to
+avoid the contention is to have the driver delay an additional 10
+milliseconds. B0 revisions of the chip will make this workaround
+unnecessary.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: Benjamin Li <benli at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 7 +++++++
+ drivers/net/tg3.h | 1 +
+ 2 files changed, 8 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 436cd2a..06b1905 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -6721,6 +6721,13 @@ static int tg3_poll_fw(struct tg3 *tp)
+ tp->dev->name);
+ }
+
++ if (tp->pci_chip_rev_id == CHIPREV_ID_57765_A0) {
++ /* The 57765 A0 needs a little more
++ * time to do some important work.
++ */
++ mdelay(10);
++ }
++
+ return 0;
+ }
+
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index cc8bf7d..46db4ad 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -110,6 +110,7 @@
+ #define CHIPREV_ID_57780_A0 0x57780000
+ #define CHIPREV_ID_57780_A1 0x57780001
+ #define CHIPREV_ID_5717_A0 0x05717000
++#define CHIPREV_ID_57765_A0 0x57785000
+ #define GET_ASIC_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 12)
+ #define ASIC_REV_5700 0x07
+ #define ASIC_REV_5701 0x00
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0073-tg3-Turn-off-multiple-DMA-reads-for-5717.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0073-tg3-Turn-off-multiple-DMA-reads-for-5717.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,47 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Fri, 12 Feb 2010 14:47:09 +0000
+Subject: [PATCH 073/207] tg3: Turn off multiple DMA reads for 5717
+
+commit 0339e4e3effeae71e2b19c6340ef9672fb7a2cb3 upstream.
+
+The 5717's DMA read engine has a bug when initiating multiple DMA reads
+across the PCIe bus. This patch disables the feature.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 3 +++
+ drivers/net/tg3.h | 1 +
+ 2 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 06b1905..a181aae 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -7915,6 +7915,9 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ RDMAC_MODE_FIFOURUN_ENAB | RDMAC_MODE_FIFOOREAD_ENAB |
+ RDMAC_MODE_LNGREAD_ENAB);
+
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717)
++ rdmac_mode |= RDMAC_MODE_MULT_DMA_RD_DIS;
++
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780)
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 46db4ad..a8fb53a 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -1258,6 +1258,7 @@
+ #define RDMAC_MODE_MBUF_SBD_CRPT_ENAB 0x00002000
+ #define RDMAC_MODE_FIFO_SIZE_128 0x00020000
+ #define RDMAC_MODE_FIFO_LONG_BURST 0x00030000
++#define RDMAC_MODE_MULT_DMA_RD_DIS 0x01000000
+ #define RDMAC_MODE_IPV4_LSO_EN 0x08000000
+ #define RDMAC_MODE_IPV6_LSO_EN 0x10000000
+ #define RDMAC_STATUS 0x00004804
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0074-tg3-Reset-phy-during-bringup-when-using-phylib.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0074-tg3-Reset-phy-during-bringup-when-using-phylib.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,36 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Fri, 12 Feb 2010 14:47:10 +0000
+Subject: [PATCH 074/207] tg3: Reset phy during bringup when using phylib
+
+commit 603f11738cee4d46a2a1d394ae80d718f8d37cba upstream.
+
+The driver puts the phy into low-power mode when it releases the device.
+If the device were to be reacquired, the phy needs a reset to bring it
+back to full powered operation. This patch allows phylib-enabled
+devices to reset the phy.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 3 +--
+ 1 files changed, 1 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index a181aae..0412379 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -7595,8 +7595,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ tg3_abort_hw(tp, 1);
+ }
+
+- if (reset_phy &&
+- !(tp->tg3_flags3 & TG3_FLG3_USE_PHYLIB))
++ if (reset_phy)
+ tg3_phy_reset(tp);
+
+ err = tg3_chip_reset(tp);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0075-tg3-Fix-napi-assignments-in-loopback-test.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0075-tg3-Fix-napi-assignments-in-loopback-test.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,41 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Fri, 12 Feb 2010 14:47:11 +0000
+Subject: [PATCH 075/207] tg3: Fix napi assignments in loopback test
+
+commit c88734054e787542ea093b02120e324e92cad882 upstream.
+
+The 57765 lacks TSS support. This renders the napi assignments
+incorrect in the loopback test function. This patch fixes the problem.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 8 ++++----
+ 1 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 0412379..ae90711 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -10781,12 +10781,12 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode)
+ struct tg3_napi *tnapi, *rnapi;
+ struct tg3_rx_prodring_set *tpr = &tp->prodring[0];
+
++ tnapi = &tp->napi[0];
++ rnapi = &tp->napi[0];
+ if (tp->irq_cnt > 1) {
+- tnapi = &tp->napi[1];
+ rnapi = &tp->napi[1];
+- } else {
+- tnapi = &tp->napi[0];
+- rnapi = &tp->napi[0];
++ if (tp->tg3_flags3 & TG3_FLG3_ENABLE_TSS)
++ tnapi = &tp->napi[1];
+ }
+ coal_now = tnapi->coal_now | rnapi->coal_now;
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0076-tg3-Fix-AC131-loopback-test-errors-for-5785.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0076-tg3-Fix-AC131-loopback-test-errors-for-5785.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,55 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Fri, 12 Feb 2010 14:47:12 +0000
+Subject: [PATCH 076/207] tg3: Fix AC131 loopback test errors for 5785
+
+commit 1061b7c56482310bbb8197045d51e2986afabfce upstream.
+
+The AC131 does not enable the forced transmit clock settings
+immediately. The workaround is to read the register again to get the
+setting to take effect.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 8 ++++++--
+ drivers/net/tg3.h | 3 +++
+ 2 files changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index ae90711..76925b6 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -10823,8 +10823,12 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode)
+
+ mac_mode = tp->mac_mode & ~MAC_MODE_PORT_MODE_MASK;
+ if (tp->tg3_flags3 & TG3_FLG3_PHY_IS_FET) {
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
+- tg3_writephy(tp, MII_TG3_FET_PTEST, 0x1800);
++ tg3_writephy(tp, MII_TG3_FET_PTEST,
++ MII_TG3_FET_PTEST_FRC_TX_LINK |
++ MII_TG3_FET_PTEST_FRC_TX_LOCK);
++ /* The write needs to be flushed for the AC131 */
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785)
++ tg3_readphy(tp, MII_TG3_FET_PTEST, &val);
+ mac_mode |= MAC_MODE_PORT_MODE_MII;
+ } else
+ mac_mode |= MAC_MODE_PORT_MODE_GMII;
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index a8fb53a..b4fd596 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -2112,6 +2112,9 @@
+
+ /* Fast Ethernet Tranceiver definitions */
+ #define MII_TG3_FET_PTEST 0x17
++#define MII_TG3_FET_PTEST_FRC_TX_LINK 0x1000
++#define MII_TG3_FET_PTEST_FRC_TX_LOCK 0x0800
++
+ #define MII_TG3_FET_TEST 0x1f
+ #define MII_TG3_FET_SHADOW_EN 0x0080
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0077-tg3-Update-driver-version-to-3.107.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0077-tg3-Update-driver-version-to-3.107.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,32 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Fri, 12 Feb 2010 14:47:13 +0000
+Subject: [PATCH 077/207] tg3: Update driver version to 3.107
+
+commit b3b3f04fb587ecb61b5baa6c1c5f0e666fd12d73 upstream.
+
+This patch updates the tg3 version to 3.107.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 76925b6..a7233b4 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -68,8 +68,8 @@
+
+ #define DRV_MODULE_NAME "tg3"
+ #define PFX DRV_MODULE_NAME ": "
+-#define DRV_MODULE_VERSION "3.106"
+-#define DRV_MODULE_RELDATE "January 12, 2010"
++#define DRV_MODULE_VERSION "3.107"
++#define DRV_MODULE_RELDATE "February 12, 2010"
+
+ #define TG3_DEF_MAC_MODE 0
+ #define TG3_DEF_RX_MODE 0
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0078-tg3-Enforce-DMA-mapping-skb-assignment-ordering.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0078-tg3-Enforce-DMA-mapping-skb-assignment-ordering.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,48 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Wed, 17 Feb 2010 15:16:54 +0000
+Subject: [PATCH 078/207] tg3: Enforce DMA mapping / skb assignment ordering
+
+commit 61e800cf949926b3d463ca3cf3025d964872774b upstream.
+
+Michael Chan noted that there is nothing in the code that would prevent
+the compiler from delaying the access of the "mapping" member of the
+newly arrived packet until much later. If this happened after the
+skb = NULL assignment, it is possible for the driver to pass a bad
+dma_addr value to pci_unmap_single(). To enforce this ordering, we need
+a write memory barrier. The pairing read memory barrier already exists
+in tg3_rx_prodring_xfer() under the comments starting with
+"Ensure that updates to the...".
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 9 +++++++--
+ 1 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index a7233b4..cc014c6 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -4659,11 +4659,16 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)
+ if (skb_size < 0)
+ goto drop_it;
+
+- ri->skb = NULL;
+-
+ pci_unmap_single(tp->pdev, dma_addr, skb_size,
+ PCI_DMA_FROMDEVICE);
+
++ /* Ensure that the update to the skb happens
++ * after the usage of the old DMA mapping.
++ */
++ smp_wmb();
++
++ ri->skb = NULL;
++
+ skb_put(skb, len);
+ } else {
+ struct sk_buff *copy_skb;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0079-tg3-Make-57791-and-57795-10-100-only.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0079-tg3-Make-57791-and-57795-10-100-only.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,32 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Wed, 17 Feb 2010 15:16:55 +0000
+Subject: [PATCH 079/207] tg3: Make 57791 and 57795 10/100 only
+
+commit d110114281fad580dd9ce629507d17b123169cff upstream.
+
+This patch adds the 57791 and 57795 to the list of devices that only
+support 10 and 100 Mbps speeds.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index cc014c6..b6256c9 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -13589,6 +13589,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ tp->pdev->device == PCI_DEVICE_ID_TIGON3_5753F ||
+ tp->pdev->device == PCI_DEVICE_ID_TIGON3_5787F)) ||
+ tp->pdev->device == TG3PCI_DEVICE_TIGON3_57790 ||
++ tp->pdev->device == TG3PCI_DEVICE_TIGON3_57791 ||
++ tp->pdev->device == TG3PCI_DEVICE_TIGON3_57795 ||
+ (tp->tg3_flags3 & TG3_FLG3_PHY_IS_FET))
+ tp->tg3_flags |= TG3_FLAG_10_100_ONLY;
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0080-tg3-Add-support-for-2-new-selfboot-formats.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0080-tg3-Add-support-for-2-new-selfboot-formats.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,59 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Wed, 17 Feb 2010 15:16:56 +0000
+Subject: [PATCH 080/207] tg3: Add support for 2 new selfboot formats
+
+commit a4153d401ac440c73e0721db0b6b031e8e6f77d1 upstream.
+
+This patch adds new offsets to the bootcode version extraction code to
+support NVRAM format versions 4 and 5.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 6 ++++++
+ drivers/net/tg3.h | 4 ++++
+ 2 files changed, 10 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index b6256c9..67a1cf7 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -12754,6 +12754,12 @@ static void __devinit tg3_read_sb_ver(struct tg3 *tp, u32 val)
+ case TG3_EEPROM_SB_REVISION_3:
+ offset = TG3_EEPROM_SB_F1R3_EDH_OFF;
+ break;
++ case TG3_EEPROM_SB_REVISION_4:
++ offset = TG3_EEPROM_SB_F1R4_EDH_OFF;
++ break;
++ case TG3_EEPROM_SB_REVISION_5:
++ offset = TG3_EEPROM_SB_F1R5_EDH_OFF;
++ break;
+ default:
+ return;
+ }
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index b4fd596..ffc12b1 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -1864,6 +1864,8 @@
+ #define TG3_EEPROM_SB_REVISION_0 0x00000000
+ #define TG3_EEPROM_SB_REVISION_2 0x00020000
+ #define TG3_EEPROM_SB_REVISION_3 0x00030000
++#define TG3_EEPROM_SB_REVISION_4 0x00040000
++#define TG3_EEPROM_SB_REVISION_5 0x00050000
+ #define TG3_EEPROM_MAGIC_HW 0xabcd
+ #define TG3_EEPROM_MAGIC_HW_MSK 0xffff
+
+@@ -1881,6 +1883,8 @@
+ #define TG3_EEPROM_SB_F1R2_EDH_OFF 0x14
+ #define TG3_EEPROM_SB_F1R2_MBA_OFF 0x10
+ #define TG3_EEPROM_SB_F1R3_EDH_OFF 0x18
++#define TG3_EEPROM_SB_F1R4_EDH_OFF 0x1c
++#define TG3_EEPROM_SB_F1R5_EDH_OFF 0x20
+ #define TG3_EEPROM_SB_EDH_MAJ_MASK 0x00000700
+ #define TG3_EEPROM_SB_EDH_MAJ_SHFT 8
+ #define TG3_EEPROM_SB_EDH_MIN_MASK 0x000000ff
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0081-tg3-Allow-phylib-flowctrl-changes-anytime.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0081-tg3-Allow-phylib-flowctrl-changes-anytime.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,132 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Wed, 17 Feb 2010 15:16:57 +0000
+Subject: [PATCH 081/207] tg3: Allow phylib flowctrl changes anytime
+
+commit 2712168f856e8cd42265e7ef855d64702da20089 upstream.
+
+This patch loosens the restriction that the phylib interface must be up
+and running to change the flow control parameters.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 94 +++++++++++++++++++++++++++++-----------------------
+ 1 files changed, 52 insertions(+), 42 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 67a1cf7..40ee66e 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -10094,56 +10094,66 @@ static int tg3_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam
+ int err = 0;
+
+ if (tp->tg3_flags3 & TG3_FLG3_USE_PHYLIB) {
+- if (!(tp->tg3_flags3 & TG3_FLG3_PHY_CONNECTED))
+- return -EAGAIN;
++ u32 newadv;
++ struct phy_device *phydev;
+
+- if (epause->autoneg) {
+- u32 newadv;
+- struct phy_device *phydev;
++ phydev = tp->mdio_bus->phy_map[TG3_PHY_MII_ADDR];
+
+- phydev = tp->mdio_bus->phy_map[TG3_PHY_MII_ADDR];
++ if (!(phydev->supported & SUPPORTED_Pause) ||
++ (!(phydev->supported & SUPPORTED_Asym_Pause) &&
++ ((epause->rx_pause && !epause->tx_pause) ||
++ (!epause->rx_pause && epause->tx_pause))))
++ return -EINVAL;
+
+- if (epause->rx_pause) {
+- if (epause->tx_pause)
+- newadv = ADVERTISED_Pause;
+- else
+- newadv = ADVERTISED_Pause |
+- ADVERTISED_Asym_Pause;
+- } else if (epause->tx_pause) {
+- newadv = ADVERTISED_Asym_Pause;
++ tp->link_config.flowctrl = 0;
++ if (epause->rx_pause) {
++ tp->link_config.flowctrl |= FLOW_CTRL_RX;
++
++ if (epause->tx_pause) {
++ tp->link_config.flowctrl |= FLOW_CTRL_TX;
++ newadv = ADVERTISED_Pause;
+ } else
+- newadv = 0;
+-
+- if (tp->tg3_flags3 & TG3_FLG3_PHY_CONNECTED) {
+- u32 oldadv = phydev->advertising &
+- (ADVERTISED_Pause |
+- ADVERTISED_Asym_Pause);
+- if (oldadv != newadv) {
+- phydev->advertising &=
+- ~(ADVERTISED_Pause |
+- ADVERTISED_Asym_Pause);
+- phydev->advertising |= newadv;
+- err = phy_start_aneg(phydev);
++ newadv = ADVERTISED_Pause |
++ ADVERTISED_Asym_Pause;
++ } else if (epause->tx_pause) {
++ tp->link_config.flowctrl |= FLOW_CTRL_TX;
++ newadv = ADVERTISED_Asym_Pause;
++ } else
++ newadv = 0;
++
++ if (epause->autoneg)
++ tp->tg3_flags |= TG3_FLAG_PAUSE_AUTONEG;
++ else
++ tp->tg3_flags &= ~TG3_FLAG_PAUSE_AUTONEG;
++
++ if (tp->tg3_flags3 & TG3_FLG3_PHY_CONNECTED) {
++ u32 oldadv = phydev->advertising &
++ (ADVERTISED_Pause | ADVERTISED_Asym_Pause);
++ if (oldadv != newadv) {
++ phydev->advertising &=
++ ~(ADVERTISED_Pause |
++ ADVERTISED_Asym_Pause);
++ phydev->advertising |= newadv;
++ if (phydev->autoneg) {
++ /*
++ * Always renegotiate the link to
++ * inform our link partner of our
++ * flow control settings, even if the
++ * flow control is forced. Let
++ * tg3_adjust_link() do the final
++ * flow control setup.
++ */
++ return phy_start_aneg(phydev);
+ }
+- } else {
+- tp->link_config.advertising &=
+- ~(ADVERTISED_Pause |
+- ADVERTISED_Asym_Pause);
+- tp->link_config.advertising |= newadv;
+ }
+- } else {
+- if (epause->rx_pause)
+- tp->link_config.flowctrl |= FLOW_CTRL_RX;
+- else
+- tp->link_config.flowctrl &= ~FLOW_CTRL_RX;
+-
+- if (epause->tx_pause)
+- tp->link_config.flowctrl |= FLOW_CTRL_TX;
+- else
+- tp->link_config.flowctrl &= ~FLOW_CTRL_TX;
+
+- if (netif_running(dev))
++ if (!epause->autoneg)
+ tg3_setup_flow_control(tp, 0, 0);
++ } else {
++ tp->link_config.orig_advertising &=
++ ~(ADVERTISED_Pause |
++ ADVERTISED_Asym_Pause);
++ tp->link_config.orig_advertising |= newadv;
+ }
+ } else {
+ int irq_sync = 0;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0082-tg3-Add-more-partno-entries-for-fallback-path.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0082-tg3-Add-more-partno-entries-for-fallback-path.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,49 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Wed, 17 Feb 2010 15:16:58 +0000
+Subject: [PATCH 082/207] tg3: Add more partno entries for fallback path
+
+commit b474eca74cf647df0a7fd56bc975ee4a812741b7 upstream.
+
+This patch adds 57765 asic partno entries for the path executed if VPD
+is not present in NVRAM.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 18 +++++++++++++++++-
+ 1 files changed, 17 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 40ee66e..e70e965 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -12660,8 +12660,24 @@ out_not_found:
+ else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 &&
+ tp->pdev->device == TG3PCI_DEVICE_TIGON3_57788)
+ strcpy(tp->board_part_number, "BCM57788");
+- else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
++ else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765 &&
++ tp->pdev->device == TG3PCI_DEVICE_TIGON3_57761)
++ strcpy(tp->board_part_number, "BCM57761");
++ else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765 &&
++ tp->pdev->device == TG3PCI_DEVICE_TIGON3_57765)
+ strcpy(tp->board_part_number, "BCM57765");
++ else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765 &&
++ tp->pdev->device == TG3PCI_DEVICE_TIGON3_57781)
++ strcpy(tp->board_part_number, "BCM57781");
++ else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765 &&
++ tp->pdev->device == TG3PCI_DEVICE_TIGON3_57785)
++ strcpy(tp->board_part_number, "BCM57785");
++ else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765 &&
++ tp->pdev->device == TG3PCI_DEVICE_TIGON3_57791)
++ strcpy(tp->board_part_number, "BCM57791");
++ else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765 &&
++ tp->pdev->device == TG3PCI_DEVICE_TIGON3_57795)
++ strcpy(tp->board_part_number, "BCM57795");
+ else
+ strcpy(tp->board_part_number, "none");
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0083-tg3-Rename-TG3_FLG3_RGMII_STD_IBND_DISABLE.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0083-tg3-Rename-TG3_FLG3_RGMII_STD_IBND_DISABLE.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,94 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Wed, 17 Feb 2010 15:16:59 +0000
+Subject: [PATCH 083/207] tg3: Rename TG3_FLG3_RGMII_STD_IBND_DISABLE
+
+commit 144170635b543ceadfe6ba907ac496b40795764e upstream.
+
+The STD part of this preprocessor definition is a bit of a misnomer.
+This flag is a coarse control of the RGMII inband status facilities.
+This patch renames the definition to be more accurate.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 12 ++++++------
+ drivers/net/tg3.h | 4 ++--
+ 2 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index e70e965..da5bac8 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -984,7 +984,7 @@ static void tg3_mdio_config_5785(struct tg3 *tp)
+ return;
+ }
+
+- if (!(tp->tg3_flags3 & TG3_FLG3_RGMII_STD_IBND_DISABLE))
++ if (!(tp->tg3_flags3 & TG3_FLG3_RGMII_INBAND_DISABLE))
+ val |= MAC_PHYCFG2_EMODE_MASK_MASK |
+ MAC_PHYCFG2_FMODE_MASK_MASK |
+ MAC_PHYCFG2_GMODE_MASK_MASK |
+@@ -997,7 +997,7 @@ static void tg3_mdio_config_5785(struct tg3 *tp)
+ val = tr32(MAC_PHYCFG1);
+ val &= ~(MAC_PHYCFG1_RXCLK_TO_MASK | MAC_PHYCFG1_TXCLK_TO_MASK |
+ MAC_PHYCFG1_RGMII_EXT_RX_DEC | MAC_PHYCFG1_RGMII_SND_STAT_EN);
+- if (!(tp->tg3_flags3 & TG3_FLG3_RGMII_STD_IBND_DISABLE)) {
++ if (!(tp->tg3_flags3 & TG3_FLG3_RGMII_INBAND_DISABLE)) {
+ if (tp->tg3_flags3 & TG3_FLG3_RGMII_EXT_IBND_RX_EN)
+ val |= MAC_PHYCFG1_RGMII_EXT_RX_DEC;
+ if (tp->tg3_flags3 & TG3_FLG3_RGMII_EXT_IBND_TX_EN)
+@@ -1015,7 +1015,7 @@ static void tg3_mdio_config_5785(struct tg3 *tp)
+ MAC_RGMII_MODE_TX_ENABLE |
+ MAC_RGMII_MODE_TX_LOWPWR |
+ MAC_RGMII_MODE_TX_RESET);
+- if (!(tp->tg3_flags3 & TG3_FLG3_RGMII_STD_IBND_DISABLE)) {
++ if (!(tp->tg3_flags3 & TG3_FLG3_RGMII_INBAND_DISABLE)) {
+ if (tp->tg3_flags3 & TG3_FLG3_RGMII_EXT_IBND_RX_EN)
+ val |= MAC_RGMII_MODE_RX_INT_B |
+ MAC_RGMII_MODE_RX_QUALITY |
+@@ -1125,7 +1125,7 @@ static int tg3_mdio_init(struct tg3 *tp)
+ PHY_BRCM_RX_REFCLK_UNUSED |
+ PHY_BRCM_DIS_TXCRXC_NOENRGY |
+ PHY_BRCM_AUTO_PWRDWN_ENABLE;
+- if (tp->tg3_flags3 & TG3_FLG3_RGMII_STD_IBND_DISABLE)
++ if (tp->tg3_flags3 & TG3_FLG3_RGMII_INBAND_DISABLE)
+ phydev->dev_flags |= PHY_BRCM_STD_IBND_DISABLE;
+ if (tp->tg3_flags3 & TG3_FLG3_RGMII_EXT_IBND_RX_EN)
+ phydev->dev_flags |= PHY_BRCM_EXT_IBND_RX_ENABLE;
+@@ -12366,8 +12366,8 @@ static void __devinit tg3_get_eeprom_hw_cfg(struct tg3 *tp)
+ tp->tg3_flags |= TG3_FLAG_ASPM_WORKAROUND;
+ }
+
+- if (cfg4 & NIC_SRAM_RGMII_STD_IBND_DISABLE)
+- tp->tg3_flags3 |= TG3_FLG3_RGMII_STD_IBND_DISABLE;
++ if (cfg4 & NIC_SRAM_RGMII_INBAND_DISABLE)
++ tp->tg3_flags3 |= TG3_FLG3_RGMII_INBAND_DISABLE;
+ if (cfg4 & NIC_SRAM_RGMII_EXT_IBND_RX_EN)
+ tp->tg3_flags3 |= TG3_FLG3_RGMII_EXT_IBND_RX_EN;
+ if (cfg4 & NIC_SRAM_RGMII_EXT_IBND_TX_EN)
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index ffc12b1..d2712c5 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -1979,7 +1979,7 @@
+
+ #define NIC_SRAM_DATA_CFG_4 0x00000d60
+ #define NIC_SRAM_GMII_MODE 0x00000002
+-#define NIC_SRAM_RGMII_STD_IBND_DISABLE 0x00000004
++#define NIC_SRAM_RGMII_INBAND_DISABLE 0x00000004
+ #define NIC_SRAM_RGMII_EXT_IBND_RX_EN 0x00000008
+ #define NIC_SRAM_RGMII_EXT_IBND_TX_EN 0x00000010
+
+@@ -2825,7 +2825,7 @@ struct tg3 {
+ #define TG3_FLG3_USE_PHYLIB 0x00000010
+ #define TG3_FLG3_MDIOBUS_INITED 0x00000020
+ #define TG3_FLG3_PHY_CONNECTED 0x00000080
+-#define TG3_FLG3_RGMII_STD_IBND_DISABLE 0x00000100
++#define TG3_FLG3_RGMII_INBAND_DISABLE 0x00000100
+ #define TG3_FLG3_RGMII_EXT_IBND_RX_EN 0x00000200
+ #define TG3_FLG3_RGMII_EXT_IBND_TX_EN 0x00000400
+ #define TG3_FLG3_CLKREQ_BUG 0x00000800
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0084-tg3-Reduce-indent-level-of-tg3_rx_prodring_alloc.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0084-tg3-Reduce-indent-level-of-tg3_rx_prodring_alloc.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,80 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Wed, 17 Feb 2010 15:17:00 +0000
+Subject: [PATCH 084/207] tg3: Reduce indent level of tg3_rx_prodring_alloc
+
+commit 0d86df808886d4e56c46a9c356dfb81146e3b6d1 upstream.
+
+This patch adds an inverted "jumbo ring enable" test and jumps to the exit
+if it succeeds. The change reduces the indent level of the remaining
+code making it more readable.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 48 ++++++++++++++++++++++++------------------------
+ 1 files changed, 24 insertions(+), 24 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index da5bac8..448b183 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -6087,31 +6087,31 @@ static int tg3_rx_prodring_alloc(struct tg3 *tp,
+
+ memset(tpr->rx_jmb, 0, TG3_RX_JUMBO_RING_BYTES);
+
+- if (tp->tg3_flags & TG3_FLAG_JUMBO_RING_ENABLE) {
+- for (i = 0; i < TG3_RX_JUMBO_RING_SIZE; i++) {
+- struct tg3_rx_buffer_desc *rxd;
+-
+- rxd = &tpr->rx_jmb[i].std;
+- rxd->idx_len = TG3_RX_JMB_DMA_SZ << RXD_LEN_SHIFT;
+- rxd->type_flags = (RXD_FLAG_END << RXD_FLAGS_SHIFT) |
+- RXD_FLAG_JUMBO;
+- rxd->opaque = (RXD_OPAQUE_RING_JUMBO |
+- (i << RXD_OPAQUE_INDEX_SHIFT));
+- }
++ if (!(tp->tg3_flags & TG3_FLAG_JUMBO_RING_ENABLE))
++ goto done;
+
+- for (i = 0; i < tp->rx_jumbo_pending; i++) {
+- if (tg3_alloc_rx_skb(tp, tpr, RXD_OPAQUE_RING_JUMBO,
+- i) < 0) {
+- printk(KERN_WARNING PFX
+- "%s: Using a smaller RX jumbo ring, "
+- "only %d out of %d buffers were "
+- "allocated successfully.\n",
+- tp->dev->name, i, tp->rx_jumbo_pending);
+- if (i == 0)
+- goto initfail;
+- tp->rx_jumbo_pending = i;
+- break;
+- }
++ for (i = 0; i < TG3_RX_JUMBO_RING_SIZE; i++) {
++ struct tg3_rx_buffer_desc *rxd;
++
++ rxd = &tpr->rx_jmb[i].std;
++ rxd->idx_len = TG3_RX_JMB_DMA_SZ << RXD_LEN_SHIFT;
++ rxd->type_flags = (RXD_FLAG_END << RXD_FLAGS_SHIFT) |
++ RXD_FLAG_JUMBO;
++ rxd->opaque = (RXD_OPAQUE_RING_JUMBO |
++ (i << RXD_OPAQUE_INDEX_SHIFT));
++ }
++
++ for (i = 0; i < tp->rx_jumbo_pending; i++) {
++ if (tg3_alloc_rx_skb(tp, tpr, RXD_OPAQUE_RING_JUMBO, i) < 0) {
++ printk(KERN_WARNING PFX
++ "%s: Using a smaller RX jumbo ring, "
++ "only %d out of %d buffers were "
++ "allocated successfully.\n",
++ tp->dev->name, i, tp->rx_jumbo_pending);
++ if (i == 0)
++ goto initfail;
++ tp->rx_jumbo_pending = i;
++ break;
+ }
+ }
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0085-tg3-Discover-phy-address-once.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0085-tg3-Discover-phy-address-once.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,59 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Wed, 17 Feb 2010 15:17:01 +0000
+Subject: [PATCH 085/207] tg3: Discover phy address once
+
+commit 9ea4818dd39cc8c6b31c38c9f51d19d5d4ee0be6 upstream.
+
+The phy address will not change after it has been identified. Move the
+discovery code to a location that only gets executed once.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 22 +++++++++++-----------
+ 1 files changed, 11 insertions(+), 11 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 448b183..5365d24 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -1035,6 +1035,17 @@ static void tg3_mdio_start(struct tg3 *tp)
+ tw32_f(MAC_MI_MODE, tp->mi_mode);
+ udelay(80);
+
++ if ((tp->tg3_flags3 & TG3_FLG3_MDIOBUS_INITED) &&
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785)
++ tg3_mdio_config_5785(tp);
++}
++
++static int tg3_mdio_init(struct tg3 *tp)
++{
++ int i;
++ u32 reg;
++ struct phy_device *phydev;
++
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) {
+ u32 funcnum, is_serdes;
+
+@@ -1054,17 +1065,6 @@ static void tg3_mdio_start(struct tg3 *tp)
+ } else
+ tp->phy_addr = TG3_PHY_MII_ADDR;
+
+- if ((tp->tg3_flags3 & TG3_FLG3_MDIOBUS_INITED) &&
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785)
+- tg3_mdio_config_5785(tp);
+-}
+-
+-static int tg3_mdio_init(struct tg3 *tp)
+-{
+- int i;
+- u32 reg;
+- struct phy_device *phydev;
+-
+ tg3_mdio_start(tp);
+
+ if (!(tp->tg3_flags3 & TG3_FLG3_USE_PHYLIB) ||
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0086-tg3-Reformat-SSID-to-phy-ID-table.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0086-tg3-Reformat-SSID-to-phy-ID-table.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,179 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Wed, 17 Feb 2010 15:17:02 +0000
+Subject: [PATCH 086/207] tg3: Reformat SSID to phy ID table
+
+commit 24daf2b0a4005f3a4e757752fcfed9da276cf202 upstream.
+
+This patch reformats the SSID to phy ID table, replacing constants with
+preprocessor definitions. This patch is also prep work for the
+following patch, which will push line lengths beyond 80 chars.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 84 ++++++++++++++++++++++++++++++++++------------------
+ drivers/net/tg3.h | 34 +++++++++++++++++++++-
+ 2 files changed, 88 insertions(+), 30 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 5365d24..f6649d5 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -12113,45 +12113,71 @@ struct subsys_tbl_ent {
+ u32 phy_id;
+ };
+
+-static struct subsys_tbl_ent subsys_id_to_phy_id[] = {
++static struct subsys_tbl_ent subsys_id_to_phy_id[] __devinitdata = {
+ /* Broadcom boards. */
+- { PCI_VENDOR_ID_BROADCOM, 0x1644, PHY_ID_BCM5401 }, /* BCM95700A6 */
+- { PCI_VENDOR_ID_BROADCOM, 0x0001, PHY_ID_BCM5701 }, /* BCM95701A5 */
+- { PCI_VENDOR_ID_BROADCOM, 0x0002, PHY_ID_BCM8002 }, /* BCM95700T6 */
+- { PCI_VENDOR_ID_BROADCOM, 0x0003, 0 }, /* BCM95700A9 */
+- { PCI_VENDOR_ID_BROADCOM, 0x0005, PHY_ID_BCM5701 }, /* BCM95701T1 */
+- { PCI_VENDOR_ID_BROADCOM, 0x0006, PHY_ID_BCM5701 }, /* BCM95701T8 */
+- { PCI_VENDOR_ID_BROADCOM, 0x0007, 0 }, /* BCM95701A7 */
+- { PCI_VENDOR_ID_BROADCOM, 0x0008, PHY_ID_BCM5701 }, /* BCM95701A10 */
+- { PCI_VENDOR_ID_BROADCOM, 0x8008, PHY_ID_BCM5701 }, /* BCM95701A12 */
+- { PCI_VENDOR_ID_BROADCOM, 0x0009, PHY_ID_BCM5703 }, /* BCM95703Ax1 */
+- { PCI_VENDOR_ID_BROADCOM, 0x8009, PHY_ID_BCM5703 }, /* BCM95703Ax2 */
++ { TG3PCI_SUBVENDOR_ID_BROADCOM,
++ TG3PCI_SUBDEVICE_ID_BROADCOM_95700A6, PHY_ID_BCM5401 },
++ { TG3PCI_SUBVENDOR_ID_BROADCOM,
++ TG3PCI_SUBDEVICE_ID_BROADCOM_95701A5, PHY_ID_BCM5701 },
++ { TG3PCI_SUBVENDOR_ID_BROADCOM,
++ TG3PCI_SUBDEVICE_ID_BROADCOM_95700T6, PHY_ID_BCM8002 },
++ { TG3PCI_SUBVENDOR_ID_BROADCOM,
++ TG3PCI_SUBDEVICE_ID_BROADCOM_95700A9, 0 },
++ { TG3PCI_SUBVENDOR_ID_BROADCOM,
++ TG3PCI_SUBDEVICE_ID_BROADCOM_95701T1, PHY_ID_BCM5701 },
++ { TG3PCI_SUBVENDOR_ID_BROADCOM,
++ TG3PCI_SUBDEVICE_ID_BROADCOM_95701T8, PHY_ID_BCM5701 },
++ { TG3PCI_SUBVENDOR_ID_BROADCOM,
++ TG3PCI_SUBDEVICE_ID_BROADCOM_95701A7, 0 },
++ { TG3PCI_SUBVENDOR_ID_BROADCOM,
++ TG3PCI_SUBDEVICE_ID_BROADCOM_95701A10, PHY_ID_BCM5701 },
++ { TG3PCI_SUBVENDOR_ID_BROADCOM,
++ TG3PCI_SUBDEVICE_ID_BROADCOM_95701A12, PHY_ID_BCM5701 },
++ { TG3PCI_SUBVENDOR_ID_BROADCOM,
++ TG3PCI_SUBDEVICE_ID_BROADCOM_95703AX1, PHY_ID_BCM5703 },
++ { TG3PCI_SUBVENDOR_ID_BROADCOM,
++ TG3PCI_SUBDEVICE_ID_BROADCOM_95703AX2, PHY_ID_BCM5703 },
+
+ /* 3com boards. */
+- { PCI_VENDOR_ID_3COM, 0x1000, PHY_ID_BCM5401 }, /* 3C996T */
+- { PCI_VENDOR_ID_3COM, 0x1006, PHY_ID_BCM5701 }, /* 3C996BT */
+- { PCI_VENDOR_ID_3COM, 0x1004, 0 }, /* 3C996SX */
+- { PCI_VENDOR_ID_3COM, 0x1007, PHY_ID_BCM5701 }, /* 3C1000T */
+- { PCI_VENDOR_ID_3COM, 0x1008, PHY_ID_BCM5701 }, /* 3C940BR01 */
++ { TG3PCI_SUBVENDOR_ID_3COM,
++ TG3PCI_SUBDEVICE_ID_3COM_3C996T, PHY_ID_BCM5401 },
++ { TG3PCI_SUBVENDOR_ID_3COM,
++ TG3PCI_SUBDEVICE_ID_3COM_3C996BT, PHY_ID_BCM5701 },
++ { TG3PCI_SUBVENDOR_ID_3COM,
++ TG3PCI_SUBDEVICE_ID_3COM_3C996SX, 0 },
++ { TG3PCI_SUBVENDOR_ID_3COM,
++ TG3PCI_SUBDEVICE_ID_3COM_3C1000T, PHY_ID_BCM5701 },
++ { TG3PCI_SUBVENDOR_ID_3COM,
++ TG3PCI_SUBDEVICE_ID_3COM_3C940BR01, PHY_ID_BCM5701 },
+
+ /* DELL boards. */
+- { PCI_VENDOR_ID_DELL, 0x00d1, PHY_ID_BCM5401 }, /* VIPER */
+- { PCI_VENDOR_ID_DELL, 0x0106, PHY_ID_BCM5401 }, /* JAGUAR */
+- { PCI_VENDOR_ID_DELL, 0x0109, PHY_ID_BCM5411 }, /* MERLOT */
+- { PCI_VENDOR_ID_DELL, 0x010a, PHY_ID_BCM5411 }, /* SLIM_MERLOT */
++ { TG3PCI_SUBVENDOR_ID_DELL,
++ TG3PCI_SUBDEVICE_ID_DELL_VIPER, PHY_ID_BCM5401 },
++ { TG3PCI_SUBVENDOR_ID_DELL,
++ TG3PCI_SUBDEVICE_ID_DELL_JAGUAR, PHY_ID_BCM5401 },
++ { TG3PCI_SUBVENDOR_ID_DELL,
++ TG3PCI_SUBDEVICE_ID_DELL_MERLOT, PHY_ID_BCM5411 },
++ { TG3PCI_SUBVENDOR_ID_DELL,
++ TG3PCI_SUBDEVICE_ID_DELL_SLIM_MERLOT, PHY_ID_BCM5411 },
+
+ /* Compaq boards. */
+- { PCI_VENDOR_ID_COMPAQ, 0x007c, PHY_ID_BCM5701 }, /* BANSHEE */
+- { PCI_VENDOR_ID_COMPAQ, 0x009a, PHY_ID_BCM5701 }, /* BANSHEE_2 */
+- { PCI_VENDOR_ID_COMPAQ, 0x007d, 0 }, /* CHANGELING */
+- { PCI_VENDOR_ID_COMPAQ, 0x0085, PHY_ID_BCM5701 }, /* NC7780 */
+- { PCI_VENDOR_ID_COMPAQ, 0x0099, PHY_ID_BCM5701 }, /* NC7780_2 */
++ { TG3PCI_SUBVENDOR_ID_COMPAQ,
++ TG3PCI_SUBDEVICE_ID_COMPAQ_BANSHEE, PHY_ID_BCM5701 },
++ { TG3PCI_SUBVENDOR_ID_COMPAQ,
++ TG3PCI_SUBDEVICE_ID_COMPAQ_BANSHEE_2, PHY_ID_BCM5701 },
++ { TG3PCI_SUBVENDOR_ID_COMPAQ,
++ TG3PCI_SUBDEVICE_ID_COMPAQ_CHANGELING, 0 },
++ { TG3PCI_SUBVENDOR_ID_COMPAQ,
++ TG3PCI_SUBDEVICE_ID_COMPAQ_NC7780, PHY_ID_BCM5701 },
++ { TG3PCI_SUBVENDOR_ID_COMPAQ,
++ TG3PCI_SUBDEVICE_ID_COMPAQ_NC7780_2, PHY_ID_BCM5701 },
+
+ /* IBM boards. */
+- { PCI_VENDOR_ID_IBM, 0x0281, 0 } /* IBM??? */
++ { TG3PCI_SUBVENDOR_ID_IBM,
++ TG3PCI_SUBDEVICE_ID_IBM_5703SAX2, 0 }
+ };
+
+-static inline struct subsys_tbl_ent *lookup_by_subsys(struct tg3 *tp)
++static struct subsys_tbl_ent * __devinit tg3_lookup_by_subsys(struct tg3 *tp)
+ {
+ int i;
+
+@@ -12477,7 +12503,7 @@ static int __devinit tg3_phy_probe(struct tg3 *tp)
+ /* No eeprom signature? Try the hardcoded
+ * subsys device table.
+ */
+- p = lookup_by_subsys(tp);
++ p = tg3_lookup_by_subsys(tp);
+ if (!p)
+ return -ENODEV;
+
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index d2712c5..12ce226 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -56,7 +56,39 @@
+ #define TG3PCI_DEVICE_TIGON3_57765 0x16b4
+ #define TG3PCI_DEVICE_TIGON3_57791 0x16b2
+ #define TG3PCI_DEVICE_TIGON3_57795 0x16b6
+-/* 0x04 --> 0x64 unused */
++/* 0x04 --> 0x2c unused */
++#define TG3PCI_SUBVENDOR_ID_BROADCOM PCI_VENDOR_ID_BROADCOM
++#define TG3PCI_SUBDEVICE_ID_BROADCOM_95700A6 0x1644
++#define TG3PCI_SUBDEVICE_ID_BROADCOM_95701A5 0x0001
++#define TG3PCI_SUBDEVICE_ID_BROADCOM_95700T6 0x0002
++#define TG3PCI_SUBDEVICE_ID_BROADCOM_95700A9 0x0003
++#define TG3PCI_SUBDEVICE_ID_BROADCOM_95701T1 0x0005
++#define TG3PCI_SUBDEVICE_ID_BROADCOM_95701T8 0x0006
++#define TG3PCI_SUBDEVICE_ID_BROADCOM_95701A7 0x0007
++#define TG3PCI_SUBDEVICE_ID_BROADCOM_95701A10 0x0008
++#define TG3PCI_SUBDEVICE_ID_BROADCOM_95701A12 0x8008
++#define TG3PCI_SUBDEVICE_ID_BROADCOM_95703AX1 0x0009
++#define TG3PCI_SUBDEVICE_ID_BROADCOM_95703AX2 0x8009
++#define TG3PCI_SUBVENDOR_ID_3COM PCI_VENDOR_ID_3COM
++#define TG3PCI_SUBDEVICE_ID_3COM_3C996T 0x1000
++#define TG3PCI_SUBDEVICE_ID_3COM_3C996BT 0x1006
++#define TG3PCI_SUBDEVICE_ID_3COM_3C996SX 0x1004
++#define TG3PCI_SUBDEVICE_ID_3COM_3C1000T 0x1007
++#define TG3PCI_SUBDEVICE_ID_3COM_3C940BR01 0x1008
++#define TG3PCI_SUBVENDOR_ID_DELL PCI_VENDOR_ID_DELL
++#define TG3PCI_SUBDEVICE_ID_DELL_VIPER 0x00d1
++#define TG3PCI_SUBDEVICE_ID_DELL_JAGUAR 0x0106
++#define TG3PCI_SUBDEVICE_ID_DELL_MERLOT 0x0109
++#define TG3PCI_SUBDEVICE_ID_DELL_SLIM_MERLOT 0x010a
++#define TG3PCI_SUBVENDOR_ID_COMPAQ PCI_VENDOR_ID_COMPAQ
++#define TG3PCI_SUBDEVICE_ID_COMPAQ_BANSHEE 0x007c
++#define TG3PCI_SUBDEVICE_ID_COMPAQ_BANSHEE_2 0x009a
++#define TG3PCI_SUBDEVICE_ID_COMPAQ_CHANGELING 0x007d
++#define TG3PCI_SUBDEVICE_ID_COMPAQ_NC7780 0x0085
++#define TG3PCI_SUBDEVICE_ID_COMPAQ_NC7780_2 0x0099
++#define TG3PCI_SUBVENDOR_ID_IBM PCI_VENDOR_ID_IBM
++#define TG3PCI_SUBDEVICE_ID_IBM_5703SAX2 0x0281
++/* 0x30 --> 0x64 unused */
+ #define TG3PCI_MSI_DATA 0x00000064
+ /* 0x66 --> 0x68 unused */
+ #define TG3PCI_MISC_HOST_CTRL 0x00000068
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0087-tg3-Rename-tg3-phy-ID-preprocessor-definitions.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0087-tg3-Rename-tg3-phy-ID-preprocessor-definitions.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,408 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Wed, 17 Feb 2010 15:17:03 +0000
+Subject: [PATCH 087/207] tg3: Rename tg3 phy ID preprocessor definitions
+
+commit 79eb6904361fe4e54e589919a9b62c5e036c42c3 upstream.
+
+The phylib presents the phy ID in a different format than the one tg3
+has traditionally used. To highlight the distinction, this patch
+prepends the tg3 native phy ID format with TG3.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 122 ++++++++++++++++++++++++++--------------------------
+ drivers/net/tg3.h | 91 +++++++++++++++++++--------------------
+ 2 files changed, 106 insertions(+), 107 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index f6649d5..c7e7d23 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -1995,7 +1995,7 @@ out:
+ }
+ /* Set Extended packet length bit (bit 14) on all chips that */
+ /* support jumbo frames */
+- if ((tp->phy_id & PHY_ID_MASK) == PHY_ID_BCM5401) {
++ if ((tp->phy_id & TG3_PHY_ID_MASK) == TG3_PHY_ID_BCM5401) {
+ /* Cannot do read-modify-write on 5401 */
+ tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x4c20);
+ } else if (tp->tg3_flags & TG3_FLAG_JUMBO_CAPABLE) {
+@@ -2147,7 +2147,7 @@ static int tg3_5700_link_polarity(struct tg3 *tp, u32 speed)
+ {
+ if (tp->led_ctrl == LED_CTRL_MODE_PHY_2)
+ return 1;
+- else if ((tp->phy_id & PHY_ID_MASK) == PHY_ID_BCM5411) {
++ else if ((tp->phy_id & TG3_PHY_ID_MASK) == TG3_PHY_ID_BCM5411) {
+ if (speed != SPEED_10)
+ return 1;
+ } else if (speed == SPEED_10)
+@@ -3077,7 +3077,7 @@ static int tg3_setup_copper_phy(struct tg3 *tp, int force_reset)
+ if (force_reset)
+ tg3_phy_reset(tp);
+
+- if ((tp->phy_id & PHY_ID_MASK) == PHY_ID_BCM5401) {
++ if ((tp->phy_id & TG3_PHY_ID_MASK) == TG3_PHY_ID_BCM5401) {
+ tg3_readphy(tp, MII_BMSR, &bmsr);
+ if (tg3_readphy(tp, MII_BMSR, &bmsr) ||
+ !(tp->tg3_flags & TG3_FLAG_INIT_COMPLETE))
+@@ -3098,7 +3098,8 @@ static int tg3_setup_copper_phy(struct tg3 *tp, int force_reset)
+ }
+ }
+
+- if ((tp->phy_id & PHY_ID_REV_MASK) == PHY_REV_BCM5401_B0 &&
++ if ((tp->phy_id & TG3_PHY_ID_REV_MASK) ==
++ TG3_PHY_REV_BCM5401_B0 &&
+ !(bmsr & BMSR_LSTATUS) &&
+ tp->link_config.active_speed == SPEED_1000) {
+ err = tg3_phy_reset(tp);
+@@ -3253,7 +3254,7 @@ relink:
+ /* ??? Without this setting Netgear GA302T PHY does not
+ * ??? send/receive packets...
+ */
+- if ((tp->phy_id & PHY_ID_MASK) == PHY_ID_BCM5411 &&
++ if ((tp->phy_id & TG3_PHY_ID_MASK) == TG3_PHY_ID_BCM5411 &&
+ tp->pci_chip_rev_id == CHIPREV_ID_5700_ALTIMA) {
+ tp->mi_mode |= MAC_MI_MODE_AUTO_POLL;
+ tw32_f(MAC_MI_MODE, tp->mi_mode);
+@@ -3968,7 +3969,7 @@ static int tg3_setup_fiber_phy(struct tg3 *tp, int force_reset)
+ tw32_f(MAC_MODE, tp->mac_mode);
+ udelay(40);
+
+- if (tp->phy_id == PHY_ID_BCM8002)
++ if (tp->phy_id == TG3_PHY_ID_BCM8002)
+ tg3_init_bcm8002(tp);
+
+ /* Enable link change event even when serdes polling. */
+@@ -10855,9 +10856,10 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode)
+ tw32_f(MAC_RX_MODE, tp->rx_mode);
+ }
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700) {
+- if ((tp->phy_id & PHY_ID_MASK) == PHY_ID_BCM5401)
++ u32 masked_phy_id = tp->phy_id & TG3_PHY_ID_MASK;
++ if (masked_phy_id == TG3_PHY_ID_BCM5401)
+ mac_mode &= ~MAC_MODE_LINK_POLARITY;
+- else if ((tp->phy_id & PHY_ID_MASK) == PHY_ID_BCM5411)
++ else if (masked_phy_id == TG3_PHY_ID_BCM5411)
+ mac_mode |= MAC_MODE_LINK_POLARITY;
+ tg3_writephy(tp, MII_TG3_EXT_CTRL,
+ MII_TG3_EXT_CTRL_LNK3_LED_MODE);
+@@ -12116,61 +12118,61 @@ struct subsys_tbl_ent {
+ static struct subsys_tbl_ent subsys_id_to_phy_id[] __devinitdata = {
+ /* Broadcom boards. */
+ { TG3PCI_SUBVENDOR_ID_BROADCOM,
+- TG3PCI_SUBDEVICE_ID_BROADCOM_95700A6, PHY_ID_BCM5401 },
++ TG3PCI_SUBDEVICE_ID_BROADCOM_95700A6, TG3_PHY_ID_BCM5401 },
+ { TG3PCI_SUBVENDOR_ID_BROADCOM,
+- TG3PCI_SUBDEVICE_ID_BROADCOM_95701A5, PHY_ID_BCM5701 },
++ TG3PCI_SUBDEVICE_ID_BROADCOM_95701A5, TG3_PHY_ID_BCM5701 },
+ { TG3PCI_SUBVENDOR_ID_BROADCOM,
+- TG3PCI_SUBDEVICE_ID_BROADCOM_95700T6, PHY_ID_BCM8002 },
++ TG3PCI_SUBDEVICE_ID_BROADCOM_95700T6, TG3_PHY_ID_BCM8002 },
+ { TG3PCI_SUBVENDOR_ID_BROADCOM,
+ TG3PCI_SUBDEVICE_ID_BROADCOM_95700A9, 0 },
+ { TG3PCI_SUBVENDOR_ID_BROADCOM,
+- TG3PCI_SUBDEVICE_ID_BROADCOM_95701T1, PHY_ID_BCM5701 },
++ TG3PCI_SUBDEVICE_ID_BROADCOM_95701T1, TG3_PHY_ID_BCM5701 },
+ { TG3PCI_SUBVENDOR_ID_BROADCOM,
+- TG3PCI_SUBDEVICE_ID_BROADCOM_95701T8, PHY_ID_BCM5701 },
++ TG3PCI_SUBDEVICE_ID_BROADCOM_95701T8, TG3_PHY_ID_BCM5701 },
+ { TG3PCI_SUBVENDOR_ID_BROADCOM,
+ TG3PCI_SUBDEVICE_ID_BROADCOM_95701A7, 0 },
+ { TG3PCI_SUBVENDOR_ID_BROADCOM,
+- TG3PCI_SUBDEVICE_ID_BROADCOM_95701A10, PHY_ID_BCM5701 },
++ TG3PCI_SUBDEVICE_ID_BROADCOM_95701A10, TG3_PHY_ID_BCM5701 },
+ { TG3PCI_SUBVENDOR_ID_BROADCOM,
+- TG3PCI_SUBDEVICE_ID_BROADCOM_95701A12, PHY_ID_BCM5701 },
++ TG3PCI_SUBDEVICE_ID_BROADCOM_95701A12, TG3_PHY_ID_BCM5701 },
+ { TG3PCI_SUBVENDOR_ID_BROADCOM,
+- TG3PCI_SUBDEVICE_ID_BROADCOM_95703AX1, PHY_ID_BCM5703 },
++ TG3PCI_SUBDEVICE_ID_BROADCOM_95703AX1, TG3_PHY_ID_BCM5703 },
+ { TG3PCI_SUBVENDOR_ID_BROADCOM,
+- TG3PCI_SUBDEVICE_ID_BROADCOM_95703AX2, PHY_ID_BCM5703 },
++ TG3PCI_SUBDEVICE_ID_BROADCOM_95703AX2, TG3_PHY_ID_BCM5703 },
+
+ /* 3com boards. */
+ { TG3PCI_SUBVENDOR_ID_3COM,
+- TG3PCI_SUBDEVICE_ID_3COM_3C996T, PHY_ID_BCM5401 },
++ TG3PCI_SUBDEVICE_ID_3COM_3C996T, TG3_PHY_ID_BCM5401 },
+ { TG3PCI_SUBVENDOR_ID_3COM,
+- TG3PCI_SUBDEVICE_ID_3COM_3C996BT, PHY_ID_BCM5701 },
++ TG3PCI_SUBDEVICE_ID_3COM_3C996BT, TG3_PHY_ID_BCM5701 },
+ { TG3PCI_SUBVENDOR_ID_3COM,
+ TG3PCI_SUBDEVICE_ID_3COM_3C996SX, 0 },
+ { TG3PCI_SUBVENDOR_ID_3COM,
+- TG3PCI_SUBDEVICE_ID_3COM_3C1000T, PHY_ID_BCM5701 },
++ TG3PCI_SUBDEVICE_ID_3COM_3C1000T, TG3_PHY_ID_BCM5701 },
+ { TG3PCI_SUBVENDOR_ID_3COM,
+- TG3PCI_SUBDEVICE_ID_3COM_3C940BR01, PHY_ID_BCM5701 },
++ TG3PCI_SUBDEVICE_ID_3COM_3C940BR01, TG3_PHY_ID_BCM5701 },
+
+ /* DELL boards. */
+ { TG3PCI_SUBVENDOR_ID_DELL,
+- TG3PCI_SUBDEVICE_ID_DELL_VIPER, PHY_ID_BCM5401 },
++ TG3PCI_SUBDEVICE_ID_DELL_VIPER, TG3_PHY_ID_BCM5401 },
+ { TG3PCI_SUBVENDOR_ID_DELL,
+- TG3PCI_SUBDEVICE_ID_DELL_JAGUAR, PHY_ID_BCM5401 },
++ TG3PCI_SUBDEVICE_ID_DELL_JAGUAR, TG3_PHY_ID_BCM5401 },
+ { TG3PCI_SUBVENDOR_ID_DELL,
+- TG3PCI_SUBDEVICE_ID_DELL_MERLOT, PHY_ID_BCM5411 },
++ TG3PCI_SUBDEVICE_ID_DELL_MERLOT, TG3_PHY_ID_BCM5411 },
+ { TG3PCI_SUBVENDOR_ID_DELL,
+- TG3PCI_SUBDEVICE_ID_DELL_SLIM_MERLOT, PHY_ID_BCM5411 },
++ TG3PCI_SUBDEVICE_ID_DELL_SLIM_MERLOT, TG3_PHY_ID_BCM5411 },
+
+ /* Compaq boards. */
+ { TG3PCI_SUBVENDOR_ID_COMPAQ,
+- TG3PCI_SUBDEVICE_ID_COMPAQ_BANSHEE, PHY_ID_BCM5701 },
++ TG3PCI_SUBDEVICE_ID_COMPAQ_BANSHEE, TG3_PHY_ID_BCM5701 },
+ { TG3PCI_SUBVENDOR_ID_COMPAQ,
+- TG3PCI_SUBDEVICE_ID_COMPAQ_BANSHEE_2, PHY_ID_BCM5701 },
++ TG3PCI_SUBDEVICE_ID_COMPAQ_BANSHEE_2, TG3_PHY_ID_BCM5701 },
+ { TG3PCI_SUBVENDOR_ID_COMPAQ,
+ TG3PCI_SUBDEVICE_ID_COMPAQ_CHANGELING, 0 },
+ { TG3PCI_SUBVENDOR_ID_COMPAQ,
+- TG3PCI_SUBDEVICE_ID_COMPAQ_NC7780, PHY_ID_BCM5701 },
++ TG3PCI_SUBDEVICE_ID_COMPAQ_NC7780, TG3_PHY_ID_BCM5701 },
+ { TG3PCI_SUBVENDOR_ID_COMPAQ,
+- TG3PCI_SUBDEVICE_ID_COMPAQ_NC7780_2, PHY_ID_BCM5701 },
++ TG3PCI_SUBDEVICE_ID_COMPAQ_NC7780_2, TG3_PHY_ID_BCM5701 },
+
+ /* IBM boards. */
+ { TG3PCI_SUBVENDOR_ID_IBM,
+@@ -12218,7 +12220,7 @@ static void __devinit tg3_get_eeprom_hw_cfg(struct tg3 *tp)
+ val = tr32(MEMARB_MODE);
+ tw32(MEMARB_MODE, val | MEMARB_MODE_ENABLE);
+
+- tp->phy_id = PHY_ID_INVALID;
++ tp->phy_id = TG3_PHY_ID_INVALID;
+ tp->led_ctrl = LED_CTRL_MODE_PHY_1;
+
+ /* Assume an onboard device and WOL capable by default. */
+@@ -12469,7 +12471,7 @@ static int __devinit tg3_phy_probe(struct tg3 *tp)
+ err = 0;
+ if ((tp->tg3_flags & TG3_FLAG_ENABLE_ASF) ||
+ (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE)) {
+- hw_phy_id = hw_phy_id_masked = PHY_ID_INVALID;
++ hw_phy_id = hw_phy_id_masked = TG3_PHY_ID_INVALID;
+ } else {
+ /* Now read the physical PHY_ID from the chip and verify
+ * that it is sane. If it doesn't look good, we fall back
+@@ -12483,17 +12485,17 @@ static int __devinit tg3_phy_probe(struct tg3 *tp)
+ hw_phy_id |= (hw_phy_id_2 & 0xfc00) << 16;
+ hw_phy_id |= (hw_phy_id_2 & 0x03ff) << 0;
+
+- hw_phy_id_masked = hw_phy_id & PHY_ID_MASK;
++ hw_phy_id_masked = hw_phy_id & TG3_PHY_ID_MASK;
+ }
+
+- if (!err && KNOWN_PHY_ID(hw_phy_id_masked)) {
++ if (!err && TG3_KNOWN_PHY_ID(hw_phy_id_masked)) {
+ tp->phy_id = hw_phy_id;
+- if (hw_phy_id_masked == PHY_ID_BCM8002)
++ if (hw_phy_id_masked == TG3_PHY_ID_BCM8002)
+ tp->tg3_flags2 |= TG3_FLG2_PHY_SERDES;
+ else
+ tp->tg3_flags2 &= ~TG3_FLG2_PHY_SERDES;
+ } else {
+- if (tp->phy_id != PHY_ID_INVALID) {
++ if (tp->phy_id != TG3_PHY_ID_INVALID) {
+ /* Do nothing, phy ID already set up in
+ * tg3_get_eeprom_hw_cfg().
+ */
+@@ -12509,7 +12511,7 @@ static int __devinit tg3_phy_probe(struct tg3 *tp)
+
+ tp->phy_id = p->phy_id;
+ if (!tp->phy_id ||
+- tp->phy_id == PHY_ID_BCM8002)
++ tp->phy_id == TG3_PHY_ID_BCM8002)
+ tp->tg3_flags2 |= TG3_FLG2_PHY_SERDES;
+ }
+ }
+@@ -12561,13 +12563,11 @@ static int __devinit tg3_phy_probe(struct tg3 *tp)
+ }
+
+ skip_phy_reset:
+- if ((tp->phy_id & PHY_ID_MASK) == PHY_ID_BCM5401) {
++ if ((tp->phy_id & TG3_PHY_ID_MASK) == TG3_PHY_ID_BCM5401) {
+ err = tg3_init_5401phy_dsp(tp);
+ if (err)
+ return err;
+- }
+
+- if (!err && ((tp->phy_id & PHY_ID_MASK) == PHY_ID_BCM5401)) {
+ err = tg3_init_5401phy_dsp(tp);
+ }
+
+@@ -14318,28 +14318,28 @@ static void __devinit tg3_init_bufmgr_config(struct tg3 *tp)
+
+ static char * __devinit tg3_phy_string(struct tg3 *tp)
+ {
+- switch (tp->phy_id & PHY_ID_MASK) {
+- case PHY_ID_BCM5400: return "5400";
+- case PHY_ID_BCM5401: return "5401";
+- case PHY_ID_BCM5411: return "5411";
+- case PHY_ID_BCM5701: return "5701";
+- case PHY_ID_BCM5703: return "5703";
+- case PHY_ID_BCM5704: return "5704";
+- case PHY_ID_BCM5705: return "5705";
+- case PHY_ID_BCM5750: return "5750";
+- case PHY_ID_BCM5752: return "5752";
+- case PHY_ID_BCM5714: return "5714";
+- case PHY_ID_BCM5780: return "5780";
+- case PHY_ID_BCM5755: return "5755";
+- case PHY_ID_BCM5787: return "5787";
+- case PHY_ID_BCM5784: return "5784";
+- case PHY_ID_BCM5756: return "5722/5756";
+- case PHY_ID_BCM5906: return "5906";
+- case PHY_ID_BCM5761: return "5761";
+- case PHY_ID_BCM5718C: return "5718C";
+- case PHY_ID_BCM5718S: return "5718S";
+- case PHY_ID_BCM57765: return "57765";
+- case PHY_ID_BCM8002: return "8002/serdes";
++ switch (tp->phy_id & TG3_PHY_ID_MASK) {
++ case TG3_PHY_ID_BCM5400: return "5400";
++ case TG3_PHY_ID_BCM5401: return "5401";
++ case TG3_PHY_ID_BCM5411: return "5411";
++ case TG3_PHY_ID_BCM5701: return "5701";
++ case TG3_PHY_ID_BCM5703: return "5703";
++ case TG3_PHY_ID_BCM5704: return "5704";
++ case TG3_PHY_ID_BCM5705: return "5705";
++ case TG3_PHY_ID_BCM5750: return "5750";
++ case TG3_PHY_ID_BCM5752: return "5752";
++ case TG3_PHY_ID_BCM5714: return "5714";
++ case TG3_PHY_ID_BCM5780: return "5780";
++ case TG3_PHY_ID_BCM5755: return "5755";
++ case TG3_PHY_ID_BCM5787: return "5787";
++ case TG3_PHY_ID_BCM5784: return "5784";
++ case TG3_PHY_ID_BCM5756: return "5722/5756";
++ case TG3_PHY_ID_BCM5906: return "5906";
++ case TG3_PHY_ID_BCM5761: return "5761";
++ case TG3_PHY_ID_BCM5718C: return "5718C";
++ case TG3_PHY_ID_BCM5718S: return "5718S";
++ case TG3_PHY_ID_BCM57765: return "57765";
++ case TG3_PHY_ID_BCM8002: return "8002/serdes";
+ case 0: return "serdes";
+ default: return "unknown";
+ }
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 12ce226..800dec4 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -2921,45 +2921,59 @@ struct tg3 {
+
+ /* PHY info */
+ u32 phy_id;
+-#define PHY_ID_MASK 0xfffffff0
+-#define PHY_ID_BCM5400 0x60008040
+-#define PHY_ID_BCM5401 0x60008050
+-#define PHY_ID_BCM5411 0x60008070
+-#define PHY_ID_BCM5701 0x60008110
+-#define PHY_ID_BCM5703 0x60008160
+-#define PHY_ID_BCM5704 0x60008190
+-#define PHY_ID_BCM5705 0x600081a0
+-#define PHY_ID_BCM5750 0x60008180
+-#define PHY_ID_BCM5752 0x60008100
+-#define PHY_ID_BCM5714 0x60008340
+-#define PHY_ID_BCM5780 0x60008350
+-#define PHY_ID_BCM5755 0xbc050cc0
+-#define PHY_ID_BCM5787 0xbc050ce0
+-#define PHY_ID_BCM5756 0xbc050ed0
+-#define PHY_ID_BCM5784 0xbc050fa0
+-#define PHY_ID_BCM5761 0xbc050fd0
+-#define PHY_ID_BCM5718C 0x5c0d8a00
+-#define PHY_ID_BCM5718S 0xbc050ff0
+-#define PHY_ID_BCM57765 0x5c0d8a40
+-#define PHY_ID_BCM5906 0xdc00ac40
+-#define PHY_ID_BCM8002 0x60010140
+-#define PHY_ID_INVALID 0xffffffff
+-#define PHY_ID_REV_MASK 0x0000000f
+-#define PHY_REV_BCM5401_B0 0x1
+-#define PHY_REV_BCM5401_B2 0x3
+-#define PHY_REV_BCM5401_C0 0x6
+-#define PHY_REV_BCM5411_X0 0x1 /* Found on Netgear GA302T */
+-#define TG3_PHY_ID_BCM50610 0x143bd60
+-#define TG3_PHY_ID_BCM50610M 0x143bd70
+-#define TG3_PHY_ID_BCMAC131 0x143bc70
++#define TG3_PHY_ID_MASK 0xfffffff0
++#define TG3_PHY_ID_BCM5400 0x60008040
++#define TG3_PHY_ID_BCM5401 0x60008050
++#define TG3_PHY_ID_BCM5411 0x60008070
++#define TG3_PHY_ID_BCM5701 0x60008110
++#define TG3_PHY_ID_BCM5703 0x60008160
++#define TG3_PHY_ID_BCM5704 0x60008190
++#define TG3_PHY_ID_BCM5705 0x600081a0
++#define TG3_PHY_ID_BCM5750 0x60008180
++#define TG3_PHY_ID_BCM5752 0x60008100
++#define TG3_PHY_ID_BCM5714 0x60008340
++#define TG3_PHY_ID_BCM5780 0x60008350
++#define TG3_PHY_ID_BCM5755 0xbc050cc0
++#define TG3_PHY_ID_BCM5787 0xbc050ce0
++#define TG3_PHY_ID_BCM5756 0xbc050ed0
++#define TG3_PHY_ID_BCM5784 0xbc050fa0
++#define TG3_PHY_ID_BCM5761 0xbc050fd0
++#define TG3_PHY_ID_BCM5718C 0x5c0d8a00
++#define TG3_PHY_ID_BCM5718S 0xbc050ff0
++#define TG3_PHY_ID_BCM57765 0x5c0d8a40
++#define TG3_PHY_ID_BCM5906 0xdc00ac40
++#define TG3_PHY_ID_BCM8002 0x60010140
++#define TG3_PHY_ID_BCM50610 0x0143bd60
++#define TG3_PHY_ID_BCM50610M 0x0143bd70
++#define TG3_PHY_ID_BCMAC131 0x0143bc70
+ #define TG3_PHY_ID_RTL8211C 0x001cc910
+ #define TG3_PHY_ID_RTL8201E 0x00008200
+ #define TG3_PHY_ID_BCM57780 0x03625d90
++#define TG3_PHY_ID_INVALID 0xffffffff
++
++#define TG3_PHY_ID_REV_MASK 0x0000000f
++#define TG3_PHY_REV_BCM5401_B0 0x1
++
+ #define TG3_PHY_OUI_MASK 0xfffffc00
+ #define TG3_PHY_OUI_1 0x00206000
+ #define TG3_PHY_OUI_2 0x0143bc00
+ #define TG3_PHY_OUI_3 0x03625c00
+
++ /* This macro assumes the passed PHY ID is
++ * already masked with TG3_PHY_ID_MASK.
++ */
++#define TG3_KNOWN_PHY_ID(X) \
++ ((X) == TG3_PHY_ID_BCM5400 || (X) == TG3_PHY_ID_BCM5401 || \
++ (X) == TG3_PHY_ID_BCM5411 || (X) == TG3_PHY_ID_BCM5701 || \
++ (X) == TG3_PHY_ID_BCM5703 || (X) == TG3_PHY_ID_BCM5704 || \
++ (X) == TG3_PHY_ID_BCM5705 || (X) == TG3_PHY_ID_BCM5750 || \
++ (X) == TG3_PHY_ID_BCM5752 || (X) == TG3_PHY_ID_BCM5714 || \
++ (X) == TG3_PHY_ID_BCM5780 || (X) == TG3_PHY_ID_BCM5787 || \
++ (X) == TG3_PHY_ID_BCM5755 || (X) == TG3_PHY_ID_BCM5756 || \
++ (X) == TG3_PHY_ID_BCM5906 || (X) == TG3_PHY_ID_BCM5761 || \
++ (X) == TG3_PHY_ID_BCM5718C || (X) == TG3_PHY_ID_BCM5718S || \
++ (X) == TG3_PHY_ID_BCM57765 || (X) == TG3_PHY_ID_BCM8002)
++
+ u32 led_ctrl;
+ u32 phy_otp;
+
+@@ -2971,21 +2985,6 @@ struct tg3 {
+ u32 pci_clock_ctrl;
+ struct pci_dev *pdev_peer;
+
+- /* This macro assumes the passed PHY ID is already masked
+- * with PHY_ID_MASK.
+- */
+-#define KNOWN_PHY_ID(X) \
+- ((X) == PHY_ID_BCM5400 || (X) == PHY_ID_BCM5401 || \
+- (X) == PHY_ID_BCM5411 || (X) == PHY_ID_BCM5701 || \
+- (X) == PHY_ID_BCM5703 || (X) == PHY_ID_BCM5704 || \
+- (X) == PHY_ID_BCM5705 || (X) == PHY_ID_BCM5750 || \
+- (X) == PHY_ID_BCM5752 || (X) == PHY_ID_BCM5714 || \
+- (X) == PHY_ID_BCM5780 || (X) == PHY_ID_BCM5787 || \
+- (X) == PHY_ID_BCM5755 || (X) == PHY_ID_BCM5756 || \
+- (X) == PHY_ID_BCM5906 || (X) == PHY_ID_BCM5761 || \
+- (X) == PHY_ID_BCM5718C || (X) == PHY_ID_BCM5718S || \
+- (X) == PHY_ID_BCM57765 || (X) == PHY_ID_BCM8002)
+-
+ struct tg3_hw_stats *hw_stats;
+ dma_addr_t stats_mapping;
+ struct work_struct reset_task;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0088-tg3-Push-phylib-definitions-to-phylib.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0088-tg3-Push-phylib-definitions-to-phylib.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,169 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Wed, 17 Feb 2010 15:17:04 +0000
+Subject: [PATCH 088/207] tg3: Push phylib definitions to phylib
+
+commit 6a443a0f72ad7706345412dbd2e4d4981fdfce39 upstream.
+
+This patch pushes phylib definitions out to phylib headers. For phy
+IDs, this removes some code duplication.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/phy/broadcom.c | 5 +----
+ drivers/net/tg3.c | 32 ++++++++++++++++----------------
+ drivers/net/tg3.h | 14 +++-----------
+ include/linux/brcmphy.h | 11 +++++++++++
+ 4 files changed, 31 insertions(+), 31 deletions(-)
+
+diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c
+index f1939c3..d456a65 100644
+--- a/drivers/net/phy/broadcom.c
++++ b/drivers/net/phy/broadcom.c
+@@ -18,9 +18,6 @@
+ #include <linux/phy.h>
+ #include <linux/brcmphy.h>
+
+-#define PHY_ID_BCM50610 0x0143bd60
+-#define PHY_ID_BCM50610M 0x0143bd70
+-#define PHY_ID_BCM57780 0x03625d90
+
+ #define BRCM_PHY_MODEL(phydev) \
+ ((phydev)->drv->phy_id & (phydev)->drv->phy_id_mask)
+@@ -823,7 +820,7 @@ static struct phy_driver bcm57780_driver = {
+ };
+
+ static struct phy_driver bcmac131_driver = {
+- .phy_id = 0x0143bc70,
++ .phy_id = PHY_ID_BCMAC131,
+ .phy_id_mask = 0xfffffff0,
+ .name = "Broadcom BCMAC131",
+ .features = PHY_BASIC_FEATURES |
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index c7e7d23..ed3fb11 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -955,17 +955,17 @@ static void tg3_mdio_config_5785(struct tg3 *tp)
+
+ phydev = tp->mdio_bus->phy_map[TG3_PHY_MII_ADDR];
+ switch (phydev->drv->phy_id & phydev->drv->phy_id_mask) {
+- case TG3_PHY_ID_BCM50610:
+- case TG3_PHY_ID_BCM50610M:
++ case PHY_ID_BCM50610:
++ case PHY_ID_BCM50610M:
+ val = MAC_PHYCFG2_50610_LED_MODES;
+ break;
+- case TG3_PHY_ID_BCMAC131:
++ case PHY_ID_BCMAC131:
+ val = MAC_PHYCFG2_AC131_LED_MODES;
+ break;
+- case TG3_PHY_ID_RTL8211C:
++ case PHY_ID_RTL8211C:
+ val = MAC_PHYCFG2_RTL8211C_LED_MODES;
+ break;
+- case TG3_PHY_ID_RTL8201E:
++ case PHY_ID_RTL8201E:
+ val = MAC_PHYCFG2_RTL8201E_LED_MODES;
+ break;
+ default:
+@@ -1115,12 +1115,12 @@ static int tg3_mdio_init(struct tg3 *tp)
+ }
+
+ switch (phydev->drv->phy_id & phydev->drv->phy_id_mask) {
+- case TG3_PHY_ID_BCM57780:
++ case PHY_ID_BCM57780:
+ phydev->interface = PHY_INTERFACE_MODE_GMII;
+ phydev->dev_flags |= PHY_BRCM_AUTO_PWRDWN_ENABLE;
+ break;
+- case TG3_PHY_ID_BCM50610:
+- case TG3_PHY_ID_BCM50610M:
++ case PHY_ID_BCM50610:
++ case PHY_ID_BCM50610M:
+ phydev->dev_flags |= PHY_BRCM_CLEAR_RGMII_MODE |
+ PHY_BRCM_RX_REFCLK_UNUSED |
+ PHY_BRCM_DIS_TXCRXC_NOENRGY |
+@@ -1132,11 +1132,11 @@ static int tg3_mdio_init(struct tg3 *tp)
+ if (tp->tg3_flags3 & TG3_FLG3_RGMII_EXT_IBND_TX_EN)
+ phydev->dev_flags |= PHY_BRCM_EXT_IBND_TX_ENABLE;
+ /* fallthru */
+- case TG3_PHY_ID_RTL8211C:
++ case PHY_ID_RTL8211C:
+ phydev->interface = PHY_INTERFACE_MODE_RGMII;
+ break;
+- case TG3_PHY_ID_RTL8201E:
+- case TG3_PHY_ID_BCMAC131:
++ case PHY_ID_RTL8201E:
++ case PHY_ID_BCMAC131:
+ phydev->interface = PHY_INTERFACE_MODE_MII;
+ phydev->dev_flags |= PHY_BRCM_AUTO_PWRDWN_ENABLE;
+ tp->tg3_flags3 |= TG3_FLG3_PHY_IS_FET;
+@@ -2563,11 +2563,11 @@ static int tg3_set_power_state(struct tg3 *tp, pci_power_t state)
+ phy_start_aneg(phydev);
+
+ phyid = phydev->drv->phy_id & phydev->drv->phy_id_mask;
+- if (phyid != TG3_PHY_ID_BCMAC131) {
+- phyid &= TG3_PHY_OUI_MASK;
+- if (phyid == TG3_PHY_OUI_1 ||
+- phyid == TG3_PHY_OUI_2 ||
+- phyid == TG3_PHY_OUI_3)
++ if (phyid != PHY_ID_BCMAC131) {
++ phyid &= PHY_BCM_OUI_MASK;
++ if (phyid == PHY_BCM_OUI_1 ||
++ phyid == PHY_BCM_OUI_2 ||
++ phyid == PHY_BCM_OUI_3)
+ do_low_power = true;
+ }
+ }
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 800dec4..574a1cc 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -2943,22 +2943,14 @@ struct tg3 {
+ #define TG3_PHY_ID_BCM57765 0x5c0d8a40
+ #define TG3_PHY_ID_BCM5906 0xdc00ac40
+ #define TG3_PHY_ID_BCM8002 0x60010140
+-#define TG3_PHY_ID_BCM50610 0x0143bd60
+-#define TG3_PHY_ID_BCM50610M 0x0143bd70
+-#define TG3_PHY_ID_BCMAC131 0x0143bc70
+-#define TG3_PHY_ID_RTL8211C 0x001cc910
+-#define TG3_PHY_ID_RTL8201E 0x00008200
+-#define TG3_PHY_ID_BCM57780 0x03625d90
+ #define TG3_PHY_ID_INVALID 0xffffffff
+
++#define PHY_ID_RTL8211C 0x001cc910
++#define PHY_ID_RTL8201E 0x00008200
++
+ #define TG3_PHY_ID_REV_MASK 0x0000000f
+ #define TG3_PHY_REV_BCM5401_B0 0x1
+
+-#define TG3_PHY_OUI_MASK 0xfffffc00
+-#define TG3_PHY_OUI_1 0x00206000
+-#define TG3_PHY_OUI_2 0x0143bc00
+-#define TG3_PHY_OUI_3 0x03625c00
+-
+ /* This macro assumes the passed PHY ID is
+ * already masked with TG3_PHY_ID_MASK.
+ */
+diff --git a/include/linux/brcmphy.h b/include/linux/brcmphy.h
+index 2b31b91..7f437ca 100644
+--- a/include/linux/brcmphy.h
++++ b/include/linux/brcmphy.h
+@@ -1,3 +1,14 @@
++#define PHY_ID_BCM50610 0x0143bd60
++#define PHY_ID_BCM50610M 0x0143bd70
++#define PHY_ID_BCMAC131 0x0143bc70
++#define PHY_ID_BCM57780 0x03625d90
++
++#define PHY_BCM_OUI_MASK 0xfffffc00
++#define PHY_BCM_OUI_1 0x00206000
++#define PHY_BCM_OUI_2 0x0143bc00
++#define PHY_BCM_OUI_3 0x03625c00
++
++
+ #define PHY_BCM_FLAGS_MODE_COPPER 0x00000001
+ #define PHY_BCM_FLAGS_MODE_1000BX 0x00000002
+ #define PHY_BCM_FLAGS_INTF_SGMII 0x00000010
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0089-tg3-Update-version-to-3.108.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0089-tg3-Update-version-to-3.108.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,33 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Wed, 17 Feb 2010 15:17:05 +0000
+Subject: [PATCH 089/207] tg3: Update version to 3.108
+
+commit be7ce5307ded2e416224baab0bd1e5072591f33f upstream.
+
+This patch updates the tg3 version to 3.108.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index ed3fb11..c097af6 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -68,8 +68,8 @@
+
+ #define DRV_MODULE_NAME "tg3"
+ #define PFX DRV_MODULE_NAME ": "
+-#define DRV_MODULE_VERSION "3.107"
+-#define DRV_MODULE_RELDATE "February 12, 2010"
++#define DRV_MODULE_VERSION "3.108"
++#define DRV_MODULE_RELDATE "February 17, 2010"
+
+ #define TG3_DEF_MAC_MODE 0
+ #define TG3_DEF_RX_MODE 0
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0090-drivers-net-tg3.c-Use-pr-netdev-_-level-macro-helper.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0090-drivers-net-tg3.c-Use-pr-netdev-_-level-macro-helper.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,666 @@
+From: Joe Perches <joe at perches.com>
+Date: Wed, 17 Feb 2010 19:44:19 +0000
+Subject: [PATCH 090/207] drivers/net/tg3.c: Use (pr|netdev)_<level> macro
+ helpers
+
+commit 05dbe005386e7521153dce6c5ad95c98b73b80c7 upstream.
+
+Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+Remove #define PFX
+Use pr_<level>
+Use netdev_<level>
+Remove periods from most formats
+Coalesce long formats
+Use printk_once
+
+Signed-off-by: Joe Perches <joe at perches.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 270 +++++++++++++++++++++-------------------------------
+ 1 files changed, 109 insertions(+), 161 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index c097af6..2d62017 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -67,7 +67,6 @@
+ #include "tg3.h"
+
+ #define DRV_MODULE_NAME "tg3"
+-#define PFX DRV_MODULE_NAME ": "
+ #define DRV_MODULE_VERSION "3.108"
+ #define DRV_MODULE_RELDATE "February 17, 2010"
+
+@@ -158,7 +157,7 @@
+ #define FIRMWARE_TG3TSO5 "tigon/tg3_tso5.bin"
+
+ static char version[] __devinitdata =
+- DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
++ DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")";
+
+ MODULE_AUTHOR("David S. Miller (davem at redhat.com) and Jeff Garzik (jgarzik at pobox.com)");
+ MODULE_DESCRIPTION("Broadcom Tigon3 ethernet driver");
+@@ -1099,8 +1098,7 @@ static int tg3_mdio_init(struct tg3 *tp)
+
+ i = mdiobus_register(tp->mdio_bus);
+ if (i) {
+- printk(KERN_WARNING "%s: mdiobus_reg failed (0x%x)\n",
+- tp->dev->name, i);
++ netdev_warn(tp->dev, "mdiobus_reg failed (0x%x)\n", i);
+ mdiobus_free(tp->mdio_bus);
+ return i;
+ }
+@@ -1108,7 +1106,7 @@ static int tg3_mdio_init(struct tg3 *tp)
+ phydev = tp->mdio_bus->phy_map[TG3_PHY_MII_ADDR];
+
+ if (!phydev || !phydev->drv) {
+- printk(KERN_WARNING "%s: No PHY devices\n", tp->dev->name);
++ netdev_warn(tp->dev, "No PHY devices\n");
+ mdiobus_unregister(tp->mdio_bus);
+ mdiobus_free(tp->mdio_bus);
+ return -ENODEV;
+@@ -1252,27 +1250,22 @@ static void tg3_ump_link_report(struct tg3 *tp)
+ static void tg3_link_report(struct tg3 *tp)
+ {
+ if (!netif_carrier_ok(tp->dev)) {
+- if (netif_msg_link(tp))
+- printk(KERN_INFO PFX "%s: Link is down.\n",
+- tp->dev->name);
++ netif_info(tp, link, tp->dev, "Link is down\n");
+ tg3_ump_link_report(tp);
+ } else if (netif_msg_link(tp)) {
+- printk(KERN_INFO PFX "%s: Link is up at %d Mbps, %s duplex.\n",
+- tp->dev->name,
+- (tp->link_config.active_speed == SPEED_1000 ?
+- 1000 :
+- (tp->link_config.active_speed == SPEED_100 ?
+- 100 : 10)),
+- (tp->link_config.active_duplex == DUPLEX_FULL ?
+- "full" : "half"));
+-
+- printk(KERN_INFO PFX
+- "%s: Flow control is %s for TX and %s for RX.\n",
+- tp->dev->name,
+- (tp->link_config.active_flowctrl & FLOW_CTRL_TX) ?
+- "on" : "off",
+- (tp->link_config.active_flowctrl & FLOW_CTRL_RX) ?
+- "on" : "off");
++ netdev_info(tp->dev, "Link is up at %d Mbps, %s duplex\n",
++ (tp->link_config.active_speed == SPEED_1000 ?
++ 1000 :
++ (tp->link_config.active_speed == SPEED_100 ?
++ 100 : 10)),
++ (tp->link_config.active_duplex == DUPLEX_FULL ?
++ "full" : "half"));
++
++ netdev_info(tp->dev, "Flow control is %s for TX and %s for RX\n",
++ (tp->link_config.active_flowctrl & FLOW_CTRL_TX) ?
++ "on" : "off",
++ (tp->link_config.active_flowctrl & FLOW_CTRL_RX) ?
++ "on" : "off");
+ tg3_ump_link_report(tp);
+ }
+ }
+@@ -1471,7 +1464,7 @@ static int tg3_phy_init(struct tg3 *tp)
+ phydev = phy_connect(tp->dev, dev_name(&phydev->dev), tg3_adjust_link,
+ phydev->dev_flags, phydev->interface);
+ if (IS_ERR(phydev)) {
+- printk(KERN_ERR "%s: Could not attach to PHY\n", tp->dev->name);
++ netdev_err(tp->dev, "Could not attach to PHY\n");
+ return PTR_ERR(phydev);
+ }
+
+@@ -2500,8 +2493,8 @@ static int tg3_set_power_state(struct tg3 *tp, pci_power_t state)
+ break;
+
+ default:
+- printk(KERN_ERR PFX "%s: Invalid power state (D%d) requested\n",
+- tp->dev->name, state);
++ netdev_err(tp->dev, "Invalid power state (D%d) requested\n",
++ state);
+ return -EINVAL;
+ }
+
+@@ -4342,10 +4335,8 @@ static void tg3_tx_recover(struct tg3 *tp)
+ BUG_ON((tp->tg3_flags & TG3_FLAG_MBOX_WRITE_REORDER) ||
+ tp->write32_tx_mbox == tg3_write_indirect_mbox);
+
+- printk(KERN_WARNING PFX "%s: The system may be re-ordering memory-"
+- "mapped I/O cycles to the network device, attempting to "
+- "recover. Please report the problem to the driver maintainer "
+- "and include system chipset information.\n", tp->dev->name);
++ netdev_warn(tp->dev, "The system may be re-ordering memory-mapped I/O cycles to the network device, attempting to recover\n"
++ "Please report the problem to the driver maintainer and include system chipset information.\n");
+
+ spin_lock(&tp->lock);
+ tp->tg3_flags |= TG3_FLAG_TX_RECOVERY_PENDING;
+@@ -5269,8 +5260,7 @@ static int tg3_restart_hw(struct tg3 *tp, int reset_phy)
+
+ err = tg3_init_hw(tp, reset_phy);
+ if (err) {
+- printk(KERN_ERR PFX "%s: Failed to re-initialize device, "
+- "aborting.\n", tp->dev->name);
++ netdev_err(tp->dev, "Failed to re-initialize device, aborting\n");
+ tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
+ tg3_full_unlock(tp);
+ del_timer_sync(&tp->timer);
+@@ -5343,10 +5333,10 @@ out:
+
+ static void tg3_dump_short_state(struct tg3 *tp)
+ {
+- printk(KERN_ERR PFX "DEBUG: MAC_TX_STATUS[%08x] MAC_RX_STATUS[%08x]\n",
+- tr32(MAC_TX_STATUS), tr32(MAC_RX_STATUS));
+- printk(KERN_ERR PFX "DEBUG: RDMAC_STATUS[%08x] WDMAC_STATUS[%08x]\n",
+- tr32(RDMAC_STATUS), tr32(WDMAC_STATUS));
++ netdev_err(tp->dev, "DEBUG: MAC_TX_STATUS[%08x] MAC_RX_STATUS[%08x]\n",
++ tr32(MAC_TX_STATUS), tr32(MAC_RX_STATUS));
++ netdev_err(tp->dev, "DEBUG: RDMAC_STATUS[%08x] WDMAC_STATUS[%08x]\n",
++ tr32(RDMAC_STATUS), tr32(WDMAC_STATUS));
+ }
+
+ static void tg3_tx_timeout(struct net_device *dev)
+@@ -5354,8 +5344,7 @@ static void tg3_tx_timeout(struct net_device *dev)
+ struct tg3 *tp = netdev_priv(dev);
+
+ if (netif_msg_tx_err(tp)) {
+- printk(KERN_ERR PFX "%s: transmit timed out, resetting\n",
+- dev->name);
++ netdev_err(dev, "transmit timed out, resetting\n");
+ tg3_dump_short_state(tp);
+ }
+
+@@ -5519,8 +5508,7 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb,
+ netif_tx_stop_queue(txq);
+
+ /* This is a hard error, log it. */
+- printk(KERN_ERR PFX "%s: BUG! Tx Ring full when "
+- "queue awake!\n", dev->name);
++ netdev_err(dev, "BUG! Tx Ring full when queue awake!\n");
+ }
+ return NETDEV_TX_BUSY;
+ }
+@@ -5723,8 +5711,7 @@ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb,
+ netif_tx_stop_queue(txq);
+
+ /* This is a hard error, log it. */
+- printk(KERN_ERR PFX "%s: BUG! Tx Ring full when "
+- "queue awake!\n", dev->name);
++ netdev_err(dev, "BUG! Tx Ring full when queue awake!\n");
+ }
+ return NETDEV_TX_BUSY;
+ }
+@@ -6071,11 +6058,8 @@ static int tg3_rx_prodring_alloc(struct tg3 *tp,
+ /* Now allocate fresh SKBs for each rx ring. */
+ for (i = 0; i < tp->rx_pending; i++) {
+ if (tg3_alloc_rx_skb(tp, tpr, RXD_OPAQUE_RING_STD, i) < 0) {
+- printk(KERN_WARNING PFX
+- "%s: Using a smaller RX standard ring, "
+- "only %d out of %d buffers were allocated "
+- "successfully.\n",
+- tp->dev->name, i, tp->rx_pending);
++ netdev_warn(tp->dev, "Using a smaller RX standard ring, only %d out of %d buffers were allocated successfully\n",
++ i, tp->rx_pending);
+ if (i == 0)
+ goto initfail;
+ tp->rx_pending = i;
+@@ -6104,11 +6088,8 @@ static int tg3_rx_prodring_alloc(struct tg3 *tp,
+
+ for (i = 0; i < tp->rx_jumbo_pending; i++) {
+ if (tg3_alloc_rx_skb(tp, tpr, RXD_OPAQUE_RING_JUMBO, i) < 0) {
+- printk(KERN_WARNING PFX
+- "%s: Using a smaller RX jumbo ring, "
+- "only %d out of %d buffers were "
+- "allocated successfully.\n",
+- tp->dev->name, i, tp->rx_jumbo_pending);
++ netdev_warn(tp->dev, "Using a smaller RX jumbo ring, only %d out of %d buffers were allocated successfully\n",
++ i, tp->rx_jumbo_pending);
+ if (i == 0)
+ goto initfail;
+ tp->rx_jumbo_pending = i;
+@@ -6452,8 +6433,7 @@ static int tg3_stop_block(struct tg3 *tp, unsigned long ofs, u32 enable_bit, int
+ }
+
+ if (i == MAX_WAIT_CNT && !silent) {
+- printk(KERN_ERR PFX "tg3_stop_block timed out, "
+- "ofs=%lx enable_bit=%x\n",
++ pr_err("tg3_stop_block timed out, ofs=%lx enable_bit=%x\n",
+ ofs, enable_bit);
+ return -ENODEV;
+ }
+@@ -6500,9 +6480,8 @@ static int tg3_abort_hw(struct tg3 *tp, int silent)
+ break;
+ }
+ if (i >= MAX_WAIT_CNT) {
+- printk(KERN_ERR PFX "tg3_abort_hw timed out for %s, "
+- "TX_MODE_ENABLE will not clear MAC_TX_MODE=%08x\n",
+- tp->dev->name, tr32(MAC_TX_MODE));
++ netdev_err(tp->dev, "%s timed out, TX_MODE_ENABLE will not clear MAC_TX_MODE=%08x\n",
++ __func__, tr32(MAC_TX_MODE));
+ err |= -ENODEV;
+ }
+
+@@ -6723,8 +6702,7 @@ static int tg3_poll_fw(struct tg3 *tp)
+ !(tp->tg3_flags2 & TG3_FLG2_NO_FWARE_REPORTED)) {
+ tp->tg3_flags2 |= TG3_FLG2_NO_FWARE_REPORTED;
+
+- printk(KERN_INFO PFX "%s: No firmware running.\n",
+- tp->dev->name);
++ netdev_info(tp->dev, "No firmware running\n");
+ }
+
+ if (tp->pci_chip_rev_id == CHIPREV_ID_57765_A0) {
+@@ -7152,10 +7130,8 @@ static int tg3_halt_cpu(struct tg3 *tp, u32 offset)
+ }
+
+ if (i >= 10000) {
+- printk(KERN_ERR PFX "tg3_reset_cpu timed out for %s, "
+- "and %s CPU\n",
+- tp->dev->name,
+- (offset == RX_CPU_BASE ? "RX" : "TX"));
++ netdev_err(tp->dev, "%s timed out, %s CPU\n",
++ __func__, offset == RX_CPU_BASE ? "RX" : "TX");
+ return -ENODEV;
+ }
+
+@@ -7180,9 +7156,8 @@ static int tg3_load_firmware_cpu(struct tg3 *tp, u32 cpu_base, u32 cpu_scratch_b
+
+ if (cpu_base == TX_CPU_BASE &&
+ (tp->tg3_flags2 & TG3_FLG2_5705_PLUS)) {
+- printk(KERN_ERR PFX "tg3_load_firmware_cpu: Trying to load "
+- "TX cpu firmware on %s which is 5705.\n",
+- tp->dev->name);
++ netdev_err(tp->dev, "%s: Trying to load TX cpu firmware which is 5705\n",
++ __func__);
+ return -EINVAL;
+ }
+
+@@ -7261,10 +7236,8 @@ static int tg3_load_5701_a0_firmware_fix(struct tg3 *tp)
+ udelay(1000);
+ }
+ if (i >= 5) {
+- printk(KERN_ERR PFX "tg3_load_firmware fails for %s "
+- "to set RX CPU PC, is %08x should be %08x\n",
+- tp->dev->name, tr32(RX_CPU_BASE + CPU_PC),
+- info.fw_base);
++ netdev_err(tp->dev, "tg3_load_firmware fails to set RX CPU PC, is %08x should be %08x\n",
++ tr32(RX_CPU_BASE + CPU_PC), info.fw_base);
+ return -ENODEV;
+ }
+ tw32(RX_CPU_BASE + CPU_STATE, 0xffffffff);
+@@ -7327,10 +7300,8 @@ static int tg3_load_tso_firmware(struct tg3 *tp)
+ udelay(1000);
+ }
+ if (i >= 5) {
+- printk(KERN_ERR PFX "tg3_load_tso_firmware fails for %s "
+- "to set CPU PC, is %08x should be %08x\n",
+- tp->dev->name, tr32(cpu_base + CPU_PC),
+- info.fw_base);
++ netdev_err(tp->dev, "%s fails to set CPU PC, is %08x should be %08x\n",
++ __func__, tr32(cpu_base + CPU_PC), info.fw_base);
+ return -ENODEV;
+ }
+ tw32(cpu_base + CPU_STATE, 0xffffffff);
+@@ -7791,8 +7762,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ udelay(10);
+ }
+ if (i >= 2000) {
+- printk(KERN_ERR PFX "tg3_reset_hw cannot enable BUFMGR for %s.\n",
+- tp->dev->name);
++ netdev_err(tp->dev, "%s cannot enable BUFMGR\n", __func__);
+ return -ENODEV;
+ }
+
+@@ -8655,10 +8625,8 @@ static int tg3_test_msi(struct tg3 *tp)
+ return err;
+
+ /* MSI test failed, go back to INTx mode */
+- printk(KERN_WARNING PFX "%s: No interrupt was generated using MSI, "
+- "switching to INTx mode. Please report this failure to "
+- "the PCI maintainer and include system chipset information.\n",
+- tp->dev->name);
++ netdev_warn(tp->dev, "No interrupt was generated using MSI, switching to INTx mode\n"
++ "Please report this failure to the PCI maintainer and include system chipset information\n");
+
+ free_irq(tp->napi[0].irq_vec, &tp->napi[0]);
+
+@@ -8692,8 +8660,8 @@ static int tg3_request_firmware(struct tg3 *tp)
+ const __be32 *fw_data;
+
+ if (request_firmware(&tp->fw, tp->fw_needed, &tp->pdev->dev)) {
+- printk(KERN_ERR "%s: Failed to load firmware \"%s\"\n",
+- tp->dev->name, tp->fw_needed);
++ netdev_err(tp->dev, "Failed to load firmware \"%s\"\n",
++ tp->fw_needed);
+ return -ENOENT;
+ }
+
+@@ -8706,8 +8674,8 @@ static int tg3_request_firmware(struct tg3 *tp)
+
+ tp->fw_len = be32_to_cpu(fw_data[2]); /* includes bss */
+ if (tp->fw_len < (tp->fw->size - 12)) {
+- printk(KERN_ERR "%s: bogus length %d in \"%s\"\n",
+- tp->dev->name, tp->fw_len, tp->fw_needed);
++ netdev_err(tp->dev, "bogus length %d in \"%s\"\n",
++ tp->fw_len, tp->fw_needed);
+ release_firmware(tp->fw);
+ tp->fw = NULL;
+ return -EINVAL;
+@@ -8745,9 +8713,8 @@ static bool tg3_enable_msix(struct tg3 *tp)
+ return false;
+ if (pci_enable_msix(tp->pdev, msix_ent, rc))
+ return false;
+- printk(KERN_NOTICE
+- "%s: Requested %d MSI-X vectors, received %d\n",
+- tp->dev->name, tp->irq_cnt, rc);
++ netdev_notice(tp->dev, "Requested %d MSI-X vectors, received %d\n",
++ tp->irq_cnt, rc);
+ tp->irq_cnt = rc;
+ }
+
+@@ -8772,8 +8739,7 @@ static void tg3_ints_init(struct tg3 *tp)
+ /* All MSI supporting chips should support tagged
+ * status. Assert that this is the case.
+ */
+- printk(KERN_WARNING PFX "%s: MSI without TAGGED? "
+- "Not using MSI.\n", tp->dev->name);
++ netdev_warn(tp->dev, "MSI without TAGGED? Not using MSI\n");
+ goto defcfg;
+ }
+
+@@ -8818,12 +8784,10 @@ static int tg3_open(struct net_device *dev)
+ if (err)
+ return err;
+ } else if (err) {
+- printk(KERN_WARNING "%s: TSO capability disabled.\n",
+- tp->dev->name);
++ netdev_warn(tp->dev, "TSO capability disabled\n");
+ tp->tg3_flags2 &= ~TG3_FLG2_TSO_CAPABLE;
+ } else if (!(tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE)) {
+- printk(KERN_NOTICE "%s: TSO capability restored.\n",
+- tp->dev->name);
++ netdev_notice(tp->dev, "TSO capability restored\n");
+ tp->tg3_flags2 |= TG3_FLG2_TSO_CAPABLE;
+ }
+ }
+@@ -10688,8 +10652,7 @@ static int tg3_test_registers(struct tg3 *tp)
+
+ out:
+ if (netif_msg_hw(tp))
+- printk(KERN_ERR PFX "Register test failed at offset %x\n",
+- offset);
++ pr_err("Register test failed at offset %x\n", offset);
+ tw32(offset, save_val);
+ return -EIO;
+ }
+@@ -11816,8 +11779,8 @@ static void __devinit tg3_nvram_init(struct tg3 *tp)
+ tp->tg3_flags |= TG3_FLAG_NVRAM;
+
+ if (tg3_nvram_lock(tp)) {
+- printk(KERN_WARNING PFX "%s: Cannot get nvarm lock, "
+- "tg3_nvram_init failed.\n", tp->dev->name);
++ netdev_warn(tp->dev, "Cannot get nvram lock, %s failed\n",
++ __func__);
+ return;
+ }
+ tg3_enable_nvram_access(tp);
+@@ -13281,8 +13244,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ (tp->tg3_flags2 & TG3_FLG2_5780_CLASS)) {
+ tp->pcix_cap = pci_find_capability(tp->pdev, PCI_CAP_ID_PCIX);
+ if (!tp->pcix_cap) {
+- printk(KERN_ERR PFX "Cannot find PCI-X "
+- "capability, aborting.\n");
++ pr_err("Cannot find PCI-X capability, aborting\n");
+ return -EIO;
+ }
+
+@@ -13479,8 +13441,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ /* Force the chip into D0. */
+ err = tg3_set_power_state(tp, PCI_D0);
+ if (err) {
+- printk(KERN_ERR PFX "(%s) transition to D0 failed\n",
+- pci_name(tp->pdev));
++ pr_err("(%s) transition to D0 failed\n", pci_name(tp->pdev));
+ return err;
+ }
+
+@@ -13654,7 +13615,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+
+ err = tg3_phy_probe(tp);
+ if (err) {
+- printk(KERN_ERR PFX "(%s) phy probe failed, err %d\n",
++ pr_err("(%s) phy probe failed, err %d\n",
+ pci_name(tp->pdev), err);
+ /* ... but do not return immediately ... */
+ tg3_mdio_fini(tp);
+@@ -14164,7 +14125,8 @@ static int __devinit tg3_test_dma(struct tg3 *tp)
+ /* Send the buffer to the chip. */
+ ret = tg3_do_test_dma(tp, buf, buf_dma, TEST_BUFFER_SIZE, 1);
+ if (ret) {
+- printk(KERN_ERR "tg3_test_dma() Write the buffer failed %d\n", ret);
++ pr_err("tg3_test_dma() Write the buffer failed %d\n",
++ ret);
+ break;
+ }
+
+@@ -14174,7 +14136,8 @@ static int __devinit tg3_test_dma(struct tg3 *tp)
+ u32 val;
+ tg3_read_mem(tp, 0x2100 + (i*4), &val);
+ if (le32_to_cpu(val) != p[i]) {
+- printk(KERN_ERR " tg3_test_dma() Card buffer corrupted on write! (%d != %d)\n", val, i);
++ pr_err(" tg3_test_dma() Card buffer corrupted on write! (%d != %d)\n",
++ val, i);
+ /* ret = -ENODEV here? */
+ }
+ p[i] = 0;
+@@ -14183,7 +14146,8 @@ static int __devinit tg3_test_dma(struct tg3 *tp)
+ /* Now read it back. */
+ ret = tg3_do_test_dma(tp, buf, buf_dma, TEST_BUFFER_SIZE, 0);
+ if (ret) {
+- printk(KERN_ERR "tg3_test_dma() Read the buffer failed %d\n", ret);
++ pr_err("tg3_test_dma() Read the buffer failed %d\n",
++ ret);
+
+ break;
+ }
+@@ -14200,7 +14164,8 @@ static int __devinit tg3_test_dma(struct tg3 *tp)
+ tw32(TG3PCI_DMA_RW_CTRL, tp->dma_rwctrl);
+ break;
+ } else {
+- printk(KERN_ERR "tg3_test_dma() buffer corrupted on read back! (%d != %d)\n", p[i], i);
++ pr_err("tg3_test_dma() buffer corrupted on read back! (%d != %d)\n",
++ p[i], i);
+ ret = -ENODEV;
+ goto out;
+ }
+@@ -14481,7 +14446,6 @@ static const struct net_device_ops tg3_netdev_ops_dma_bug = {
+ static int __devinit tg3_init_one(struct pci_dev *pdev,
+ const struct pci_device_id *ent)
+ {
+- static int tg3_version_printed = 0;
+ struct net_device *dev;
+ struct tg3 *tp;
+ int i, err, pm_cap;
+@@ -14489,20 +14453,17 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
+ char str[40];
+ u64 dma_mask, persist_dma_mask;
+
+- if (tg3_version_printed++ == 0)
+- printk(KERN_INFO "%s", version);
++ printk_once(KERN_INFO "%s\n", version);
+
+ err = pci_enable_device(pdev);
+ if (err) {
+- printk(KERN_ERR PFX "Cannot enable PCI device, "
+- "aborting.\n");
++ pr_err("Cannot enable PCI device, aborting\n");
+ return err;
+ }
+
+ err = pci_request_regions(pdev, DRV_MODULE_NAME);
+ if (err) {
+- printk(KERN_ERR PFX "Cannot obtain PCI resources, "
+- "aborting.\n");
++ pr_err("Cannot obtain PCI resources, aborting\n");
+ goto err_out_disable_pdev;
+ }
+
+@@ -14511,15 +14472,14 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
+ /* Find power-management capability. */
+ pm_cap = pci_find_capability(pdev, PCI_CAP_ID_PM);
+ if (pm_cap == 0) {
+- printk(KERN_ERR PFX "Cannot find PowerManagement capability, "
+- "aborting.\n");
++ pr_err("Cannot find PowerManagement capability, aborting\n");
+ err = -EIO;
+ goto err_out_free_res;
+ }
+
+ dev = alloc_etherdev_mq(sizeof(*tp), TG3_IRQ_MAX_VECS);
+ if (!dev) {
+- printk(KERN_ERR PFX "Etherdev alloc failed, aborting.\n");
++ pr_err("Etherdev alloc failed, aborting\n");
+ err = -ENOMEM;
+ goto err_out_free_res;
+ }
+@@ -14569,8 +14529,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
+
+ tp->regs = pci_ioremap_bar(pdev, BAR_0);
+ if (!tp->regs) {
+- printk(KERN_ERR PFX "Cannot map device registers, "
+- "aborting.\n");
++ netdev_err(dev, "Cannot map device registers, aborting\n");
+ err = -ENOMEM;
+ goto err_out_free_dev;
+ }
+@@ -14586,8 +14545,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
+
+ err = tg3_get_invariants(tp);
+ if (err) {
+- printk(KERN_ERR PFX "Problem fetching invariants of chip, "
+- "aborting.\n");
++ netdev_err(dev, "Problem fetching invariants of chip, aborting\n");
+ goto err_out_iounmap;
+ }
+
+@@ -14622,8 +14580,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
+ err = pci_set_consistent_dma_mask(pdev,
+ persist_dma_mask);
+ if (err < 0) {
+- printk(KERN_ERR PFX "Unable to obtain 64 bit "
+- "DMA for consistent allocations\n");
++ netdev_err(dev, "Unable to obtain 64 bit DMA for consistent allocations\n");
+ goto err_out_iounmap;
+ }
+ }
+@@ -14631,8 +14588,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
+ if (err || dma_mask == DMA_BIT_MASK(32)) {
+ err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
+ if (err) {
+- printk(KERN_ERR PFX "No usable DMA configuration, "
+- "aborting.\n");
++ netdev_err(dev, "No usable DMA configuration, aborting\n");
+ goto err_out_iounmap;
+ }
+ }
+@@ -14681,16 +14637,14 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
+
+ err = tg3_get_device_address(tp);
+ if (err) {
+- printk(KERN_ERR PFX "Could not obtain valid ethernet address, "
+- "aborting.\n");
++ netdev_err(dev, "Could not obtain valid ethernet address, aborting\n");
+ goto err_out_iounmap;
+ }
+
+ if (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE) {
+ tp->aperegs = pci_ioremap_bar(pdev, BAR_2);
+ if (!tp->aperegs) {
+- printk(KERN_ERR PFX "Cannot map APE registers, "
+- "aborting.\n");
++ netdev_err(dev, "Cannot map APE registers, aborting\n");
+ err = -ENOMEM;
+ goto err_out_iounmap;
+ }
+@@ -14714,7 +14668,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
+
+ err = tg3_test_dma(tp);
+ if (err) {
+- printk(KERN_ERR PFX "DMA engine test failed, aborting.\n");
++ netdev_err(dev, "DMA engine test failed, aborting\n");
+ goto err_out_apeunmap;
+ }
+
+@@ -14775,45 +14729,39 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
+
+ err = register_netdev(dev);
+ if (err) {
+- printk(KERN_ERR PFX "Cannot register net device, "
+- "aborting.\n");
++ netdev_err(dev, "Cannot register net device, aborting\n");
+ goto err_out_apeunmap;
+ }
+
+- printk(KERN_INFO "%s: Tigon3 [partno(%s) rev %04x] (%s) MAC address %pM\n",
+- dev->name,
+- tp->board_part_number,
+- tp->pci_chip_rev_id,
+- tg3_bus_string(tp, str),
+- dev->dev_addr);
++ netdev_info(dev, "Tigon3 [partno(%s) rev %04x] (%s) MAC address %pM\n",
++ tp->board_part_number,
++ tp->pci_chip_rev_id,
++ tg3_bus_string(tp, str),
++ dev->dev_addr);
+
+ if (tp->tg3_flags3 & TG3_FLG3_PHY_CONNECTED) {
+ struct phy_device *phydev;
+ phydev = tp->mdio_bus->phy_map[TG3_PHY_MII_ADDR];
+- printk(KERN_INFO
+- "%s: attached PHY driver [%s] (mii_bus:phy_addr=%s)\n",
+- tp->dev->name, phydev->drv->name,
+- dev_name(&phydev->dev));
++ netdev_info(dev, "attached PHY driver [%s] (mii_bus:phy_addr=%s)\n",
++ phydev->drv->name, dev_name(&phydev->dev));
+ } else
+- printk(KERN_INFO
+- "%s: attached PHY is %s (%s Ethernet) (WireSpeed[%d])\n",
+- tp->dev->name, tg3_phy_string(tp),
+- ((tp->tg3_flags & TG3_FLAG_10_100_ONLY) ? "10/100Base-TX" :
+- ((tp->tg3_flags2 & TG3_FLG2_ANY_SERDES) ? "1000Base-SX" :
+- "10/100/1000Base-T")),
+- (tp->tg3_flags2 & TG3_FLG2_NO_ETH_WIRE_SPEED) == 0);
+-
+- printk(KERN_INFO "%s: RXcsums[%d] LinkChgREG[%d] MIirq[%d] ASF[%d] TSOcap[%d]\n",
+- dev->name,
+- (tp->tg3_flags & TG3_FLAG_RX_CHECKSUMS) != 0,
+- (tp->tg3_flags & TG3_FLAG_USE_LINKCHG_REG) != 0,
+- (tp->tg3_flags & TG3_FLAG_USE_MI_INTERRUPT) != 0,
+- (tp->tg3_flags & TG3_FLAG_ENABLE_ASF) != 0,
+- (tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE) != 0);
+- printk(KERN_INFO "%s: dma_rwctrl[%08x] dma_mask[%d-bit]\n",
+- dev->name, tp->dma_rwctrl,
+- (pdev->dma_mask == DMA_BIT_MASK(32)) ? 32 :
+- (((u64) pdev->dma_mask == DMA_BIT_MASK(40)) ? 40 : 64));
++ netdev_info(dev, "attached PHY is %s (%s Ethernet) (WireSpeed[%d])\n",
++ tg3_phy_string(tp),
++ ((tp->tg3_flags & TG3_FLAG_10_100_ONLY) ? "10/100Base-TX" :
++ ((tp->tg3_flags2 & TG3_FLG2_ANY_SERDES) ? "1000Base-SX" :
++ "10/100/1000Base-T")),
++ (tp->tg3_flags2 & TG3_FLG2_NO_ETH_WIRE_SPEED) == 0);
++
++ netdev_info(dev, "RXcsums[%d] LinkChgREG[%d] MIirq[%d] ASF[%d] TSOcap[%d]\n",
++ (tp->tg3_flags & TG3_FLAG_RX_CHECKSUMS) != 0,
++ (tp->tg3_flags & TG3_FLAG_USE_LINKCHG_REG) != 0,
++ (tp->tg3_flags & TG3_FLAG_USE_MI_INTERRUPT) != 0,
++ (tp->tg3_flags & TG3_FLAG_ENABLE_ASF) != 0,
++ (tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE) != 0);
++ netdev_info(dev, "dma_rwctrl[%08x] dma_mask[%d-bit]\n",
++ tp->dma_rwctrl,
++ pdev->dma_mask == DMA_BIT_MASK(32) ? 32 :
++ ((u64)pdev->dma_mask) == DMA_BIT_MASK(40) ? 40 : 64);
+
+ return 0;
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0091-net-convert-multiple-drivers-to-use-netdev_for_each_.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0091-net-convert-multiple-drivers-to-use-netdev_for_each_.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,38 @@
+From: Jiri Pirko <jpirko at redhat.com>
+Date: Tue, 23 Feb 2010 23:17:07 +0000
+Subject: [PATCH 091/207] net: convert multiple drivers to use
+ netdev_for_each_mc_addr, part6
+
+commit 567ec874d15b478c8eda7e9a5d2dcb05f13f1fb5 upstream.
+
+Signed-off-by: Jiri Pirko <jpirko at redhat.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Restricted to drivers/net/tg3.{c,h}]
+---
+ drivers/net/tg3.c | 5 +----
+ 1 files changed, 1 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 2d62017..9136c15 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -9459,15 +9459,12 @@ static void __tg3_set_rx_mode(struct net_device *dev)
+ } else {
+ /* Accept one or more multicast(s). */
+ struct dev_mc_list *mclist;
+- unsigned int i;
+ u32 mc_filter[4] = { 0, };
+ u32 regidx;
+ u32 bit;
+ u32 crc;
+
+- for (i = 0, mclist = dev->mc_list; mclist && i < netdev_mc_count(dev);
+- i++, mclist = mclist->next) {
+-
++ netdev_for_each_mc_addr(mclist, dev) {
+ crc = calc_crc (mclist->dmi_addr, ETH_ALEN);
+ bit = ~crc & 0x7f;
+ regidx = (bit & 0x60) >> 5;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0092-pci-Add-PCI-LRDT-tag-size-and-section-size.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0092-pci-Add-PCI-LRDT-tag-size-and-section-size.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,76 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Fri, 26 Feb 2010 14:04:39 +0000
+Subject: [PATCH 092/207] pci: Add PCI LRDT tag size and section size
+
+commit a2ce766238f72ff7337606c0bc96803c30c9e05c upstream.
+
+This patch adds a preprocessor constant to describe the PCI VPD large
+resource data type tag size and an inline function to extract the large
+resource section size from the large resource data type tag.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: Michael Chan <mchan at broadcom.com>
+Acked-by: Jesse Barnes <jbarnes at virtuousgeek.org>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Adjust context; drop inapplicable changes to bnx2]
+---
+ drivers/net/tg3.c | 13 ++++++-------
+ include/linux/pci.h | 13 +++++++++++++
+ 2 files changed, 19 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 9136c15..dc76709 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -12591,19 +12591,18 @@ static void __devinit tg3_read_partno(struct tg3 *tp)
+ unsigned int block_end;
+
+ if (val == 0x82 || val == 0x91) {
+- i = (i + 3 +
+- (vpd_data[i + 1] +
+- (vpd_data[i + 2] << 8)));
++ i += PCI_VPD_LRDT_TAG_SIZE +
++ pci_vpd_lrdt_size(&vpd_data[i]);
+ continue;
+ }
+
+ if (val != 0x90)
+ goto out_not_found;
+
+- block_end = (i + 3 +
+- (vpd_data[i + 1] +
+- (vpd_data[i + 2] << 8)));
+- i += 3;
++ block_end = i + PCI_VPD_LRDT_TAG_SIZE +
++ pci_vpd_lrdt_size(&vpd_data[i]);
++
++ i += PCI_VPD_LRDT_TAG_SIZE;
+
+ if (block_end > TG3_NVM_VPD_LEN)
+ goto out_not_found;
+diff --git a/include/linux/pci.h b/include/linux/pci.h
+index d67702a..0955945 100644
+--- a/include/linux/pci.h
++++ b/include/linux/pci.h
+@@ -1300,5 +1300,18 @@ extern void pci_hp_create_module_link(struct pci_slot *pci_slot);
+ extern void pci_hp_remove_module_link(struct pci_slot *pci_slot);
+ #endif
+
++#define PCI_VPD_LRDT_TAG_SIZE 3
++
++/**
++ * pci_vpd_lrdt_size - Extracts the Large Resource Data Type length
++ * @lrdt: Pointer to the beginning of the Large Resource Data Type tag
++ *
++ * Returns the extracted Large Resource Data Type length.
++ */
++static inline u16 pci_vpd_lrdt_size(const u8 *lrdt)
++{
++ return (u16)lrdt[1] + ((u16)lrdt[2] << 8);
++}
++
+ #endif /* __KERNEL__ */
+ #endif /* LINUX_PCI_H */
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0093-pci-Add-large-and-small-resource-data-type-code.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0093-pci-Add-large-and-small-resource-data-type-code.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,112 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Fri, 26 Feb 2010 14:04:40 +0000
+Subject: [PATCH 093/207] pci: Add large and small resource data type code
+
+commit 7ad506fa1adc2da3d394c562f09b8e1b3026c402 upstream.
+
+This patch introduces more VPD preprocessor definitions to identify some
+small and large resource data type item names. The patch then continues
+to correct how the tg3 and bnx2 drivers search for the "read-only data"
+large resource data type.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: Michael Chan <mchan at broadcom.com>
+Acked-by: Jesse Barnes <jbarnes at virtuousgeek.org>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Adjust context; drop inapplicable changes to bnx2]
+---
+ drivers/net/tg3.c | 23 +++++++++++++++++------
+ include/linux/pci.h | 34 +++++++++++++++++++++++++++++++++-
+ 2 files changed, 50 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index dc76709..d1d6f59 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -12590,15 +12590,26 @@ static void __devinit tg3_read_partno(struct tg3 *tp)
+ unsigned char val = vpd_data[i];
+ unsigned int block_end;
+
+- if (val == 0x82 || val == 0x91) {
+- i += PCI_VPD_LRDT_TAG_SIZE +
+- pci_vpd_lrdt_size(&vpd_data[i]);
++ if (val & PCI_VPD_LRDT) {
++ if (i + PCI_VPD_LRDT_TAG_SIZE > TG3_NVM_VPD_LEN)
++ break;
++
++ if (val != PCI_VPD_LRDT_RO_DATA) {
++ i += PCI_VPD_LRDT_TAG_SIZE +
++ pci_vpd_lrdt_size(&vpd_data[i]);
++
++ continue;
++ }
++ } else {
++ if ((val & PCI_VPD_SRDT_TIN_MASK) == PCI_VPD_STIN_END)
++ break;
++
++ i += PCI_VPD_SRDT_TAG_SIZE +
++ pci_vpd_srdt_size(&vpd_data[i]);
++
+ continue;
+ }
+
+- if (val != 0x90)
+- goto out_not_found;
+-
+ block_end = i + PCI_VPD_LRDT_TAG_SIZE +
+ pci_vpd_lrdt_size(&vpd_data[i]);
+
+diff --git a/include/linux/pci.h b/include/linux/pci.h
+index 0955945..dd21f8f 100644
+--- a/include/linux/pci.h
++++ b/include/linux/pci.h
+@@ -1300,7 +1300,28 @@ extern void pci_hp_create_module_link(struct pci_slot *pci_slot);
+ extern void pci_hp_remove_module_link(struct pci_slot *pci_slot);
+ #endif
+
+-#define PCI_VPD_LRDT_TAG_SIZE 3
++#define PCI_VPD_LRDT 0x80 /* Large Resource Data Type */
++#define PCI_VPD_LRDT_ID(x) (x | PCI_VPD_LRDT)
++
++/* Large Resource Data Type Tag Item Names */
++#define PCI_VPD_LTIN_ID_STRING 0x02 /* Identifier String */
++#define PCI_VPD_LTIN_RO_DATA 0x10 /* Read-Only Data */
++#define PCI_VPD_LTIN_RW_DATA 0x11 /* Read-Write Data */
++
++#define PCI_VPD_LRDT_ID_STRING PCI_VPD_LRDT_ID(PCI_VPD_LTIN_ID_STRING)
++#define PCI_VPD_LRDT_RO_DATA PCI_VPD_LRDT_ID(PCI_VPD_LTIN_RO_DATA)
++#define PCI_VPD_LRDT_RW_DATA PCI_VPD_LRDT_ID(PCI_VPD_LTIN_RW_DATA)
++
++/* Small Resource Data Type Tag Item Names */
++#define PCI_VPD_STIN_END 0x78 /* End */
++
++#define PCI_VPD_SRDT_END PCI_VPD_STIN_END
++
++#define PCI_VPD_SRDT_TIN_MASK 0x78
++#define PCI_VPD_SRDT_LEN_MASK 0x07
++
++#define PCI_VPD_LRDT_TAG_SIZE 3
++#define PCI_VPD_SRDT_TAG_SIZE 1
+
+ /**
+ * pci_vpd_lrdt_size - Extracts the Large Resource Data Type length
+@@ -1313,5 +1334,16 @@ static inline u16 pci_vpd_lrdt_size(const u8 *lrdt)
+ return (u16)lrdt[1] + ((u16)lrdt[2] << 8);
+ }
+
++/**
++ * pci_vpd_srdt_size - Extracts the Small Resource Data Type length
++ * @lrdt: Pointer to the beginning of the Small Resource Data Type tag
++ *
++ * Returns the extracted Small Resource Data Type length.
++ */
++static inline u8 pci_vpd_srdt_size(const u8 *srdt)
++{
++ return (*srdt) & PCI_VPD_SRDT_LEN_MASK;
++}
++
+ #endif /* __KERNEL__ */
+ #endif /* LINUX_PCI_H */
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0094-pci-Add-helper-to-find-a-VPD-resource-data-type.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0094-pci-Add-helper-to-find-a-VPD-resource-data-type.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,155 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Fri, 26 Feb 2010 14:04:41 +0000
+Subject: [PATCH 094/207] pci: Add helper to find a VPD resource data type
+
+commit b55ac1b22690d2e5b02a61cf6d69c2d66969c79d upstream.
+
+This patch adds the pci_vpd_find_tag() helper function to find VPD
+resource data types in a buffer.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: Michael Chan <mchan at broadcom.com>
+Acked-by: Jesse Barnes <jbarnes at virtuousgeek.org>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Adjust context; drop inapplicable changes to bnx2]
+---
+ drivers/net/tg3.c | 26 +++++---------------------
+ drivers/pci/Makefile | 2 +-
+ drivers/pci/vpd.c | 43 +++++++++++++++++++++++++++++++++++++++++++
+ include/linux/pci.h | 12 ++++++++++++
+ 4 files changed, 61 insertions(+), 22 deletions(-)
+ create mode 100644 drivers/pci/vpd.c
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index d1d6f59..22425a3 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -12548,7 +12548,7 @@ skip_phy_reset:
+ static void __devinit tg3_read_partno(struct tg3 *tp)
+ {
+ unsigned char vpd_data[TG3_NVM_VPD_LEN]; /* in little-endian format */
+- unsigned int i;
++ int i;
+ u32 magic;
+
+ if ((tp->tg3_flags3 & TG3_FLG3_NO_NVRAM) ||
+@@ -12587,28 +12587,12 @@ static void __devinit tg3_read_partno(struct tg3 *tp)
+
+ /* Now parse and find the part number. */
+ for (i = 0; i < TG3_NVM_VPD_LEN - 2; ) {
+- unsigned char val = vpd_data[i];
+ unsigned int block_end;
+
+- if (val & PCI_VPD_LRDT) {
+- if (i + PCI_VPD_LRDT_TAG_SIZE > TG3_NVM_VPD_LEN)
+- break;
+-
+- if (val != PCI_VPD_LRDT_RO_DATA) {
+- i += PCI_VPD_LRDT_TAG_SIZE +
+- pci_vpd_lrdt_size(&vpd_data[i]);
+-
+- continue;
+- }
+- } else {
+- if ((val & PCI_VPD_SRDT_TIN_MASK) == PCI_VPD_STIN_END)
+- break;
+-
+- i += PCI_VPD_SRDT_TAG_SIZE +
+- pci_vpd_srdt_size(&vpd_data[i]);
+-
+- continue;
+- }
++ i = pci_vpd_find_tag(vpd_data, i, TG3_NVM_VPD_LEN,
++ PCI_VPD_LRDT_RO_DATA);
++ if (i < 0)
++ break;
+
+ block_end = i + PCI_VPD_LRDT_TAG_SIZE +
+ pci_vpd_lrdt_size(&vpd_data[i]);
+diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile
+index 4a7f11d..c959e22 100644
+--- a/drivers/pci/Makefile
++++ b/drivers/pci/Makefile
+@@ -4,7 +4,7 @@
+
+ obj-y += access.o bus.o probe.o remove.o pci.o quirks.o \
+ pci-driver.o search.o pci-sysfs.o rom.o setup-res.o \
+- irq.o
++ irq.o vpd.o
+ obj-$(CONFIG_PROC_FS) += proc.o
+ obj-$(CONFIG_SYSFS) += slot.o
+
+diff --git a/drivers/pci/vpd.c b/drivers/pci/vpd.c
+new file mode 100644
+index 0000000..6bc55457
+--- /dev/null
++++ b/drivers/pci/vpd.c
+@@ -0,0 +1,43 @@
++/*
++ * File: vpd.c
++ * Purpose: Provide PCI VPD support
++ *
++ * Copyright (C) 2010 Broadcom Corporation.
++ */
++
++#include <linux/pci.h>
++
++int pci_vpd_find_tag(const u8 *buf, unsigned int off, unsigned int len, u8 rdt)
++{
++ int i;
++
++ for (i = off; i < len; ) {
++ u8 val = buf[i];
++
++ if (val & PCI_VPD_LRDT) {
++ /* Don't return success of the tag isn't complete */
++ if (i + PCI_VPD_LRDT_TAG_SIZE > len)
++ break;
++
++ if (val == rdt)
++ return i;
++
++ i += PCI_VPD_LRDT_TAG_SIZE +
++ pci_vpd_lrdt_size(&buf[i]);
++ } else {
++ u8 tag = val & ~PCI_VPD_SRDT_LEN_MASK;
++
++ if (tag == rdt)
++ return i;
++
++ if (tag == PCI_VPD_SRDT_END)
++ break;
++
++ i += PCI_VPD_SRDT_TAG_SIZE +
++ pci_vpd_srdt_size(&buf[i]);
++ }
++ }
++
++ return -ENOENT;
++}
++EXPORT_SYMBOL_GPL(pci_vpd_find_tag);
+diff --git a/include/linux/pci.h b/include/linux/pci.h
+index dd21f8f..00137f2 100644
+--- a/include/linux/pci.h
++++ b/include/linux/pci.h
+@@ -1345,5 +1345,17 @@ static inline u8 pci_vpd_srdt_size(const u8 *srdt)
+ return (*srdt) & PCI_VPD_SRDT_LEN_MASK;
+ }
+
++/**
++ * pci_vpd_find_tag - Locates the Resource Data Type tag provided
++ * @buf: Pointer to buffered vpd data
++ * @off: The offset into the buffer at which to begin the search
++ * @len: The length of the vpd buffer
++ * @rdt: The Resource Data Type to search for
++ *
++ * Returns the index where the Resource Data Type was found or
++ * -ENOENT otherwise.
++ */
++int pci_vpd_find_tag(const u8 *buf, unsigned int off, unsigned int len, u8 rdt);
++
+ #endif /* __KERNEL__ */
+ #endif /* LINUX_PCI_H */
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0095-pci-Add-VPD-information-field-helper-functions.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0095-pci-Add-VPD-information-field-helper-functions.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,80 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Fri, 26 Feb 2010 14:04:42 +0000
+Subject: [PATCH 095/207] pci: Add VPD information field helper functions
+
+commit e1d5bdabb94da89bdb3c3f2ee105cf61fca88ec8 upstream.
+
+This patch adds a preprocessor constant to describe the PCI VPD
+information field header size and an inline function to extract the
+size of the information field itself.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: Michael Chan <mchan at broadcom.com>
+Acked-by: Jesse Barnes <jbarnes at virtuousgeek.org>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Adjust context; drop inapplicable changes to bnx2]
+---
+ drivers/net/tg3.c | 7 ++++---
+ include/linux/pci.h | 13 +++++++++++++
+ 2 files changed, 17 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 22425a3..2448bcf 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -12605,9 +12605,9 @@ static void __devinit tg3_read_partno(struct tg3 *tp)
+ while (i < (block_end - 2)) {
+ if (vpd_data[i + 0] == 'P' &&
+ vpd_data[i + 1] == 'N') {
+- int partno_len = vpd_data[i + 2];
++ int partno_len = pci_vpd_info_field_size(&vpd_data[i]);
+
+- i += 3;
++ i += PCI_VPD_INFO_FLD_HDR_SIZE;
+ if (partno_len > TG3_BPN_SIZE ||
+ (partno_len + i) > TG3_NVM_VPD_LEN)
+ goto out_not_found;
+@@ -12618,7 +12618,8 @@ static void __devinit tg3_read_partno(struct tg3 *tp)
+ /* Success. */
+ return;
+ }
+- i += 3 + vpd_data[i + 2];
++ i += PCI_VPD_INFO_FLD_HDR_SIZE +
++ pci_vpd_info_field_size(&vpd_data[i]);
+ }
+
+ /* Part number not found. */
+diff --git a/include/linux/pci.h b/include/linux/pci.h
+index 00137f2..9dba6a4 100644
+--- a/include/linux/pci.h
++++ b/include/linux/pci.h
+@@ -1323,6 +1323,8 @@ extern void pci_hp_remove_module_link(struct pci_slot *pci_slot);
+ #define PCI_VPD_LRDT_TAG_SIZE 3
+ #define PCI_VPD_SRDT_TAG_SIZE 1
+
++#define PCI_VPD_INFO_FLD_HDR_SIZE 3
++
+ /**
+ * pci_vpd_lrdt_size - Extracts the Large Resource Data Type length
+ * @lrdt: Pointer to the beginning of the Large Resource Data Type tag
+@@ -1346,6 +1348,17 @@ static inline u8 pci_vpd_srdt_size(const u8 *srdt)
+ }
+
+ /**
++ * pci_vpd_info_field_size - Extracts the information field length
++ * @lrdt: Pointer to the beginning of an information field header
++ *
++ * Returns the extracted information field length.
++ */
++static inline u8 pci_vpd_info_field_size(const u8 *info_field)
++{
++ return info_field[2];
++}
++
++/**
+ * pci_vpd_find_tag - Locates the Resource Data Type tag provided
+ * @buf: Pointer to buffered vpd data
+ * @off: The offset into the buffer at which to begin the search
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0096-pci-Add-helper-to-search-for-VPD-keywords.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0096-pci-Add-helper-to-search-for-VPD-keywords.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,141 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Fri, 26 Feb 2010 14:04:43 +0000
+Subject: [PATCH 096/207] pci: Add helper to search for VPD keywords
+
+commit 4067a8541d397e9d6b443dd2ce0ecb78bfd991db upstream.
+
+This patch adds the pci_vpd_find_info_keyword() helper function to
+find information field keywords within read-only and read-write large
+resource data type sections.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: Michael Chan <mchan at broadcom.com>
+Acked-by: Jesse Barnes <jbarnes at virtuousgeek.org>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Adjust context; drop inapplicable changes to bnx2]
+---
+ drivers/net/tg3.c | 32 +++++++++++++-------------------
+ drivers/pci/vpd.c | 18 ++++++++++++++++++
+ include/linux/pci.h | 17 +++++++++++++++++
+ 3 files changed, 48 insertions(+), 19 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 2448bcf..2223379 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -12587,39 +12587,33 @@ static void __devinit tg3_read_partno(struct tg3 *tp)
+
+ /* Now parse and find the part number. */
+ for (i = 0; i < TG3_NVM_VPD_LEN - 2; ) {
+- unsigned int block_end;
++ unsigned int block_end, rosize;
+
+ i = pci_vpd_find_tag(vpd_data, i, TG3_NVM_VPD_LEN,
+ PCI_VPD_LRDT_RO_DATA);
+ if (i < 0)
+ break;
+
+- block_end = i + PCI_VPD_LRDT_TAG_SIZE +
+- pci_vpd_lrdt_size(&vpd_data[i]);
+-
++ rosize = pci_vpd_lrdt_size(&vpd_data[i]);
++ block_end = i + PCI_VPD_LRDT_TAG_SIZE + rosize;
+ i += PCI_VPD_LRDT_TAG_SIZE;
+
+ if (block_end > TG3_NVM_VPD_LEN)
+ goto out_not_found;
+
+- while (i < (block_end - 2)) {
+- if (vpd_data[i + 0] == 'P' &&
+- vpd_data[i + 1] == 'N') {
+- int partno_len = pci_vpd_info_field_size(&vpd_data[i]);
++ i = pci_vpd_find_info_keyword(vpd_data, i, rosize,
++ PCI_VPD_RO_KEYWORD_PARTNO);
++ if (i > 0) {
++ u8 len = pci_vpd_info_field_size(&vpd_data[i]);
+
+- i += PCI_VPD_INFO_FLD_HDR_SIZE;
+- if (partno_len > TG3_BPN_SIZE ||
+- (partno_len + i) > TG3_NVM_VPD_LEN)
+- goto out_not_found;
++ i += PCI_VPD_INFO_FLD_HDR_SIZE;
++ if (len > TG3_BPN_SIZE ||
++ (len + i) > TG3_NVM_VPD_LEN)
++ break;
+
+- memcpy(tp->board_part_number,
+- &vpd_data[i], partno_len);
++ memcpy(tp->board_part_number, &vpd_data[i], len);
+
+- /* Success. */
+- return;
+- }
+- i += PCI_VPD_INFO_FLD_HDR_SIZE +
+- pci_vpd_info_field_size(&vpd_data[i]);
++ return;
+ }
+
+ /* Part number not found. */
+diff --git a/drivers/pci/vpd.c b/drivers/pci/vpd.c
+index 6bc55457..a5a5ca1 100644
+--- a/drivers/pci/vpd.c
++++ b/drivers/pci/vpd.c
+@@ -41,3 +41,21 @@ int pci_vpd_find_tag(const u8 *buf, unsigned int off, unsigned int len, u8 rdt)
+ return -ENOENT;
+ }
+ EXPORT_SYMBOL_GPL(pci_vpd_find_tag);
++
++int pci_vpd_find_info_keyword(const u8 *buf, unsigned int off,
++ unsigned int len, const char *kw)
++{
++ int i;
++
++ for (i = off; i + PCI_VPD_INFO_FLD_HDR_SIZE <= off + len;) {
++ if (buf[i + 0] == kw[0] &&
++ buf[i + 1] == kw[1])
++ return i;
++
++ i += PCI_VPD_INFO_FLD_HDR_SIZE +
++ pci_vpd_info_field_size(&buf[i]);
++ }
++
++ return -ENOENT;
++}
++EXPORT_SYMBOL_GPL(pci_vpd_find_info_keyword);
+diff --git a/include/linux/pci.h b/include/linux/pci.h
+index 9dba6a4..9a18b5f 100644
+--- a/include/linux/pci.h
++++ b/include/linux/pci.h
+@@ -1325,6 +1325,10 @@ extern void pci_hp_remove_module_link(struct pci_slot *pci_slot);
+
+ #define PCI_VPD_INFO_FLD_HDR_SIZE 3
+
++#define PCI_VPD_RO_KEYWORD_PARTNO "PN"
++#define PCI_VPD_RO_KEYWORD_MFR_ID "MN"
++#define PCI_VPD_RO_KEYWORD_VENDOR0 "V0"
++
+ /**
+ * pci_vpd_lrdt_size - Extracts the Large Resource Data Type length
+ * @lrdt: Pointer to the beginning of the Large Resource Data Type tag
+@@ -1370,5 +1374,18 @@ static inline u8 pci_vpd_info_field_size(const u8 *info_field)
+ */
+ int pci_vpd_find_tag(const u8 *buf, unsigned int off, unsigned int len, u8 rdt);
+
++/**
++ * pci_vpd_find_info_keyword - Locates an information field keyword in the VPD
++ * @buf: Pointer to buffered vpd data
++ * @off: The offset into the buffer at which to begin the search
++ * @len: The length of the buffer area, relative to off, in which to search
++ * @kw: The keyword to search for
++ *
++ * Returns the index where the information field keyword was found or
++ * -ENOENT otherwise.
++ */
++int pci_vpd_find_info_keyword(const u8 *buf, unsigned int off,
++ unsigned int len, const char *kw);
++
+ #endif /* __KERNEL__ */
+ #endif /* LINUX_PCI_H */
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0097-tg3-Remove-now-useless-VPD-code.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0097-tg3-Remove-now-useless-VPD-code.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,103 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Fri, 26 Feb 2010 14:04:45 +0000
+Subject: [PATCH 097/207] tg3: Remove now useless VPD code
+
+commit 4181b2c8bc29bb756ac1816678104b528377b656 upstream.
+
+Now that the VPD searching code is abstracted away, the outer loop used
+to detect the read-only large resource data type section is useless.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Acked-by: Jesse Barnes <jbarnes at virtuousgeek.org>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 52 +++++++++++++++++++++++-----------------------------
+ 1 files changed, 23 insertions(+), 29 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 2223379..942b780 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -12548,7 +12548,8 @@ skip_phy_reset:
+ static void __devinit tg3_read_partno(struct tg3 *tp)
+ {
+ unsigned char vpd_data[TG3_NVM_VPD_LEN]; /* in little-endian format */
+- int i;
++ unsigned int block_end, rosize, len;
++ int i = 0;
+ u32 magic;
+
+ if ((tp->tg3_flags3 & TG3_FLG3_NO_NVRAM) ||
+@@ -12570,7 +12571,7 @@ static void __devinit tg3_read_partno(struct tg3 *tp)
+ }
+ } else {
+ ssize_t cnt;
+- unsigned int pos = 0, i = 0;
++ unsigned int pos = 0;
+
+ for (; pos < TG3_NVM_VPD_LEN && i < 3; i++, pos += cnt) {
+ cnt = pci_read_vpd(tp->pdev, pos,
+@@ -12585,40 +12586,33 @@ static void __devinit tg3_read_partno(struct tg3 *tp)
+ goto out_not_found;
+ }
+
+- /* Now parse and find the part number. */
+- for (i = 0; i < TG3_NVM_VPD_LEN - 2; ) {
+- unsigned int block_end, rosize;
++ i = pci_vpd_find_tag(vpd_data, 0, TG3_NVM_VPD_LEN,
++ PCI_VPD_LRDT_RO_DATA);
++ if (i < 0)
++ goto out_not_found;
+
+- i = pci_vpd_find_tag(vpd_data, i, TG3_NVM_VPD_LEN,
+- PCI_VPD_LRDT_RO_DATA);
+- if (i < 0)
+- break;
++ rosize = pci_vpd_lrdt_size(&vpd_data[i]);
++ block_end = i + PCI_VPD_LRDT_TAG_SIZE + rosize;
++ i += PCI_VPD_LRDT_TAG_SIZE;
+
+- rosize = pci_vpd_lrdt_size(&vpd_data[i]);
+- block_end = i + PCI_VPD_LRDT_TAG_SIZE + rosize;
+- i += PCI_VPD_LRDT_TAG_SIZE;
++ if (block_end > TG3_NVM_VPD_LEN)
++ goto out_not_found;
+
+- if (block_end > TG3_NVM_VPD_LEN)
+- goto out_not_found;
++ i = pci_vpd_find_info_keyword(vpd_data, i, rosize,
++ PCI_VPD_RO_KEYWORD_PARTNO);
++ if (i < 0)
++ goto out_not_found;
+
+- i = pci_vpd_find_info_keyword(vpd_data, i, rosize,
+- PCI_VPD_RO_KEYWORD_PARTNO);
+- if (i > 0) {
+- u8 len = pci_vpd_info_field_size(&vpd_data[i]);
++ len = pci_vpd_info_field_size(&vpd_data[i]);
+
+- i += PCI_VPD_INFO_FLD_HDR_SIZE;
+- if (len > TG3_BPN_SIZE ||
+- (len + i) > TG3_NVM_VPD_LEN)
+- break;
+-
+- memcpy(tp->board_part_number, &vpd_data[i], len);
++ i += PCI_VPD_INFO_FLD_HDR_SIZE;
++ if (len > TG3_BPN_SIZE ||
++ (len + i) > TG3_NVM_VPD_LEN)
++ goto out_not_found;
+
+- return;
+- }
++ memcpy(tp->board_part_number, &vpd_data[i], len);
+
+- /* Part number not found. */
+- goto out_not_found;
+- }
++ return;
+
+ out_not_found:
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0098-drivers-net-tg3.c-change-the-field-used-with-the-TG3.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0098-drivers-net-tg3.c-change-the-field-used-with-the-TG3.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,32 @@
+From: Julia Lawall <julia at diku.dk>
+Date: Sat, 13 Mar 2010 12:22:16 -0800
+Subject: [PATCH 098/207] drivers/net/tg3.c: change the field used with the
+ TG3_FLAG_10_100_ONLY constant
+
+commit 3f07d1295191cfa41125e4e61ee2064790070071 upstream.
+
+The constant TG3_FLAG_10_100_ONLY should be used with the tg3_flags field,
+not the tg3_flags2 field, as done elsewhere in the same file.
+
+Signed-off-by: Julia Lawall <julia at diku.dk>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 942b780..ecc41cf 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -9777,7 +9777,7 @@ static int tg3_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
+ ADVERTISED_Pause |
+ ADVERTISED_Asym_Pause;
+
+- if (!(tp->tg3_flags2 & TG3_FLAG_10_100_ONLY))
++ if (!(tp->tg3_flags & TG3_FLAG_10_100_ONLY))
+ mask |= ADVERTISED_1000baseT_Half |
+ ADVERTISED_1000baseT_Full;
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0099-tg3-Fix-MII_TG3_DSP_EXP8-offset.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0099-tg3-Fix-MII_TG3_DSP_EXP8-offset.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,32 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 5 Apr 2010 10:19:19 +0000
+Subject: [PATCH 099/207] tg3: Fix MII_TG3_DSP_EXP8 offset
+
+commit c1f614a1214126d7c9f58bf8481070c66b3cc1af upstream.
+
+The offset to the MII_TG3_DSP_EXP8 register is incorrect. Fix it.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.h | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 574a1cc..4836f56 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -2082,7 +2082,7 @@
+ #define MII_TG3_DSP_AADJ1CH0 0x001f
+ #define MII_TG3_DSP_AADJ1CH3 0x601f
+ #define MII_TG3_DSP_AADJ1CH3_ADCCKADJ 0x0002
+-#define MII_TG3_DSP_EXP8 0x0708
++#define MII_TG3_DSP_EXP8 0x0f08
+ #define MII_TG3_DSP_EXP8_REJ2MHz 0x0001
+ #define MII_TG3_DSP_EXP8_AEDW 0x0200
+ #define MII_TG3_DSP_EXP75 0x0f75
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0100-tg3-Restore-likely-check-in-tg3_poll_msix.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0100-tg3-Restore-likely-check-in-tg3_poll_msix.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,35 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 5 Apr 2010 10:19:20 +0000
+Subject: [PATCH 100/207] tg3: Restore likely() check in tg3_poll_msix()
+
+commit 6d40db7beaef823621ff3d340ef53d08445960b4 upstream.
+
+When creating the new tg3_poll_msix() function, the likely() compiler
+hint was dropped. This patch reintroduces it.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index ecc41cf..8ca2648 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -4987,8 +4987,8 @@ static int tg3_poll_msix(struct napi_struct *napi, int budget)
+ rmb();
+
+ /* check for RX/TX work to do */
+- if (sblk->idx[0].tx_consumer == tnapi->tx_cons &&
+- *(tnapi->rx_rcb_prod_idx) == tnapi->rx_rcb_ptr) {
++ if (likely(sblk->idx[0].tx_consumer == tnapi->tx_cons &&
++ *(tnapi->rx_rcb_prod_idx) == tnapi->rx_rcb_ptr)) {
+ napi_complete(napi);
+ /* Reenable interrupts. */
+ tw32_mailbox(tnapi->int_mbox, tnapi->last_tag << 24);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0101-tg3-Replace-pr_err-with-sensible-alternatives.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0101-tg3-Replace-pr_err-with-sensible-alternatives.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,158 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 5 Apr 2010 10:19:21 +0000
+Subject: [PATCH 101/207] tg3: Replace pr_err with sensible alternatives
+
+commit 2445e461ce8c5a2316ed4c8a45cd2d0b6a366310 upstream.
+
+All the instances of pr_err() in the tg3 driver have better
+alternatives. This patch replaces all pr_err() calls.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 46 ++++++++++++++++++++++++++--------------------
+ 1 files changed, 26 insertions(+), 20 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 8ca2648..37f2be8 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -6433,8 +6433,9 @@ static int tg3_stop_block(struct tg3 *tp, unsigned long ofs, u32 enable_bit, int
+ }
+
+ if (i == MAX_WAIT_CNT && !silent) {
+- pr_err("tg3_stop_block timed out, ofs=%lx enable_bit=%x\n",
+- ofs, enable_bit);
++ dev_err(&tp->pdev->dev,
++ "tg3_stop_block timed out, ofs=%lx enable_bit=%x\n",
++ ofs, enable_bit);
+ return -ENODEV;
+ }
+
+@@ -10649,7 +10650,8 @@ static int tg3_test_registers(struct tg3 *tp)
+
+ out:
+ if (netif_msg_hw(tp))
+- pr_err("Register test failed at offset %x\n", offset);
++ netdev_err(tp->dev,
++ "Register test failed at offset %x\n", offset);
+ tw32(offset, save_val);
+ return -EIO;
+ }
+@@ -13224,7 +13226,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ (tp->tg3_flags2 & TG3_FLG2_5780_CLASS)) {
+ tp->pcix_cap = pci_find_capability(tp->pdev, PCI_CAP_ID_PCIX);
+ if (!tp->pcix_cap) {
+- pr_err("Cannot find PCI-X capability, aborting\n");
++ dev_err(&tp->pdev->dev,
++ "Cannot find PCI-X capability, aborting\n");
+ return -EIO;
+ }
+
+@@ -13421,7 +13424,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ /* Force the chip into D0. */
+ err = tg3_set_power_state(tp, PCI_D0);
+ if (err) {
+- pr_err("(%s) transition to D0 failed\n", pci_name(tp->pdev));
++ dev_err(&tp->pdev->dev, "Transition to D0 failed\n");
+ return err;
+ }
+
+@@ -13595,8 +13598,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+
+ err = tg3_phy_probe(tp);
+ if (err) {
+- pr_err("(%s) phy probe failed, err %d\n",
+- pci_name(tp->pdev), err);
++ dev_err(&tp->pdev->dev, "phy probe failed, err %d\n", err);
+ /* ... but do not return immediately ... */
+ tg3_mdio_fini(tp);
+ }
+@@ -14105,8 +14107,9 @@ static int __devinit tg3_test_dma(struct tg3 *tp)
+ /* Send the buffer to the chip. */
+ ret = tg3_do_test_dma(tp, buf, buf_dma, TEST_BUFFER_SIZE, 1);
+ if (ret) {
+- pr_err("tg3_test_dma() Write the buffer failed %d\n",
+- ret);
++ dev_err(&tp->pdev->dev,
++ "%s: Buffer write failed. err = %d\n",
++ __func__, ret);
+ break;
+ }
+
+@@ -14116,8 +14119,9 @@ static int __devinit tg3_test_dma(struct tg3 *tp)
+ u32 val;
+ tg3_read_mem(tp, 0x2100 + (i*4), &val);
+ if (le32_to_cpu(val) != p[i]) {
+- pr_err(" tg3_test_dma() Card buffer corrupted on write! (%d != %d)\n",
+- val, i);
++ dev_err(&tp->pdev->dev,
++ "%s: Buffer corrupted on device! "
++ "(%d != %d)\n", __func__, val, i);
+ /* ret = -ENODEV here? */
+ }
+ p[i] = 0;
+@@ -14126,9 +14130,9 @@ static int __devinit tg3_test_dma(struct tg3 *tp)
+ /* Now read it back. */
+ ret = tg3_do_test_dma(tp, buf, buf_dma, TEST_BUFFER_SIZE, 0);
+ if (ret) {
+- pr_err("tg3_test_dma() Read the buffer failed %d\n",
+- ret);
+-
++ dev_err(&tp->pdev->dev,
++ "%s: Buffer read failed. err = %d\n",
++ __func__, ret);
+ break;
+ }
+
+@@ -14144,8 +14148,9 @@ static int __devinit tg3_test_dma(struct tg3 *tp)
+ tw32(TG3PCI_DMA_RW_CTRL, tp->dma_rwctrl);
+ break;
+ } else {
+- pr_err("tg3_test_dma() buffer corrupted on read back! (%d != %d)\n",
+- p[i], i);
++ dev_err(&tp->pdev->dev,
++ "%s: Buffer corrupted on read back! "
++ "(%d != %d)\n", __func__, p[i], i);
+ ret = -ENODEV;
+ goto out;
+ }
+@@ -14437,13 +14442,13 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
+
+ err = pci_enable_device(pdev);
+ if (err) {
+- pr_err("Cannot enable PCI device, aborting\n");
++ dev_err(&pdev->dev, "Cannot enable PCI device, aborting\n");
+ return err;
+ }
+
+ err = pci_request_regions(pdev, DRV_MODULE_NAME);
+ if (err) {
+- pr_err("Cannot obtain PCI resources, aborting\n");
++ dev_err(&pdev->dev, "Cannot obtain PCI resources, aborting\n");
+ goto err_out_disable_pdev;
+ }
+
+@@ -14452,14 +14457,15 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
+ /* Find power-management capability. */
+ pm_cap = pci_find_capability(pdev, PCI_CAP_ID_PM);
+ if (pm_cap == 0) {
+- pr_err("Cannot find PowerManagement capability, aborting\n");
++ dev_err(&pdev->dev,
++ "Cannot find Power Management capability, aborting\n");
+ err = -EIO;
+ goto err_out_free_res;
+ }
+
+ dev = alloc_etherdev_mq(sizeof(*tp), TG3_IRQ_MAX_VECS);
+ if (!dev) {
+- pr_err("Etherdev alloc failed, aborting\n");
++ dev_err(&pdev->dev, "Etherdev alloc failed, aborting\n");
+ err = -ENOMEM;
+ goto err_out_free_res;
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0102-tg3-netdev_err-dev_err.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0102-tg3-netdev_err-dev_err.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,141 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 5 Apr 2010 10:19:22 +0000
+Subject: [PATCH 102/207] tg3: netdev_err() => dev_err()
+
+commit ab96b241fd82ec8d546684ab6e29b6530976780a upstream.
+
+Some uses of netdev_err() happen before the device has been registered.
+This will cause the messages to be prepended with "(unregistered
+net_device)" strings. We can clean up the message by using dev_err()
+instead.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 32 +++++++++++++++++++-------------
+ 1 files changed, 19 insertions(+), 13 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 37f2be8..d0348b7 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -1098,7 +1098,7 @@ static int tg3_mdio_init(struct tg3 *tp)
+
+ i = mdiobus_register(tp->mdio_bus);
+ if (i) {
+- netdev_warn(tp->dev, "mdiobus_reg failed (0x%x)\n", i);
++ dev_warn(&tp->pdev->dev, "mdiobus_reg failed (0x%x)\n", i);
+ mdiobus_free(tp->mdio_bus);
+ return i;
+ }
+@@ -1106,7 +1106,7 @@ static int tg3_mdio_init(struct tg3 *tp)
+ phydev = tp->mdio_bus->phy_map[TG3_PHY_MII_ADDR];
+
+ if (!phydev || !phydev->drv) {
+- netdev_warn(tp->dev, "No PHY devices\n");
++ dev_warn(&tp->pdev->dev, "No PHY devices\n");
+ mdiobus_unregister(tp->mdio_bus);
+ mdiobus_free(tp->mdio_bus);
+ return -ENODEV;
+@@ -1464,7 +1464,7 @@ static int tg3_phy_init(struct tg3 *tp)
+ phydev = phy_connect(tp->dev, dev_name(&phydev->dev), tg3_adjust_link,
+ phydev->dev_flags, phydev->interface);
+ if (IS_ERR(phydev)) {
+- netdev_err(tp->dev, "Could not attach to PHY\n");
++ dev_err(&tp->pdev->dev, "Could not attach to PHY\n");
+ return PTR_ERR(phydev);
+ }
+
+@@ -6481,8 +6481,9 @@ static int tg3_abort_hw(struct tg3 *tp, int silent)
+ break;
+ }
+ if (i >= MAX_WAIT_CNT) {
+- netdev_err(tp->dev, "%s timed out, TX_MODE_ENABLE will not clear MAC_TX_MODE=%08x\n",
+- __func__, tr32(MAC_TX_MODE));
++ dev_err(&tp->pdev->dev,
++ "%s timed out, TX_MODE_ENABLE will not clear "
++ "MAC_TX_MODE=%08x\n", __func__, tr32(MAC_TX_MODE));
+ err |= -ENODEV;
+ }
+
+@@ -14515,7 +14516,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
+
+ tp->regs = pci_ioremap_bar(pdev, BAR_0);
+ if (!tp->regs) {
+- netdev_err(dev, "Cannot map device registers, aborting\n");
++ dev_err(&pdev->dev, "Cannot map device registers, aborting\n");
+ err = -ENOMEM;
+ goto err_out_free_dev;
+ }
+@@ -14531,7 +14532,8 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
+
+ err = tg3_get_invariants(tp);
+ if (err) {
+- netdev_err(dev, "Problem fetching invariants of chip, aborting\n");
++ dev_err(&pdev->dev,
++ "Problem fetching invariants of chip, aborting\n");
+ goto err_out_iounmap;
+ }
+
+@@ -14566,7 +14568,8 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
+ err = pci_set_consistent_dma_mask(pdev,
+ persist_dma_mask);
+ if (err < 0) {
+- netdev_err(dev, "Unable to obtain 64 bit DMA for consistent allocations\n");
++ dev_err(&pdev->dev, "Unable to obtain 64 bit "
++ "DMA for consistent allocations\n");
+ goto err_out_iounmap;
+ }
+ }
+@@ -14574,7 +14577,8 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
+ if (err || dma_mask == DMA_BIT_MASK(32)) {
+ err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
+ if (err) {
+- netdev_err(dev, "No usable DMA configuration, aborting\n");
++ dev_err(&pdev->dev,
++ "No usable DMA configuration, aborting\n");
+ goto err_out_iounmap;
+ }
+ }
+@@ -14623,14 +14627,16 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
+
+ err = tg3_get_device_address(tp);
+ if (err) {
+- netdev_err(dev, "Could not obtain valid ethernet address, aborting\n");
++ dev_err(&pdev->dev,
++ "Could not obtain valid ethernet address, aborting\n");
+ goto err_out_iounmap;
+ }
+
+ if (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE) {
+ tp->aperegs = pci_ioremap_bar(pdev, BAR_2);
+ if (!tp->aperegs) {
+- netdev_err(dev, "Cannot map APE registers, aborting\n");
++ dev_err(&pdev->dev,
++ "Cannot map APE registers, aborting\n");
+ err = -ENOMEM;
+ goto err_out_iounmap;
+ }
+@@ -14654,7 +14660,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
+
+ err = tg3_test_dma(tp);
+ if (err) {
+- netdev_err(dev, "DMA engine test failed, aborting\n");
++ dev_err(&pdev->dev, "DMA engine test failed, aborting\n");
+ goto err_out_apeunmap;
+ }
+
+@@ -14715,7 +14721,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
+
+ err = register_netdev(dev);
+ if (err) {
+- netdev_err(dev, "Cannot register net device, aborting\n");
++ dev_err(&pdev->dev, "Cannot register net device, aborting\n");
+ goto err_out_apeunmap;
+ }
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0103-tg3-Fix-message-80-char-violations.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0103-tg3-Fix-message-80-char-violations.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,185 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 5 Apr 2010 10:19:23 +0000
+Subject: [PATCH 103/207] tg3: Fix message 80 char violations
+
+commit 5129c3a3faf8c5f4e6dd6ca581e1c4b06f8e837f upstream.
+
+Commit 05dbe005386e7521153dce6c5ad95c98b73b80c7, "Use (pr|netdev)_<level>
+macro helpers" extended some of the message lines longer than 80 chars.
+This patch reels the line lengths back in.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 60 +++++++++++++++++++++++++++++++++-------------------
+ 1 files changed, 38 insertions(+), 22 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index d0348b7..4526a9d 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -4335,8 +4335,11 @@ static void tg3_tx_recover(struct tg3 *tp)
+ BUG_ON((tp->tg3_flags & TG3_FLAG_MBOX_WRITE_REORDER) ||
+ tp->write32_tx_mbox == tg3_write_indirect_mbox);
+
+- netdev_warn(tp->dev, "The system may be re-ordering memory-mapped I/O cycles to the network device, attempting to recover\n"
+- "Please report the problem to the driver maintainer and include system chipset information.\n");
++ netdev_warn(tp->dev,
++ "The system may be re-ordering memory-mapped I/O "
++ "cycles to the network device, attempting to recover. "
++ "Please report the problem to the driver maintainer "
++ "and include system chipset information.\n");
+
+ spin_lock(&tp->lock);
+ tp->tg3_flags |= TG3_FLAG_TX_RECOVERY_PENDING;
+@@ -5260,7 +5263,8 @@ static int tg3_restart_hw(struct tg3 *tp, int reset_phy)
+
+ err = tg3_init_hw(tp, reset_phy);
+ if (err) {
+- netdev_err(tp->dev, "Failed to re-initialize device, aborting\n");
++ netdev_err(tp->dev,
++ "Failed to re-initialize device, aborting\n");
+ tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
+ tg3_full_unlock(tp);
+ del_timer_sync(&tp->timer);
+@@ -5508,7 +5512,8 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb,
+ netif_tx_stop_queue(txq);
+
+ /* This is a hard error, log it. */
+- netdev_err(dev, "BUG! Tx Ring full when queue awake!\n");
++ netdev_err(dev,
++ "BUG! Tx Ring full when queue awake!\n");
+ }
+ return NETDEV_TX_BUSY;
+ }
+@@ -5711,7 +5716,8 @@ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb,
+ netif_tx_stop_queue(txq);
+
+ /* This is a hard error, log it. */
+- netdev_err(dev, "BUG! Tx Ring full when queue awake!\n");
++ netdev_err(dev,
++ "BUG! Tx Ring full when queue awake!\n");
+ }
+ return NETDEV_TX_BUSY;
+ }
+@@ -6058,8 +6064,10 @@ static int tg3_rx_prodring_alloc(struct tg3 *tp,
+ /* Now allocate fresh SKBs for each rx ring. */
+ for (i = 0; i < tp->rx_pending; i++) {
+ if (tg3_alloc_rx_skb(tp, tpr, RXD_OPAQUE_RING_STD, i) < 0) {
+- netdev_warn(tp->dev, "Using a smaller RX standard ring, only %d out of %d buffers were allocated successfully\n",
+- i, tp->rx_pending);
++ netdev_warn(tp->dev,
++ "Using a smaller RX standard ring. Only "
++ "%d out of %d buffers were allocated "
++ "successfully\n", i, tp->rx_pending);
+ if (i == 0)
+ goto initfail;
+ tp->rx_pending = i;
+@@ -6088,8 +6096,10 @@ static int tg3_rx_prodring_alloc(struct tg3 *tp,
+
+ for (i = 0; i < tp->rx_jumbo_pending; i++) {
+ if (tg3_alloc_rx_skb(tp, tpr, RXD_OPAQUE_RING_JUMBO, i) < 0) {
+- netdev_warn(tp->dev, "Using a smaller RX jumbo ring, only %d out of %d buffers were allocated successfully\n",
+- i, tp->rx_jumbo_pending);
++ netdev_warn(tp->dev,
++ "Using a smaller RX jumbo ring. Only %d "
++ "out of %d buffers were allocated "
++ "successfully\n", i, tp->rx_jumbo_pending);
+ if (i == 0)
+ goto initfail;
+ tp->rx_jumbo_pending = i;
+@@ -7158,7 +7168,8 @@ static int tg3_load_firmware_cpu(struct tg3 *tp, u32 cpu_base, u32 cpu_scratch_b
+
+ if (cpu_base == TX_CPU_BASE &&
+ (tp->tg3_flags2 & TG3_FLG2_5705_PLUS)) {
+- netdev_err(tp->dev, "%s: Trying to load TX cpu firmware which is 5705\n",
++ netdev_err(tp->dev,
++ "%s: Trying to load TX cpu firmware which is 5705\n",
+ __func__);
+ return -EINVAL;
+ }
+@@ -7238,7 +7249,8 @@ static int tg3_load_5701_a0_firmware_fix(struct tg3 *tp)
+ udelay(1000);
+ }
+ if (i >= 5) {
+- netdev_err(tp->dev, "tg3_load_firmware fails to set RX CPU PC, is %08x should be %08x\n",
++ netdev_err(tp->dev, "%s fails to set RX CPU PC, is %08x "
++ "should be %08x\n", __func__,
+ tr32(RX_CPU_BASE + CPU_PC), info.fw_base);
+ return -ENODEV;
+ }
+@@ -7302,7 +7314,8 @@ static int tg3_load_tso_firmware(struct tg3 *tp)
+ udelay(1000);
+ }
+ if (i >= 5) {
+- netdev_err(tp->dev, "%s fails to set CPU PC, is %08x should be %08x\n",
++ netdev_err(tp->dev,
++ "%s fails to set CPU PC, is %08x should be %08x\n",
+ __func__, tr32(cpu_base + CPU_PC), info.fw_base);
+ return -ENODEV;
+ }
+@@ -8627,8 +8640,9 @@ static int tg3_test_msi(struct tg3 *tp)
+ return err;
+
+ /* MSI test failed, go back to INTx mode */
+- netdev_warn(tp->dev, "No interrupt was generated using MSI, switching to INTx mode\n"
+- "Please report this failure to the PCI maintainer and include system chipset information\n");
++ netdev_warn(tp->dev, "No interrupt was generated using MSI. Switching "
++ "to INTx mode. Please report this failure to the PCI "
++ "maintainer and include system chipset information\n");
+
+ free_irq(tp->napi[0].irq_vec, &tp->napi[0]);
+
+@@ -8741,7 +8755,8 @@ static void tg3_ints_init(struct tg3 *tp)
+ /* All MSI supporting chips should support tagged
+ * status. Assert that this is the case.
+ */
+- netdev_warn(tp->dev, "MSI without TAGGED? Not using MSI\n");
++ netdev_warn(tp->dev,
++ "MSI without TAGGED_STATUS? Not using MSI\n");
+ goto defcfg;
+ }
+
+@@ -11779,7 +11794,8 @@ static void __devinit tg3_nvram_init(struct tg3 *tp)
+ tp->tg3_flags |= TG3_FLAG_NVRAM;
+
+ if (tg3_nvram_lock(tp)) {
+- netdev_warn(tp->dev, "Cannot get nvram lock, %s failed\n",
++ netdev_warn(tp->dev,
++ "Cannot get nvram lock, %s failed\n",
+ __func__);
+ return;
+ }
+@@ -14131,9 +14147,8 @@ static int __devinit tg3_test_dma(struct tg3 *tp)
+ /* Now read it back. */
+ ret = tg3_do_test_dma(tp, buf, buf_dma, TEST_BUFFER_SIZE, 0);
+ if (ret) {
+- dev_err(&tp->pdev->dev,
+- "%s: Buffer read failed. err = %d\n",
+- __func__, ret);
++ dev_err(&tp->pdev->dev, "%s: Buffer read failed. "
++ "err = %d\n", __func__, ret);
+ break;
+ }
+
+@@ -14734,11 +14749,12 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
+ if (tp->tg3_flags3 & TG3_FLG3_PHY_CONNECTED) {
+ struct phy_device *phydev;
+ phydev = tp->mdio_bus->phy_map[TG3_PHY_MII_ADDR];
+- netdev_info(dev, "attached PHY driver [%s] (mii_bus:phy_addr=%s)\n",
++ netdev_info(dev,
++ "attached PHY driver [%s] (mii_bus:phy_addr=%s)\n",
+ phydev->drv->name, dev_name(&phydev->dev));
+ } else
+- netdev_info(dev, "attached PHY is %s (%s Ethernet) (WireSpeed[%d])\n",
+- tg3_phy_string(tp),
++ netdev_info(dev, "attached PHY is %s (%s Ethernet) "
++ "(WireSpeed[%d])\n", tg3_phy_string(tp),
+ ((tp->tg3_flags & TG3_FLAG_10_100_ONLY) ? "10/100Base-TX" :
+ ((tp->tg3_flags2 & TG3_FLG2_ANY_SERDES) ? "1000Base-SX" :
+ "10/100/1000Base-T")),
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0104-tg3-Prepare-FW-version-code-for-VPD-versioning.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0104-tg3-Prepare-FW-version-code-for-VPD-versioning.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,130 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 5 Apr 2010 10:19:24 +0000
+Subject: [PATCH 104/207] tg3: Prepare FW version code for VPD versioning
+
+commit 75f9936e1150be739a9f6577a9d34de120ea35f1 upstream.
+
+The code that extracts the firmware version from the device's NVRAM
+assumes the firmware version member is a clean slate. The following
+patch will add code to extract the firmware version from the VPD area
+of NVRAM, so this assumption will no longer be true. This patch adjusts
+the versioning code to respect the VPD version if it exists.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: Benjamin Li <benli at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 39 +++++++++++++++++++++++----------------
+ 1 files changed, 23 insertions(+), 16 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 4526a9d..e52dbaa 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -12686,7 +12686,7 @@ static int __devinit tg3_fw_img_is_valid(struct tg3 *tp, u32 offset)
+ static void __devinit tg3_read_bc_ver(struct tg3 *tp)
+ {
+ u32 val, offset, start, ver_offset;
+- int i;
++ int i, dst_off;
+ bool newver = false;
+
+ if (tg3_nvram_read(tp, 0xc, &offset) ||
+@@ -12706,8 +12706,11 @@ static void __devinit tg3_read_bc_ver(struct tg3 *tp)
+ newver = true;
+ }
+
++ dst_off = strlen(tp->fw_ver);
++
+ if (newver) {
+- if (tg3_nvram_read(tp, offset + 8, &ver_offset))
++ if (TG3_VER_SIZE - dst_off < 16 ||
++ tg3_nvram_read(tp, offset + 8, &ver_offset))
+ return;
+
+ offset = offset + ver_offset - start;
+@@ -12716,7 +12719,7 @@ static void __devinit tg3_read_bc_ver(struct tg3 *tp)
+ if (tg3_nvram_read_be32(tp, offset + i, &v))
+ return;
+
+- memcpy(tp->fw_ver + i, &v, sizeof(v));
++ memcpy(tp->fw_ver + dst_off + i, &v, sizeof(v));
+ }
+ } else {
+ u32 major, minor;
+@@ -12727,7 +12730,8 @@ static void __devinit tg3_read_bc_ver(struct tg3 *tp)
+ major = (ver_offset & TG3_NVM_BCVER_MAJMSK) >>
+ TG3_NVM_BCVER_MAJSFT;
+ minor = ver_offset & TG3_NVM_BCVER_MINMSK;
+- snprintf(&tp->fw_ver[0], 32, "v%d.%02d", major, minor);
++ snprintf(&tp->fw_ver[dst_off], TG3_VER_SIZE - dst_off,
++ "v%d.%02d", major, minor);
+ }
+ }
+
+@@ -12751,9 +12755,7 @@ static void __devinit tg3_read_sb_ver(struct tg3 *tp, u32 val)
+ {
+ u32 offset, major, minor, build;
+
+- tp->fw_ver[0] = 's';
+- tp->fw_ver[1] = 'b';
+- tp->fw_ver[2] = '\0';
++ strncat(tp->fw_ver, "sb", TG3_VER_SIZE - strlen(tp->fw_ver) - 1);
+
+ if ((val & TG3_EEPROM_SB_FORMAT_MASK) != TG3_EEPROM_SB_FORMAT_1)
+ return;
+@@ -12790,11 +12792,14 @@ static void __devinit tg3_read_sb_ver(struct tg3 *tp, u32 val)
+ if (minor > 99 || build > 26)
+ return;
+
+- snprintf(&tp->fw_ver[2], 30, " v%d.%02d", major, minor);
++ offset = strlen(tp->fw_ver);
++ snprintf(&tp->fw_ver[offset], TG3_VER_SIZE - offset,
++ " v%d.%02d", major, minor);
+
+ if (build > 0) {
+- tp->fw_ver[8] = 'a' + build - 1;
+- tp->fw_ver[9] = '\0';
++ offset = strlen(tp->fw_ver);
++ if (offset < TG3_VER_SIZE - 1)
++ tp->fw_ver[offset] = 'a' + build - 1;
+ }
+ }
+
+@@ -12881,12 +12886,13 @@ static void __devinit tg3_read_dash_ver(struct tg3 *tp)
+ static void __devinit tg3_read_fw_ver(struct tg3 *tp)
+ {
+ u32 val;
++ bool vpd_vers = false;
+
+- if (tp->tg3_flags3 & TG3_FLG3_NO_NVRAM) {
+- tp->fw_ver[0] = 's';
+- tp->fw_ver[1] = 'b';
+- tp->fw_ver[2] = '\0';
++ if (tp->fw_ver[0] != 0)
++ vpd_vers = true;
+
++ if (tp->tg3_flags3 & TG3_FLG3_NO_NVRAM) {
++ strcat(tp->fw_ver, "sb");
+ return;
+ }
+
+@@ -12903,11 +12909,12 @@ static void __devinit tg3_read_fw_ver(struct tg3 *tp)
+ return;
+
+ if (!(tp->tg3_flags & TG3_FLAG_ENABLE_ASF) ||
+- (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE))
+- return;
++ (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE) || vpd_vers)
++ goto done;
+
+ tg3_read_mgmtfw_ver(tp);
+
++done:
+ tp->fw_ver[TG3_VER_SIZE - 1] = 0;
+ }
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0105-tg3-Use-VPD-fw-version-when-present.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0105-tg3-Use-VPD-fw-version-when-present.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,82 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 5 Apr 2010 10:19:25 +0000
+Subject: [PATCH 105/207] tg3: Use VPD fw version when present
+
+commit 184b89044fb6e2a74611dafa69b1dce0d98612c6 upstream.
+
+This patch extracts the firmware version from the VPD area and changes
+the code to prefer that version version over the manually extracted
+version.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 34 ++++++++++++++++++++++++++++++----
+ 1 files changed, 30 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index e52dbaa..317302c 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -12564,11 +12564,11 @@ skip_phy_reset:
+ return err;
+ }
+
+-static void __devinit tg3_read_partno(struct tg3 *tp)
++static void __devinit tg3_read_vpd(struct tg3 *tp)
+ {
+- unsigned char vpd_data[TG3_NVM_VPD_LEN]; /* in little-endian format */
++ u8 vpd_data[TG3_NVM_VPD_LEN];
+ unsigned int block_end, rosize, len;
+- int i = 0;
++ int j, i = 0;
+ u32 magic;
+
+ if ((tp->tg3_flags3 & TG3_FLG3_NO_NVRAM) ||
+@@ -12617,6 +12617,32 @@ static void __devinit tg3_read_partno(struct tg3 *tp)
+ if (block_end > TG3_NVM_VPD_LEN)
+ goto out_not_found;
+
++ j = pci_vpd_find_info_keyword(vpd_data, i, rosize,
++ PCI_VPD_RO_KEYWORD_MFR_ID);
++ if (j > 0) {
++ len = pci_vpd_info_field_size(&vpd_data[j]);
++
++ j += PCI_VPD_INFO_FLD_HDR_SIZE;
++ if (j + len > block_end || len != 4 ||
++ memcmp(&vpd_data[j], "1028", 4))
++ goto partno;
++
++ j = pci_vpd_find_info_keyword(vpd_data, i, rosize,
++ PCI_VPD_RO_KEYWORD_VENDOR0);
++ if (j < 0)
++ goto partno;
++
++ len = pci_vpd_info_field_size(&vpd_data[j]);
++
++ j += PCI_VPD_INFO_FLD_HDR_SIZE;
++ if (j + len > block_end)
++ goto partno;
++
++ memcpy(tp->fw_ver, &vpd_data[j], len);
++ strncat(tp->fw_ver, " bc ", TG3_NVM_VPD_LEN - len - 1);
++ }
++
++partno:
+ i = pci_vpd_find_info_keyword(vpd_data, i, rosize,
+ PCI_VPD_RO_KEYWORD_PARTNO);
+ if (i < 0)
+@@ -13627,7 +13653,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ tg3_mdio_fini(tp);
+ }
+
+- tg3_read_partno(tp);
++ tg3_read_vpd(tp);
+ tg3_read_fw_ver(tp);
+
+ if (tp->tg3_flags2 & TG3_FLG2_PHY_SERDES) {
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0106-tg3-Whitespace-constant-and-comment-updates.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0106-tg3-Whitespace-constant-and-comment-updates.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,307 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 5 Apr 2010 10:19:26 +0000
+Subject: [PATCH 106/207] tg3: Whitespace, constant, and comment updates
+
+commit c6cdf43631c4108b38b872136c926691e987880f upstream.
+
+This patch fixes whitespace errors, preprocessor definition placement
+oddities and updates comments.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 72 +++++++++++++++++++++++++++-------------------------
+ drivers/net/tg3.h | 6 ++--
+ 2 files changed, 40 insertions(+), 38 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 317302c..2cd5c88 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -101,7 +101,7 @@
+ #define TG3_DEF_RX_RING_PENDING 200
+ #define TG3_RX_JUMBO_RING_SIZE 256
+ #define TG3_DEF_RX_JUMBO_RING_PENDING 100
+-#define TG3_RSS_INDIR_TBL_SIZE 128
++#define TG3_RSS_INDIR_TBL_SIZE 128
+
+ /* Do not place this n-ring entries value into the tp struct itself,
+ * we really want to expose these constants to GCC so that modulo et
+@@ -142,6 +142,8 @@
+ #define TG3_RX_JMB_BUFF_RING_SIZE \
+ (sizeof(struct ring_info) * TG3_RX_JUMBO_RING_SIZE)
+
++#define TG3_RSS_MIN_NUM_MSIX_VECS 2
++
+ /* minimum number of free TX descriptors required to wake up TX process */
+ #define TG3_TX_WAKEUP_THRESH(tnapi) ((tnapi)->tx_pending / 4)
+
+@@ -152,6 +154,8 @@
+
+ #define TG3_NUM_TEST 6
+
++#define TG3_FW_UPDATE_TIMEOUT_SEC 5
++
+ #define FIRMWARE_TG3 "tigon/tg3.bin"
+ #define FIRMWARE_TG3TSO "tigon/tg3_tso.bin"
+ #define FIRMWARE_TG3TSO5 "tigon/tg3_tso5.bin"
+@@ -167,8 +171,6 @@ MODULE_FIRMWARE(FIRMWARE_TG3);
+ MODULE_FIRMWARE(FIRMWARE_TG3TSO);
+ MODULE_FIRMWARE(FIRMWARE_TG3TSO5);
+
+-#define TG3_RSS_MIN_NUM_MSIX_VECS 2
+-
+ static int tg3_debug = -1; /* -1 == use TG3_DEF_MSG_ENABLE as value */
+ module_param(tg3_debug, int, 0);
+ MODULE_PARM_DESC(tg3_debug, "Tigon3 bitmapped debugging message enable value");
+@@ -496,16 +498,16 @@ static void tg3_write32_mbox_5906(struct tg3 *tp, u32 off, u32 val)
+ writel(val, tp->regs + off + GRCMBOX_BASE);
+ }
+
+-#define tw32_mailbox(reg, val) tp->write32_mbox(tp, reg, val)
++#define tw32_mailbox(reg, val) tp->write32_mbox(tp, reg, val)
+ #define tw32_mailbox_f(reg, val) tw32_mailbox_flush(tp, (reg), (val))
+-#define tw32_rx_mbox(reg, val) tp->write32_rx_mbox(tp, reg, val)
+-#define tw32_tx_mbox(reg, val) tp->write32_tx_mbox(tp, reg, val)
+-#define tr32_mailbox(reg) tp->read32_mbox(tp, reg)
++#define tw32_rx_mbox(reg, val) tp->write32_rx_mbox(tp, reg, val)
++#define tw32_tx_mbox(reg, val) tp->write32_tx_mbox(tp, reg, val)
++#define tr32_mailbox(reg) tp->read32_mbox(tp, reg)
+
+-#define tw32(reg,val) tp->write32(tp, reg, val)
+-#define tw32_f(reg,val) _tw32_flush(tp,(reg),(val), 0)
+-#define tw32_wait_f(reg,val,us) _tw32_flush(tp,(reg),(val), (us))
+-#define tr32(reg) tp->read32(tp, reg)
++#define tw32(reg, val) tp->write32(tp, reg, val)
++#define tw32_f(reg, val) _tw32_flush(tp, (reg), (val), 0)
++#define tw32_wait_f(reg, val, us) _tw32_flush(tp, (reg), (val), (us))
++#define tr32(reg) tp->read32(tp, reg)
+
+ static void tg3_write_mem(struct tg3 *tp, u32 off, u32 val)
+ {
+@@ -651,6 +653,7 @@ static void tg3_enable_ints(struct tg3 *tp)
+ tp->coal_now = tp->coalesce_mode | HOSTCC_MODE_ENABLE;
+ for (i = 0; i < tp->irq_cnt; i++) {
+ struct tg3_napi *tnapi = &tp->napi[i];
++
+ tw32_mailbox_f(tnapi->int_mbox, tnapi->last_tag << 24);
+ if (tp->tg3_flags2 & TG3_FLG2_1SHOT_MSI)
+ tw32_mailbox_f(tnapi->int_mbox, tnapi->last_tag << 24);
+@@ -1437,7 +1440,7 @@ static void tg3_adjust_link(struct net_device *dev)
+ phydev->speed != tp->link_config.active_speed ||
+ phydev->duplex != tp->link_config.active_duplex ||
+ oldflowctrl != tp->link_config.active_flowctrl)
+- linkmesg = 1;
++ linkmesg = 1;
+
+ tp->link_config.active_speed = phydev->speed;
+ tp->link_config.active_duplex = phydev->duplex;
+@@ -2007,8 +2010,8 @@ out:
+ u32 phy_reg;
+
+ if (!tg3_readphy(tp, MII_TG3_EXT_CTRL, &phy_reg))
+- tg3_writephy(tp, MII_TG3_EXT_CTRL,
+- phy_reg | MII_TG3_EXT_CTRL_FIFO_ELASTIC);
++ tg3_writephy(tp, MII_TG3_EXT_CTRL,
++ phy_reg | MII_TG3_EXT_CTRL_FIFO_ELASTIC);
+ }
+
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) {
+@@ -4211,6 +4214,7 @@ static void tg3_serdes_parallel_detect(struct tg3 *tp)
+ tp->serdes_counter--;
+ return;
+ }
++
+ if (!netif_carrier_ok(tp->dev) &&
+ (tp->link_config.autoneg == AUTONEG_ENABLE)) {
+ u32 bmcr;
+@@ -4519,8 +4523,8 @@ static void tg3_recycle_rx(struct tg3_napi *tnapi,
+ struct tg3 *tp = tnapi->tp;
+ struct tg3_rx_buffer_desc *src_desc, *dest_desc;
+ struct ring_info *src_map, *dest_map;
+- int dest_idx;
+ struct tg3_rx_prodring_set *spr = &tp->prodring[0];
++ int dest_idx;
+
+ switch (opaque_key) {
+ case RXD_OPAQUE_RING_STD:
+@@ -4981,7 +4985,7 @@ static int tg3_poll_msix(struct napi_struct *napi, int budget)
+ if (unlikely(work_done >= budget))
+ break;
+
+- /* tp->last_tag is used in tg3_restart_ints() below
++ /* tp->last_tag is used in tg3_int_reenable() below
+ * to tell the hw how much work has been processed,
+ * so we must read it before checking for more work.
+ */
+@@ -5496,7 +5500,6 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb,
+ struct netdev_queue *txq;
+ unsigned int i, last;
+
+-
+ txq = netdev_get_tx_queue(dev, skb_get_queue_mapping(skb));
+ tnapi = &tp->napi[skb_get_queue_mapping(skb)];
+ if (tp->tg3_flags3 & TG3_FLG3_ENABLE_TSS)
+@@ -5700,7 +5703,6 @@ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb,
+ struct netdev_queue *txq;
+ unsigned int i, last;
+
+-
+ txq = netdev_get_tx_queue(dev, skb_get_queue_mapping(skb));
+ tnapi = &tp->napi[skb_get_queue_mapping(skb)];
+ if (tp->tg3_flags3 & TG3_FLG3_ENABLE_TSS)
+@@ -6013,7 +6015,7 @@ static void tg3_rx_prodring_free(struct tg3 *tp,
+ }
+ }
+
+-/* Initialize tx/rx rings for packet processing.
++/* Initialize rx rings for packet processing.
+ *
+ * The chip has been shut down and the driver detached from
+ * the networking, so no interrupts or new tx packets will
+@@ -8491,8 +8493,8 @@ static void tg3_timer(unsigned long __opaque)
+ tg3_write_mem(tp, NIC_SRAM_FW_CMD_MBOX,
+ FWCMD_NICDRV_ALIVE3);
+ tg3_write_mem(tp, NIC_SRAM_FW_CMD_LEN_MBOX, 4);
+- /* 5 seconds timeout */
+- tg3_write_mem(tp, NIC_SRAM_FW_CMD_DATA_MBOX, 5);
++ tg3_write_mem(tp, NIC_SRAM_FW_CMD_DATA_MBOX,
++ TG3_FW_UPDATE_TIMEOUT_SEC);
+
+ tg3_generate_fw_event(tp);
+ }
+@@ -9635,7 +9637,7 @@ static int tg3_get_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
+ memcpy(data, ((char*)&val) + b_offset, b_count);
+ len -= b_count;
+ offset += b_count;
+- eeprom->len += b_count;
++ eeprom->len += b_count;
+ }
+
+ /* read bytes upto the last 4 byte boundary */
+@@ -10183,8 +10185,8 @@ static int tg3_set_rx_csum(struct net_device *dev, u32 data)
+ if (tp->tg3_flags & TG3_FLAG_BROKEN_CHECKSUMS) {
+ if (data != 0)
+ return -EINVAL;
+- return 0;
+- }
++ return 0;
++ }
+
+ spin_lock_bh(&tp->lock);
+ if (data)
+@@ -10203,8 +10205,8 @@ static int tg3_set_tx_csum(struct net_device *dev, u32 data)
+ if (tp->tg3_flags & TG3_FLAG_BROKEN_CHECKSUMS) {
+ if (data != 0)
+ return -EINVAL;
+- return 0;
+- }
++ return 0;
++ }
+
+ if (tp->tg3_flags3 & TG3_FLG3_5755_PLUS)
+ ethtool_op_set_tx_ipv6_csum(dev, data);
+@@ -10478,7 +10480,7 @@ static int tg3_test_registers(struct tg3 *tp)
+ { MAC_ADDR_0_HIGH, 0x0000,
+ 0x00000000, 0x0000ffff },
+ { MAC_ADDR_0_LOW, 0x0000,
+- 0x00000000, 0xffffffff },
++ 0x00000000, 0xffffffff },
+ { MAC_RX_MTU_SIZE, 0x0000,
+ 0x00000000, 0x0000ffff },
+ { MAC_TX_MODE, 0x0000,
+@@ -11914,7 +11916,7 @@ static int tg3_nvram_write_block_unbuffered(struct tg3 *tp, u32 offset, u32 len,
+ if (ret)
+ break;
+
+- page_off = offset & pagemask;
++ page_off = offset & pagemask;
+ size = pagesize;
+ if (len < size)
+ size = len;
+@@ -11942,7 +11944,7 @@ static int tg3_nvram_write_block_unbuffered(struct tg3 *tp, u32 offset, u32 len,
+ nvram_cmd = NVRAM_CMD_GO | NVRAM_CMD_DONE | NVRAM_CMD_WR |
+ NVRAM_CMD_FIRST | NVRAM_CMD_LAST | NVRAM_CMD_ERASE;
+
+- if (tg3_nvram_exec_cmd(tp, nvram_cmd))
++ if (tg3_nvram_exec_cmd(tp, nvram_cmd))
+ break;
+
+ /* Issue another write enable to start the write. */
+@@ -11996,7 +11998,7 @@ static int tg3_nvram_write_block_buffered(struct tg3 *tp, u32 offset, u32 len,
+ memcpy(&data, buf + i, 4);
+ tw32(NVRAM_WRDATA, be32_to_cpu(data));
+
+- page_off = offset % tp->nvram_pagesize;
++ page_off = offset % tp->nvram_pagesize;
+
+ phy_addr = tg3_nvram_phys_addr(tp, offset);
+
+@@ -12004,7 +12006,7 @@ static int tg3_nvram_write_block_buffered(struct tg3 *tp, u32 offset, u32 len,
+
+ nvram_cmd = NVRAM_CMD_GO | NVRAM_CMD_DONE | NVRAM_CMD_WR;
+
+- if ((page_off == 0) || (i == 0))
++ if (page_off == 0 || i == 0)
+ nvram_cmd |= NVRAM_CMD_FIRST;
+ if (page_off == (tp->nvram_pagesize - 4))
+ nvram_cmd |= NVRAM_CMD_LAST;
+@@ -12950,9 +12952,9 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ {
+ static struct pci_device_id write_reorder_chipsets[] = {
+ { PCI_DEVICE(PCI_VENDOR_ID_AMD,
+- PCI_DEVICE_ID_AMD_FE_GATE_700C) },
++ PCI_DEVICE_ID_AMD_FE_GATE_700C) },
+ { PCI_DEVICE(PCI_VENDOR_ID_AMD,
+- PCI_DEVICE_ID_AMD_8131_BRIDGE) },
++ PCI_DEVICE_ID_AMD_8131_BRIDGE) },
+ { PCI_DEVICE(PCI_VENDOR_ID_VIA,
+ PCI_DEVICE_ID_VIA_8385_0) },
+ { },
+@@ -13241,8 +13243,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ tp->tg3_flags3 |= TG3_FLG3_USE_JUMBO_BDFLAG;
+
+ if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS) ||
+- (tp->tg3_flags2 & TG3_FLG2_5780_CLASS) ||
+- (tp->tg3_flags3 & TG3_FLG3_USE_JUMBO_BDFLAG))
++ (tp->tg3_flags2 & TG3_FLG2_5780_CLASS) ||
++ (tp->tg3_flags3 & TG3_FLG3_USE_JUMBO_BDFLAG))
+ tp->tg3_flags |= TG3_FLAG_JUMBO_CAPABLE;
+
+ pci_read_config_dword(tp->pdev, TG3PCI_PCISTATE,
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 4836f56..5d7f72a 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -23,7 +23,7 @@
+ #define TG3_BDINFO_NIC_ADDR 0xcUL /* 32-bit */
+ #define TG3_BDINFO_SIZE 0x10UL
+
+-#define RX_COPY_THRESHOLD 256
++#define RX_COPY_THRESHOLD 256
+
+ #define TG3_RX_INTERNAL_RING_SZ_5906 32
+
+@@ -252,7 +252,7 @@
+ /* 0x94 --> 0x98 unused */
+ #define TG3PCI_STD_RING_PROD_IDX 0x00000098 /* 64-bit */
+ #define TG3PCI_RCV_RET_RING_CON_IDX 0x000000a0 /* 64-bit */
+-/* 0xa0 --> 0xb8 unused */
++/* 0xa8 --> 0xb8 unused */
+ #define TG3PCI_DUAL_MAC_CTRL 0x000000b8
+ #define DUAL_MAC_CTRL_CH_MASK 0x00000003
+ #define DUAL_MAC_CTRL_ID 0x00000004
+@@ -2561,7 +2561,7 @@ struct tg3_bufmgr_config {
+
+ struct tg3_ethtool_stats {
+ /* Statistics maintained by Receive MAC. */
+- u64 rx_octets;
++ u64 rx_octets;
+ u64 rx_fragments;
+ u64 rx_ucast_packets;
+ u64 rx_mcast_packets;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0107-tg3-The-case-of-switches.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0107-tg3-The-case-of-switches.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,139 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 5 Apr 2010 10:19:27 +0000
+Subject: [PATCH 107/207] tg3: The case of switches
+
+commit 33f401aec709e4fea414e5a4cf81b96462bc224f upstream.
+
+This patch fixes checkpatch errors related to switch statements.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 80 ++++++++++++++++++++++++++--------------------------
+ 1 files changed, 40 insertions(+), 40 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 2cd5c88..15a207b 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -581,11 +581,11 @@ static int tg3_ape_lock(struct tg3 *tp, int locknum)
+ return 0;
+
+ switch (locknum) {
+- case TG3_APE_LOCK_GRC:
+- case TG3_APE_LOCK_MEM:
+- break;
+- default:
+- return -EINVAL;
++ case TG3_APE_LOCK_GRC:
++ case TG3_APE_LOCK_MEM:
++ break;
++ default:
++ return -EINVAL;
+ }
+
+ off = 4 * locknum;
+@@ -619,11 +619,11 @@ static void tg3_ape_unlock(struct tg3 *tp, int locknum)
+ return;
+
+ switch (locknum) {
+- case TG3_APE_LOCK_GRC:
+- case TG3_APE_LOCK_MEM:
+- break;
+- default:
+- return;
++ case TG3_APE_LOCK_GRC:
++ case TG3_APE_LOCK_MEM:
++ break;
++ default:
++ return;
+ }
+
+ off = 4 * locknum;
+@@ -3428,7 +3428,7 @@ static int tg3_fiber_aneg_smachine(struct tg3 *tp,
+ ap->rxconfig = rx_cfg_reg;
+ ret = ANEG_OK;
+
+- switch(ap->state) {
++ switch (ap->state) {
+ case ANEG_STATE_UNKNOWN:
+ if (ap->flags & (MR_AN_ENABLE | MR_RESTART_AN))
+ ap->state = ANEG_STATE_AN_ENABLE;
+@@ -6565,35 +6565,35 @@ static void tg3_ape_driver_state_change(struct tg3 *tp, int kind)
+ return;
+
+ switch (kind) {
+- case RESET_KIND_INIT:
+- tg3_ape_write32(tp, TG3_APE_HOST_SEG_SIG,
+- APE_HOST_SEG_SIG_MAGIC);
+- tg3_ape_write32(tp, TG3_APE_HOST_SEG_LEN,
+- APE_HOST_SEG_LEN_MAGIC);
+- apedata = tg3_ape_read32(tp, TG3_APE_HOST_INIT_COUNT);
+- tg3_ape_write32(tp, TG3_APE_HOST_INIT_COUNT, ++apedata);
+- tg3_ape_write32(tp, TG3_APE_HOST_DRIVER_ID,
+- APE_HOST_DRIVER_ID_MAGIC);
+- tg3_ape_write32(tp, TG3_APE_HOST_BEHAVIOR,
+- APE_HOST_BEHAV_NO_PHYLOCK);
+-
+- event = APE_EVENT_STATUS_STATE_START;
+- break;
+- case RESET_KIND_SHUTDOWN:
+- /* With the interface we are currently using,
+- * APE does not track driver state. Wiping
+- * out the HOST SEGMENT SIGNATURE forces
+- * the APE to assume OS absent status.
+- */
+- tg3_ape_write32(tp, TG3_APE_HOST_SEG_SIG, 0x0);
++ case RESET_KIND_INIT:
++ tg3_ape_write32(tp, TG3_APE_HOST_SEG_SIG,
++ APE_HOST_SEG_SIG_MAGIC);
++ tg3_ape_write32(tp, TG3_APE_HOST_SEG_LEN,
++ APE_HOST_SEG_LEN_MAGIC);
++ apedata = tg3_ape_read32(tp, TG3_APE_HOST_INIT_COUNT);
++ tg3_ape_write32(tp, TG3_APE_HOST_INIT_COUNT, ++apedata);
++ tg3_ape_write32(tp, TG3_APE_HOST_DRIVER_ID,
++ APE_HOST_DRIVER_ID_MAGIC);
++ tg3_ape_write32(tp, TG3_APE_HOST_BEHAVIOR,
++ APE_HOST_BEHAV_NO_PHYLOCK);
++
++ event = APE_EVENT_STATUS_STATE_START;
++ break;
++ case RESET_KIND_SHUTDOWN:
++ /* With the interface we are currently using,
++ * APE does not track driver state. Wiping
++ * out the HOST SEGMENT SIGNATURE forces
++ * the APE to assume OS absent status.
++ */
++ tg3_ape_write32(tp, TG3_APE_HOST_SEG_SIG, 0x0);
+
+- event = APE_EVENT_STATUS_STATE_UNLOAD;
+- break;
+- case RESET_KIND_SUSPEND:
+- event = APE_EVENT_STATUS_STATE_SUSPEND;
+- break;
+- default:
+- return;
++ event = APE_EVENT_STATUS_STATE_UNLOAD;
++ break;
++ case RESET_KIND_SUSPEND:
++ event = APE_EVENT_STATUS_STATE_SUSPEND;
++ break;
++ default:
++ return;
+ }
+
+ event |= APE_EVENT_STATUS_DRIVER_EVNT | APE_EVENT_STATUS_STATE_CHNGE;
+@@ -11103,7 +11103,7 @@ static int tg3_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
+ return phy_mii_ioctl(phydev, data, cmd);
+ }
+
+- switch(cmd) {
++ switch (cmd) {
+ case SIOCGMIIPHY:
+ data->phy_id = tp->phy_addr;
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0108-tg3-Cleanup-if-codestyle.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0108-tg3-Cleanup-if-codestyle.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,247 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 5 Apr 2010 10:19:28 +0000
+Subject: [PATCH 108/207] tg3: Cleanup if codestyle
+
+commit 859a58879d7c771e78a373028d719467a2f8feb7 upstream.
+
+This patch cleans up the code style as it pertains to if statements.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: Michael Chan <mchan at broadcom.com>
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 75 ++++++++++++++++++++++-------------------------------
+ 1 files changed, 31 insertions(+), 44 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 15a207b..410622f 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -1858,8 +1858,7 @@ static int tg3_phy_reset_5703_4_5(struct tg3 *tp)
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) {
+ /* Set Extended packet length bit for jumbo frames */
+ tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x4400);
+- }
+- else {
++ } else {
+ tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x0400);
+ }
+
+@@ -1977,8 +1976,7 @@ out:
+ tg3_writephy(tp, MII_TG3_DSP_ADDRESS, 0x401f);
+ tg3_writephy(tp, MII_TG3_DSP_RW_PORT, 0x14e2);
+ tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x0400);
+- }
+- else if (tp->tg3_flags2 & TG3_FLG2_PHY_JITTER_BUG) {
++ } else if (tp->tg3_flags2 & TG3_FLG2_PHY_JITTER_BUG) {
+ tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x0c00);
+ tg3_writephy(tp, MII_TG3_DSP_ADDRESS, 0x000a);
+ if (tp->tg3_flags2 & TG3_FLG2_PHY_ADJUST_TRIM) {
+@@ -3466,11 +3464,10 @@ static int tg3_fiber_aneg_smachine(struct tg3 *tp,
+ /* fallthru */
+ case ANEG_STATE_RESTART:
+ delta = ap->cur_time - ap->link_time;
+- if (delta > ANEG_STATE_SETTLE_TIME) {
++ if (delta > ANEG_STATE_SETTLE_TIME)
+ ap->state = ANEG_STATE_ABILITY_DETECT_INIT;
+- } else {
++ else
+ ret = ANEG_TIMER_ENAB;
+- }
+ break;
+
+ case ANEG_STATE_DISABLE_LINK_OK:
+@@ -3494,9 +3491,8 @@ static int tg3_fiber_aneg_smachine(struct tg3 *tp,
+ break;
+
+ case ANEG_STATE_ABILITY_DETECT:
+- if (ap->ability_match != 0 && ap->rxconfig != 0) {
++ if (ap->ability_match != 0 && ap->rxconfig != 0)
+ ap->state = ANEG_STATE_ACK_DETECT_INIT;
+- }
+ break;
+
+ case ANEG_STATE_ACK_DETECT_INIT:
+@@ -4174,9 +4170,9 @@ static int tg3_setup_fiber_mii_phy(struct tg3 *tp, int force_reset)
+ current_duplex = DUPLEX_FULL;
+ else
+ current_duplex = DUPLEX_HALF;
+- }
+- else
++ } else {
+ current_link_up = 0;
++ }
+ }
+ }
+
+@@ -4244,10 +4240,9 @@ static void tg3_serdes_parallel_detect(struct tg3 *tp)
+ tp->tg3_flags2 |= TG3_FLG2_PARALLEL_DETECT;
+ }
+ }
+- }
+- else if (netif_carrier_ok(tp->dev) &&
+- (tp->link_config.autoneg == AUTONEG_ENABLE) &&
+- (tp->tg3_flags2 & TG3_FLG2_PARALLEL_DETECT)) {
++ } else if (netif_carrier_ok(tp->dev) &&
++ (tp->link_config.autoneg == AUTONEG_ENABLE) &&
++ (tp->tg3_flags2 & TG3_FLG2_PARALLEL_DETECT)) {
+ u32 phy2;
+
+ /* Select expansion interrupt status register */
+@@ -4270,13 +4265,12 @@ static int tg3_setup_phy(struct tg3 *tp, int force_reset)
+ {
+ int err;
+
+- if (tp->tg3_flags2 & TG3_FLG2_PHY_SERDES) {
++ if (tp->tg3_flags2 & TG3_FLG2_PHY_SERDES)
+ err = tg3_setup_fiber_phy(tp, force_reset);
+- } else if (tp->tg3_flags2 & TG3_FLG2_MII_SERDES) {
++ else if (tp->tg3_flags2 & TG3_FLG2_MII_SERDES)
+ err = tg3_setup_fiber_mii_phy(tp, force_reset);
+- } else {
++ else
+ err = tg3_setup_copper_phy(tp, force_reset);
+- }
+
+ if (GET_CHIP_REV(tp->pci_chip_rev_id) == CHIPREV_5784_AX) {
+ u32 val, scale;
+@@ -5560,9 +5554,10 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb,
+
+ tcp_hdr(skb)->check = 0;
+
+- }
+- else if (skb->ip_summed == CHECKSUM_PARTIAL)
++ } else if (skb->ip_summed == CHECKSUM_PARTIAL) {
+ base_flags |= TXD_FLAG_TCPUDP_CSUM;
++ }
++
+ #if TG3_VLAN_TAG_USED
+ if (tp->vlgrp != NULL && vlan_tx_tag_present(skb))
+ base_flags |= (TXD_FLAG_VLAN |
+@@ -5932,9 +5927,9 @@ static inline void tg3_set_mtu(struct net_device *dev, struct tg3 *tp,
+ if (tp->tg3_flags2 & TG3_FLG2_5780_CLASS) {
+ tp->tg3_flags2 &= ~TG3_FLG2_TSO_CAPABLE;
+ ethtool_op_set_tso(dev, 0);
+- }
+- else
++ } else {
+ tp->tg3_flags |= TG3_FLAG_JUMBO_RING_ENABLE;
++ }
+ } else {
+ if (tp->tg3_flags2 & TG3_FLG2_5780_CLASS)
+ tp->tg3_flags2 |= TG3_FLG2_TSO_CAPABLE;
+@@ -7585,9 +7580,8 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+
+ tg3_write_sig_pre_reset(tp, RESET_KIND_INIT);
+
+- if (tp->tg3_flags & TG3_FLAG_INIT_COMPLETE) {
++ if (tp->tg3_flags & TG3_FLAG_INIT_COMPLETE)
+ tg3_abort_hw(tp, 1);
+- }
+
+ if (reset_phy)
+ tg3_phy_reset(tp);
+@@ -7740,8 +7734,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ tw32(BUFMGR_MB_POOL_SIZE, NIC_SRAM_MBUF_POOL_SIZE96);
+ tw32(BUFMGR_DMA_DESC_POOL_ADDR, NIC_SRAM_DMA_DESC_POOL_BASE);
+ tw32(BUFMGR_DMA_DESC_POOL_SIZE, NIC_SRAM_DMA_DESC_POOL_SIZE);
+- }
+- else if (tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE) {
++ } else if (tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE) {
+ int fw_len;
+
+ fw_len = tp->fw_len;
+@@ -9425,9 +9418,8 @@ static inline u32 calc_crc(unsigned char *buf, int len)
+
+ reg >>= 1;
+
+- if (tmp) {
++ if (tmp)
+ reg ^= 0xedb88320;
+- }
+ }
+ }
+
+@@ -10381,8 +10373,7 @@ static int tg3_test_nvram(struct tg3 *tp)
+ for (l = 0, msk = 0x80; l < 7; l++, msk >>= 1)
+ parity[k++] = buf8[i] & msk;
+ i++;
+- }
+- else if (i == 16) {
++ } else if (i == 16) {
+ int l;
+ u8 msk;
+
+@@ -10845,9 +10836,9 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode)
+ MII_TG3_EXT_CTRL_LNK3_LED_MODE);
+ }
+ tw32(MAC_MODE, mac_mode);
+- }
+- else
++ } else {
+ return -EINVAL;
++ }
+
+ err = -EIO;
+
+@@ -12049,8 +12040,7 @@ static int tg3_nvram_write_block(struct tg3 *tp, u32 offset, u32 len, u8 *buf)
+
+ if (!(tp->tg3_flags & TG3_FLAG_NVRAM)) {
+ ret = tg3_nvram_write_block_using_eeprom(tp, offset, len, buf);
+- }
+- else {
++ } else {
+ u32 grc_mode;
+
+ ret = tg3_nvram_lock(tp);
+@@ -12070,8 +12060,7 @@ static int tg3_nvram_write_block(struct tg3 *tp, u32 offset, u32 len, u8 *buf)
+
+ ret = tg3_nvram_write_block_buffered(tp, offset, len,
+ buf);
+- }
+- else {
++ } else {
+ ret = tg3_nvram_write_block_unbuffered(tp, offset, len,
+ buf);
+ }
+@@ -13120,8 +13109,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ tp->tg3_flags2 |= TG3_FLG2_5780_CLASS;
+ tp->tg3_flags |= TG3_FLAG_40BIT_DMA_BUG;
+ tp->msi_cap = pci_find_capability(tp->pdev, PCI_CAP_ID_MSI);
+- }
+- else {
++ } else {
+ struct pci_dev *bridge = NULL;
+
+ do {
+@@ -14019,11 +14007,10 @@ static int __devinit tg3_do_test_dma(struct tg3 *tp, u32 *buf, dma_addr_t buf_dm
+ }
+ pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_BASE_ADDR, 0);
+
+- if (to_device) {
++ if (to_device)
+ tw32(FTQ_DMA_HIGH_READ_FIFO_ENQDEQ, sram_dma_descs);
+- } else {
++ else
+ tw32(FTQ_DMA_HIGH_WRITE_FIFO_ENQDEQ, sram_dma_descs);
+- }
+
+ ret = -ENODEV;
+ for (i = 0; i < 40; i++) {
+@@ -14228,10 +14215,10 @@ static int __devinit tg3_test_dma(struct tg3 *tp)
+ if (pci_dev_present(dma_wait_state_chipsets)) {
+ tp->dma_rwctrl &= ~DMA_RWCTRL_WRITE_BNDRY_MASK;
+ tp->dma_rwctrl |= DMA_RWCTRL_WRITE_BNDRY_16;
+- }
+- else
++ } else {
+ /* Safe to use the calculated DMA boundary. */
+ tp->dma_rwctrl = saved_dma_rwctrl;
++ }
+
+ tw32(TG3PCI_DMA_RW_CTRL, tp->dma_rwctrl);
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0109-tg3-Remove-tg3_dump_state.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0109-tg3-Remove-tg3_dump_state.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,274 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 5 Apr 2010 10:19:29 +0000
+Subject: [PATCH 109/207] tg3: Remove tg3_dump_state()
+
+commit 7705736f5fc2e8fd0aa98eb7667e65dbedf50d63 upstream.
+
+The tg3_dump_state() function is commented out and doesn't get used much
+when debugging efforts are underway. The chip architecture has also
+changed enough that any debugging effort that might use it would have to
+tailor it to the capabilities of the hardware. This patch just removes
+the function entirely.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 233 -----------------------------------------------------
+ 1 files changed, 0 insertions(+), 233 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 410622f..0c46a65 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -8926,236 +8926,6 @@ err_out1:
+ return err;
+ }
+
+-#if 0
+-/*static*/ void tg3_dump_state(struct tg3 *tp)
+-{
+- u32 val32, val32_2, val32_3, val32_4, val32_5;
+- u16 val16;
+- int i;
+- struct tg3_hw_status *sblk = tp->napi[0]->hw_status;
+-
+- pci_read_config_word(tp->pdev, PCI_STATUS, &val16);
+- pci_read_config_dword(tp->pdev, TG3PCI_PCISTATE, &val32);
+- printk("DEBUG: PCI status [%04x] TG3PCI state[%08x]\n",
+- val16, val32);
+-
+- /* MAC block */
+- printk("DEBUG: MAC_MODE[%08x] MAC_STATUS[%08x]\n",
+- tr32(MAC_MODE), tr32(MAC_STATUS));
+- printk(" MAC_EVENT[%08x] MAC_LED_CTRL[%08x]\n",
+- tr32(MAC_EVENT), tr32(MAC_LED_CTRL));
+- printk("DEBUG: MAC_TX_MODE[%08x] MAC_TX_STATUS[%08x]\n",
+- tr32(MAC_TX_MODE), tr32(MAC_TX_STATUS));
+- printk(" MAC_RX_MODE[%08x] MAC_RX_STATUS[%08x]\n",
+- tr32(MAC_RX_MODE), tr32(MAC_RX_STATUS));
+-
+- /* Send data initiator control block */
+- printk("DEBUG: SNDDATAI_MODE[%08x] SNDDATAI_STATUS[%08x]\n",
+- tr32(SNDDATAI_MODE), tr32(SNDDATAI_STATUS));
+- printk(" SNDDATAI_STATSCTRL[%08x]\n",
+- tr32(SNDDATAI_STATSCTRL));
+-
+- /* Send data completion control block */
+- printk("DEBUG: SNDDATAC_MODE[%08x]\n", tr32(SNDDATAC_MODE));
+-
+- /* Send BD ring selector block */
+- printk("DEBUG: SNDBDS_MODE[%08x] SNDBDS_STATUS[%08x]\n",
+- tr32(SNDBDS_MODE), tr32(SNDBDS_STATUS));
+-
+- /* Send BD initiator control block */
+- printk("DEBUG: SNDBDI_MODE[%08x] SNDBDI_STATUS[%08x]\n",
+- tr32(SNDBDI_MODE), tr32(SNDBDI_STATUS));
+-
+- /* Send BD completion control block */
+- printk("DEBUG: SNDBDC_MODE[%08x]\n", tr32(SNDBDC_MODE));
+-
+- /* Receive list placement control block */
+- printk("DEBUG: RCVLPC_MODE[%08x] RCVLPC_STATUS[%08x]\n",
+- tr32(RCVLPC_MODE), tr32(RCVLPC_STATUS));
+- printk(" RCVLPC_STATSCTRL[%08x]\n",
+- tr32(RCVLPC_STATSCTRL));
+-
+- /* Receive data and receive BD initiator control block */
+- printk("DEBUG: RCVDBDI_MODE[%08x] RCVDBDI_STATUS[%08x]\n",
+- tr32(RCVDBDI_MODE), tr32(RCVDBDI_STATUS));
+-
+- /* Receive data completion control block */
+- printk("DEBUG: RCVDCC_MODE[%08x]\n",
+- tr32(RCVDCC_MODE));
+-
+- /* Receive BD initiator control block */
+- printk("DEBUG: RCVBDI_MODE[%08x] RCVBDI_STATUS[%08x]\n",
+- tr32(RCVBDI_MODE), tr32(RCVBDI_STATUS));
+-
+- /* Receive BD completion control block */
+- printk("DEBUG: RCVCC_MODE[%08x] RCVCC_STATUS[%08x]\n",
+- tr32(RCVCC_MODE), tr32(RCVCC_STATUS));
+-
+- /* Receive list selector control block */
+- printk("DEBUG: RCVLSC_MODE[%08x] RCVLSC_STATUS[%08x]\n",
+- tr32(RCVLSC_MODE), tr32(RCVLSC_STATUS));
+-
+- /* Mbuf cluster free block */
+- printk("DEBUG: MBFREE_MODE[%08x] MBFREE_STATUS[%08x]\n",
+- tr32(MBFREE_MODE), tr32(MBFREE_STATUS));
+-
+- /* Host coalescing control block */
+- printk("DEBUG: HOSTCC_MODE[%08x] HOSTCC_STATUS[%08x]\n",
+- tr32(HOSTCC_MODE), tr32(HOSTCC_STATUS));
+- printk("DEBUG: HOSTCC_STATS_BLK_HOST_ADDR[%08x%08x]\n",
+- tr32(HOSTCC_STATS_BLK_HOST_ADDR + TG3_64BIT_REG_HIGH),
+- tr32(HOSTCC_STATS_BLK_HOST_ADDR + TG3_64BIT_REG_LOW));
+- printk("DEBUG: HOSTCC_STATUS_BLK_HOST_ADDR[%08x%08x]\n",
+- tr32(HOSTCC_STATUS_BLK_HOST_ADDR + TG3_64BIT_REG_HIGH),
+- tr32(HOSTCC_STATUS_BLK_HOST_ADDR + TG3_64BIT_REG_LOW));
+- printk("DEBUG: HOSTCC_STATS_BLK_NIC_ADDR[%08x]\n",
+- tr32(HOSTCC_STATS_BLK_NIC_ADDR));
+- printk("DEBUG: HOSTCC_STATUS_BLK_NIC_ADDR[%08x]\n",
+- tr32(HOSTCC_STATUS_BLK_NIC_ADDR));
+-
+- /* Memory arbiter control block */
+- printk("DEBUG: MEMARB_MODE[%08x] MEMARB_STATUS[%08x]\n",
+- tr32(MEMARB_MODE), tr32(MEMARB_STATUS));
+-
+- /* Buffer manager control block */
+- printk("DEBUG: BUFMGR_MODE[%08x] BUFMGR_STATUS[%08x]\n",
+- tr32(BUFMGR_MODE), tr32(BUFMGR_STATUS));
+- printk("DEBUG: BUFMGR_MB_POOL_ADDR[%08x] BUFMGR_MB_POOL_SIZE[%08x]\n",
+- tr32(BUFMGR_MB_POOL_ADDR), tr32(BUFMGR_MB_POOL_SIZE));
+- printk("DEBUG: BUFMGR_DMA_DESC_POOL_ADDR[%08x] "
+- "BUFMGR_DMA_DESC_POOL_SIZE[%08x]\n",
+- tr32(BUFMGR_DMA_DESC_POOL_ADDR),
+- tr32(BUFMGR_DMA_DESC_POOL_SIZE));
+-
+- /* Read DMA control block */
+- printk("DEBUG: RDMAC_MODE[%08x] RDMAC_STATUS[%08x]\n",
+- tr32(RDMAC_MODE), tr32(RDMAC_STATUS));
+-
+- /* Write DMA control block */
+- printk("DEBUG: WDMAC_MODE[%08x] WDMAC_STATUS[%08x]\n",
+- tr32(WDMAC_MODE), tr32(WDMAC_STATUS));
+-
+- /* DMA completion block */
+- printk("DEBUG: DMAC_MODE[%08x]\n",
+- tr32(DMAC_MODE));
+-
+- /* GRC block */
+- printk("DEBUG: GRC_MODE[%08x] GRC_MISC_CFG[%08x]\n",
+- tr32(GRC_MODE), tr32(GRC_MISC_CFG));
+- printk("DEBUG: GRC_LOCAL_CTRL[%08x]\n",
+- tr32(GRC_LOCAL_CTRL));
+-
+- /* TG3_BDINFOs */
+- printk("DEBUG: RCVDBDI_JUMBO_BD[%08x%08x:%08x:%08x]\n",
+- tr32(RCVDBDI_JUMBO_BD + 0x0),
+- tr32(RCVDBDI_JUMBO_BD + 0x4),
+- tr32(RCVDBDI_JUMBO_BD + 0x8),
+- tr32(RCVDBDI_JUMBO_BD + 0xc));
+- printk("DEBUG: RCVDBDI_STD_BD[%08x%08x:%08x:%08x]\n",
+- tr32(RCVDBDI_STD_BD + 0x0),
+- tr32(RCVDBDI_STD_BD + 0x4),
+- tr32(RCVDBDI_STD_BD + 0x8),
+- tr32(RCVDBDI_STD_BD + 0xc));
+- printk("DEBUG: RCVDBDI_MINI_BD[%08x%08x:%08x:%08x]\n",
+- tr32(RCVDBDI_MINI_BD + 0x0),
+- tr32(RCVDBDI_MINI_BD + 0x4),
+- tr32(RCVDBDI_MINI_BD + 0x8),
+- tr32(RCVDBDI_MINI_BD + 0xc));
+-
+- tg3_read_mem(tp, NIC_SRAM_SEND_RCB + 0x0, &val32);
+- tg3_read_mem(tp, NIC_SRAM_SEND_RCB + 0x4, &val32_2);
+- tg3_read_mem(tp, NIC_SRAM_SEND_RCB + 0x8, &val32_3);
+- tg3_read_mem(tp, NIC_SRAM_SEND_RCB + 0xc, &val32_4);
+- printk("DEBUG: SRAM_SEND_RCB_0[%08x%08x:%08x:%08x]\n",
+- val32, val32_2, val32_3, val32_4);
+-
+- tg3_read_mem(tp, NIC_SRAM_RCV_RET_RCB + 0x0, &val32);
+- tg3_read_mem(tp, NIC_SRAM_RCV_RET_RCB + 0x4, &val32_2);
+- tg3_read_mem(tp, NIC_SRAM_RCV_RET_RCB + 0x8, &val32_3);
+- tg3_read_mem(tp, NIC_SRAM_RCV_RET_RCB + 0xc, &val32_4);
+- printk("DEBUG: SRAM_RCV_RET_RCB_0[%08x%08x:%08x:%08x]\n",
+- val32, val32_2, val32_3, val32_4);
+-
+- tg3_read_mem(tp, NIC_SRAM_STATUS_BLK + 0x0, &val32);
+- tg3_read_mem(tp, NIC_SRAM_STATUS_BLK + 0x4, &val32_2);
+- tg3_read_mem(tp, NIC_SRAM_STATUS_BLK + 0x8, &val32_3);
+- tg3_read_mem(tp, NIC_SRAM_STATUS_BLK + 0xc, &val32_4);
+- tg3_read_mem(tp, NIC_SRAM_STATUS_BLK + 0x10, &val32_5);
+- printk("DEBUG: SRAM_STATUS_BLK[%08x:%08x:%08x:%08x:%08x]\n",
+- val32, val32_2, val32_3, val32_4, val32_5);
+-
+- /* SW status block */
+- printk(KERN_DEBUG
+- "Host status block [%08x:%08x:(%04x:%04x:%04x):(%04x:%04x)]\n",
+- sblk->status,
+- sblk->status_tag,
+- sblk->rx_jumbo_consumer,
+- sblk->rx_consumer,
+- sblk->rx_mini_consumer,
+- sblk->idx[0].rx_producer,
+- sblk->idx[0].tx_consumer);
+-
+- /* SW statistics block */
+- printk("DEBUG: Host statistics block [%08x:%08x:%08x:%08x]\n",
+- ((u32 *)tp->hw_stats)[0],
+- ((u32 *)tp->hw_stats)[1],
+- ((u32 *)tp->hw_stats)[2],
+- ((u32 *)tp->hw_stats)[3]);
+-
+- /* Mailboxes */
+- printk("DEBUG: SNDHOST_PROD[%08x%08x] SNDNIC_PROD[%08x%08x]\n",
+- tr32_mailbox(MAILBOX_SNDHOST_PROD_IDX_0 + 0x0),
+- tr32_mailbox(MAILBOX_SNDHOST_PROD_IDX_0 + 0x4),
+- tr32_mailbox(MAILBOX_SNDNIC_PROD_IDX_0 + 0x0),
+- tr32_mailbox(MAILBOX_SNDNIC_PROD_IDX_0 + 0x4));
+-
+- /* NIC side send descriptors. */
+- for (i = 0; i < 6; i++) {
+- unsigned long txd;
+-
+- txd = tp->regs + NIC_SRAM_WIN_BASE + NIC_SRAM_TX_BUFFER_DESC
+- + (i * sizeof(struct tg3_tx_buffer_desc));
+- printk("DEBUG: NIC TXD(%d)[%08x:%08x:%08x:%08x]\n",
+- i,
+- readl(txd + 0x0), readl(txd + 0x4),
+- readl(txd + 0x8), readl(txd + 0xc));
+- }
+-
+- /* NIC side RX descriptors. */
+- for (i = 0; i < 6; i++) {
+- unsigned long rxd;
+-
+- rxd = tp->regs + NIC_SRAM_WIN_BASE + NIC_SRAM_RX_BUFFER_DESC
+- + (i * sizeof(struct tg3_rx_buffer_desc));
+- printk("DEBUG: NIC RXD_STD(%d)[0][%08x:%08x:%08x:%08x]\n",
+- i,
+- readl(rxd + 0x0), readl(rxd + 0x4),
+- readl(rxd + 0x8), readl(rxd + 0xc));
+- rxd += (4 * sizeof(u32));
+- printk("DEBUG: NIC RXD_STD(%d)[1][%08x:%08x:%08x:%08x]\n",
+- i,
+- readl(rxd + 0x0), readl(rxd + 0x4),
+- readl(rxd + 0x8), readl(rxd + 0xc));
+- }
+-
+- for (i = 0; i < 6; i++) {
+- unsigned long rxd;
+-
+- rxd = tp->regs + NIC_SRAM_WIN_BASE + NIC_SRAM_RX_JUMBO_BUFFER_DESC
+- + (i * sizeof(struct tg3_rx_buffer_desc));
+- printk("DEBUG: NIC RXD_JUMBO(%d)[0][%08x:%08x:%08x:%08x]\n",
+- i,
+- readl(rxd + 0x0), readl(rxd + 0x4),
+- readl(rxd + 0x8), readl(rxd + 0xc));
+- rxd += (4 * sizeof(u32));
+- printk("DEBUG: NIC RXD_JUMBO(%d)[1][%08x:%08x:%08x:%08x]\n",
+- i,
+- readl(rxd + 0x0), readl(rxd + 0x4),
+- readl(rxd + 0x8), readl(rxd + 0xc));
+- }
+-}
+-#endif
+-
+ static struct net_device_stats *tg3_get_stats(struct net_device *);
+ static struct tg3_ethtool_stats *tg3_get_estats(struct tg3 *);
+
+@@ -9174,9 +8944,6 @@ static int tg3_close(struct net_device *dev)
+ tg3_phy_stop(tp);
+
+ tg3_full_lock(tp, 1);
+-#if 0
+- tg3_dump_state(tp);
+-#endif
+
+ tg3_disable_ints(tp);
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0110-tg3-Update-version-to-3.109.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0110-tg3-Update-version-to-3.109.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,34 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 5 Apr 2010 10:19:30 +0000
+Subject: [PATCH 110/207] tg3: Update version to 3.109
+
+commit 7ae554e5557bc8ee6ced437e5acffba922463a63 upstream.
+
+This patch updates the tg3 version to 3.109.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 0c46a65..0906cb1 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -67,8 +67,8 @@
+ #include "tg3.h"
+
+ #define DRV_MODULE_NAME "tg3"
+-#define DRV_MODULE_VERSION "3.108"
+-#define DRV_MODULE_RELDATE "February 17, 2010"
++#define DRV_MODULE_VERSION "3.109"
++#define DRV_MODULE_RELDATE "April 2, 2010"
+
+ #define TG3_DEF_MAC_MODE 0
+ #define TG3_DEF_RX_MODE 0
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0111-tg3-Disable-CLKREQ-in-L2.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0111-tg3-Disable-CLKREQ-in-L2.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,57 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 12 Apr 2010 06:58:24 +0000
+Subject: [PATCH 111/207] tg3: Disable CLKREQ in L2
+
+commit cea46462681d61a65a208d17206d38739c1ea1b1 upstream.
+
+This patch disables CLKREQ in L2 to workaround a chipset bug.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 14 ++++++++++++++
+ drivers/net/tg3.h | 2 ++
+ 2 files changed, 16 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 0906cb1..ad38487 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -7642,6 +7642,20 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ tw32(GRC_MODE, grc_mode);
+ }
+
++ if (tp->pci_chip_rev_id == CHIPREV_ID_57765_A0) {
++ u32 grc_mode = tr32(GRC_MODE);
++
++ /* Access the lower 1K of PL PCIE block registers. */
++ val = grc_mode & ~GRC_MODE_PCIE_PORT_MASK;
++ tw32(GRC_MODE, val | GRC_MODE_PCIE_PL_SEL);
++
++ val = tr32(TG3_PCIE_TLDLPL_PORT + TG3_PCIE_PL_LO_PHYCTL5);
++ tw32(TG3_PCIE_TLDLPL_PORT + TG3_PCIE_PL_LO_PHYCTL5,
++ val | TG3_PCIE_PL_LO_PHYCTL5_DIS_L2CLKREQ);
++
++ tw32(GRC_MODE, grc_mode);
++ }
++
+ /* This works around an issue with Athlon chipsets on
+ * B3 tigon3 silicon. This bit has no effect on any
+ * other revision. But do not set this on PCI Express
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 5d7f72a..8a6012a 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -1854,6 +1854,8 @@
+ #define TG3_PCIE_TLDLPL_PORT 0x00007c00
+ #define TG3_PCIE_PL_LO_PHYCTL1 0x00000004
+ #define TG3_PCIE_PL_LO_PHYCTL1_L1PLLPD_EN 0x00001000
++#define TG3_PCIE_PL_LO_PHYCTL5 0x00000014
++#define TG3_PCIE_PL_LO_PHYCTL5_DIS_L2CLKREQ 0x80000000
+
+ /* OTP bit definitions */
+ #define TG3_OTP_AGCTGT_MASK 0x000000e0
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0112-tg3-Set-card-57765-card-reader-MRRS-to-1024B.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0112-tg3-Set-card-57765-card-reader-MRRS-to-1024B.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,45 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 12 Apr 2010 06:58:25 +0000
+Subject: [PATCH 112/207] tg3: Set card 57765 card reader MRRS to 1024B
+
+commit 1a3190254c0d1d1951e1d7e93542387c6ec82384 upstream.
+
+This patch sets the Maximum Read Request Size for the card reader
+function to 1024 bytes to prevent an SD controller lockup.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 2 ++
+ drivers/net/tg3.h | 1 +
+ 2 files changed, 3 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index ad38487..b8ed328 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -7704,6 +7704,8 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) {
+ val = tr32(TG3PCI_DMA_RW_CTRL) &
+ ~DMA_RWCTRL_DIS_CACHE_ALIGNMENT;
++ if (tp->pci_chip_rev_id == CHIPREV_ID_57765_A0)
++ val &= ~DMA_RWCTRL_CRDRDR_RDMA_MRRS_MSK;
+ tw32(TG3PCI_DMA_RW_CTRL, val | tp->dma_rwctrl);
+ } else if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5784 &&
+ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5761) {
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 8a6012a..9e7fe0e 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -183,6 +183,7 @@
+ #define METAL_REV_B2 0x02
+ #define TG3PCI_DMA_RW_CTRL 0x0000006c
+ #define DMA_RWCTRL_DIS_CACHE_ALIGNMENT 0x00000001
++#define DMA_RWCTRL_CRDRDR_RDMA_MRRS_MSK 0x00000380
+ #define DMA_RWCTRL_READ_BNDRY_MASK 0x00000700
+ #define DMA_RWCTRL_READ_BNDRY_DISAB 0x00000000
+ #define DMA_RWCTRL_READ_BNDRY_16 0x00000100
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0113-tg3-Reduce-57765-core-clock-when-link-at-10Mbps.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0113-tg3-Reduce-57765-core-clock-when-link-at-10Mbps.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,36 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 12 Apr 2010 06:58:26 +0000
+Subject: [PATCH 113/207] tg3: Reduce 57765 core clock when link at 10Mbps
+
+commit a977dbe8445b8a81d6127c4aa9112a2c29a1a008 upstream.
+
+This patch reduces the core clock to 6.25MHz when operating at 10Mbps
+link speed. This is needed to prevent a bug that will ultimately cause
+transmits to cease.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 5 +++++
+ 1 files changed, 5 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index b8ed328..40b2dd9 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -7654,6 +7654,11 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ val | TG3_PCIE_PL_LO_PHYCTL5_DIS_L2CLKREQ);
+
+ tw32(GRC_MODE, grc_mode);
++
++ val = tr32(TG3_CPMU_LSPD_10MB_CLK);
++ val &= ~CPMU_LSPD_10MB_MACCLK_MASK;
++ val |= CPMU_LSPD_10MB_MACCLK_6_25;
++ tw32(TG3_CPMU_LSPD_10MB_CLK, val);
+ }
+
+ /* This works around an issue with Athlon chipsets on
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0114-tg3-Optimize-rx-double-copy-test.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0114-tg3-Optimize-rx-double-copy-test.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,120 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 12 Apr 2010 06:58:27 +0000
+Subject: [PATCH 114/207] tg3: Optimize rx double copy test
+
+commit d2757fc4076118e13180e91f02c3c52659be3d9d upstream.
+
+On a PCIX bus, the 5701 has a bug which requires the driver to double
+copy all rx packets. The rx code uses the rx_offset device member as a
+flag to determine if this workaround should take effect. The following
+patch will modify the rx_offset member such that this test will become
+less clear.
+
+The patch starts by integrating the workaround check into the packet
+length check. It rounds out the implementation by relaxing the
+workaround restrictions if the platform has efficient unaligned
+accesses.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 32 +++++++++++++++++++++++++-------
+ drivers/net/tg3.h | 5 ++---
+ 2 files changed, 27 insertions(+), 10 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 40b2dd9..15d0164 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -144,6 +144,24 @@
+
+ #define TG3_RSS_MIN_NUM_MSIX_VECS 2
+
++/* Due to a hardware bug, the 5701 can only DMA to memory addresses
++ * that are at least dword aligned when used in PCIX mode. The driver
++ * works around this bug by double copying the packet. This workaround
++ * is built into the normal double copy length check for efficiency.
++ *
++ * However, the double copy is only necessary on those architectures
++ * where unaligned memory accesses are inefficient. For those architectures
++ * where unaligned memory accesses incur little penalty, we can reintegrate
++ * the 5701 in the normal rx path. Doing so saves a device structure
++ * dereference by hardcoding the double copy threshold in place.
++ */
++#define TG3_RX_COPY_THRESHOLD 256
++#if NET_IP_ALIGN == 0 || defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
++ #define TG3_RX_COPY_THRESH(tp) TG3_RX_COPY_THRESHOLD
++#else
++ #define TG3_RX_COPY_THRESH(tp) ((tp)->rx_copy_thresh)
++#endif
++
+ /* minimum number of free TX descriptors required to wake up TX process */
+ #define TG3_TX_WAKEUP_THRESH(tnapi) ((tnapi)->tx_pending / 4)
+
+@@ -4639,12 +4657,7 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)
+ len = ((desc->idx_len & RXD_LEN_MASK) >> RXD_LEN_SHIFT) -
+ ETH_FCS_LEN;
+
+- if (len > RX_COPY_THRESHOLD &&
+- tp->rx_offset == NET_IP_ALIGN) {
+- /* rx_offset will likely not equal NET_IP_ALIGN
+- * if this is a 5701 card running in PCI-X mode
+- * [see tg3_get_invariants()]
+- */
++ if (len > TG3_RX_COPY_THRESH(tp)) {
+ int skb_size;
+
+ skb_size = tg3_alloc_rx_skb(tp, tpr, opaque_key,
+@@ -13470,9 +13483,14 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ tp->tg3_flags &= ~TG3_FLAG_POLL_SERDES;
+
+ tp->rx_offset = NET_IP_ALIGN;
++ tp->rx_copy_thresh = TG3_RX_COPY_THRESHOLD;
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701 &&
+- (tp->tg3_flags & TG3_FLAG_PCIX_MODE) != 0)
++ (tp->tg3_flags & TG3_FLAG_PCIX_MODE) != 0) {
+ tp->rx_offset = 0;
++#ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
++ tp->rx_copy_thresh = ~0;
++#endif
++ }
+
+ tp->rx_std_max_post = TG3_RX_RING_SIZE;
+
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 9e7fe0e..43dd1d2 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -23,8 +23,6 @@
+ #define TG3_BDINFO_NIC_ADDR 0xcUL /* 32-bit */
+ #define TG3_BDINFO_SIZE 0x10UL
+
+-#define RX_COPY_THRESHOLD 256
+-
+ #define TG3_RX_INTERNAL_RING_SZ_5906 32
+
+ #define RX_STD_MAX_SIZE 1536
+@@ -2754,9 +2752,11 @@ struct tg3 {
+ struct tg3_napi napi[TG3_IRQ_MAX_VECS];
+ void (*write32_rx_mbox) (struct tg3 *, u32,
+ u32);
++ u32 rx_copy_thresh;
+ u32 rx_pending;
+ u32 rx_jumbo_pending;
+ u32 rx_std_max_post;
++ u32 rx_offset;
+ u32 rx_pkt_map_sz;
+ #if TG3_VLAN_TAG_USED
+ struct vlan_group *vlgrp;
+@@ -2776,7 +2776,6 @@ struct tg3 {
+ unsigned long last_event_jiffies;
+ };
+
+- u32 rx_offset;
+ u32 tg3_flags;
+ #define TG3_FLAG_TAGGED_STATUS 0x00000001
+ #define TG3_FLAG_TXD_MBOX_HWBUG 0x00000002
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0115-tg3-Re-inline-VLAN-tags-when-appropriate.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0115-tg3-Re-inline-VLAN-tags-when-appropriate.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,115 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 12 Apr 2010 06:58:28 +0000
+Subject: [PATCH 115/207] tg3: Re-inline VLAN tags when appropriate
+
+commit 9dc7a1134919bda8951bf5909fb79c14defb8317 upstream.
+
+The tg3 driver is written so that VLAN tagged packets can be accepted,
+even if CONFIG_VLAN_8021Q or CONFIG_VLAN_8021Q_MODULE is not defined.
+(Think raw interfaces.) If the device has ASF support enabled, the
+firmware requires the driver to enable VLAN tag stripping. If VLAN
+tagging is not explicitly supported by the kernel and ASF is enabled,
+the driver will have to reinject the VLAN tag back into the packet
+stream.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 44 +++++++++++++++++++++++++++++++++-----------
+ 1 files changed, 33 insertions(+), 11 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 15d0164..0784121 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -126,6 +126,9 @@
+ TG3_TX_RING_SIZE)
+ #define NEXT_TX(N) (((N) + 1) & (TG3_TX_RING_SIZE - 1))
+
++#define TG3_RX_DMA_ALIGN 16
++#define TG3_RX_HEADROOM ALIGN(VLAN_HLEN, TG3_RX_DMA_ALIGN)
++
+ #define TG3_DMA_BYTE_ENAB 64
+
+ #define TG3_RX_STD_DMA_SZ 1536
+@@ -4624,6 +4627,8 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)
+ struct sk_buff *skb;
+ dma_addr_t dma_addr;
+ u32 opaque_key, desc_idx, *post_ptr;
++ bool hw_vlan __maybe_unused = false;
++ u16 vtag __maybe_unused = 0;
+
+ desc_idx = desc->opaque & RXD_OPAQUE_INDEX_MASK;
+ opaque_key = desc->opaque & RXD_OPAQUE_RING_MASK;
+@@ -4682,12 +4687,12 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)
+ tg3_recycle_rx(tnapi, tpr, opaque_key,
+ desc_idx, *post_ptr);
+
+- copy_skb = netdev_alloc_skb(tp->dev,
+- len + TG3_RAW_IP_ALIGN);
++ copy_skb = netdev_alloc_skb(tp->dev, len + VLAN_HLEN +
++ TG3_RAW_IP_ALIGN);
+ if (copy_skb == NULL)
+ goto drop_it_no_recycle;
+
+- skb_reserve(copy_skb, TG3_RAW_IP_ALIGN);
++ skb_reserve(copy_skb, TG3_RAW_IP_ALIGN + VLAN_HLEN);
+ skb_put(copy_skb, len);
+ pci_dma_sync_single_for_cpu(tp->pdev, dma_addr, len, PCI_DMA_FROMDEVICE);
+ skb_copy_from_linear_data(skb, copy_skb->data, len);
+@@ -4713,12 +4718,29 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)
+ goto next_pkt;
+ }
+
++ if (desc->type_flags & RXD_FLAG_VLAN &&
++ !(tp->rx_mode & RX_MODE_KEEP_VLAN_TAG)) {
++ vtag = desc->err_vlan & RXD_VLAN_MASK;
+ #if TG3_VLAN_TAG_USED
+- if (tp->vlgrp != NULL &&
+- desc->type_flags & RXD_FLAG_VLAN) {
+- vlan_gro_receive(&tnapi->napi, tp->vlgrp,
+- desc->err_vlan & RXD_VLAN_MASK, skb);
+- } else
++ if (tp->vlgrp)
++ hw_vlan = true;
++ else
++#endif
++ {
++ struct vlan_ethhdr *ve = (struct vlan_ethhdr *)
++ __skb_push(skb, VLAN_HLEN);
++
++ memmove(ve, skb->data + VLAN_HLEN,
++ ETH_ALEN * 2);
++ ve->h_vlan_proto = htons(ETH_P_8021Q);
++ ve->h_vlan_TCI = htons(vtag);
++ }
++ }
++
++#if TG3_VLAN_TAG_USED
++ if (hw_vlan)
++ vlan_gro_receive(&tnapi->napi, tp->vlgrp, vtag, skb);
++ else
+ #endif
+ napi_gro_receive(&tnapi->napi, skb);
+
+@@ -13482,13 +13504,13 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ else
+ tp->tg3_flags &= ~TG3_FLAG_POLL_SERDES;
+
+- tp->rx_offset = NET_IP_ALIGN;
++ tp->rx_offset = NET_IP_ALIGN + TG3_RX_HEADROOM;
+ tp->rx_copy_thresh = TG3_RX_COPY_THRESHOLD;
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701 &&
+ (tp->tg3_flags & TG3_FLAG_PCIX_MODE) != 0) {
+- tp->rx_offset = 0;
++ tp->rx_offset -= NET_IP_ALIGN;
+ #ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
+- tp->rx_copy_thresh = ~0;
++ tp->rx_copy_thresh = ~(u16)0;
+ #endif
+ }
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0116-tg3-Unify-max-pkt-size-preprocessor-constants.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0116-tg3-Unify-max-pkt-size-preprocessor-constants.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,50 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 12 Apr 2010 06:58:29 +0000
+Subject: [PATCH 116/207] tg3: Unify max pkt size preprocessor constants
+
+commit 04380d401ebd02ec68bb0fc170f21a93690ebc80 upstream.
+
+The maximum packet size that gets programmed into the standard producer
+ring control block is directly related to the packet size used to
+allocate packet buffers. This patch removes the redundant preprocessor
+constant.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 4 ++--
+ drivers/net/tg3.h | 1 -
+ 2 files changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 0784121..08c5b8b 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -7905,9 +7905,9 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
+ val = (RX_STD_MAX_SIZE_5705 << BDINFO_FLAGS_MAXLEN_SHIFT) |
+- (RX_STD_MAX_SIZE << 2);
++ (TG3_RX_STD_DMA_SZ << 2);
+ else
+- val = RX_STD_MAX_SIZE << BDINFO_FLAGS_MAXLEN_SHIFT;
++ val = TG3_RX_STD_DMA_SZ << BDINFO_FLAGS_MAXLEN_SHIFT;
+ } else
+ val = RX_STD_MAX_SIZE_5705 << BDINFO_FLAGS_MAXLEN_SHIFT;
+
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 43dd1d2..b71083d 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -25,7 +25,6 @@
+
+ #define TG3_RX_INTERNAL_RING_SZ_5906 32
+
+-#define RX_STD_MAX_SIZE 1536
+ #define RX_STD_MAX_SIZE_5705 512
+ #define RX_JUMBO_MAX_SIZE 0xdeadbeef /* XXX */
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0117-tg3-Remove-function-errors-flagged-by-checkpatch.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0117-tg3-Remove-function-errors-flagged-by-checkpatch.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,101 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 12 Apr 2010 06:58:30 +0000
+Subject: [PATCH 117/207] tg3: Remove function errors flagged by checkpatch
+
+commit de6f31eb9a467cfd0f1f8c5e6ca842563f7f2870 upstream.
+
+This patch removes the following checkpatch errors:
+
+* return is not a function, parentheses are not required
+* space prohibited between function name and open parenthesis '('
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 18 +++++++++---------
+ 1 files changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 08c5b8b..ef93235 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -383,7 +383,7 @@ static void tg3_write32(struct tg3 *tp, u32 off, u32 val)
+
+ static u32 tg3_read32(struct tg3 *tp, u32 off)
+ {
+- return (readl(tp->regs + off));
++ return readl(tp->regs + off);
+ }
+
+ static void tg3_ape_write32(struct tg3 *tp, u32 off, u32 val)
+@@ -393,7 +393,7 @@ static void tg3_ape_write32(struct tg3 *tp, u32 off, u32 val)
+
+ static u32 tg3_ape_read32(struct tg3 *tp, u32 off)
+ {
+- return (readl(tp->aperegs + off));
++ return readl(tp->aperegs + off);
+ }
+
+ static void tg3_write_indirect_reg32(struct tg3 *tp, u32 off, u32 val)
+@@ -511,7 +511,7 @@ static void tg3_write32_tx_mbox(struct tg3 *tp, u32 off, u32 val)
+
+ static u32 tg3_read32_mbox_5906(struct tg3 *tp, u32 off)
+ {
+- return (readl(tp->regs + off + GRCMBOX_BASE));
++ return readl(tp->regs + off + GRCMBOX_BASE);
+ }
+
+ static void tg3_write32_mbox_5906(struct tg3 *tp, u32 off, u32 val)
+@@ -5775,7 +5775,7 @@ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb,
+ hdr_len = ip_tcp_len + tcp_opt_len;
+ if (unlikely((ETH_HLEN + hdr_len) > 80) &&
+ (tp->tg3_flags2 & TG3_FLG2_TSO_BUG))
+- return (tg3_tso_bug(tp, skb));
++ return tg3_tso_bug(tp, skb);
+
+ base_flags |= (TXD_FLAG_CPU_PRE_DMA |
+ TXD_FLAG_CPU_POST_DMA);
+@@ -9286,10 +9286,10 @@ static void __tg3_set_rx_mode(struct net_device *dev)
+ rx_mode |= RX_MODE_PROMISC;
+ } else if (dev->flags & IFF_ALLMULTI) {
+ /* Accept all multicast. */
+- tg3_set_multi (tp, 1);
++ tg3_set_multi(tp, 1);
+ } else if (netdev_mc_empty(dev)) {
+ /* Reject all multicast. */
+- tg3_set_multi (tp, 0);
++ tg3_set_multi(tp, 0);
+ } else {
+ /* Accept one or more multicast(s). */
+ struct dev_mc_list *mclist;
+@@ -10031,7 +10031,7 @@ static int tg3_set_tx_csum(struct net_device *dev, u32 data)
+ return 0;
+ }
+
+-static int tg3_get_sset_count (struct net_device *dev, int sset)
++static int tg3_get_sset_count(struct net_device *dev, int sset)
+ {
+ switch (sset) {
+ case ETH_SS_TEST:
+@@ -10043,7 +10043,7 @@ static int tg3_get_sset_count (struct net_device *dev, int sset)
+ }
+ }
+
+-static void tg3_get_strings (struct net_device *dev, u32 stringset, u8 *buf)
++static void tg3_get_strings(struct net_device *dev, u32 stringset, u8 *buf)
+ {
+ switch (stringset) {
+ case ETH_SS_STATS:
+@@ -10090,7 +10090,7 @@ static int tg3_phys_id(struct net_device *dev, u32 data)
+ return 0;
+ }
+
+-static void tg3_get_ethtool_stats (struct net_device *dev,
++static void tg3_get_ethtool_stats(struct net_device *dev,
+ struct ethtool_stats *estats, u64 *tmp_stats)
+ {
+ struct tg3 *tp = netdev_priv(dev);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0118-tg3-Update-version-to-3.110.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0118-tg3-Update-version-to-3.110.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,33 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 12 Apr 2010 06:58:31 +0000
+Subject: [PATCH 118/207] tg3: Update version to 3.110
+
+commit 3941f1885bbf5b9f5e45cdd5a82efc794cc3823f upstream.
+
+This patch updates the tg3 version to 3.110.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index ef93235..ac8f275 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -67,8 +67,8 @@
+ #include "tg3.h"
+
+ #define DRV_MODULE_NAME "tg3"
+-#define DRV_MODULE_VERSION "3.109"
+-#define DRV_MODULE_RELDATE "April 2, 2010"
++#define DRV_MODULE_VERSION "3.110"
++#define DRV_MODULE_RELDATE "April 9, 2010"
+
+ #define TG3_DEF_MAC_MODE 0
+ #define TG3_DEF_RX_MODE 0
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0119-tg3-use-the-DMA-state-API-instead-of-the-pci-equival.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0119-tg3-use-the-DMA-state-API-instead-of-the-pci-equival.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,222 @@
+From: FUJITA Tomonori <fujita.tomonori at lab.ntt.co.jp>
+Date: Mon, 12 Apr 2010 14:32:09 +0000
+Subject: [PATCH 119/207] tg3: use the DMA state API instead of the pci
+ equivalents
+
+commit 4e5e4f0d65975ce092202cce48b42571bf84591e upstream.
+
+This replace the PCI DMA state API (include/linux/pci-dma.h) with the
+DMA equivalents since the PCI DMA state API will be obsolete.
+
+No functional change.
+
+For further information about the background:
+
+http://marc.info/?l=linux-netdev&m=127037540020276&w=2
+
+Signed-off-by: FUJITA Tomonori <fujita.tomonori at lab.ntt.co.jp>
+Cc: Matt Carlson <mcarlson at broadcom.com>
+Cc: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 42 +++++++++++++++++++++---------------------
+ drivers/net/tg3.h | 2 +-
+ 2 files changed, 22 insertions(+), 22 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index ac8f275..bfbe11e 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -4400,7 +4400,7 @@ static void tg3_tx(struct tg3_napi *tnapi)
+ }
+
+ pci_unmap_single(tp->pdev,
+- pci_unmap_addr(ri, mapping),
++ dma_unmap_addr(ri, mapping),
+ skb_headlen(skb),
+ PCI_DMA_TODEVICE);
+
+@@ -4414,7 +4414,7 @@ static void tg3_tx(struct tg3_napi *tnapi)
+ tx_bug = 1;
+
+ pci_unmap_page(tp->pdev,
+- pci_unmap_addr(ri, mapping),
++ dma_unmap_addr(ri, mapping),
+ skb_shinfo(skb)->frags[i].size,
+ PCI_DMA_TODEVICE);
+ sw_idx = NEXT_TX(sw_idx);
+@@ -4452,7 +4452,7 @@ static void tg3_rx_skb_free(struct tg3 *tp, struct ring_info *ri, u32 map_sz)
+ if (!ri->skb)
+ return;
+
+- pci_unmap_single(tp->pdev, pci_unmap_addr(ri, mapping),
++ pci_unmap_single(tp->pdev, dma_unmap_addr(ri, mapping),
+ map_sz, PCI_DMA_FROMDEVICE);
+ dev_kfree_skb_any(ri->skb);
+ ri->skb = NULL;
+@@ -4518,7 +4518,7 @@ static int tg3_alloc_rx_skb(struct tg3 *tp, struct tg3_rx_prodring_set *tpr,
+ }
+
+ map->skb = skb;
+- pci_unmap_addr_set(map, mapping, mapping);
++ dma_unmap_addr_set(map, mapping, mapping);
+
+ desc->addr_hi = ((u64)mapping >> 32);
+ desc->addr_lo = ((u64)mapping & 0xffffffff);
+@@ -4563,8 +4563,8 @@ static void tg3_recycle_rx(struct tg3_napi *tnapi,
+ }
+
+ dest_map->skb = src_map->skb;
+- pci_unmap_addr_set(dest_map, mapping,
+- pci_unmap_addr(src_map, mapping));
++ dma_unmap_addr_set(dest_map, mapping,
++ dma_unmap_addr(src_map, mapping));
+ dest_desc->addr_hi = src_desc->addr_hi;
+ dest_desc->addr_lo = src_desc->addr_lo;
+
+@@ -4634,13 +4634,13 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)
+ opaque_key = desc->opaque & RXD_OPAQUE_RING_MASK;
+ if (opaque_key == RXD_OPAQUE_RING_STD) {
+ ri = &tp->prodring[0].rx_std_buffers[desc_idx];
+- dma_addr = pci_unmap_addr(ri, mapping);
++ dma_addr = dma_unmap_addr(ri, mapping);
+ skb = ri->skb;
+ post_ptr = &std_prod_idx;
+ rx_std_posted++;
+ } else if (opaque_key == RXD_OPAQUE_RING_JUMBO) {
+ ri = &tp->prodring[0].rx_jmb_buffers[desc_idx];
+- dma_addr = pci_unmap_addr(ri, mapping);
++ dma_addr = dma_unmap_addr(ri, mapping);
+ skb = ri->skb;
+ post_ptr = &jmb_prod_idx;
+ } else
+@@ -5474,12 +5474,12 @@ static int tigon3_dma_hwbug_workaround(struct tg3_napi *tnapi,
+ len = skb_shinfo(skb)->frags[i-1].size;
+
+ pci_unmap_single(tp->pdev,
+- pci_unmap_addr(&tnapi->tx_buffers[entry],
++ dma_unmap_addr(&tnapi->tx_buffers[entry],
+ mapping),
+ len, PCI_DMA_TODEVICE);
+ if (i == 0) {
+ tnapi->tx_buffers[entry].skb = new_skb;
+- pci_unmap_addr_set(&tnapi->tx_buffers[entry], mapping,
++ dma_unmap_addr_set(&tnapi->tx_buffers[entry], mapping,
+ new_addr);
+ } else {
+ tnapi->tx_buffers[entry].skb = NULL;
+@@ -5609,7 +5609,7 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb,
+ }
+
+ tnapi->tx_buffers[entry].skb = skb;
+- pci_unmap_addr_set(&tnapi->tx_buffers[entry], mapping, mapping);
++ dma_unmap_addr_set(&tnapi->tx_buffers[entry], mapping, mapping);
+
+ if ((tp->tg3_flags3 & TG3_FLG3_USE_JUMBO_BDFLAG) &&
+ !mss && skb->len > ETH_DATA_LEN)
+@@ -5635,7 +5635,7 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb,
+ goto dma_error;
+
+ tnapi->tx_buffers[entry].skb = NULL;
+- pci_unmap_addr_set(&tnapi->tx_buffers[entry], mapping,
++ dma_unmap_addr_set(&tnapi->tx_buffers[entry], mapping,
+ mapping);
+
+ tg3_set_txd(tnapi, entry, mapping, len,
+@@ -5665,7 +5665,7 @@ dma_error:
+ entry = tnapi->tx_prod;
+ tnapi->tx_buffers[entry].skb = NULL;
+ pci_unmap_single(tp->pdev,
+- pci_unmap_addr(&tnapi->tx_buffers[entry], mapping),
++ dma_unmap_addr(&tnapi->tx_buffers[entry], mapping),
+ skb_headlen(skb),
+ PCI_DMA_TODEVICE);
+ for (i = 0; i <= last; i++) {
+@@ -5673,7 +5673,7 @@ dma_error:
+ entry = NEXT_TX(entry);
+
+ pci_unmap_page(tp->pdev,
+- pci_unmap_addr(&tnapi->tx_buffers[entry],
++ dma_unmap_addr(&tnapi->tx_buffers[entry],
+ mapping),
+ frag->size, PCI_DMA_TODEVICE);
+ }
+@@ -5835,7 +5835,7 @@ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb,
+ }
+
+ tnapi->tx_buffers[entry].skb = skb;
+- pci_unmap_addr_set(&tnapi->tx_buffers[entry], mapping, mapping);
++ dma_unmap_addr_set(&tnapi->tx_buffers[entry], mapping, mapping);
+
+ would_hit_hwbug = 0;
+
+@@ -5871,7 +5871,7 @@ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb,
+ len, PCI_DMA_TODEVICE);
+
+ tnapi->tx_buffers[entry].skb = NULL;
+- pci_unmap_addr_set(&tnapi->tx_buffers[entry], mapping,
++ dma_unmap_addr_set(&tnapi->tx_buffers[entry], mapping,
+ mapping);
+ if (pci_dma_mapping_error(tp->pdev, mapping))
+ goto dma_error;
+@@ -5936,7 +5936,7 @@ dma_error:
+ entry = tnapi->tx_prod;
+ tnapi->tx_buffers[entry].skb = NULL;
+ pci_unmap_single(tp->pdev,
+- pci_unmap_addr(&tnapi->tx_buffers[entry], mapping),
++ dma_unmap_addr(&tnapi->tx_buffers[entry], mapping),
+ skb_headlen(skb),
+ PCI_DMA_TODEVICE);
+ for (i = 0; i <= last; i++) {
+@@ -5944,7 +5944,7 @@ dma_error:
+ entry = NEXT_TX(entry);
+
+ pci_unmap_page(tp->pdev,
+- pci_unmap_addr(&tnapi->tx_buffers[entry],
++ dma_unmap_addr(&tnapi->tx_buffers[entry],
+ mapping),
+ frag->size, PCI_DMA_TODEVICE);
+ }
+@@ -6229,7 +6229,7 @@ static void tg3_free_rings(struct tg3 *tp)
+ }
+
+ pci_unmap_single(tp->pdev,
+- pci_unmap_addr(txp, mapping),
++ dma_unmap_addr(txp, mapping),
+ skb_headlen(skb),
+ PCI_DMA_TODEVICE);
+ txp->skb = NULL;
+@@ -6239,7 +6239,7 @@ static void tg3_free_rings(struct tg3 *tp)
+ for (k = 0; k < skb_shinfo(skb)->nr_frags; k++) {
+ txp = &tnapi->tx_buffers[i & (TG3_TX_RING_SIZE - 1)];
+ pci_unmap_page(tp->pdev,
+- pci_unmap_addr(txp, mapping),
++ dma_unmap_addr(txp, mapping),
+ skb_shinfo(skb)->frags[k].size,
+ PCI_DMA_TODEVICE);
+ i++;
+@@ -10743,7 +10743,7 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode)
+
+ rx_skb = tpr->rx_std_buffers[desc_idx].skb;
+
+- map = pci_unmap_addr(&tpr->rx_std_buffers[desc_idx], mapping);
++ map = dma_unmap_addr(&tpr->rx_std_buffers[desc_idx], mapping);
+ pci_dma_sync_single_for_cpu(tp->pdev, map, rx_len, PCI_DMA_FROMDEVICE);
+
+ for (i = 14; i < tx_len; i++) {
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index b71083d..ce9c491 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -2512,7 +2512,7 @@ struct tg3_hw_stats {
+ */
+ struct ring_info {
+ struct sk_buff *skb;
+- DECLARE_PCI_UNMAP_ADDR(mapping)
++ DEFINE_DMA_UNMAP_ADDR(mapping);
+ };
+
+ struct tg3_config_info {
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0120-tg3-Enable-GRO-by-default.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0120-tg3-Enable-GRO-by-default.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,29 @@
+From: "David S. Miller" <davem at davemloft.net>
+Date: Tue, 20 Apr 2010 18:49:45 -0700
+Subject: [PATCH 120/207] tg3: Enable GRO by default.
+
+commit cb903bf4ee2d6e53210e2174d363e10698112042 upstream.
+
+This was merely an oversight when I added the *_gro_receive()
+calls.
+
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index bfbe11e..72bbdcb 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -12994,6 +12994,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ tp->dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG;
+ if (tp->tg3_flags3 & TG3_FLG3_5755_PLUS)
+ tp->dev->features |= NETIF_F_IPV6_CSUM;
++ tp->dev->features |= NETIF_F_GRO;
+ }
+
+ /* Determine TSO capabilities */
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0121-tg3-Relocate-APE-mutex-regs-for-5717.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0121-tg3-Relocate-APE-mutex-regs-for-5717.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,163 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Sat, 5 Jun 2010 17:24:30 +0000
+Subject: [PATCH 121/207] tg3: Relocate APE mutex regs for 5717+
+
+commit f92d9dc1504a964acfe07e8036fa30dcef22d343 upstream.
+
+The 5717 and later devices relocate the APE mutex registers. This patch
+organizes the code so that the driver can use the mutex registers in the
+old and new locations.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 44 ++++++++++++++++++++++++++++++++------------
+ drivers/net/tg3.h | 6 ++++++
+ 2 files changed, 38 insertions(+), 12 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 72bbdcb..5b289a5 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -585,18 +585,23 @@ static void tg3_read_mem(struct tg3 *tp, u32 off, u32 *val)
+ static void tg3_ape_lock_init(struct tg3 *tp)
+ {
+ int i;
++ u32 regbase;
++
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761)
++ regbase = TG3_APE_LOCK_GRANT;
++ else
++ regbase = TG3_APE_PER_LOCK_GRANT;
+
+ /* Make sure the driver hasn't any stale locks. */
+ for (i = 0; i < 8; i++)
+- tg3_ape_write32(tp, TG3_APE_LOCK_GRANT + 4 * i,
+- APE_LOCK_GRANT_DRIVER);
++ tg3_ape_write32(tp, regbase + 4 * i, APE_LOCK_GRANT_DRIVER);
+ }
+
+ static int tg3_ape_lock(struct tg3 *tp, int locknum)
+ {
+ int i, off;
+ int ret = 0;
+- u32 status;
++ u32 status, req, gnt;
+
+ if (!(tp->tg3_flags3 & TG3_FLG3_ENABLE_APE))
+ return 0;
+@@ -609,13 +614,21 @@ static int tg3_ape_lock(struct tg3 *tp, int locknum)
+ return -EINVAL;
+ }
+
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761) {
++ req = TG3_APE_LOCK_REQ;
++ gnt = TG3_APE_LOCK_GRANT;
++ } else {
++ req = TG3_APE_PER_LOCK_REQ;
++ gnt = TG3_APE_PER_LOCK_GRANT;
++ }
++
+ off = 4 * locknum;
+
+- tg3_ape_write32(tp, TG3_APE_LOCK_REQ + off, APE_LOCK_REQ_DRIVER);
++ tg3_ape_write32(tp, req + off, APE_LOCK_REQ_DRIVER);
+
+ /* Wait for up to 1 millisecond to acquire lock. */
+ for (i = 0; i < 100; i++) {
+- status = tg3_ape_read32(tp, TG3_APE_LOCK_GRANT + off);
++ status = tg3_ape_read32(tp, gnt + off);
+ if (status == APE_LOCK_GRANT_DRIVER)
+ break;
+ udelay(10);
+@@ -623,7 +636,7 @@ static int tg3_ape_lock(struct tg3 *tp, int locknum)
+
+ if (status != APE_LOCK_GRANT_DRIVER) {
+ /* Revoke the lock request. */
+- tg3_ape_write32(tp, TG3_APE_LOCK_GRANT + off,
++ tg3_ape_write32(tp, gnt + off,
+ APE_LOCK_GRANT_DRIVER);
+
+ ret = -EBUSY;
+@@ -634,7 +647,7 @@ static int tg3_ape_lock(struct tg3 *tp, int locknum)
+
+ static void tg3_ape_unlock(struct tg3 *tp, int locknum)
+ {
+- int off;
++ u32 gnt;
+
+ if (!(tp->tg3_flags3 & TG3_FLG3_ENABLE_APE))
+ return;
+@@ -647,8 +660,12 @@ static void tg3_ape_unlock(struct tg3 *tp, int locknum)
+ return;
+ }
+
+- off = 4 * locknum;
+- tg3_ape_write32(tp, TG3_APE_LOCK_GRANT + off, APE_LOCK_GRANT_DRIVER);
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761)
++ gnt = TG3_APE_LOCK_GRANT;
++ else
++ gnt = TG3_APE_PER_LOCK_GRANT;
++
++ tg3_ape_write32(tp, gnt + 4 * locknum, APE_LOCK_GRANT_DRIVER);
+ }
+
+ static void tg3_disable_ints(struct tg3 *tp)
+@@ -6782,7 +6799,8 @@ static void tg3_restore_pci_state(struct tg3 *tp)
+ /* Allow reads and writes to the APE register and memory space. */
+ if (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE)
+ val |= PCISTATE_ALLOW_APE_CTLSPC_WR |
+- PCISTATE_ALLOW_APE_SHMEM_WR;
++ PCISTATE_ALLOW_APE_SHMEM_WR |
++ PCISTATE_ALLOW_APE_PSPACE_WR;
+ pci_write_config_dword(tp->pdev, TG3PCI_PCISTATE, val);
+
+ pci_write_config_word(tp->pdev, PCI_COMMAND, tp->pci_cmd);
+@@ -7720,7 +7738,8 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ */
+ val = tr32(TG3PCI_PCISTATE);
+ val |= PCISTATE_ALLOW_APE_CTLSPC_WR |
+- PCISTATE_ALLOW_APE_SHMEM_WR;
++ PCISTATE_ALLOW_APE_SHMEM_WR |
++ PCISTATE_ALLOW_APE_PSPACE_WR;
+ tw32(TG3PCI_PCISTATE, val);
+ }
+
+@@ -13242,7 +13261,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ * APE register and memory space.
+ */
+ pci_state_reg |= PCISTATE_ALLOW_APE_CTLSPC_WR |
+- PCISTATE_ALLOW_APE_SHMEM_WR;
++ PCISTATE_ALLOW_APE_SHMEM_WR |
++ PCISTATE_ALLOW_APE_PSPACE_WR;
+ pci_write_config_dword(tp->pdev, TG3PCI_PCISTATE,
+ pci_state_reg);
+ }
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index ce9c491..84ea0dc 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -231,6 +231,7 @@
+ #define PCISTATE_RETRY_SAME_DMA 0x00002000
+ #define PCISTATE_ALLOW_APE_CTLSPC_WR 0x00010000
+ #define PCISTATE_ALLOW_APE_SHMEM_WR 0x00020000
++#define PCISTATE_ALLOW_APE_PSPACE_WR 0x00040000
+ #define TG3PCI_CLOCK_CTRL 0x00000074
+ #define CLOCK_CTRL_CORECLK_DISABLE 0x00000200
+ #define CLOCK_CTRL_RXCLK_DISABLE 0x00000400
+@@ -2209,6 +2210,11 @@
+ #define APE_EVENT_STATUS_STATE_SUSPEND 0x00040000
+ #define APE_EVENT_STATUS_EVENT_PENDING 0x80000000
+
++#define TG3_APE_PER_LOCK_REQ 0x8400
++#define APE_LOCK_PER_REQ_DRIVER 0x00001000
++#define TG3_APE_PER_LOCK_GRANT 0x8420
++#define APE_PER_LOCK_GRANT_DRIVER 0x00001000
++
+ /* APE convenience enumerations. */
+ #define TG3_APE_LOCK_GRC 1
+ #define TG3_APE_LOCK_MEM 4
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0122-tg3-Avoid-tx-lockups-on-5755-devices.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0122-tg3-Avoid-tx-lockups-on-5755-devices.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,46 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Sat, 5 Jun 2010 17:24:31 +0000
+Subject: [PATCH 122/207] tg3: Avoid tx lockups on 5755+ devices
+
+commit b1d0521059789a138d19c4f940d6eca7d620a6eb upstream.
+
+In certain edge conditions, internal tx resources can get corrupted.
+This patch enables a bit that will fix the problem.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 3 +++
+ drivers/net/tg3.h | 1 +
+ 2 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 5b289a5..f8c5d06 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -8214,6 +8214,9 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ }
+
+ tp->tx_mode = TX_MODE_ENABLE;
++ if ((tp->tg3_flags3 & TG3_FLG3_5755_PLUS) ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
++ tp->tx_mode |= TX_MODE_MBUF_LOCKUP_FIX;
+ tw32_f(MAC_TX_MODE, tp->tx_mode);
+ udelay(100);
+
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 84ea0dc..c245e80 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -469,6 +469,7 @@
+ #define TX_MODE_FLOW_CTRL_ENABLE 0x00000010
+ #define TX_MODE_BIG_BCKOFF_ENABLE 0x00000020
+ #define TX_MODE_LONG_PAUSE_ENABLE 0x00000040
++#define TX_MODE_MBUF_LOCKUP_FIX 0x00000100
+ #define MAC_TX_STATUS 0x00000460
+ #define TX_STATUS_XOFFED 0x00000001
+ #define TX_STATUS_SENT_XOFF 0x00000002
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0123-tg3-Fix-a-memory-leak-on-5717-devices.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0123-tg3-Fix-a-memory-leak-on-5717-devices.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,44 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Sat, 5 Jun 2010 17:24:32 +0000
+Subject: [PATCH 123/207] tg3: Fix a memory leak on 5717+ devices
+
+commit b28f6428af279ffb9e97ee00486a29498b7fcfdc upstream.
+
+The rx resources for MSI-X interrupt vector 0 were not being freed
+correctly. This happens because the teardown loop continue's to the
+next loop iteration if it detects the tx ring for that vector is not
+setup, thus bypassing the rx teardown code. This patch moves the
+call to tg3_rx_prodring_free() earlier in the loop.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index f8c5d06..fc7c890 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -6229,6 +6229,8 @@ static void tg3_free_rings(struct tg3 *tp)
+ for (j = 0; j < tp->irq_cnt; j++) {
+ struct tg3_napi *tnapi = &tp->napi[j];
+
++ tg3_rx_prodring_free(tp, &tp->prodring[j]);
++
+ if (!tnapi->tx_buffers)
+ continue;
+
+@@ -6264,8 +6266,6 @@ static void tg3_free_rings(struct tg3 *tp)
+
+ dev_kfree_skb_any(skb);
+ }
+-
+- tg3_rx_prodring_free(tp, &tp->prodring[j]);
+ }
+ }
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0124-tg3-Allow-single-MSI-X-vector-allocations.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0124-tg3-Allow-single-MSI-X-vector-allocations.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,72 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Sat, 5 Jun 2010 17:24:34 +0000
+Subject: [PATCH 124/207] tg3: Allow single MSI-X vector allocations
+
+commit 2430b031be8d3eb57f22f2df6fb3784564109db0 upstream.
+
+This patch changes the code to make it legal to allocate only one MSI-X
+vector. It also fixes a bug where the driver was not checking for error
+return codes from pci_enable_msix().
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 24 ++++++++++++------------
+ 1 files changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index fc7c890..8b549f6 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -145,8 +145,6 @@
+ #define TG3_RX_JMB_BUFF_RING_SIZE \
+ (sizeof(struct ring_info) * TG3_RX_JUMBO_RING_SIZE)
+
+-#define TG3_RSS_MIN_NUM_MSIX_VECS 2
+-
+ /* Due to a hardware bug, the 5701 can only DMA to memory addresses
+ * that are at least dword aligned when used in PCIX mode. The driver
+ * works around this bug by double copying the packet. This workaround
+@@ -8797,9 +8795,9 @@ static bool tg3_enable_msix(struct tg3 *tp)
+ }
+
+ rc = pci_enable_msix(tp->pdev, msix_ent, tp->irq_cnt);
+- if (rc != 0) {
+- if (rc < TG3_RSS_MIN_NUM_MSIX_VECS)
+- return false;
++ if (rc < 0) {
++ return false;
++ } else if (rc != 0) {
+ if (pci_enable_msix(tp->pdev, msix_ent, rc))
+ return false;
+ netdev_notice(tp->dev, "Requested %d MSI-X vectors, received %d\n",
+@@ -8807,16 +8805,18 @@ static bool tg3_enable_msix(struct tg3 *tp)
+ tp->irq_cnt = rc;
+ }
+
+- tp->tg3_flags3 |= TG3_FLG3_ENABLE_RSS;
+-
+ for (i = 0; i < tp->irq_max; i++)
+ tp->napi[i].irq_vec = msix_ent[i].vector;
+
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) {
+- tp->tg3_flags3 |= TG3_FLG3_ENABLE_TSS;
+- tp->dev->real_num_tx_queues = tp->irq_cnt - 1;
+- } else
+- tp->dev->real_num_tx_queues = 1;
++ tp->dev->real_num_tx_queues = 1;
++ if (tp->irq_cnt > 1) {
++ tp->tg3_flags3 |= TG3_FLG3_ENABLE_RSS;
++
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) {
++ tp->tg3_flags3 |= TG3_FLG3_ENABLE_TSS;
++ tp->dev->real_num_tx_queues = tp->irq_cnt - 1;
++ }
++ }
+
+ return true;
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0125-tg3-5717-Allow-serdes-link-via-parallel-detect.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0125-tg3-5717-Allow-serdes-link-via-parallel-detect.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,46 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Sat, 5 Jun 2010 17:24:35 +0000
+Subject: [PATCH 125/207] tg3: 5717: Allow serdes link via parallel detect
+
+commit 57d8b88030ca9f295bb72ef65228c6d86bed22f6 upstream.
+
+The 5717 serdes phy brings link up via parallel detection without any
+additional help from the driver. This patch changes the
+tg3_setup_fiber_mii_phy() function to detect and allow the use of this
+feature.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 6 +++++-
+ 1 files changed, 5 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 8b549f6..cd58c81 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -4206,6 +4206,8 @@ static int tg3_setup_fiber_mii_phy(struct tg3 *tp, int force_reset)
+ current_duplex = DUPLEX_FULL;
+ else
+ current_duplex = DUPLEX_HALF;
++ } else if (!(tp->tg3_flags2 & TG3_FLG2_5780_CLASS)) {
++ /* Link is up via parallel detect */
+ } else {
+ current_link_up = 0;
+ }
+@@ -8531,8 +8533,10 @@ static void tg3_timer(unsigned long __opaque)
+ }
+ tg3_setup_phy(tp, 0);
+ }
+- } else if (tp->tg3_flags2 & TG3_FLG2_MII_SERDES)
++ } else if ((tp->tg3_flags2 & TG3_FLG2_MII_SERDES) &&
++ !(tp->tg3_flags2 & TG3_FLG2_5780_CLASS)) {
+ tg3_serdes_parallel_detect(tp);
++ }
+
+ tp->timer_counter = tp->timer_multiplier;
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0126-tg3-Use-devfn-to-determine-function-number.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0126-tg3-Use-devfn-to-determine-function-number.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,66 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Sat, 5 Jun 2010 17:24:36 +0000
+Subject: [PATCH 126/207] tg3: Use devfn to determine function number
+
+commit 9c7df9157889a8f67d2d104fd52f2aacb3826fe7 upstream.
+
+The driver sometimes needs to know which function number the current
+device is. This patch changes the code to use devfn over internal
+register values.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 10 +++-------
+ drivers/net/tg3.h | 4 +---
+ 2 files changed, 4 insertions(+), 10 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index cd58c81..d4d6f8b 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -1085,13 +1085,9 @@ static int tg3_mdio_init(struct tg3 *tp)
+ struct phy_device *phydev;
+
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) {
+- u32 funcnum, is_serdes;
++ u32 is_serdes;
+
+- funcnum = tr32(TG3_CPMU_STATUS) & TG3_CPMU_STATUS_PCIE_FUNC;
+- if (funcnum)
+- tp->phy_addr = 2;
+- else
+- tp->phy_addr = 1;
++ tp->phy_addr = PCI_FUNC(tp->pdev->devfn) + 1;
+
+ if (tp->pci_chip_rev_id != CHIPREV_ID_5717_A0)
+ is_serdes = tr32(SG_DIG_STATUS) & SG_DIG_IS_SERDES;
+@@ -13608,7 +13604,7 @@ static int __devinit tg3_get_device_address(struct tg3 *tp)
+ else
+ tg3_nvram_unlock(tp);
+ } else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) {
+- if (tr32(TG3_CPMU_STATUS) & TG3_CPMU_STATUS_PCIE_FUNC)
++ if (PCI_FUNC(tp->pdev->devfn))
+ mac_offset = 0xcc;
+ } else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
+ mac_offset = 0x10;
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index c245e80..878cdee 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -1073,10 +1073,8 @@
+ #define TG3_CPMU_HST_ACC 0x0000361c
+ #define CPMU_HST_ACC_MACCLK_MASK 0x001f0000
+ #define CPMU_HST_ACC_MACCLK_6_25 0x00130000
+-/* 0x3620 --> 0x362c unused */
++/* 0x3620 --> 0x3630 unused */
+
+-#define TG3_CPMU_STATUS 0x0000362c
+-#define TG3_CPMU_STATUS_PCIE_FUNC 0x20000000
+ #define TG3_CPMU_CLCK_STAT 0x00003630
+ #define CPMU_CLCK_STAT_MAC_CLCK_MASK 0x001f0000
+ #define CPMU_CLCK_STAT_MAC_CLCK_62_5 0x00000000
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0127-tg3-Add-5719-ASIC-rev.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0127-tg3-Add-5719-ASIC-rev.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,337 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Sat, 5 Jun 2010 17:24:37 +0000
+Subject: [PATCH 127/207] tg3: Add 5719 ASIC rev
+
+commit a50d0796b09ad909a25fc75e54eec7f713edeba8 upstream.
+
+This patch adds the 5719 ASIC revision.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 68 +++++++++++++++++++++++++++++++++++++++--------------
+ drivers/net/tg3.h | 2 +
+ 2 files changed, 52 insertions(+), 18 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index d4d6f8b..a677dd4 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -1084,7 +1084,8 @@ static int tg3_mdio_init(struct tg3 *tp)
+ u32 reg;
+ struct phy_device *phydev;
+
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) {
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719) {
+ u32 is_serdes;
+
+ tp->phy_addr = PCI_FUNC(tp->pdev->devfn) + 1;
+@@ -1600,7 +1601,8 @@ static void tg3_phy_toggle_apd(struct tg3 *tp, bool enable)
+ u32 reg;
+
+ if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS) ||
+- (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 &&
++ ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719) &&
+ (tp->tg3_flags2 & TG3_FLG2_MII_SERDES)))
+ return;
+
+@@ -1975,7 +1977,8 @@ static int tg3_phy_reset(struct tg3 *tp)
+ }
+ }
+
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 &&
++ if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719) &&
+ (tp->tg3_flags2 & TG3_FLG2_MII_SERDES))
+ return 0;
+
+@@ -2060,6 +2063,7 @@ static void tg3_frob_aux_power(struct tg3 *tp)
+
+ /* The GPIOs do something completely different on 57765. */
+ if ((tp->tg3_flags2 & TG3_FLG2_IS_NIC) == 0 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
+ return;
+
+@@ -7083,6 +7087,7 @@ static int tg3_chip_reset(struct tg3 *tp)
+ tp->pci_chip_rev_id != CHIPREV_ID_5750_A0 &&
+ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5785 &&
+ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717 &&
++ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5719 &&
+ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_57765) {
+ val = tr32(0x7c00);
+
+@@ -7518,7 +7523,8 @@ static void tg3_rings_reset(struct tg3 *tp)
+
+
+ /* Disable all receive return rings but the first. */
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717)
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719)
+ limit = NIC_SRAM_RCV_RET_RCB + TG3_BDINFO_SIZE * 17;
+ else if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS))
+ limit = NIC_SRAM_RCV_RET_RCB + TG3_BDINFO_SIZE * 16;
+@@ -7756,6 +7762,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ return err;
+
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) {
+ val = tr32(TG3PCI_DMA_RW_CTRL) &
+ ~DMA_RWCTRL_DIS_CACHE_ALIGNMENT;
+@@ -7884,7 +7891,8 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ ((u64) tpr->rx_std_mapping >> 32));
+ tw32(RCVDBDI_STD_BD + TG3_BDINFO_HOST_ADDR + TG3_64BIT_REG_LOW,
+ ((u64) tpr->rx_std_mapping & 0xffffffff));
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717)
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717 &&
++ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5719)
+ tw32(RCVDBDI_STD_BD + TG3_BDINFO_NIC_ADDR,
+ NIC_SRAM_RX_BUFFER_DESC);
+
+@@ -7909,7 +7917,8 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ tw32(RCVDBDI_JUMBO_BD + TG3_BDINFO_MAXLEN_FLAGS,
+ (RX_JUMBO_MAX_SIZE << BDINFO_FLAGS_MAXLEN_SHIFT) |
+ BDINFO_FLAGS_USE_EXT_RECV);
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717)
++ if (!(tp->tg3_flags3 & TG3_FLG3_USE_JUMBO_BDFLAG) ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
+ tw32(RCVDBDI_JUMBO_BD + TG3_BDINFO_NIC_ADDR,
+ NIC_SRAM_RX_JUMBO_BUFFER_DESC);
+ } else {
+@@ -7918,6 +7927,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ }
+
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
+ val = (RX_STD_MAX_SIZE_5705 << BDINFO_FLAGS_MAXLEN_SHIFT) |
+ (TG3_RX_STD_DMA_SZ << 2);
+@@ -7936,6 +7946,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ tw32_rx_mbox(TG3_RX_JMB_PROD_IDX_REG, tpr->rx_jmb_prod_idx);
+
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) {
+ tw32(STD_REPLENISH_LWM, 32);
+ tw32(JMB_REPLENISH_LWM, 16);
+@@ -7971,7 +7982,8 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ RDMAC_MODE_FIFOURUN_ENAB | RDMAC_MODE_FIFOOREAD_ENAB |
+ RDMAC_MODE_LNGREAD_ENAB);
+
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717)
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719)
+ rdmac_mode |= RDMAC_MODE_MULT_DMA_RD_DIS;
+
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 ||
+@@ -8626,6 +8638,7 @@ static int tg3_test_interrupt(struct tg3 *tp)
+ * observable way to know whether the interrupt was delivered.
+ */
+ if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) &&
+ (tp->tg3_flags2 & TG3_FLG2_USING_MSI)) {
+ val = tr32(MSGINT_MODE) | MSGINT_MODE_ONE_SHOT_DISABLE;
+@@ -8670,6 +8683,7 @@ static int tg3_test_interrupt(struct tg3 *tp)
+ if (intr_ok) {
+ /* Reenable MSI one shot mode. */
+ if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) &&
+ (tp->tg3_flags2 & TG3_FLG2_USING_MSI)) {
+ val = tr32(MSGINT_MODE) & ~MSGINT_MODE_ONE_SHOT_DISABLE;
+@@ -8812,7 +8826,8 @@ static bool tg3_enable_msix(struct tg3 *tp)
+ if (tp->irq_cnt > 1) {
+ tp->tg3_flags3 |= TG3_FLG3_ENABLE_RSS;
+
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) {
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719) {
+ tp->tg3_flags3 |= TG3_FLG3_ENABLE_TSS;
+ tp->dev->real_num_tx_queues = tp->irq_cnt - 1;
+ }
+@@ -8965,6 +8980,7 @@ static int tg3_open(struct net_device *dev)
+ }
+
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717 &&
++ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5719 &&
+ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_57765 &&
+ (tp->tg3_flags2 & TG3_FLG2_USING_MSI) &&
+ (tp->tg3_flags2 & TG3_FLG2_1SHOT_MSI)) {
+@@ -10576,7 +10592,8 @@ static int tg3_test_memory(struct tg3 *tp)
+ int err = 0;
+ int i;
+
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717)
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719)
+ mem_tbl = mem_tbl_5717;
+ else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
+ mem_tbl = mem_tbl_57765;
+@@ -11656,7 +11673,8 @@ static void __devinit tg3_nvram_init(struct tg3 *tp)
+ else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
+ tg3_get_57780_nvram_info(tp);
+- else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717)
++ else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719)
+ tg3_get_5717_nvram_info(tp);
+ else
+ tg3_get_nvram_info(tp);
+@@ -12092,11 +12110,10 @@ static void __devinit tg3_get_eeprom_hw_cfg(struct tg3 *tp)
+
+ tp->phy_id = eeprom_phy_id;
+ if (eeprom_phy_serdes) {
+- if ((tp->tg3_flags2 & TG3_FLG2_5780_CLASS) ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717)
+- tp->tg3_flags2 |= TG3_FLG2_MII_SERDES;
+- else
++ if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS))
+ tp->tg3_flags2 |= TG3_FLG2_PHY_SERDES;
++ else
++ tp->tg3_flags2 |= TG3_FLG2_MII_SERDES;
+ }
+
+ if (tp->tg3_flags2 & TG3_FLG2_5750_PLUS)
+@@ -12826,7 +12843,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+
+ if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_5717 ||
+ tp->pdev->device == TG3PCI_DEVICE_TIGON3_5718 ||
+- tp->pdev->device == TG3PCI_DEVICE_TIGON3_5724)
++ tp->pdev->device == TG3PCI_DEVICE_TIGON3_5724 ||
++ tp->pdev->device == TG3PCI_DEVICE_TIGON3_5719)
+ pci_read_config_dword(tp->pdev,
+ TG3PCI_GEN2_PRODID_ASICREV,
+ &prod_id_asic_rev);
+@@ -12992,6 +13010,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
+ tp->tg3_flags3 |= TG3_FLG3_5755_PLUS;
+
+@@ -13021,6 +13040,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+
+ /* Determine TSO capabilities */
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
+ tp->tg3_flags2 |= TG3_FLG2_HW_TSO_3;
+ else if ((tp->tg3_flags3 & TG3_FLG3_5755_PLUS) ||
+@@ -13058,6 +13078,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ }
+
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) {
+ tp->tg3_flags |= TG3_FLAG_SUPPORT_MSIX;
+ tp->irq_max = TG3_IRQ_MAX_VECS;
+@@ -13065,6 +13086,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ }
+
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
+ tp->tg3_flags3 |= TG3_FLG3_SHORT_DMA_BUG;
+ else if (!(tp->tg3_flags3 & TG3_FLG3_5755_PLUS)) {
+@@ -13073,6 +13095,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ }
+
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
+ tp->tg3_flags3 |= TG3_FLG3_USE_JUMBO_BDFLAG;
+
+@@ -13275,6 +13298,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
+ tp->tg3_flags |= TG3_FLAG_CPMU_PRESENT;
+
+@@ -13355,6 +13379,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5785 &&
+ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_57780 &&
+ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717 &&
++ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5719 &&
+ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_57765) {
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787 ||
+@@ -13603,9 +13628,12 @@ static int __devinit tg3_get_device_address(struct tg3 *tp)
+ tw32_f(NVRAM_CMD, NVRAM_CMD_RESET);
+ else
+ tg3_nvram_unlock(tp);
+- } else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) {
+- if (PCI_FUNC(tp->pdev->devfn))
++ } else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719) {
++ if (PCI_FUNC(tp->pdev->devfn) & 1)
+ mac_offset = 0xcc;
++ if (PCI_FUNC(tp->pdev->devfn) > 1)
++ mac_offset += 0x18c;
+ } else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
+ mac_offset = 0x10;
+
+@@ -13691,6 +13719,7 @@ static u32 __devinit tg3_calc_dma_bndry(struct tg3 *tp, u32 val)
+ #endif
+
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) {
+ val = goal ? 0 : DMA_RWCTRL_DIS_CACHE_ALIGNMENT;
+ goto out;
+@@ -13903,6 +13932,7 @@ static int __devinit tg3_test_dma(struct tg3 *tp)
+ tp->dma_rwctrl = tg3_calc_dma_bndry(tp, tp->dma_rwctrl);
+
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
+ goto out;
+
+@@ -14102,6 +14132,7 @@ static void __devinit tg3_init_link_config(struct tg3 *tp)
+ static void __devinit tg3_init_bufmgr_config(struct tg3 *tp)
+ {
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) {
+ tp->bufmgr_config.mbuf_read_dma_low_water =
+ DEFAULT_MB_RDMA_LOW_WATER_5705;
+@@ -14427,7 +14458,8 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
+ }
+
+ if ((tp->tg3_flags3 & TG3_FLG3_5755_PLUS) &&
+- tp->pci_chip_rev_id != CHIPREV_ID_5717_A0)
++ tp->pci_chip_rev_id != CHIPREV_ID_5717_A0 &&
++ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5719)
+ dev->netdev_ops = &tg3_netdev_ops;
+ else
+ dev->netdev_ops = &tg3_netdev_ops_dma_bug;
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 878cdee..74e5bc2 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -53,6 +53,7 @@
+ #define TG3PCI_DEVICE_TIGON3_57765 0x16b4
+ #define TG3PCI_DEVICE_TIGON3_57791 0x16b2
+ #define TG3PCI_DEVICE_TIGON3_57795 0x16b6
++#define TG3PCI_DEVICE_TIGON3_5719 0x1657
+ /* 0x04 --> 0x2c unused */
+ #define TG3PCI_SUBVENDOR_ID_BROADCOM PCI_VENDOR_ID_BROADCOM
+ #define TG3PCI_SUBDEVICE_ID_BROADCOM_95700A6 0x1644
+@@ -160,6 +161,7 @@
+ #define ASIC_REV_57780 0x57780
+ #define ASIC_REV_5717 0x5717
+ #define ASIC_REV_57765 0x57785
++#define ASIC_REV_5719 0x5719
+ #define GET_CHIP_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 8)
+ #define CHIPREV_5700_AX 0x70
+ #define CHIPREV_5700_BX 0x71
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0128-tg3-Add-5719-PCI-device-and-phy-IDs.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0128-tg3-Add-5719-PCI-device-and-phy-IDs.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,61 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Sat, 5 Jun 2010 17:24:38 +0000
+Subject: [PATCH 128/207] tg3: Add 5719 PCI device and phy IDs
+
+commit 302b500b27dda8e07b3cb967ff588de84ee87ba4 upstream.
+
+This patch adds the 5719 PCI device and phy IDs.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 2 ++
+ drivers/net/tg3.h | 4 +++-
+ 2 files changed, 5 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index a677dd4..b506725 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -270,6 +270,7 @@ static DEFINE_PCI_DEVICE_TABLE(tg3_pci_tbl) = {
+ {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_57765)},
+ {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_57791)},
+ {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_57795)},
++ {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_5719)},
+ {PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_9DXX)},
+ {PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_9MXX)},
+ {PCI_DEVICE(PCI_VENDOR_ID_ALTIMA, PCI_DEVICE_ID_ALTIMA_AC1000)},
+@@ -14210,6 +14211,7 @@ static char * __devinit tg3_phy_string(struct tg3 *tp)
+ case TG3_PHY_ID_BCM5718C: return "5718C";
+ case TG3_PHY_ID_BCM5718S: return "5718S";
+ case TG3_PHY_ID_BCM57765: return "57765";
++ case TG3_PHY_ID_BCM5719C: return "5719C";
+ case TG3_PHY_ID_BCM8002: return "8002/serdes";
+ case 0: return "serdes";
+ default: return "unknown";
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 74e5bc2..6b6af76 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -2949,6 +2949,7 @@ struct tg3 {
+ #define TG3_PHY_ID_BCM5718C 0x5c0d8a00
+ #define TG3_PHY_ID_BCM5718S 0xbc050ff0
+ #define TG3_PHY_ID_BCM57765 0x5c0d8a40
++#define TG3_PHY_ID_BCM5719C 0x5c0d8a20
+ #define TG3_PHY_ID_BCM5906 0xdc00ac40
+ #define TG3_PHY_ID_BCM8002 0x60010140
+ #define TG3_PHY_ID_INVALID 0xffffffff
+@@ -2972,7 +2973,8 @@ struct tg3 {
+ (X) == TG3_PHY_ID_BCM5755 || (X) == TG3_PHY_ID_BCM5756 || \
+ (X) == TG3_PHY_ID_BCM5906 || (X) == TG3_PHY_ID_BCM5761 || \
+ (X) == TG3_PHY_ID_BCM5718C || (X) == TG3_PHY_ID_BCM5718S || \
+- (X) == TG3_PHY_ID_BCM57765 || (X) == TG3_PHY_ID_BCM8002)
++ (X) == TG3_PHY_ID_BCM57765 || (X) == TG3_PHY_ID_BCM5719C || \
++ (X) == TG3_PHY_ID_BCM8002)
+
+ u32 led_ctrl;
+ u32 phy_otp;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0129-tg3-Update-version-to-3.111.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0129-tg3-Update-version-to-3.111.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,33 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Sat, 5 Jun 2010 17:24:39 +0000
+Subject: [PATCH 129/207] tg3: Update version to 3.111
+
+commit 83038a2a7062f6cbbdcfaff47284566f060a5af1 upstream.
+
+This patch updates the tg3 version to 3.111.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index b506725..84994fc 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -67,8 +67,8 @@
+ #include "tg3.h"
+
+ #define DRV_MODULE_NAME "tg3"
+-#define DRV_MODULE_VERSION "3.110"
+-#define DRV_MODULE_RELDATE "April 9, 2010"
++#define DRV_MODULE_VERSION "3.111"
++#define DRV_MODULE_RELDATE "June 5, 2010"
+
+ #define TG3_DEF_MAC_MODE 0
+ #define TG3_DEF_RX_MODE 0
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0130-broadcom-move-all-PHY_ID-s-to-header.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0130-broadcom-move-all-PHY_ID-s-to-header.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,118 @@
+From: Dmitry Baryshkov <dbaryshkov at gmail.com>
+Date: Wed, 16 Jun 2010 23:02:23 +0000
+Subject: [PATCH 130/207] broadcom: move all PHY_ID's to header
+
+commit fcb26ec5b18d88bb22366799d056dc3630d0e895 upstream.
+
+Move all PHY IDs to brcmphy.h header for completeness and unification of code.
+
+Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov at gmail.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Also do this for PHY_ID_BCMAC131]
+---
+ drivers/net/phy/broadcom.c | 26 +++++++++++++-------------
+ include/linux/brcmphy.h | 6 ++++++
+ 2 files changed, 19 insertions(+), 13 deletions(-)
+
+diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c
+index d456a65..b743d37 100644
+--- a/drivers/net/phy/broadcom.c
++++ b/drivers/net/phy/broadcom.c
+@@ -685,7 +685,7 @@ static int brcm_fet_config_intr(struct phy_device *phydev)
+ }
+
+ static struct phy_driver bcm5411_driver = {
+- .phy_id = 0x00206070,
++ .phy_id = PHY_ID_BCM5411,
+ .phy_id_mask = 0xfffffff0,
+ .name = "Broadcom BCM5411",
+ .features = PHY_GBIT_FEATURES |
+@@ -700,7 +700,7 @@ static struct phy_driver bcm5411_driver = {
+ };
+
+ static struct phy_driver bcm5421_driver = {
+- .phy_id = 0x002060e0,
++ .phy_id = PHY_ID_BCM5421,
+ .phy_id_mask = 0xfffffff0,
+ .name = "Broadcom BCM5421",
+ .features = PHY_GBIT_FEATURES |
+@@ -715,7 +715,7 @@ static struct phy_driver bcm5421_driver = {
+ };
+
+ static struct phy_driver bcm5461_driver = {
+- .phy_id = 0x002060c0,
++ .phy_id = PHY_ID_BCM5461,
+ .phy_id_mask = 0xfffffff0,
+ .name = "Broadcom BCM5461",
+ .features = PHY_GBIT_FEATURES |
+@@ -730,7 +730,7 @@ static struct phy_driver bcm5461_driver = {
+ };
+
+ static struct phy_driver bcm5464_driver = {
+- .phy_id = 0x002060b0,
++ .phy_id = PHY_ID_BCM5464,
+ .phy_id_mask = 0xfffffff0,
+ .name = "Broadcom BCM5464",
+ .features = PHY_GBIT_FEATURES |
+@@ -745,7 +745,7 @@ static struct phy_driver bcm5464_driver = {
+ };
+
+ static struct phy_driver bcm5481_driver = {
+- .phy_id = 0x0143bca0,
++ .phy_id = PHY_ID_BCM5481,
+ .phy_id_mask = 0xfffffff0,
+ .name = "Broadcom BCM5481",
+ .features = PHY_GBIT_FEATURES |
+@@ -760,7 +760,7 @@ static struct phy_driver bcm5481_driver = {
+ };
+
+ static struct phy_driver bcm5482_driver = {
+- .phy_id = 0x0143bcb0,
++ .phy_id = PHY_ID_BCM5482,
+ .phy_id_mask = 0xfffffff0,
+ .name = "Broadcom BCM5482",
+ .features = PHY_GBIT_FEATURES |
+@@ -910,16 +910,16 @@ module_init(broadcom_init);
+ module_exit(broadcom_exit);
+
+ static struct mdio_device_id broadcom_tbl[] = {
+- { 0x00206070, 0xfffffff0 },
+- { 0x002060e0, 0xfffffff0 },
+- { 0x002060c0, 0xfffffff0 },
+- { 0x002060b0, 0xfffffff0 },
+- { 0x0143bca0, 0xfffffff0 },
+- { 0x0143bcb0, 0xfffffff0 },
++ { PHY_ID_BCM5411, 0xfffffff0 },
++ { PHY_ID_BCM5421, 0xfffffff0 },
++ { PHY_ID_BCM5461, 0xfffffff0 },
++ { PHY_ID_BCM5464, 0xfffffff0 },
++ { PHY_ID_BCM5482, 0xfffffff0 },
++ { PHY_ID_BCM5482, 0xfffffff0 },
+ { PHY_ID_BCM50610, 0xfffffff0 },
+ { PHY_ID_BCM50610M, 0xfffffff0 },
+ { PHY_ID_BCM57780, 0xfffffff0 },
+- { 0x0143bc70, 0xfffffff0 },
++ { PHY_ID_BCMAC131, 0xfffffff0 },
+ { }
+ };
+
+diff --git a/include/linux/brcmphy.h b/include/linux/brcmphy.h
+index 7f437ca..c14c3a1 100644
+--- a/include/linux/brcmphy.h
++++ b/include/linux/brcmphy.h
+@@ -1,6 +1,12 @@
+ #define PHY_ID_BCM50610 0x0143bd60
+ #define PHY_ID_BCM50610M 0x0143bd70
+ #define PHY_ID_BCMAC131 0x0143bc70
++#define PHY_ID_BCM5481 0x0143bca0
++#define PHY_ID_BCM5482 0x0143bcb0
++#define PHY_ID_BCM5411 0x00206070
++#define PHY_ID_BCM5421 0x002060e0
++#define PHY_ID_BCM5464 0x002060b0
++#define PHY_ID_BCM5461 0x002060c0
+ #define PHY_ID_BCM57780 0x03625d90
+
+ #define PHY_BCM_OUI_MASK 0xfffffc00
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0131-broadcom-Add-5241-support.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0131-broadcom-Add-5241-support.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,85 @@
+From: Dmitry Baryshkov <dbaryshkov at gmail.com>
+Date: Wed, 16 Jun 2010 23:02:24 +0000
+Subject: [PATCH 131/207] broadcom: Add 5241 support
+
+commit 7a938f80264f2cbfb0c0841b450eab42a8093281 upstream.
+
+This patch adds the 5241 PHY ID to the broadcom module.
+
+Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov at gmail.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/phy/broadcom.c | 22 ++++++++++++++++++++++
+ include/linux/brcmphy.h | 1 +
+ 2 files changed, 23 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c
+index b743d37..4accd83 100644
+--- a/drivers/net/phy/broadcom.c
++++ b/drivers/net/phy/broadcom.c
+@@ -834,6 +834,21 @@ static struct phy_driver bcmac131_driver = {
+ .driver = { .owner = THIS_MODULE },
+ };
+
++static struct phy_driver bcm5241_driver = {
++ .phy_id = PHY_ID_BCM5241,
++ .phy_id_mask = 0xfffffff0,
++ .name = "Broadcom BCM5241",
++ .features = PHY_BASIC_FEATURES |
++ SUPPORTED_Pause | SUPPORTED_Asym_Pause,
++ .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
++ .config_init = brcm_fet_config_init,
++ .config_aneg = genphy_config_aneg,
++ .read_status = genphy_read_status,
++ .ack_interrupt = brcm_fet_ack_interrupt,
++ .config_intr = brcm_fet_config_intr,
++ .driver = { .owner = THIS_MODULE },
++};
++
+ static int __init broadcom_init(void)
+ {
+ int ret;
+@@ -868,8 +883,13 @@ static int __init broadcom_init(void)
+ ret = phy_driver_register(&bcmac131_driver);
+ if (ret)
+ goto out_ac131;
++ ret = phy_driver_register(&bcm5241_driver);
++ if (ret)
++ goto out_5241;
+ return ret;
+
++out_5241:
++ phy_driver_unregister(&bcmac131_driver);
+ out_ac131:
+ phy_driver_unregister(&bcm57780_driver);
+ out_57780:
+@@ -894,6 +914,7 @@ out_5411:
+
+ static void __exit broadcom_exit(void)
+ {
++ phy_driver_unregister(&bcm5241_driver);
+ phy_driver_unregister(&bcmac131_driver);
+ phy_driver_unregister(&bcm57780_driver);
+ phy_driver_unregister(&bcm50610m_driver);
+@@ -920,6 +941,7 @@ static struct mdio_device_id broadcom_tbl[] = {
+ { PHY_ID_BCM50610M, 0xfffffff0 },
+ { PHY_ID_BCM57780, 0xfffffff0 },
+ { PHY_ID_BCMAC131, 0xfffffff0 },
++ { PHY_ID_BCM5241, 0xfffffff0 },
+ { }
+ };
+
+diff --git a/include/linux/brcmphy.h b/include/linux/brcmphy.h
+index c14c3a1..b840a49 100644
+--- a/include/linux/brcmphy.h
++++ b/include/linux/brcmphy.h
+@@ -1,5 +1,6 @@
+ #define PHY_ID_BCM50610 0x0143bd60
+ #define PHY_ID_BCM50610M 0x0143bd70
++#define PHY_ID_BCM5241 0x0143bc30
+ #define PHY_ID_BCMAC131 0x0143bc70
+ #define PHY_ID_BCM5481 0x0143bca0
+ #define PHY_ID_BCM5482 0x0143bcb0
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0132-tg3-allow-TSO-on-vlan-devices.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0132-tg3-allow-TSO-on-vlan-devices.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,87 @@
+From: Eric Dumazet <eric.dumazet at gmail.com>
+Date: Thu, 8 Jul 2010 06:14:55 +0000
+Subject: [PATCH 132/207] tg3: allow TSO on vlan devices
+
+commit 7fe876af921d1d2bc8353e0062c10ff35e902653 upstream.
+
+Similar to commit 72dccb01e8632aa (bnx2: Update vlan_features)
+
+In order to enable TSO on vlan devices, tg3 needs to update
+dev->vlan_features.
+
+Tested on HP NC326m (aka BCM5715S (rev a3))
+
+Signed-off-by: Eric Dumazet <eric.dumazet at gmail.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 28 +++++++++++++++++++++-------
+ 1 files changed, 21 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 84994fc..7ea2054 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -12800,6 +12800,13 @@ done:
+
+ static struct pci_dev * __devinit tg3_find_peer(struct tg3 *);
+
++static void inline vlan_features_add(struct net_device *dev, unsigned long flags)
++{
++#if TG3_VLAN_TAG_USED
++ dev->vlan_features |= flags;
++#endif
++}
++
+ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ {
+ static struct pci_device_id write_reorder_chipsets[] = {
+@@ -13032,11 +13039,13 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ if (tp->pci_chip_rev_id == CHIPREV_ID_5700_B0)
+ tp->tg3_flags |= TG3_FLAG_BROKEN_CHECKSUMS;
+ else {
++ unsigned long features = NETIF_F_IP_CSUM | NETIF_F_SG | NETIF_F_GRO;
++
+ tp->tg3_flags |= TG3_FLAG_RX_CHECKSUMS;
+- tp->dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG;
+ if (tp->tg3_flags3 & TG3_FLG3_5755_PLUS)
+- tp->dev->features |= NETIF_F_IPV6_CSUM;
+- tp->dev->features |= NETIF_F_GRO;
++ features |= NETIF_F_IPV6_CSUM;
++ tp->dev->features |= features;
++ vlan_features_add(tp->dev, features);
+ }
+
+ /* Determine TSO capabilities */
+@@ -14525,20 +14534,25 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
+ * is off by default, but can be enabled using ethtool.
+ */
+ if ((tp->tg3_flags2 & TG3_FLG2_HW_TSO) &&
+- (dev->features & NETIF_F_IP_CSUM))
++ (dev->features & NETIF_F_IP_CSUM)) {
+ dev->features |= NETIF_F_TSO;
+-
++ vlan_features_add(dev, NETIF_F_TSO);
++ }
+ if ((tp->tg3_flags2 & TG3_FLG2_HW_TSO_2) ||
+ (tp->tg3_flags2 & TG3_FLG2_HW_TSO_3)) {
+- if (dev->features & NETIF_F_IPV6_CSUM)
++ if (dev->features & NETIF_F_IPV6_CSUM) {
+ dev->features |= NETIF_F_TSO6;
++ vlan_features_add(dev, NETIF_F_TSO6);
++ }
+ if ((tp->tg3_flags2 & TG3_FLG2_HW_TSO_3) ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 ||
+ (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 &&
+ GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5784_AX) ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780)
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780) {
+ dev->features |= NETIF_F_TSO_ECN;
++ vlan_features_add(dev, NETIF_F_TSO_ECN);
++ }
+ }
+
+ if (tp->pci_chip_rev_id == CHIPREV_ID_5705_A1 &&
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0133-tg3-Fix-single-MSI-X-vector-coalescing.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0133-tg3-Fix-single-MSI-X-vector-coalescing.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,34 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Sun, 11 Jul 2010 09:31:41 +0000
+Subject: [PATCH 133/207] tg3: Fix single MSI-X vector coalescing
+
+commit 20d7375c1fdf054ca8ab9e5b9fe7fe62b39fa218 upstream.
+
+The interrupt coalescing setup code used the TG3_FLG2_USING_MSIX flag to
+determine whether or not to configure the rx coalescing parameters.
+This is incorrect for the single MSI-X vector case. This patch changes
+the code to look at the TG3_FLG3_ENABLE_RSS instead.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 7ea2054..bb3206f 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -7447,7 +7447,7 @@ static void __tg3_set_coalesce(struct tg3 *tp, struct ethtool_coalesce *ec)
+ tw32(HOSTCC_TXCOAL_MAXF_INT, 0);
+ }
+
+- if (!(tp->tg3_flags2 & TG3_FLG2_USING_MSIX)) {
++ if (!(tp->tg3_flags3 & TG3_FLG3_ENABLE_RSS)) {
+ tw32(HOSTCC_RXCOL_TICKS, ec->rx_coalesce_usecs);
+ tw32(HOSTCC_RXMAX_FRAMES, ec->rx_max_coalesced_frames);
+ tw32(HOSTCC_RXCOAL_MAXF_INT, ec->rx_max_coalesced_frames_irq);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0134-tg3-Fix-IPv6-TSO-code-in-tg3_start_xmit_dma_bug.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0134-tg3-Fix-IPv6-TSO-code-in-tg3_start_xmit_dma_bug.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,65 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Sun, 11 Jul 2010 09:31:42 +0000
+Subject: [PATCH 134/207] tg3: Fix IPv6 TSO code in tg3_start_xmit_dma_bug()
+
+commit 34195c3dce84fd0ee47f4131584ff1f6f283b93c upstream.
+
+The tg3_start_xmit_dma_bug() function was missing code to process IPv6
+TSO packets. This patch adds the missing support.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 20 ++++++++++++++------
+ 1 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index bb3206f..a35aa9b 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -5779,7 +5779,7 @@ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb,
+
+ if ((mss = skb_shinfo(skb)->gso_size) != 0) {
+ struct iphdr *iph;
+- u32 tcp_opt_len, ip_tcp_len, hdr_len;
++ u32 tcp_opt_len, hdr_len;
+
+ if (skb_header_cloned(skb) &&
+ pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) {
+@@ -5787,10 +5787,21 @@ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb,
+ goto out_unlock;
+ }
+
++ iph = ip_hdr(skb);
+ tcp_opt_len = tcp_optlen(skb);
+- ip_tcp_len = ip_hdrlen(skb) + sizeof(struct tcphdr);
+
+- hdr_len = ip_tcp_len + tcp_opt_len;
++ if (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6) {
++ hdr_len = skb_headlen(skb) - ETH_HLEN;
++ } else {
++ u32 ip_tcp_len;
++
++ ip_tcp_len = ip_hdrlen(skb) + sizeof(struct tcphdr);
++ hdr_len = ip_tcp_len + tcp_opt_len;
++
++ iph->check = 0;
++ iph->tot_len = htons(mss + hdr_len);
++ }
++
+ if (unlikely((ETH_HLEN + hdr_len) > 80) &&
+ (tp->tg3_flags2 & TG3_FLG2_TSO_BUG))
+ return tg3_tso_bug(tp, skb);
+@@ -5798,9 +5809,6 @@ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb,
+ base_flags |= (TXD_FLAG_CPU_PRE_DMA |
+ TXD_FLAG_CPU_POST_DMA);
+
+- iph = ip_hdr(skb);
+- iph->check = 0;
+- iph->tot_len = htons(mss + hdr_len);
+ if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) {
+ tcp_hdr(skb)->check = 0;
+ base_flags &= ~TXD_FLAG_TCPUDP_CSUM;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0135-tg3-Relax-5717-serdes-restriction.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0135-tg3-Relax-5717-serdes-restriction.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,44 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Sun, 11 Jul 2010 09:31:43 +0000
+Subject: [PATCH 135/207] tg3: Relax 5717 serdes restriction
+
+commit 2138c002173abe3e439e213e5cc03b385b20508c upstream.
+
+tg3 is coded to refuse to attach to 5717 serdes devices. Now that the
+hardware is better supported, we can relax this restriction. This patch
+also fixes a recently introduced bug which will cause serdes parallel
+detection not to work with 5780 class devices.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 5 ++---
+ 1 files changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index a35aa9b..4f14c80 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -8551,7 +8551,7 @@ static void tg3_timer(unsigned long __opaque)
+ tg3_setup_phy(tp, 0);
+ }
+ } else if ((tp->tg3_flags2 & TG3_FLG2_MII_SERDES) &&
+- !(tp->tg3_flags2 & TG3_FLG2_5780_CLASS)) {
++ (tp->tg3_flags2 & TG3_FLG2_5780_CLASS)) {
+ tg3_serdes_parallel_detect(tp);
+ }
+
+@@ -13438,8 +13438,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ return err;
+
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 &&
+- (tp->pci_chip_rev_id != CHIPREV_ID_5717_A0 ||
+- (tp->tg3_flags2 & TG3_FLG2_MII_SERDES)))
++ tp->pci_chip_rev_id != CHIPREV_ID_5717_A0)
+ return -ENOTSUPP;
+
+ /* Initialize data/descriptor byte/word swapping. */
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0136-tg3-Report-driver-version-to-firmware.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0136-tg3-Report-driver-version-to-firmware.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,68 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Sun, 11 Jul 2010 09:31:44 +0000
+Subject: [PATCH 136/207] tg3: Report driver version to firmware
+
+commit 6867c843813a801d5f568b6fb006695316714f1b upstream.
+
+This patch changes the code so that the driver version can be reported
+to the firmware in addition to the current use.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 8 ++++++--
+ drivers/net/tg3.h | 4 +++-
+ 2 files changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 4f14c80..8b58c0c 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -18,6 +18,7 @@
+
+ #include <linux/module.h>
+ #include <linux/moduleparam.h>
++#include <linux/stringify.h>
+ #include <linux/kernel.h>
+ #include <linux/types.h>
+ #include <linux/compiler.h>
+@@ -67,7 +68,10 @@
+ #include "tg3.h"
+
+ #define DRV_MODULE_NAME "tg3"
+-#define DRV_MODULE_VERSION "3.111"
++#define TG3_MAJ_NUM 3
++#define TG3_MIN_NUM 111
++#define DRV_MODULE_VERSION \
++ __stringify(TG3_MAJ_NUM) "." __stringify(TG3_MIN_NUM)
+ #define DRV_MODULE_RELDATE "June 5, 2010"
+
+ #define TG3_DEF_MAC_MODE 0
+@@ -6629,7 +6633,7 @@ static void tg3_ape_driver_state_change(struct tg3 *tp, int kind)
+ apedata = tg3_ape_read32(tp, TG3_APE_HOST_INIT_COUNT);
+ tg3_ape_write32(tp, TG3_APE_HOST_INIT_COUNT, ++apedata);
+ tg3_ape_write32(tp, TG3_APE_HOST_DRIVER_ID,
+- APE_HOST_DRIVER_ID_MAGIC);
++ APE_HOST_DRIVER_ID_MAGIC(TG3_MAJ_NUM, TG3_MIN_NUM));
+ tg3_ape_write32(tp, TG3_APE_HOST_BEHAVIOR,
+ APE_HOST_BEHAV_NO_PHYLOCK);
+
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 6b6af76..6b439dc 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -2193,7 +2193,9 @@
+ #define APE_HOST_SEG_LEN_MAGIC 0x0000001c
+ #define TG3_APE_HOST_INIT_COUNT 0x4208
+ #define TG3_APE_HOST_DRIVER_ID 0x420c
+-#define APE_HOST_DRIVER_ID_MAGIC 0xf0035100
++#define APE_HOST_DRIVER_ID_LINUX 0xf0000000
++#define APE_HOST_DRIVER_ID_MAGIC(maj, min) \
++ (APE_HOST_DRIVER_ID_LINUX | (maj & 0xff) << 16 | (min & 0xff) << 8)
+ #define TG3_APE_HOST_BEHAVIOR 0x4210
+ #define APE_HOST_BEHAV_NO_PHYLOCK 0x00000001
+ #define TG3_APE_HOST_HEARTBEAT_INT_MS 0x4214
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0137-tg3-Revert-PCIe-tx-glitch-fix.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0137-tg3-Revert-PCIe-tx-glitch-fix.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,94 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Sun, 11 Jul 2010 09:31:45 +0000
+Subject: [PATCH 137/207] tg3: Revert PCIe tx glitch fix
+
+commit 702e52ccd32164a09ea91aa5896ad7c64cb708cb upstream.
+
+This patch reverts commit 52cdf8526fe24f11d300b75458ddee017f3f4c88,
+entitled "tg3: Prevent a PCIe tx glitch". The problem does not have
+any visible side-effects and happens too early for the driver to do
+anything about it. The proper place for this code is within the
+device's bootcode.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 24 ------------------------
+ drivers/net/tg3.h | 22 ----------------------
+ 2 files changed, 0 insertions(+), 46 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 8b58c0c..f279929 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -7072,30 +7072,6 @@ static int tg3_chip_reset(struct tg3 *tp)
+
+ tg3_mdio_start(tp);
+
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780) {
+- u8 phy_addr;
+-
+- phy_addr = tp->phy_addr;
+- tp->phy_addr = TG3_PHY_PCIE_ADDR;
+-
+- tg3_writephy(tp, TG3_PCIEPHY_BLOCK_ADDR,
+- TG3_PCIEPHY_TXB_BLK << TG3_PCIEPHY_BLOCK_SHIFT);
+- val = TG3_PCIEPHY_TX0CTRL1_TXOCM | TG3_PCIEPHY_TX0CTRL1_RDCTL |
+- TG3_PCIEPHY_TX0CTRL1_TXCMV | TG3_PCIEPHY_TX0CTRL1_TKSEL |
+- TG3_PCIEPHY_TX0CTRL1_NB_EN;
+- tg3_writephy(tp, TG3_PCIEPHY_TX0CTRL1, val);
+- udelay(10);
+-
+- tg3_writephy(tp, TG3_PCIEPHY_BLOCK_ADDR,
+- TG3_PCIEPHY_XGXS_BLK1 << TG3_PCIEPHY_BLOCK_SHIFT);
+- val = TG3_PCIEPHY_PWRMGMT4_LOWPWR_EN |
+- TG3_PCIEPHY_PWRMGMT4_L1PLLPD_EN;
+- tg3_writephy(tp, TG3_PCIEPHY_PWRMGMT4, val);
+- udelay(10);
+-
+- tp->phy_addr = phy_addr;
+- }
+-
+ if ((tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS) &&
+ tp->pci_chip_rev_id != CHIPREV_ID_5750_A0 &&
+ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5785 &&
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 6b439dc..91bdc2a 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -2032,31 +2032,9 @@
+
+
+ /* Currently this is fixed. */
+-#define TG3_PHY_PCIE_ADDR 0x00
+ #define TG3_PHY_MII_ADDR 0x01
+
+
+-/*** Tigon3 specific PHY PCIE registers. ***/
+-
+-#define TG3_PCIEPHY_BLOCK_ADDR 0x1f
+-#define TG3_PCIEPHY_XGXS_BLK1 0x0801
+-#define TG3_PCIEPHY_TXB_BLK 0x0861
+-#define TG3_PCIEPHY_BLOCK_SHIFT 4
+-
+-/* TG3_PCIEPHY_TXB_BLK */
+-#define TG3_PCIEPHY_TX0CTRL1 0x15
+-#define TG3_PCIEPHY_TX0CTRL1_TXOCM 0x0003
+-#define TG3_PCIEPHY_TX0CTRL1_RDCTL 0x0008
+-#define TG3_PCIEPHY_TX0CTRL1_TXCMV 0x0030
+-#define TG3_PCIEPHY_TX0CTRL1_TKSEL 0x0040
+-#define TG3_PCIEPHY_TX0CTRL1_NB_EN 0x0400
+-
+-/* TG3_PCIEPHY_XGXS_BLK1 */
+-#define TG3_PCIEPHY_PWRMGMT4 0x1a
+-#define TG3_PCIEPHY_PWRMGMT4_L1PLLPD_EN 0x0038
+-#define TG3_PCIEPHY_PWRMGMT4_LOWPWR_EN 0x4000
+-
+-
+ /*** Tigon3 specific PHY MII registers. ***/
+ #define TG3_BMCR_SPEED1000 0x0040
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0138-tg3-Fix-some-checkpatch-errors.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0138-tg3-Fix-some-checkpatch-errors.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,101 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Sun, 11 Jul 2010 09:31:46 +0000
+Subject: [PATCH 138/207] tg3: Fix some checkpatch errors
+
+commit be98da6a10f3e7f855f36f3fdd67a91366cabc1c upstream.
+
+This patch fixes the following checkpatch errors:
+
+ERROR: do not use assignment in if condition
++ if ((mss = skb_shinfo(skb)->gso_size) != 0) {
+
+ERROR: do not use assignment in if condition
++ if ((mss = skb_shinfo(skb)->gso_size) != 0) {
+
+ERROR: space prohibited after that '!' (ctx:BxW)
++ if (! netif_carrier_ok(tp->dev) &&
+ ^
+
+ERROR: space required after that ',' (ctx:VxV)
++#define GET_REG32_LOOP(base,len) \
+ ^
+
+ERROR: "(foo*)" should be "(foo *)"
++ memcpy(data, ((char*)&val) + b_offset, b_count);
+
+ERROR: do not use assignment in if condition
++ if ((err = tg3_do_mem_test(tp, mem_tbl[i].offset,
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 17 +++++++++--------
+ 1 files changed, 9 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index f279929..0f0f4db 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -5574,8 +5574,8 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb,
+
+ entry = tnapi->tx_prod;
+ base_flags = 0;
+- mss = 0;
+- if ((mss = skb_shinfo(skb)->gso_size) != 0) {
++ mss = skb_shinfo(skb)->gso_size;
++ if (mss) {
+ int tcp_opt_len, ip_tcp_len;
+ u32 hdrlen;
+
+@@ -5781,7 +5781,8 @@ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb,
+ if (skb->ip_summed == CHECKSUM_PARTIAL)
+ base_flags |= TXD_FLAG_TCPUDP_CSUM;
+
+- if ((mss = skb_shinfo(skb)->gso_size) != 0) {
++ mss = skb_shinfo(skb)->gso_size;
++ if (mss) {
+ struct iphdr *iph;
+ u32 tcp_opt_len, hdr_len;
+
+@@ -8514,7 +8515,7 @@ static void tg3_timer(unsigned long __opaque)
+ (mac_stat & MAC_STATUS_LNKSTATE_CHANGED)) {
+ need_setup = 1;
+ }
+- if (! netif_carrier_ok(tp->dev) &&
++ if (!netif_carrier_ok(tp->dev) &&
+ (mac_stat & (MAC_STATUS_PCS_SYNCED |
+ MAC_STATUS_SIGNAL_DET))) {
+ need_setup = 1;
+@@ -9383,7 +9384,7 @@ static void tg3_get_regs(struct net_device *dev,
+ tg3_full_lock(tp, 0);
+
+ #define __GET_REG32(reg) (*(p)++ = tr32(reg))
+-#define GET_REG32_LOOP(base,len) \
++#define GET_REG32_LOOP(base, len) \
+ do { p = (u32 *)(orig_p + (base)); \
+ for (i = 0; i < len; i += 4) \
+ __GET_REG32((base) + i); \
+@@ -9476,7 +9477,7 @@ static int tg3_get_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
+ ret = tg3_nvram_read_be32(tp, offset-b_offset, &val);
+ if (ret)
+ return ret;
+- memcpy(data, ((char*)&val) + b_offset, b_count);
++ memcpy(data, ((char *)&val) + b_offset, b_count);
+ len -= b_count;
+ offset += b_count;
+ eeprom->len += b_count;
+@@ -10596,8 +10597,8 @@ static int tg3_test_memory(struct tg3 *tp)
+ mem_tbl = mem_tbl_570x;
+
+ for (i = 0; mem_tbl[i].offset != 0xffffffff; i++) {
+- if ((err = tg3_do_mem_test(tp, mem_tbl[i].offset,
+- mem_tbl[i].len)) != 0)
++ err = tg3_do_mem_test(tp, mem_tbl[i].offset, mem_tbl[i].len);
++ if (err)
+ break;
+ }
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0139-tg3-Update-version-to-3.112.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0139-tg3-Update-version-to-3.112.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,35 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Sun, 11 Jul 2010 09:31:47 +0000
+Subject: [PATCH 139/207] tg3: Update version to 3.112
+
+commit 98e32a9ceea8e3a0cd6ea89c9ce8e09a74b03b78 upstream.
+
+This patch updates the tg3 version to 3.112.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 0f0f4db..4e994c7 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -69,10 +69,10 @@
+
+ #define DRV_MODULE_NAME "tg3"
+ #define TG3_MAJ_NUM 3
+-#define TG3_MIN_NUM 111
++#define TG3_MIN_NUM 112
+ #define DRV_MODULE_VERSION \
+ __stringify(TG3_MAJ_NUM) "." __stringify(TG3_MIN_NUM)
+-#define DRV_MODULE_RELDATE "June 5, 2010"
++#define DRV_MODULE_RELDATE "July 11, 2010"
+
+ #define TG3_DEF_MAC_MODE 0
+ #define TG3_DEF_RX_MODE 0
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0140-tg3-Add-5784-ASIC-rev-to-earlier-PCIe-MPS-fix.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0140-tg3-Add-5784-ASIC-rev-to-earlier-PCIe-MPS-fix.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,38 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 2 Aug 2010 11:25:55 +0000
+Subject: [PATCH 140/207] tg3: Add 5784 ASIC rev to earlier PCIe MPS fix
+
+commit 6de34cb963a934953fdd365937b4b75959256602 upstream.
+
+tg3 commit e7126997342560533317d8467e8516119ebcbd21 entitled
+"tg3: Preserve PCIe MPS setting for new devs" attempted to ensure the
+PCIe link negotiated Maximum Payload Size (MPS) setting was 128 bytes
+for all devices that didn't support higher speeds. The 5784 device was
+mistakenly added to this list when it shouldn't have. This patch
+removes the 5784 ASIC rev devices from that list.
+
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 3 +--
+ 1 files changed, 1 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 4e994c7..f5efd01 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -7002,8 +7002,7 @@ static int tg3_chip_reset(struct tg3 *tp)
+ * Older PCIe devices only support the 128 byte
+ * MPS setting. Enforce the restriction.
+ */
+- if (!(tp->tg3_flags & TG3_FLAG_CPMU_PRESENT) ||
+- (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784))
++ if (!(tp->tg3_flags & TG3_FLAG_CPMU_PRESENT))
+ val16 &= ~PCI_EXP_DEVCTL_PAYLOAD;
+ pci_write_config_word(tp->pdev,
+ tp->pcie_cap + PCI_EXP_DEVCTL,
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0141-tg3-Disable-TSS-also-during-tg3_close.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0141-tg3-Disable-TSS-also-during-tg3_close.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,32 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 2 Aug 2010 11:25:56 +0000
+Subject: [PATCH 141/207] tg3: Disable TSS also during tg3_close()
+
+commit 774ee7525ff94e597844c9f7f6a48938906df698 upstream.
+
+The TSS flag needs to be turned off during tg3_close(). If the device
+fails to allocate more than one MSI-X vector the next time the device is
+brought up, transmits will fail.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index f5efd01..521c41e 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -8864,7 +8864,7 @@ static void tg3_ints_fini(struct tg3 *tp)
+ else if (tp->tg3_flags2 & TG3_FLG2_USING_MSI)
+ pci_disable_msi(tp->pdev);
+ tp->tg3_flags2 &= ~TG3_FLG2_USING_MSI_OR_MSIX;
+- tp->tg3_flags3 &= ~TG3_FLG3_ENABLE_RSS;
++ tp->tg3_flags3 &= ~(TG3_FLG3_ENABLE_RSS | TG3_FLG3_ENABLE_TSS);
+ }
+
+ static int tg3_open(struct net_device *dev)
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0142-tg3-Create-TG3_FLG3_5717_PLUS-flag.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0142-tg3-Create-TG3_FLG3_5717_PLUS-flag.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,228 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 2 Aug 2010 11:25:57 +0000
+Subject: [PATCH 142/207] tg3: Create TG3_FLG3_5717_PLUS flag
+
+commit c885e824699f49bc3758a0dec760e189cd774e79 upstream.
+
+This patch creates a TG3_FLG3_5717_PLUS flag to collectively describe
+the set of changes in the ASIC that will apply to all future chip
+revisions.
+
+Signed-off-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 72 ++++++++++++++++------------------------------------
+ drivers/net/tg3.h | 1 +
+ 2 files changed, 23 insertions(+), 50 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 521c41e..29719fe 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -7075,9 +7075,7 @@ static int tg3_chip_reset(struct tg3 *tp)
+ if ((tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS) &&
+ tp->pci_chip_rev_id != CHIPREV_ID_5750_A0 &&
+ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5785 &&
+- GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717 &&
+- GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5719 &&
+- GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_57765) {
++ !(tp->tg3_flags3 & TG3_FLG3_5717_PLUS)) {
+ val = tr32(0x7c00);
+
+ tw32(0x7c00, val | (1 << 25));
+@@ -7750,9 +7748,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ if (err)
+ return err;
+
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) {
++ if (tp->tg3_flags3 & TG3_FLG3_5717_PLUS) {
+ val = tr32(TG3PCI_DMA_RW_CTRL) &
+ ~DMA_RWCTRL_DIS_CACHE_ALIGNMENT;
+ if (tp->pci_chip_rev_id == CHIPREV_ID_57765_A0)
+@@ -7915,9 +7911,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ BDINFO_FLAGS_DISABLED);
+ }
+
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
++ if (tp->tg3_flags3 & TG3_FLG3_5717_PLUS)
+ val = (RX_STD_MAX_SIZE_5705 << BDINFO_FLAGS_MAXLEN_SHIFT) |
+ (TG3_RX_STD_DMA_SZ << 2);
+ else
+@@ -7934,9 +7928,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ tp->rx_jumbo_pending : 0;
+ tw32_rx_mbox(TG3_RX_JMB_PROD_IDX_REG, tpr->rx_jmb_prod_idx);
+
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) {
++ if (tp->tg3_flags3 & TG3_FLG3_5717_PLUS) {
+ tw32(STD_REPLENISH_LWM, 32);
+ tw32(JMB_REPLENISH_LWM, 16);
+ }
+@@ -8626,9 +8618,7 @@ static int tg3_test_interrupt(struct tg3 *tp)
+ * Turn off MSI one shot mode. Otherwise this test has no
+ * observable way to know whether the interrupt was delivered.
+ */
+- if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) &&
++ if ((tp->tg3_flags3 & TG3_FLG3_5717_PLUS) &&
+ (tp->tg3_flags2 & TG3_FLG2_USING_MSI)) {
+ val = tr32(MSGINT_MODE) | MSGINT_MODE_ONE_SHOT_DISABLE;
+ tw32(MSGINT_MODE, val);
+@@ -8671,9 +8661,7 @@ static int tg3_test_interrupt(struct tg3 *tp)
+
+ if (intr_ok) {
+ /* Reenable MSI one shot mode. */
+- if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) &&
++ if ((tp->tg3_flags3 & TG3_FLG3_5717_PLUS) &&
+ (tp->tg3_flags2 & TG3_FLG2_USING_MSI)) {
+ val = tr32(MSGINT_MODE) & ~MSGINT_MODE_ONE_SHOT_DISABLE;
+ tw32(MSGINT_MODE, val);
+@@ -8968,11 +8956,8 @@ static int tg3_open(struct net_device *dev)
+ goto err_out2;
+ }
+
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717 &&
+- GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5719 &&
+- GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_57765 &&
+- (tp->tg3_flags2 & TG3_FLG2_USING_MSI) &&
+- (tp->tg3_flags2 & TG3_FLG2_1SHOT_MSI)) {
++ if (!(tp->tg3_flags3 & TG3_FLG3_5717_PLUS) &&
++ (tp->tg3_flags2 & TG3_FLG2_USING_MSI)) {
+ u32 val = tr32(PCIE_TRANSACTION_CFG);
+
+ tw32(PCIE_TRANSACTION_CFG,
+@@ -12998,6 +12983,11 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717)
+ tp->pdev_peer = tg3_find_peer(tp);
+
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
++ tp->tg3_flags3 |= TG3_FLG3_5717_PLUS;
++
+ /* Intentionally exclude ASIC_REV_5906 */
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787 ||
+@@ -13005,9 +12995,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
++ (tp->tg3_flags3 & TG3_FLG3_5717_PLUS))
+ tp->tg3_flags3 |= TG3_FLG3_5755_PLUS;
+
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750 ||
+@@ -13037,9 +13025,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ }
+
+ /* Determine TSO capabilities */
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
++ if (tp->tg3_flags3 & TG3_FLG3_5717_PLUS)
+ tp->tg3_flags2 |= TG3_FLG2_HW_TSO_3;
+ else if ((tp->tg3_flags3 & TG3_FLG3_5755_PLUS) ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
+@@ -13075,9 +13061,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ tp->tg3_flags2 |= TG3_FLG2_1SHOT_MSI;
+ }
+
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) {
++ if (tp->tg3_flags3 & TG3_FLG3_5717_PLUS) {
+ tp->tg3_flags |= TG3_FLAG_SUPPORT_MSIX;
+ tp->irq_max = TG3_IRQ_MAX_VECS;
+ }
+@@ -13092,9 +13076,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ tp->tg3_flags3 |= TG3_FLG3_40BIT_DMA_LIMIT_BUG;
+ }
+
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
++ if (tp->tg3_flags3 & TG3_FLG3_5717_PLUS)
+ tp->tg3_flags3 |= TG3_FLG3_USE_JUMBO_BDFLAG;
+
+ if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS) ||
+@@ -13295,9 +13277,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
++ (tp->tg3_flags3 & TG3_FLG3_5717_PLUS))
+ tp->tg3_flags |= TG3_FLAG_CPMU_PRESENT;
+
+ /* Set up tp->grc_local_ctrl before calling tg3_set_power_state().
+@@ -13376,9 +13356,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ !(tp->tg3_flags3 & TG3_FLG3_PHY_IS_FET) &&
+ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5785 &&
+ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_57780 &&
+- GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717 &&
+- GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5719 &&
+- GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_57765) {
++ !(tp->tg3_flags3 & TG3_FLG3_5717_PLUS)) {
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 ||
+@@ -13715,9 +13693,7 @@ static u32 __devinit tg3_calc_dma_bndry(struct tg3 *tp, u32 val)
+ #endif
+ #endif
+
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) {
++ if (tp->tg3_flags3 & TG3_FLG3_5717_PLUS) {
+ val = goal ? 0 : DMA_RWCTRL_DIS_CACHE_ALIGNMENT;
+ goto out;
+ }
+@@ -13928,9 +13904,7 @@ static int __devinit tg3_test_dma(struct tg3 *tp)
+
+ tp->dma_rwctrl = tg3_calc_dma_bndry(tp, tp->dma_rwctrl);
+
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
++ if (tp->tg3_flags3 & TG3_FLG3_5717_PLUS)
+ goto out;
+
+ if (tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS) {
+@@ -14128,9 +14102,7 @@ static void __devinit tg3_init_link_config(struct tg3 *tp)
+
+ static void __devinit tg3_init_bufmgr_config(struct tg3 *tp)
+ {
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) {
++ if (tp->tg3_flags3 & TG3_FLG3_5717_PLUS) {
+ tp->bufmgr_config.mbuf_read_dma_low_water =
+ DEFAULT_MB_RDMA_LOW_WATER_5705;
+ tp->bufmgr_config.mbuf_mac_rx_low_water =
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 91bdc2a..7863171 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -2860,6 +2860,7 @@ struct tg3 {
+ #define TG3_FLG3_SHORT_DMA_BUG 0x00200000
+ #define TG3_FLG3_USE_JUMBO_BDFLAG 0x00400000
+ #define TG3_FLG3_L1PLLPD_EN 0x00800000
++#define TG3_FLG3_5717_PLUS 0x01000000
+
+ struct timer_list timer;
+ u16 timer_counter;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0143-tg3-Don-t-access-phy-test-ctrl-reg-for-5717.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0143-tg3-Don-t-access-phy-test-ctrl-reg-for-5717.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,57 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 2 Aug 2010 11:25:58 +0000
+Subject: [PATCH 143/207] tg3: Don't access phy test ctrl reg for 5717+
+
+commit 88075d915b51d9a17cc7436c868013a3113a849a upstream.
+
+The phy test register location has been repurposed for 5717+ devices.
+This patch changes the code to avoid this location for these devices.
+
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 10 +++++++---
+ drivers/net/tg3.h | 4 ++++
+ 2 files changed, 11 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 29719fe..c3b038a 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -6929,9 +6929,13 @@ static int tg3_chip_reset(struct tg3 *tp)
+ val = GRC_MISC_CFG_CORECLK_RESET;
+
+ if (tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS) {
+- if (tr32(0x7e2c) == 0x60) {
+- tw32(0x7e2c, 0x20);
+- }
++ /* Force PCIe 1.0a mode */
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5785 &&
++ !(tp->tg3_flags3 & TG3_FLG3_5717_PLUS) &&
++ tr32(TG3_PCIE_PHY_TSTCTL) ==
++ (TG3_PCIE_PHY_TSTCTL_PCIE10 | TG3_PCIE_PHY_TSTCTL_PSCRAM))
++ tw32(TG3_PCIE_PHY_TSTCTL, TG3_PCIE_PHY_TSTCTL_PSCRAM);
++
+ if (tp->pci_chip_rev_id != CHIPREV_ID_5750_A0) {
+ tw32(GRC_MISC_CFG, (1 << 29));
+ val |= (1 << 29);
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 7863171..af31cf6 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -1844,6 +1844,10 @@
+ #define TG3_PCIE_LNKCTL_L1_PLL_PD_DIS 0x00000080
+ /* 0x7d58 --> 0x7e70 unused */
+
++#define TG3_PCIE_PHY_TSTCTL 0x00007e2c
++#define TG3_PCIE_PHY_TSTCTL_PCIE10 0x00000040
++#define TG3_PCIE_PHY_TSTCTL_PSCRAM 0x00000020
++
+ #define TG3_PCIE_EIDLE_DELAY 0x00007e70
+ #define TG3_PCIE_EIDLE_DELAY_MASK 0x0000001f
+ #define TG3_PCIE_EIDLE_DELAY_13_CLKS 0x0000000c
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0144-tg3-Manage-gphy-power-for-CPMU-less-devs-only.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0144-tg3-Manage-gphy-power-for-CPMU-less-devs-only.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,38 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 2 Aug 2010 11:25:59 +0000
+Subject: [PATCH 144/207] tg3: Manage gphy power for CPMU-less devs only
+
+commit f37500d3f66ba82888315838278d56fc27308327 upstream.
+
+This patch changes the code to only manage the PCIe gphy power for
+CPMU-less devices only. The CPMU takes over management for newer
+chips.
+
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 5 ++++-
+ 1 files changed, 4 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index c3b038a..858c308 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -6948,8 +6948,11 @@ static int tg3_chip_reset(struct tg3 *tp)
+ tr32(GRC_VCPU_EXT_CTRL) & ~GRC_VCPU_EXT_CTRL_HALT_CPU);
+ }
+
+- if (tp->tg3_flags2 & TG3_FLG2_5705_PLUS)
++ /* Manage gphy power for all CPMU absent PCIe devices. */
++ if ((tp->tg3_flags2 & TG3_FLG2_5705_PLUS) &&
++ !(tp->tg3_flags & TG3_FLAG_CPMU_PRESENT))
+ val |= GRC_MISC_CFG_KEEP_GPHY_POWER;
++
+ tw32(GRC_MISC_CFG, val);
+
+ /* restore 5701 hardware bug workaround write method */
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0145-tg3-Restrict-ASPM-workaround-devlist.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0145-tg3-Restrict-ASPM-workaround-devlist.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,35 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 2 Aug 2010 11:26:00 +0000
+Subject: [PATCH 145/207] tg3: Restrict ASPM workaround devlist
+
+commit 8c69b1e702527e39c0b4fbda79d2738d186a3908 upstream.
+
+The ASPM workaround setting obtained from NVRAM only works with devices
+older than 5717. This patch enforces the restriction.
+
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 4 +++-
+ 1 files changed, 3 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 858c308..4d0386e 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -12199,7 +12199,9 @@ static void __devinit tg3_get_eeprom_hw_cfg(struct tg3 *tp)
+ (cfg2 & NIC_SRAM_DATA_CFG_2_APD_EN))
+ tp->tg3_flags3 |= TG3_FLG3_PHY_ENABLE_APD;
+
+- if (tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS) {
++ if ((tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS) &&
++ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5785 &&
++ !(tp->tg3_flags3 & TG3_FLG3_5717_PLUS)) {
+ u32 cfg3;
+
+ tg3_read_mem(tp, NIC_SRAM_DATA_CFG_3, &cfg3);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0146-tg3-Detect-APE-firmware-types.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0146-tg3-Detect-APE-firmware-types.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,63 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 2 Aug 2010 11:26:01 +0000
+Subject: [PATCH 146/207] tg3: Detect APE firmware types
+
+commit ecc796486f0a7f4958f8dc7550267570dcacb608 upstream.
+
+This patch adds code to determine the APE firmware type and report this
+along with the firmware version.
+
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 9 ++++++++-
+ drivers/net/tg3.h | 2 ++
+ 2 files changed, 10 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 4d0386e..36518b3 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -12721,6 +12721,7 @@ static void __devinit tg3_read_dash_ver(struct tg3 *tp)
+ {
+ int vlen;
+ u32 apedata;
++ char *fwtype;
+
+ if (!(tp->tg3_flags3 & TG3_FLG3_ENABLE_APE) ||
+ !(tp->tg3_flags & TG3_FLAG_ENABLE_ASF))
+@@ -12736,9 +12737,15 @@ static void __devinit tg3_read_dash_ver(struct tg3 *tp)
+
+ apedata = tg3_ape_read32(tp, TG3_APE_FW_VERSION);
+
++ if (tg3_ape_read32(tp, TG3_APE_FW_FEATURES) & TG3_APE_FW_FEATURE_NCSI)
++ fwtype = "NCSI";
++ else
++ fwtype = "DASH";
++
+ vlen = strlen(tp->fw_ver);
+
+- snprintf(&tp->fw_ver[vlen], TG3_VER_SIZE - vlen, " DASH v%d.%d.%d.%d",
++ snprintf(&tp->fw_ver[vlen], TG3_VER_SIZE - vlen, " %s v%d.%d.%d.%d",
++ fwtype,
+ (apedata & APE_FW_VERSION_MAJMSK) >> APE_FW_VERSION_MAJSFT,
+ (apedata & APE_FW_VERSION_MINMSK) >> APE_FW_VERSION_MINSFT,
+ (apedata & APE_FW_VERSION_REVMSK) >> APE_FW_VERSION_REVSFT,
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index af31cf6..2af1013 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -2161,6 +2161,8 @@
+ /* APE shared memory. Accessible through BAR1 */
+ #define TG3_APE_FW_STATUS 0x400c
+ #define APE_FW_STATUS_READY 0x00000100
++#define TG3_APE_FW_FEATURES 0x4010
++#define TG3_APE_FW_FEATURE_NCSI 0x00000002
+ #define TG3_APE_FW_VERSION 0x4018
+ #define APE_FW_VERSION_MAJMSK 0xff000000
+ #define APE_FW_VERSION_MAJSFT 24
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0147-tg3-Remove-5720-5750-and-5750M.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0147-tg3-Remove-5720-5750-and-5750M.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,36 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 2 Aug 2010 11:26:02 +0000
+Subject: [PATCH 147/207] tg3: Remove 5720, 5750, and 5750M
+
+commit 67b284d476bcb3d100e946da23d6cf9acfd0465c upstream.
+
+These devices were never released to the public.
+
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 3 ---
+ 1 files changed, 0 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 36518b3..43d0ab2 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -221,12 +221,9 @@ static DEFINE_PCI_DEVICE_TABLE(tg3_pci_tbl) = {
+ {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5901_2)},
+ {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5704S_2)},
+ {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5705F)},
+- {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5720)},
+ {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5721)},
+ {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5722)},
+- {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5750)},
+ {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5751)},
+- {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5750M)},
+ {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5751M)},
+ {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5751F)},
+ {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5752)},
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0148-tg3-Improve-small-packet-performance.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0148-tg3-Improve-small-packet-performance.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,103 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 2 Aug 2010 11:26:03 +0000
+Subject: [PATCH 148/207] tg3: Improve small packet performance
+
+commit f65aac166fe10b96e64c233980a3522fc50fbecf upstream.
+
+smp_mb() inside tg3_tx_avail() is used twice in the normal
+tg3_start_xmit() path (see illustration below). The full memory
+barrier is only necessary during race conditions with tx completion.
+We can speed up the tx path by replacing smp_mb() in tg3_tx_avail()
+with a compiler barrier. The compiler barrier is to force the
+compiler to fetch the tx_prod and tx_cons from memory.
+
+In the race condition between tg3_start_xmit() and tg3_tx(),
+we have the following situation:
+
+tg3_start_xmit() tg3_tx()
+ if (!tg3_tx_avail())
+ BUG();
+
+ ...
+
+ if (!tg3_tx_avail())
+ netif_tx_stop_queue(); update_tx_index();
+ smp_mb(); smp_mb();
+ if (tg3_tx_avail()) if (netif_tx_queue_stopped() &&
+ netif_tx_wake_queue(); tg3_tx_avail())
+
+With smp_mb() removed from tg3_tx_avail(), we need to add smp_mb() to
+tg3_start_xmit() as shown above to properly order netif_tx_stop_queue()
+and tg3_tx_avail() to check the ring index. If it is not strictly
+ordered, the tx queue can be stopped forever.
+
+This improves performance by about 3% with 2 ports running
+bi-directional 64-byte packets.
+
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Signed-off-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 24 +++++++++++++++++++++++-
+ 1 files changed, 23 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 43d0ab2..69a2575 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -4386,7 +4386,8 @@ static void tg3_tx_recover(struct tg3 *tp)
+
+ static inline u32 tg3_tx_avail(struct tg3_napi *tnapi)
+ {
+- smp_mb();
++ /* Tell compiler to fetch tx indices from memory. */
++ barrier();
+ return tnapi->tx_pending -
+ ((tnapi->tx_prod - tnapi->tx_cons) & (TG3_TX_RING_SIZE - 1));
+ }
+@@ -5670,6 +5671,13 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb,
+ tnapi->tx_prod = entry;
+ if (unlikely(tg3_tx_avail(tnapi) <= (MAX_SKB_FRAGS + 1))) {
+ netif_tx_stop_queue(txq);
++
++ /* netif_tx_stop_queue() must be done before checking
++ * checking tx index in tg3_tx_avail() below, because in
++ * tg3_tx(), we update tx index before checking for
++ * netif_tx_queue_stopped().
++ */
++ smp_mb();
+ if (tg3_tx_avail(tnapi) > TG3_TX_WAKEUP_THRESH(tnapi))
+ netif_tx_wake_queue(txq);
+ }
+@@ -5715,6 +5723,13 @@ static int tg3_tso_bug(struct tg3 *tp, struct sk_buff *skb)
+ /* Estimate the number of fragments in the worst case */
+ if (unlikely(tg3_tx_avail(&tp->napi[0]) <= frag_cnt_est)) {
+ netif_stop_queue(tp->dev);
++
++ /* netif_tx_stop_queue() must be done before checking
++ * checking tx index in tg3_tx_avail() below, because in
++ * tg3_tx(), we update tx index before checking for
++ * netif_tx_queue_stopped().
++ */
++ smp_mb();
+ if (tg3_tx_avail(&tp->napi[0]) <= frag_cnt_est)
+ return NETDEV_TX_BUSY;
+
+@@ -5950,6 +5965,13 @@ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb,
+ tnapi->tx_prod = entry;
+ if (unlikely(tg3_tx_avail(tnapi) <= (MAX_SKB_FRAGS + 1))) {
+ netif_tx_stop_queue(txq);
++
++ /* netif_tx_stop_queue() must be done before checking
++ * checking tx index in tg3_tx_avail() below, because in
++ * tg3_tx(), we update tx index before checking for
++ * netif_tx_queue_stopped().
++ */
++ smp_mb();
+ if (tg3_tx_avail(tnapi) > TG3_TX_WAKEUP_THRESH(tnapi))
+ netif_tx_wake_queue(txq);
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0149-tg3-Add-error-reporting-to-tg3_phydsp_write.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0149-tg3-Add-error-reporting-to-tg3_phydsp_write.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,119 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 2 Aug 2010 11:26:04 +0000
+Subject: [PATCH 149/207] tg3: Add error reporting to tg3_phydsp_write()
+
+commit 6ee7c0a0a5003abd4afd724f5c2f654fe7328c0a upstream.
+
+This patch adds error reporting to the tg3_phydsp_write() function and
+converts a few more locations to use this function over the inlined
+equivalent.
+
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 51 ++++++++++++++++++++-------------------------------
+ 1 files changed, 20 insertions(+), 31 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 69a2575..b4e1a9b 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -1572,10 +1572,15 @@ static void tg3_phy_fini(struct tg3 *tp)
+ }
+ }
+
+-static void tg3_phydsp_write(struct tg3 *tp, u32 reg, u32 val)
++static int tg3_phydsp_write(struct tg3 *tp, u32 reg, u32 val)
+ {
+- tg3_writephy(tp, MII_TG3_DSP_ADDRESS, reg);
+- tg3_writephy(tp, MII_TG3_DSP_RW_PORT, val);
++ int err;
++
++ err = tg3_writephy(tp, MII_TG3_DSP_ADDRESS, reg);
++ if (!err)
++ err = tg3_writephy(tp, MII_TG3_DSP_RW_PORT, val);
++
++ return err;
+ }
+
+ static void tg3_phy_fet_toggle_apd(struct tg3 *tp, bool enable)
+@@ -1872,8 +1877,7 @@ static int tg3_phy_reset_5703_4_5(struct tg3 *tp)
+ tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x0c00);
+
+ /* Block the PHY control access. */
+- tg3_writephy(tp, MII_TG3_DSP_ADDRESS, 0x8005);
+- tg3_writephy(tp, MII_TG3_DSP_RW_PORT, 0x0800);
++ tg3_phydsp_write(tp, 0x8005, 0x0800);
+
+ err = tg3_phy_write_and_check_testpat(tp, &do_phy_reset);
+ if (!err)
+@@ -1884,8 +1888,7 @@ static int tg3_phy_reset_5703_4_5(struct tg3 *tp)
+ if (err)
+ return err;
+
+- tg3_writephy(tp, MII_TG3_DSP_ADDRESS, 0x8005);
+- tg3_writephy(tp, MII_TG3_DSP_RW_PORT, 0x0000);
++ tg3_phydsp_write(tp, 0x8005, 0x0000);
+
+ tg3_writephy(tp, MII_TG3_DSP_ADDRESS, 0x8200);
+ tg3_writephy(tp, 0x16, 0x0000);
+@@ -1994,10 +1997,8 @@ static int tg3_phy_reset(struct tg3 *tp)
+ out:
+ if (tp->tg3_flags2 & TG3_FLG2_PHY_ADC_BUG) {
+ tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x0c00);
+- tg3_writephy(tp, MII_TG3_DSP_ADDRESS, 0x201f);
+- tg3_writephy(tp, MII_TG3_DSP_RW_PORT, 0x2aaa);
+- tg3_writephy(tp, MII_TG3_DSP_ADDRESS, 0x000a);
+- tg3_writephy(tp, MII_TG3_DSP_RW_PORT, 0x0323);
++ tg3_phydsp_write(tp, 0x201f, 0x2aaa);
++ tg3_phydsp_write(tp, 0x000a, 0x0323);
+ tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x0400);
+ }
+ if (tp->tg3_flags2 & TG3_FLG2_PHY_5704_A0_BUG) {
+@@ -2006,12 +2007,9 @@ out:
+ }
+ if (tp->tg3_flags2 & TG3_FLG2_PHY_BER_BUG) {
+ tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x0c00);
+- tg3_writephy(tp, MII_TG3_DSP_ADDRESS, 0x000a);
+- tg3_writephy(tp, MII_TG3_DSP_RW_PORT, 0x310b);
+- tg3_writephy(tp, MII_TG3_DSP_ADDRESS, 0x201f);
+- tg3_writephy(tp, MII_TG3_DSP_RW_PORT, 0x9506);
+- tg3_writephy(tp, MII_TG3_DSP_ADDRESS, 0x401f);
+- tg3_writephy(tp, MII_TG3_DSP_RW_PORT, 0x14e2);
++ tg3_phydsp_write(tp, 0x000a, 0x310b);
++ tg3_phydsp_write(tp, 0x201f, 0x9506);
++ tg3_phydsp_write(tp, 0x401f, 0x14e2);
+ tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x0400);
+ } else if (tp->tg3_flags2 & TG3_FLG2_PHY_JITTER_BUG) {
+ tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x0c00);
+@@ -2979,20 +2977,11 @@ static int tg3_init_5401phy_dsp(struct tg3 *tp)
+ /* Set Extended packet length bit */
+ err = tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x4c20);
+
+- err |= tg3_writephy(tp, MII_TG3_DSP_ADDRESS, 0x0012);
+- err |= tg3_writephy(tp, MII_TG3_DSP_RW_PORT, 0x1804);
+-
+- err |= tg3_writephy(tp, MII_TG3_DSP_ADDRESS, 0x0013);
+- err |= tg3_writephy(tp, MII_TG3_DSP_RW_PORT, 0x1204);
+-
+- err |= tg3_writephy(tp, MII_TG3_DSP_ADDRESS, 0x8006);
+- err |= tg3_writephy(tp, MII_TG3_DSP_RW_PORT, 0x0132);
+-
+- err |= tg3_writephy(tp, MII_TG3_DSP_ADDRESS, 0x8006);
+- err |= tg3_writephy(tp, MII_TG3_DSP_RW_PORT, 0x0232);
+-
+- err |= tg3_writephy(tp, MII_TG3_DSP_ADDRESS, 0x201f);
+- err |= tg3_writephy(tp, MII_TG3_DSP_RW_PORT, 0x0a20);
++ err |= tg3_phydsp_write(tp, 0x0012, 0x1804);
++ err |= tg3_phydsp_write(tp, 0x0013, 0x1204);
++ err |= tg3_phydsp_write(tp, 0x8006, 0x0132);
++ err |= tg3_phydsp_write(tp, 0x8006, 0x0232);
++ err |= tg3_phydsp_write(tp, 0x201f, 0x0a20);
+
+ udelay(40);
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0150-tg3-Add-phy-related-preprocessor-constants.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0150-tg3-Add-phy-related-preprocessor-constants.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,185 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 2 Aug 2010 11:26:05 +0000
+Subject: [PATCH 150/207] tg3: Add phy-related preprocessor constants
+
+commit f08aa1a8b8ff0738d42936c3ac8c5516848bca02 upstream.
+
+This patch replaces some instances of hardcoded phy register values with
+preprocessor equivalents.
+
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 46 ++++++++++++++++++++++++----------------------
+ drivers/net/tg3.h | 4 +++-
+ 2 files changed, 27 insertions(+), 23 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index b4e1a9b..81d9b4f 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -1742,7 +1742,7 @@ static int tg3_wait_macro_done(struct tg3 *tp)
+ while (limit--) {
+ u32 tmp32;
+
+- if (!tg3_readphy(tp, 0x16, &tmp32)) {
++ if (!tg3_readphy(tp, MII_TG3_DSP_CONTROL, &tmp32)) {
+ if ((tmp32 & 0x1000) == 0)
+ break;
+ }
+@@ -1768,13 +1768,13 @@ static int tg3_phy_write_and_check_testpat(struct tg3 *tp, int *resetp)
+
+ tg3_writephy(tp, MII_TG3_DSP_ADDRESS,
+ (chan * 0x2000) | 0x0200);
+- tg3_writephy(tp, 0x16, 0x0002);
++ tg3_writephy(tp, MII_TG3_DSP_CONTROL, 0x0002);
+
+ for (i = 0; i < 6; i++)
+ tg3_writephy(tp, MII_TG3_DSP_RW_PORT,
+ test_pat[chan][i]);
+
+- tg3_writephy(tp, 0x16, 0x0202);
++ tg3_writephy(tp, MII_TG3_DSP_CONTROL, 0x0202);
+ if (tg3_wait_macro_done(tp)) {
+ *resetp = 1;
+ return -EBUSY;
+@@ -1782,13 +1782,13 @@ static int tg3_phy_write_and_check_testpat(struct tg3 *tp, int *resetp)
+
+ tg3_writephy(tp, MII_TG3_DSP_ADDRESS,
+ (chan * 0x2000) | 0x0200);
+- tg3_writephy(tp, 0x16, 0x0082);
++ tg3_writephy(tp, MII_TG3_DSP_CONTROL, 0x0082);
+ if (tg3_wait_macro_done(tp)) {
+ *resetp = 1;
+ return -EBUSY;
+ }
+
+- tg3_writephy(tp, 0x16, 0x0802);
++ tg3_writephy(tp, MII_TG3_DSP_CONTROL, 0x0802);
+ if (tg3_wait_macro_done(tp)) {
+ *resetp = 1;
+ return -EBUSY;
+@@ -1828,10 +1828,10 @@ static int tg3_phy_reset_chanpat(struct tg3 *tp)
+
+ tg3_writephy(tp, MII_TG3_DSP_ADDRESS,
+ (chan * 0x2000) | 0x0200);
+- tg3_writephy(tp, 0x16, 0x0002);
++ tg3_writephy(tp, MII_TG3_DSP_CONTROL, 0x0002);
+ for (i = 0; i < 6; i++)
+ tg3_writephy(tp, MII_TG3_DSP_RW_PORT, 0x000);
+- tg3_writephy(tp, 0x16, 0x0202);
++ tg3_writephy(tp, MII_TG3_DSP_CONTROL, 0x0202);
+ if (tg3_wait_macro_done(tp))
+ return -EBUSY;
+ }
+@@ -1891,7 +1891,7 @@ static int tg3_phy_reset_5703_4_5(struct tg3 *tp)
+ tg3_phydsp_write(tp, 0x8005, 0x0000);
+
+ tg3_writephy(tp, MII_TG3_DSP_ADDRESS, 0x8200);
+- tg3_writephy(tp, 0x16, 0x0000);
++ tg3_writephy(tp, MII_TG3_DSP_CONTROL, 0x0000);
+
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5703 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) {
+@@ -2002,8 +2002,8 @@ out:
+ tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x0400);
+ }
+ if (tp->tg3_flags2 & TG3_FLG2_PHY_5704_A0_BUG) {
+- tg3_writephy(tp, 0x1c, 0x8d68);
+- tg3_writephy(tp, 0x1c, 0x8d68);
++ tg3_writephy(tp, MII_TG3_MISC_SHDW, 0x8d68);
++ tg3_writephy(tp, MII_TG3_MISC_SHDW, 0x8d68);
+ }
+ if (tp->tg3_flags2 & TG3_FLG2_PHY_BER_BUG) {
+ tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x0c00);
+@@ -3134,9 +3134,9 @@ static int tg3_setup_copper_phy(struct tg3 *tp, int force_reset)
+ tp->pci_chip_rev_id == CHIPREV_ID_5701_B0) {
+ /* 5701 {A0,B0} CRC bug workaround */
+ tg3_writephy(tp, 0x15, 0x0a75);
+- tg3_writephy(tp, 0x1c, 0x8c68);
+- tg3_writephy(tp, 0x1c, 0x8d68);
+- tg3_writephy(tp, 0x1c, 0x8c68);
++ tg3_writephy(tp, MII_TG3_MISC_SHDW, 0x8c68);
++ tg3_writephy(tp, MII_TG3_MISC_SHDW, 0x8d68);
++ tg3_writephy(tp, MII_TG3_MISC_SHDW, 0x8c68);
+ }
+
+ /* Clear pending interrupts... */
+@@ -4249,13 +4249,14 @@ static void tg3_serdes_parallel_detect(struct tg3 *tp)
+ u32 phy1, phy2;
+
+ /* Select shadow register 0x1f */
+- tg3_writephy(tp, 0x1c, 0x7c00);
+- tg3_readphy(tp, 0x1c, &phy1);
++ tg3_writephy(tp, MII_TG3_MISC_SHDW, 0x7c00);
++ tg3_readphy(tp, MII_TG3_MISC_SHDW, &phy1);
+
+ /* Select expansion interrupt status register */
+- tg3_writephy(tp, 0x17, 0x0f01);
+- tg3_readphy(tp, 0x15, &phy2);
+- tg3_readphy(tp, 0x15, &phy2);
++ tg3_writephy(tp, MII_TG3_DSP_ADDRESS,
++ MII_TG3_DSP_EXP1_INT_STAT);
++ tg3_readphy(tp, MII_TG3_DSP_RW_PORT, &phy2);
++ tg3_readphy(tp, MII_TG3_DSP_RW_PORT, &phy2);
+
+ if ((phy1 & 0x10) && !(phy2 & 0x20)) {
+ /* We have signal detect and not receiving
+@@ -4275,8 +4276,9 @@ static void tg3_serdes_parallel_detect(struct tg3 *tp)
+ u32 phy2;
+
+ /* Select expansion interrupt status register */
+- tg3_writephy(tp, 0x17, 0x0f01);
+- tg3_readphy(tp, 0x15, &phy2);
++ tg3_writephy(tp, MII_TG3_DSP_ADDRESS,
++ MII_TG3_DSP_EXP1_INT_STAT);
++ tg3_readphy(tp, MII_TG3_DSP_RW_PORT, &phy2);
+ if (phy2 & 0x20) {
+ u32 bmcr;
+
+@@ -8337,7 +8339,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ if (!tg3_readphy(tp, MII_TG3_TEST1, &tmp)) {
+ tg3_writephy(tp, MII_TG3_TEST1,
+ tmp | MII_TG3_TEST1_CRC_EN);
+- tg3_readphy(tp, 0x14, &tmp);
++ tg3_readphy(tp, MII_TG3_RXR_COUNTERS, &tmp);
+ }
+ }
+ }
+@@ -9087,7 +9089,7 @@ static unsigned long calc_crc_errors(struct tg3 *tp)
+ if (!tg3_readphy(tp, MII_TG3_TEST1, &val)) {
+ tg3_writephy(tp, MII_TG3_TEST1,
+ val | MII_TG3_TEST1_CRC_EN);
+- tg3_readphy(tp, 0x14, &val);
++ tg3_readphy(tp, MII_TG3_RXR_COUNTERS, &val);
+ } else
+ val = 0;
+ spin_unlock_bh(&tp->lock);
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 2af1013..6d9dcbf 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -2057,8 +2057,9 @@
+ #define MII_TG3_EXT_STAT 0x11 /* Extended status register */
+ #define MII_TG3_EXT_STAT_LPASS 0x0100
+
++#define MII_TG3_RXR_COUNTERS 0x14 /* Local/Remote Receiver Counts */
+ #define MII_TG3_DSP_RW_PORT 0x15 /* DSP coefficient read/write port */
+-
++#define MII_TG3_DSP_CONTROL 0x16 /* DSP control register */
+ #define MII_TG3_DSP_ADDRESS 0x17 /* DSP address register */
+
+ #define MII_TG3_DSP_TAP1 0x0001
+@@ -2066,6 +2067,7 @@
+ #define MII_TG3_DSP_AADJ1CH0 0x001f
+ #define MII_TG3_DSP_AADJ1CH3 0x601f
+ #define MII_TG3_DSP_AADJ1CH3_ADCCKADJ 0x0002
++#define MII_TG3_DSP_EXP1_INT_STAT 0x0f01
+ #define MII_TG3_DSP_EXP8 0x0f08
+ #define MII_TG3_DSP_EXP8_REJ2MHz 0x0001
+ #define MII_TG3_DSP_EXP8_AEDW 0x0200
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0151-tg3-Create-phy_flags-and-migrate-phy_is_low_power.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0151-tg3-Create-phy_flags-and-migrate-phy_is_low_power.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,186 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 2 Aug 2010 11:26:06 +0000
+Subject: [PATCH 151/207] tg3: Create phy_flags and migrate phy_is_low_power
+
+commit 80096068bc21420ba4d690341a3c70c49017d167 upstream.
+
+This patch deletes the link_config.phy_is_low_power flag and creates a
+new phy_flags device member to store all phy related settings. All the
+code is converted accordingly.
+
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 35 +++++++++++++++++------------------
+ drivers/net/tg3.h | 4 +++-
+ 2 files changed, 20 insertions(+), 19 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 81d9b4f..76a7587 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -1543,8 +1543,8 @@ static void tg3_phy_start(struct tg3 *tp)
+
+ phydev = tp->mdio_bus->phy_map[TG3_PHY_MII_ADDR];
+
+- if (tp->link_config.phy_is_low_power) {
+- tp->link_config.phy_is_low_power = 0;
++ if (tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER) {
++ tp->phy_flags &= ~TG3_PHYFLG_IS_LOW_POWER;
+ phydev->speed = tp->link_config.orig_speed;
+ phydev->duplex = tp->link_config.orig_duplex;
+ phydev->autoneg = tp->link_config.orig_autoneg;
+@@ -2559,13 +2559,13 @@ static int tg3_set_power_state(struct tg3 *tp, pci_power_t state)
+ if (tp->tg3_flags3 & TG3_FLG3_USE_PHYLIB) {
+ do_low_power = false;
+ if ((tp->tg3_flags3 & TG3_FLG3_PHY_CONNECTED) &&
+- !tp->link_config.phy_is_low_power) {
++ !(tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER)) {
+ struct phy_device *phydev;
+ u32 phyid, advertising;
+
+ phydev = tp->mdio_bus->phy_map[TG3_PHY_MII_ADDR];
+
+- tp->link_config.phy_is_low_power = 1;
++ tp->phy_flags |= TG3_PHYFLG_IS_LOW_POWER;
+
+ tp->link_config.orig_speed = phydev->speed;
+ tp->link_config.orig_duplex = phydev->duplex;
+@@ -2604,8 +2604,8 @@ static int tg3_set_power_state(struct tg3 *tp, pci_power_t state)
+ } else {
+ do_low_power = true;
+
+- if (tp->link_config.phy_is_low_power == 0) {
+- tp->link_config.phy_is_low_power = 1;
++ if (!(tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER)) {
++ tp->phy_flags |= TG3_PHYFLG_IS_LOW_POWER;
+ tp->link_config.orig_speed = tp->link_config.speed;
+ tp->link_config.orig_duplex = tp->link_config.duplex;
+ tp->link_config.orig_autoneg = tp->link_config.autoneg;
+@@ -2836,7 +2836,7 @@ static void tg3_phy_copper_begin(struct tg3 *tp)
+ u32 new_adv;
+ int i;
+
+- if (tp->link_config.phy_is_low_power) {
++ if (tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER) {
+ /* Entering low power mode. Disable gigabit and
+ * 100baseT advertisements.
+ */
+@@ -3237,7 +3237,7 @@ static int tg3_setup_copper_phy(struct tg3 *tp, int force_reset)
+ }
+
+ relink:
+- if (current_link_up == 0 || tp->link_config.phy_is_low_power) {
++ if (current_link_up == 0 || (tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER)) {
+ u32 tmp;
+
+ tg3_phy_copper_begin(tp);
+@@ -8320,8 +8320,8 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ }
+
+ if (!(tp->tg3_flags3 & TG3_FLG3_USE_PHYLIB)) {
+- if (tp->link_config.phy_is_low_power) {
+- tp->link_config.phy_is_low_power = 0;
++ if (tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER) {
++ tp->phy_flags &= ~TG3_PHYFLG_IS_LOW_POWER;
+ tp->link_config.speed = tp->link_config.orig_speed;
+ tp->link_config.duplex = tp->link_config.orig_duplex;
+ tp->link_config.autoneg = tp->link_config.orig_autoneg;
+@@ -9379,7 +9379,7 @@ static void tg3_get_regs(struct net_device *dev,
+
+ memset(p, 0, TG3_REGDUMP_LEN);
+
+- if (tp->link_config.phy_is_low_power)
++ if (tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER)
+ return;
+
+ tg3_full_lock(tp, 0);
+@@ -9458,7 +9458,7 @@ static int tg3_get_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
+ if (tp->tg3_flags3 & TG3_FLG3_NO_NVRAM)
+ return -EINVAL;
+
+- if (tp->link_config.phy_is_low_power)
++ if (tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER)
+ return -EAGAIN;
+
+ offset = eeprom->offset;
+@@ -9520,7 +9520,7 @@ static int tg3_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
+ u8 *buf;
+ __be32 start, end;
+
+- if (tp->link_config.phy_is_low_power)
++ if (tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER)
+ return -EAGAIN;
+
+ if ((tp->tg3_flags3 & TG3_FLG3_NO_NVRAM) ||
+@@ -10860,7 +10860,7 @@ static void tg3_self_test(struct net_device *dev, struct ethtool_test *etest,
+ {
+ struct tg3 *tp = netdev_priv(dev);
+
+- if (tp->link_config.phy_is_low_power)
++ if (tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER)
+ tg3_set_power_state(tp, PCI_D0);
+
+ memset(data, 0, sizeof(u64) * TG3_NUM_TEST);
+@@ -10928,7 +10928,7 @@ static void tg3_self_test(struct net_device *dev, struct ethtool_test *etest,
+ if (irq_sync && !err2)
+ tg3_phy_start(tp);
+ }
+- if (tp->link_config.phy_is_low_power)
++ if (tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER)
+ tg3_set_power_state(tp, PCI_D3hot);
+
+ }
+@@ -10958,7 +10958,7 @@ static int tg3_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
+ if (tp->tg3_flags2 & TG3_FLG2_PHY_SERDES)
+ break; /* We have no PHY */
+
+- if (tp->link_config.phy_is_low_power)
++ if (tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER)
+ return -EAGAIN;
+
+ spin_lock_bh(&tp->lock);
+@@ -10974,7 +10974,7 @@ static int tg3_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
+ if (tp->tg3_flags2 & TG3_FLG2_PHY_SERDES)
+ break; /* We have no PHY */
+
+- if (tp->link_config.phy_is_low_power)
++ if (tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER)
+ return -EAGAIN;
+
+ spin_lock_bh(&tp->lock);
+@@ -14120,7 +14120,6 @@ static void __devinit tg3_init_link_config(struct tg3 *tp)
+ tp->link_config.autoneg = AUTONEG_ENABLE;
+ tp->link_config.active_speed = SPEED_INVALID;
+ tp->link_config.active_duplex = DUPLEX_INVALID;
+- tp->link_config.phy_is_low_power = 0;
+ tp->link_config.orig_speed = SPEED_INVALID;
+ tp->link_config.orig_duplex = DUPLEX_INVALID;
+ tp->link_config.orig_autoneg = AUTONEG_INVALID;
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 6d9dcbf..b8f3df3 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -2534,7 +2534,6 @@ struct tg3_link_config {
+ /* When we go in and out of low power mode we need
+ * to swap with this state.
+ */
+- int phy_is_low_power;
+ u16 orig_speed;
+ u8 orig_duplex;
+ u8 orig_autoneg;
+@@ -2965,6 +2964,9 @@ struct tg3 {
+ (X) == TG3_PHY_ID_BCM57765 || (X) == TG3_PHY_ID_BCM5719C || \
+ (X) == TG3_PHY_ID_BCM8002)
+
++ u32 phy_flags;
++#define TG3_PHYFLG_IS_LOW_POWER 0x00000001
++
+ u32 led_ctrl;
+ u32 phy_otp;
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0152-tg3-Migrate-tg3_flags-to-phy_flags.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0152-tg3-Migrate-tg3_flags-to-phy_flags.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,1095 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 2 Aug 2010 11:26:07 +0000
+Subject: [PATCH 152/207] tg3: Migrate tg3_flags to phy_flags
+
+commit f07e9af31e6e1bf2a499e1f52cbf0982619fa611 upstream.
+
+This patch moves most of the phy related flag definitions over to the
+phyflags member and changes the code accordingly.
+
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 275 +++++++++++++++++++++++++++--------------------------
+ drivers/net/tg3.h | 36 ++++----
+ 2 files changed, 159 insertions(+), 152 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 76a7587..fde3ba0 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -879,7 +879,7 @@ static int tg3_writephy(struct tg3 *tp, int reg, u32 val)
+ unsigned int loops;
+ int ret;
+
+- if ((tp->tg3_flags3 & TG3_FLG3_PHY_IS_FET) &&
++ if ((tp->phy_flags & TG3_PHYFLG_IS_FET) &&
+ (reg == MII_TG3_CTRL || reg == MII_TG3_AUX_CTRL))
+ return 0;
+
+@@ -1175,7 +1175,7 @@ static int tg3_mdio_init(struct tg3 *tp)
+ case PHY_ID_BCMAC131:
+ phydev->interface = PHY_INTERFACE_MODE_MII;
+ phydev->dev_flags |= PHY_BRCM_AUTO_PWRDWN_ENABLE;
+- tp->tg3_flags3 |= TG3_FLG3_PHY_IS_FET;
++ tp->phy_flags |= TG3_PHYFLG_IS_FET;
+ break;
+ }
+
+@@ -1268,7 +1268,7 @@ static void tg3_ump_link_report(struct tg3 *tp)
+ tg3_write_mem(tp, NIC_SRAM_FW_CMD_DATA_MBOX + 4, val);
+
+ val = 0;
+- if (!(tp->tg3_flags2 & TG3_FLG2_MII_SERDES)) {
++ if (!(tp->phy_flags & TG3_PHYFLG_MII_SERDES)) {
+ if (!tg3_readphy(tp, MII_CTRL1000, ®))
+ val = reg << 16;
+ if (!tg3_readphy(tp, MII_STAT1000, ®))
+@@ -1376,7 +1376,7 @@ static void tg3_setup_flow_control(struct tg3 *tp, u32 lcladv, u32 rmtadv)
+
+ if (autoneg == AUTONEG_ENABLE &&
+ (tp->tg3_flags & TG3_FLAG_PAUSE_AUTONEG)) {
+- if (tp->tg3_flags2 & TG3_FLG2_ANY_SERDES)
++ if (tp->phy_flags & TG3_PHYFLG_ANY_SERDES)
+ flowctrl = tg3_resolve_flowctrl_1000X(lcladv, rmtadv);
+ else
+ flowctrl = mii_resolve_flowctrl_fdx(lcladv, rmtadv);
+@@ -1490,7 +1490,7 @@ static int tg3_phy_init(struct tg3 *tp)
+ {
+ struct phy_device *phydev;
+
+- if (tp->tg3_flags3 & TG3_FLG3_PHY_CONNECTED)
++ if (tp->phy_flags & TG3_PHYFLG_IS_CONNECTED)
+ return 0;
+
+ /* Bring the PHY back to a known state. */
+@@ -1510,7 +1510,7 @@ static int tg3_phy_init(struct tg3 *tp)
+ switch (phydev->interface) {
+ case PHY_INTERFACE_MODE_GMII:
+ case PHY_INTERFACE_MODE_RGMII:
+- if (!(tp->tg3_flags & TG3_FLAG_10_100_ONLY)) {
++ if (!(tp->phy_flags & TG3_PHYFLG_10_100_ONLY)) {
+ phydev->supported &= (PHY_GBIT_FEATURES |
+ SUPPORTED_Pause |
+ SUPPORTED_Asym_Pause);
+@@ -1527,7 +1527,7 @@ static int tg3_phy_init(struct tg3 *tp)
+ return -EINVAL;
+ }
+
+- tp->tg3_flags3 |= TG3_FLG3_PHY_CONNECTED;
++ tp->phy_flags |= TG3_PHYFLG_IS_CONNECTED;
+
+ phydev->advertising = phydev->supported;
+
+@@ -1538,7 +1538,7 @@ static void tg3_phy_start(struct tg3 *tp)
+ {
+ struct phy_device *phydev;
+
+- if (!(tp->tg3_flags3 & TG3_FLG3_PHY_CONNECTED))
++ if (!(tp->phy_flags & TG3_PHYFLG_IS_CONNECTED))
+ return;
+
+ phydev = tp->mdio_bus->phy_map[TG3_PHY_MII_ADDR];
+@@ -1558,7 +1558,7 @@ static void tg3_phy_start(struct tg3 *tp)
+
+ static void tg3_phy_stop(struct tg3 *tp)
+ {
+- if (!(tp->tg3_flags3 & TG3_FLG3_PHY_CONNECTED))
++ if (!(tp->phy_flags & TG3_PHYFLG_IS_CONNECTED))
+ return;
+
+ phy_stop(tp->mdio_bus->phy_map[TG3_PHY_MII_ADDR]);
+@@ -1566,9 +1566,9 @@ static void tg3_phy_stop(struct tg3 *tp)
+
+ static void tg3_phy_fini(struct tg3 *tp)
+ {
+- if (tp->tg3_flags3 & TG3_FLG3_PHY_CONNECTED) {
++ if (tp->phy_flags & TG3_PHYFLG_IS_CONNECTED) {
+ phy_disconnect(tp->mdio_bus->phy_map[TG3_PHY_MII_ADDR]);
+- tp->tg3_flags3 &= ~TG3_FLG3_PHY_CONNECTED;
++ tp->phy_flags &= ~TG3_PHYFLG_IS_CONNECTED;
+ }
+ }
+
+@@ -1610,10 +1610,10 @@ static void tg3_phy_toggle_apd(struct tg3 *tp, bool enable)
+ if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS) ||
+ ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719) &&
+- (tp->tg3_flags2 & TG3_FLG2_MII_SERDES)))
++ (tp->phy_flags & TG3_PHYFLG_MII_SERDES)))
+ return;
+
+- if (tp->tg3_flags3 & TG3_FLG3_PHY_IS_FET) {
++ if (tp->phy_flags & TG3_PHYFLG_IS_FET) {
+ tg3_phy_fet_toggle_apd(tp, enable);
+ return;
+ }
+@@ -1644,10 +1644,10 @@ static void tg3_phy_toggle_automdix(struct tg3 *tp, int enable)
+ u32 phy;
+
+ if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS) ||
+- (tp->tg3_flags2 & TG3_FLG2_ANY_SERDES))
++ (tp->phy_flags & TG3_PHYFLG_ANY_SERDES))
+ return;
+
+- if (tp->tg3_flags3 & TG3_FLG3_PHY_IS_FET) {
++ if (tp->phy_flags & TG3_PHYFLG_IS_FET) {
+ u32 ephy;
+
+ if (!tg3_readphy(tp, MII_TG3_FET_TEST, &ephy)) {
+@@ -1683,7 +1683,7 @@ static void tg3_phy_set_wirespeed(struct tg3 *tp)
+ {
+ u32 val;
+
+- if (tp->tg3_flags2 & TG3_FLG2_NO_ETH_WIRE_SPEED)
++ if (tp->phy_flags & TG3_PHYFLG_NO_ETH_WIRE_SPEED)
+ return;
+
+ if (!tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x7007) &&
+@@ -1984,37 +1984,37 @@ static int tg3_phy_reset(struct tg3 *tp)
+
+ if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719) &&
+- (tp->tg3_flags2 & TG3_FLG2_MII_SERDES))
++ (tp->phy_flags & TG3_PHYFLG_MII_SERDES))
+ return 0;
+
+ tg3_phy_apply_otp(tp);
+
+- if (tp->tg3_flags3 & TG3_FLG3_PHY_ENABLE_APD)
++ if (tp->phy_flags & TG3_PHYFLG_ENABLE_APD)
+ tg3_phy_toggle_apd(tp, true);
+ else
+ tg3_phy_toggle_apd(tp, false);
+
+ out:
+- if (tp->tg3_flags2 & TG3_FLG2_PHY_ADC_BUG) {
++ if (tp->phy_flags & TG3_PHYFLG_ADC_BUG) {
+ tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x0c00);
+ tg3_phydsp_write(tp, 0x201f, 0x2aaa);
+ tg3_phydsp_write(tp, 0x000a, 0x0323);
+ tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x0400);
+ }
+- if (tp->tg3_flags2 & TG3_FLG2_PHY_5704_A0_BUG) {
++ if (tp->phy_flags & TG3_PHYFLG_5704_A0_BUG) {
+ tg3_writephy(tp, MII_TG3_MISC_SHDW, 0x8d68);
+ tg3_writephy(tp, MII_TG3_MISC_SHDW, 0x8d68);
+ }
+- if (tp->tg3_flags2 & TG3_FLG2_PHY_BER_BUG) {
++ if (tp->phy_flags & TG3_PHYFLG_BER_BUG) {
+ tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x0c00);
+ tg3_phydsp_write(tp, 0x000a, 0x310b);
+ tg3_phydsp_write(tp, 0x201f, 0x9506);
+ tg3_phydsp_write(tp, 0x401f, 0x14e2);
+ tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x0400);
+- } else if (tp->tg3_flags2 & TG3_FLG2_PHY_JITTER_BUG) {
++ } else if (tp->phy_flags & TG3_PHYFLG_JITTER_BUG) {
+ tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x0c00);
+ tg3_writephy(tp, MII_TG3_DSP_ADDRESS, 0x000a);
+- if (tp->tg3_flags2 & TG3_FLG2_PHY_ADJUST_TRIM) {
++ if (tp->phy_flags & TG3_PHYFLG_ADJUST_TRIM) {
+ tg3_writephy(tp, MII_TG3_DSP_RW_PORT, 0x110b);
+ tg3_writephy(tp, MII_TG3_TEST1,
+ MII_TG3_TEST1_TRIM_EN | 0x4);
+@@ -2199,7 +2199,7 @@ static void tg3_power_down_phy(struct tg3 *tp, bool do_low_power)
+ {
+ u32 val;
+
+- if (tp->tg3_flags2 & TG3_FLG2_PHY_SERDES) {
++ if (tp->phy_flags & TG3_PHYFLG_PHY_SERDES) {
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) {
+ u32 sg_dig_ctrl = tr32(SG_DIG_CTRL);
+ u32 serdes_cfg = tr32(MAC_SERDES_CFG);
+@@ -2218,7 +2218,7 @@ static void tg3_power_down_phy(struct tg3 *tp, bool do_low_power)
+ tw32_f(GRC_MISC_CFG, val | GRC_MISC_CFG_EPHY_IDDQ);
+ udelay(40);
+ return;
+- } else if (tp->tg3_flags3 & TG3_FLG3_PHY_IS_FET) {
++ } else if (tp->phy_flags & TG3_PHYFLG_IS_FET) {
+ u32 phytest;
+ if (!tg3_readphy(tp, MII_TG3_FET_TEST, &phytest)) {
+ u32 phy;
+@@ -2255,7 +2255,7 @@ static void tg3_power_down_phy(struct tg3 *tp, bool do_low_power)
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704 ||
+ (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5780 &&
+- (tp->tg3_flags2 & TG3_FLG2_MII_SERDES)))
++ (tp->phy_flags & TG3_PHYFLG_MII_SERDES)))
+ return;
+
+ if (GET_CHIP_REV(tp->pci_chip_rev_id) == CHIPREV_5784_AX ||
+@@ -2558,7 +2558,7 @@ static int tg3_set_power_state(struct tg3 *tp, pci_power_t state)
+
+ if (tp->tg3_flags3 & TG3_FLG3_USE_PHYLIB) {
+ do_low_power = false;
+- if ((tp->tg3_flags3 & TG3_FLG3_PHY_CONNECTED) &&
++ if ((tp->phy_flags & TG3_PHYFLG_IS_CONNECTED) &&
+ !(tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER)) {
+ struct phy_device *phydev;
+ u32 phyid, advertising;
+@@ -2611,7 +2611,7 @@ static int tg3_set_power_state(struct tg3 *tp, pci_power_t state)
+ tp->link_config.orig_autoneg = tp->link_config.autoneg;
+ }
+
+- if (!(tp->tg3_flags2 & TG3_FLG2_ANY_SERDES)) {
++ if (!(tp->phy_flags & TG3_PHYFLG_ANY_SERDES)) {
+ tp->link_config.speed = SPEED_10;
+ tp->link_config.duplex = DUPLEX_HALF;
+ tp->link_config.autoneg = AUTONEG_ENABLE;
+@@ -2644,13 +2644,13 @@ static int tg3_set_power_state(struct tg3 *tp, pci_power_t state)
+ if (device_should_wake) {
+ u32 mac_mode;
+
+- if (!(tp->tg3_flags2 & TG3_FLG2_PHY_SERDES)) {
++ if (!(tp->phy_flags & TG3_PHYFLG_PHY_SERDES)) {
+ if (do_low_power) {
+ tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x5a);
+ udelay(40);
+ }
+
+- if (tp->tg3_flags2 & TG3_FLG2_MII_SERDES)
++ if (tp->phy_flags & TG3_PHYFLG_MII_SERDES)
+ mac_mode = MAC_MODE_PORT_MODE_GMII;
+ else
+ mac_mode = MAC_MODE_PORT_MODE_MII;
+@@ -2818,7 +2818,7 @@ static void tg3_aux_stat_to_speed_duplex(struct tg3 *tp, u32 val, u16 *speed, u8
+ break;
+
+ default:
+- if (tp->tg3_flags3 & TG3_FLG3_PHY_IS_FET) {
++ if (tp->phy_flags & TG3_PHYFLG_IS_FET) {
+ *speed = (val & MII_TG3_AUX_STAT_100) ? SPEED_100 :
+ SPEED_10;
+ *duplex = (val & MII_TG3_AUX_STAT_FULL) ? DUPLEX_FULL :
+@@ -2849,7 +2849,7 @@ static void tg3_phy_copper_begin(struct tg3 *tp)
+
+ tg3_writephy(tp, MII_ADVERTISE, new_adv);
+ } else if (tp->link_config.speed == SPEED_INVALID) {
+- if (tp->tg3_flags & TG3_FLAG_10_100_ONLY)
++ if (tp->phy_flags & TG3_PHYFLG_10_100_ONLY)
+ tp->link_config.advertising &=
+ ~(ADVERTISED_1000baseT_Half |
+ ADVERTISED_1000baseT_Full);
+@@ -2875,7 +2875,7 @@ static void tg3_phy_copper_begin(struct tg3 *tp)
+ new_adv |= MII_TG3_CTRL_ADV_1000_HALF;
+ if (tp->link_config.advertising & ADVERTISED_1000baseT_Full)
+ new_adv |= MII_TG3_CTRL_ADV_1000_FULL;
+- if (!(tp->tg3_flags & TG3_FLAG_10_100_ONLY) &&
++ if (!(tp->phy_flags & TG3_PHYFLG_10_100_ONLY) &&
+ (tp->pci_chip_rev_id == CHIPREV_ID_5701_A0 ||
+ tp->pci_chip_rev_id == CHIPREV_ID_5701_B0))
+ new_adv |= (MII_TG3_CTRL_AS_MASTER |
+@@ -3006,7 +3006,7 @@ static int tg3_copper_is_advertising_all(struct tg3 *tp, u32 mask)
+
+ if ((adv_reg & all_mask) != all_mask)
+ return 0;
+- if (!(tp->tg3_flags & TG3_FLAG_10_100_ONLY)) {
++ if (!(tp->phy_flags & TG3_PHYFLG_10_100_ONLY)) {
+ u32 tg3_ctrl;
+
+ all_mask = 0;
+@@ -3143,9 +3143,9 @@ static int tg3_setup_copper_phy(struct tg3 *tp, int force_reset)
+ tg3_readphy(tp, MII_TG3_ISTAT, &dummy);
+ tg3_readphy(tp, MII_TG3_ISTAT, &dummy);
+
+- if (tp->tg3_flags & TG3_FLAG_USE_MI_INTERRUPT)
++ if (tp->phy_flags & TG3_PHYFLG_USE_MI_INTERRUPT)
+ tg3_writephy(tp, MII_TG3_IMASK, ~MII_TG3_INT_LINKCHG);
+- else if (!(tp->tg3_flags3 & TG3_FLG3_PHY_IS_FET))
++ else if (!(tp->phy_flags & TG3_PHYFLG_IS_FET))
+ tg3_writephy(tp, MII_TG3_IMASK, ~0);
+
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700 ||
+@@ -3161,7 +3161,7 @@ static int tg3_setup_copper_phy(struct tg3 *tp, int force_reset)
+ current_speed = SPEED_INVALID;
+ current_duplex = DUPLEX_INVALID;
+
+- if (tp->tg3_flags2 & TG3_FLG2_CAPACITIVE_COUPLING) {
++ if (tp->phy_flags & TG3_PHYFLG_CAPACITIVE_COUPLING) {
+ u32 val;
+
+ tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x4007);
+@@ -3255,7 +3255,7 @@ relink:
+ tp->mac_mode |= MAC_MODE_PORT_MODE_MII;
+ else
+ tp->mac_mode |= MAC_MODE_PORT_MODE_GMII;
+- } else if (tp->tg3_flags3 & TG3_FLG3_PHY_IS_FET)
++ } else if (tp->phy_flags & TG3_PHYFLG_IS_FET)
+ tp->mac_mode |= MAC_MODE_PORT_MODE_MII;
+ else
+ tp->mac_mode |= MAC_MODE_PORT_MODE_GMII;
+@@ -3806,7 +3806,7 @@ static int tg3_setup_fiber_hw_autoneg(struct tg3 *tp, u32 mac_status)
+ expected_sg_dig_ctrl |= SG_DIG_ASYM_PAUSE;
+
+ if (sg_dig_ctrl != expected_sg_dig_ctrl) {
+- if ((tp->tg3_flags2 & TG3_FLG2_PARALLEL_DETECT) &&
++ if ((tp->phy_flags & TG3_PHYFLG_PARALLEL_DETECT) &&
+ tp->serdes_counter &&
+ ((mac_status & (MAC_STATUS_PCS_SYNCED |
+ MAC_STATUS_RCVD_CFG)) ==
+@@ -3823,7 +3823,7 @@ restart_autoneg:
+ tw32_f(SG_DIG_CTRL, expected_sg_dig_ctrl);
+
+ tp->serdes_counter = SERDES_AN_TIMEOUT_5704S;
+- tp->tg3_flags2 &= ~TG3_FLG2_PARALLEL_DETECT;
++ tp->phy_flags &= ~TG3_PHYFLG_PARALLEL_DETECT;
+ } else if (mac_status & (MAC_STATUS_PCS_SYNCED |
+ MAC_STATUS_SIGNAL_DET)) {
+ sg_dig_status = tr32(SG_DIG_STATUS);
+@@ -3846,7 +3846,7 @@ restart_autoneg:
+ tg3_setup_flow_control(tp, local_adv, remote_adv);
+ current_link_up = 1;
+ tp->serdes_counter = 0;
+- tp->tg3_flags2 &= ~TG3_FLG2_PARALLEL_DETECT;
++ tp->phy_flags &= ~TG3_PHYFLG_PARALLEL_DETECT;
+ } else if (!(sg_dig_status & SG_DIG_AUTONEG_COMPLETE)) {
+ if (tp->serdes_counter)
+ tp->serdes_counter--;
+@@ -3873,8 +3873,8 @@ restart_autoneg:
+ !(mac_status & MAC_STATUS_RCVD_CFG)) {
+ tg3_setup_flow_control(tp, 0, 0);
+ current_link_up = 1;
+- tp->tg3_flags2 |=
+- TG3_FLG2_PARALLEL_DETECT;
++ tp->phy_flags |=
++ TG3_PHYFLG_PARALLEL_DETECT;
+ tp->serdes_counter =
+ SERDES_PARALLEL_DET_TIMEOUT;
+ } else
+@@ -3883,7 +3883,7 @@ restart_autoneg:
+ }
+ } else {
+ tp->serdes_counter = SERDES_AN_TIMEOUT_5704S;
+- tp->tg3_flags2 &= ~TG3_FLG2_PARALLEL_DETECT;
++ tp->phy_flags &= ~TG3_PHYFLG_PARALLEL_DETECT;
+ }
+
+ out:
+@@ -4100,7 +4100,7 @@ static int tg3_setup_fiber_mii_phy(struct tg3 *tp, int force_reset)
+ err |= tg3_readphy(tp, MII_BMCR, &bmcr);
+
+ if ((tp->link_config.autoneg == AUTONEG_ENABLE) && !force_reset &&
+- (tp->tg3_flags2 & TG3_FLG2_PARALLEL_DETECT)) {
++ (tp->phy_flags & TG3_PHYFLG_PARALLEL_DETECT)) {
+ /* do nothing, just check for link up at the end */
+ } else if (tp->link_config.autoneg == AUTONEG_ENABLE) {
+ u32 adv, new_adv;
+@@ -4125,7 +4125,7 @@ static int tg3_setup_fiber_mii_phy(struct tg3 *tp, int force_reset)
+
+ tw32_f(MAC_EVENT, MAC_EVENT_LNKSTATE_CHANGED);
+ tp->serdes_counter = SERDES_AN_TIMEOUT_5714S;
+- tp->tg3_flags2 &= ~TG3_FLG2_PARALLEL_DETECT;
++ tp->phy_flags &= ~TG3_PHYFLG_PARALLEL_DETECT;
+
+ return err;
+ }
+@@ -4170,7 +4170,7 @@ static int tg3_setup_fiber_mii_phy(struct tg3 *tp, int force_reset)
+ else
+ bmsr &= ~BMSR_LSTATUS;
+ }
+- tp->tg3_flags2 &= ~TG3_FLG2_PARALLEL_DETECT;
++ tp->phy_flags &= ~TG3_PHYFLG_PARALLEL_DETECT;
+ }
+ }
+
+@@ -4225,7 +4225,7 @@ static int tg3_setup_fiber_mii_phy(struct tg3 *tp, int force_reset)
+ netif_carrier_on(tp->dev);
+ else {
+ netif_carrier_off(tp->dev);
+- tp->tg3_flags2 &= ~TG3_FLG2_PARALLEL_DETECT;
++ tp->phy_flags &= ~TG3_PHYFLG_PARALLEL_DETECT;
+ }
+ tg3_link_report(tp);
+ }
+@@ -4267,12 +4267,12 @@ static void tg3_serdes_parallel_detect(struct tg3 *tp)
+ bmcr &= ~BMCR_ANENABLE;
+ bmcr |= BMCR_SPEED1000 | BMCR_FULLDPLX;
+ tg3_writephy(tp, MII_BMCR, bmcr);
+- tp->tg3_flags2 |= TG3_FLG2_PARALLEL_DETECT;
++ tp->phy_flags |= TG3_PHYFLG_PARALLEL_DETECT;
+ }
+ }
+ } else if (netif_carrier_ok(tp->dev) &&
+ (tp->link_config.autoneg == AUTONEG_ENABLE) &&
+- (tp->tg3_flags2 & TG3_FLG2_PARALLEL_DETECT)) {
++ (tp->phy_flags & TG3_PHYFLG_PARALLEL_DETECT)) {
+ u32 phy2;
+
+ /* Select expansion interrupt status register */
+@@ -4286,7 +4286,7 @@ static void tg3_serdes_parallel_detect(struct tg3 *tp)
+ tg3_readphy(tp, MII_BMCR, &bmcr);
+ tg3_writephy(tp, MII_BMCR, bmcr | BMCR_ANENABLE);
+
+- tp->tg3_flags2 &= ~TG3_FLG2_PARALLEL_DETECT;
++ tp->phy_flags &= ~TG3_PHYFLG_PARALLEL_DETECT;
+
+ }
+ }
+@@ -4296,9 +4296,9 @@ static int tg3_setup_phy(struct tg3 *tp, int force_reset)
+ {
+ int err;
+
+- if (tp->tg3_flags2 & TG3_FLG2_PHY_SERDES)
++ if (tp->phy_flags & TG3_PHYFLG_PHY_SERDES)
+ err = tg3_setup_fiber_phy(tp, force_reset);
+- else if (tp->tg3_flags2 & TG3_FLG2_MII_SERDES)
++ else if (tp->phy_flags & TG3_PHYFLG_MII_SERDES)
+ err = tg3_setup_fiber_mii_phy(tp, force_reset);
+ else
+ err = tg3_setup_copper_phy(tp, force_reset);
+@@ -7066,10 +7066,10 @@ static int tg3_chip_reset(struct tg3 *tp)
+ tw32(TG3PCI_CLOCK_CTRL, tp->pci_clock_ctrl);
+ }
+
+- if (tp->tg3_flags2 & TG3_FLG2_PHY_SERDES) {
++ if (tp->phy_flags & TG3_PHYFLG_PHY_SERDES) {
+ tp->mac_mode = MAC_MODE_PORT_MODE_TBI;
+ tw32_f(MAC_MODE, tp->mac_mode);
+- } else if (tp->tg3_flags2 & TG3_FLG2_MII_SERDES) {
++ } else if (tp->phy_flags & TG3_PHYFLG_MII_SERDES) {
+ tp->mac_mode = MAC_MODE_PORT_MODE_GMII;
+ tw32_f(MAC_MODE, tp->mac_mode);
+ } else if (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE) {
+@@ -8073,8 +8073,8 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS))
+ tw32(RCVLSC_MODE, RCVLSC_MODE_ENABLE | RCVLSC_MODE_ATTN_ENABLE);
+
+- if (tp->tg3_flags2 & TG3_FLG2_MII_SERDES) {
+- tp->tg3_flags2 &= ~TG3_FLG2_PARALLEL_DETECT;
++ if (tp->phy_flags & TG3_PHYFLG_MII_SERDES) {
++ tp->phy_flags &= ~TG3_PHYFLG_PARALLEL_DETECT;
+ /* reset to prevent losing 1st rx packet intermittently */
+ tw32_f(MAC_RX_MODE, RX_MODE_RESET);
+ udelay(10);
+@@ -8087,7 +8087,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ tp->mac_mode |= MAC_MODE_TXSTAT_ENABLE | MAC_MODE_RXSTAT_ENABLE |
+ MAC_MODE_TDE_ENABLE | MAC_MODE_RDE_ENABLE | MAC_MODE_FHDE_ENABLE;
+ if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS) &&
+- !(tp->tg3_flags2 & TG3_FLG2_PHY_SERDES) &&
++ !(tp->phy_flags & TG3_PHYFLG_PHY_SERDES) &&
+ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5700)
+ tp->mac_mode |= MAC_MODE_LINK_POLARITY;
+ tw32_f(MAC_MODE, tp->mac_mode | MAC_MODE_RXSTAT_CLEAR | MAC_MODE_TXSTAT_CLEAR);
+@@ -8272,16 +8272,16 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ tw32(MAC_LED_CTRL, tp->led_ctrl);
+
+ tw32(MAC_MI_STAT, MAC_MI_STAT_LNKSTAT_ATTN_ENAB);
+- if (tp->tg3_flags2 & TG3_FLG2_PHY_SERDES) {
++ if (tp->phy_flags & TG3_PHYFLG_PHY_SERDES) {
+ tw32_f(MAC_RX_MODE, RX_MODE_RESET);
+ udelay(10);
+ }
+ tw32_f(MAC_RX_MODE, tp->rx_mode);
+ udelay(10);
+
+- if (tp->tg3_flags2 & TG3_FLG2_PHY_SERDES) {
++ if (tp->phy_flags & TG3_PHYFLG_PHY_SERDES) {
+ if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) &&
+- !(tp->tg3_flags2 & TG3_FLG2_SERDES_PREEMPHASIS)) {
++ !(tp->phy_flags & TG3_PHYFLG_SERDES_PREEMPHASIS)) {
+ /* Set drive transmission level to 1.2V */
+ /* only if the signal pre-emphasis bit is not set */
+ val = tr32(MAC_SERDES_CFG);
+@@ -8303,12 +8303,12 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ tw32_f(MAC_LOW_WMARK_MAX_RX_FRAME, val);
+
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704 &&
+- (tp->tg3_flags2 & TG3_FLG2_PHY_SERDES)) {
++ (tp->phy_flags & TG3_PHYFLG_PHY_SERDES)) {
+ /* Use hardware link auto-negotiation */
+ tp->tg3_flags2 |= TG3_FLG2_HW_AUTONEG;
+ }
+
+- if ((tp->tg3_flags2 & TG3_FLG2_MII_SERDES) &&
++ if ((tp->phy_flags & TG3_PHYFLG_MII_SERDES) &&
+ (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5714)) {
+ u32 tmp;
+
+@@ -8331,8 +8331,8 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ if (err)
+ return err;
+
+- if (!(tp->tg3_flags2 & TG3_FLG2_PHY_SERDES) &&
+- !(tp->tg3_flags3 & TG3_FLG3_PHY_IS_FET)) {
++ if (!(tp->phy_flags & TG3_PHYFLG_PHY_SERDES) &&
++ !(tp->phy_flags & TG3_PHYFLG_IS_FET)) {
+ u32 tmp;
+
+ /* Clear CRC stats. */
+@@ -8507,7 +8507,7 @@ static void tg3_timer(unsigned long __opaque)
+ mac_stat = tr32(MAC_STATUS);
+
+ phy_event = 0;
+- if (tp->tg3_flags & TG3_FLAG_USE_MI_INTERRUPT) {
++ if (tp->phy_flags & TG3_PHYFLG_USE_MI_INTERRUPT) {
+ if (mac_stat & MAC_STATUS_MI_INTERRUPT)
+ phy_event = 1;
+ } else if (mac_stat & MAC_STATUS_LNKSTATE_CHANGED)
+@@ -8539,7 +8539,7 @@ static void tg3_timer(unsigned long __opaque)
+ }
+ tg3_setup_phy(tp, 0);
+ }
+- } else if ((tp->tg3_flags2 & TG3_FLG2_MII_SERDES) &&
++ } else if ((tp->phy_flags & TG3_PHYFLG_MII_SERDES) &&
+ (tp->tg3_flags2 & TG3_FLG2_5780_CLASS)) {
+ tg3_serdes_parallel_detect(tp);
+ }
+@@ -9080,7 +9080,7 @@ static unsigned long calc_crc_errors(struct tg3 *tp)
+ {
+ struct tg3_hw_stats *hw_stats = tp->hw_stats;
+
+- if (!(tp->tg3_flags2 & TG3_FLG2_PHY_SERDES) &&
++ if (!(tp->phy_flags & TG3_PHYFLG_PHY_SERDES) &&
+ (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701)) {
+ u32 val;
+@@ -9577,7 +9577,7 @@ static int tg3_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
+
+ if (tp->tg3_flags3 & TG3_FLG3_USE_PHYLIB) {
+ struct phy_device *phydev;
+- if (!(tp->tg3_flags3 & TG3_FLG3_PHY_CONNECTED))
++ if (!(tp->phy_flags & TG3_PHYFLG_IS_CONNECTED))
+ return -EAGAIN;
+ phydev = tp->mdio_bus->phy_map[TG3_PHY_MII_ADDR];
+ return phy_ethtool_gset(phydev, cmd);
+@@ -9585,11 +9585,11 @@ static int tg3_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
+
+ cmd->supported = (SUPPORTED_Autoneg);
+
+- if (!(tp->tg3_flags & TG3_FLAG_10_100_ONLY))
++ if (!(tp->phy_flags & TG3_PHYFLG_10_100_ONLY))
+ cmd->supported |= (SUPPORTED_1000baseT_Half |
+ SUPPORTED_1000baseT_Full);
+
+- if (!(tp->tg3_flags2 & TG3_FLG2_ANY_SERDES)) {
++ if (!(tp->phy_flags & TG3_PHYFLG_ANY_SERDES)) {
+ cmd->supported |= (SUPPORTED_100baseT_Half |
+ SUPPORTED_100baseT_Full |
+ SUPPORTED_10baseT_Half |
+@@ -9620,7 +9620,7 @@ static int tg3_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
+
+ if (tp->tg3_flags3 & TG3_FLG3_USE_PHYLIB) {
+ struct phy_device *phydev;
+- if (!(tp->tg3_flags3 & TG3_FLG3_PHY_CONNECTED))
++ if (!(tp->phy_flags & TG3_PHYFLG_IS_CONNECTED))
+ return -EAGAIN;
+ phydev = tp->mdio_bus->phy_map[TG3_PHY_MII_ADDR];
+ return phy_ethtool_sset(phydev, cmd);
+@@ -9640,11 +9640,11 @@ static int tg3_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
+ ADVERTISED_Pause |
+ ADVERTISED_Asym_Pause;
+
+- if (!(tp->tg3_flags & TG3_FLAG_10_100_ONLY))
++ if (!(tp->phy_flags & TG3_PHYFLG_10_100_ONLY))
+ mask |= ADVERTISED_1000baseT_Half |
+ ADVERTISED_1000baseT_Full;
+
+- if (!(tp->tg3_flags2 & TG3_FLG2_ANY_SERDES))
++ if (!(tp->phy_flags & TG3_PHYFLG_ANY_SERDES))
+ mask |= ADVERTISED_100baseT_Half |
+ ADVERTISED_100baseT_Full |
+ ADVERTISED_10baseT_Half |
+@@ -9665,7 +9665,7 @@ static int tg3_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
+
+ cmd->advertising &= mask;
+ } else {
+- if (tp->tg3_flags2 & TG3_FLG2_ANY_SERDES) {
++ if (tp->phy_flags & TG3_PHYFLG_ANY_SERDES) {
+ if (cmd->speed != SPEED_1000)
+ return -EINVAL;
+
+@@ -9801,11 +9801,11 @@ static int tg3_nway_reset(struct net_device *dev)
+ if (!netif_running(dev))
+ return -EAGAIN;
+
+- if (tp->tg3_flags2 & TG3_FLG2_PHY_SERDES)
++ if (tp->phy_flags & TG3_PHYFLG_PHY_SERDES)
+ return -EINVAL;
+
+ if (tp->tg3_flags3 & TG3_FLG3_USE_PHYLIB) {
+- if (!(tp->tg3_flags3 & TG3_FLG3_PHY_CONNECTED))
++ if (!(tp->phy_flags & TG3_PHYFLG_IS_CONNECTED))
+ return -EAGAIN;
+ r = phy_start_aneg(tp->mdio_bus->phy_map[TG3_PHY_MII_ADDR]);
+ } else {
+@@ -9816,7 +9816,7 @@ static int tg3_nway_reset(struct net_device *dev)
+ tg3_readphy(tp, MII_BMCR, &bmcr);
+ if (!tg3_readphy(tp, MII_BMCR, &bmcr) &&
+ ((bmcr & BMCR_ANENABLE) ||
+- (tp->tg3_flags2 & TG3_FLG2_PARALLEL_DETECT))) {
++ (tp->phy_flags & TG3_PHYFLG_PARALLEL_DETECT))) {
+ tg3_writephy(tp, MII_BMCR, bmcr | BMCR_ANRESTART |
+ BMCR_ANENABLE);
+ r = 0;
+@@ -9951,7 +9951,7 @@ static int tg3_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam
+ else
+ tp->tg3_flags &= ~TG3_FLAG_PAUSE_AUTONEG;
+
+- if (tp->tg3_flags3 & TG3_FLG3_PHY_CONNECTED) {
++ if (tp->phy_flags & TG3_PHYFLG_IS_CONNECTED) {
+ u32 oldadv = phydev->advertising &
+ (ADVERTISED_Pause | ADVERTISED_Asym_Pause);
+ if (oldadv != newadv) {
+@@ -10280,7 +10280,7 @@ static int tg3_test_link(struct tg3 *tp)
+ if (!netif_running(tp->dev))
+ return -ENODEV;
+
+- if (tp->tg3_flags2 & TG3_FLG2_ANY_SERDES)
++ if (tp->phy_flags & TG3_PHYFLG_ANY_SERDES)
+ max = TG3_SERDES_TIMEOUT_SEC;
+ else
+ max = TG3_COPPER_TIMEOUT_SEC;
+@@ -10642,7 +10642,7 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode)
+ MAC_MODE_PORT_INT_LPBACK;
+ if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS))
+ mac_mode |= MAC_MODE_LINK_POLARITY;
+- if (tp->tg3_flags & TG3_FLAG_10_100_ONLY)
++ if (tp->phy_flags & TG3_PHYFLG_10_100_ONLY)
+ mac_mode |= MAC_MODE_PORT_MODE_MII;
+ else
+ mac_mode |= MAC_MODE_PORT_MODE_GMII;
+@@ -10650,7 +10650,7 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode)
+ } else if (loopback_mode == TG3_PHY_LOOPBACK) {
+ u32 val;
+
+- if (tp->tg3_flags3 & TG3_FLG3_PHY_IS_FET) {
++ if (tp->phy_flags & TG3_PHYFLG_IS_FET) {
+ tg3_phy_fet_toggle_apd(tp, false);
+ val = BMCR_LOOPBACK | BMCR_FULLDPLX | BMCR_SPEED100;
+ } else
+@@ -10662,7 +10662,7 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode)
+ udelay(40);
+
+ mac_mode = tp->mac_mode & ~MAC_MODE_PORT_MODE_MASK;
+- if (tp->tg3_flags3 & TG3_FLG3_PHY_IS_FET) {
++ if (tp->phy_flags & TG3_PHYFLG_IS_FET) {
+ tg3_writephy(tp, MII_TG3_FET_PTEST,
+ MII_TG3_FET_PTEST_FRC_TX_LINK |
+ MII_TG3_FET_PTEST_FRC_TX_LOCK);
+@@ -10674,7 +10674,7 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode)
+ mac_mode |= MAC_MODE_PORT_MODE_GMII;
+
+ /* reset to prevent losing 1st rx packet intermittently */
+- if (tp->tg3_flags2 & TG3_FLG2_MII_SERDES) {
++ if (tp->phy_flags & TG3_PHYFLG_MII_SERDES) {
+ tw32_f(MAC_RX_MODE, RX_MODE_RESET);
+ udelay(10);
+ tw32_f(MAC_RX_MODE, tp->rx_mode);
+@@ -10805,7 +10805,7 @@ static int tg3_test_loopback(struct tg3 *tp)
+ return TG3_LOOPBACK_FAILED;
+
+ /* Turn off gphy autopowerdown. */
+- if (tp->tg3_flags3 & TG3_FLG3_PHY_ENABLE_APD)
++ if (tp->phy_flags & TG3_PHYFLG_ENABLE_APD)
+ tg3_phy_toggle_apd(tp, false);
+
+ if (tp->tg3_flags & TG3_FLAG_CPMU_PRESENT) {
+@@ -10842,14 +10842,14 @@ static int tg3_test_loopback(struct tg3 *tp)
+ tw32(TG3_CPMU_MUTEX_GNT, CPMU_MUTEX_GNT_DRIVER);
+ }
+
+- if (!(tp->tg3_flags2 & TG3_FLG2_PHY_SERDES) &&
++ if (!(tp->phy_flags & TG3_PHYFLG_PHY_SERDES) &&
+ !(tp->tg3_flags3 & TG3_FLG3_USE_PHYLIB)) {
+ if (tg3_run_loopback(tp, TG3_PHY_LOOPBACK))
+ err |= TG3_PHY_LOOPBACK_FAILED;
+ }
+
+ /* Re-enable gphy autopowerdown. */
+- if (tp->tg3_flags3 & TG3_FLG3_PHY_ENABLE_APD)
++ if (tp->phy_flags & TG3_PHYFLG_ENABLE_APD)
+ tg3_phy_toggle_apd(tp, true);
+
+ return err;
+@@ -10892,7 +10892,7 @@ static void tg3_self_test(struct net_device *dev, struct ethtool_test *etest,
+ if (!err)
+ tg3_nvram_unlock(tp);
+
+- if (tp->tg3_flags2 & TG3_FLG2_MII_SERDES)
++ if (tp->phy_flags & TG3_PHYFLG_MII_SERDES)
+ tg3_phy_reset(tp);
+
+ if (tg3_test_registers(tp) != 0) {
+@@ -10941,7 +10941,7 @@ static int tg3_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
+
+ if (tp->tg3_flags3 & TG3_FLG3_USE_PHYLIB) {
+ struct phy_device *phydev;
+- if (!(tp->tg3_flags3 & TG3_FLG3_PHY_CONNECTED))
++ if (!(tp->phy_flags & TG3_PHYFLG_IS_CONNECTED))
+ return -EAGAIN;
+ phydev = tp->mdio_bus->phy_map[TG3_PHY_MII_ADDR];
+ return phy_mii_ioctl(phydev, data, cmd);
+@@ -10955,7 +10955,7 @@ static int tg3_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
+ case SIOCGMIIREG: {
+ u32 mii_regval;
+
+- if (tp->tg3_flags2 & TG3_FLG2_PHY_SERDES)
++ if (tp->phy_flags & TG3_PHYFLG_PHY_SERDES)
+ break; /* We have no PHY */
+
+ if (tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER)
+@@ -10971,7 +10971,7 @@ static int tg3_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
+ }
+
+ case SIOCSMIIREG:
+- if (tp->tg3_flags2 & TG3_FLG2_PHY_SERDES)
++ if (tp->phy_flags & TG3_PHYFLG_PHY_SERDES)
+ break; /* We have no PHY */
+
+ if (tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER)
+@@ -12102,9 +12102,9 @@ static void __devinit tg3_get_eeprom_hw_cfg(struct tg3 *tp)
+ tp->phy_id = eeprom_phy_id;
+ if (eeprom_phy_serdes) {
+ if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS))
+- tp->tg3_flags2 |= TG3_FLG2_PHY_SERDES;
++ tp->phy_flags |= TG3_PHYFLG_PHY_SERDES;
+ else
+- tp->tg3_flags2 |= TG3_FLG2_MII_SERDES;
++ tp->phy_flags |= TG3_PHYFLG_MII_SERDES;
+ }
+
+ if (tp->tg3_flags2 & TG3_FLG2_5750_PLUS)
+@@ -12188,7 +12188,7 @@ static void __devinit tg3_get_eeprom_hw_cfg(struct tg3 *tp)
+ (tp->tg3_flags2 & TG3_FLG2_5750_PLUS))
+ tp->tg3_flags3 |= TG3_FLG3_ENABLE_APE;
+
+- if (tp->tg3_flags2 & TG3_FLG2_ANY_SERDES &&
++ if (tp->phy_flags & TG3_PHYFLG_ANY_SERDES &&
+ !(nic_cfg & NIC_SRAM_DATA_CFG_FIBER_WOL))
+ tp->tg3_flags &= ~TG3_FLAG_WOL_CAP;
+
+@@ -12197,17 +12197,17 @@ static void __devinit tg3_get_eeprom_hw_cfg(struct tg3 *tp)
+ tp->tg3_flags |= TG3_FLAG_WOL_ENABLE;
+
+ if (cfg2 & (1 << 17))
+- tp->tg3_flags2 |= TG3_FLG2_CAPACITIVE_COUPLING;
++ tp->phy_flags |= TG3_PHYFLG_CAPACITIVE_COUPLING;
+
+ /* serdes signal pre-emphasis in register 0x590 set by */
+ /* bootcode if bit 18 is set */
+ if (cfg2 & (1 << 18))
+- tp->tg3_flags2 |= TG3_FLG2_SERDES_PREEMPHASIS;
++ tp->phy_flags |= TG3_PHYFLG_SERDES_PREEMPHASIS;
+
+ if (((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 &&
+ GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5784_AX)) &&
+ (cfg2 & NIC_SRAM_DATA_CFG_2_APD_EN))
+- tp->tg3_flags3 |= TG3_FLG3_PHY_ENABLE_APD;
++ tp->phy_flags |= TG3_PHYFLG_ENABLE_APD;
+
+ if ((tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS) &&
+ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5785 &&
+@@ -12316,9 +12316,9 @@ static int __devinit tg3_phy_probe(struct tg3 *tp)
+ if (!err && TG3_KNOWN_PHY_ID(hw_phy_id_masked)) {
+ tp->phy_id = hw_phy_id;
+ if (hw_phy_id_masked == TG3_PHY_ID_BCM8002)
+- tp->tg3_flags2 |= TG3_FLG2_PHY_SERDES;
++ tp->phy_flags |= TG3_PHYFLG_PHY_SERDES;
+ else
+- tp->tg3_flags2 &= ~TG3_FLG2_PHY_SERDES;
++ tp->phy_flags &= ~TG3_PHYFLG_PHY_SERDES;
+ } else {
+ if (tp->phy_id != TG3_PHY_ID_INVALID) {
+ /* Do nothing, phy ID already set up in
+@@ -12337,11 +12337,11 @@ static int __devinit tg3_phy_probe(struct tg3 *tp)
+ tp->phy_id = p->phy_id;
+ if (!tp->phy_id ||
+ tp->phy_id == TG3_PHY_ID_BCM8002)
+- tp->tg3_flags2 |= TG3_FLG2_PHY_SERDES;
++ tp->phy_flags |= TG3_PHYFLG_PHY_SERDES;
+ }
+ }
+
+- if (!(tp->tg3_flags2 & TG3_FLG2_ANY_SERDES) &&
++ if (!(tp->phy_flags & TG3_PHYFLG_ANY_SERDES) &&
+ !(tp->tg3_flags3 & TG3_FLG3_ENABLE_APE) &&
+ !(tp->tg3_flags & TG3_FLAG_ENABLE_ASF)) {
+ u32 bmsr, adv_reg, tg3_ctrl, mask;
+@@ -12359,7 +12359,7 @@ static int __devinit tg3_phy_probe(struct tg3 *tp)
+ ADVERTISE_100HALF | ADVERTISE_100FULL |
+ ADVERTISE_CSMA | ADVERTISE_PAUSE_CAP);
+ tg3_ctrl = 0;
+- if (!(tp->tg3_flags & TG3_FLAG_10_100_ONLY)) {
++ if (!(tp->phy_flags & TG3_PHYFLG_10_100_ONLY)) {
+ tg3_ctrl = (MII_TG3_CTRL_ADV_1000_HALF |
+ MII_TG3_CTRL_ADV_1000_FULL);
+ if (tp->pci_chip_rev_id == CHIPREV_ID_5701_A0 ||
+@@ -12374,7 +12374,7 @@ static int __devinit tg3_phy_probe(struct tg3 *tp)
+ if (!tg3_copper_is_advertising_all(tp, mask)) {
+ tg3_writephy(tp, MII_ADVERTISE, adv_reg);
+
+- if (!(tp->tg3_flags & TG3_FLAG_10_100_ONLY))
++ if (!(tp->phy_flags & TG3_PHYFLG_10_100_ONLY))
+ tg3_writephy(tp, MII_TG3_CTRL, tg3_ctrl);
+
+ tg3_writephy(tp, MII_BMCR,
+@@ -12383,7 +12383,7 @@ static int __devinit tg3_phy_probe(struct tg3 *tp)
+ tg3_phy_set_wirespeed(tp);
+
+ tg3_writephy(tp, MII_ADVERTISE, adv_reg);
+- if (!(tp->tg3_flags & TG3_FLAG_10_100_ONLY))
++ if (!(tp->phy_flags & TG3_PHYFLG_10_100_ONLY))
+ tg3_writephy(tp, MII_TG3_CTRL, tg3_ctrl);
+ }
+
+@@ -12396,13 +12396,13 @@ skip_phy_reset:
+ err = tg3_init_5401phy_dsp(tp);
+ }
+
+- if (tp->tg3_flags2 & TG3_FLG2_ANY_SERDES)
++ if (tp->phy_flags & TG3_PHYFLG_ANY_SERDES)
+ tp->link_config.advertising =
+ (ADVERTISED_1000baseT_Half |
+ ADVERTISED_1000baseT_Full |
+ ADVERTISED_Autoneg |
+ ADVERTISED_FIBRE);
+- if (tp->tg3_flags & TG3_FLAG_10_100_ONLY)
++ if (tp->phy_flags & TG3_PHYFLG_10_100_ONLY)
+ tp->link_config.advertising &=
+ ~(ADVERTISED_1000baseT_Half |
+ ADVERTISED_1000baseT_Full);
+@@ -13361,25 +13361,25 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ }
+
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
+- tp->tg3_flags3 |= TG3_FLG3_PHY_IS_FET;
++ tp->phy_flags |= TG3_PHYFLG_IS_FET;
+
+ /* A few boards don't want Ethernet at WireSpeed phy feature */
+ if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700) ||
+ ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705) &&
+ (tp->pci_chip_rev_id != CHIPREV_ID_5705_A0) &&
+ (tp->pci_chip_rev_id != CHIPREV_ID_5705_A1)) ||
+- (tp->tg3_flags3 & TG3_FLG3_PHY_IS_FET) ||
+- (tp->tg3_flags2 & TG3_FLG2_ANY_SERDES))
+- tp->tg3_flags2 |= TG3_FLG2_NO_ETH_WIRE_SPEED;
++ (tp->phy_flags & TG3_PHYFLG_IS_FET) ||
++ (tp->phy_flags & TG3_PHYFLG_ANY_SERDES))
++ tp->phy_flags |= TG3_PHYFLG_NO_ETH_WIRE_SPEED;
+
+ if (GET_CHIP_REV(tp->pci_chip_rev_id) == CHIPREV_5703_AX ||
+ GET_CHIP_REV(tp->pci_chip_rev_id) == CHIPREV_5704_AX)
+- tp->tg3_flags2 |= TG3_FLG2_PHY_ADC_BUG;
++ tp->phy_flags |= TG3_PHYFLG_ADC_BUG;
+ if (tp->pci_chip_rev_id == CHIPREV_ID_5704_A0)
+- tp->tg3_flags2 |= TG3_FLG2_PHY_5704_A0_BUG;
++ tp->phy_flags |= TG3_PHYFLG_5704_A0_BUG;
+
+ if ((tp->tg3_flags2 & TG3_FLG2_5705_PLUS) &&
+- !(tp->tg3_flags3 & TG3_FLG3_PHY_IS_FET) &&
++ !(tp->phy_flags & TG3_PHYFLG_IS_FET) &&
+ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5785 &&
+ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_57780 &&
+ !(tp->tg3_flags3 & TG3_FLG3_5717_PLUS)) {
+@@ -13389,11 +13389,11 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761) {
+ if (tp->pdev->device != PCI_DEVICE_ID_TIGON3_5756 &&
+ tp->pdev->device != PCI_DEVICE_ID_TIGON3_5722)
+- tp->tg3_flags2 |= TG3_FLG2_PHY_JITTER_BUG;
++ tp->phy_flags |= TG3_PHYFLG_JITTER_BUG;
+ if (tp->pdev->device == PCI_DEVICE_ID_TIGON3_5755M)
+- tp->tg3_flags2 |= TG3_FLG2_PHY_ADJUST_TRIM;
++ tp->phy_flags |= TG3_PHYFLG_ADJUST_TRIM;
+ } else
+- tp->tg3_flags2 |= TG3_FLG2_PHY_BER_BUG;
++ tp->phy_flags |= TG3_PHYFLG_BER_BUG;
+ }
+
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 &&
+@@ -13506,8 +13506,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ tp->pdev->device == TG3PCI_DEVICE_TIGON3_57790 ||
+ tp->pdev->device == TG3PCI_DEVICE_TIGON3_57791 ||
+ tp->pdev->device == TG3PCI_DEVICE_TIGON3_57795 ||
+- (tp->tg3_flags3 & TG3_FLG3_PHY_IS_FET))
+- tp->tg3_flags |= TG3_FLAG_10_100_ONLY;
++ (tp->phy_flags & TG3_PHYFLG_IS_FET))
++ tp->phy_flags |= TG3_PHYFLG_10_100_ONLY;
+
+ err = tg3_phy_probe(tp);
+ if (err) {
+@@ -13519,13 +13519,13 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ tg3_read_vpd(tp);
+ tg3_read_fw_ver(tp);
+
+- if (tp->tg3_flags2 & TG3_FLG2_PHY_SERDES) {
+- tp->tg3_flags &= ~TG3_FLAG_USE_MI_INTERRUPT;
++ if (tp->phy_flags & TG3_PHYFLG_PHY_SERDES) {
++ tp->phy_flags &= ~TG3_PHYFLG_USE_MI_INTERRUPT;
+ } else {
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700)
+- tp->tg3_flags |= TG3_FLAG_USE_MI_INTERRUPT;
++ tp->phy_flags |= TG3_PHYFLG_USE_MI_INTERRUPT;
+ else
+- tp->tg3_flags &= ~TG3_FLAG_USE_MI_INTERRUPT;
++ tp->phy_flags &= ~TG3_PHYFLG_USE_MI_INTERRUPT;
+ }
+
+ /* 5700 {AX,BX} chips have a broken status block link
+@@ -13543,13 +13543,13 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ */
+ if (tp->pdev->subsystem_vendor == PCI_VENDOR_ID_DELL &&
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701 &&
+- !(tp->tg3_flags2 & TG3_FLG2_PHY_SERDES)) {
+- tp->tg3_flags |= (TG3_FLAG_USE_MI_INTERRUPT |
+- TG3_FLAG_USE_LINKCHG_REG);
++ !(tp->phy_flags & TG3_PHYFLG_PHY_SERDES)) {
++ tp->phy_flags |= TG3_PHYFLG_USE_MI_INTERRUPT;
++ tp->tg3_flags |= TG3_FLAG_USE_LINKCHG_REG;
+ }
+
+ /* For all SERDES we poll the MAC status register. */
+- if (tp->tg3_flags2 & TG3_FLG2_PHY_SERDES)
++ if (tp->phy_flags & TG3_PHYFLG_PHY_SERDES)
+ tp->tg3_flags |= TG3_FLAG_POLL_SERDES;
+ else
+ tp->tg3_flags &= ~TG3_FLAG_POLL_SERDES;
+@@ -14652,24 +14652,31 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
+ tg3_bus_string(tp, str),
+ dev->dev_addr);
+
+- if (tp->tg3_flags3 & TG3_FLG3_PHY_CONNECTED) {
++ if (tp->phy_flags & TG3_PHYFLG_IS_CONNECTED) {
+ struct phy_device *phydev;
+ phydev = tp->mdio_bus->phy_map[TG3_PHY_MII_ADDR];
+ netdev_info(dev,
+ "attached PHY driver [%s] (mii_bus:phy_addr=%s)\n",
+ phydev->drv->name, dev_name(&phydev->dev));
+- } else
++ } else {
++ char *ethtype;
++
++ if (tp->phy_flags & TG3_PHYFLG_10_100_ONLY)
++ ethtype = "10/100Base-TX";
++ else if (tp->phy_flags & TG3_PHYFLG_ANY_SERDES)
++ ethtype = "1000Base-SX";
++ else
++ ethtype = "10/100/1000Base-T";
++
+ netdev_info(dev, "attached PHY is %s (%s Ethernet) "
+- "(WireSpeed[%d])\n", tg3_phy_string(tp),
+- ((tp->tg3_flags & TG3_FLAG_10_100_ONLY) ? "10/100Base-TX" :
+- ((tp->tg3_flags2 & TG3_FLG2_ANY_SERDES) ? "1000Base-SX" :
+- "10/100/1000Base-T")),
+- (tp->tg3_flags2 & TG3_FLG2_NO_ETH_WIRE_SPEED) == 0);
++ "(WireSpeed[%d])\n", tg3_phy_string(tp), ethtype,
++ (tp->phy_flags & TG3_PHYFLG_NO_ETH_WIRE_SPEED) == 0);
++ }
+
+ netdev_info(dev, "RXcsums[%d] LinkChgREG[%d] MIirq[%d] ASF[%d] TSOcap[%d]\n",
+ (tp->tg3_flags & TG3_FLAG_RX_CHECKSUMS) != 0,
+ (tp->tg3_flags & TG3_FLAG_USE_LINKCHG_REG) != 0,
+- (tp->tg3_flags & TG3_FLAG_USE_MI_INTERRUPT) != 0,
++ (tp->phy_flags & TG3_PHYFLG_USE_MI_INTERRUPT) != 0,
+ (tp->tg3_flags & TG3_FLAG_ENABLE_ASF) != 0,
+ (tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE) != 0);
+ netdev_info(dev, "dma_rwctrl[%08x] dma_mask[%d-bit]\n",
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index b8f3df3..1cd924d 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -2774,7 +2774,6 @@ struct tg3 {
+ #define TG3_FLAG_TXD_MBOX_HWBUG 0x00000002
+ #define TG3_FLAG_RX_CHECKSUMS 0x00000004
+ #define TG3_FLAG_USE_LINKCHG_REG 0x00000008
+-#define TG3_FLAG_USE_MI_INTERRUPT 0x00000010
+ #define TG3_FLAG_ENABLE_ASF 0x00000020
+ #define TG3_FLAG_ASPM_WORKAROUND 0x00000040
+ #define TG3_FLAG_POLL_SERDES 0x00000080
+@@ -2796,7 +2795,6 @@ struct tg3 {
+ #define TG3_FLAG_TX_RECOVERY_PENDING 0x00200000
+ #define TG3_FLAG_WOL_CAP 0x00400000
+ #define TG3_FLAG_JUMBO_RING_ENABLE 0x00800000
+-#define TG3_FLAG_10_100_ONLY 0x01000000
+ #define TG3_FLAG_PAUSE_AUTONEG 0x02000000
+ #define TG3_FLAG_CPMU_PRESENT 0x04000000
+ #define TG3_FLAG_40BIT_DMA_BUG 0x08000000
+@@ -2807,22 +2805,15 @@ struct tg3 {
+ u32 tg3_flags2;
+ #define TG3_FLG2_RESTART_TIMER 0x00000001
+ #define TG3_FLG2_TSO_BUG 0x00000002
+-#define TG3_FLG2_NO_ETH_WIRE_SPEED 0x00000004
+ #define TG3_FLG2_IS_5788 0x00000008
+ #define TG3_FLG2_MAX_RXPEND_64 0x00000010
+ #define TG3_FLG2_TSO_CAPABLE 0x00000020
+-#define TG3_FLG2_PHY_ADC_BUG 0x00000040
+-#define TG3_FLG2_PHY_5704_A0_BUG 0x00000080
+-#define TG3_FLG2_PHY_BER_BUG 0x00000100
+ #define TG3_FLG2_PCI_EXPRESS 0x00000200
+ #define TG3_FLG2_ASF_NEW_HANDSHAKE 0x00000400
+ #define TG3_FLG2_HW_AUTONEG 0x00000800
+ #define TG3_FLG2_IS_NIC 0x00001000
+-#define TG3_FLG2_PHY_SERDES 0x00002000
+-#define TG3_FLG2_CAPACITIVE_COUPLING 0x00004000
+ #define TG3_FLG2_FLASH 0x00008000
+ #define TG3_FLG2_HW_TSO_1 0x00010000
+-#define TG3_FLG2_SERDES_PREEMPHASIS 0x00020000
+ #define TG3_FLG2_5705_PLUS 0x00040000
+ #define TG3_FLG2_5750_PLUS 0x00080000
+ #define TG3_FLG2_HW_TSO_3 0x00100000
+@@ -2830,10 +2821,6 @@ struct tg3 {
+ #define TG3_FLG2_USING_MSIX 0x00400000
+ #define TG3_FLG2_USING_MSI_OR_MSIX (TG3_FLG2_USING_MSI | \
+ TG3_FLG2_USING_MSIX)
+-#define TG3_FLG2_MII_SERDES 0x00800000
+-#define TG3_FLG2_ANY_SERDES (TG3_FLG2_PHY_SERDES | \
+- TG3_FLG2_MII_SERDES)
+-#define TG3_FLG2_PARALLEL_DETECT 0x01000000
+ #define TG3_FLG2_ICH_WORKAROUND 0x02000000
+ #define TG3_FLG2_5780_CLASS 0x04000000
+ #define TG3_FLG2_HW_TSO_2 0x08000000
+@@ -2841,9 +2828,7 @@ struct tg3 {
+ TG3_FLG2_HW_TSO_2 | \
+ TG3_FLG2_HW_TSO_3)
+ #define TG3_FLG2_1SHOT_MSI 0x10000000
+-#define TG3_FLG2_PHY_JITTER_BUG 0x20000000
+ #define TG3_FLG2_NO_FWARE_REPORTED 0x40000000
+-#define TG3_FLG2_PHY_ADJUST_TRIM 0x80000000
+ u32 tg3_flags3;
+ #define TG3_FLG3_NO_NVRAM_ADDR_TRANS 0x00000001
+ #define TG3_FLG3_ENABLE_APE 0x00000002
+@@ -2851,15 +2836,12 @@ struct tg3 {
+ #define TG3_FLG3_5701_DMA_BUG 0x00000008
+ #define TG3_FLG3_USE_PHYLIB 0x00000010
+ #define TG3_FLG3_MDIOBUS_INITED 0x00000020
+-#define TG3_FLG3_PHY_CONNECTED 0x00000080
+ #define TG3_FLG3_RGMII_INBAND_DISABLE 0x00000100
+ #define TG3_FLG3_RGMII_EXT_IBND_RX_EN 0x00000200
+ #define TG3_FLG3_RGMII_EXT_IBND_TX_EN 0x00000400
+ #define TG3_FLG3_CLKREQ_BUG 0x00000800
+-#define TG3_FLG3_PHY_ENABLE_APD 0x00001000
+ #define TG3_FLG3_5755_PLUS 0x00002000
+ #define TG3_FLG3_NO_NVRAM 0x00004000
+-#define TG3_FLG3_PHY_IS_FET 0x00010000
+ #define TG3_FLG3_ENABLE_RSS 0x00020000
+ #define TG3_FLG3_ENABLE_TSS 0x00040000
+ #define TG3_FLG3_4G_DMA_BNDRY_BUG 0x00080000
+@@ -2966,6 +2948,24 @@ struct tg3 {
+
+ u32 phy_flags;
+ #define TG3_PHYFLG_IS_LOW_POWER 0x00000001
++#define TG3_PHYFLG_IS_CONNECTED 0x00000002
++#define TG3_PHYFLG_USE_MI_INTERRUPT 0x00000004
++#define TG3_PHYFLG_PHY_SERDES 0x00000010
++#define TG3_PHYFLG_MII_SERDES 0x00000020
++#define TG3_PHYFLG_ANY_SERDES (TG3_PHYFLG_PHY_SERDES | \
++ TG3_PHYFLG_MII_SERDES)
++#define TG3_PHYFLG_IS_FET 0x00000040
++#define TG3_PHYFLG_10_100_ONLY 0x00000080
++#define TG3_PHYFLG_ENABLE_APD 0x00000100
++#define TG3_PHYFLG_CAPACITIVE_COUPLING 0x00000200
++#define TG3_PHYFLG_NO_ETH_WIRE_SPEED 0x00000400
++#define TG3_PHYFLG_JITTER_BUG 0x00000800
++#define TG3_PHYFLG_ADJUST_TRIM 0x00001000
++#define TG3_PHYFLG_ADC_BUG 0x00002000
++#define TG3_PHYFLG_5704_A0_BUG 0x00004000
++#define TG3_PHYFLG_BER_BUG 0x00008000
++#define TG3_PHYFLG_SERDES_PREEMPHASIS 0x00010000
++#define TG3_PHYFLG_PARALLEL_DETECT 0x00020000
+
+ u32 led_ctrl;
+ u32 phy_otp;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0153-tg3-Update-version-to-3.113.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0153-tg3-Update-version-to-3.113.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,36 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 2 Aug 2010 11:26:08 +0000
+Subject: [PATCH 153/207] tg3: Update version to 3.113
+
+commit 9ed6eda4fad9ea95e99f1e3cc546bcde049695cf upstream.
+
+This patch updates the tg3 version to 3.113.
+
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index fde3ba0..8b40c7f 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -69,10 +69,10 @@
+
+ #define DRV_MODULE_NAME "tg3"
+ #define TG3_MAJ_NUM 3
+-#define TG3_MIN_NUM 112
++#define TG3_MIN_NUM 113
+ #define DRV_MODULE_VERSION \
+ __stringify(TG3_MAJ_NUM) "." __stringify(TG3_MIN_NUM)
+-#define DRV_MODULE_RELDATE "July 11, 2010"
++#define DRV_MODULE_RELDATE "August 2, 2010"
+
+ #define TG3_DEF_MAC_MODE 0
+ #define TG3_DEF_RX_MODE 0
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0154-tg3-Fix-read-DMA-FIFO-overruns-on-recent-devices.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0154-tg3-Fix-read-DMA-FIFO-overruns-on-recent-devices.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,66 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Wed, 15 Sep 2010 08:59:53 +0000
+Subject: [PATCH 154/207] tg3: Fix read DMA FIFO overruns on recent devices
+
+commit 41a8a7ee4a78216962f3afcea5968c04d0ab3b08 upstream.
+
+Earlier versions of tg3 devices had a problem where the read DMA FIFO
+could be overrun in certain edge conditions. The fix was to limit the
+number of rx BDs the hardware would fetch at a time. For later devices
+(5761, 5784 and later ASIC revs), there is a hardware fix that must be
+enabled to fix the same problem. This patch adds that hardware fix.
+
+There is a gap in the ASIC revision lineage where neither fix is
+applied. This is intentional as these ASIC revisions are not afflicted
+by the bug.
+
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 10 ++++++++++
+ drivers/net/tg3.h | 6 +++++-
+ 2 files changed, 15 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 8b40c7f..8107ae8 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -8015,6 +8015,16 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780)
+ rdmac_mode |= RDMAC_MODE_IPV6_LSO_EN;
+
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 ||
++ (tp->tg3_flags3 & TG3_FLG3_5717_PLUS)) {
++ val = tr32(TG3_RDMA_RSRVCTRL_REG);
++ tw32(TG3_RDMA_RSRVCTRL_REG,
++ val | TG3_RDMA_RSRVCTRL_FIFO_OFLW_FIX);
++ }
++
+ /* Receive/send statistics. */
+ if (tp->tg3_flags2 & TG3_FLG2_5750_PLUS) {
+ val = tr32(RCVLPC_STATS_ENABLE);
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 1cd924d..26af216 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -1302,7 +1302,11 @@
+ #define RDMAC_STATUS_FIFOURUN 0x00000080
+ #define RDMAC_STATUS_FIFOOREAD 0x00000100
+ #define RDMAC_STATUS_LNGREAD 0x00000200
+-/* 0x4808 --> 0x4c00 unused */
++/* 0x4808 --> 0x4900 unused */
++
++#define TG3_RDMA_RSRVCTRL_REG 0x00004900
++#define TG3_RDMA_RSRVCTRL_FIFO_OFLW_FIX 0x00000004
++/* 0x4904 --> 0x4c00 unused */
+
+ /* Write DMA control registers */
+ #define WDMAC_MODE 0x00004c00
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0155-tg3-Disable-TSS.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0155-tg3-Disable-TSS.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,41 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Wed, 15 Sep 2010 08:59:54 +0000
+Subject: [PATCH 155/207] tg3: Disable TSS
+
+commit f0392d24485e4c144d2741a5424f069b8b5f30e7 upstream.
+
+It was recently discovered that enabling TSS can lockup the device.
+This patch disables the feature until a suitable workaround can be
+found.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 9 +--------
+ 1 files changed, 1 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 8107ae8..ecd6b70 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -8827,16 +8827,9 @@ static bool tg3_enable_msix(struct tg3 *tp)
+ tp->napi[i].irq_vec = msix_ent[i].vector;
+
+ tp->dev->real_num_tx_queues = 1;
+- if (tp->irq_cnt > 1) {
++ if (tp->irq_cnt > 1)
+ tp->tg3_flags3 |= TG3_FLG3_ENABLE_RSS;
+
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719) {
+- tp->tg3_flags3 |= TG3_FLG3_ENABLE_TSS;
+- tp->dev->real_num_tx_queues = tp->irq_cnt - 1;
+- }
+- }
+-
+ return true;
+ }
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0156-tg3-Don-t-send-APE-events-for-NCSI-firmware.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0156-tg3-Don-t-send-APE-events-for-NCSI-firmware.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,113 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Wed, 15 Sep 2010 08:59:55 +0000
+Subject: [PATCH 156/207] tg3: Don't send APE events for NCSI firmware
+
+commit dc6d074457f1551f9357f773a4eda09a3d5ef150 upstream.
+
+NCSI firmware does not accept APE events. It relies on a "driver state"
+location in shared memory to tell it what the driver's current state is.
+
+This patch pivots the code to use the new driver state scheme.
+
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 22 ++++++++++++++++++++--
+ drivers/net/tg3.h | 9 ++++++++-
+ 2 files changed, 28 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index ecd6b70..4dea92b 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -6596,6 +6596,10 @@ static void tg3_ape_send_event(struct tg3 *tp, u32 event)
+ int i;
+ u32 apedata;
+
++ /* NCSI does not support APE events */
++ if (tp->tg3_flags3 & TG3_FLG3_APE_HAS_NCSI)
++ return;
++
+ apedata = tg3_ape_read32(tp, TG3_APE_SEG_SIG);
+ if (apedata != APE_SEG_SIG_MAGIC)
+ return;
+@@ -6647,6 +6651,8 @@ static void tg3_ape_driver_state_change(struct tg3 *tp, int kind)
+ APE_HOST_DRIVER_ID_MAGIC(TG3_MAJ_NUM, TG3_MIN_NUM));
+ tg3_ape_write32(tp, TG3_APE_HOST_BEHAVIOR,
+ APE_HOST_BEHAV_NO_PHYLOCK);
++ tg3_ape_write32(tp, TG3_APE_HOST_DRVR_STATE,
++ TG3_APE_HOST_DRVR_STATE_START);
+
+ event = APE_EVENT_STATUS_STATE_START;
+ break;
+@@ -6658,6 +6664,16 @@ static void tg3_ape_driver_state_change(struct tg3 *tp, int kind)
+ */
+ tg3_ape_write32(tp, TG3_APE_HOST_SEG_SIG, 0x0);
+
++ if (device_may_wakeup(&tp->pdev->dev) &&
++ (tp->tg3_flags & TG3_FLAG_WOL_ENABLE)) {
++ tg3_ape_write32(tp, TG3_APE_HOST_WOL_SPEED,
++ TG3_APE_HOST_WOL_SPEED_AUTO);
++ apedata = TG3_APE_HOST_DRVR_STATE_WOL;
++ } else
++ apedata = TG3_APE_HOST_DRVR_STATE_UNLOAD;
++
++ tg3_ape_write32(tp, TG3_APE_HOST_DRVR_STATE, apedata);
++
+ event = APE_EVENT_STATUS_STATE_UNLOAD;
+ break;
+ case RESET_KIND_SUSPEND:
+@@ -12750,10 +12766,12 @@ static void __devinit tg3_read_dash_ver(struct tg3 *tp)
+
+ apedata = tg3_ape_read32(tp, TG3_APE_FW_VERSION);
+
+- if (tg3_ape_read32(tp, TG3_APE_FW_FEATURES) & TG3_APE_FW_FEATURE_NCSI)
++ if (tg3_ape_read32(tp, TG3_APE_FW_FEATURES) & TG3_APE_FW_FEATURE_NCSI) {
++ tp->tg3_flags3 |= TG3_FLG3_APE_HAS_NCSI;
+ fwtype = "NCSI";
+- else
++ } else {
+ fwtype = "DASH";
++ }
+
+ vlen = strlen(tp->fw_ver);
+
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 26af216..73cc17d 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -2180,7 +2180,7 @@
+ #define TG3_APE_HOST_SEG_SIG 0x4200
+ #define APE_HOST_SEG_SIG_MAGIC 0x484f5354
+ #define TG3_APE_HOST_SEG_LEN 0x4204
+-#define APE_HOST_SEG_LEN_MAGIC 0x0000001c
++#define APE_HOST_SEG_LEN_MAGIC 0x00000020
+ #define TG3_APE_HOST_INIT_COUNT 0x4208
+ #define TG3_APE_HOST_DRIVER_ID 0x420c
+ #define APE_HOST_DRIVER_ID_LINUX 0xf0000000
+@@ -2192,6 +2192,12 @@
+ #define APE_HOST_HEARTBEAT_INT_DISABLE 0
+ #define APE_HOST_HEARTBEAT_INT_5SEC 5000
+ #define TG3_APE_HOST_HEARTBEAT_COUNT 0x4218
++#define TG3_APE_HOST_DRVR_STATE 0x421c
++#define TG3_APE_HOST_DRVR_STATE_START 0x00000001
++#define TG3_APE_HOST_DRVR_STATE_UNLOAD 0x00000002
++#define TG3_APE_HOST_DRVR_STATE_WOL 0x00000003
++#define TG3_APE_HOST_WOL_SPEED 0x4224
++#define TG3_APE_HOST_WOL_SPEED_AUTO 0x00008000
+
+ #define TG3_APE_EVENT_STATUS 0x4300
+
+@@ -2854,6 +2860,7 @@ struct tg3 {
+ #define TG3_FLG3_USE_JUMBO_BDFLAG 0x00400000
+ #define TG3_FLG3_L1PLLPD_EN 0x00800000
+ #define TG3_FLG3_5717_PLUS 0x01000000
++#define TG3_FLG3_APE_HAS_NCSI 0x02000000
+
+ struct timer_list timer;
+ u16 timer_counter;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0157-tg3-Unlock-5717-B0-support.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0157-tg3-Unlock-5717-B0-support.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,45 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Wed, 15 Sep 2010 08:59:56 +0000
+Subject: [PATCH 157/207] tg3: Unlock 5717 B0+ support
+
+commit 2e9f7a7408d264f01d4477c564ef5c6b610cd10f upstream.
+
+This patch adjusts the driver to use the tg3_start_xmit_dma_bug()
+transmit routine for all revisions of 5717 asic rev devices and then
+allows the driver to attach to B0 and later devices.
+
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 6 +-----
+ 1 files changed, 1 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 4dea92b..dc9c59e 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -13442,10 +13442,6 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ if (err)
+ return err;
+
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 &&
+- tp->pci_chip_rev_id != CHIPREV_ID_5717_A0)
+- return -ENOTSUPP;
+-
+ /* Initialize data/descriptor byte/word swapping. */
+ val = tr32(GRC_MODE);
+ val &= GRC_MODE_HOST_STACKUP;
+@@ -14474,7 +14470,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
+ }
+
+ if ((tp->tg3_flags3 & TG3_FLG3_5755_PLUS) &&
+- tp->pci_chip_rev_id != CHIPREV_ID_5717_A0 &&
++ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717 &&
+ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5719)
+ dev->netdev_ops = &tg3_netdev_ops;
+ else
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0158-tg3-Clarify-semantics-of-TG3_IRQ_MAX_VECS.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0158-tg3-Clarify-semantics-of-TG3_IRQ_MAX_VECS.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,68 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Wed, 15 Sep 2010 08:59:57 +0000
+Subject: [PATCH 158/207] tg3: Clarify semantics of TG3_IRQ_MAX_VECS
+
+commit 6fd45cb814709767a1704b541aa91647b7f275cf upstream.
+
+TG3_IRQ_MAX_VECS should be seen as the maximum number of vectors that
+any device could be expected to use. tp->irq_max represents the maximum
+number of vectors the current device can use. This patch clarifies the
+semantics of the code to match the above description.
+
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 6 +++---
+ drivers/net/tg3.h | 3 ++-
+ 2 files changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index dc9c59e..086984d 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -7564,7 +7564,7 @@ static void tg3_rings_reset(struct tg3 *tp)
+
+ /* Zero mailbox registers. */
+ if (tp->tg3_flags & TG3_FLAG_SUPPORT_MSIX) {
+- for (i = 1; i < TG3_IRQ_MAX_VECS; i++) {
++ for (i = 1; i < tp->irq_max; i++) {
+ tp->napi[i].tx_prod = 0;
+ tp->napi[i].tx_cons = 0;
+ if (tp->tg3_flags3 & TG3_FLG3_ENABLE_TSS)
+@@ -9897,7 +9897,7 @@ static int tg3_set_ringparam(struct net_device *dev, struct ethtool_ringparam *e
+ tp->rx_pending = 63;
+ tp->rx_jumbo_pending = ering->rx_jumbo_pending;
+
+- for (i = 0; i < TG3_IRQ_MAX_VECS; i++)
++ for (i = 0; i < tp->irq_max; i++)
+ tp->napi[i].tx_pending = ering->tx_pending;
+
+ if (netif_running(dev)) {
+@@ -14609,7 +14609,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
+ intmbx = MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW;
+ rcvmbx = MAILBOX_RCVRET_CON_IDX_0 + TG3_64BIT_REG_LOW;
+ sndmbx = MAILBOX_SNDHOST_PROD_IDX_0 + TG3_64BIT_REG_LOW;
+- for (i = 0; i < TG3_IRQ_MAX_VECS; i++) {
++ for (i = 0; i < tp->irq_max; i++) {
+ struct tg3_napi *tnapi = &tp->napi[i];
+
+ tnapi->tp = tp;
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 73cc17d..606a41d 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -2659,7 +2659,8 @@ struct tg3_rx_prodring_set {
+ dma_addr_t rx_jmb_mapping;
+ };
+
+-#define TG3_IRQ_MAX_VECS 5
++#define TG3_IRQ_MAX_VECS_RSS 5
++#define TG3_IRQ_MAX_VECS TG3_IRQ_MAX_VECS_RSS
+
+ struct tg3_napi {
+ struct napi_struct napi ____cacheline_aligned;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0159-tg3-Move-producer-ring-struct-to-tg3_napi.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0159-tg3-Move-producer-ring-struct-to-tg3_napi.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,204 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Wed, 15 Sep 2010 08:59:58 +0000
+Subject: [PATCH 159/207] tg3: Move producer ring struct to tg3_napi
+
+commit 8fea32b9555726d35b91492d17fc21c7874d36f9 upstream.
+
+Now that each NAPI instance has its own producer ring, it no longer
+makes sense to keep the producer ring structure external. This patch
+migrates the producer ring struct to tg3_napi and pivots the code to the
+new implementation.
+
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 39 +++++++++++++++++----------------------
+ drivers/net/tg3.h | 4 +---
+ 2 files changed, 18 insertions(+), 25 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 086984d..fe504f3 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -4549,7 +4549,7 @@ static void tg3_recycle_rx(struct tg3_napi *tnapi,
+ struct tg3 *tp = tnapi->tp;
+ struct tg3_rx_buffer_desc *src_desc, *dest_desc;
+ struct ring_info *src_map, *dest_map;
+- struct tg3_rx_prodring_set *spr = &tp->prodring[0];
++ struct tg3_rx_prodring_set *spr = &tp->napi[0].prodring;
+ int dest_idx;
+
+ switch (opaque_key) {
+@@ -4619,7 +4619,7 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)
+ u32 sw_idx = tnapi->rx_rcb_ptr;
+ u16 hw_idx;
+ int received;
+- struct tg3_rx_prodring_set *tpr = tnapi->prodring;
++ struct tg3_rx_prodring_set *tpr = &tnapi->prodring;
+
+ hw_idx = *(tnapi->rx_rcb_prod_idx);
+ /*
+@@ -4644,13 +4644,13 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)
+ desc_idx = desc->opaque & RXD_OPAQUE_INDEX_MASK;
+ opaque_key = desc->opaque & RXD_OPAQUE_RING_MASK;
+ if (opaque_key == RXD_OPAQUE_RING_STD) {
+- ri = &tp->prodring[0].rx_std_buffers[desc_idx];
++ ri = &tp->napi[0].prodring.rx_std_buffers[desc_idx];
+ dma_addr = dma_unmap_addr(ri, mapping);
+ skb = ri->skb;
+ post_ptr = &std_prod_idx;
+ rx_std_posted++;
+ } else if (opaque_key == RXD_OPAQUE_RING_JUMBO) {
+- ri = &tp->prodring[0].rx_jmb_buffers[desc_idx];
++ ri = &tp->napi[0].prodring.rx_jmb_buffers[desc_idx];
+ dma_addr = dma_unmap_addr(ri, mapping);
+ skb = ri->skb;
+ post_ptr = &jmb_prod_idx;
+@@ -4981,14 +4981,14 @@ static int tg3_poll_work(struct tg3_napi *tnapi, int work_done, int budget)
+ work_done += tg3_rx(tnapi, budget - work_done);
+
+ if ((tp->tg3_flags3 & TG3_FLG3_ENABLE_RSS) && tnapi == &tp->napi[1]) {
+- struct tg3_rx_prodring_set *dpr = &tp->prodring[0];
++ struct tg3_rx_prodring_set *dpr = &tp->napi[0].prodring;
+ int i, err = 0;
+ u32 std_prod_idx = dpr->rx_std_prod_idx;
+ u32 jmb_prod_idx = dpr->rx_jmb_prod_idx;
+
+ for (i = 1; i < tp->irq_cnt; i++)
+ err |= tg3_rx_prodring_xfer(tp, dpr,
+- tp->napi[i].prodring);
++ &tp->napi[i].prodring);
+
+ wmb();
+
+@@ -6057,7 +6057,7 @@ static void tg3_rx_prodring_free(struct tg3 *tp,
+ {
+ int i;
+
+- if (tpr != &tp->prodring[0]) {
++ if (tpr != &tp->napi[0].prodring) {
+ for (i = tpr->rx_std_cons_idx; i != tpr->rx_std_prod_idx;
+ i = (i + 1) % TG3_RX_RING_SIZE)
+ tg3_rx_skb_free(tp, &tpr->rx_std_buffers[i],
+@@ -6103,7 +6103,7 @@ static int tg3_rx_prodring_alloc(struct tg3 *tp,
+ tpr->rx_jmb_cons_idx = 0;
+ tpr->rx_jmb_prod_idx = 0;
+
+- if (tpr != &tp->prodring[0]) {
++ if (tpr != &tp->napi[0].prodring) {
+ memset(&tpr->rx_std_buffers[0], 0, TG3_RX_STD_BUFF_RING_SIZE);
+ if (tp->tg3_flags & TG3_FLAG_JUMBO_CAPABLE)
+ memset(&tpr->rx_jmb_buffers[0], 0,
+@@ -6253,7 +6253,7 @@ static void tg3_free_rings(struct tg3 *tp)
+ for (j = 0; j < tp->irq_cnt; j++) {
+ struct tg3_napi *tnapi = &tp->napi[j];
+
+- tg3_rx_prodring_free(tp, &tp->prodring[j]);
++ tg3_rx_prodring_free(tp, &tnapi->prodring);
+
+ if (!tnapi->tx_buffers)
+ continue;
+@@ -6325,7 +6325,7 @@ static int tg3_init_rings(struct tg3 *tp)
+ if (tnapi->rx_rcb)
+ memset(tnapi->rx_rcb, 0, TG3_RX_RCB_RING_BYTES(tp));
+
+- if (tg3_rx_prodring_alloc(tp, &tp->prodring[i])) {
++ if (tg3_rx_prodring_alloc(tp, &tnapi->prodring)) {
+ tg3_free_rings(tp);
+ return -ENOMEM;
+ }
+@@ -6361,6 +6361,8 @@ static void tg3_free_consistent(struct tg3 *tp)
+ tnapi->rx_rcb = NULL;
+ }
+
++ tg3_rx_prodring_fini(tp, &tnapi->prodring);
++
+ if (tnapi->hw_status) {
+ pci_free_consistent(tp->pdev, TG3_HW_STATUS_SIZE,
+ tnapi->hw_status,
+@@ -6374,9 +6376,6 @@ static void tg3_free_consistent(struct tg3 *tp)
+ tp->hw_stats, tp->stats_mapping);
+ tp->hw_stats = NULL;
+ }
+-
+- for (i = 0; i < tp->irq_cnt; i++)
+- tg3_rx_prodring_fini(tp, &tp->prodring[i]);
+ }
+
+ /*
+@@ -6387,11 +6386,6 @@ static int tg3_alloc_consistent(struct tg3 *tp)
+ {
+ int i;
+
+- for (i = 0; i < tp->irq_cnt; i++) {
+- if (tg3_rx_prodring_init(tp, &tp->prodring[i]))
+- goto err_out;
+- }
+-
+ tp->hw_stats = pci_alloc_consistent(tp->pdev,
+ sizeof(struct tg3_hw_stats),
+ &tp->stats_mapping);
+@@ -6413,6 +6407,9 @@ static int tg3_alloc_consistent(struct tg3 *tp)
+ memset(tnapi->hw_status, 0, TG3_HW_STATUS_SIZE);
+ sblk = tnapi->hw_status;
+
++ if (tg3_rx_prodring_init(tp, &tnapi->prodring))
++ goto err_out;
++
+ /* If multivector TSS is enabled, vector 0 does not handle
+ * tx interrupts. Don't allocate any resources for it.
+ */
+@@ -6452,8 +6449,6 @@ static int tg3_alloc_consistent(struct tg3 *tp)
+ break;
+ }
+
+- tnapi->prodring = &tp->prodring[i];
+-
+ /*
+ * If multivector RSS is enabled, vector 0 does not handle
+ * rx or tx interrupts. Don't allocate any resources for it.
+@@ -7647,7 +7642,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ {
+ u32 val, rdmac_mode;
+ int i, err, limit;
+- struct tg3_rx_prodring_set *tpr = &tp->prodring[0];
++ struct tg3_rx_prodring_set *tpr = &tp->napi[0].prodring;
+
+ tg3_disable_ints(tp);
+
+@@ -10638,7 +10633,7 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode)
+ int num_pkts, tx_len, rx_len, i, err;
+ struct tg3_rx_buffer_desc *desc;
+ struct tg3_napi *tnapi, *rnapi;
+- struct tg3_rx_prodring_set *tpr = &tp->prodring[0];
++ struct tg3_rx_prodring_set *tpr = &tp->napi[0].prodring;
+
+ tnapi = &tp->napi[0];
+ rnapi = &tp->napi[0];
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 606a41d..dcc39c0 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -2679,7 +2679,7 @@ struct tg3_napi {
+ u32 consmbox;
+ u32 rx_rcb_ptr;
+ u16 *rx_rcb_prod_idx;
+- struct tg3_rx_prodring_set *prodring;
++ struct tg3_rx_prodring_set prodring;
+
+ struct tg3_rx_buffer_desc *rx_rcb;
+ struct tg3_tx_buffer_desc *tx_ring;
+@@ -2766,8 +2766,6 @@ struct tg3 {
+ struct vlan_group *vlgrp;
+ #endif
+
+- struct tg3_rx_prodring_set prodring[TG3_IRQ_MAX_VECS];
+-
+
+ /* begin "everything else" cacheline(s) section */
+ struct net_device_stats net_stats;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0160-tg3-Use-skb_is_gso_v6.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0160-tg3-Use-skb_is_gso_v6.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,45 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Wed, 15 Sep 2010 08:59:59 +0000
+Subject: [PATCH 160/207] tg3: Use skb_is_gso_v6()
+
+commit 02e96080af2b70313f2ffc8c1b03ae2f9d8c65ac upstream.
+
+This patch converts the driver to prefer the skb_is_gso_v6() helper over
+the explicit inlined version.
+
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 6 +++---
+ 1 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index fe504f3..d13053a 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -5574,9 +5574,9 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb,
+ goto out_unlock;
+ }
+
+- if (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6)
++ if (skb_is_gso_v6(skb)) {
+ hdrlen = skb_headlen(skb) - ETH_HLEN;
+- else {
++ } else {
+ struct iphdr *iph = ip_hdr(skb);
+
+ tcp_opt_len = tcp_optlen(skb);
+@@ -5798,7 +5798,7 @@ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb,
+ iph = ip_hdr(skb);
+ tcp_opt_len = tcp_optlen(skb);
+
+- if (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6) {
++ if (skb_is_gso_v6(skb)) {
+ hdr_len = skb_headlen(skb) - ETH_HLEN;
+ } else {
+ u32 ip_tcp_len;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0161-tg3-Dynamically-allocate-VPD-data-memory.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0161-tg3-Dynamically-allocate-VPD-data-memory.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,60 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Wed, 15 Sep 2010 09:00:00 +0000
+Subject: [PATCH 161/207] tg3: Dynamically allocate VPD data memory
+
+commit a4a8bb15aed20ff74aa3ca14a4f2c0d62efd8391 upstream.
+
+This patch eases stack pressure by dynamically allocating the memory
+used to temporarily store VPD data.
+
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 15 +++++++++++----
+ 1 files changed, 11 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index d13053a..208caa9 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -12426,14 +12426,18 @@ skip_phy_reset:
+
+ static void __devinit tg3_read_vpd(struct tg3 *tp)
+ {
+- u8 vpd_data[TG3_NVM_VPD_LEN];
++ u8 *vpd_data;
+ unsigned int block_end, rosize, len;
+ int j, i = 0;
+ u32 magic;
+
+ if ((tp->tg3_flags3 & TG3_FLG3_NO_NVRAM) ||
+ tg3_nvram_read(tp, 0x0, &magic))
+- goto out_not_found;
++ goto out_no_vpd;
++
++ vpd_data = kmalloc(TG3_NVM_VPD_LEN, GFP_KERNEL);
++ if (!vpd_data)
++ goto out_no_vpd;
+
+ if (magic == TG3_EEPROM_MAGIC) {
+ for (i = 0; i < TG3_NVM_VPD_LEN; i += 4) {
+@@ -12517,9 +12521,12 @@ partno:
+
+ memcpy(tp->board_part_number, &vpd_data[i], len);
+
+- return;
+-
+ out_not_found:
++ kfree(vpd_data);
++ if (!tp->board_part_number[0])
++ return;
++
++out_no_vpd:
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
+ strcpy(tp->board_part_number, "BCM95906");
+ else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 &&
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0162-tg3-phy-tmp-variable-roundup.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0162-tg3-phy-tmp-variable-roundup.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,143 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Wed, 15 Sep 2010 09:00:01 +0000
+Subject: [PATCH 162/207] tg3: phy tmp variable roundup
+
+commit f833c4c181e4e948758b7b252322f50273100d30 upstream.
+
+The tg3's phy routines define temporary variables in many locations
+within the same routine. This patch unifies all temporary variables
+into one location.
+
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 45 +++++++++++++++------------------------------
+ 1 files changed, 15 insertions(+), 30 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 208caa9..b801697 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -1917,19 +1917,16 @@ static int tg3_phy_reset_5703_4_5(struct tg3 *tp)
+ */
+ static int tg3_phy_reset(struct tg3 *tp)
+ {
+- u32 cpmuctrl;
+- u32 phy_status;
++ u32 val, cpmuctrl;
+ int err;
+
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) {
+- u32 val;
+-
+ val = tr32(GRC_MISC_CFG);
+ tw32_f(GRC_MISC_CFG, val & ~GRC_MISC_CFG_EPHY_IDDQ);
+ udelay(40);
+ }
+- err = tg3_readphy(tp, MII_BMSR, &phy_status);
+- err |= tg3_readphy(tp, MII_BMSR, &phy_status);
++ err = tg3_readphy(tp, MII_BMSR, &val);
++ err |= tg3_readphy(tp, MII_BMSR, &val);
+ if (err != 0)
+ return -EBUSY;
+
+@@ -1961,18 +1958,14 @@ static int tg3_phy_reset(struct tg3 *tp)
+ return err;
+
+ if (cpmuctrl & CPMU_CTRL_GPHY_10MB_RXONLY) {
+- u32 phy;
+-
+- phy = MII_TG3_DSP_EXP8_AEDW | MII_TG3_DSP_EXP8_REJ2MHz;
+- tg3_phydsp_write(tp, MII_TG3_DSP_EXP8, phy);
++ val = MII_TG3_DSP_EXP8_AEDW | MII_TG3_DSP_EXP8_REJ2MHz;
++ tg3_phydsp_write(tp, MII_TG3_DSP_EXP8, val);
+
+ tw32(TG3_CPMU_CTRL, cpmuctrl);
+ }
+
+ if (GET_CHIP_REV(tp->pci_chip_rev_id) == CHIPREV_5784_AX ||
+ GET_CHIP_REV(tp->pci_chip_rev_id) == CHIPREV_5761_AX) {
+- u32 val;
+-
+ val = tr32(TG3_CPMU_LSPD_1000MB_CLK);
+ if ((val & CPMU_LSPD_1000MB_MACCLK_MASK) ==
+ CPMU_LSPD_1000MB_MACCLK_12_5) {
+@@ -2028,23 +2021,19 @@ out:
+ /* Cannot do read-modify-write on 5401 */
+ tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x4c20);
+ } else if (tp->tg3_flags & TG3_FLAG_JUMBO_CAPABLE) {
+- u32 phy_reg;
+-
+ /* Set bit 14 with read-modify-write to preserve other bits */
+ if (!tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x0007) &&
+- !tg3_readphy(tp, MII_TG3_AUX_CTRL, &phy_reg))
+- tg3_writephy(tp, MII_TG3_AUX_CTRL, phy_reg | 0x4000);
++ !tg3_readphy(tp, MII_TG3_AUX_CTRL, &val))
++ tg3_writephy(tp, MII_TG3_AUX_CTRL, val | 0x4000);
+ }
+
+ /* Set phy register 0x10 bit 0 to high fifo elasticity to support
+ * jumbo frames transmission.
+ */
+ if (tp->tg3_flags & TG3_FLAG_JUMBO_CAPABLE) {
+- u32 phy_reg;
+-
+- if (!tg3_readphy(tp, MII_TG3_EXT_CTRL, &phy_reg))
++ if (!tg3_readphy(tp, MII_TG3_EXT_CTRL, &val))
+ tg3_writephy(tp, MII_TG3_EXT_CTRL,
+- phy_reg | MII_TG3_EXT_CTRL_FIFO_ELASTIC);
++ val | MII_TG3_EXT_CTRL_FIFO_ELASTIC);
+ }
+
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) {
+@@ -3060,7 +3049,7 @@ static int tg3_adv_1000T_flowctrl_ok(struct tg3 *tp, u32 *lcladv, u32 *rmtadv)
+ static int tg3_setup_copper_phy(struct tg3 *tp, int force_reset)
+ {
+ int current_link_up;
+- u32 bmsr, dummy;
++ u32 bmsr, val;
+ u32 lcl_adv, rmt_adv;
+ u16 current_speed;
+ u8 current_duplex;
+@@ -3140,8 +3129,8 @@ static int tg3_setup_copper_phy(struct tg3 *tp, int force_reset)
+ }
+
+ /* Clear pending interrupts... */
+- tg3_readphy(tp, MII_TG3_ISTAT, &dummy);
+- tg3_readphy(tp, MII_TG3_ISTAT, &dummy);
++ tg3_readphy(tp, MII_TG3_ISTAT, &val);
++ tg3_readphy(tp, MII_TG3_ISTAT, &val);
+
+ if (tp->phy_flags & TG3_PHYFLG_USE_MI_INTERRUPT)
+ tg3_writephy(tp, MII_TG3_IMASK, ~MII_TG3_INT_LINKCHG);
+@@ -3162,8 +3151,6 @@ static int tg3_setup_copper_phy(struct tg3 *tp, int force_reset)
+ current_duplex = DUPLEX_INVALID;
+
+ if (tp->phy_flags & TG3_PHYFLG_CAPACITIVE_COUPLING) {
+- u32 val;
+-
+ tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x4007);
+ tg3_readphy(tp, MII_TG3_AUX_CTRL, &val);
+ if (!(val & (1 << 10))) {
+@@ -3238,13 +3225,11 @@ static int tg3_setup_copper_phy(struct tg3 *tp, int force_reset)
+
+ relink:
+ if (current_link_up == 0 || (tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER)) {
+- u32 tmp;
+-
+ tg3_phy_copper_begin(tp);
+
+- tg3_readphy(tp, MII_BMSR, &tmp);
+- if (!tg3_readphy(tp, MII_BMSR, &tmp) &&
+- (tmp & BMSR_LSTATUS))
++ tg3_readphy(tp, MII_BMSR, &bmsr);
++ if (!tg3_readphy(tp, MII_BMSR, &bmsr) &&
++ (bmsr & BMSR_LSTATUS))
+ current_link_up = 1;
+ }
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0163-drivers-net-return-operator-cleanup.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0163-drivers-net-return-operator-cleanup.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,43 @@
+From: Eric Dumazet <eric.dumazet at gmail.com>
+Date: Thu, 23 Sep 2010 05:40:09 +0000
+Subject: [PATCH 163/207] drivers/net: return operator cleanup
+
+commit 807540baae406c84dcb9c1c8ef07a56d2d2ae84a upstream.
+
+Change "return (EXPR);" to "return EXPR;"
+
+return is not a function, parentheses are not required.
+
+Signed-off-by: Eric Dumazet <eric.dumazet at gmail.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Restricted to drivers/net/tg3.{c,h}]
+---
+ drivers/net/tg3.c | 5 ++---
+ 1 files changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index b801697..6408304 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -5389,8 +5389,7 @@ static inline int tg3_4g_overflow_test(dma_addr_t mapping, int len)
+ {
+ u32 base = (u32) mapping & 0xffffffff;
+
+- return ((base > 0xffffdcc0) &&
+- (base + len + 8 < base));
++ return (base > 0xffffdcc0) && (base + len + 8 < base);
+ }
+
+ /* Test for DMA addresses > 40-bit */
+@@ -5399,7 +5398,7 @@ static inline int tg3_40bit_overflow_test(struct tg3 *tp, dma_addr_t mapping,
+ {
+ #if defined(CONFIG_HIGHMEM) && (BITS_PER_LONG == 64)
+ if (tp->tg3_flags & TG3_FLAG_40BIT_DMA_BUG)
+- return (((u64) mapping + len) > DMA_BIT_MASK(40));
++ return ((u64) mapping + len) > DMA_BIT_MASK(40);
+ return 0;
+ #else
+ return 0;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0164-tg3-Fix-potential-netpoll-crash.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0164-tg3-Fix-potential-netpoll-crash.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,198 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Thu, 30 Sep 2010 10:34:30 +0000
+Subject: [PATCH 164/207] tg3: Fix potential netpoll crash
+
+commit 66cfd1bd05a7a1c31c9cdbb2ddf5c57d1cddc5f6 upstream.
+
+Up until now the tg3 driver would call netif_napi_add() for the maximum
+number of NAPI instances the driver could use. The problem is that
+netpoll could call tg3_poll() on instances that are not active. The net
+effect is that the driver will crash attempting to dereference
+uninitialized pointers.
+
+The fix is to only allocate as many NAPI instances as the driver would
+use in tg3_open() and deleted them in tg3_close().
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 111 +++++++++++++++++++++++++++++++----------------------
+ 1 files changed, 65 insertions(+), 46 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 6408304..5a49cf2 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -752,42 +752,6 @@ static void tg3_int_reenable(struct tg3_napi *tnapi)
+ HOSTCC_MODE_ENABLE | tnapi->coal_now);
+ }
+
+-static void tg3_napi_disable(struct tg3 *tp)
+-{
+- int i;
+-
+- for (i = tp->irq_cnt - 1; i >= 0; i--)
+- napi_disable(&tp->napi[i].napi);
+-}
+-
+-static void tg3_napi_enable(struct tg3 *tp)
+-{
+- int i;
+-
+- for (i = 0; i < tp->irq_cnt; i++)
+- napi_enable(&tp->napi[i].napi);
+-}
+-
+-static inline void tg3_netif_stop(struct tg3 *tp)
+-{
+- tp->dev->trans_start = jiffies; /* prevent tx timeout */
+- tg3_napi_disable(tp);
+- netif_tx_disable(tp->dev);
+-}
+-
+-static inline void tg3_netif_start(struct tg3 *tp)
+-{
+- /* NOTE: unconditional netif_tx_wake_all_queues is only
+- * appropriate so long as all callers are assured to
+- * have free tx slots (such as after tg3_init_hw)
+- */
+- netif_tx_wake_all_queues(tp->dev);
+-
+- tg3_napi_enable(tp);
+- tp->napi[0].hw_status->status |= SD_STATUS_UPDATED;
+- tg3_enable_ints(tp);
+-}
+-
+ static void tg3_switch_clocks(struct tg3 *tp)
+ {
+ u32 clock_ctrl;
+@@ -4338,6 +4302,11 @@ static int tg3_setup_phy(struct tg3 *tp, int force_reset)
+ return err;
+ }
+
++static inline int tg3_irq_sync(struct tg3 *tp)
++{
++ return tp->irq_sync;
++}
++
+ /* This is called whenever we suspect that the system chipset is re-
+ * ordering the sequence of MMIO to the tx send mailbox. The symptom
+ * is bogus tx completions. We try to recover by setting the
+@@ -5083,6 +5052,59 @@ tx_recovery:
+ return work_done;
+ }
+
++static void tg3_napi_disable(struct tg3 *tp)
++{
++ int i;
++
++ for (i = tp->irq_cnt - 1; i >= 0; i--)
++ napi_disable(&tp->napi[i].napi);
++}
++
++static void tg3_napi_enable(struct tg3 *tp)
++{
++ int i;
++
++ for (i = 0; i < tp->irq_cnt; i++)
++ napi_enable(&tp->napi[i].napi);
++}
++
++static void tg3_napi_init(struct tg3 *tp)
++{
++ int i;
++
++ netif_napi_add(tp->dev, &tp->napi[0].napi, tg3_poll, 64);
++ for (i = 1; i < tp->irq_cnt; i++)
++ netif_napi_add(tp->dev, &tp->napi[i].napi, tg3_poll_msix, 64);
++}
++
++static void tg3_napi_fini(struct tg3 *tp)
++{
++ int i;
++
++ for (i = 0; i < tp->irq_cnt; i++)
++ netif_napi_del(&tp->napi[i].napi);
++}
++
++static inline void tg3_netif_stop(struct tg3 *tp)
++{
++ tp->dev->trans_start = jiffies; /* prevent tx timeout */
++ tg3_napi_disable(tp);
++ netif_tx_disable(tp->dev);
++}
++
++static inline void tg3_netif_start(struct tg3 *tp)
++{
++ /* NOTE: unconditional netif_tx_wake_all_queues is only
++ * appropriate so long as all callers are assured to
++ * have free tx slots (such as after tg3_init_hw)
++ */
++ netif_tx_wake_all_queues(tp->dev);
++
++ tg3_napi_enable(tp);
++ tp->napi[0].hw_status->status |= SD_STATUS_UPDATED;
++ tg3_enable_ints(tp);
++}
++
+ static void tg3_irq_quiesce(struct tg3 *tp)
+ {
+ int i;
+@@ -5096,11 +5118,6 @@ static void tg3_irq_quiesce(struct tg3 *tp)
+ synchronize_irq(tp->napi[i].irq_vec);
+ }
+
+-static inline int tg3_irq_sync(struct tg3 *tp)
+-{
+- return tp->irq_sync;
+-}
+-
+ /* Fully shutdown all tg3 driver activity elsewhere in the system.
+ * If irq_sync is non-zero, then the IRQ handler must be synchronized
+ * with as well. Most of the time, this is not necessary except when
+@@ -8915,6 +8932,8 @@ static int tg3_open(struct net_device *dev)
+ if (err)
+ goto err_out1;
+
++ tg3_napi_init(tp);
++
+ tg3_napi_enable(tp);
+
+ for (i = 0; i < tp->irq_cnt; i++) {
+@@ -9002,6 +9021,7 @@ err_out3:
+
+ err_out2:
+ tg3_napi_disable(tp);
++ tg3_napi_fini(tp);
+ tg3_free_consistent(tp);
+
+ err_out1:
+@@ -9048,6 +9068,8 @@ static int tg3_close(struct net_device *dev)
+ memcpy(&tp->estats_prev, tg3_get_estats(tp),
+ sizeof(tp->estats_prev));
+
++ tg3_napi_fini(tp);
++
+ tg3_free_consistent(tp);
+
+ tg3_set_power_state(tp, PCI_D3hot);
+@@ -14610,13 +14632,10 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
+ tnapi->consmbox = rcvmbx;
+ tnapi->prodmbox = sndmbx;
+
+- if (i) {
++ if (i)
+ tnapi->coal_now = HOSTCC_MODE_COAL_VEC1_NOW << (i - 1);
+- netif_napi_add(dev, &tnapi->napi, tg3_poll_msix, 64);
+- } else {
++ else
+ tnapi->coal_now = HOSTCC_MODE_NOW;
+- netif_napi_add(dev, &tnapi->napi, tg3_poll, 64);
+- }
+
+ if (!(tp->tg3_flags & TG3_FLAG_SUPPORT_MSIX))
+ break;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0165-tg3-5719-Prevent-tx-data-corruption.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0165-tg3-5719-Prevent-tx-data-corruption.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,78 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Thu, 30 Sep 2010 10:34:31 +0000
+Subject: [PATCH 165/207] tg3: 5719: Prevent tx data corruption
+
+commit d309a46e42542223946d3a9e4e239fdc945cb53e upstream.
+
+This patch enables a bit that prevents read DMA overflows and adjusts
+the txmbuf margin from the hardware default. The combination of these
+modifications prevents a tx data corruption issue we were seeing on the
+5719.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 12 +++++++++++-
+ drivers/net/tg3.h | 8 +++++++-
+ 2 files changed, 18 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 5a49cf2..1828eb6 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -7857,7 +7857,10 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ tw32(BUFMGR_DMA_HIGH_WATER,
+ tp->bufmgr_config.dma_high_water);
+
+- tw32(BUFMGR_MODE, BUFMGR_MODE_ENABLE | BUFMGR_MODE_ATTN_ENABLE);
++ val = BUFMGR_MODE_ENABLE | BUFMGR_MODE_ATTN_ENABLE;
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719)
++ val |= BUFMGR_MODE_NO_TX_UNDERRUN;
++ tw32(BUFMGR_MODE, val);
+ for (i = 0; i < 2000; i++) {
+ if (tr32(BUFMGR_MODE) & BUFMGR_MODE_ENABLE)
+ break;
+@@ -8037,6 +8040,13 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ val | TG3_RDMA_RSRVCTRL_FIFO_OFLW_FIX);
+ }
+
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719) {
++ val = tr32(TG3_LSO_RD_DMA_CRPTEN_CTRL);
++ tw32(TG3_LSO_RD_DMA_CRPTEN_CTRL, val |
++ TG3_LSO_RD_DMA_CRPTEN_CTRL_BLEN_BD_4K |
++ TG3_LSO_RD_DMA_CRPTEN_CTRL_BLEN_LSO_4K);
++ }
++
+ /* Receive/send statistics. */
+ if (tp->tg3_flags2 & TG3_FLG2_5750_PLUS) {
+ val = tr32(RCVLPC_STATS_ENABLE);
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index dcc39c0..acb1bbd 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -1225,6 +1225,7 @@
+ #define BUFMGR_MODE_ATTN_ENABLE 0x00000004
+ #define BUFMGR_MODE_BM_TEST 0x00000008
+ #define BUFMGR_MODE_MBLOW_ATTN_ENAB 0x00000010
++#define BUFMGR_MODE_NO_TX_UNDERRUN 0x80000000
+ #define BUFMGR_STATUS 0x00004404
+ #define BUFMGR_STATUS_ERROR 0x00000004
+ #define BUFMGR_STATUS_MBLOW 0x00000010
+@@ -1306,7 +1307,12 @@
+
+ #define TG3_RDMA_RSRVCTRL_REG 0x00004900
+ #define TG3_RDMA_RSRVCTRL_FIFO_OFLW_FIX 0x00000004
+-/* 0x4904 --> 0x4c00 unused */
++/* 0x4904 --> 0x4910 unused */
++
++#define TG3_LSO_RD_DMA_CRPTEN_CTRL 0x00004910
++#define TG3_LSO_RD_DMA_CRPTEN_CTRL_BLEN_BD_4K 0x00030000
++#define TG3_LSO_RD_DMA_CRPTEN_CTRL_BLEN_LSO_4K 0x000c0000
++/* 0x4914 --> 0x4c00 unused */
+
+ /* Write DMA control registers */
+ #define WDMAC_MODE 0x00004c00
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0166-tg3-Remove-5724-device-ID.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0166-tg3-Remove-5724-device-ID.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,51 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Thu, 30 Sep 2010 10:34:32 +0000
+Subject: [PATCH 166/207] tg3: Remove 5724 device ID
+
+commit f51a8903f14512f5ce61a74657db7f84f16b2717 upstream.
+
+This product was never released to the public.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 2 --
+ drivers/net/tg3.h | 1 -
+ 2 files changed, 0 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 1828eb6..ca635a7 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -264,7 +264,6 @@ static DEFINE_PCI_DEVICE_TABLE(tg3_pci_tbl) = {
+ {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_57788)},
+ {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_5717)},
+ {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_5718)},
+- {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_5724)},
+ {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_57781)},
+ {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_57785)},
+ {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_57761)},
+@@ -12889,7 +12888,6 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+
+ if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_5717 ||
+ tp->pdev->device == TG3PCI_DEVICE_TIGON3_5718 ||
+- tp->pdev->device == TG3PCI_DEVICE_TIGON3_5724 ||
+ tp->pdev->device == TG3PCI_DEVICE_TIGON3_5719)
+ pci_read_config_dword(tp->pdev,
+ TG3PCI_GEN2_PRODID_ASICREV,
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index acb1bbd..c57e407 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -46,7 +46,6 @@
+ #define TG3PCI_DEVICE_TIGON3_5785_F 0x16a0 /* 10/100 only */
+ #define TG3PCI_DEVICE_TIGON3_5717 0x1655
+ #define TG3PCI_DEVICE_TIGON3_5718 0x1656
+-#define TG3PCI_DEVICE_TIGON3_5724 0x165c
+ #define TG3PCI_DEVICE_TIGON3_57781 0x16b1
+ #define TG3PCI_DEVICE_TIGON3_57785 0x16b5
+ #define TG3PCI_DEVICE_TIGON3_57761 0x16b0
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0167-tg3-Cleanup-missing-VPD-partno-section.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0167-tg3-Cleanup-missing-VPD-partno-section.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,106 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Thu, 30 Sep 2010 10:34:33 +0000
+Subject: [PATCH 167/207] tg3: Cleanup missing VPD partno section
+
+commit 37a949c54857d8b2a38dbdc75bc8666c3292cbc4 upstream.
+
+This patch cleans up the default VPD partno section. New entries for
+5717 asic rev devices were also added.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 71 ++++++++++++++++++++++++++++------------------------
+ 1 files changed, 38 insertions(+), 33 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index ca635a7..945823c 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -12538,44 +12538,49 @@ partno:
+
+ out_not_found:
+ kfree(vpd_data);
+- if (!tp->board_part_number[0])
++ if (tp->board_part_number[0])
+ return;
+
+ out_no_vpd:
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) {
++ if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_5717)
++ strcpy(tp->board_part_number, "BCM5717");
++ else if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_5718)
++ strcpy(tp->board_part_number, "BCM5718");
++ else
++ goto nomatch;
++ } else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780) {
++ if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_57780)
++ strcpy(tp->board_part_number, "BCM57780");
++ else if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_57760)
++ strcpy(tp->board_part_number, "BCM57760");
++ else if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_57790)
++ strcpy(tp->board_part_number, "BCM57790");
++ else if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_57788)
++ strcpy(tp->board_part_number, "BCM57788");
++ else
++ goto nomatch;
++ } else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) {
++ if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_57761)
++ strcpy(tp->board_part_number, "BCM57761");
++ else if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_57765)
++ strcpy(tp->board_part_number, "BCM57765");
++ else if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_57781)
++ strcpy(tp->board_part_number, "BCM57781");
++ else if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_57785)
++ strcpy(tp->board_part_number, "BCM57785");
++ else if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_57791)
++ strcpy(tp->board_part_number, "BCM57791");
++ else if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_57795)
++ strcpy(tp->board_part_number, "BCM57795");
++ else
++ goto nomatch;
++ } else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) {
+ strcpy(tp->board_part_number, "BCM95906");
+- else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 &&
+- tp->pdev->device == TG3PCI_DEVICE_TIGON3_57780)
+- strcpy(tp->board_part_number, "BCM57780");
+- else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 &&
+- tp->pdev->device == TG3PCI_DEVICE_TIGON3_57760)
+- strcpy(tp->board_part_number, "BCM57760");
+- else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 &&
+- tp->pdev->device == TG3PCI_DEVICE_TIGON3_57790)
+- strcpy(tp->board_part_number, "BCM57790");
+- else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 &&
+- tp->pdev->device == TG3PCI_DEVICE_TIGON3_57788)
+- strcpy(tp->board_part_number, "BCM57788");
+- else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765 &&
+- tp->pdev->device == TG3PCI_DEVICE_TIGON3_57761)
+- strcpy(tp->board_part_number, "BCM57761");
+- else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765 &&
+- tp->pdev->device == TG3PCI_DEVICE_TIGON3_57765)
+- strcpy(tp->board_part_number, "BCM57765");
+- else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765 &&
+- tp->pdev->device == TG3PCI_DEVICE_TIGON3_57781)
+- strcpy(tp->board_part_number, "BCM57781");
+- else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765 &&
+- tp->pdev->device == TG3PCI_DEVICE_TIGON3_57785)
+- strcpy(tp->board_part_number, "BCM57785");
+- else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765 &&
+- tp->pdev->device == TG3PCI_DEVICE_TIGON3_57791)
+- strcpy(tp->board_part_number, "BCM57791");
+- else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765 &&
+- tp->pdev->device == TG3PCI_DEVICE_TIGON3_57795)
+- strcpy(tp->board_part_number, "BCM57795");
+- else
++ } else {
++nomatch:
+ strcpy(tp->board_part_number, "none");
++ }
+ }
+
+ static int __devinit tg3_fw_img_is_valid(struct tg3 *tp, u32 offset)
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0168-tg3-Futureproof-the-loopback-test.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0168-tg3-Futureproof-the-loopback-test.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,34 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Thu, 30 Sep 2010 10:34:34 +0000
+Subject: [PATCH 168/207] tg3: Futureproof the loopback test
+
+commit 1da85aa3db6878639e407548dad5b2404443e2c5 upstream.
+
+There are other multiqueue modes 5717 and 5719 devices can assume. This
+patch makes sure that the loopback test is safe, should those other
+modes be enabled in the future.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 3 ++-
+ 1 files changed, 2 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 945823c..c6bed69 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -10653,7 +10653,8 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode)
+ tnapi = &tp->napi[0];
+ rnapi = &tp->napi[0];
+ if (tp->irq_cnt > 1) {
+- rnapi = &tp->napi[1];
++ if (tp->tg3_flags3 & TG3_FLG3_ENABLE_RSS)
++ rnapi = &tp->napi[1];
+ if (tp->tg3_flags3 & TG3_FLG3_ENABLE_TSS)
+ tnapi = &tp->napi[1];
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0169-tg3-Prepare-for-larger-rx-ring-sizes.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0169-tg3-Prepare-for-larger-rx-ring-sizes.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,372 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Thu, 30 Sep 2010 10:34:35 +0000
+Subject: [PATCH 169/207] tg3: Prepare for larger rx ring sizes
+
+commit 2c49a44df33e22e1f48bd8d51781e7f38d55d002 upstream.
+
+This patch adds two new variables to track the size of the standard and
+jumbo rx producer ring sizes. The code is then pivoted to these
+variables from preprocessor constants.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 119 ++++++++++++++++++++++++++++------------------------
+ drivers/net/tg3.h | 2 +
+ 2 files changed, 66 insertions(+), 55 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index c6bed69..81722bc 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -101,9 +101,9 @@
+ * You can't change the ring sizes, but you can change where you place
+ * them in the NIC onboard memory.
+ */
+-#define TG3_RX_RING_SIZE 512
++#define TG3_RX_STD_RING_SIZE(tp) 512
+ #define TG3_DEF_RX_RING_PENDING 200
+-#define TG3_RX_JUMBO_RING_SIZE 256
++#define TG3_RX_JMB_RING_SIZE(tp) 256
+ #define TG3_DEF_RX_JUMBO_RING_PENDING 100
+ #define TG3_RSS_INDIR_TBL_SIZE 128
+
+@@ -120,12 +120,12 @@
+ #define TG3_TX_RING_SIZE 512
+ #define TG3_DEF_TX_RING_PENDING (TG3_TX_RING_SIZE - 1)
+
+-#define TG3_RX_RING_BYTES (sizeof(struct tg3_rx_buffer_desc) * \
+- TG3_RX_RING_SIZE)
+-#define TG3_RX_JUMBO_RING_BYTES (sizeof(struct tg3_ext_rx_buffer_desc) * \
+- TG3_RX_JUMBO_RING_SIZE)
+-#define TG3_RX_RCB_RING_BYTES(tp) (sizeof(struct tg3_rx_buffer_desc) * \
+- TG3_RX_RCB_RING_SIZE(tp))
++#define TG3_RX_STD_RING_BYTES(tp) \
++ (sizeof(struct tg3_rx_buffer_desc) * TG3_RX_STD_RING_SIZE(tp))
++#define TG3_RX_JMB_RING_BYTES(tp) \
++ (sizeof(struct tg3_ext_rx_buffer_desc) * TG3_RX_JMB_RING_SIZE(tp))
++#define TG3_RX_RCB_RING_BYTES(tp) \
++ (sizeof(struct tg3_rx_buffer_desc) * TG3_RX_RCB_RING_SIZE(tp))
+ #define TG3_TX_RING_BYTES (sizeof(struct tg3_tx_buffer_desc) * \
+ TG3_TX_RING_SIZE)
+ #define NEXT_TX(N) (((N) + 1) & (TG3_TX_RING_SIZE - 1))
+@@ -143,11 +143,11 @@
+ #define TG3_RX_STD_MAP_SZ TG3_RX_DMA_TO_MAP_SZ(TG3_RX_STD_DMA_SZ)
+ #define TG3_RX_JMB_MAP_SZ TG3_RX_DMA_TO_MAP_SZ(TG3_RX_JMB_DMA_SZ)
+
+-#define TG3_RX_STD_BUFF_RING_SIZE \
+- (sizeof(struct ring_info) * TG3_RX_RING_SIZE)
++#define TG3_RX_STD_BUFF_RING_SIZE(tp) \
++ (sizeof(struct ring_info) * TG3_RX_STD_RING_SIZE(tp))
+
+-#define TG3_RX_JMB_BUFF_RING_SIZE \
+- (sizeof(struct ring_info) * TG3_RX_JUMBO_RING_SIZE)
++#define TG3_RX_JMB_BUFF_RING_SIZE(tp) \
++ (sizeof(struct ring_info) * TG3_RX_JMB_RING_SIZE(tp))
+
+ /* Due to a hardware bug, the 5701 can only DMA to memory addresses
+ * that are at least dword aligned when used in PCIX mode. The driver
+@@ -4445,14 +4445,14 @@ static int tg3_alloc_rx_skb(struct tg3 *tp, struct tg3_rx_prodring_set *tpr,
+ src_map = NULL;
+ switch (opaque_key) {
+ case RXD_OPAQUE_RING_STD:
+- dest_idx = dest_idx_unmasked % TG3_RX_RING_SIZE;
++ dest_idx = dest_idx_unmasked & tp->rx_std_ring_mask;
+ desc = &tpr->rx_std[dest_idx];
+ map = &tpr->rx_std_buffers[dest_idx];
+ skb_size = tp->rx_pkt_map_sz;
+ break;
+
+ case RXD_OPAQUE_RING_JUMBO:
+- dest_idx = dest_idx_unmasked % TG3_RX_JUMBO_RING_SIZE;
++ dest_idx = dest_idx_unmasked & tp->rx_jmb_ring_mask;
+ desc = &tpr->rx_jmb[dest_idx].std;
+ map = &tpr->rx_jmb_buffers[dest_idx];
+ skb_size = TG3_RX_JMB_MAP_SZ;
+@@ -4507,7 +4507,7 @@ static void tg3_recycle_rx(struct tg3_napi *tnapi,
+
+ switch (opaque_key) {
+ case RXD_OPAQUE_RING_STD:
+- dest_idx = dest_idx_unmasked % TG3_RX_RING_SIZE;
++ dest_idx = dest_idx_unmasked & tp->rx_std_ring_mask;
+ dest_desc = &dpr->rx_std[dest_idx];
+ dest_map = &dpr->rx_std_buffers[dest_idx];
+ src_desc = &spr->rx_std[src_idx];
+@@ -4515,7 +4515,7 @@ static void tg3_recycle_rx(struct tg3_napi *tnapi,
+ break;
+
+ case RXD_OPAQUE_RING_JUMBO:
+- dest_idx = dest_idx_unmasked % TG3_RX_JUMBO_RING_SIZE;
++ dest_idx = dest_idx_unmasked & tp->rx_jmb_ring_mask;
+ dest_desc = &dpr->rx_jmb[dest_idx].std;
+ dest_map = &dpr->rx_jmb_buffers[dest_idx];
+ src_desc = &spr->rx_jmb[src_idx].std;
+@@ -4715,7 +4715,8 @@ next_pkt:
+ (*post_ptr)++;
+
+ if (unlikely(rx_std_posted >= tp->rx_std_max_post)) {
+- tpr->rx_std_prod_idx = std_prod_idx % TG3_RX_RING_SIZE;
++ tpr->rx_std_prod_idx = std_prod_idx &
++ tp->rx_std_ring_mask;
+ tw32_rx_mbox(TG3_RX_STD_PROD_IDX_REG,
+ tpr->rx_std_prod_idx);
+ work_mask &= ~RXD_OPAQUE_RING_STD;
+@@ -4739,13 +4740,14 @@ next_pkt_nopost:
+ /* Refill RX ring(s). */
+ if (!(tp->tg3_flags3 & TG3_FLG3_ENABLE_RSS)) {
+ if (work_mask & RXD_OPAQUE_RING_STD) {
+- tpr->rx_std_prod_idx = std_prod_idx % TG3_RX_RING_SIZE;
++ tpr->rx_std_prod_idx = std_prod_idx &
++ tp->rx_std_ring_mask;
+ tw32_rx_mbox(TG3_RX_STD_PROD_IDX_REG,
+ tpr->rx_std_prod_idx);
+ }
+ if (work_mask & RXD_OPAQUE_RING_JUMBO) {
+- tpr->rx_jmb_prod_idx = jmb_prod_idx %
+- TG3_RX_JUMBO_RING_SIZE;
++ tpr->rx_jmb_prod_idx = jmb_prod_idx &
++ tp->rx_jmb_ring_mask;
+ tw32_rx_mbox(TG3_RX_JMB_PROD_IDX_REG,
+ tpr->rx_jmb_prod_idx);
+ }
+@@ -4756,8 +4758,8 @@ next_pkt_nopost:
+ */
+ smp_wmb();
+
+- tpr->rx_std_prod_idx = std_prod_idx % TG3_RX_RING_SIZE;
+- tpr->rx_jmb_prod_idx = jmb_prod_idx % TG3_RX_JUMBO_RING_SIZE;
++ tpr->rx_std_prod_idx = std_prod_idx & tp->rx_std_ring_mask;
++ tpr->rx_jmb_prod_idx = jmb_prod_idx & tp->rx_jmb_ring_mask;
+
+ if (tnapi != &tp->napi[1])
+ napi_schedule(&tp->napi[1].napi);
+@@ -4813,9 +4815,11 @@ static int tg3_rx_prodring_xfer(struct tg3 *tp,
+ if (spr->rx_std_cons_idx < src_prod_idx)
+ cpycnt = src_prod_idx - spr->rx_std_cons_idx;
+ else
+- cpycnt = TG3_RX_RING_SIZE - spr->rx_std_cons_idx;
++ cpycnt = tp->rx_std_ring_mask + 1 -
++ spr->rx_std_cons_idx;
+
+- cpycnt = min(cpycnt, TG3_RX_RING_SIZE - dpr->rx_std_prod_idx);
++ cpycnt = min(cpycnt,
++ tp->rx_std_ring_mask + 1 - dpr->rx_std_prod_idx);
+
+ si = spr->rx_std_cons_idx;
+ di = dpr->rx_std_prod_idx;
+@@ -4849,10 +4853,10 @@ static int tg3_rx_prodring_xfer(struct tg3 *tp,
+ dbd->addr_lo = sbd->addr_lo;
+ }
+
+- spr->rx_std_cons_idx = (spr->rx_std_cons_idx + cpycnt) %
+- TG3_RX_RING_SIZE;
+- dpr->rx_std_prod_idx = (dpr->rx_std_prod_idx + cpycnt) %
+- TG3_RX_RING_SIZE;
++ spr->rx_std_cons_idx = (spr->rx_std_cons_idx + cpycnt) &
++ tp->rx_std_ring_mask;
++ dpr->rx_std_prod_idx = (dpr->rx_std_prod_idx + cpycnt) &
++ tp->rx_std_ring_mask;
+ }
+
+ while (1) {
+@@ -4869,10 +4873,11 @@ static int tg3_rx_prodring_xfer(struct tg3 *tp,
+ if (spr->rx_jmb_cons_idx < src_prod_idx)
+ cpycnt = src_prod_idx - spr->rx_jmb_cons_idx;
+ else
+- cpycnt = TG3_RX_JUMBO_RING_SIZE - spr->rx_jmb_cons_idx;
++ cpycnt = tp->rx_jmb_ring_mask + 1 -
++ spr->rx_jmb_cons_idx;
+
+ cpycnt = min(cpycnt,
+- TG3_RX_JUMBO_RING_SIZE - dpr->rx_jmb_prod_idx);
++ tp->rx_jmb_ring_mask + 1 - dpr->rx_jmb_prod_idx);
+
+ si = spr->rx_jmb_cons_idx;
+ di = dpr->rx_jmb_prod_idx;
+@@ -4906,10 +4911,10 @@ static int tg3_rx_prodring_xfer(struct tg3 *tp,
+ dbd->addr_lo = sbd->addr_lo;
+ }
+
+- spr->rx_jmb_cons_idx = (spr->rx_jmb_cons_idx + cpycnt) %
+- TG3_RX_JUMBO_RING_SIZE;
+- dpr->rx_jmb_prod_idx = (dpr->rx_jmb_prod_idx + cpycnt) %
+- TG3_RX_JUMBO_RING_SIZE;
++ spr->rx_jmb_cons_idx = (spr->rx_jmb_cons_idx + cpycnt) &
++ tp->rx_jmb_ring_mask;
++ dpr->rx_jmb_prod_idx = (dpr->rx_jmb_prod_idx + cpycnt) &
++ tp->rx_jmb_ring_mask;
+ }
+
+ return err;
+@@ -6059,14 +6064,14 @@ static void tg3_rx_prodring_free(struct tg3 *tp,
+
+ if (tpr != &tp->napi[0].prodring) {
+ for (i = tpr->rx_std_cons_idx; i != tpr->rx_std_prod_idx;
+- i = (i + 1) % TG3_RX_RING_SIZE)
++ i = (i + 1) & tp->rx_std_ring_mask)
+ tg3_rx_skb_free(tp, &tpr->rx_std_buffers[i],
+ tp->rx_pkt_map_sz);
+
+ if (tp->tg3_flags & TG3_FLAG_JUMBO_CAPABLE) {
+ for (i = tpr->rx_jmb_cons_idx;
+ i != tpr->rx_jmb_prod_idx;
+- i = (i + 1) % TG3_RX_JUMBO_RING_SIZE) {
++ i = (i + 1) & tp->rx_jmb_ring_mask) {
+ tg3_rx_skb_free(tp, &tpr->rx_jmb_buffers[i],
+ TG3_RX_JMB_MAP_SZ);
+ }
+@@ -6075,12 +6080,12 @@ static void tg3_rx_prodring_free(struct tg3 *tp,
+ return;
+ }
+
+- for (i = 0; i < TG3_RX_RING_SIZE; i++)
++ for (i = 0; i <= tp->rx_std_ring_mask; i++)
+ tg3_rx_skb_free(tp, &tpr->rx_std_buffers[i],
+ tp->rx_pkt_map_sz);
+
+ if (tp->tg3_flags & TG3_FLAG_JUMBO_CAPABLE) {
+- for (i = 0; i < TG3_RX_JUMBO_RING_SIZE; i++)
++ for (i = 0; i <= tp->rx_jmb_ring_mask; i++)
+ tg3_rx_skb_free(tp, &tpr->rx_jmb_buffers[i],
+ TG3_RX_JMB_MAP_SZ);
+ }
+@@ -6104,15 +6109,16 @@ static int tg3_rx_prodring_alloc(struct tg3 *tp,
+ tpr->rx_jmb_prod_idx = 0;
+
+ if (tpr != &tp->napi[0].prodring) {
+- memset(&tpr->rx_std_buffers[0], 0, TG3_RX_STD_BUFF_RING_SIZE);
++ memset(&tpr->rx_std_buffers[0], 0,
++ TG3_RX_STD_BUFF_RING_SIZE(tp));
+ if (tp->tg3_flags & TG3_FLAG_JUMBO_CAPABLE)
+ memset(&tpr->rx_jmb_buffers[0], 0,
+- TG3_RX_JMB_BUFF_RING_SIZE);
++ TG3_RX_JMB_BUFF_RING_SIZE(tp));
+ goto done;
+ }
+
+ /* Zero out all descriptors. */
+- memset(tpr->rx_std, 0, TG3_RX_RING_BYTES);
++ memset(tpr->rx_std, 0, TG3_RX_STD_RING_BYTES(tp));
+
+ rx_pkt_dma_sz = TG3_RX_STD_DMA_SZ;
+ if ((tp->tg3_flags2 & TG3_FLG2_5780_CLASS) &&
+@@ -6124,7 +6130,7 @@ static int tg3_rx_prodring_alloc(struct tg3 *tp,
+ * stuff once. This works because the card does not
+ * write into the rx buffer posting rings.
+ */
+- for (i = 0; i < TG3_RX_RING_SIZE; i++) {
++ for (i = 0; i <= tp->rx_std_ring_mask; i++) {
+ struct tg3_rx_buffer_desc *rxd;
+
+ rxd = &tpr->rx_std[i];
+@@ -6151,12 +6157,12 @@ static int tg3_rx_prodring_alloc(struct tg3 *tp,
+ if (!(tp->tg3_flags & TG3_FLAG_JUMBO_CAPABLE))
+ goto done;
+
+- memset(tpr->rx_jmb, 0, TG3_RX_JUMBO_RING_BYTES);
++ memset(tpr->rx_jmb, 0, TG3_RX_JMB_RING_BYTES(tp));
+
+ if (!(tp->tg3_flags & TG3_FLAG_JUMBO_RING_ENABLE))
+ goto done;
+
+- for (i = 0; i < TG3_RX_JUMBO_RING_SIZE; i++) {
++ for (i = 0; i <= tp->rx_jmb_ring_mask; i++) {
+ struct tg3_rx_buffer_desc *rxd;
+
+ rxd = &tpr->rx_jmb[i].std;
+@@ -6196,12 +6202,12 @@ static void tg3_rx_prodring_fini(struct tg3 *tp,
+ kfree(tpr->rx_jmb_buffers);
+ tpr->rx_jmb_buffers = NULL;
+ if (tpr->rx_std) {
+- pci_free_consistent(tp->pdev, TG3_RX_RING_BYTES,
++ pci_free_consistent(tp->pdev, TG3_RX_STD_RING_BYTES(tp),
+ tpr->rx_std, tpr->rx_std_mapping);
+ tpr->rx_std = NULL;
+ }
+ if (tpr->rx_jmb) {
+- pci_free_consistent(tp->pdev, TG3_RX_JUMBO_RING_BYTES,
++ pci_free_consistent(tp->pdev, TG3_RX_JMB_RING_BYTES(tp),
+ tpr->rx_jmb, tpr->rx_jmb_mapping);
+ tpr->rx_jmb = NULL;
+ }
+@@ -6210,23 +6216,24 @@ static void tg3_rx_prodring_fini(struct tg3 *tp,
+ static int tg3_rx_prodring_init(struct tg3 *tp,
+ struct tg3_rx_prodring_set *tpr)
+ {
+- tpr->rx_std_buffers = kzalloc(TG3_RX_STD_BUFF_RING_SIZE, GFP_KERNEL);
++ tpr->rx_std_buffers = kzalloc(TG3_RX_STD_BUFF_RING_SIZE(tp),
++ GFP_KERNEL);
+ if (!tpr->rx_std_buffers)
+ return -ENOMEM;
+
+- tpr->rx_std = pci_alloc_consistent(tp->pdev, TG3_RX_RING_BYTES,
++ tpr->rx_std = pci_alloc_consistent(tp->pdev, TG3_RX_STD_RING_BYTES(tp),
+ &tpr->rx_std_mapping);
+ if (!tpr->rx_std)
+ goto err_out;
+
+ if (tp->tg3_flags & TG3_FLAG_JUMBO_CAPABLE) {
+- tpr->rx_jmb_buffers = kzalloc(TG3_RX_JMB_BUFF_RING_SIZE,
++ tpr->rx_jmb_buffers = kzalloc(TG3_RX_JMB_BUFF_RING_SIZE(tp),
+ GFP_KERNEL);
+ if (!tpr->rx_jmb_buffers)
+ goto err_out;
+
+ tpr->rx_jmb = pci_alloc_consistent(tp->pdev,
+- TG3_RX_JUMBO_RING_BYTES,
++ TG3_RX_JMB_RING_BYTES(tp),
+ &tpr->rx_jmb_mapping);
+ if (!tpr->rx_jmb)
+ goto err_out;
+@@ -9860,10 +9867,10 @@ static void tg3_get_ringparam(struct net_device *dev, struct ethtool_ringparam *
+ {
+ struct tg3 *tp = netdev_priv(dev);
+
+- ering->rx_max_pending = TG3_RX_RING_SIZE - 1;
++ ering->rx_max_pending = tp->rx_std_ring_mask;
+ ering->rx_mini_max_pending = 0;
+ if (tp->tg3_flags & TG3_FLAG_JUMBO_RING_ENABLE)
+- ering->rx_jumbo_max_pending = TG3_RX_JUMBO_RING_SIZE - 1;
++ ering->rx_jumbo_max_pending = tp->rx_jmb_ring_mask;
+ else
+ ering->rx_jumbo_max_pending = 0;
+
+@@ -9884,8 +9891,8 @@ static int tg3_set_ringparam(struct net_device *dev, struct ethtool_ringparam *e
+ struct tg3 *tp = netdev_priv(dev);
+ int i, irq_sync = 0, err = 0;
+
+- if ((ering->rx_pending > TG3_RX_RING_SIZE - 1) ||
+- (ering->rx_jumbo_pending > TG3_RX_JUMBO_RING_SIZE - 1) ||
++ if ((ering->rx_pending > tp->rx_std_ring_mask) ||
++ (ering->rx_jumbo_pending > tp->rx_jmb_ring_mask) ||
+ (ering->tx_pending > TG3_TX_RING_SIZE - 1) ||
+ (ering->tx_pending <= MAX_SKB_FRAGS) ||
+ ((tp->tg3_flags2 & TG3_FLG2_TSO_BUG) &&
+@@ -13603,7 +13610,9 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ #endif
+ }
+
+- tp->rx_std_max_post = TG3_RX_RING_SIZE;
++ tp->rx_std_ring_mask = TG3_RX_STD_RING_SIZE(tp) - 1;
++ tp->rx_jmb_ring_mask = TG3_RX_JMB_RING_SIZE(tp) - 1;
++ tp->rx_std_max_post = tp->rx_std_ring_mask + 1;
+
+ /* Increment the rx prod index on the rx std ring by at most
+ * 8 for these chips to workaround hw errata.
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index c57e407..6f52556 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -2762,6 +2762,8 @@ struct tg3 {
+ void (*write32_rx_mbox) (struct tg3 *, u32,
+ u32);
+ u32 rx_copy_thresh;
++ u32 rx_std_ring_mask;
++ u32 rx_jmb_ring_mask;
+ u32 rx_pending;
+ u32 rx_jumbo_pending;
+ u32 rx_std_max_post;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0170-tg3-Add-extend-rx-ring-sizes-for-5717-and-5719.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0170-tg3-Add-extend-rx-ring-sizes-for-5717-and-5719.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,178 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Thu, 30 Sep 2010 10:34:36 +0000
+Subject: [PATCH 170/207] tg3: Add extend rx ring sizes for 5717 and 5719
+
+commit 7cb32cf23c63a371cf89bfaad3f911a1609241cc upstream.
+
+This patch increases the rx ring sizes for those asic revs that support
+them.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 55 ++++++++++++++++++++++++++++++++++++++--------------
+ drivers/net/tg3.h | 3 ++
+ 2 files changed, 43 insertions(+), 15 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 81722bc..e1282be 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -101,9 +101,15 @@
+ * You can't change the ring sizes, but you can change where you place
+ * them in the NIC onboard memory.
+ */
+-#define TG3_RX_STD_RING_SIZE(tp) 512
++#define TG3_RX_STD_RING_SIZE(tp) \
++ ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || \
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719) ? \
++ RX_STD_MAX_SIZE_5717 : 512)
+ #define TG3_DEF_RX_RING_PENDING 200
+-#define TG3_RX_JMB_RING_SIZE(tp) 256
++#define TG3_RX_JMB_RING_SIZE(tp) \
++ ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || \
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719) ? \
++ 1024 : 256)
+ #define TG3_DEF_RX_JUMBO_RING_PENDING 100
+ #define TG3_RSS_INDIR_TBL_SIZE 128
+
+@@ -113,9 +119,6 @@
+ * hw multiply/modulo instructions. Another solution would be to
+ * replace things like '% foo' with '& (foo - 1)'.
+ */
+-#define TG3_RX_RCB_RING_SIZE(tp) \
+- (((tp->tg3_flags & TG3_FLAG_JUMBO_CAPABLE) && \
+- !(tp->tg3_flags2 & TG3_FLG2_5780_CLASS)) ? 1024 : 512)
+
+ #define TG3_TX_RING_SIZE 512
+ #define TG3_DEF_TX_RING_PENDING (TG3_TX_RING_SIZE - 1)
+@@ -125,7 +128,7 @@
+ #define TG3_RX_JMB_RING_BYTES(tp) \
+ (sizeof(struct tg3_ext_rx_buffer_desc) * TG3_RX_JMB_RING_SIZE(tp))
+ #define TG3_RX_RCB_RING_BYTES(tp) \
+- (sizeof(struct tg3_rx_buffer_desc) * TG3_RX_RCB_RING_SIZE(tp))
++ (sizeof(struct tg3_rx_buffer_desc) * (tp->rx_ret_ring_mask + 1))
+ #define TG3_TX_RING_BYTES (sizeof(struct tg3_tx_buffer_desc) * \
+ TG3_TX_RING_SIZE)
+ #define NEXT_TX(N) (((N) + 1) & (TG3_TX_RING_SIZE - 1))
+@@ -4724,7 +4727,7 @@ next_pkt:
+ }
+ next_pkt_nopost:
+ sw_idx++;
+- sw_idx &= (TG3_RX_RCB_RING_SIZE(tp) - 1);
++ sw_idx &= tp->rx_ret_ring_mask;
+
+ /* Refresh hw_idx to see if there is new work */
+ if (sw_idx == hw_idx) {
+@@ -7612,8 +7615,8 @@ static void tg3_rings_reset(struct tg3 *tp)
+
+ if (tnapi->rx_rcb) {
+ tg3_set_bdinfo(tp, rxrcb, tnapi->rx_rcb_mapping,
+- (TG3_RX_RCB_RING_SIZE(tp) <<
+- BDINFO_FLAGS_MAXLEN_SHIFT), 0);
++ (tp->rx_ret_ring_mask + 1) <<
++ BDINFO_FLAGS_MAXLEN_SHIFT, 0);
+ rxrcb += TG3_BDINFO_SIZE;
+ }
+
+@@ -7636,7 +7639,7 @@ static void tg3_rings_reset(struct tg3 *tp)
+ }
+
+ tg3_set_bdinfo(tp, rxrcb, tnapi->rx_rcb_mapping,
+- (TG3_RX_RCB_RING_SIZE(tp) <<
++ ((tp->rx_ret_ring_mask + 1) <<
+ BDINFO_FLAGS_MAXLEN_SHIFT), 0);
+
+ stblk += 8;
+@@ -7949,10 +7952,14 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ BDINFO_FLAGS_DISABLED);
+ }
+
+- if (tp->tg3_flags3 & TG3_FLG3_5717_PLUS)
+- val = (RX_STD_MAX_SIZE_5705 << BDINFO_FLAGS_MAXLEN_SHIFT) |
+- (TG3_RX_STD_DMA_SZ << 2);
+- else
++ if (tp->tg3_flags3 & TG3_FLG3_5717_PLUS) {
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
++ val = RX_STD_MAX_SIZE_5705;
++ else
++ val = RX_STD_MAX_SIZE_5717;
++ val <<= BDINFO_FLAGS_MAXLEN_SHIFT;
++ val |= (TG3_RX_STD_DMA_SZ << 2);
++ } else
+ val = TG3_RX_STD_DMA_SZ << BDINFO_FLAGS_MAXLEN_SHIFT;
+ } else
+ val = RX_STD_MAX_SIZE_5705 << BDINFO_FLAGS_MAXLEN_SHIFT;
+@@ -8235,7 +8242,11 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+
+ tw32(SNDBDC_MODE, SNDBDC_MODE_ENABLE | SNDBDC_MODE_ATTN_ENABLE);
+ tw32(RCVBDI_MODE, RCVBDI_MODE_ENABLE | RCVBDI_MODE_RCB_ATTN_ENAB);
+- tw32(RCVDBDI_MODE, RCVDBDI_MODE_ENABLE | RCVDBDI_MODE_INV_RING_SZ);
++ val = RCVDBDI_MODE_ENABLE | RCVDBDI_MODE_INV_RING_SZ;
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719)
++ val |= RCVDBDI_MODE_LRG_RING_SZ;
++ tw32(RCVDBDI_MODE, val);
+ tw32(SNDDATAI_MODE, SNDDATAI_MODE_ENABLE);
+ if (tp->tg3_flags2 & TG3_FLG2_HW_TSO)
+ tw32(SNDDATAI_MODE, SNDDATAI_MODE_ENABLE | 0x8);
+@@ -12857,6 +12868,18 @@ static void inline vlan_features_add(struct net_device *dev, unsigned long flags
+ #endif
+ }
+
++static inline u32 tg3_rx_ret_ring_size(struct tg3 *tp)
++{
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719)
++ return 4096;
++ else if ((tp->tg3_flags & TG3_FLAG_JUMBO_CAPABLE) &&
++ !(tp->tg3_flags2 & TG3_FLG2_5780_CLASS))
++ return 1024;
++ else
++ return 512;
++}
++
+ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ {
+ static struct pci_device_id write_reorder_chipsets[] = {
+@@ -13612,6 +13635,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+
+ tp->rx_std_ring_mask = TG3_RX_STD_RING_SIZE(tp) - 1;
+ tp->rx_jmb_ring_mask = TG3_RX_JMB_RING_SIZE(tp) - 1;
++ tp->rx_ret_ring_mask = tg3_rx_ret_ring_size(tp) - 1;
++
+ tp->rx_std_max_post = tp->rx_std_ring_mask + 1;
+
+ /* Increment the rx prod index on the rx std ring by at most
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 6f52556..08460c2 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -26,6 +26,7 @@
+ #define TG3_RX_INTERNAL_RING_SZ_5906 32
+
+ #define RX_STD_MAX_SIZE_5705 512
++#define RX_STD_MAX_SIZE_5717 2048
+ #define RX_JUMBO_MAX_SIZE 0xdeadbeef /* XXX */
+
+ /* First 256 bytes are a mirror of PCI config space. */
+@@ -972,6 +973,7 @@
+ #define RCVDBDI_MODE_JUMBOBD_NEEDED 0x00000004
+ #define RCVDBDI_MODE_FRM_TOO_BIG 0x00000008
+ #define RCVDBDI_MODE_INV_RING_SZ 0x00000010
++#define RCVDBDI_MODE_LRG_RING_SZ 0x00010000
+ #define RCVDBDI_STATUS 0x00002404
+ #define RCVDBDI_STATUS_JUMBOBD_NEEDED 0x00000004
+ #define RCVDBDI_STATUS_FRM_TOO_BIG 0x00000008
+@@ -2764,6 +2766,7 @@ struct tg3 {
+ u32 rx_copy_thresh;
+ u32 rx_std_ring_mask;
+ u32 rx_jmb_ring_mask;
++ u32 rx_ret_ring_mask;
+ u32 rx_pending;
+ u32 rx_jumbo_pending;
+ u32 rx_std_max_post;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0171-tg3-Update-version-to-3.114.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0171-tg3-Update-version-to-3.114.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,35 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Thu, 30 Sep 2010 10:34:37 +0000
+Subject: [PATCH 171/207] tg3: Update version to 3.114
+
+commit c7ebfdaca0b89fe9d846e93b249303313612d0e3 upstream.
+
+This patch updates the tg3 version to 3.114.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index e1282be..03dfc94 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -69,10 +69,10 @@
+
+ #define DRV_MODULE_NAME "tg3"
+ #define TG3_MAJ_NUM 3
+-#define TG3_MIN_NUM 113
++#define TG3_MIN_NUM 114
+ #define DRV_MODULE_VERSION \
+ __stringify(TG3_MAJ_NUM) "." __stringify(TG3_MIN_NUM)
+-#define DRV_MODULE_RELDATE "August 2, 2010"
++#define DRV_MODULE_RELDATE "September 30, 2010"
+
+ #define TG3_DEF_MAC_MODE 0
+ #define TG3_DEF_RX_MODE 0
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0172-net-tg3-simplify-conditional.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0172-net-tg3-simplify-conditional.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,31 @@
+From: Nicolas Kaiser <nikai at nikai.net>
+Date: Thu, 7 Oct 2010 23:29:27 +0000
+Subject: [PATCH 172/207] net/tg3: simplify conditional
+
+commit 2259dca36a2f0226596ea37132a46338fcff6722 upstream.
+
+Simplify: ((a && !b) || (!a && b)) => (a != b)
+
+Signed-off-by: Nicolas Kaiser <nikai at nikai.net>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 3 +--
+ 1 files changed, 1 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 03dfc94..9419104 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -9973,8 +9973,7 @@ static int tg3_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam
+
+ if (!(phydev->supported & SUPPORTED_Pause) ||
+ (!(phydev->supported & SUPPORTED_Asym_Pause) &&
+- ((epause->rx_pause && !epause->tx_pause) ||
+- (!epause->rx_pause && epause->tx_pause))))
++ (epause->rx_pause != epause->tx_pause)))
+ return -EINVAL;
+
+ tp->link_config.flowctrl = 0;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0173-tg3-Add-support-for-selfboot-format-1-v6.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0173-tg3-Add-support-for-selfboot-format-1-v6.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,55 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Thu, 14 Oct 2010 10:37:38 +0000
+Subject: [PATCH 173/207] tg3: Add support for selfboot format 1 v6
+
+commit bba226acf4d13586ce47cf8376db33bed7bc0bd6 upstream.
+
+5718 B0 and 5719 devices will use a new selfboot firmware format. This
+patch adds code to detect the new format so that bootcode versions get
+reported correctly.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 3 +++
+ drivers/net/tg3.h | 2 ++
+ 2 files changed, 5 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 9419104..2b4e678 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -12707,6 +12707,9 @@ static void __devinit tg3_read_sb_ver(struct tg3 *tp, u32 val)
+ case TG3_EEPROM_SB_REVISION_5:
+ offset = TG3_EEPROM_SB_F1R5_EDH_OFF;
+ break;
++ case TG3_EEPROM_SB_REVISION_6:
++ offset = TG3_EEPROM_SB_F1R6_EDH_OFF;
++ break;
+ default:
+ return;
+ }
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 08460c2..c26b32d 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -1915,6 +1915,7 @@
+ #define TG3_EEPROM_SB_REVISION_3 0x00030000
+ #define TG3_EEPROM_SB_REVISION_4 0x00040000
+ #define TG3_EEPROM_SB_REVISION_5 0x00050000
++#define TG3_EEPROM_SB_REVISION_6 0x00060000
+ #define TG3_EEPROM_MAGIC_HW 0xabcd
+ #define TG3_EEPROM_MAGIC_HW_MSK 0xffff
+
+@@ -1934,6 +1935,7 @@
+ #define TG3_EEPROM_SB_F1R3_EDH_OFF 0x18
+ #define TG3_EEPROM_SB_F1R4_EDH_OFF 0x1c
+ #define TG3_EEPROM_SB_F1R5_EDH_OFF 0x20
++#define TG3_EEPROM_SB_F1R6_EDH_OFF 0x4c
+ #define TG3_EEPROM_SB_EDH_MAJ_MASK 0x00000700
+ #define TG3_EEPROM_SB_EDH_MAJ_SHFT 8
+ #define TG3_EEPROM_SB_EDH_MIN_MASK 0x000000ff
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0174-tg3-Disable-unused-transmit-rings.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0174-tg3-Disable-unused-transmit-rings.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,34 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Thu, 14 Oct 2010 10:37:39 +0000
+Subject: [PATCH 174/207] tg3: Disable unused transmit rings
+
+commit 3d37728bc55994fdf2888f6c872bdeea03a84cc2 upstream.
+
+This patch allows the driver to disable the additional transmit rings
+available on the 5717 and 5719 devices. This is not strictly necessary,
+but is done anyways for correctness.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 3 +++
+ 1 files changed, 3 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 2b4e678..12f5dcd 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -7536,6 +7536,9 @@ static void tg3_rings_reset(struct tg3 *tp)
+ /* Disable all transmit rings but the first. */
+ if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS))
+ limit = NIC_SRAM_SEND_RCB + TG3_BDINFO_SIZE * 16;
++ else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719)
++ limit = NIC_SRAM_SEND_RCB + TG3_BDINFO_SIZE * 4;
+ else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
+ limit = NIC_SRAM_SEND_RCB + TG3_BDINFO_SIZE * 2;
+ else
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0175-tg3-Add-clause-45-register-accessor-methods.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0175-tg3-Add-clause-45-register-accessor-methods.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,92 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Thu, 14 Oct 2010 10:37:40 +0000
+Subject: [PATCH 175/207] tg3: Add clause 45 register accessor methods
+
+commit ddfc87bfd16f370904c6ff7d23738335dd68d0ce upstream.
+
+This patch adds clause 45 register access methods. They will be used in
+the following patch.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
+ drivers/net/tg3.h | 4 ++++
+ 2 files changed, 50 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 12f5dcd..f21f5e9 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -1162,6 +1162,52 @@ static void tg3_mdio_fini(struct tg3 *tp)
+ }
+ }
+
++static int tg3_phy_cl45_write(struct tg3 *tp, u32 devad, u32 addr, u32 val)
++{
++ int err;
++
++ err = tg3_writephy(tp, MII_TG3_MMD_CTRL, devad);
++ if (err)
++ goto done;
++
++ err = tg3_writephy(tp, MII_TG3_MMD_ADDRESS, addr);
++ if (err)
++ goto done;
++
++ err = tg3_writephy(tp, MII_TG3_MMD_CTRL,
++ MII_TG3_MMD_CTRL_DATA_NOINC | devad);
++ if (err)
++ goto done;
++
++ err = tg3_writephy(tp, MII_TG3_MMD_ADDRESS, val);
++
++done:
++ return err;
++}
++
++static int tg3_phy_cl45_read(struct tg3 *tp, u32 devad, u32 addr, u32 *val)
++{
++ int err;
++
++ err = tg3_writephy(tp, MII_TG3_MMD_CTRL, devad);
++ if (err)
++ goto done;
++
++ err = tg3_writephy(tp, MII_TG3_MMD_ADDRESS, addr);
++ if (err)
++ goto done;
++
++ err = tg3_writephy(tp, MII_TG3_MMD_CTRL,
++ MII_TG3_MMD_CTRL_DATA_NOINC | devad);
++ if (err)
++ goto done;
++
++ err = tg3_readphy(tp, MII_TG3_MMD_ADDRESS, val);
++
++done:
++ return err;
++}
++
+ /* tp->lock is held. */
+ static inline void tg3_generate_fw_event(struct tg3 *tp)
+ {
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index c26b32d..6dea2c0 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -2061,6 +2061,10 @@
+ #define MII_TG3_CTRL_AS_MASTER 0x0800
+ #define MII_TG3_CTRL_ENABLE_AS_MASTER 0x1000
+
++#define MII_TG3_MMD_CTRL 0x0d /* MMD Access Control register */
++#define MII_TG3_MMD_CTRL_DATA_NOINC 0x4000
++#define MII_TG3_MMD_ADDRESS 0x0e /* MMD Address Data register */
++
+ #define MII_TG3_EXT_CTRL 0x10 /* Extended control register */
+ #define MII_TG3_EXT_CTRL_FIFO_ELASTIC 0x0001
+ #define MII_TG3_EXT_CTRL_LNK3_LED_MODE 0x0002
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0176-tg3-Add-EEE-support.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0176-tg3-Add-EEE-support.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,255 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Thu, 14 Oct 2010 10:37:41 +0000
+Subject: [PATCH 176/207] tg3: Add EEE support
+
+commit 52b02d04c801fff51ca49ad033210846d1713253 upstream.
+
+This patch adds Energy Efficient Ethernet (EEE) support for the 5718
+device ID and the 57765 B0 asic revision.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 114 +++++++++++++++++++++++++++++++++++++++++++++++++++++
+ drivers/net/tg3.h | 33 +++++++++++++++-
+ 2 files changed, 146 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index f21f5e9..03602f7 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -1584,6 +1584,17 @@ static void tg3_phy_fini(struct tg3 *tp)
+ }
+ }
+
++static int tg3_phydsp_read(struct tg3 *tp, u32 reg, u32 *val)
++{
++ int err;
++
++ err = tg3_writephy(tp, MII_TG3_DSP_ADDRESS, reg);
++ if (!err)
++ err = tg3_readphy(tp, MII_TG3_DSP_RW_PORT, val);
++
++ return err;
++}
++
+ static int tg3_phydsp_write(struct tg3 *tp, u32 reg, u32 val)
+ {
+ int err;
+@@ -1747,6 +1758,42 @@ static void tg3_phy_apply_otp(struct tg3 *tp)
+ tg3_writephy(tp, MII_TG3_AUX_CTRL, phy);
+ }
+
++static void tg3_phy_eee_adjust(struct tg3 *tp, u32 current_link_up)
++{
++ u32 val;
++
++ if (!(tp->phy_flags & TG3_PHYFLG_EEE_CAP))
++ return;
++
++ tp->setlpicnt = 0;
++
++ if (tp->link_config.autoneg == AUTONEG_ENABLE &&
++ current_link_up == 1 &&
++ (tp->link_config.active_speed == SPEED_1000 ||
++ (tp->link_config.active_speed == SPEED_100 &&
++ tp->link_config.active_duplex == DUPLEX_FULL))) {
++ u32 eeectl;
++
++ if (tp->link_config.active_speed == SPEED_1000)
++ eeectl = TG3_CPMU_EEE_CTRL_EXIT_16_5_US;
++ else
++ eeectl = TG3_CPMU_EEE_CTRL_EXIT_36_US;
++
++ tw32(TG3_CPMU_EEE_CTRL, eeectl);
++
++ tg3_phy_cl45_read(tp, 0x7, TG3_CL45_D7_EEERES_STAT, &val);
++
++ if (val == TG3_CL45_D7_EEERES_STAT_LP_1000T ||
++ val == TG3_CL45_D7_EEERES_STAT_LP_100TX)
++ tp->setlpicnt = 2;
++ }
++
++ if (!tp->setlpicnt) {
++ val = tr32(TG3_CPMU_EEE_MODE);
++ tw32(TG3_CPMU_EEE_MODE, val & ~TG3_CPMU_EEEMD_LPI_ENABLE);
++ }
++}
++
+ static int tg3_wait_macro_done(struct tg3 *tp)
+ {
+ int limit = 100;
+@@ -2921,6 +2968,44 @@ static void tg3_phy_copper_begin(struct tg3 *tp)
+ tg3_writephy(tp, MII_TG3_CTRL, new_adv);
+ }
+
++ if (tp->phy_flags & TG3_PHYFLG_EEE_CAP) {
++ u32 val = 0;
++
++ tw32(TG3_CPMU_EEE_MODE,
++ tr32(TG3_CPMU_EEE_MODE) & ~TG3_CPMU_EEEMD_LPI_ENABLE);
++
++ /* Enable SM_DSP clock and tx 6dB coding. */
++ val = MII_TG3_AUXCTL_SHDWSEL_AUXCTL |
++ MII_TG3_AUXCTL_ACTL_SMDSP_ENA |
++ MII_TG3_AUXCTL_ACTL_TX_6DB;
++ tg3_writephy(tp, MII_TG3_AUX_CTRL, val);
++
++ if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) &&
++ !tg3_phydsp_read(tp, MII_TG3_DSP_CH34TP2, &val))
++ tg3_phydsp_write(tp, MII_TG3_DSP_CH34TP2,
++ val | MII_TG3_DSP_CH34TP2_HIBW01);
++
++ if (tp->link_config.autoneg == AUTONEG_ENABLE) {
++ /* Advertise 100-BaseTX EEE ability */
++ if (tp->link_config.advertising &
++ (ADVERTISED_100baseT_Half |
++ ADVERTISED_100baseT_Full))
++ val |= TG3_CL45_D7_EEEADV_CAP_100TX;
++ /* Advertise 1000-BaseT EEE ability */
++ if (tp->link_config.advertising &
++ (ADVERTISED_1000baseT_Half |
++ ADVERTISED_1000baseT_Full))
++ val |= TG3_CL45_D7_EEEADV_CAP_1000T;
++ }
++ tg3_phy_cl45_write(tp, 0x7, TG3_CL45_D7_EEEADV_CAP, val);
++
++ /* Turn off SM_DSP clock. */
++ val = MII_TG3_AUXCTL_SHDWSEL_AUXCTL |
++ MII_TG3_AUXCTL_ACTL_TX_6DB;
++ tg3_writephy(tp, MII_TG3_AUX_CTRL, val);
++ }
++
+ if (tp->link_config.autoneg == AUTONEG_DISABLE &&
+ tp->link_config.speed != SPEED_INVALID) {
+ u32 bmcr, orig_bmcr;
+@@ -3282,6 +3367,8 @@ relink:
+ tw32_f(MAC_MODE, tp->mac_mode);
+ udelay(40);
+
++ tg3_phy_eee_adjust(tp, current_link_up);
++
+ if (tp->tg3_flags & TG3_FLAG_USE_LINKCHG_REG) {
+ /* Polled via timer. */
+ tw32_f(MAC_EVENT, 0);
+@@ -7790,6 +7877,22 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ tw32(TG3_CPMU_LSPD_10MB_CLK, val);
+ }
+
++ /* Enable MAC control of LPI */
++ if (tp->phy_flags & TG3_PHYFLG_EEE_CAP) {
++ tw32_f(TG3_CPMU_EEE_LNKIDL_CTRL,
++ TG3_CPMU_EEE_LNKIDL_PCIE_NL0 |
++ TG3_CPMU_EEE_LNKIDL_UART_IDL);
++
++ tw32_f(TG3_CPMU_EEE_CTRL,
++ TG3_CPMU_EEE_CTRL_EXIT_20_1_US);
++
++ tw32_f(TG3_CPMU_EEE_MODE,
++ TG3_CPMU_EEEMD_ERLY_L1_XIT_DET |
++ TG3_CPMU_EEEMD_LPI_IN_TX |
++ TG3_CPMU_EEEMD_LPI_IN_RX |
++ TG3_CPMU_EEEMD_EEE_ENABLE);
++ }
++
+ /* This works around an issue with Athlon chipsets on
+ * B3 tigon3 silicon. This bit has no effect on any
+ * other revision. But do not set this on PCI Express
+@@ -8598,6 +8701,12 @@ static void tg3_timer(unsigned long __opaque)
+ if (tp->tg3_flags2 & TG3_FLG2_5705_PLUS)
+ tg3_periodic_fetch_stats(tp);
+
++ if (tp->setlpicnt && !--tp->setlpicnt) {
++ u32 val = tr32(TG3_CPMU_EEE_MODE);
++ tw32(TG3_CPMU_EEE_MODE,
++ val | TG3_CPMU_EEEMD_LPI_ENABLE);
++ }
++
+ if (tp->tg3_flags & TG3_FLAG_USE_LINKCHG_REG) {
+ u32 mac_stat;
+ int phy_event;
+@@ -12437,6 +12546,11 @@ static int __devinit tg3_phy_probe(struct tg3 *tp)
+ }
+ }
+
++ if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_5718 ||
++ (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765 &&
++ tp->pci_chip_rev_id != CHIPREV_ID_57765_A0))
++ tp->phy_flags |= TG3_PHYFLG_EEE_CAP;
++
+ if (!(tp->phy_flags & TG3_PHYFLG_ANY_SERDES) &&
+ !(tp->tg3_flags3 & TG3_FLG3_ENABLE_APE) &&
+ !(tp->tg3_flags & TG3_FLAG_ENABLE_ASF)) {
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 6dea2c0..0d50349 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -1091,7 +1091,26 @@
+ #define CPMU_MUTEX_GNT_DRIVER 0x00001000
+ #define TG3_CPMU_PHY_STRAP 0x00003664
+ #define TG3_CPMU_PHY_STRAP_IS_SERDES 0x00000020
+-/* 0x3664 --> 0x3800 unused */
++/* 0x3664 --> 0x36b0 unused */
++
++#define TG3_CPMU_EEE_MODE 0x000036b0
++#define TG3_CPMU_EEEMD_ERLY_L1_XIT_DET 0x00000008
++#define TG3_CPMU_EEEMD_LPI_ENABLE 0x00000080
++#define TG3_CPMU_EEEMD_LPI_IN_TX 0x00000100
++#define TG3_CPMU_EEEMD_LPI_IN_RX 0x00000200
++#define TG3_CPMU_EEEMD_EEE_ENABLE 0x00100000
++/* 0x36b4 --> 0x36b8 unused */
++
++#define TG3_CPMU_EEE_LNKIDL_CTRL 0x000036bc
++#define TG3_CPMU_EEE_LNKIDL_PCIE_NL0 0x01000000
++#define TG3_CPMU_EEE_LNKIDL_UART_IDL 0x00000004
++/* 0x36c0 --> 0x36d0 unused */
++
++#define TG3_CPMU_EEE_CTRL 0x000036d0
++#define TG3_CPMU_EEE_CTRL_EXIT_16_5_US 0x0000019d
++#define TG3_CPMU_EEE_CTRL_EXIT_36_US 0x00000384
++#define TG3_CPMU_EEE_CTRL_EXIT_20_1_US 0x000001f8
++/* 0x36d4 --> 0x3800 unused */
+
+ /* Mbuf cluster free registers */
+ #define MBFREE_MODE 0x00003800
+@@ -2082,6 +2101,8 @@
+ #define MII_TG3_DSP_TAP1 0x0001
+ #define MII_TG3_DSP_TAP1_AGCTGT_DFLT 0x0007
+ #define MII_TG3_DSP_AADJ1CH0 0x001f
++#define MII_TG3_DSP_CH34TP2 0x4022
++#define MII_TG3_DSP_CH34TP2_HIBW01 0x0010
+ #define MII_TG3_DSP_AADJ1CH3 0x601f
+ #define MII_TG3_DSP_AADJ1CH3_ADCCKADJ 0x0002
+ #define MII_TG3_DSP_EXP1_INT_STAT 0x0f01
+@@ -2148,6 +2169,14 @@
+ #define MII_TG3_TEST1_TRIM_EN 0x0010
+ #define MII_TG3_TEST1_CRC_EN 0x8000
+
++/* Clause 45 expansion registers */
++#define TG3_CL45_D7_EEEADV_CAP 0x003c
++#define TG3_CL45_D7_EEEADV_CAP_100TX 0x0002
++#define TG3_CL45_D7_EEEADV_CAP_1000T 0x0004
++#define TG3_CL45_D7_EEERES_STAT 0x803e
++#define TG3_CL45_D7_EEERES_STAT_LP_100TX 0x0002
++#define TG3_CL45_D7_EEERES_STAT_LP_1000T 0x0004
++
+
+ /* Fast Ethernet Tranceiver definitions */
+ #define MII_TG3_FET_PTEST 0x17
+@@ -2992,9 +3021,11 @@ struct tg3 {
+ #define TG3_PHYFLG_BER_BUG 0x00008000
+ #define TG3_PHYFLG_SERDES_PREEMPHASIS 0x00010000
+ #define TG3_PHYFLG_PARALLEL_DETECT 0x00020000
++#define TG3_PHYFLG_EEE_CAP 0x00040000
+
+ u32 led_ctrl;
+ u32 phy_otp;
++ u32 setlpicnt;
+
+ #define TG3_BPN_SIZE 24
+ char board_part_number[TG3_BPN_SIZE];
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0177-tg3-Cleanup-tg3_alloc_rx_skb.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0177-tg3-Cleanup-tg3_alloc_rx_skb.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,36 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Thu, 14 Oct 2010 10:37:42 +0000
+Subject: [PATCH 177/207] tg3: Cleanup tg3_alloc_rx_skb()
+
+commit f94e290eba2f98e8f759d273d9d04e8487fb4b6b upstream.
+
+src_map is no longer used in tg3_alloc_rx_skb(). Remove it.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 3 +--
+ 1 files changed, 1 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 03602f7..ee309d31 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -4573,12 +4573,11 @@ static int tg3_alloc_rx_skb(struct tg3 *tp, struct tg3_rx_prodring_set *tpr,
+ u32 opaque_key, u32 dest_idx_unmasked)
+ {
+ struct tg3_rx_buffer_desc *desc;
+- struct ring_info *map, *src_map;
++ struct ring_info *map;
+ struct sk_buff *skb;
+ dma_addr_t mapping;
+ int skb_size, dest_idx;
+
+- src_map = NULL;
+ switch (opaque_key) {
+ case RXD_OPAQUE_RING_STD:
+ dest_idx = dest_idx_unmasked & tp->rx_std_ring_mask;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0178-tg3-Don-t-allocate-jumbo-ring-for-5780-class-devs.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0178-tg3-Don-t-allocate-jumbo-ring-for-5780-class-devs.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,63 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Thu, 14 Oct 2010 10:37:43 +0000
+Subject: [PATCH 178/207] tg3: Don't allocate jumbo ring for 5780 class devs
+
+commit 4803572815feea2dca9485a343a8556c9037e36e upstream.
+
+The 5714, 5715, and 5780 devices do not have a separate rx jumbo
+producer ring. This patch changes the code so that resources are not
+allocated for it.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 11 +++++++----
+ 1 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index ee309d31..6787efe 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -6219,7 +6219,8 @@ static void tg3_rx_prodring_free(struct tg3 *tp,
+ tg3_rx_skb_free(tp, &tpr->rx_std_buffers[i],
+ tp->rx_pkt_map_sz);
+
+- if (tp->tg3_flags & TG3_FLAG_JUMBO_CAPABLE) {
++ if ((tp->tg3_flags & TG3_FLAG_JUMBO_CAPABLE) &&
++ !(tp->tg3_flags2 & TG3_FLG2_5780_CLASS)) {
+ for (i = 0; i <= tp->rx_jmb_ring_mask; i++)
+ tg3_rx_skb_free(tp, &tpr->rx_jmb_buffers[i],
+ TG3_RX_JMB_MAP_SZ);
+@@ -6246,7 +6247,7 @@ static int tg3_rx_prodring_alloc(struct tg3 *tp,
+ if (tpr != &tp->napi[0].prodring) {
+ memset(&tpr->rx_std_buffers[0], 0,
+ TG3_RX_STD_BUFF_RING_SIZE(tp));
+- if (tp->tg3_flags & TG3_FLAG_JUMBO_CAPABLE)
++ if (tpr->rx_jmb_buffers)
+ memset(&tpr->rx_jmb_buffers[0], 0,
+ TG3_RX_JMB_BUFF_RING_SIZE(tp));
+ goto done;
+@@ -6289,7 +6290,8 @@ static int tg3_rx_prodring_alloc(struct tg3 *tp,
+ }
+ }
+
+- if (!(tp->tg3_flags & TG3_FLAG_JUMBO_CAPABLE))
++ if (!(tp->tg3_flags & TG3_FLAG_JUMBO_CAPABLE) ||
++ (tp->tg3_flags2 & TG3_FLG2_5780_CLASS))
+ goto done;
+
+ memset(tpr->rx_jmb, 0, TG3_RX_JMB_RING_BYTES(tp));
+@@ -6361,7 +6363,8 @@ static int tg3_rx_prodring_init(struct tg3 *tp,
+ if (!tpr->rx_std)
+ goto err_out;
+
+- if (tp->tg3_flags & TG3_FLAG_JUMBO_CAPABLE) {
++ if ((tp->tg3_flags & TG3_FLAG_JUMBO_CAPABLE) &&
++ !(tp->tg3_flags2 & TG3_FLG2_5780_CLASS)) {
+ tpr->rx_jmb_buffers = kzalloc(TG3_RX_JMB_BUFF_RING_SIZE(tp),
+ GFP_KERNEL);
+ if (!tpr->rx_jmb_buffers)
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0179-tg3-Report-invalid-link-from-tg3_get_settings.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0179-tg3-Report-invalid-link-from-tg3_get_settings.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,38 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Thu, 14 Oct 2010 10:37:44 +0000
+Subject: [PATCH 179/207] tg3: Report invalid link from tg3_get_settings()
+
+commit 64c2218266996b562a8e940a95a887fc432daced upstream.
+
+Currently the tg3 driver leaves the speed and duplex fields
+uninitialized in tg3_get_settings() if the device is not up. This can
+lead to some strange deductions in certain versions of ethtool. When
+the device is up and the link is down, the driver reports SPEED_INVALID
+and DUPLEX_INVALID for these fields. This patch makes the presentation
+consistent by returning SPEED_INVALID and DUPLEX_INVALID when the device
+has not been brought up as well.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 3 +++
+ 1 files changed, 3 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 6787efe..d63ae95 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -9812,6 +9812,9 @@ static int tg3_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
+ if (netif_running(dev)) {
+ cmd->speed = tp->link_config.active_speed;
+ cmd->duplex = tp->link_config.active_duplex;
++ } else {
++ cmd->speed = SPEED_INVALID;
++ cmd->duplex = DUPLEX_INVALID;
+ }
+ cmd->phy_address = tp->phy_addr;
+ cmd->transceiver = XCVR_INTERNAL;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0180-tg3-Update-version-to-3.115.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0180-tg3-Update-version-to-3.115.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,35 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Thu, 14 Oct 2010 10:37:45 +0000
+Subject: [PATCH 180/207] tg3: Update version to 3.115
+
+commit 7c1a96a9966efc2eb33d1021569c5ef6ae6f5ecb upstream.
+
+This patch updates the tg3 version to 3.115.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index d63ae95..bc9ee85 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -69,10 +69,10 @@
+
+ #define DRV_MODULE_NAME "tg3"
+ #define TG3_MAJ_NUM 3
+-#define TG3_MIN_NUM 114
++#define TG3_MIN_NUM 115
+ #define DRV_MODULE_VERSION \
+ __stringify(TG3_MAJ_NUM) "." __stringify(TG3_MIN_NUM)
+-#define DRV_MODULE_RELDATE "September 30, 2010"
++#define DRV_MODULE_RELDATE "October 14, 2010"
+
+ #define TG3_DEF_MAC_MODE 0
+ #define TG3_DEF_RX_MODE 0
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0181-tg3-Do-not-call-device_set_wakeup_enable-under-spin_.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0181-tg3-Do-not-call-device_set_wakeup_enable-under-spin_.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,49 @@
+From: "Rafael J. Wysocki" <rjw at sisk.pl>
+Date: Mon, 25 Oct 2010 13:01:55 +0000
+Subject: [PATCH 181/207] tg3: Do not call device_set_wakeup_enable() under
+ spin_lock_bh
+
+commit f2dc0d1809ab7e0147c7e4ac837be1682f706538 upstream.
+
+The tg3 driver calls device_set_wakeup_enable() under spin_lock_bh,
+which causes a problem to happen after the recent core power
+management changes, because this function can sleep now. Fix this
+by moving the device_set_wakeup_enable() call out of the
+spin_lock_bh-protected area.
+
+Reported-by: Maxim Levitsky <maximlevitsky at gmail.com>
+Signed-off-by: Rafael J. Wysocki <rjw at sisk.pl>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 10 +++++-----
+ 1 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index bc9ee85..dee4415 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -9951,16 +9951,16 @@ static int tg3_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
+ !((tp->tg3_flags & TG3_FLAG_WOL_CAP) && device_can_wakeup(dp)))
+ return -EINVAL;
+
++ device_set_wakeup_enable(dp, wol->wolopts & WAKE_MAGIC);
++
+ spin_lock_bh(&tp->lock);
+- if (wol->wolopts & WAKE_MAGIC) {
++ if (device_may_wakeup(dp))
+ tp->tg3_flags |= TG3_FLAG_WOL_ENABLE;
+- device_set_wakeup_enable(dp, true);
+- } else {
++ else
+ tp->tg3_flags &= ~TG3_FLAG_WOL_ENABLE;
+- device_set_wakeup_enable(dp, false);
+- }
+ spin_unlock_bh(&tp->lock);
+
++
+ return 0;
+ }
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0182-tg3-Apply-10Mbps-fix-to-all-57765-revisions.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0182-tg3-Apply-10Mbps-fix-to-all-57765-revisions.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,55 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Wed, 24 Nov 2010 08:31:45 +0000
+Subject: [PATCH 182/207] tg3: Apply 10Mbps fix to all 57765 revisions
+
+commit 5093eedc8bdfd7d906836a44a248f66a99e27d22 upstream.
+
+Commit a977dbe8445b8a81d6127c4aa9112a2c29a1a008, entitled
+"tg3: Reduce 57765 core clock when link at 10Mbps" needs to be applied
+to all revisions of the 57765 asic rev, not just the A0 revision.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 21 ++++++++++++---------
+ 1 files changed, 12 insertions(+), 9 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index dee4415..e79d396 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -7860,18 +7860,21 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ tw32(GRC_MODE, grc_mode);
+ }
+
+- if (tp->pci_chip_rev_id == CHIPREV_ID_57765_A0) {
+- u32 grc_mode = tr32(GRC_MODE);
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) {
++ if (tp->pci_chip_rev_id == CHIPREV_ID_57765_A0) {
++ u32 grc_mode = tr32(GRC_MODE);
+
+- /* Access the lower 1K of PL PCIE block registers. */
+- val = grc_mode & ~GRC_MODE_PCIE_PORT_MASK;
+- tw32(GRC_MODE, val | GRC_MODE_PCIE_PL_SEL);
++ /* Access the lower 1K of PL PCIE block registers. */
++ val = grc_mode & ~GRC_MODE_PCIE_PORT_MASK;
++ tw32(GRC_MODE, val | GRC_MODE_PCIE_PL_SEL);
+
+- val = tr32(TG3_PCIE_TLDLPL_PORT + TG3_PCIE_PL_LO_PHYCTL5);
+- tw32(TG3_PCIE_TLDLPL_PORT + TG3_PCIE_PL_LO_PHYCTL5,
+- val | TG3_PCIE_PL_LO_PHYCTL5_DIS_L2CLKREQ);
++ val = tr32(TG3_PCIE_TLDLPL_PORT +
++ TG3_PCIE_PL_LO_PHYCTL5);
++ tw32(TG3_PCIE_TLDLPL_PORT + TG3_PCIE_PL_LO_PHYCTL5,
++ val | TG3_PCIE_PL_LO_PHYCTL5_DIS_L2CLKREQ);
+
+- tw32(GRC_MODE, grc_mode);
++ tw32(GRC_MODE, grc_mode);
++ }
+
+ val = tr32(TG3_CPMU_LSPD_10MB_CLK);
+ val &= ~CPMU_LSPD_10MB_MACCLK_MASK;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0183-tg3-Assign-correct-tx-margin-for-5719.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0183-tg3-Assign-correct-tx-margin-for-5719.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,50 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Wed, 24 Nov 2010 08:31:46 +0000
+Subject: [PATCH 183/207] tg3: Assign correct tx margin for 5719
+
+commit b75cc0e4c1caac63941d96a73b2214e8007b934b upstream.
+
+Commit d309a46e42542223946d3a9e4e239fdc945cb53e, entitled
+"tg3: 5719: Prevent tx data corruption", was supposed to contain the tx
+margin adjustment but it looks like it somehow was omitted. This patch
+fixes the problem.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 4 ++++
+ drivers/net/tg3.h | 2 ++
+ 2 files changed, 6 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index e79d396..cceeb05 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -8206,6 +8206,10 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 ||
+ (tp->tg3_flags3 & TG3_FLG3_5717_PLUS)) {
+ val = tr32(TG3_RDMA_RSRVCTRL_REG);
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719) {
++ val &= ~TG3_RDMA_RSRVCTRL_TXMRGN_MASK;
++ val |= TG3_RDMA_RSRVCTRL_TXMRGN_320B;
++ }
+ tw32(TG3_RDMA_RSRVCTRL_REG,
+ val | TG3_RDMA_RSRVCTRL_FIFO_OFLW_FIX);
+ }
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 0d50349..fe8acde 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -1327,6 +1327,8 @@
+
+ #define TG3_RDMA_RSRVCTRL_REG 0x00004900
+ #define TG3_RDMA_RSRVCTRL_FIFO_OFLW_FIX 0x00000004
++#define TG3_RDMA_RSRVCTRL_TXMRGN_320B 0x28000000
++#define TG3_RDMA_RSRVCTRL_TXMRGN_MASK 0xffe00000
+ /* 0x4904 --> 0x4910 unused */
+
+ #define TG3_LSO_RD_DMA_CRPTEN_CTRL 0x00004910
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0184-tg3-Always-turn-on-APE-features-in-mac_mode-reg.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0184-tg3-Always-turn-on-APE-features-in-mac_mode-reg.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,92 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Wed, 24 Nov 2010 08:31:47 +0000
+Subject: [PATCH 184/207] tg3: Always turn on APE features in mac_mode reg
+
+commit d2394e6bb1aa636f3bd142cb6f7845a4332514b5 upstream.
+
+The APE needs certain bits in the mac_mode register to be enabled for
+traffic to flow correctly. This patch changes the code to always enable
+these bits in the presence of the APE.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 37 ++++++++++++++++++-------------------
+ 1 files changed, 18 insertions(+), 19 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index cceeb05..1cc35cb 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -2728,12 +2728,10 @@ static int tg3_set_power_state(struct tg3 *tp, pci_power_t state)
+ (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE)))
+ mac_mode |= MAC_MODE_KEEP_FRAME_IN_WOL;
+
+- if (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE) {
+- mac_mode |= tp->mac_mode &
+- (MAC_MODE_APE_TX_EN | MAC_MODE_APE_RX_EN);
+- if (mac_mode & MAC_MODE_APE_TX_EN)
+- mac_mode |= MAC_MODE_TDE_ENABLE;
+- }
++ if (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE)
++ mac_mode |= MAC_MODE_APE_TX_EN |
++ MAC_MODE_APE_RX_EN |
++ MAC_MODE_TDE_ENABLE;
+
+ tw32_f(MAC_MODE, mac_mode);
+ udelay(100);
+@@ -7222,19 +7220,21 @@ static int tg3_chip_reset(struct tg3 *tp)
+ tw32(TG3PCI_CLOCK_CTRL, tp->pci_clock_ctrl);
+ }
+
++ if (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE)
++ tp->mac_mode = MAC_MODE_APE_TX_EN |
++ MAC_MODE_APE_RX_EN |
++ MAC_MODE_TDE_ENABLE;
++
+ if (tp->phy_flags & TG3_PHYFLG_PHY_SERDES) {
+- tp->mac_mode = MAC_MODE_PORT_MODE_TBI;
+- tw32_f(MAC_MODE, tp->mac_mode);
++ tp->mac_mode |= MAC_MODE_PORT_MODE_TBI;
++ val = tp->mac_mode;
+ } else if (tp->phy_flags & TG3_PHYFLG_MII_SERDES) {
+- tp->mac_mode = MAC_MODE_PORT_MODE_GMII;
+- tw32_f(MAC_MODE, tp->mac_mode);
+- } else if (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE) {
+- tp->mac_mode &= (MAC_MODE_APE_TX_EN | MAC_MODE_APE_RX_EN);
+- if (tp->mac_mode & MAC_MODE_APE_TX_EN)
+- tp->mac_mode |= MAC_MODE_TDE_ENABLE;
+- tw32_f(MAC_MODE, tp->mac_mode);
++ tp->mac_mode |= MAC_MODE_PORT_MODE_GMII;
++ val = tp->mac_mode;
+ } else
+- tw32_f(MAC_MODE, 0);
++ val = 0;
++
++ tw32_f(MAC_MODE, val);
+ udelay(40);
+
+ tg3_ape_unlock(tp, TG3_APE_LOCK_GRC);
+@@ -8287,7 +8287,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ }
+
+ if (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE)
+- tp->mac_mode &= MAC_MODE_APE_TX_EN | MAC_MODE_APE_RX_EN;
++ tp->mac_mode = MAC_MODE_APE_TX_EN | MAC_MODE_APE_RX_EN;
+ else
+ tp->mac_mode = 0;
+ tp->mac_mode |= MAC_MODE_TXSTAT_ENABLE | MAC_MODE_RXSTAT_ENABLE |
+@@ -13732,8 +13732,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+
+ /* Preserve the APE MAC_MODE bits */
+ if (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE)
+- tp->mac_mode = tr32(MAC_MODE) |
+- MAC_MODE_APE_TX_EN | MAC_MODE_APE_RX_EN;
++ tp->mac_mode = MAC_MODE_APE_TX_EN | MAC_MODE_APE_RX_EN;
+ else
+ tp->mac_mode = TG3_DEF_MAC_MODE;
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0185-tg3-Fix-5719-internal-FIFO-overflow-problem.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0185-tg3-Fix-5719-internal-FIFO-overflow-problem.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,102 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Wed, 24 Nov 2010 08:31:48 +0000
+Subject: [PATCH 185/207] tg3: Fix 5719 internal FIFO overflow problem
+
+commit cf79003d598b1f82a4caa0564107283b4f560e14 upstream.
+
+Under load, there an internal FIFO can overflow on the 5719. The fix is
+to scale back the PCIe maximum read request size based on the current
+link speed and width.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 44 +++++++++++++++++++++++++++++++++++++++++---
+ drivers/net/tg3.h | 1 +
+ 2 files changed, 42 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 1cc35cb..bf63883 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -6985,7 +6985,7 @@ static void tg3_restore_pci_state(struct tg3 *tp)
+
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5785) {
+ if (tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS)
+- pcie_set_readrq(tp->pdev, 4096);
++ pcie_set_readrq(tp->pdev, tp->pcie_readrq);
+ else {
+ pci_write_config_byte(tp->pdev, PCI_CACHE_LINE_SIZE,
+ tp->pci_cacheline_sz);
+@@ -7179,7 +7179,7 @@ static int tg3_chip_reset(struct tg3 *tp)
+ tp->pcie_cap + PCI_EXP_DEVCTL,
+ val16);
+
+- pcie_set_readrq(tp->pdev, 4096);
++ pcie_set_readrq(tp->pdev, tp->pcie_readrq);
+
+ /* Clear error status */
+ pci_write_config_word(tp->pdev,
+@@ -13369,7 +13369,45 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+
+ tp->tg3_flags2 |= TG3_FLG2_PCI_EXPRESS;
+
+- pcie_set_readrq(tp->pdev, 4096);
++ tp->pcie_readrq = 4096;
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719) {
++ u16 word;
++
++ pci_read_config_word(tp->pdev,
++ tp->pcie_cap + PCI_EXP_LNKSTA,
++ &word);
++ switch (word & PCI_EXP_LNKSTA_CLS) {
++ case PCI_EXP_LNKSTA_CLS_2_5GB:
++ word &= PCI_EXP_LNKSTA_NLW;
++ word >>= PCI_EXP_LNKSTA_NLW_SHIFT;
++ switch (word) {
++ case 2:
++ tp->pcie_readrq = 2048;
++ break;
++ case 4:
++ tp->pcie_readrq = 1024;
++ break;
++ }
++ break;
++
++ case PCI_EXP_LNKSTA_CLS_5_0GB:
++ word &= PCI_EXP_LNKSTA_NLW;
++ word >>= PCI_EXP_LNKSTA_NLW_SHIFT;
++ switch (word) {
++ case 1:
++ tp->pcie_readrq = 2048;
++ break;
++ case 2:
++ tp->pcie_readrq = 1024;
++ break;
++ case 4:
++ tp->pcie_readrq = 512;
++ break;
++ }
++ }
++ }
++
++ pcie_set_readrq(tp->pdev, tp->pcie_readrq);
+
+ pci_read_config_word(tp->pdev,
+ tp->pcie_cap + PCI_EXP_LNKCTL,
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index fe8acde..acb5630 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -2948,6 +2948,7 @@ struct tg3 {
+ int pcix_cap;
+ int pcie_cap;
+ };
++ int pcie_readrq;
+
+ struct mii_bus *mdio_bus;
+ int mdio_irq[PHY_MAX_ADDR];
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0186-tg3-Reorg-tg3_napi-members.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0186-tg3-Reorg-tg3_napi-members.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,47 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Wed, 24 Nov 2010 08:31:49 +0000
+Subject: [PATCH 186/207] tg3: Reorg tg3_napi members
+
+commit 07ae8fc00bcc97d2f896b257da225a0789b0aa5d upstream.
+
+This patch reorders and realigns the tg3_napi members for a ~3-4%
+performance improvement on small packet performance tests.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.h | 12 ++++++------
+ 1 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index acb5630..8ceb77b 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -2715,17 +2715,17 @@ struct tg3_napi {
+ u32 last_irq_tag;
+ u32 int_mbox;
+ u32 coal_now;
+- u32 tx_prod;
+- u32 tx_cons;
+- u32 tx_pending;
+- u32 prodmbox;
+
+- u32 consmbox;
++ u32 consmbox ____cacheline_aligned;
+ u32 rx_rcb_ptr;
+ u16 *rx_rcb_prod_idx;
+ struct tg3_rx_prodring_set prodring;
+-
+ struct tg3_rx_buffer_desc *rx_rcb;
++
++ u32 tx_prod ____cacheline_aligned;
++ u32 tx_cons;
++ u32 tx_pending;
++ u32 prodmbox;
+ struct tg3_tx_buffer_desc *tx_ring;
+ struct ring_info *tx_buffers;
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0187-tg3-Enable-mult-rd-DMA-engine-on-5719.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0187-tg3-Enable-mult-rd-DMA-engine-on-5719.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,33 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Wed, 24 Nov 2010 08:31:50 +0000
+Subject: [PATCH 187/207] tg3: Enable mult rd DMA engine on 5719
+
+commit deabaac8beeccdfee5358c0cd4c63258f28f3a74 upstream.
+
+The multiple DMA read engine bugs have been fixed on the 5719. This
+patch reenables support for this feature.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 3 +--
+ 1 files changed, 1 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index bf63883..9574fc5 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -8165,8 +8165,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ RDMAC_MODE_FIFOURUN_ENAB | RDMAC_MODE_FIFOOREAD_ENAB |
+ RDMAC_MODE_LNGREAD_ENAB);
+
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719)
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717)
+ rdmac_mode |= RDMAC_MODE_MULT_DMA_RD_DIS;
+
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 ||
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0188-tg3-Reenable-TSS-for-5719.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0188-tg3-Reenable-TSS-for-5719.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,38 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Wed, 24 Nov 2010 08:31:51 +0000
+Subject: [PATCH 188/207] tg3: Reenable TSS for 5719
+
+commit b92b9040f6e4997b895b7b9c655a158354d28964 upstream.
+
+All TSS bugs have been fixed in the 5719. This patch reenables the
+feature.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 7 ++++++-
+ 1 files changed, 6 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 9574fc5..2d9f30c 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -9032,8 +9032,13 @@ static bool tg3_enable_msix(struct tg3 *tp)
+ tp->napi[i].irq_vec = msix_ent[i].vector;
+
+ tp->dev->real_num_tx_queues = 1;
+- if (tp->irq_cnt > 1)
++
++ if (tp->irq_cnt > 1) {
+ tp->tg3_flags3 |= TG3_FLG3_ENABLE_RSS;
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719) {
++ tp->tg3_flags3 |= TG3_FLG3_ENABLE_TSS;
++ }
++ }
+
+ return true;
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0189-tg3-use-dma_alloc_coherent-instead-of-pci_alloc_cons.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0189-tg3-use-dma_alloc_coherent-instead-of-pci_alloc_cons.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,191 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Wed, 24 Nov 2010 08:31:52 +0000
+Subject: [PATCH 189/207] tg3: use dma_alloc_coherent() instead of
+ pci_alloc_consistent()
+
+commit 4bae65c892b4ff9a2797cbfa8526a5f9aaf1b2ed upstream.
+
+Using dma_alloc_coherent() permits to use GFP_KERNEL allocations instead
+of GFP_ATOMIC ones. Its better when a machine is out of memory, because
+this allows driver to sleep to get its memory and succeed its init,
+especially when allocating high order pages.
+
+Signed-off-by: Eric Dumazet <eric.dumazet at gmail.com>
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 73 +++++++++++++++++++++++++++++-----------------------
+ 1 files changed, 41 insertions(+), 32 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 2d9f30c..b4ed622 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -6337,13 +6337,13 @@ static void tg3_rx_prodring_fini(struct tg3 *tp,
+ kfree(tpr->rx_jmb_buffers);
+ tpr->rx_jmb_buffers = NULL;
+ if (tpr->rx_std) {
+- pci_free_consistent(tp->pdev, TG3_RX_STD_RING_BYTES(tp),
+- tpr->rx_std, tpr->rx_std_mapping);
++ dma_free_coherent(&tp->pdev->dev, TG3_RX_STD_RING_BYTES(tp),
++ tpr->rx_std, tpr->rx_std_mapping);
+ tpr->rx_std = NULL;
+ }
+ if (tpr->rx_jmb) {
+- pci_free_consistent(tp->pdev, TG3_RX_JMB_RING_BYTES(tp),
+- tpr->rx_jmb, tpr->rx_jmb_mapping);
++ dma_free_coherent(&tp->pdev->dev, TG3_RX_JMB_RING_BYTES(tp),
++ tpr->rx_jmb, tpr->rx_jmb_mapping);
+ tpr->rx_jmb = NULL;
+ }
+ }
+@@ -6356,8 +6356,10 @@ static int tg3_rx_prodring_init(struct tg3 *tp,
+ if (!tpr->rx_std_buffers)
+ return -ENOMEM;
+
+- tpr->rx_std = pci_alloc_consistent(tp->pdev, TG3_RX_STD_RING_BYTES(tp),
+- &tpr->rx_std_mapping);
++ tpr->rx_std = dma_alloc_coherent(&tp->pdev->dev,
++ TG3_RX_STD_RING_BYTES(tp),
++ &tpr->rx_std_mapping,
++ GFP_KERNEL);
+ if (!tpr->rx_std)
+ goto err_out;
+
+@@ -6368,9 +6370,10 @@ static int tg3_rx_prodring_init(struct tg3 *tp,
+ if (!tpr->rx_jmb_buffers)
+ goto err_out;
+
+- tpr->rx_jmb = pci_alloc_consistent(tp->pdev,
+- TG3_RX_JMB_RING_BYTES(tp),
+- &tpr->rx_jmb_mapping);
++ tpr->rx_jmb = dma_alloc_coherent(&tp->pdev->dev,
++ TG3_RX_JMB_RING_BYTES(tp),
++ &tpr->rx_jmb_mapping,
++ GFP_KERNEL);
+ if (!tpr->rx_jmb)
+ goto err_out;
+ }
+@@ -6489,7 +6492,7 @@ static void tg3_free_consistent(struct tg3 *tp)
+ struct tg3_napi *tnapi = &tp->napi[i];
+
+ if (tnapi->tx_ring) {
+- pci_free_consistent(tp->pdev, TG3_TX_RING_BYTES,
++ dma_free_coherent(&tp->pdev->dev, TG3_TX_RING_BYTES,
+ tnapi->tx_ring, tnapi->tx_desc_mapping);
+ tnapi->tx_ring = NULL;
+ }
+@@ -6498,25 +6501,26 @@ static void tg3_free_consistent(struct tg3 *tp)
+ tnapi->tx_buffers = NULL;
+
+ if (tnapi->rx_rcb) {
+- pci_free_consistent(tp->pdev, TG3_RX_RCB_RING_BYTES(tp),
+- tnapi->rx_rcb,
+- tnapi->rx_rcb_mapping);
++ dma_free_coherent(&tp->pdev->dev,
++ TG3_RX_RCB_RING_BYTES(tp),
++ tnapi->rx_rcb,
++ tnapi->rx_rcb_mapping);
+ tnapi->rx_rcb = NULL;
+ }
+
+ tg3_rx_prodring_fini(tp, &tnapi->prodring);
+
+ if (tnapi->hw_status) {
+- pci_free_consistent(tp->pdev, TG3_HW_STATUS_SIZE,
+- tnapi->hw_status,
+- tnapi->status_mapping);
++ dma_free_coherent(&tp->pdev->dev, TG3_HW_STATUS_SIZE,
++ tnapi->hw_status,
++ tnapi->status_mapping);
+ tnapi->hw_status = NULL;
+ }
+ }
+
+ if (tp->hw_stats) {
+- pci_free_consistent(tp->pdev, sizeof(struct tg3_hw_stats),
+- tp->hw_stats, tp->stats_mapping);
++ dma_free_coherent(&tp->pdev->dev, sizeof(struct tg3_hw_stats),
++ tp->hw_stats, tp->stats_mapping);
+ tp->hw_stats = NULL;
+ }
+ }
+@@ -6529,9 +6533,10 @@ static int tg3_alloc_consistent(struct tg3 *tp)
+ {
+ int i;
+
+- tp->hw_stats = pci_alloc_consistent(tp->pdev,
+- sizeof(struct tg3_hw_stats),
+- &tp->stats_mapping);
++ tp->hw_stats = dma_alloc_coherent(&tp->pdev->dev,
++ sizeof(struct tg3_hw_stats),
++ &tp->stats_mapping,
++ GFP_KERNEL);
+ if (!tp->hw_stats)
+ goto err_out;
+
+@@ -6541,9 +6546,10 @@ static int tg3_alloc_consistent(struct tg3 *tp)
+ struct tg3_napi *tnapi = &tp->napi[i];
+ struct tg3_hw_status *sblk;
+
+- tnapi->hw_status = pci_alloc_consistent(tp->pdev,
+- TG3_HW_STATUS_SIZE,
+- &tnapi->status_mapping);
++ tnapi->hw_status = dma_alloc_coherent(&tp->pdev->dev,
++ TG3_HW_STATUS_SIZE,
++ &tnapi->status_mapping,
++ GFP_KERNEL);
+ if (!tnapi->hw_status)
+ goto err_out;
+
+@@ -6564,9 +6570,10 @@ static int tg3_alloc_consistent(struct tg3 *tp)
+ if (!tnapi->tx_buffers)
+ goto err_out;
+
+- tnapi->tx_ring = pci_alloc_consistent(tp->pdev,
+- TG3_TX_RING_BYTES,
+- &tnapi->tx_desc_mapping);
++ tnapi->tx_ring = dma_alloc_coherent(&tp->pdev->dev,
++ TG3_TX_RING_BYTES,
++ &tnapi->tx_desc_mapping,
++ GFP_KERNEL);
+ if (!tnapi->tx_ring)
+ goto err_out;
+ }
+@@ -6599,9 +6606,10 @@ static int tg3_alloc_consistent(struct tg3 *tp)
+ if (!i && (tp->tg3_flags3 & TG3_FLG3_ENABLE_RSS))
+ continue;
+
+- tnapi->rx_rcb = pci_alloc_consistent(tp->pdev,
+- TG3_RX_RCB_RING_BYTES(tp),
+- &tnapi->rx_rcb_mapping);
++ tnapi->rx_rcb = dma_alloc_coherent(&tp->pdev->dev,
++ TG3_RX_RCB_RING_BYTES(tp),
++ &tnapi->rx_rcb_mapping,
++ GFP_KERNEL);
+ if (!tnapi->rx_rcb)
+ goto err_out;
+
+@@ -14210,7 +14218,8 @@ static int __devinit tg3_test_dma(struct tg3 *tp)
+ u32 *buf, saved_dma_rwctrl;
+ int ret = 0;
+
+- buf = pci_alloc_consistent(tp->pdev, TEST_BUFFER_SIZE, &buf_dma);
++ buf = dma_alloc_coherent(&tp->pdev->dev, TEST_BUFFER_SIZE,
++ &buf_dma, GFP_KERNEL);
+ if (!buf) {
+ ret = -ENOMEM;
+ goto out_nofree;
+@@ -14394,7 +14403,7 @@ static int __devinit tg3_test_dma(struct tg3 *tp)
+ }
+
+ out:
+- pci_free_consistent(tp->pdev, TEST_BUFFER_SIZE, buf, buf_dma);
++ dma_free_coherent(&tp->pdev->dev, TEST_BUFFER_SIZE, buf, buf_dma);
+ out_nofree:
+ return ret;
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0190-tg3-Enable-phy-APD-for-5717-and-later-asic-revs.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0190-tg3-Enable-phy-APD-for-5717-and-later-asic-revs.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,35 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Wed, 24 Nov 2010 08:31:53 +0000
+Subject: [PATCH 190/207] tg3: Enable phy APD for 5717 and later asic revs
+
+commit 2e1e3291d4727e14c8f0f48df561afb1a5c26ffe upstream.
+
+This patch enables the gphy autopowerdown feature in the phy for all
+new devices that support it.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 5 +++--
+ 1 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index b4ed622..148b5c7 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -12433,8 +12433,9 @@ static void __devinit tg3_get_eeprom_hw_cfg(struct tg3 *tp)
+ if (cfg2 & (1 << 18))
+ tp->phy_flags |= TG3_PHYFLG_SERDES_PREEMPHASIS;
+
+- if (((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 &&
+- GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5784_AX)) &&
++ if (((tp->tg3_flags3 & TG3_FLG3_5717_PLUS) ||
++ ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 &&
++ GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5784_AX))) &&
+ (cfg2 & NIC_SRAM_DATA_CFG_2_APD_EN))
+ tp->phy_flags |= TG3_PHYFLG_ENABLE_APD;
+
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0191-tg3-Remove-tg3_config_info-definition.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0191-tg3-Remove-tg3_config_info-definition.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,33 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Wed, 24 Nov 2010 08:31:54 +0000
+Subject: [PATCH 191/207] tg3: Remove tg3_config_info definition
+
+commit 37a118452cbc9c0cf0d23bfd16d3ca56058be754 upstream.
+
+This structure isn't used anywhere in the driver.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.h | 4 ----
+ 1 files changed, 0 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 8ceb77b..9ccd38b 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -2564,10 +2564,6 @@ struct ring_info {
+ DEFINE_DMA_UNMAP_ADDR(mapping);
+ };
+
+-struct tg3_config_info {
+- u32 flags;
+-};
+-
+ struct tg3_link_config {
+ /* Describes what we're trying to get. */
+ u32 advertising;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0192-tg3-Raise-the-jumbo-frame-BD-flag-threshold.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0192-tg3-Raise-the-jumbo-frame-BD-flag-threshold.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,42 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 6 Dec 2010 08:28:49 +0000
+Subject: [PATCH 192/207] tg3: Raise the jumbo frame BD flag threshold
+
+commit 8fc2f9956127d2b85280c07e69aeb08b9bd85150 upstream.
+
+The current transmit routines set the jumbo frame BD flag too
+aggressively. This can reduce performance for common cases. This patch
+raises the jumbo flag threshold to 1518, up from 1500.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 148b5c7..84c115d 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -5761,7 +5761,7 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb,
+ dma_unmap_addr_set(&tnapi->tx_buffers[entry], mapping, mapping);
+
+ if ((tp->tg3_flags3 & TG3_FLG3_USE_JUMBO_BDFLAG) &&
+- !mss && skb->len > ETH_DATA_LEN)
++ !mss && skb->len > VLAN_ETH_FRAME_LEN)
+ base_flags |= TXD_FLAG_JMB_PKT;
+
+ tg3_set_txd(tnapi, entry, mapping, len, base_flags,
+@@ -5995,7 +5995,7 @@ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb,
+ #endif
+
+ if ((tp->tg3_flags3 & TG3_FLG3_USE_JUMBO_BDFLAG) &&
+- !mss && skb->len > ETH_DATA_LEN)
++ !mss && skb->len > VLAN_ETH_FRAME_LEN)
+ base_flags |= TXD_FLAG_JMB_PKT;
+
+ len = skb_headlen(skb);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0193-tg3-Move-EEE-definitions-into-mdio.h.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0193-tg3-Move-EEE-definitions-into-mdio.h.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,104 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 6 Dec 2010 08:28:50 +0000
+Subject: [PATCH 193/207] tg3: Move EEE definitions into mdio.h
+
+commit 3110f5f5545a645c50ef66b1f705d08dfd1df404 upstream.
+
+In commit 52b02d04c801fff51ca49ad033210846d1713253 entitled "tg3: Add
+EEE support", Ben Hutchings had commented that the EEE advertisement
+register will be in a standard location. This patch moves that
+definition into mdio.h and changes the code to use it.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 16 ++++++++--------
+ drivers/net/tg3.h | 3 ---
+ include/linux/mdio.h | 5 +++++
+ 3 files changed, 13 insertions(+), 11 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 84c115d..88d3cc3 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -32,6 +32,7 @@
+ #include <linux/etherdevice.h>
+ #include <linux/skbuff.h>
+ #include <linux/ethtool.h>
++#include <linux/mdio.h>
+ #include <linux/mii.h>
+ #include <linux/phy.h>
+ #include <linux/brcmphy.h>
+@@ -1781,7 +1782,8 @@ static void tg3_phy_eee_adjust(struct tg3 *tp, u32 current_link_up)
+
+ tw32(TG3_CPMU_EEE_CTRL, eeectl);
+
+- tg3_phy_cl45_read(tp, 0x7, TG3_CL45_D7_EEERES_STAT, &val);
++ tg3_phy_cl45_read(tp, MDIO_MMD_AN,
++ TG3_CL45_D7_EEERES_STAT, &val);
+
+ if (val == TG3_CL45_D7_EEERES_STAT_LP_1000T ||
+ val == TG3_CL45_D7_EEERES_STAT_LP_100TX)
+@@ -2987,16 +2989,14 @@ static void tg3_phy_copper_begin(struct tg3 *tp)
+ if (tp->link_config.autoneg == AUTONEG_ENABLE) {
+ /* Advertise 100-BaseTX EEE ability */
+ if (tp->link_config.advertising &
+- (ADVERTISED_100baseT_Half |
+- ADVERTISED_100baseT_Full))
+- val |= TG3_CL45_D7_EEEADV_CAP_100TX;
++ ADVERTISED_100baseT_Full)
++ val |= MDIO_AN_EEE_ADV_100TX;
+ /* Advertise 1000-BaseT EEE ability */
+ if (tp->link_config.advertising &
+- (ADVERTISED_1000baseT_Half |
+- ADVERTISED_1000baseT_Full))
+- val |= TG3_CL45_D7_EEEADV_CAP_1000T;
++ ADVERTISED_1000baseT_Full)
++ val |= MDIO_AN_EEE_ADV_1000T;
+ }
+- tg3_phy_cl45_write(tp, 0x7, TG3_CL45_D7_EEEADV_CAP, val);
++ tg3_phy_cl45_write(tp, MDIO_MMD_AN, MDIO_AN_EEE_ADV, val);
+
+ /* Turn off SM_DSP clock. */
+ val = MII_TG3_AUXCTL_SHDWSEL_AUXCTL |
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 9ccd38b..38508ce 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -2172,9 +2172,6 @@
+ #define MII_TG3_TEST1_CRC_EN 0x8000
+
+ /* Clause 45 expansion registers */
+-#define TG3_CL45_D7_EEEADV_CAP 0x003c
+-#define TG3_CL45_D7_EEEADV_CAP_100TX 0x0002
+-#define TG3_CL45_D7_EEEADV_CAP_1000T 0x0004
+ #define TG3_CL45_D7_EEERES_STAT 0x803e
+ #define TG3_CL45_D7_EEERES_STAT_LP_100TX 0x0002
+ #define TG3_CL45_D7_EEERES_STAT_LP_1000T 0x0004
+diff --git a/include/linux/mdio.h b/include/linux/mdio.h
+index c779b49..b1494ac 100644
+--- a/include/linux/mdio.h
++++ b/include/linux/mdio.h
+@@ -55,6 +55,7 @@
+ #define MDIO_PCS_10GBRT_STAT2 33 /* 10GBASE-R/-T PCS status 2 */
+ #define MDIO_AN_10GBT_CTRL 32 /* 10GBASE-T auto-negotiation control */
+ #define MDIO_AN_10GBT_STAT 33 /* 10GBASE-T auto-negotiation status */
++#define MDIO_AN_EEE_ADV 60 /* EEE advertisement */
+
+ /* LASI (Link Alarm Status Interrupt) registers, defined by XENPAK MSA. */
+ #define MDIO_PMA_LASI_RXCTRL 0x9000 /* RX_ALARM control */
+@@ -235,6 +236,10 @@
+ #define MDIO_AN_10GBT_STAT_MS 0x4000 /* Master/slave config */
+ #define MDIO_AN_10GBT_STAT_MSFLT 0x8000 /* Master/slave config fault */
+
++/* AN EEE Advertisement register. */
++#define MDIO_AN_EEE_ADV_100TX 0x0002 /* Advertise 100TX EEE cap */
++#define MDIO_AN_EEE_ADV_1000T 0x0004 /* Advertise 1000T EEE cap */
++
+ /* LASI RX_ALARM control/status registers. */
+ #define MDIO_PMA_LASI_RX_PHYXSLFLT 0x0001 /* PHY XS RX local fault */
+ #define MDIO_PMA_LASI_RX_PCSLFLT 0x0008 /* PCS RX local fault */
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0194-tg3-Fix-57765-EEE-support.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0194-tg3-Fix-57765-EEE-support.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,71 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 6 Dec 2010 08:28:51 +0000
+Subject: [PATCH 194/207] tg3: Fix 57765 EEE support
+
+commit 699c019385fcb13498a5a3a8bd368f04f1d4a223 upstream.
+
+EEE support in the 57765 internal phy will not enable after a phy reset
+unless it sees that EEE is supported in the MAC. This patch moves the
+code that programs the CPMU EEE registers to a place before the phy
+reset.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 32 ++++++++++++++++----------------
+ 1 files changed, 16 insertions(+), 16 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 88d3cc3..cfe2c36 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -7809,6 +7809,22 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ if (tp->tg3_flags & TG3_FLAG_INIT_COMPLETE)
+ tg3_abort_hw(tp, 1);
+
++ /* Enable MAC control of LPI */
++ if (tp->phy_flags & TG3_PHYFLG_EEE_CAP) {
++ tw32_f(TG3_CPMU_EEE_LNKIDL_CTRL,
++ TG3_CPMU_EEE_LNKIDL_PCIE_NL0 |
++ TG3_CPMU_EEE_LNKIDL_UART_IDL);
++
++ tw32_f(TG3_CPMU_EEE_CTRL,
++ TG3_CPMU_EEE_CTRL_EXIT_20_1_US);
++
++ tw32_f(TG3_CPMU_EEE_MODE,
++ TG3_CPMU_EEEMD_ERLY_L1_XIT_DET |
++ TG3_CPMU_EEEMD_LPI_IN_TX |
++ TG3_CPMU_EEEMD_LPI_IN_RX |
++ TG3_CPMU_EEEMD_EEE_ENABLE);
++ }
++
+ if (reset_phy)
+ tg3_phy_reset(tp);
+
+@@ -7890,22 +7906,6 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ tw32(TG3_CPMU_LSPD_10MB_CLK, val);
+ }
+
+- /* Enable MAC control of LPI */
+- if (tp->phy_flags & TG3_PHYFLG_EEE_CAP) {
+- tw32_f(TG3_CPMU_EEE_LNKIDL_CTRL,
+- TG3_CPMU_EEE_LNKIDL_PCIE_NL0 |
+- TG3_CPMU_EEE_LNKIDL_UART_IDL);
+-
+- tw32_f(TG3_CPMU_EEE_CTRL,
+- TG3_CPMU_EEE_CTRL_EXIT_20_1_US);
+-
+- tw32_f(TG3_CPMU_EEE_MODE,
+- TG3_CPMU_EEEMD_ERLY_L1_XIT_DET |
+- TG3_CPMU_EEEMD_LPI_IN_TX |
+- TG3_CPMU_EEEMD_LPI_IN_RX |
+- TG3_CPMU_EEEMD_EEE_ENABLE);
+- }
+-
+ /* This works around an issue with Athlon chipsets on
+ * B3 tigon3 silicon. This bit has no effect on any
+ * other revision. But do not set this on PCI Express
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0195-tg3-Minor-EEE-code-tweaks.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0195-tg3-Minor-EEE-code-tweaks.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,80 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 6 Dec 2010 08:28:52 +0000
+Subject: [PATCH 195/207] tg3: Minor EEE code tweaks
+
+commit a6b68dab169e2a51e59f43504f1279cbc2afcde8 upstream.
+
+The first hunk of this patch makes sure that the driver checks for the
+appropriate preconditions before checking if EEE negotiation succeeded.
+More specifically the link needs to be full duplex for EEE to be
+enabled.
+
+The second and third hunks of this patch fix a bug where the eee
+advertisement register would be programmed with extra bits set.
+
+The fourth hunk of this patch makes sure the EEE capability flag is not
+set for 5718 A0 devices and that the device is not a serdes device.
+
+None of these modifications are strictly necessary. The driver /
+hardware still does the right thing. They are submitted primarily for
+correctness.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 17 ++++++++++-------
+ 1 files changed, 10 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index cfe2c36..be04919 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -1770,9 +1770,9 @@ static void tg3_phy_eee_adjust(struct tg3 *tp, u32 current_link_up)
+
+ if (tp->link_config.autoneg == AUTONEG_ENABLE &&
+ current_link_up == 1 &&
+- (tp->link_config.active_speed == SPEED_1000 ||
+- (tp->link_config.active_speed == SPEED_100 &&
+- tp->link_config.active_duplex == DUPLEX_FULL))) {
++ tp->link_config.active_duplex == DUPLEX_FULL &&
++ (tp->link_config.active_speed == SPEED_100 ||
++ tp->link_config.active_speed == SPEED_1000)) {
+ u32 eeectl;
+
+ if (tp->link_config.active_speed == SPEED_1000)
+@@ -2969,7 +2969,7 @@ static void tg3_phy_copper_begin(struct tg3 *tp)
+ }
+
+ if (tp->phy_flags & TG3_PHYFLG_EEE_CAP) {
+- u32 val = 0;
++ u32 val;
+
+ tw32(TG3_CPMU_EEE_MODE,
+ tr32(TG3_CPMU_EEE_MODE) & ~TG3_CPMU_EEEMD_LPI_ENABLE);
+@@ -2986,6 +2986,7 @@ static void tg3_phy_copper_begin(struct tg3 *tp)
+ tg3_phydsp_write(tp, MII_TG3_DSP_CH34TP2,
+ val | MII_TG3_DSP_CH34TP2_HIBW01);
+
++ val = 0;
+ if (tp->link_config.autoneg == AUTONEG_ENABLE) {
+ /* Advertise 100-BaseTX EEE ability */
+ if (tp->link_config.advertising &
+@@ -12571,9 +12572,11 @@ static int __devinit tg3_phy_probe(struct tg3 *tp)
+ }
+ }
+
+- if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_5718 ||
+- (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765 &&
+- tp->pci_chip_rev_id != CHIPREV_ID_57765_A0))
++ if (!(tp->phy_flags & TG3_PHYFLG_ANY_SERDES) &&
++ ((tp->pdev->device == TG3PCI_DEVICE_TIGON3_5718 &&
++ tp->pci_chip_rev_id != CHIPREV_ID_5717_A0) ||
++ (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765 &&
++ tp->pci_chip_rev_id != CHIPREV_ID_57765_A0)))
+ tp->phy_flags |= TG3_PHYFLG_EEE_CAP;
+
+ if (!(tp->phy_flags & TG3_PHYFLG_ANY_SERDES) &&
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0196-tg3-Relax-EEE-thresholds.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0196-tg3-Relax-EEE-thresholds.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,88 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 6 Dec 2010 08:28:53 +0000
+Subject: [PATCH 196/207] tg3: Relax EEE thresholds
+
+commit a386b9011a4687470e6168e2f2a08c468f25f72f upstream.
+
+The hardware defaults to fairly aggressive EEE thresholds. While there
+appear to be no ill effects, this patch relaxes them, just as a
+precaution.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 25 ++++++++++++++++++++-----
+ drivers/net/tg3.h | 20 +++++++++++++-------
+ 2 files changed, 33 insertions(+), 12 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index be04919..7c99d45 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -7819,11 +7819,26 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
+ tw32_f(TG3_CPMU_EEE_CTRL,
+ TG3_CPMU_EEE_CTRL_EXIT_20_1_US);
+
+- tw32_f(TG3_CPMU_EEE_MODE,
+- TG3_CPMU_EEEMD_ERLY_L1_XIT_DET |
+- TG3_CPMU_EEEMD_LPI_IN_TX |
+- TG3_CPMU_EEEMD_LPI_IN_RX |
+- TG3_CPMU_EEEMD_EEE_ENABLE);
++ val = TG3_CPMU_EEEMD_ERLY_L1_XIT_DET |
++ TG3_CPMU_EEEMD_LPI_IN_TX |
++ TG3_CPMU_EEEMD_LPI_IN_RX |
++ TG3_CPMU_EEEMD_EEE_ENABLE;
++
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717)
++ val |= TG3_CPMU_EEEMD_SND_IDX_DET_EN;
++
++ if (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE)
++ val |= TG3_CPMU_EEEMD_APE_TX_DET_EN;
++
++ tw32_f(TG3_CPMU_EEE_MODE, val);
++
++ tw32_f(TG3_CPMU_EEE_DBTMR1,
++ TG3_CPMU_DBTMR1_PCIEXIT_2047US |
++ TG3_CPMU_DBTMR1_LNKIDLE_2047US);
++
++ tw32_f(TG3_CPMU_EEE_DBTMR2,
++ TG3_CPMU_DBTMR1_APE_TX_2047US |
++ TG3_CPMU_DBTMR2_TXIDXEQ_2047US);
+ }
+
+ if (reset_phy)
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
+index 38508ce..fc5ad85 100644
+--- a/drivers/net/tg3.h
++++ b/drivers/net/tg3.h
+@@ -1094,13 +1094,19 @@
+ /* 0x3664 --> 0x36b0 unused */
+
+ #define TG3_CPMU_EEE_MODE 0x000036b0
+-#define TG3_CPMU_EEEMD_ERLY_L1_XIT_DET 0x00000008
+-#define TG3_CPMU_EEEMD_LPI_ENABLE 0x00000080
+-#define TG3_CPMU_EEEMD_LPI_IN_TX 0x00000100
+-#define TG3_CPMU_EEEMD_LPI_IN_RX 0x00000200
+-#define TG3_CPMU_EEEMD_EEE_ENABLE 0x00100000
+-/* 0x36b4 --> 0x36b8 unused */
+-
++#define TG3_CPMU_EEEMD_APE_TX_DET_EN 0x00000004
++#define TG3_CPMU_EEEMD_ERLY_L1_XIT_DET 0x00000008
++#define TG3_CPMU_EEEMD_SND_IDX_DET_EN 0x00000040
++#define TG3_CPMU_EEEMD_LPI_ENABLE 0x00000080
++#define TG3_CPMU_EEEMD_LPI_IN_TX 0x00000100
++#define TG3_CPMU_EEEMD_LPI_IN_RX 0x00000200
++#define TG3_CPMU_EEEMD_EEE_ENABLE 0x00100000
++#define TG3_CPMU_EEE_DBTMR1 0x000036b4
++#define TG3_CPMU_DBTMR1_PCIEXIT_2047US 0x07ff0000
++#define TG3_CPMU_DBTMR1_LNKIDLE_2047US 0x000070ff
++#define TG3_CPMU_EEE_DBTMR2 0x000036b8
++#define TG3_CPMU_DBTMR1_APE_TX_2047US 0x07ff0000
++#define TG3_CPMU_DBTMR2_TXIDXEQ_2047US 0x000070ff
+ #define TG3_CPMU_EEE_LNKIDL_CTRL 0x000036bc
+ #define TG3_CPMU_EEE_LNKIDL_PCIE_NL0 0x01000000
+ #define TG3_CPMU_EEE_LNKIDL_UART_IDL 0x00000004
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0197-tg3-Update-version-to-3.116.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0197-tg3-Update-version-to-3.116.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,35 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Mon, 6 Dec 2010 08:28:54 +0000
+Subject: [PATCH 197/207] tg3: Update version to 3.116
+
+commit 5ee493767352314893520ac40aec5bb07d0147e0 upstream.
+
+This patch updates the tg3 version to 3.116.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Benjamin Li <benli at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 7c99d45..5384649 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -70,10 +70,10 @@
+
+ #define DRV_MODULE_NAME "tg3"
+ #define TG3_MAJ_NUM 3
+-#define TG3_MIN_NUM 115
++#define TG3_MIN_NUM 116
+ #define DRV_MODULE_VERSION \
+ __stringify(TG3_MAJ_NUM) "." __stringify(TG3_MIN_NUM)
+-#define DRV_MODULE_RELDATE "October 14, 2010"
++#define DRV_MODULE_RELDATE "December 3, 2010"
+
+ #define TG3_DEF_MAC_MODE 0
+ #define TG3_DEF_RX_MODE 0
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0198-tg3-Use-DEFINE_PCI_DEVICE_TABLE.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0198-tg3-Use-DEFINE_PCI_DEVICE_TABLE.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,69 @@
+From: Joe Perches <joe at perches.com>
+Date: Tue, 21 Dec 2010 02:16:08 -0800
+Subject: [PATCH 198/207] tg3: Use DEFINE_PCI_DEVICE_TABLE
+
+commit 895950c2a6565d9eefda4a38b00fa28537e39fcb upstream.
+
+Moves the PCI tables to the right read-only section.
+
+Signed-off-by: Joe Perches <joe at perches.com>
+---
+ drivers/net/tg3.c | 26 ++++++++++++--------------
+ 1 files changed, 12 insertions(+), 14 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 5384649..16b2a51 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -13088,17 +13088,15 @@ static inline u32 tg3_rx_ret_ring_size(struct tg3 *tp)
+ return 512;
+ }
+
++DEFINE_PCI_DEVICE_TABLE(write_reorder_chipsets) = {
++ { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_FE_GATE_700C) },
++ { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8131_BRIDGE) },
++ { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8385_0) },
++ { },
++};
++
+ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ {
+- static struct pci_device_id write_reorder_chipsets[] = {
+- { PCI_DEVICE(PCI_VENDOR_ID_AMD,
+- PCI_DEVICE_ID_AMD_FE_GATE_700C) },
+- { PCI_DEVICE(PCI_VENDOR_ID_AMD,
+- PCI_DEVICE_ID_AMD_8131_BRIDGE) },
+- { PCI_DEVICE(PCI_VENDOR_ID_VIA,
+- PCI_DEVICE_ID_VIA_8385_0) },
+- { },
+- };
+ u32 misc_ctrl_reg;
+ u32 pci_state_reg, grc_misc_cfg;
+ u32 val;
+@@ -14231,6 +14229,11 @@ static int __devinit tg3_do_test_dma(struct tg3 *tp, u32 *buf, dma_addr_t buf_dm
+
+ #define TEST_BUFFER_SIZE 0x2000
+
++DEFINE_PCI_DEVICE_TABLE(dma_wait_state_chipsets) = {
++ { PCI_DEVICE(PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_UNI_N_PCI15) },
++ { },
++};
++
+ static int __devinit tg3_test_dma(struct tg3 *tp)
+ {
+ dma_addr_t buf_dma;
+@@ -14400,11 +14403,6 @@ static int __devinit tg3_test_dma(struct tg3 *tp)
+ }
+ if ((tp->dma_rwctrl & DMA_RWCTRL_WRITE_BNDRY_MASK) !=
+ DMA_RWCTRL_WRITE_BNDRY_16) {
+- static struct pci_device_id dma_wait_state_chipsets[] = {
+- { PCI_DEVICE(PCI_VENDOR_ID_APPLE,
+- PCI_DEVICE_ID_APPLE_UNI_N_PCI15) },
+- { },
+- };
+
+ /* DMA test passed without adjusting DMA boundary,
+ * now look for chipsets that are known to expose the
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0199-tg3-Do-not-use-legacy-PCI-power-management.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0199-tg3-Do-not-use-legacy-PCI-power-management.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,250 @@
+From: "Rafael J. Wysocki" <rjw at sisk.pl>
+Date: Sat, 25 Dec 2010 12:56:23 +0000
+Subject: [PATCH 199/207] tg3: Do not use legacy PCI power management
+
+commit c866b7eac073198cef03ea6bac2dc978635a9f5c upstream.
+
+The tg3 driver uses the legacy PCI power management, so it has to do
+some PCI-specific things in its ->suspend() and ->resume() callbacks,
+which isn't necessary and should better be done by the PCI
+sybsystem-level power management code.
+
+Convert tg3 to the new PCI power management framework and make it
+let the PCI subsystem take care of all the PCI-specific aspects of
+device handling during system power transitions.
+
+Tested on HP nx6325 with a NetXtreme BCM5788 adapter.
+
+Signed-off-by: Rafael J. Wysocki <rjw at sisk.pl>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 101 ++++++++++++++++++++++------------------------------
+ 1 files changed, 43 insertions(+), 58 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 16b2a51..9dedee1 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -2551,39 +2551,35 @@ static void __tg3_set_mac_addr(struct tg3 *tp, int skip_mac_1)
+ tw32(MAC_TX_BACKOFF_SEED, addr_high);
+ }
+
+-static int tg3_set_power_state(struct tg3 *tp, pci_power_t state)
++static void tg3_enable_register_access(struct tg3 *tp)
+ {
+- u32 misc_host_ctrl;
+- bool device_should_wake, do_low_power;
+-
+- /* Make sure register accesses (indirect or otherwise)
+- * will function correctly.
++ /*
++ * Make sure register accesses (indirect or otherwise) will function
++ * correctly.
+ */
+ pci_write_config_dword(tp->pdev,
+- TG3PCI_MISC_HOST_CTRL,
+- tp->misc_host_ctrl);
++ TG3PCI_MISC_HOST_CTRL, tp->misc_host_ctrl);
++}
+
+- switch (state) {
+- case PCI_D0:
+- pci_enable_wake(tp->pdev, state, false);
+- pci_set_power_state(tp->pdev, PCI_D0);
++static int tg3_power_up(struct tg3 *tp)
++{
++ tg3_enable_register_access(tp);
+
+- /* Switch out of Vaux if it is a NIC */
+- if (tp->tg3_flags2 & TG3_FLG2_IS_NIC)
+- tw32_wait_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl, 100);
++ pci_set_power_state(tp->pdev, PCI_D0);
+
+- return 0;
++ /* Switch out of Vaux if it is a NIC */
++ if (tp->tg3_flags2 & TG3_FLG2_IS_NIC)
++ tw32_wait_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl, 100);
+
+- case PCI_D1:
+- case PCI_D2:
+- case PCI_D3hot:
+- break;
++ return 0;
++}
+
+- default:
+- netdev_err(tp->dev, "Invalid power state (D%d) requested\n",
+- state);
+- return -EINVAL;
+- }
++static int tg3_power_down_prepare(struct tg3 *tp)
++{
++ u32 misc_host_ctrl;
++ bool device_should_wake, do_low_power;
++
++ tg3_enable_register_access(tp);
+
+ /* Restore the CLKREQ setting. */
+ if (tp->tg3_flags3 & TG3_FLG3_CLKREQ_BUG) {
+@@ -2602,8 +2598,7 @@ static int tg3_set_power_state(struct tg3 *tp, pci_power_t state)
+ tw32(TG3PCI_MISC_HOST_CTRL,
+ misc_host_ctrl | MISC_HOST_CTRL_MASK_PCI_INT);
+
+- device_should_wake = pci_pme_capable(tp->pdev, state) &&
+- device_may_wakeup(&tp->pdev->dev) &&
++ device_should_wake = device_may_wakeup(&tp->pdev->dev) &&
+ (tp->tg3_flags & TG3_FLAG_WOL_ENABLE);
+
+ if (tp->tg3_flags3 & TG3_FLG3_USE_PHYLIB) {
+@@ -2823,13 +2818,15 @@ static int tg3_set_power_state(struct tg3 *tp, pci_power_t state)
+
+ tg3_write_sig_post_reset(tp, RESET_KIND_SHUTDOWN);
+
+- if (device_should_wake)
+- pci_enable_wake(tp->pdev, state, true);
++ return 0;
++}
+
+- /* Finally, set the new power state. */
+- pci_set_power_state(tp->pdev, state);
++static void tg3_power_down(struct tg3 *tp)
++{
++ tg3_power_down_prepare(tp);
+
+- return 0;
++ pci_wake_from_d3(tp->pdev, tp->tg3_flags & TG3_FLAG_WOL_ENABLE);
++ pci_set_power_state(tp->pdev, PCI_D3hot);
+ }
+
+ static void tg3_aux_stat_to_speed_duplex(struct tg3 *tp, u32 val, u16 *speed, u8 *duplex)
+@@ -9130,7 +9127,7 @@ static int tg3_open(struct net_device *dev)
+
+ netif_carrier_off(tp->dev);
+
+- err = tg3_set_power_state(tp, PCI_D0);
++ err = tg3_power_up(tp);
+ if (err)
+ return err;
+
+@@ -9294,7 +9291,7 @@ static int tg3_close(struct net_device *dev)
+
+ tg3_free_consistent(tp);
+
+- tg3_set_power_state(tp, PCI_D3hot);
++ tg3_power_down(tp);
+
+ netif_carrier_off(tp->dev);
+
+@@ -11106,7 +11103,7 @@ static void tg3_self_test(struct net_device *dev, struct ethtool_test *etest,
+ struct tg3 *tp = netdev_priv(dev);
+
+ if (tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER)
+- tg3_set_power_state(tp, PCI_D0);
++ tg3_power_up(tp);
+
+ memset(data, 0, sizeof(u64) * TG3_NUM_TEST);
+
+@@ -11174,7 +11171,7 @@ static void tg3_self_test(struct net_device *dev, struct ethtool_test *etest,
+ tg3_phy_start(tp);
+ }
+ if (tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER)
+- tg3_set_power_state(tp, PCI_D3hot);
++ tg3_power_down(tp);
+
+ }
+
+@@ -13623,7 +13620,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ (tp->tg3_flags3 & TG3_FLG3_5717_PLUS))
+ tp->tg3_flags |= TG3_FLAG_CPMU_PRESENT;
+
+- /* Set up tp->grc_local_ctrl before calling tg3_set_power_state().
++ /* Set up tp->grc_local_ctrl before calling tg_power_up().
+ * GPIO1 driven high will bring 5700's external PHY out of reset.
+ * It is also used as eeprom write protect on LOMs.
+ */
+@@ -13654,7 +13651,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ }
+
+ /* Force the chip into D0. */
+- err = tg3_set_power_state(tp, PCI_D0);
++ err = tg3_power_up(tp);
+ if (err) {
+ dev_err(&tp->pdev->dev, "Transition to D0 failed\n");
+ return err;
+@@ -15057,19 +15054,13 @@ static void __devexit tg3_remove_one(struct pci_dev *pdev)
+ }
+ }
+
+-static int tg3_suspend(struct pci_dev *pdev, pm_message_t state)
++static int tg3_suspend(struct device *device)
+ {
++ struct pci_dev *pdev = to_pci_dev(device);
+ struct net_device *dev = pci_get_drvdata(pdev);
+ struct tg3 *tp = netdev_priv(dev);
+- pci_power_t target_state;
+ int err;
+
+- /* PCI register 4 needs to be saved whether netif_running() or not.
+- * MSI address and data need to be saved if using MSI and
+- * netif_running().
+- */
+- pci_save_state(pdev);
+-
+ if (!netif_running(dev))
+ return 0;
+
+@@ -15090,9 +15081,7 @@ static int tg3_suspend(struct pci_dev *pdev, pm_message_t state)
+ tp->tg3_flags &= ~TG3_FLAG_INIT_COMPLETE;
+ tg3_full_unlock(tp);
+
+- target_state = pdev->pm_cap ? pci_target_state(pdev) : PCI_D3hot;
+-
+- err = tg3_set_power_state(tp, target_state);
++ err = tg3_power_down_prepare(tp);
+ if (err) {
+ int err2;
+
+@@ -15119,21 +15108,16 @@ out:
+ return err;
+ }
+
+-static int tg3_resume(struct pci_dev *pdev)
++static int tg3_resume(struct device *device)
+ {
++ struct pci_dev *pdev = to_pci_dev(device);
+ struct net_device *dev = pci_get_drvdata(pdev);
+ struct tg3 *tp = netdev_priv(dev);
+ int err;
+
+- pci_restore_state(tp->pdev);
+-
+ if (!netif_running(dev))
+ return 0;
+
+- err = tg3_set_power_state(tp, PCI_D0);
+- if (err)
+- return err;
+-
+ netif_device_attach(dev);
+
+ tg3_full_lock(tp, 0);
+@@ -15157,13 +15141,14 @@ out:
+ return err;
+ }
+
++static SIMPLE_DEV_PM_OPS(tg3_pm_ops, tg3_suspend, tg3_resume);
++
+ static struct pci_driver tg3_driver = {
+ .name = DRV_MODULE_NAME,
+ .id_table = tg3_pci_tbl,
+ .probe = tg3_init_one,
+ .remove = __devexit_p(tg3_remove_one),
+- .suspend = tg3_suspend,
+- .resume = tg3_resume
++ .driver.pm = &tg3_pm_ops,
+ };
+
+ static int __init tg3_init(void)
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0200-tg3-fix-return-value-check-in-tg3_read_vpd.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0200-tg3-fix-return-value-check-in-tg3_read_vpd.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,36 @@
+From: David Sterba <dsterba at suse.cz>
+Date: Wed, 29 Dec 2010 03:40:31 +0000
+Subject: [PATCH 200/207] tg3: fix return value check in tg3_read_vpd()
+
+commit 824f5f38d3005c346a043dedcfe8b048b699b81a upstream.
+
+Besides -ETIMEDOUT and -EINTR, pci_read_vpd may return other error
+values like -ENODEV or -EINVAL which are ignored due to the buggy
+check, but the data are not read from VPD anyway and this is checked
+subsequently with at most 3 needless loop iterations. This does not
+show up as a runtime bug.
+
+CC: Matt Carlson <mcarlson at broadcom.com>
+CC: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David Sterba <dsterba at suse.cz>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 9dedee1..a6132be 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -12696,7 +12696,7 @@ static void __devinit tg3_read_vpd(struct tg3 *tp)
+ cnt = pci_read_vpd(tp->pdev, pos,
+ TG3_NVM_VPD_LEN - pos,
+ &vpd_data[pos]);
+- if (cnt == -ETIMEDOUT || -EINTR)
++ if (cnt == -ETIMEDOUT || cnt == -EINTR)
+ cnt = 0;
+ else if (cnt < 0)
+ goto out_not_found;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0201-tg3-fix-warnings.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0201-tg3-fix-warnings.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,61 @@
+From: Eric Dumazet <eric.dumazet at gmail.com>
+Date: Sat, 1 Jan 2011 05:22:46 +0000
+Subject: [PATCH 201/207] tg3: fix warnings
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+commit aa6027cacdd912ce884953714fcc7392b6155bc6 upstream.
+
+In case CONFIG_PM_SLEEP is disabled, we dont need tg3_suspend() and
+tg3_resume().
+
+drivers/net/tg3.c:15056: warning: ‘tg3_suspend’ defined but not used
+drivers/net/tg3.c:15110: warning: ‘tg3_resume’ defined but not used
+
+Signed-off-by: Eric Dumazet <eric.dumazet at gmail.com>
+Cc: Rafael J. Wysocki <rjw at sisk.pl>
+Cc: Michael Chan <mchan at broadcom.com>
+Cc: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 10 +++++++++-
+ 1 files changed, 9 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index a6132be..f6b6792 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -15054,6 +15054,7 @@ static void __devexit tg3_remove_one(struct pci_dev *pdev)
+ }
+ }
+
++#ifdef CONFIG_PM_SLEEP
+ static int tg3_suspend(struct device *device)
+ {
+ struct pci_dev *pdev = to_pci_dev(device);
+@@ -15142,13 +15143,20 @@ out:
+ }
+
+ static SIMPLE_DEV_PM_OPS(tg3_pm_ops, tg3_suspend, tg3_resume);
++#define TG3_PM_OPS (&tg3_pm_ops)
++
++#else
++
++#define TG3_PM_OPS NULL
++
++#endif /* CONFIG_PM_SLEEP */
+
+ static struct pci_driver tg3_driver = {
+ .name = DRV_MODULE_NAME,
+ .id_table = tg3_pci_tbl,
+ .probe = tg3_init_one,
+ .remove = __devexit_p(tg3_remove_one),
+- .driver.pm = &tg3_pm_ops,
++ .driver.pm = TG3_PM_OPS,
+ };
+
+ static int __init tg3_init(void)
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0202-tg3-Restrict-phy-ioctl-access.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0202-tg3-Restrict-phy-ioctl-access.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,48 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Tue, 15 Feb 2011 12:51:10 +0000
+Subject: [PATCH 202/207] tg3: Restrict phy ioctl access
+
+commit ed199facd070f8e551dc16a2ae1baa01d8d28ed4 upstream.
+
+If management firmware is present and the device is down, the firmware
+will assume control of the phy. If a phy access were allowed from the
+host, it will collide with firmware phy accesses, resulting in
+unpredictable behavior. This patch fixes the problem by disallowing phy
+accesses during the problematic condition.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 8 ++++++--
+ 1 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index f6b6792..f176cce 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -11200,7 +11200,9 @@ static int tg3_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
+ if (tp->phy_flags & TG3_PHYFLG_PHY_SERDES)
+ break; /* We have no PHY */
+
+- if (tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER)
++ if ((tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER) ||
++ ((tp->tg3_flags & TG3_FLAG_ENABLE_ASF) &&
++ !netif_running(dev)))
+ return -EAGAIN;
+
+ spin_lock_bh(&tp->lock);
+@@ -11216,7 +11218,9 @@ static int tg3_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
+ if (tp->phy_flags & TG3_PHYFLG_PHY_SERDES)
+ break; /* We have no PHY */
+
+- if (tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER)
++ if ((tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER) ||
++ ((tp->tg3_flags & TG3_FLAG_ENABLE_ASF) &&
++ !netif_running(dev)))
+ return -EAGAIN;
+
+ spin_lock_bh(&tp->lock);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0203-tg3-Fix-loopback-tests.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0203-tg3-Fix-loopback-tests.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,65 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Tue, 25 Jan 2011 15:58:52 +0000
+Subject: [PATCH 203/207] tg3: Fix loopback tests
+
+commit 49692ca1e686970bac5726c3fd925427bb3ae89d upstream.
+
+The half-duplex bit in the MAC MODE register will be set during the
+loopback test if the external link is in half-duplex mode. This will
+cause the loopback test to fail on newer devices. This patch turns the
+half-duplex bit off for the test.
+
+Also, newer devices fail the internal phy loopback test because the phy
+link takes a little while to come up. This patch adds code to wait for
+the link before proceeding with the test.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 15 ++++++++++++---
+ 1 files changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index f176cce..3faff5d 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -10880,8 +10880,9 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode)
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5780)
+ return 0;
+
+- mac_mode = (tp->mac_mode & ~MAC_MODE_PORT_MODE_MASK) |
+- MAC_MODE_PORT_INT_LPBACK;
++ mac_mode = tp->mac_mode &
++ ~(MAC_MODE_PORT_MODE_MASK | MAC_MODE_HALF_DUPLEX);
++ mac_mode |= MAC_MODE_PORT_INT_LPBACK;
+ if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS))
+ mac_mode |= MAC_MODE_LINK_POLARITY;
+ if (tp->phy_flags & TG3_PHYFLG_10_100_ONLY)
+@@ -10903,7 +10904,8 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode)
+ tg3_writephy(tp, MII_BMCR, val);
+ udelay(40);
+
+- mac_mode = tp->mac_mode & ~MAC_MODE_PORT_MODE_MASK;
++ mac_mode = tp->mac_mode &
++ ~(MAC_MODE_PORT_MODE_MASK | MAC_MODE_HALF_DUPLEX);
+ if (tp->phy_flags & TG3_PHYFLG_IS_FET) {
+ tg3_writephy(tp, MII_TG3_FET_PTEST,
+ MII_TG3_FET_PTEST_FRC_TX_LINK |
+@@ -10931,6 +10933,13 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode)
+ MII_TG3_EXT_CTRL_LNK3_LED_MODE);
+ }
+ tw32(MAC_MODE, mac_mode);
++
++ /* Wait for link */
++ for (i = 0; i < 100; i++) {
++ if (tr32(MAC_TX_STATUS) & TX_STATUS_LINK_UP)
++ break;
++ mdelay(1);
++ }
+ } else {
+ return -EINVAL;
+ }
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0204-tg3-Disable-MAC-loopback-test-for-CPMU-devices.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0204-tg3-Disable-MAC-loopback-test-for-CPMU-devices.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,39 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Tue, 25 Jan 2011 15:58:53 +0000
+Subject: [PATCH 204/207] tg3: Disable MAC loopback test for CPMU devices
+
+commit aba49f2421d5287692aee961ab4ce2981fdf4939 upstream.
+
+On CPMU devices, the MAC loopback test does not test any important paths
+the phy loopback test doesn't also test. The phy loopback test is the
+more comprehensive test. This patch disables the MAC loopback test for
+these devices.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 6 ++++--
+ 1 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 3faff5d..2310efc 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -10875,9 +10875,11 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode)
+ if (loopback_mode == TG3_MAC_LOOPBACK) {
+ /* HW errata - mac loopback fails in some cases on 5780.
+ * Normal traffic and PHY loopback are not affected by
+- * errata.
++ * errata. Also, the MAC loopback test is deprecated for
++ * all newer ASIC revisions.
+ */
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5780)
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5780 ||
++ (tp->tg3_flags & TG3_FLAG_CPMU_PRESENT))
+ return 0;
+
+ mac_mode = tp->mac_mode &
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0205-tg3-Fix-NVRAM-selftest.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0205-tg3-Fix-NVRAM-selftest.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,46 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Wed, 9 Mar 2011 16:58:20 +0000
+Subject: [PATCH 205/207] tg3: Fix NVRAM selftest
+
+commit 01c3a3920f9f78866420b2004602944fca45083a upstream.
+
+The tg3 NVRAM selftest actually fails when validating the checksum of
+the legacy NVRAM format. However, the test still reported success
+because the last update of the return code was a success from the NVRAM
+reads. This patch fixes the code so that the error return code defaults
+to a failure status. Then the patch fixes the reason why the checsum
+validation failed.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 6 ++++--
+ 1 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 2310efc..ba45dd1 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -10494,14 +10494,16 @@ static int tg3_test_nvram(struct tg3 *tp)
+ goto out;
+ }
+
++ err = -EIO;
++
+ /* Bootstrap checksum at offset 0x10 */
+ csum = calc_crc((unsigned char *) buf, 0x10);
+- if (csum != be32_to_cpu(buf[0x10/4]))
++ if (csum != le32_to_cpu(buf[0x10/4]))
+ goto out;
+
+ /* Manufacturing block starts at offset 0x74, checksum at 0xfc */
+ csum = calc_crc((unsigned char *) &buf[0x74/4], 0x88);
+- if (csum != be32_to_cpu(buf[0xfc/4]))
++ if (csum != le32_to_cpu(buf[0xfc/4]))
+ goto out;
+
+ err = 0;
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0206-tg3-Only-allow-phy-ioctls-while-netif_running.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0206-tg3-Only-allow-phy-ioctls-while-netif_running.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,57 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Wed, 20 Apr 2011 07:57:38 +0000
+Subject: [PATCH 206/207] tg3: Only allow phy ioctls while netif_running
+
+commit 34eea5ac214353ccd93ef7dd8dbd10aed87f5f46 upstream.
+
+When tg3 was new, phy accesses through ioctl were allowable at any time.
+Then, the driver started shutting down the phy when the device was
+closed. Phy accesses would be allowed when the driver first attached to
+the device, but then would be forbidden after the device had been up'd
+and down'd. After that, management firmware made it illegal to access
+the phy unless the driver "owned" the device. Now that most firmware
+is being moved over to the APE, it is less clear when phy accesses are
+safe.
+
+While it is possible to attempt to identify these conditions and code
+the driver to navigate through the pitfalls, it could be perplexing to
+the admin why phy accesses work in some cases and not others. This
+patch brings some uniformity to the problem by only allowing phy
+accesses while the driver has control of the device.
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/tg3.c | 8 ++------
+ 1 files changed, 2 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index ba45dd1..7482edc 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -11213,9 +11213,7 @@ static int tg3_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
+ if (tp->phy_flags & TG3_PHYFLG_PHY_SERDES)
+ break; /* We have no PHY */
+
+- if ((tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER) ||
+- ((tp->tg3_flags & TG3_FLAG_ENABLE_ASF) &&
+- !netif_running(dev)))
++ if (!netif_running(dev))
+ return -EAGAIN;
+
+ spin_lock_bh(&tp->lock);
+@@ -11231,9 +11229,7 @@ static int tg3_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
+ if (tp->phy_flags & TG3_PHYFLG_PHY_SERDES)
+ break; /* We have no PHY */
+
+- if ((tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER) ||
+- ((tp->tg3_flags & TG3_FLAG_ENABLE_ASF) &&
+- !netif_running(dev)))
++ if (!netif_running(dev))
+ return -EAGAIN;
+
+ spin_lock_bh(&tp->lock);
+--
+1.7.5.4
+
Added: dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0207-tg3-Set-tx-bug-flags-for-more-devices.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/tg3/0207-tg3-Set-tx-bug-flags-for-more-devices.patch Sun Aug 14 22:55:28 2011 (r17922)
@@ -0,0 +1,354 @@
+From: Matt Carlson <mcarlson at broadcom.com>
+Date: Thu, 19 May 2011 12:12:44 +0000
+Subject: [PATCH 207/207] tg3: Set tx bug flags for more devices
+
+commit 2ffcc981d823a0518c627ca22d51ef72d0b7ca9a upstream.
+
+It has been recently discovered that all tg3 devices have a 4Gb boundary
+DMA problem, and that all 5755 and newer devices can't handle fragments
+less than or equal to 8 bytes in size. This patch adjusts the flags and
+removes tg3_start_xmit(). tg3_start_xmit_dma_bug() has been renamed to
+tg3_start_xmit().
+
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Reviewed-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Use separate flag members, as we haven't yet taken the patch
+ to convert them to a bit array]
+---
+ drivers/net/tg3.c | 268 +++++++----------------------------------------------
+ 1 files changed, 33 insertions(+), 235 deletions(-)
+
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 7482edc..fb57c29 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -5557,7 +5557,28 @@ static inline int tg3_40bit_overflow_test(struct tg3 *tp, dma_addr_t mapping,
+ #endif
+ }
+
+-static void tg3_set_txd(struct tg3_napi *, int, dma_addr_t, int, u32, u32);
++static void tg3_set_txd(struct tg3_napi *tnapi, int entry,
++ dma_addr_t mapping, int len, u32 flags,
++ u32 mss_and_is_end)
++{
++ struct tg3_tx_buffer_desc *txd = &tnapi->tx_ring[entry];
++ int is_end = (mss_and_is_end & 0x1);
++ u32 mss = (mss_and_is_end >> 1);
++ u32 vlan_tag = 0;
++
++ if (is_end)
++ flags |= TXD_FLAG_END;
++ if (flags & TXD_FLAG_VLAN) {
++ vlan_tag = flags >> 16;
++ flags &= 0xffff;
++ }
++ vlan_tag |= (mss << TXD_MSS_SHIFT);
++
++ txd->addr_hi = ((u64) mapping >> 32);
++ txd->addr_lo = ((u64) mapping & 0xffffffff);
++ txd->len_flags = (len << TXD_LEN_SHIFT) | flags;
++ txd->vlan_tag = vlan_tag << TXD_VLAN_TAG_SHIFT;
++}
+
+ /* Workaround 4GB and 40-bit hardware DMA bugs. */
+ static int tigon3_dma_hwbug_workaround(struct tg3_napi *tnapi,
+@@ -5640,204 +5661,7 @@ static int tigon3_dma_hwbug_workaround(struct tg3_napi *tnapi,
+ return ret;
+ }
+
+-static void tg3_set_txd(struct tg3_napi *tnapi, int entry,
+- dma_addr_t mapping, int len, u32 flags,
+- u32 mss_and_is_end)
+-{
+- struct tg3_tx_buffer_desc *txd = &tnapi->tx_ring[entry];
+- int is_end = (mss_and_is_end & 0x1);
+- u32 mss = (mss_and_is_end >> 1);
+- u32 vlan_tag = 0;
+-
+- if (is_end)
+- flags |= TXD_FLAG_END;
+- if (flags & TXD_FLAG_VLAN) {
+- vlan_tag = flags >> 16;
+- flags &= 0xffff;
+- }
+- vlan_tag |= (mss << TXD_MSS_SHIFT);
+-
+- txd->addr_hi = ((u64) mapping >> 32);
+- txd->addr_lo = ((u64) mapping & 0xffffffff);
+- txd->len_flags = (len << TXD_LEN_SHIFT) | flags;
+- txd->vlan_tag = vlan_tag << TXD_VLAN_TAG_SHIFT;
+-}
+-
+-/* hard_start_xmit for devices that don't have any bugs and
+- * support TG3_FLG2_HW_TSO_2 and TG3_FLG2_HW_TSO_3 only.
+- */
+-static netdev_tx_t tg3_start_xmit(struct sk_buff *skb,
+- struct net_device *dev)
+-{
+- struct tg3 *tp = netdev_priv(dev);
+- u32 len, entry, base_flags, mss;
+- dma_addr_t mapping;
+- struct tg3_napi *tnapi;
+- struct netdev_queue *txq;
+- unsigned int i, last;
+-
+- txq = netdev_get_tx_queue(dev, skb_get_queue_mapping(skb));
+- tnapi = &tp->napi[skb_get_queue_mapping(skb)];
+- if (tp->tg3_flags3 & TG3_FLG3_ENABLE_TSS)
+- tnapi++;
+-
+- /* We are running in BH disabled context with netif_tx_lock
+- * and TX reclaim runs via tp->napi.poll inside of a software
+- * interrupt. Furthermore, IRQ processing runs lockless so we have
+- * no IRQ context deadlocks to worry about either. Rejoice!
+- */
+- if (unlikely(tg3_tx_avail(tnapi) <= (skb_shinfo(skb)->nr_frags + 1))) {
+- if (!netif_tx_queue_stopped(txq)) {
+- netif_tx_stop_queue(txq);
+-
+- /* This is a hard error, log it. */
+- netdev_err(dev,
+- "BUG! Tx Ring full when queue awake!\n");
+- }
+- return NETDEV_TX_BUSY;
+- }
+-
+- entry = tnapi->tx_prod;
+- base_flags = 0;
+- mss = skb_shinfo(skb)->gso_size;
+- if (mss) {
+- int tcp_opt_len, ip_tcp_len;
+- u32 hdrlen;
+-
+- if (skb_header_cloned(skb) &&
+- pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) {
+- dev_kfree_skb(skb);
+- goto out_unlock;
+- }
+-
+- if (skb_is_gso_v6(skb)) {
+- hdrlen = skb_headlen(skb) - ETH_HLEN;
+- } else {
+- struct iphdr *iph = ip_hdr(skb);
+-
+- tcp_opt_len = tcp_optlen(skb);
+- ip_tcp_len = ip_hdrlen(skb) + sizeof(struct tcphdr);
+-
+- iph->check = 0;
+- iph->tot_len = htons(mss + ip_tcp_len + tcp_opt_len);
+- hdrlen = ip_tcp_len + tcp_opt_len;
+- }
+-
+- if (tp->tg3_flags2 & TG3_FLG2_HW_TSO_3) {
+- mss |= (hdrlen & 0xc) << 12;
+- if (hdrlen & 0x10)
+- base_flags |= 0x00000010;
+- base_flags |= (hdrlen & 0x3e0) << 5;
+- } else
+- mss |= hdrlen << 9;
+-
+- base_flags |= (TXD_FLAG_CPU_PRE_DMA |
+- TXD_FLAG_CPU_POST_DMA);
+-
+- tcp_hdr(skb)->check = 0;
+-
+- } else if (skb->ip_summed == CHECKSUM_PARTIAL) {
+- base_flags |= TXD_FLAG_TCPUDP_CSUM;
+- }
+-
+-#if TG3_VLAN_TAG_USED
+- if (tp->vlgrp != NULL && vlan_tx_tag_present(skb))
+- base_flags |= (TXD_FLAG_VLAN |
+- (vlan_tx_tag_get(skb) << 16));
+-#endif
+-
+- len = skb_headlen(skb);
+-
+- /* Queue skb data, a.k.a. the main skb fragment. */
+- mapping = pci_map_single(tp->pdev, skb->data, len, PCI_DMA_TODEVICE);
+- if (pci_dma_mapping_error(tp->pdev, mapping)) {
+- dev_kfree_skb(skb);
+- goto out_unlock;
+- }
+-
+- tnapi->tx_buffers[entry].skb = skb;
+- dma_unmap_addr_set(&tnapi->tx_buffers[entry], mapping, mapping);
+-
+- if ((tp->tg3_flags3 & TG3_FLG3_USE_JUMBO_BDFLAG) &&
+- !mss && skb->len > VLAN_ETH_FRAME_LEN)
+- base_flags |= TXD_FLAG_JMB_PKT;
+-
+- tg3_set_txd(tnapi, entry, mapping, len, base_flags,
+- (skb_shinfo(skb)->nr_frags == 0) | (mss << 1));
+-
+- entry = NEXT_TX(entry);
+-
+- /* Now loop through additional data fragments, and queue them. */
+- if (skb_shinfo(skb)->nr_frags > 0) {
+- last = skb_shinfo(skb)->nr_frags - 1;
+- for (i = 0; i <= last; i++) {
+- skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
+-
+- len = frag->size;
+- mapping = pci_map_page(tp->pdev,
+- frag->page,
+- frag->page_offset,
+- len, PCI_DMA_TODEVICE);
+- if (pci_dma_mapping_error(tp->pdev, mapping))
+- goto dma_error;
+-
+- tnapi->tx_buffers[entry].skb = NULL;
+- dma_unmap_addr_set(&tnapi->tx_buffers[entry], mapping,
+- mapping);
+-
+- tg3_set_txd(tnapi, entry, mapping, len,
+- base_flags, (i == last) | (mss << 1));
+-
+- entry = NEXT_TX(entry);
+- }
+- }
+-
+- /* Packets are ready, update Tx producer idx local and on card. */
+- tw32_tx_mbox(tnapi->prodmbox, entry);
+-
+- tnapi->tx_prod = entry;
+- if (unlikely(tg3_tx_avail(tnapi) <= (MAX_SKB_FRAGS + 1))) {
+- netif_tx_stop_queue(txq);
+-
+- /* netif_tx_stop_queue() must be done before checking
+- * checking tx index in tg3_tx_avail() below, because in
+- * tg3_tx(), we update tx index before checking for
+- * netif_tx_queue_stopped().
+- */
+- smp_mb();
+- if (tg3_tx_avail(tnapi) > TG3_TX_WAKEUP_THRESH(tnapi))
+- netif_tx_wake_queue(txq);
+- }
+-
+-out_unlock:
+- mmiowb();
+-
+- return NETDEV_TX_OK;
+-
+-dma_error:
+- last = i;
+- entry = tnapi->tx_prod;
+- tnapi->tx_buffers[entry].skb = NULL;
+- pci_unmap_single(tp->pdev,
+- dma_unmap_addr(&tnapi->tx_buffers[entry], mapping),
+- skb_headlen(skb),
+- PCI_DMA_TODEVICE);
+- for (i = 0; i <= last; i++) {
+- skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
+- entry = NEXT_TX(entry);
+-
+- pci_unmap_page(tp->pdev,
+- dma_unmap_addr(&tnapi->tx_buffers[entry],
+- mapping),
+- frag->size, PCI_DMA_TODEVICE);
+- }
+-
+- dev_kfree_skb(skb);
+- return NETDEV_TX_OK;
+-}
+-
+-static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *,
+- struct net_device *);
++static netdev_tx_t tg3_start_xmit(struct sk_buff *, struct net_device *);
+
+ /* Use GSO to workaround a rare TSO bug that may be triggered when the
+ * TSO header is greater than 80 bytes.
+@@ -5871,7 +5695,7 @@ static int tg3_tso_bug(struct tg3 *tp, struct sk_buff *skb)
+ nskb = segs;
+ segs = segs->next;
+ nskb->next = NULL;
+- tg3_start_xmit_dma_bug(nskb, tp->dev);
++ tg3_start_xmit(nskb, tp->dev);
+ } while (segs);
+
+ tg3_tso_bug_end:
+@@ -5883,8 +5707,7 @@ tg3_tso_bug_end:
+ /* hard_start_xmit for devices that have the 4G bug and/or 40-bit bug and
+ * support TG3_FLG2_HW_TSO_1 or firmware TSO only.
+ */
+-static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb,
+- struct net_device *dev)
++static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
+ {
+ struct tg3 *tp = netdev_priv(dev);
+ u32 len, entry, base_flags, mss;
+@@ -13382,14 +13205,15 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
+ }
+ }
+
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
++ /* All chips can get confused if TX buffers
++ * straddle the 4GB address boundary.
++ */
++ tp->tg3_flags3 |= TG3_FLG3_4G_DMA_BNDRY_BUG;
++
++ if (tp->tg3_flags3 & TG3_FLG3_5755_PLUS)
+ tp->tg3_flags3 |= TG3_FLG3_SHORT_DMA_BUG;
+- else if (!(tp->tg3_flags3 & TG3_FLG3_5755_PLUS)) {
+- tp->tg3_flags3 |= TG3_FLG3_4G_DMA_BNDRY_BUG;
++ else
+ tp->tg3_flags3 |= TG3_FLG3_40BIT_DMA_LIMIT_BUG;
+- }
+
+ if (tp->tg3_flags3 & TG3_FLG3_5717_PLUS)
+ tp->tg3_flags3 |= TG3_FLG3_USE_JUMBO_BDFLAG;
+@@ -14652,25 +14476,6 @@ static const struct net_device_ops tg3_netdev_ops = {
+ #endif
+ };
+
+-static const struct net_device_ops tg3_netdev_ops_dma_bug = {
+- .ndo_open = tg3_open,
+- .ndo_stop = tg3_close,
+- .ndo_start_xmit = tg3_start_xmit_dma_bug,
+- .ndo_get_stats = tg3_get_stats,
+- .ndo_validate_addr = eth_validate_addr,
+- .ndo_set_multicast_list = tg3_set_rx_mode,
+- .ndo_set_mac_address = tg3_set_mac_addr,
+- .ndo_do_ioctl = tg3_ioctl,
+- .ndo_tx_timeout = tg3_tx_timeout,
+- .ndo_change_mtu = tg3_change_mtu,
+-#if TG3_VLAN_TAG_USED
+- .ndo_vlan_rx_register = tg3_vlan_rx_register,
+-#endif
+-#ifdef CONFIG_NET_POLL_CONTROLLER
+- .ndo_poll_controller = tg3_poll_controller,
+-#endif
+-};
+-
+ static int __devinit tg3_init_one(struct pci_dev *pdev,
+ const struct pci_device_id *ent)
+ {
+@@ -14770,6 +14575,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
+
+ dev->ethtool_ops = &tg3_ethtool_ops;
+ dev->watchdog_timeo = TG3_TX_TIMEOUT;
++ dev->netdev_ops = &tg3_netdev_ops;
+ dev->irq = pdev->irq;
+
+ err = tg3_get_invariants(tp);
+@@ -14779,14 +14585,6 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
+ goto err_out_iounmap;
+ }
+
+- if ((tp->tg3_flags3 & TG3_FLG3_5755_PLUS) &&
+- GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717 &&
+- GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5719)
+- dev->netdev_ops = &tg3_netdev_ops;
+- else
+- dev->netdev_ops = &tg3_netdev_ops_dma_bug;
+-
+-
+ /* The EPB bridge inside 5714, 5715, and 5780 and any
+ * device behind the EPB cannot support DMA addresses > 40-bit.
+ * On 64-bit systems with IOMMU, use 40-bit dma_mask.
+--
+1.7.5.4
+
Modified: dists/squeeze/linux-2.6/debian/patches/series/36
==============================================================================
--- dists/squeeze/linux-2.6/debian/patches/series/36 Sun Aug 14 20:10:24 2011 (r17921)
+++ dists/squeeze/linux-2.6/debian/patches/series/36 Sun Aug 14 22:55:28 2011 (r17922)
@@ -16,3 +16,598 @@
+ bugfix/all/drm-radeon-kms-fix-for-radeon-on-systems-4GB-without.patch
+ bugfix/all/stable/2.6.32.43.patch
+ bugfix/all/perf-do-not-look-at-.-config-for-configuration.patch
+
+# Networking
++ features/all/net-Add-netdev_alloc_skb_ip_align-helper.patch
++ features/all/PCI-Add-dummy-implementation-of-pci_dev_run_wake.patch
++ features/all/pm-Define-SET_SYSTEM_SLEEP_PM_OPS.patch
++ features/all/dma-mapping-dma-mapping.h-add-dma_set_coherent_mask.patch
++ features/all/dma-mapping.h-add-the-dma_unmap-state-API.patch
++ features/all/etherdevice-Dummy-implementation-of-dev_hw_addr_rand.patch
++ features/all/e1000e/0001-e1000e-Use-the-instance-of-net_device_stats-from-net.patch
++ features/all/e1000e/0002-net-Use-netdev_alloc_skb_ip_align.patch
++ features/all/e1000e/0003-e1000e-Fix-erroneous-display-of-stats-by-ethtool-S.patch
++ features/all/e1000e/0004-drivers-net-request_irq-Remove-unnecessary-leading-f.patch
++ features/all/e1000e/0005-e1000e-check-WoL-mode-is-among-set-of-supported-mode.patch
++ features/all/e1000e/0006-e1000e-add-missing-tests-for-82583-in-ethtool-functi.patch
++ features/all/e1000e/0007-e1000e-clearing-interrupt-timers-causes-descriptors-.patch
++ features/all/e1000e/0008-e1000e-function-pointers-for-ethtool-set-get-offload.patch
++ features/all/e1000e/0009-e1000e-don-t-clean-Rx-ring-while-resetting.patch
++ features/all/e1000e/0010-e1000e-link-reporting-problems.patch
++ features/all/e1000e/0011-e1000e-improper-return-code-signage.patch
++ features/all/e1000e/0012-e1000e-disable-K1-on-PCH-LOM-when-in-PHY-loopback-mo.patch
++ features/all/e1000e/0013-e1000e-Incorrect-MII-Link-beat-reporting.patch
++ features/all/e1000e/0014-e1000e-cleanup-redundant-include-s.patch
++ features/all/e1000e/0015-e1000e-consolidate-two-dbug-macros-into-one-simpler-.patch
++ features/all/e1000e/0016-e1000e-cleanup-ops-function-pointers.patch
++ features/all/e1000e/0017-e1000e-update-copyright-information.patch
++ features/all/e1000e/0018-e1000e-remove-comments-regarding-a-non-existent-api-.patch
++ features/all/e1000e/0019-e1000e-provide-comment-for-82571-workaround.patch
++ features/all/e1000e/0020-e1000e-set-bools-to-true-false-instead-of-1-0.patch
++ features/all/e1000e/0021-e1000e-cleanup-shift-indentation-left-by-exiting-ear.patch
++ features/all/e1000e/0022-e1000e-cleanup-functions-that-clear-hardware-statist.patch
++ features/all/e1000e/0023-e1000e-set-pm_qos-DMA-latency-requirement-per-interf.patch
++ features/all/e1000e/0024-e1000e-do-not-error-out-on-identification-LED-init-f.patch
++ features/all/e1000e/0025-e1000e-remove-redundant-might_sleep.patch
++ features/all/e1000e/0026-e1000e-cosmetic-group-local-variables-of-the-same-ty.patch
++ features/all/e1000e/0027-e1000e-update-Tx-Unit-hang-detection-message.patch
++ features/all/e1000e/0028-e1000e-provide-family-specific-functions-to-manage-V.patch
++ features/all/e1000e/0029-e1000e-guard-against-buffer-overflow-in-cable-length.patch
++ features/all/e1000e/0030-e1000e-provide-family-specific-PHY-power-up-down-ope.patch
++ features/all/e1000e/0031-e1000e-ensure-the-link-state-is-correct-for-serdes-l.patch
++ features/all/e1000e/0032-e1000e-comment-corrections.patch
++ features/all/e1000e/0033-e1000e-add-debug-messages.patch
++ features/all/e1000e/0034-e1000e-PHY-type-cleanups-in-e1000e_check_downshift.patch
++ features/all/e1000e/0035-e1000e-Use-sizeof-struct-rather-than-pointer-in-e100.patch
++ features/all/e1000e/0036-e1000e-remove-use-of-skb_dma_map-from-e1000e-driver.patch
++ features/all/e1000e/0037-e1000e-check_polarity-function-pointers-not-set-for-.patch
++ features/all/e1000e/0038-e1000e-refactor-PHY-ID-detection-workaround.patch
++ features/all/e1000e/0039-e1000e-correct-ICH-PCH-PHY-operations-function-point.patch
++ features/all/e1000e/0040-drivers-net-Move-and-to-end-of-previous-line.patch
++ features/all/e1000e/0041-e1000e-minor-correction-to-name-of-bit-in-CTRL_EXT-r.patch
++ features/all/e1000e/0042-e1000e-replace-incorrect-use-of-GG82563_REG-macro.patch
++ features/all/e1000e/0043-e1000e-only-perform-ESB2-MDIC-workaround-on-certain-.patch
++ features/all/e1000e/0044-e1000e-LED-settings-in-EEPROM-ignored-on-82571-and-8.patch
++ features/all/e1000e/0045-drivers-net-use-DEFINE_PCI_DEVICE_TABLE.patch
++ features/all/e1000e/0046-e1000e-call-pci_save_state-after-pci_restore_state.patch
++ features/all/e1000e/0047-e1000e-don-t-accumulate-PHY-statistics-on-PHY-read-f.patch
++ features/all/e1000e/0048-e1000e-perform-10-100-adaptive-IFS-only-on-parts-tha.patch
++ features/all/e1000e/0049-e1000e-e1000e_enable_tx_pkt_filtering-returns-wrong-.patch
++ features/all/e1000e/0050-e1000e-fix-and-commonize-code-for-setting-the-receiv.patch
++ features/all/e1000e/0051-e1000e-MDIO-slow-mode-should-always-be-done-for-8257.patch
++ features/all/e1000e/0052-e1000e-workaround-link-issues-on-busy-hub-in-half-du.patch
++ features/all/e1000e/0053-e1000e-use-alternate-MAC-address-on-ESB2-if-availabl.patch
++ features/all/e1000e/0054-e1000e-provide-MAC-family-specific-function-to-set-L.patch
++ features/all/e1000e/0055-e1000e-genericize-the-update-multicast-address-list.patch
++ features/all/e1000e/0056-e1000-e1000e-igb-igbvf-ixgb-ixgbe-Fix-tests-of-unsig.patch
++ features/all/e1000e/0057-net-Fix-IPv6-GSO-type-checks-in-Intel-ethernet-drive.patch
++ features/all/e1000e/0058-e1000e-Fix-namespace-conflicts-wrt.-e1000_has_link.patch
++ features/all/e1000e/0059-net-e1000e-convert-to-use-mc-helpers.patch
++ features/all/e1000e/0060-tree-wide-Assorted-spelling-fixes.patch
++ features/all/e1000e/0061-e1000e-fix-packet-corruption-and-tx-hang-during-NFSv.patch
++ features/all/e1000e/0062-e1000e-enable-disable-ASPM-L0s-and-L1-and-ERT-accord.patch
++ features/all/e1000e/0063-e1000e-PCI-PM-Add-basic-runtime-PM-support-rev.-4.patch
++ features/all/e1000e/0064-e1000e-Fix-build-with-CONFIG_PM-disabled.patch
++ features/all/e1000e/0065-Net-e1000e-Fix-build-issue-introduced-by-runtime-PM-.patch
++ features/all/e1000e/0066-e1000e-Disable-run-time-PM-support.patch
++ features/all/e1000e/0067-e1000e-do-not-modify-tx_queue_len-on-link-speed-chan.patch
++ features/all/e1000e/0068-e1000e-Use-pr_-level-and-netdev_-level.patch
++ features/all/e1000e/0069-include-cleanup-Update-gfp.h-and-slab.h-includes-to-.patch
++ features/all/e1000e/0070-e1000e-typo-corrections.patch
++ features/all/e1000e/0071-e1000e-use-static-params-to-save-stack-space.patch
++ features/all/e1000e/0072-drivers-net-use-skb_headlen.patch
++ features/all/e1000e/0073-e1000e-use-DMA-API-instead-of-PCI-DMA-functions.patch
++ features/all/e1000e/0074-e1000e-add-registers-etc.-printout-code-just-before-.patch
++ features/all/e1000e/0075-e1000e-Fix-oops-caused-by-ASPM-patch.patch
++ features/all/e1000e/0076-e1000e-save-skb-counts-in-TX-to-avoid-cache-misses.patch
++ features/all/e1000e/0077-e1000e-reduce-writes-of-RX-producer-ptr.patch
++ features/all/e1000e/0078-e1000e-Remove-unnessary-log-message.patch
++ features/all/e1000e/0079-e1000e-Save-irq-into-netdev-structure.patch
++ features/all/e1000e/0080-e1000e-increase-rx-fifo-size-to-36K-on-82574-and-825.patch
++ features/all/e1000e/0081-e1000-e1000e-implement-a-simple-interrupt-moderation.patch
++ features/all/e1000e/0082-e1000e-reset-MAC-PHY-interconnect-on-82577-82578-dur.patch
++ features/all/e1000e/0083-e1000e-use-static-params-to-save-stack-space-part-2.patch
++ features/all/e1000e/0084-e1000e-bad-state-after-running-ethtool-diagnostics-w.patch
++ features/all/e1000e/0085-e1000e-initialize-manageability-IPMI-pass-through-in.patch
++ features/all/e1000e/0086-e1000e-s-w-initiated-LSC-MSI-X-interrupts-not-genera.patch
++ features/all/e1000e/0087-e1000e-cleanup-multiple-common-exit-points.patch
++ features/all/e1000e/0088-e1000e-Remove-EN_MAC_ADDR_FILTER-check-from-enable_m.patch
++ features/all/e1000e/0089-e1000e-Cleanup-e1000_sw_lcd_config_ich8lan.patch
++ features/all/e1000e/0090-e1000e-Incorrect-function-pointer-set-for-force_spee.patch
++ features/all/e1000e/0091-e1000e-fix-checks-for-manageability-enabled-and-mana.patch
++ features/all/e1000e/0092-e1000e-move-settting-of-flow-control-refresh-timer-t.patch
++ features/all/e1000e/0093-e1000e-Fix-cleanup-PHY-reset-code-for-ICHx-PCHx.patch
++ features/all/e1000e/0094-e1000e-add-PCI-device-id-to-enable-support-for-82567.patch
++ features/all/e1000e/0095-drivers-net-Remove-unnecessary-returns-from-void-fun.patch
++ features/all/e1000e/0096-e1000e-change-logical-negate-to-bitwise.patch
++ features/all/e1000e/0097-e1000e-cleanup-ethtool-loopback-setup-code.patch
++ features/all/e1000e/0098-e1000e-cleanup-e1000_sw_lcd_config_ich8lan.patch
++ features/all/e1000e/0099-e1000e-separate-out-PHY-statistics-register-updates.patch
++ features/all/e1000e/0100-e1000e-fix-check-for-manageability-on-ICHx-PCH.patch
++ features/all/e1000e/0101-e1000e-initial-support-for-82579-LOMs.patch
++ features/all/e1000e/0102-e1000e-enable-support-for-EEE-on-82579.patch
++ features/all/e1000e/0103-e1000e-update-copyright-information.patch
++ features/all/e1000e/0104-e1000e-update-driver-version-number.patch
++ features/all/e1000e/0105-e1000e-avoid-polling-h-w-registers-during-link-negot.patch
++ features/all/e1000e/0106-e1000e-do-not-touch-PHY-page-800-registers-when-link.patch
++ features/all/e1000e/0107-e1000e-packet-split-should-not-be-used-with-early-re.patch
++ features/all/e1000e/0108-e1000e-disable-gig-speed-when-in-S0-Sx-transition.patch
++ features/all/e1000e/0109-e1000e-fail-when-try-to-setup-unsupported-features.patch
++ features/all/e1000e/0110-e1000e-suppress-compile-warnings-on-certain-archs.patch
++ features/all/e1000e/0111-e1000e-remove-EEE-module-parameter.patch
++ features/all/e1000e/0112-e1000e-disable-EEE-support-by-default.patch
++ features/all/e1000e/0113-e1000e-Drop-a-useless-statement.patch
++ features/all/e1000e/0114-e1000e-Fix-irq_synchronize-in-MSI-X-case.patch
++ features/all/e1000e/0115-e1000e-correct-MAC-PHY-interconnect-register-offset-.patch
++ features/all/e1000e/0116-e100-e1000-igb-ixgb-Add-missing-read-memory-barrier.patch
++ features/all/e1000e/0117-e1000e-disable-ASPM-L1-on-82573.patch
++ features/all/e1000e/0118-e1000e-don-t-check-for-alternate-MAC-addr-on-parts-t.patch
++ features/all/e1000e/0119-drivers-net-Remove-address-use-from-assignments-of-f.patch
++ features/all/e1000e/0120-e1000e-Simplify-MSI-interrupt-testing.patch
++ features/all/e1000e/0121-e1000e-82577-8-9-issues-with-device-in-Sx.patch
++ features/all/e1000e/0122-e1000e-82579-SMBus-address-and-LEDs-incorrect-after-.patch
++ features/all/e1000e/0123-e1000e-82566DC-fails-to-get-link.patch
++ features/all/e1000e/0124-e1000e-82579-unaccounted-missed-packets.patch
++ features/all/e1000e/0125-e1000e-82579-jumbo-frame-workaround-causing-CRC-erro.patch
++ features/all/e1000e/0126-e1000e-82579-do-not-gate-auto-config-of-PHY-by-hardw.patch
++ features/all/e1000e/0127-e1000-e1000e-igb-ixgb-ixgbe-set-NETIF_F_HIGHDMA-for-.patch
++ features/all/e1000e/0128-drivers-net-return-operator-cleanup.patch
++ features/all/e1000e/0129-e1000e-use-hardware-writeback-batching.patch
++ features/all/e1000e/0130-e1000e-Fix-for-offline-diag-test-failure-at-first-ca.patch
++ features/all/e1000e/0131-e1000e-82579-performance-improvements.patch
++ features/all/e1000e/0132-e1000e-reset-PHY-after-errors-detected.patch
++ features/all/e1000e/0133-e1000e-Add-check-for-reset-flags-before-displaying-r.patch
++ features/all/e1000e/0134-tree-wide-fix-comment-printk-typos.patch
++ features/all/e1000e/0135-drivers-net-e1000e-Remove-unnecessary-semicolons.patch
++ features/all/e1000e/0136-e1000e-82571-SerDes-link-handle-null-code-word-from-.patch
++ features/all/e1000e/0137-e1000e-82574-intermittently-fails-to-initialize-with.patch
++ features/all/e1000e/0138-e1000e-add-netpoll-support-for-MSI-MSI-X-IRQ-modes.patch
++ features/all/e1000e/0139-Intel-Wired-LAN-drivers-Use-static-const.patch
++ features/all/e1000e/0140-e1000e-fix-double-initialization-in-blink-path.patch
++ features/all/e1000e/0141-e1000e-82571-based-mezzanine-card-can-fail-ethtool-l.patch
++ features/all/e1000e/0142-e1000e-82574-82583-performance-improvement.patch
++ features/all/e1000e/0143-e1000e-82577-8-must-acquire-h-w-semaphore-before-wor.patch
++ features/all/e1000e/0144-e1000e-82571-Serdes-can-fail-to-get-link.patch
++ features/all/e1000e/0145-e1000e-82577-8-9-mis-configured-OEM-bits-during-S0-S.patch
++ features/all/e1000e/0146-e1000e-82579-PHY-incorrectly-identified-during-init.patch
++ features/all/e1000e/0147-e1000e-support-new-PBA-format-from-EEPROM.patch
++ features/all/e1000e/0148-e1000e-prevent-null-ptr-dereference-in-e1000_tx_queu.patch
++ features/all/e1000e/0149-e1000e-minor-error-message-corrections.patch
++ features/all/e1000e/0150-e1000e-static-analysis-tools-complain-of-a-possible-.patch
++ features/all/e1000e/0151-e1000e-increment-the-driver-version.patch
++ features/all/e1000e/0152-e1000e-checkpatch-error-macro-panethesis.patch
++ features/all/e1000e/0153-e1000e-checkpatch-error-trailing-statements.patch
++ features/all/e1000e/0154-e1000e-checkpatch-error-open-braces.patch
++ features/all/e1000e/0155-e1000e-checkpatch-warnings-braces.patch
++ features/all/e1000e/0156-e1000e-cleanup-variables-set-but-not-used.patch
++ features/all/e1000e/0157-e1000e-convert-calls-of-ops.-read-write-_reg-to-e1e_.patch
++ features/all/e1000e/0158-e1000e-properly-bounds-check-string-functions.patch
++ features/all/e1000e/0159-e1000e-use-either_crc_le-rather-than-re-write-it.patch
++ features/all/e1000e/0160-e1000e-power-off-PHY-after-reset-when-interface-is-d.patch
++ features/all/e1000e/0161-e1000e-add-custom-set_d-0-3-_lplu_state-function-poi.patch
++ features/all/e1000e/0162-e1000e-update-Copyright-for-2011.patch
++ features/all/e1000e/0163-e1000e-consistent-use-of-Rx-Tx-vs.-RX-TX-rx-tx-in-co.patch
++ features/all/e1000e/0164-e1000e-tx_timeout-should-not-increment-for-non-hang-.patch
++ features/all/e1000e/0165-e1000e-check-down-flag-in-tasks.patch
++ features/all/e1000e/0166-e1000e-flush-all-writebacks-before-unload.patch
++ features/all/igb/0001-net-Convert-ethtool-get_stats-self_test-_count-ops-t.patch
++ features/all/igb/0002-igb-remove-unused-temp-variable-from-stats-clearing-.patch
++ features/all/igb/0003-igb-update-comments-for-serdes-config-and-update-to-.patch
++ features/all/igb/0004-igb-update-the-approach-taken-to-acquiring-and-relea.patch
++ features/all/igb/0005-igb-add-locking-to-reads-of-the-i2c-interface.patch
++ features/all/igb/0006-igb-add-combined-function-for-setting-rar-and-pool-b.patch
++ features/all/igb/0007-igb-make-use-of-the-uta-to-allow-for-promiscous-mode.patch
++ features/all/igb/0008-igb-add-function-to-handle-mailbox-lock.patch
++ features/all/igb/0009-igb-fix-a-few-items-where-weren-t-correctly-setup-fo.patch
++ features/all/igb/0010-igb-remove-microwire-support-from-igb.patch
++ features/all/igb/0011-igb-move-the-generic-copper-link-setup-code-into-e10.patch
++ features/all/igb/0012-igb-add-code-to-retry-a-phy-read-in-the-event-of-fai.patch
++ features/all/igb/0013-igb-add-additional-error-handling-to-the-phy-code.patch
++ features/all/igb/0014-igb-add-flushes-between-RAR-writes-when-setting-mac-.patch
++ features/all/igb/0015-igb-Use-the-instance-of-net_device_stats-from-net_de.patch
++ features/all/igb/0016-net-Use-netdev_alloc_skb_ip_align.patch
++ features/all/igb/0017-igb-Fix-erroneous-display-of-stats-by-ethtool-S.patch
++ features/all/igb/0018-igb-add-new-data-structure-for-handling-interrupts-a.patch
++ features/all/igb/0019-igb-remove-rx-checksum-good-counter.patch
++ features/all/igb/0020-igb-increase-minimum-rx-buffer-size-to-1K.patch
++ features/all/igb/0021-igb-move-the-tx-and-rx-ring-specific-config-into-sep.patch
++ features/all/igb/0022-igb-remove-rx_ps_hdr_len.patch
++ features/all/igb/0023-igb-move-SRRCTL-register-configuration-into-ring-spe.patch
++ features/all/igb/0024-igb-change-the-head-and-tail-offsets-into-pointers.patch
++ features/all/igb/0025-igb-add-pci-device-pointer-to-ring-structure.patch
++ features/all/igb/0026-igb-move-rx_buffer_len-into-the-ring-structure.patch
++ features/all/igb/0027-igb-move-alloc_failed-and-csum_err-stats-into-per-rx.patch
++ features/all/igb/0028-igb-add-a-flags-value-to-the-ring.patch
++ features/all/igb/0029-igb-place-a-pointer-to-the-netdev-struct-in-the-ring.patch
++ features/all/igb/0030-igb-move-the-multiple-receive-queue-configuration-in.patch
++ features/all/igb/0031-igb-delay-VF-reset-notification-until-after-interrup.patch
++ features/all/igb/0032-igb-setup-vlan-tag-replication-stripping-in-igb_vmm_.patch
++ features/all/igb/0033-igb-re-use-ring-configuration-code-in-ethtool-testin.patch
++ features/all/igb/0034-igb-make-tx-ring-map-and-free-functionality-non-stat.patch
++ features/all/igb/0035-igb-make-ethtool-use-core-xmit-map-and-free-function.patch
++ features/all/igb/0036-igb-add-single-vector-msi-x-testing-to-interrupt-tes.patch
++ features/all/igb/0037-igb-cleanup-todo-code-found-in-igb_ethtool.c.patch
++ features/all/igb/0038-igb-add-support-for-seperate-tx-usecs-setting-in-eth.patch
++ features/all/igb/0039-igb-cleanup-some-of-the-code-related-to-hw-timestamp.patch
++ features/all/igb/0040-igb-misc-cleanups-within-igb_ethtool.c.patch
++ features/all/igb/0041-igb-use-packet-buffer-sizes-from-RXPBS-register.patch
++ features/all/igb/0042-igb-replace-the-VF-clear_to_send-with-a-flags-value.patch
++ features/all/igb/0043-igb-rework-use-of-VMOLR-in-regards-to-PF-and-VFs.patch
++ features/all/igb/0044-igb-rework-handling-of-the-vfta-and-vlvf-registers-i.patch
++ features/all/igb/0045-igb-move-vf-init-into-a-seperate-function.patch
++ features/all/igb/0046-igb-only-process-global-stats-in-igb_update_stats.patch
++ features/all/igb/0047-igb-move-global_quad_port_a-from-global-into-local-s.patch
++ features/all/igb/0048-igb-make-tx-hang-check-multiqueue-check-eop-descript.patch
++ features/all/igb/0049-igb-cleanup-code-related-to-ring-resource-allocation.patch
++ features/all/igb/0050-igb-change-queue-ordering-for-82576-based-adapters.patch
++ features/all/igb/0051-igb-cleanup-interrupt-enablement-in-regards-to-msix_.patch
++ features/all/igb/0052-igb-Remove-invalid-stats-counters.patch
++ features/all/igb/0053-igb-cleanup-igb.h-header-whitespace-and-some-structu.patch
++ features/all/igb/0054-igb-cleanup-igb-xmit-frame-path.patch
++ features/all/igb/0055-igb-cleanup-clean_rx_irq_adv-and-alloc_rx_buffers_ad.patch
++ features/all/igb/0056-igb-replace-unecessary-adapter-hw-with-just-hw-where.patch
++ features/all/igb/0057-igb-add-pci_dev-in-few-spots-to-clean-up-use-of-dev_.patch
++ features/all/igb/0058-igb-limit-minimum-mtu-to-68-to-keep-ip-bound-to-inte.patch
++ features/all/igb/0059-igb-open-up-SCTP-checksum-offloads-to-all-MACs-82576.patch
++ features/all/igb/0060-igb-cleanup-whitespace-issues-in-igb_main.c.patch
++ features/all/igb/0061-igb-Fix-warnings-in-igb_set_ringparam.patch
++ features/all/igb/0062-igb-change-type-for-ring-sizes-to-u16-in-igb_set_rin.patch
++ features/all/igb/0063-igb-move-timesync-init-into-a-seperate-function.patch
++ features/all/igb/0064-igb-when-number-of-CPUs-4-combine-tx-rx-queues-to-al.patch
++ features/all/igb/0065-igb-Rework-how-netdev-stats-is-handled.patch
++ features/all/igb/0066-igb-removed-unused-tx-rx-total-bytes-packets-from-ad.patch
++ features/all/igb/0067-igb-check-for-packets-on-all-tx-rings-when-link-is-d.patch
++ features/all/igb/0068-igb-only-recycle-page-if-it-is-on-our-numa-node.patch
++ features/all/igb/0069-drivers-net-request_irq-Remove-unnecessary-leading-f.patch
++ features/all/igb/0070-igb-add-support-for-the-82580-phy.patch
++ features/all/igb/0071-igb-add-support-for-82580-MAC.patch
++ features/all/igb/0072-igb-Add-full-support-for-82580-devices.patch
++ features/all/igb/0073-igb-remove-use-of-skb_dma_map-from-driver.patch
++ features/all/igb/0074-igbvf-remove-skb_dma_map-unmap-call-from-drivers.patch
++ features/all/igb/0075-drivers-net-Move-and-to-end-of-previous-line.patch
++ features/all/igb/0076-igb-fix-handling-of-mailbox-collisions-between-PF-VF.patch
++ features/all/igb/0077-igbvf-avoid-reset-storms-due-to-mailbox-issues.patch
++ features/all/igb/0078-igb-do-not-force-pcs-link-when-in-KX-mode.patch
++ features/all/igb/0079-igb-do-not-force-retry-count-to-1-on-82580-phy.patch
++ features/all/igb/0080-igb-correctly-offset-82575-flow-control-watermarks-b.patch
++ features/all/igb/0081-igb-check-both-function-bits-in-status-register-in-w.patch
++ features/all/igb/0082-igbvf-Make-igbvf-error-message-more-informative.patch
++ features/all/igb/0083-drivers-net-igbvf-netdev.c-use-pM-to-shown-MAC-addre.patch
++ features/all/igb/0084-drivers-net-use-DEFINE_PCI_DEVICE_TABLE.patch
++ features/all/igb/0085-igb-add-support-for-device-reset-interrupt.patch
++ features/all/igb/0086-e1000-e1000e-igb-igbvf-ixgb-ixgbe-Fix-tests-of-unsig.patch
++ features/all/igb/0087-igb-igbvf-cleanup-exception-handling-in-tx_map_adv.patch
++ features/all/igb/0088-net-Fix-IPv6-GSO-type-checks-in-Intel-ethernet-drive.patch
++ features/all/igb/0089-igbvf-fix-issue-w-mapped_as_page-being-left-set-afte.patch
++ features/all/igb/0090-igb-make-certain-to-reassign-legacy-interrupt-vector.patch
++ features/all/igb/0091-tree-wide-Assorted-spelling-fixes.patch
++ features/all/igb/0092-net-use-netdev_mc_count-and-netdev_mc_empty-when-app.patch
++ features/all/igb/0093-igb-remove-unecessary-q_vector-declarations-and-remo.patch
++ features/all/igb/0094-igb-add-support-for-wake-on-link.patch
++ features/all/igb/0095-igb-Report-link-status-in-ethtool-when-interface-is-.patch
++ features/all/igb/0096-igb-ignore-EEPROM-APME-check-when-shutting-down-serd.patch
++ features/all/igb/0097-igb-Power-down-link-when-interface-is-down.patch
++ features/all/igb/0098-igb-call-pci_save_state-after-pci_restore_state.patch
++ features/all/igb/0099-igb-Allocate-rings-seperately-instead-of-as-a-block.patch
++ features/all/igb/0100-igb-remove-adaptive-IFS-from-driver.patch
++ features/all/igb/0101-igb-cap-interrupts-at-20K-per-queue-when-in-itr-mode.patch
++ features/all/igb/0102-igb-only-support-SRRCTL_DROP_EN-when-using-multiple-.patch
++ features/all/igb/0103-igb-only-read-phy-specific-stats-if-in-internal-phy-.patch
++ features/all/igb/0104-igb-inline-igb_maybe_stop_tx.patch
++ features/all/igb/0105-igb-move-gso_segs-into-buffer_info-structure.patch
++ features/all/igb/0106-igb-minor-type-cleanups.patch
++ features/all/igb/0107-igb-remove-unused-vmolr-value.patch
++ features/all/igb/0108-igb-use-igb_free_q_vectors-to-cleanup-failure-in-igb.patch
++ features/all/igb/0109-igb-change-descriptor-control-thresholds.patch
++ features/all/igb/0110-igb-update-tx-DMA-mapping-error-handling.patch
++ features/all/igb/0111-net-convert-multiple-drivers-to-use-netdev_for_each_.patch
++ features/all/igb/0112-igb-Add-support-for-82576-ET2-Quad-Port-Server-Adapt.patch
++ features/all/igb/0113-igb-Do-not-overwrite-mdicnfg-register-when-accessing.patch
++ features/all/igb/0114-igb-cleanup-usage-of-virtualization-registers.patch
++ features/all/igb/0115-igb-add-support-for-Intel-I350-Gigabit-Network-Conne.patch
++ features/all/igb/0116-igb-count-Rx-FIFO-errors-correctly.patch
++ features/all/igb/0117-igb-do-not-modify-tx_queue_len-on-link-speed-change.patch
++ features/all/igb/0118-igbvf-do-not-modify-tx_queue_len-on-link-speed-chang.patch
++ features/all/igb/0119-igb-use-correct-bits-to-identify-if-managability-is-.patch
++ features/all/igb/0120-include-cleanup-Update-gfp.h-and-slab.h-includes-to-.patch
++ features/all/igb/0121-igb-update-hw_debug-macro-to-make-use-of-netdev_dbg-.patch
++ features/all/igb/0122-igb-add-per-packet-timestamping.patch
++ features/all/igb/0123-igb-modify-register-test-for-i350-to-reflect-read-on.patch
++ features/all/igb/0124-igb-restrict-WoL-for-82576-ET2-Quad-Port-Server-Adap.patch
++ features/all/igb/0125-igb-double-increment-nr_frags.patch
++ features/all/igb/0126-igbvf-double-increment-nr_frags.patch
++ features/all/igb/0127-igb-add-support-for-reporting-5GT-s-during-probe-on-.patch
++ features/all/igb/0128-igb-convert-igb-from-using-PCI-DMA-functions-to-usin.patch
++ features/all/igb/0129-igbvf-use-DMA-API-instead-of-PCI-DMA-functions.patch
++ features/all/igb/0130-igb-add-registers-etc.-printout-code-just-before-res.patch
++ features/all/igb/0131-igb-Clean-up-left-over-prototype-of-igb_get_hw_dev_n.patch
++ features/all/igb/0132-igb-reduce-cache-misses-on-tx-cleanup.patch
++ features/all/igb/0133-drivers-net-Remove-unnecessary-returns-from-void-fun.patch
++ features/all/igb/0134-igb-fix-PHY-config-access-on-82580.patch
++ features/all/igb/0135-igb-Use-only-a-single-Tx-queue-in-SR-IOV-mode.patch
++ features/all/igb/0136-igb-Fix-Tx-hangs-seen-when-loading-igb-with-max_vfs-.patch
++ features/all/igb/0137-igb-correct-link-test-not-being-run-when-link-is-dow.patch
++ features/all/igb/0138-igb-Add-comment.patch
++ features/all/igb/0139-igb-drop-support-for-UDP-hashing-w-RSS.patch
++ features/all/igb/0140-ixgbe-igb-catch-invalid-VF-settings.patch
++ features/all/igb/0141-igb-add-support-for-SGMII-based-MDIO-PHYs.patch
++ features/all/igb/0142-igb-restore-EEPROM-values-of-MDICNFG-on-reset-with-8.patch
++ features/all/igb/0143-igbvf-ixgbevf-use-dev_hw_addr_random.patch
++ features/all/igb/0144-igb-Use-irq_synchronize-per-vector-when-using-MSI-X.patch
++ features/all/igb/0145-igb-Program-MDICNFG-register-prior-to-PHY-init.patch
++ features/all/igb/0146-e100-e1000-igb-ixgb-Add-missing-read-memory-barrier.patch
++ features/all/igb/0147-Fix-spelling-fuction-function-in-comments.patch
++ features/all/igb/0148-drivers-net-Remove-address-use-from-assignments-of-f.patch
++ features/all/igb/0149-igb-clear-VF_PROMISC-bits-instead-of-setting-all-oth.patch
++ features/all/igb/0150-igb-Add-support-for-DH89xxCC.patch
++ features/all/igb/0151-e1000-e1000e-igb-ixgb-ixgbe-set-NETIF_F_HIGHDMA-for-.patch
++ features/all/igb/0152-drivers-net-return-operator-cleanup.patch
++ features/all/igb/0153-igb-add-check-for-fiber-serdes-devices-to-igb_set_sp.patch
++ features/all/igb/0154-igbvf-Remove-unneeded-pm_qos-calls.patch
++ features/all/igb/0155-igbvf-fix-panic-on-load.patch
++ features/all/igb/0156-igbvf-Update-version-and-Copyright.patch
++ features/all/igb/0157-igbvf-Remove-some-dead-code-in-igbvf.patch
++ features/all/igb/0158-Intel-Wired-LAN-drivers-Use-static-const.patch
++ features/all/igb/0159-igb-Add-new-function-to-read-part-number-from-EEPROM.patch
++ features/all/igb/0160-igb-Some-fine-tuning.patch
++ features/all/igb/0161-igb-Add-Anti-spoofing-feature-support.patch
++ features/all/igb/0162-igbvf-force-link-checking-when-mailbox-timeout-has-o.patch
++ features/all/igb/0163-igbvf-add-support-for-i350-VF-device.patch
++ features/all/igb/0164-igb-fix-sparse-warning.patch
++ features/all/igb/0165-Revert-r8169-Fix-up-backport-of-r8169-keep-firmware-.patch
+- bugfix/all/r8169-keep-firmware-in-memory.patch
+- features/all/r8169-remove-the-firmware-of-RTL8111D-2.patch
++ features/all/r8169/0001-net-Use-netdev_alloc_skb_ip_align.patch
++ features/all/r8169/0002-r8169-move-PHY-regs-tables-to-.rodata.patch
++ features/all/r8169/0003-drivers-net-Move-and-to-end-of-previous-line.patch
++ features/all/r8169/0004-const-constify-remaining-dev_pm_ops.patch
++ features/all/r8169/0005-drivers-net-r8169.c-use-pM-to-shown-MAC-address.patch
++ features/all/r8169/0006-drivers-net-use-DEFINE_PCI_DEVICE_TABLE.patch
++ features/all/r8169/0007-net-use-netdev_mc_count-and-netdev_mc_empty-when-app.patch
++ features/all/r8169/0008-drivers-net-r8196.c-Use-netif_printk-macros.patch
++ features/all/r8169/0009-net-convert-multiple-drivers-to-use-netdev_for_each_.patch
++ features/all/r8169/0010-r8169-PCI-PM-Add-simplified-runtime-PM-support-rev.-.patch
++ features/all/r8169/0011-r8169-Fix-rtl8169_rx_interrupt.patch
++ features/all/r8169/0012-r8169-failure-to-enable-mwi-should-not-be-fatal.patch
++ features/all/r8169/0013-r8169-remove-unnecessary-cast-of-readl-s-return-valu.patch
++ features/all/r8169/0014-r8169-incorrect-identifier-for-a-8168dp.patch
++ features/all/r8169/0015-r8169-fix-rx-checksum-offload.patch
++ features/all/r8169/0016-r8169-add-gro-support.patch
++ features/all/r8169/0017-r8169-use-device-model-DMA-API.patch
++ features/all/r8169/0018-r8169-use-50-less-ram-for-RX-ring.patch
++ features/all/r8169/0019-r8169-check-dma-mapping-failures.patch
++ features/all/r8169/0020-r8169-init-rx-ring-cleanup.patch
++ features/all/r8169/0021-r8169-replace-PCI_DMA_-TO-FROM-DEVICE-to-DMA_-TO-FRO.patch
++ features/all/r8169/0022-r8169-use-pointer-to-struct-device-as-local-variable.patch
++ features/all/r8169/0023-r8169-do-not-account-fragments-as-packets.patch
++ features/all/r8169/0024-r8169-changing-mtu-clean-up.patch
++ features/all/r8169/0025-r8169-re-init-phy-on-resume.patch
++ features/all/r8169/0026-r8169-print-errors-when-dma-mapping-fail.patch
++ features/all/r8169/0027-r8169-fix-sleeping-while-holding-spinlock.patch
++ features/all/r8169/0028-r8169-fix-checksum-broken.patch
++ features/all/r8169/0029-r8169-Fix-runtime-power-management.patch
++ features/all/r8169/0030-drivers-net-.c-Use-static-const.patch
++ features/all/r8169/0031-r8169-remove-the-firmware-of-RTL8111D.patch
++ features/all/r8169/0032-r8169-identify-different-registers.patch
++ features/all/r8169/0033-r8169-use-device-dependent-methods-to-access-the-MII.patch
++ features/all/r8169/0034-r8169-8168DP-specific-MII-registers-access-methods.patch
++ features/all/r8169/0035-r8169-phy-power-ops.patch
++ features/all/r8169/0036-r8169-magic.patch
++ features/all/r8169/0037-r8169-rtl_csi_access_enable-rename.patch
++ features/all/r8169/0038-r8169-more-8168dp-support.patch
++ features/all/r8169/0039-r8169-delay-phy-init-until-device-opens.patch
++ features/all/r8169/0040-net-r8169-Update-the-function-of-parsing-firmware.patch
++ features/all/r8169/0041-r8169-keep-firmware-in-memory.patch
++ features/all/r8169/0042-r8169-RxFIFO-overflow-oddities-with-8168-chipsets.patch
++ features/all/r8169/0043-r8169-prevent-RxFIFO-induced-loops-in-the-irq-handle.patch
++ features/all/r8169/0044-drivers-net-Call-netif_carrier_off-at-the-end-of-the.patch
++ features/all/r8169/0045-r8169-fix-incorrect-args-to-oob-notify.patch
++ features/all/r8169/0046-r8169-correct-settings-of-rtl8102e.patch
++ features/all/r8169/0047-r8169-fix-RTL8168DP-power-off-issue.patch
++ features/all/tg3/0001-Revert-tg3-Fix-5906-transmit-hangs.patch
++ features/all/tg3/0002-tg3-Assign-flags-to-fixes-in-start_xmit_dma_bug.patch
++ features/all/tg3/0003-tg3-Fix-5906-transmit-hangs.patch
++ features/all/tg3/0004-tg3-Fix-disappearing-57780-devices.patch
++ features/all/tg3/0005-tg3-Convert-PHY_ADDR-TG3_PHY_MII_ADDR.patch
++ features/all/tg3/0006-tg3-Prevent-a-PCIe-tx-glitch.patch
++ features/all/tg3/0007-tg3-Add-more-PCI-DMA-map-error-checking.patch
++ features/all/tg3/0008-tg3-Improve-5785-PCIe-performance.patch
++ features/all/tg3/0009-tg3-Add-AC131-power-down-support.patch
++ features/all/tg3/0010-tg3-5785-Set-port-mode-to-MII-when-link-down.patch
++ features/all/tg3/0011-tg3-Extend-loopback-test-timeout.patch
++ features/all/tg3/0012-broadcom-Isolate-phy-dsp-accesses.patch
++ features/all/tg3/0013-broadcom-Fix-slow-link-problem.patch
++ features/all/tg3/0014-tg3-Add-50610M-phy-ID-for-5785.patch
++ features/all/tg3/0015-broadcom-Consolidate-dev_flags-definitions.patch
++ features/all/tg3/0016-tg3-broadcom-Add-PHY_BRCM_CLEAR_RGMII_MODE-flag.patch
++ features/all/tg3/0017-tg3-broadcom-Refine-AC131-APD-support.patch
++ features/all/tg3/0018-tg3-broadcom-Add-code-to-disable-rxc-refclk.patch
++ features/all/tg3/0019-tg3-broadcom-Add-APD-support-for-GPHYs.patch
++ features/all/tg3/0020-tg3-broadcom-Optionally-disable-TXC-if-no-link.patch
++ features/all/tg3/0021-tg3-Update-version-to-3.103.patch
++ features/all/tg3/0022-tg3-Add-5717-phy-ID.patch
++ features/all/tg3/0023-tg3-Don-t-touch-RCB-nic-addresses.patch
++ features/all/tg3/0024-tg3-Napify-tg3_start_xmit_dma_bug.patch
++ features/all/tg3/0025-tg3-Move-TG3_FLG2_PROTECTED_NVRAM-to-tg3_flags3.patch
++ features/all/tg3/0026-tg3-Refine-TSO-and-MSI-discovery.patch
++ features/all/tg3/0027-tg3-Add-new-HW_TSO_3-flag-for-5717.patch
++ features/all/tg3/0028-tg3-Use-tg3_start_xmit_dma_bug-for-5717-A0.patch
++ features/all/tg3/0029-tg3-Allow-DMAs-to-cross-cacheline-boundaries.patch
++ features/all/tg3/0030-tg3-Create-tg3_poll_msix-for-non-zero-MSIX-vecs.patch
++ features/all/tg3/0031-tg3-Move-napi_add-calls-below-tg3_get_invariants.patch
++ features/all/tg3/0032-tg3-Make-tg3_alloc_rx_skb-a-dst-only-operation.patch
++ features/all/tg3/0033-tg3-Add-prodring-parameter-to-tg3_alloc_rx_skb.patch
++ features/all/tg3/0034-tg3-tg3_alloc_rx_skb-tnapi-tp.patch
++ features/all/tg3/0035-tg3-rename-rx_-std-jmb-_ptr.patch
++ features/all/tg3/0036-tg3-Consider-rx_std_prod_idx-a-hw-mailbox.patch
++ features/all/tg3/0037-tg3-Lay-proucer-ring-handling-groundwork.patch
++ features/all/tg3/0038-tg3-Create-aliases-for-rx-producer-mailbox-regs.patch
++ features/all/tg3/0039-tg3-Add-rx-prod-ring-consolidation.patch
++ features/all/tg3/0040-tg3-Fix-DIDs-Enable-5717-support.patch
++ features/all/tg3/0041-tg3-Update-version-to-3.104.patch
++ features/all/tg3/0042-tg3-remove-use-of-skb_dma_map-unmap.patch
++ features/all/tg3/0043-drivers-net-Move-and-to-end-of-previous-line.patch
++ features/all/tg3/0044-tg3-Make-TSS-enable-independent-of-MSI-X-enable.patch
++ features/all/tg3/0045-tg3-Add-57765-asic-rev.patch
++ features/all/tg3/0046-tg3-Add-some-VPD-preprocessor-constants.patch
++ features/all/tg3/0047-tg3-Use-pci_read_vpd-instead-of-private-method.patch
++ features/all/tg3/0048-tg3-Clean-tg3_init_one.patch
++ features/all/tg3/0049-tg3-Update-version-to-3.105.patch
++ features/all/tg3/0050-broadcom-bcm54xx_shadow_read-errors-ignored-in-bcm54.patch
++ features/all/tg3/0051-broadcom-Fix-confusion-in-bcm54xx_adjust_rxrefclk.patch
++ features/all/tg3/0052-drivers-net-use-DEFINE_PCI_DEVICE_TABLE.patch
++ features/all/tg3/0053-tg3-Fix-std-prod-ring-nicaddr-for-5787-and-57765.patch
++ features/all/tg3/0054-tg3-Fix-std-rx-prod-ring-handling.patch
++ features/all/tg3/0055-tg3-Add-reliable-serdes-detection-for-5717-A0.patch
++ features/all/tg3/0056-tg3-Disable-5717-serdes-and-B0-support.patch
++ features/all/tg3/0057-tg3-Update-copyright-and-driver-version.patch
++ features/all/tg3/0058-tg3-Enable-PLL-PD-when-CLKREQ-disabled-for-5717A0.patch
++ features/all/tg3/0059-tg3-Improve-internal-resource-allocations.patch
++ features/all/tg3/0060-tg3-Add-5717-serdes-phy-ID.patch
++ features/all/tg3/0061-tg3-Abort-phy-init-for-5717-serdes-devices.patch
++ features/all/tg3/0062-tg3-Fix-5717-and-57765-memory-selftests.patch
++ features/all/tg3/0063-tg3-Supply-a-nicaddr-for-57765-jumbo-RCB.patch
++ features/all/tg3/0064-tg3-Fix-tx-mailbox-initialization.patch
++ features/all/tg3/0065-tg3-Turn-off-the-debug-UART-for-57765.patch
++ features/all/tg3/0066-tg3-Bypass-power-source-switching-for-57765.patch
++ features/all/tg3/0067-tg3-Add-57765-phy-ID-and-enable-devices.patch
++ features/all/tg3/0068-net-use-netdev_mc_count-and-netdev_mc_empty-when-app.patch
++ features/all/tg3/0069-tg3-Give-MSI-X-vec-1-rx-backlog-space.patch
++ features/all/tg3/0070-tg3-Prevent-rx-producer-ring-overruns.patch
++ features/all/tg3/0071-tg3-Unwedge-stuck-MSI-X-vectors.patch
++ features/all/tg3/0072-tg3-Fix-57765-A0-bootcode-race-condition.patch
++ features/all/tg3/0073-tg3-Turn-off-multiple-DMA-reads-for-5717.patch
++ features/all/tg3/0074-tg3-Reset-phy-during-bringup-when-using-phylib.patch
++ features/all/tg3/0075-tg3-Fix-napi-assignments-in-loopback-test.patch
++ features/all/tg3/0076-tg3-Fix-AC131-loopback-test-errors-for-5785.patch
++ features/all/tg3/0077-tg3-Update-driver-version-to-3.107.patch
++ features/all/tg3/0078-tg3-Enforce-DMA-mapping-skb-assignment-ordering.patch
++ features/all/tg3/0079-tg3-Make-57791-and-57795-10-100-only.patch
++ features/all/tg3/0080-tg3-Add-support-for-2-new-selfboot-formats.patch
++ features/all/tg3/0081-tg3-Allow-phylib-flowctrl-changes-anytime.patch
++ features/all/tg3/0082-tg3-Add-more-partno-entries-for-fallback-path.patch
++ features/all/tg3/0083-tg3-Rename-TG3_FLG3_RGMII_STD_IBND_DISABLE.patch
++ features/all/tg3/0084-tg3-Reduce-indent-level-of-tg3_rx_prodring_alloc.patch
++ features/all/tg3/0085-tg3-Discover-phy-address-once.patch
++ features/all/tg3/0086-tg3-Reformat-SSID-to-phy-ID-table.patch
++ features/all/tg3/0087-tg3-Rename-tg3-phy-ID-preprocessor-definitions.patch
++ features/all/tg3/0088-tg3-Push-phylib-definitions-to-phylib.patch
++ features/all/tg3/0089-tg3-Update-version-to-3.108.patch
++ features/all/tg3/0090-drivers-net-tg3.c-Use-pr-netdev-_-level-macro-helper.patch
++ features/all/tg3/0091-net-convert-multiple-drivers-to-use-netdev_for_each_.patch
++ features/all/tg3/0092-pci-Add-PCI-LRDT-tag-size-and-section-size.patch
++ features/all/tg3/0093-pci-Add-large-and-small-resource-data-type-code.patch
++ features/all/tg3/0094-pci-Add-helper-to-find-a-VPD-resource-data-type.patch
++ features/all/tg3/0095-pci-Add-VPD-information-field-helper-functions.patch
++ features/all/tg3/0096-pci-Add-helper-to-search-for-VPD-keywords.patch
++ features/all/tg3/0097-tg3-Remove-now-useless-VPD-code.patch
++ features/all/tg3/0098-drivers-net-tg3.c-change-the-field-used-with-the-TG3.patch
++ features/all/tg3/0099-tg3-Fix-MII_TG3_DSP_EXP8-offset.patch
++ features/all/tg3/0100-tg3-Restore-likely-check-in-tg3_poll_msix.patch
++ features/all/tg3/0101-tg3-Replace-pr_err-with-sensible-alternatives.patch
++ features/all/tg3/0102-tg3-netdev_err-dev_err.patch
++ features/all/tg3/0103-tg3-Fix-message-80-char-violations.patch
++ features/all/tg3/0104-tg3-Prepare-FW-version-code-for-VPD-versioning.patch
++ features/all/tg3/0105-tg3-Use-VPD-fw-version-when-present.patch
++ features/all/tg3/0106-tg3-Whitespace-constant-and-comment-updates.patch
++ features/all/tg3/0107-tg3-The-case-of-switches.patch
++ features/all/tg3/0108-tg3-Cleanup-if-codestyle.patch
++ features/all/tg3/0109-tg3-Remove-tg3_dump_state.patch
++ features/all/tg3/0110-tg3-Update-version-to-3.109.patch
++ features/all/tg3/0111-tg3-Disable-CLKREQ-in-L2.patch
++ features/all/tg3/0112-tg3-Set-card-57765-card-reader-MRRS-to-1024B.patch
++ features/all/tg3/0113-tg3-Reduce-57765-core-clock-when-link-at-10Mbps.patch
++ features/all/tg3/0114-tg3-Optimize-rx-double-copy-test.patch
++ features/all/tg3/0115-tg3-Re-inline-VLAN-tags-when-appropriate.patch
++ features/all/tg3/0116-tg3-Unify-max-pkt-size-preprocessor-constants.patch
++ features/all/tg3/0117-tg3-Remove-function-errors-flagged-by-checkpatch.patch
++ features/all/tg3/0118-tg3-Update-version-to-3.110.patch
++ features/all/tg3/0119-tg3-use-the-DMA-state-API-instead-of-the-pci-equival.patch
++ features/all/tg3/0120-tg3-Enable-GRO-by-default.patch
++ features/all/tg3/0121-tg3-Relocate-APE-mutex-regs-for-5717.patch
++ features/all/tg3/0122-tg3-Avoid-tx-lockups-on-5755-devices.patch
++ features/all/tg3/0123-tg3-Fix-a-memory-leak-on-5717-devices.patch
++ features/all/tg3/0124-tg3-Allow-single-MSI-X-vector-allocations.patch
++ features/all/tg3/0125-tg3-5717-Allow-serdes-link-via-parallel-detect.patch
++ features/all/tg3/0126-tg3-Use-devfn-to-determine-function-number.patch
++ features/all/tg3/0127-tg3-Add-5719-ASIC-rev.patch
++ features/all/tg3/0128-tg3-Add-5719-PCI-device-and-phy-IDs.patch
++ features/all/tg3/0129-tg3-Update-version-to-3.111.patch
++ features/all/tg3/0130-broadcom-move-all-PHY_ID-s-to-header.patch
++ features/all/tg3/0131-broadcom-Add-5241-support.patch
++ features/all/tg3/0132-tg3-allow-TSO-on-vlan-devices.patch
++ features/all/tg3/0133-tg3-Fix-single-MSI-X-vector-coalescing.patch
++ features/all/tg3/0134-tg3-Fix-IPv6-TSO-code-in-tg3_start_xmit_dma_bug.patch
++ features/all/tg3/0135-tg3-Relax-5717-serdes-restriction.patch
++ features/all/tg3/0136-tg3-Report-driver-version-to-firmware.patch
++ features/all/tg3/0137-tg3-Revert-PCIe-tx-glitch-fix.patch
++ features/all/tg3/0138-tg3-Fix-some-checkpatch-errors.patch
++ features/all/tg3/0139-tg3-Update-version-to-3.112.patch
++ features/all/tg3/0140-tg3-Add-5784-ASIC-rev-to-earlier-PCIe-MPS-fix.patch
++ features/all/tg3/0141-tg3-Disable-TSS-also-during-tg3_close.patch
++ features/all/tg3/0142-tg3-Create-TG3_FLG3_5717_PLUS-flag.patch
++ features/all/tg3/0143-tg3-Don-t-access-phy-test-ctrl-reg-for-5717.patch
++ features/all/tg3/0144-tg3-Manage-gphy-power-for-CPMU-less-devs-only.patch
++ features/all/tg3/0145-tg3-Restrict-ASPM-workaround-devlist.patch
++ features/all/tg3/0146-tg3-Detect-APE-firmware-types.patch
++ features/all/tg3/0147-tg3-Remove-5720-5750-and-5750M.patch
++ features/all/tg3/0148-tg3-Improve-small-packet-performance.patch
++ features/all/tg3/0149-tg3-Add-error-reporting-to-tg3_phydsp_write.patch
++ features/all/tg3/0150-tg3-Add-phy-related-preprocessor-constants.patch
++ features/all/tg3/0151-tg3-Create-phy_flags-and-migrate-phy_is_low_power.patch
++ features/all/tg3/0152-tg3-Migrate-tg3_flags-to-phy_flags.patch
++ features/all/tg3/0153-tg3-Update-version-to-3.113.patch
++ features/all/tg3/0154-tg3-Fix-read-DMA-FIFO-overruns-on-recent-devices.patch
++ features/all/tg3/0155-tg3-Disable-TSS.patch
++ features/all/tg3/0156-tg3-Don-t-send-APE-events-for-NCSI-firmware.patch
++ features/all/tg3/0157-tg3-Unlock-5717-B0-support.patch
++ features/all/tg3/0158-tg3-Clarify-semantics-of-TG3_IRQ_MAX_VECS.patch
++ features/all/tg3/0159-tg3-Move-producer-ring-struct-to-tg3_napi.patch
++ features/all/tg3/0160-tg3-Use-skb_is_gso_v6.patch
++ features/all/tg3/0161-tg3-Dynamically-allocate-VPD-data-memory.patch
++ features/all/tg3/0162-tg3-phy-tmp-variable-roundup.patch
++ features/all/tg3/0163-drivers-net-return-operator-cleanup.patch
++ features/all/tg3/0164-tg3-Fix-potential-netpoll-crash.patch
++ features/all/tg3/0165-tg3-5719-Prevent-tx-data-corruption.patch
++ features/all/tg3/0166-tg3-Remove-5724-device-ID.patch
++ features/all/tg3/0167-tg3-Cleanup-missing-VPD-partno-section.patch
++ features/all/tg3/0168-tg3-Futureproof-the-loopback-test.patch
++ features/all/tg3/0169-tg3-Prepare-for-larger-rx-ring-sizes.patch
++ features/all/tg3/0170-tg3-Add-extend-rx-ring-sizes-for-5717-and-5719.patch
++ features/all/tg3/0171-tg3-Update-version-to-3.114.patch
++ features/all/tg3/0172-net-tg3-simplify-conditional.patch
++ features/all/tg3/0173-tg3-Add-support-for-selfboot-format-1-v6.patch
++ features/all/tg3/0174-tg3-Disable-unused-transmit-rings.patch
++ features/all/tg3/0175-tg3-Add-clause-45-register-accessor-methods.patch
++ features/all/tg3/0176-tg3-Add-EEE-support.patch
++ features/all/tg3/0177-tg3-Cleanup-tg3_alloc_rx_skb.patch
++ features/all/tg3/0178-tg3-Don-t-allocate-jumbo-ring-for-5780-class-devs.patch
++ features/all/tg3/0179-tg3-Report-invalid-link-from-tg3_get_settings.patch
++ features/all/tg3/0180-tg3-Update-version-to-3.115.patch
++ features/all/tg3/0181-tg3-Do-not-call-device_set_wakeup_enable-under-spin_.patch
++ features/all/tg3/0182-tg3-Apply-10Mbps-fix-to-all-57765-revisions.patch
++ features/all/tg3/0183-tg3-Assign-correct-tx-margin-for-5719.patch
++ features/all/tg3/0184-tg3-Always-turn-on-APE-features-in-mac_mode-reg.patch
++ features/all/tg3/0185-tg3-Fix-5719-internal-FIFO-overflow-problem.patch
++ features/all/tg3/0186-tg3-Reorg-tg3_napi-members.patch
++ features/all/tg3/0187-tg3-Enable-mult-rd-DMA-engine-on-5719.patch
++ features/all/tg3/0188-tg3-Reenable-TSS-for-5719.patch
++ features/all/tg3/0189-tg3-use-dma_alloc_coherent-instead-of-pci_alloc_cons.patch
++ features/all/tg3/0190-tg3-Enable-phy-APD-for-5717-and-later-asic-revs.patch
++ features/all/tg3/0191-tg3-Remove-tg3_config_info-definition.patch
++ features/all/tg3/0192-tg3-Raise-the-jumbo-frame-BD-flag-threshold.patch
++ features/all/tg3/0193-tg3-Move-EEE-definitions-into-mdio.h.patch
++ features/all/tg3/0194-tg3-Fix-57765-EEE-support.patch
++ features/all/tg3/0195-tg3-Minor-EEE-code-tweaks.patch
++ features/all/tg3/0196-tg3-Relax-EEE-thresholds.patch
++ features/all/tg3/0197-tg3-Update-version-to-3.116.patch
++ features/all/tg3/0198-tg3-Use-DEFINE_PCI_DEVICE_TABLE.patch
++ features/all/tg3/0199-tg3-Do-not-use-legacy-PCI-power-management.patch
++ features/all/tg3/0200-tg3-fix-return-value-check-in-tg3_read_vpd.patch
++ features/all/tg3/0201-tg3-fix-warnings.patch
++ features/all/tg3/0202-tg3-Restrict-phy-ioctl-access.patch
++ features/all/tg3/0203-tg3-Fix-loopback-tests.patch
++ features/all/tg3/0204-tg3-Disable-MAC-loopback-test-for-CPMU-devices.patch
++ features/all/tg3/0205-tg3-Fix-NVRAM-selftest.patch
++ features/all/tg3/0206-tg3-Only-allow-phy-ioctls-while-netif_running.patch
++ features/all/tg3/0207-tg3-Set-tx-bug-flags-for-more-devices.patch
More information about the Kernel-svn-changes
mailing list