[kernel] r16222 - in dists/sid/linux-2.6/debian: . config patches/features/all/sky2 patches/series

Ben Hutchings benh at alioth.debian.org
Sun Aug 29 21:57:37 UTC 2010


Author: benh
Date: Sun Aug 29 21:57:32 2010
New Revision: 16222

Log:
sky2: Apply fixes and new hardware support from 2.6.33-2.6.35 (Closes: #571526)

Added:
   dists/sid/linux-2.6/debian/patches/features/all/sky2/
   dists/sid/linux-2.6/debian/patches/features/all/sky2/0002-sky2-add-SK-9E21M-device-id.patch
   dists/sid/linux-2.6/debian/patches/features/all/sky2/0003-sky2-add-register-definitions-for-new-chips.patch
   dists/sid/linux-2.6/debian/patches/features/all/sky2/0004-sky2-fix-receive-pause-thresholds.patch
   dists/sid/linux-2.6/debian/patches/features/all/sky2/0005-sky2-workarounds-for-Yukon-2-supreme.patch
   dists/sid/linux-2.6/debian/patches/features/all/sky2/0006-sky2-88E8059-support.patch
   dists/sid/linux-2.6/debian/patches/features/all/sky2/0007-sky2-version-1.26.patch
   dists/sid/linux-2.6/debian/patches/features/all/sky2/0009-sky2-fix-sky2_link_down-copy-paste-comment-error.patch
   dists/sid/linux-2.6/debian/patches/features/all/sky2/0010-net-Fix-Yukon-2-Optima-TCP-offload-setup.patch
   dists/sid/linux-2.6/debian/patches/features/all/sky2/0011-net-Add-missing-TST_CFG_WRITE-bits-around-sky2_pci_w.patch
   dists/sid/linux-2.6/debian/patches/features/all/sky2/0012-sky2-print-Optima-chip-name.patch
   dists/sid/linux-2.6/debian/patches/features/all/sky2/0013-sky2-leave-PCI-config-space-writeable.patch
   dists/sid/linux-2.6/debian/patches/features/all/sky2/0015-sky2-Refactor-sky2_get_regs-into-two-functions.patch
   dists/sid/linux-2.6/debian/patches/features/all/sky2/0016-sky2-Lock-transmit-queue-while-disabling-device.patch
   dists/sid/linux-2.6/debian/patches/features/all/sky2/0018-sky2-Enable-disable-WOL-per-hardware-device.patch
   dists/sid/linux-2.6/debian/patches/features/all/sky2/0019-sky2-revert-config-space-change.patch
   dists/sid/linux-2.6/debian/patches/features/all/sky2/0020-sky2-Fix-TX_MAP_PAGE-misspelling.patch
   dists/sid/linux-2.6/debian/patches/features/all/sky2/0022-sky2-hand-receive-DMA-mapping-failures.patch
   dists/sid/linux-2.6/debian/patches/features/all/sky2/0023-sky2-Flow-control-frames-recorded-as-dropped-packets.patch
   dists/sid/linux-2.6/debian/patches/features/all/sky2/0024-sky2-resume-clocks.patch
   dists/sid/linux-2.6/debian/patches/features/all/sky2/0025-sky2-disable-ASF-on-Yukon-Supreme.patch
   dists/sid/linux-2.6/debian/patches/features/all/sky2/0026-sky2-receive-checksum-refactoring.patch
   dists/sid/linux-2.6/debian/patches/features/all/sky2/0028-sky2-fix-sparse-warning.patch
   dists/sid/linux-2.6/debian/patches/features/all/sky2/0029-sky2-WoL-changes.patch
   dists/sid/linux-2.6/debian/patches/features/all/sky2/0030-sky2-dont-enable-PME-legacy-mode.patch
   dists/sid/linux-2.6/debian/patches/features/all/sky2/0031-sky2-jumbo-packet-changes.patch
   dists/sid/linux-2.6/debian/patches/features/all/sky2/0032-sky2-Factor-out-code-to-calculate-packet-sizes.patch
   dists/sid/linux-2.6/debian/patches/features/all/sky2/0033-sky2-Allocate-initial-skbs-in-sky2_alloc_buffers.patch
   dists/sid/linux-2.6/debian/patches/features/all/sky2/0034-sky2-Refactor-sky2_up-into-two-functions.patch
   dists/sid/linux-2.6/debian/patches/features/all/sky2/0035-sky2-Refactor-sky2_down-into-two-functions.patch
   dists/sid/linux-2.6/debian/patches/features/all/sky2/0036-sky2-Avoid-down-and-up-during-sky2_reset.patch
   dists/sid/linux-2.6/debian/patches/features/all/sky2/0037-sky2-version-1.27.patch
   dists/sid/linux-2.6/debian/patches/features/all/sky2/0041-sky2-Avoid-rtnl_unlock-without-rtnl_lock.patch
   dists/sid/linux-2.6/debian/patches/features/all/sky2/0043-sky2-support-Yukon-EC_U-rev-B1-and-later.patch
   dists/sid/linux-2.6/debian/patches/features/all/sky2/0044-sky2-add-XL-revisions.patch
   dists/sid/linux-2.6/debian/patches/features/all/sky2/0045-sky2-avoid-duplicate-link-up-on-Optima-chip.patch
   dists/sid/linux-2.6/debian/patches/features/all/sky2/0047-sky2-size-status-ring-based-on-Tx-Rx-ring.patch
   dists/sid/linux-2.6/debian/patches/features/all/sky2/0050-sky2-Restore-multicast-after-restart.patch
   dists/sid/linux-2.6/debian/patches/features/all/sky2/0051-sky2-Avoid-race-in-sky2_change_mtu.patch
   dists/sid/linux-2.6/debian/patches/features/all/sky2/0052-sky2-Shut-off-interrupts-before-NAPI.patch
   dists/sid/linux-2.6/debian/patches/features/all/sky2/0053-sky2-Refactor-down-up-code-out-of-sky2_restart.patch
   dists/sid/linux-2.6/debian/patches/features/all/sky2/0054-sky2-Avoid-allocating-memory-in-sky2_resume.patch
   dists/sid/linux-2.6/debian/patches/features/all/sky2/0055-sky2-version-1.28.patch
Modified:
   dists/sid/linux-2.6/debian/changelog
   dists/sid/linux-2.6/debian/config/defines
   dists/sid/linux-2.6/debian/patches/series/22

Modified: dists/sid/linux-2.6/debian/changelog
==============================================================================
--- dists/sid/linux-2.6/debian/changelog	Sun Aug 29 20:12:03 2010	(r16221)
+++ dists/sid/linux-2.6/debian/changelog	Sun Aug 29 21:57:32 2010	(r16222)
@@ -18,6 +18,8 @@
   * rt2870sta: Add more device IDs from vendor drivers
   * rt2860sta, rt2870sta: Enable channels 12-14 (Closes: #594561)
   * SCSI/mptsas: fix hangs caused by ATA pass-through (Closes: #594690)
+  * sky2: Apply fixes and new hardware support from 2.6.33-2.6.35
+    (Closes: #571526)
 
   [ Bastian Blank ]
   * Use Breaks instead of Conflicts.

Modified: dists/sid/linux-2.6/debian/config/defines
==============================================================================
--- dists/sid/linux-2.6/debian/config/defines	Sun Aug 29 20:12:03 2010	(r16221)
+++ dists/sid/linux-2.6/debian/config/defines	Sun Aug 29 21:57:32 2010	(r16222)
@@ -96,6 +96,8 @@
 drivers/staging/ramzswap/: 2.6.33
 drivers/media/dvb/mantis/: 2.6.34
 drivers/net/macvtap.c: 2.6.34
+drivers/net/sky2.c: 2.6.35
+drivers/net/sky2.h: 2.6.35
 drivers/net/usb/ipheth.c: 2.6.34
 drivers/staging/rt2860/: 2.6.34
 drivers/staging/rt2870/: 2.6.34

Added: dists/sid/linux-2.6/debian/patches/features/all/sky2/0002-sky2-add-SK-9E21M-device-id.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/sky2/0002-sky2-add-SK-9E21M-device-id.patch	Sun Aug 29 21:57:32 2010	(r16222)
@@ -0,0 +1,29 @@
+From: Stephen Hemminger <shemminger at vyatta.com>
+Date: Thu, 29 Oct 2009 06:37:05 +0000
+Subject: [PATCH 02/56] sky2: add SK-9E21M device id
+
+commit e30a4ac243b1fd2714675fd451e718d9940b1bdd upstream.
+
+This is a new ID that just showed up in latest vendor driver.
+
+Signed-off-by: Stephen Hemminger <shemminger at vyatta.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/sky2.c |    1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
+index 3a449d0..e961a86 100644
+--- a/drivers/net/sky2.c
++++ b/drivers/net/sky2.c
+@@ -102,6 +102,7 @@ MODULE_PARM_DESC(disable_msi, "Disable Message Signaled Interrupt (MSI)");
+ static DEFINE_PCI_DEVICE_TABLE(sky2_id_table) = {
+ 	{ PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9000) }, /* SK-9Sxx */
+ 	{ PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9E00) }, /* SK-9Exx */
++	{ PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9E01) }, /* SK-9E21M */
+ 	{ PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4b00) },	/* DGE-560T */
+ 	{ PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4001) }, 	/* DGE-550SX */
+ 	{ PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4B02) },	/* DGE-560SX */
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/features/all/sky2/0003-sky2-add-register-definitions-for-new-chips.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/sky2/0003-sky2-add-register-definitions-for-new-chips.patch	Sun Aug 29 21:57:32 2010	(r16222)
@@ -0,0 +1,284 @@
+From: Stephen Hemminger <shemminger at vyatta.com>
+Date: Thu, 29 Oct 2009 06:37:06 +0000
+Subject: [PATCH 03/56] sky2: add register definitions for new chips
+
+commit e91cd2e65f22a80af87367178bed4957fdc45ecd upstream.
+
+This adds infrastructure for the newer chip versions and workarounds.
+Extracted from the vendor (GPL) driver.
+
+Signed-off-by: Stephen Hemminger <shemminger at vyatta.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/sky2.h |  178 +++++++++++++++++++++++++++++++++++++++++++++++++++-
+ 1 files changed, 177 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/sky2.h b/drivers/net/sky2.h
+index ed54129..e13da94 100644
+--- a/drivers/net/sky2.h
++++ b/drivers/net/sky2.h
+@@ -16,6 +16,13 @@ enum {
+ 	PCI_DEV_REG5    = 0x88,
+ 	PCI_CFG_REG_0	= 0x90,
+ 	PCI_CFG_REG_1	= 0x94,
++
++	PSM_CONFIG_REG0  = 0x98,
++	PSM_CONFIG_REG1	 = 0x9C,
++	PSM_CONFIG_REG2  = 0x160,
++	PSM_CONFIG_REG3  = 0x164,
++	PSM_CONFIG_REG4  = 0x168,
++
+ };
+ 
+ /* Yukon-2 */
+@@ -48,6 +55,37 @@ enum pci_dev_reg_2 {
+ 	PCI_USEDATA64	= 1<<0,		/* Use 64Bit Data bus ext */
+ };
+ 
++/*	PCI_OUR_REG_3		32 bit	Our Register 3 (Yukon-ECU only) */
++enum pci_dev_reg_3 {
++	P_CLK_ASF_REGS_DIS	= 1<<18,/* Disable Clock ASF (Yukon-Ext.) */
++	P_CLK_COR_REGS_D0_DIS	= 1<<17,/* Disable Clock Core Regs D0 */
++	P_CLK_MACSEC_DIS	= 1<<17,/* Disable Clock MACSec (Yukon-Ext.) */
++	P_CLK_PCI_REGS_D0_DIS	= 1<<16,/* Disable Clock PCI  Regs D0 */
++	P_CLK_COR_YTB_ARB_DIS	= 1<<15,/* Disable Clock YTB  Arbiter */
++	P_CLK_MAC_LNK1_D3_DIS	= 1<<14,/* Disable Clock MAC  Link1 D3 */
++	P_CLK_COR_LNK1_D0_DIS	= 1<<13,/* Disable Clock Core Link1 D0 */
++	P_CLK_MAC_LNK1_D0_DIS	= 1<<12,/* Disable Clock MAC  Link1 D0 */
++	P_CLK_COR_LNK1_D3_DIS	= 1<<11,/* Disable Clock Core Link1 D3 */
++	P_CLK_PCI_MST_ARB_DIS	= 1<<10,/* Disable Clock PCI  Master Arb. */
++	P_CLK_COR_REGS_D3_DIS	= 1<<9,	/* Disable Clock Core Regs D3 */
++	P_CLK_PCI_REGS_D3_DIS	= 1<<8,	/* Disable Clock PCI  Regs D3 */
++	P_CLK_REF_LNK1_GM_DIS	= 1<<7,	/* Disable Clock Ref. Link1 GMAC */
++	P_CLK_COR_LNK1_GM_DIS	= 1<<6,	/* Disable Clock Core Link1 GMAC */
++	P_CLK_PCI_COMMON_DIS	= 1<<5,	/* Disable Clock PCI  Common */
++	P_CLK_COR_COMMON_DIS	= 1<<4,	/* Disable Clock Core Common */
++	P_CLK_PCI_LNK1_BMU_DIS	= 1<<3,	/* Disable Clock PCI  Link1 BMU */
++	P_CLK_COR_LNK1_BMU_DIS	= 1<<2,	/* Disable Clock Core Link1 BMU */
++	P_CLK_PCI_LNK1_BIU_DIS	= 1<<1,	/* Disable Clock PCI  Link1 BIU */
++	P_CLK_COR_LNK1_BIU_DIS	= 1<<0,	/* Disable Clock Core Link1 BIU */
++	PCIE_OUR3_WOL_D3_COLD_SET = P_CLK_ASF_REGS_DIS |
++				    P_CLK_COR_REGS_D0_DIS |
++				    P_CLK_COR_LNK1_D0_DIS |
++				    P_CLK_MAC_LNK1_D0_DIS |
++				    P_CLK_PCI_MST_ARB_DIS |
++				    P_CLK_COR_COMMON_DIS |
++				    P_CLK_COR_LNK1_BMU_DIS,
++};
++
+ /*	PCI_OUR_REG_4		32 bit	Our Register 4 (Yukon-ECU only) */
+ enum pci_dev_reg_4 {
+ 				/* (Link Training & Status State Machine) */
+@@ -114,7 +152,7 @@ enum pci_dev_reg_5 {
+ 				     P_GAT_PCIE_RX_EL_IDLE,
+ };
+ 
+-#/*	PCI_CFG_REG_1			32 bit	Config Register 1 (Yukon-Ext only) */
++/*	PCI_CFG_REG_1			32 bit	Config Register 1 (Yukon-Ext only) */
+ enum pci_cfg_reg1 {
+ 	P_CF1_DIS_REL_EVT_RST	= 1<<24, /* Dis. Rel. Event during PCIE reset */
+ 										/* Bit 23..21: Release Clock on Event */
+@@ -145,6 +183,72 @@ enum pci_cfg_reg1 {
+ 					P_CF1_ENA_TXBMU_WR_IDLE,
+ };
+ 
++/* Yukon-Optima */
++enum {
++	PSM_CONFIG_REG1_AC_PRESENT_STATUS = 1<<31,   /* AC Present Status */
++
++	PSM_CONFIG_REG1_PTP_CLK_SEL	  = 1<<29,   /* PTP Clock Select */
++	PSM_CONFIG_REG1_PTP_MODE	  = 1<<28,   /* PTP Mode */
++
++	PSM_CONFIG_REG1_MUX_PHY_LINK	  = 1<<27,   /* PHY Energy Detect Event */
++
++	PSM_CONFIG_REG1_EN_PIN63_AC_PRESENT = 1<<26,  /* Enable LED_DUPLEX for ac_present */
++	PSM_CONFIG_REG1_EN_PCIE_TIMER	  = 1<<25,    /* Enable PCIe Timer */
++	PSM_CONFIG_REG1_EN_SPU_TIMER	  = 1<<24,    /* Enable SPU Timer */
++	PSM_CONFIG_REG1_POLARITY_AC_PRESENT = 1<<23,  /* AC Present Polarity */
++
++	PSM_CONFIG_REG1_EN_AC_PRESENT	  = 1<<21,    /* Enable AC Present */
++
++	PSM_CONFIG_REG1_EN_GPHY_INT_PSM	= 1<<20,      /* Enable GPHY INT for PSM */
++	PSM_CONFIG_REG1_DIS_PSM_TIMER	= 1<<19,      /* Disable PSM Timer */
++};
++
++/* Yukon-Supreme */
++enum {
++	PSM_CONFIG_REG1_GPHY_ENERGY_STS	= 1<<31, /* GPHY Energy Detect Status */
++
++	PSM_CONFIG_REG1_UART_MODE_MSK	= 3<<29, /* UART_Mode */
++	PSM_CONFIG_REG1_CLK_RUN_ASF	= 1<<28, /* Enable Clock Free Running for ASF Subsystem */
++	PSM_CONFIG_REG1_UART_CLK_DISABLE= 1<<27, /* Disable UART clock */
++	PSM_CONFIG_REG1_VAUX_ONE	= 1<<26, /* Tie internal Vaux to 1'b1 */
++	PSM_CONFIG_REG1_UART_FC_RI_VAL	= 1<<25, /* Default value for UART_RI_n */
++	PSM_CONFIG_REG1_UART_FC_DCD_VAL	= 1<<24, /* Default value for UART_DCD_n */
++	PSM_CONFIG_REG1_UART_FC_DSR_VAL	= 1<<23, /* Default value for UART_DSR_n */
++	PSM_CONFIG_REG1_UART_FC_CTS_VAL	= 1<<22, /* Default value for UART_CTS_n */
++	PSM_CONFIG_REG1_LATCH_VAUX	= 1<<21, /* Enable Latch current Vaux_avlbl */
++	PSM_CONFIG_REG1_FORCE_TESTMODE_INPUT= 1<<20, /* Force Testmode pin as input PAD */
++	PSM_CONFIG_REG1_UART_RST	= 1<<19, /* UART_RST */
++	PSM_CONFIG_REG1_PSM_PCIE_L1_POL	= 1<<18, /* PCIE L1 Event Polarity for PSM */
++	PSM_CONFIG_REG1_TIMER_STAT	= 1<<17, /* PSM Timer Status */
++	PSM_CONFIG_REG1_GPHY_INT	= 1<<16, /* GPHY INT Status */
++	PSM_CONFIG_REG1_FORCE_TESTMODE_ZERO= 1<<15, /* Force internal Testmode as 1'b0 */
++	PSM_CONFIG_REG1_EN_INT_ASPM_CLKREQ = 1<<14, /* ENABLE INT for CLKRUN on ASPM and CLKREQ */
++	PSM_CONFIG_REG1_EN_SND_TASK_ASPM_CLKREQ	= 1<<13, /* ENABLE Snd_task for CLKRUN on ASPM and CLKREQ */
++	PSM_CONFIG_REG1_DIS_CLK_GATE_SND_TASK	= 1<<12, /* Disable CLK_GATE control snd_task */
++	PSM_CONFIG_REG1_DIS_FF_CHIAN_SND_INTA	= 1<<11, /* Disable flip-flop chain for sndmsg_inta */
++
++	PSM_CONFIG_REG1_DIS_LOADER	= 1<<9, /* Disable Loader SM after PSM Goes back to IDLE */
++	PSM_CONFIG_REG1_DO_PWDN		= 1<<8, /* Do Power Down, Start PSM Scheme */
++	PSM_CONFIG_REG1_DIS_PIG		= 1<<7, /* Disable Plug-in-Go SM after PSM Goes back to IDLE */
++	PSM_CONFIG_REG1_DIS_PERST	= 1<<6, /* Disable Internal PCIe Reset after PSM Goes back to IDLE */
++	PSM_CONFIG_REG1_EN_REG18_PD	= 1<<5, /* Enable REG18 Power Down for PSM */
++	PSM_CONFIG_REG1_EN_PSM_LOAD	= 1<<4, /* Disable EEPROM Loader after PSM Goes back to IDLE */
++	PSM_CONFIG_REG1_EN_PSM_HOT_RST	= 1<<3, /* Enable PCIe Hot Reset for PSM */
++	PSM_CONFIG_REG1_EN_PSM_PERST	= 1<<2, /* Enable PCIe Reset Event for PSM */
++	PSM_CONFIG_REG1_EN_PSM_PCIE_L1	= 1<<1, /* Enable PCIe L1 Event for PSM */
++	PSM_CONFIG_REG1_EN_PSM		= 1<<0, /* Enable PSM Scheme */
++};
++
++/*	PSM_CONFIG_REG4				0x0168	PSM Config Register 4 */
++enum {
++						/* PHY Link Detect Timer */
++	PSM_CONFIG_REG4_TIMER_PHY_LINK_DETECT_MSK = 0xf<<4,
++	PSM_CONFIG_REG4_TIMER_PHY_LINK_DETECT_BASE = 4,
++
++	PSM_CONFIG_REG4_DEBUG_TIMER	    = 1<<1, /* Debug Timer */
++	PSM_CONFIG_REG4_RST_PHY_LINK_DETECT = 1<<0, /* Reset GPHY Link Detect */
++};
++
+ 
+ #define PCI_STATUS_ERROR_BITS (PCI_STATUS_DETECTED_PARITY | \
+ 			       PCI_STATUS_SIG_SYSTEM_ERROR | \
+@@ -197,6 +301,9 @@ enum csr_regs {
+ 	B2_I2C_IRQ	= 0x0168,
+ 	B2_I2C_SW	= 0x016c,
+ 
++	Y2_PEX_PHY_DATA = 0x0170,
++	Y2_PEX_PHY_ADDR = 0x0172,
++
+ 	B3_RAM_ADDR	= 0x0180,
+ 	B3_RAM_DATA_LO	= 0x0184,
+ 	B3_RAM_DATA_HI	= 0x0188,
+@@ -317,6 +424,10 @@ enum {
+ 	Y2_IS_CHK_TXS2	= 1<<9,		/* Descriptor error TXS 2 */
+ 	Y2_IS_CHK_TXA2	= 1<<8,		/* Descriptor error TXA 2 */
+ 
++	Y2_IS_PSM_ACK	= 1<<7,		/* PSM Acknowledge (Yukon-Optima only) */
++	Y2_IS_PTP_TIST	= 1<<6,		/* PTP Time Stamp (Yukon-Optima only) */
++	Y2_IS_PHY_QLNK	= 1<<5,		/* PHY Quick Link (Yukon-Optima only) */
++
+ 	Y2_IS_IRQ_PHY1	= 1<<4,		/* Interrupt from PHY 1 */
+ 	Y2_IS_IRQ_MAC1	= 1<<3,		/* Interrupt from MAC 1 */
+ 	Y2_IS_CHK_RX1	= 1<<2,		/* Descriptor error Rx 1 */
+@@ -435,6 +546,7 @@ enum {
+  	CHIP_ID_YUKON_FE_P = 0xb8, /* YUKON-2 FE+ */
+ 	CHIP_ID_YUKON_SUPR = 0xb9, /* YUKON-2 Supreme */
+ 	CHIP_ID_YUKON_UL_2 = 0xba, /* YUKON-2 Ultra 2 */
++	CHIP_ID_YUKON_OPT  = 0xbc, /* YUKON-2 Optima */
+ };
+ enum yukon_ec_rev {
+ 	CHIP_REV_YU_EC_A1    = 0,  /* Chip Rev. for Yukon-EC A1/A0 */
+@@ -459,6 +571,8 @@ enum yukon_ex_rev {
+ };
+ enum yukon_supr_rev {
+ 	CHIP_REV_YU_SU_A0    = 0,
++	CHIP_REV_YU_SU_B0    = 1,
++	CHIP_REV_YU_SU_B1    = 3,
+ };
+ 
+ 
+@@ -513,6 +627,12 @@ enum {
+ 	TIM_T_STEP	= 1<<0,	/* Test step */
+ };
+ 
++/*	Y2_PEX_PHY_ADDR/DATA		PEX PHY address and data reg  (Yukon-2 only) */
++enum {
++	PEX_RD_ACCESS	= 1<<31, /* Access Mode Read = 1, Write = 0 */
++	PEX_DB_ACCESS	= 1<<30, /* Access to debug register */
++};
++
+ /*	B3_RAM_ADDR		32 bit	RAM Address, to read or write */
+ 					/* Bit 31..19:	reserved */
+ #define RAM_ADR_RAN	0x0007ffffL	/* Bit 18.. 0:	RAM Address Range */
+@@ -754,6 +874,42 @@ enum {
+ 	BMU_TX_CLR_IRQ_TCP	= 1<<11, /* Clear IRQ on TCP segment length mismatch */
+ };
+ 
++/*	TBMU_TEST			0x06B8	Transmit BMU Test Register */
++enum {
++	TBMU_TEST_BMU_TX_CHK_AUTO_OFF		= 1<<31, /* BMU Tx Checksum Auto Calculation Disable */
++	TBMU_TEST_BMU_TX_CHK_AUTO_ON		= 1<<30, /* BMU Tx Checksum Auto Calculation Enable */
++	TBMU_TEST_HOME_ADD_PAD_FIX1_EN		= 1<<29, /* Home Address Paddiing FIX1 Enable */
++	TBMU_TEST_HOME_ADD_PAD_FIX1_DIS		= 1<<28, /* Home Address Paddiing FIX1 Disable */
++	TBMU_TEST_ROUTING_ADD_FIX_EN		= 1<<27, /* Routing Address Fix Enable */
++	TBMU_TEST_ROUTING_ADD_FIX_DIS		= 1<<26, /* Routing Address Fix Disable */
++	TBMU_TEST_HOME_ADD_FIX_EN		= 1<<25, /* Home address checksum fix enable */
++	TBMU_TEST_HOME_ADD_FIX_DIS		= 1<<24, /* Home address checksum fix disable */
++
++	TBMU_TEST_TEST_RSPTR_ON			= 1<<22, /* Testmode Shadow Read Ptr On */
++	TBMU_TEST_TEST_RSPTR_OFF		= 1<<21, /* Testmode Shadow Read Ptr Off */
++	TBMU_TEST_TESTSTEP_RSPTR		= 1<<20, /* Teststep Shadow Read Ptr */
++
++	TBMU_TEST_TEST_RPTR_ON			= 1<<18, /* Testmode Read Ptr On */
++	TBMU_TEST_TEST_RPTR_OFF			= 1<<17, /* Testmode Read Ptr Off */
++	TBMU_TEST_TESTSTEP_RPTR			= 1<<16, /* Teststep Read Ptr */
++
++	TBMU_TEST_TEST_WSPTR_ON			= 1<<14, /* Testmode Shadow Write Ptr On */
++	TBMU_TEST_TEST_WSPTR_OFF		= 1<<13, /* Testmode Shadow Write Ptr Off */
++	TBMU_TEST_TESTSTEP_WSPTR		= 1<<12, /* Teststep Shadow Write Ptr */
++
++	TBMU_TEST_TEST_WPTR_ON			= 1<<10, /* Testmode Write Ptr On */
++	TBMU_TEST_TEST_WPTR_OFF			= 1<<9, /* Testmode Write Ptr Off */
++	TBMU_TEST_TESTSTEP_WPTR			= 1<<8,			/* Teststep Write Ptr */
++
++	TBMU_TEST_TEST_REQ_NB_ON		= 1<<6, /* Testmode Req Nbytes/Addr On */
++	TBMU_TEST_TEST_REQ_NB_OFF		= 1<<5, /* Testmode Req Nbytes/Addr Off */
++	TBMU_TEST_TESTSTEP_REQ_NB		= 1<<4, /* Teststep Req Nbytes/Addr */
++
++	TBMU_TEST_TEST_DONE_IDX_ON		= 1<<2, /* Testmode Done Index On */
++	TBMU_TEST_TEST_DONE_IDX_OFF		= 1<<1, /* Testmode Done Index Off */
++	TBMU_TEST_TESTSTEP_DONE_IDX		= 1<<0,	/* Teststep Done Index */
++};
++
+ /* Queue Prefetch Unit Offsets, use Y2_QADDR() to address (Yukon-2 only)*/
+ /* PREF_UNIT_CTRL	32 bit	Prefetch Control register */
+ enum {
+@@ -1674,6 +1830,12 @@ enum {
+ 
+ /*	RX_GMF_CTRL_T	32 bit	Rx GMAC FIFO Control/Test */
+ enum {
++	RX_GCLKMAC_ENA	= 1<<31,	/* RX MAC Clock Gating Enable */
++	RX_GCLKMAC_OFF	= 1<<30,
++
++	RX_STFW_DIS	= 1<<29,	/* RX Store and Forward Enable */
++	RX_STFW_ENA	= 1<<28,
++
+ 	RX_TRUNC_ON	= 1<<27,  	/* enable  packet truncation */
+ 	RX_TRUNC_OFF	= 1<<26, 	/* disable packet truncation */
+ 	RX_VLAN_STRIP_ON = 1<<25,	/* enable  VLAN stripping */
+@@ -1711,6 +1873,20 @@ enum {
+ 	GMF_RX_CTRL_DEF	= GMF_OPER_ON | GMF_RX_F_FL_ON,
+ };
+ 
++/*	RX_GMF_FL_CTRL	16 bit	Rx GMAC FIFO Flush Control (Yukon-Supreme) */
++enum {
++	RX_IPV6_SA_MOB_ENA	= 1<<9,	/* IPv6 SA Mobility Support Enable */
++	RX_IPV6_SA_MOB_DIS	= 1<<8,	/* IPv6 SA Mobility Support Disable */
++	RX_IPV6_DA_MOB_ENA	= 1<<7,	/* IPv6 DA Mobility Support Enable */
++	RX_IPV6_DA_MOB_DIS	= 1<<6,	/* IPv6 DA Mobility Support Disable */
++	RX_PTR_SYNCDLY_ENA	= 1<<5,	/* Pointers Delay Synch Enable */
++	RX_PTR_SYNCDLY_DIS	= 1<<4,	/* Pointers Delay Synch Disable */
++	RX_ASF_NEWFLAG_ENA	= 1<<3,	/* RX ASF Flag New Logic Enable */
++	RX_ASF_NEWFLAG_DIS	= 1<<2,	/* RX ASF Flag New Logic Disable */
++	RX_FLSH_MISSPKT_ENA	= 1<<1,	/* RX Flush Miss-Packet Enable */
++	RX_FLSH_MISSPKT_DIS	= 1<<0,	/* RX Flush Miss-Packet Disable */
++};
++
+ /*	TX_GMF_EA		32 bit	Tx GMAC FIFO End Address */
+ enum {
+ 	TX_DYN_WM_ENA	= 3,	/* Yukon-FE+ specific */
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/features/all/sky2/0004-sky2-fix-receive-pause-thresholds.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/sky2/0004-sky2-fix-receive-pause-thresholds.patch	Sun Aug 29 21:57:32 2010	(r16222)
@@ -0,0 +1,59 @@
+From: Stephen Hemminger <shemminger at vyatta.com>
+Date: Thu, 29 Oct 2009 06:37:07 +0000
+Subject: [PATCH 04/56] sky2: fix receive pause thresholds
+
+commit d6b54d241c558483302616ac1d997806795513e4 upstream.
+
+Program the receive pause thresholds differently depending on
+chip version. This cloned from from the vendor (GPL) driver.
+
+Signed-off-by: Stephen Hemminger <shemminger at vyatta.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/sky2.c |   10 ++++++++--
+ drivers/net/sky2.h |    7 ++++---
+ 2 files changed, 12 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
+index e961a86..70524f2 100644
+--- a/drivers/net/sky2.c
++++ b/drivers/net/sky2.c
+@@ -926,8 +926,14 @@ static void sky2_mac_init(struct sky2_hw *hw, unsigned port)
+ 
+ 	/* On chips without ram buffer, pause is controled by MAC level */
+ 	if (!(hw->flags & SKY2_HW_RAM_BUFFER)) {
+-		sky2_write8(hw, SK_REG(port, RX_GMF_LP_THR), 768/8);
+-		sky2_write8(hw, SK_REG(port, RX_GMF_UP_THR), 1024/8);
++		/* Pause threshold is scaled by 8 in bytes */
++		if (hw->chip_id == CHIP_ID_YUKON_FE_P
++			&& hw->chip_rev == CHIP_REV_YU_FE2_A0)
++			reg = 1568 / 8;
++		else
++			reg = 1024 / 8;
++		sky2_write16(hw, SK_REG(port, RX_GMF_UP_THR), reg);
++		sky2_write16(hw, SK_REG(port, RX_GMF_LP_THR), 768 / 8);
+ 
+ 		sky2_set_tx_stfwd(hw, port);
+ 	}
+diff --git a/drivers/net/sky2.h b/drivers/net/sky2.h
+index e13da94..365d79c 100644
+--- a/drivers/net/sky2.h
++++ b/drivers/net/sky2.h
+@@ -808,10 +808,11 @@ enum {
+ 	RX_GMF_AF_THR	= 0x0c44,/* 32 bit	Rx GMAC FIFO Almost Full Thresh. */
+ 	RX_GMF_CTRL_T	= 0x0c48,/* 32 bit	Rx GMAC FIFO Control/Test */
+ 	RX_GMF_FL_MSK	= 0x0c4c,/* 32 bit	Rx GMAC FIFO Flush Mask */
+-	RX_GMF_FL_THR	= 0x0c50,/* 32 bit	Rx GMAC FIFO Flush Threshold */
++	RX_GMF_FL_THR	= 0x0c50,/* 16 bit	Rx GMAC FIFO Flush Threshold */
++	RX_GMF_FL_CTRL	= 0x0c52,/* 16 bit	Rx GMAC FIFO Flush Control */
+ 	RX_GMF_TR_THR	= 0x0c54,/* 32 bit	Rx Truncation Threshold (Yukon-2) */
+-	RX_GMF_UP_THR	= 0x0c58,/*  8 bit	Rx Upper Pause Thr (Yukon-EC_U) */
+-	RX_GMF_LP_THR	= 0x0c5a,/*  8 bit	Rx Lower Pause Thr (Yukon-EC_U) */
++	RX_GMF_UP_THR	= 0x0c58,/* 16 bit	Rx Upper Pause Thr (Yukon-EC_U) */
++	RX_GMF_LP_THR	= 0x0c5a,/* 16 bit	Rx Lower Pause Thr (Yukon-EC_U) */
+ 	RX_GMF_VLAN	= 0x0c5c,/* 32 bit	Rx VLAN Type Register (Yukon-2) */
+ 	RX_GMF_WP	= 0x0c60,/* 32 bit	Rx GMAC FIFO Write Pointer */
+ 
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/features/all/sky2/0005-sky2-workarounds-for-Yukon-2-supreme.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/sky2/0005-sky2-workarounds-for-Yukon-2-supreme.patch	Sun Aug 29 21:57:32 2010	(r16222)
@@ -0,0 +1,78 @@
+From: Stephen Hemminger <shemminger at vyatta.com>
+Date: Thu, 29 Oct 2009 06:37:08 +0000
+Subject: [PATCH 05/56] sky2: workarounds for Yukon-2 supreme
+
+commit 877c8570fb00ad0529b07f8193cc098ac0193d03 upstream.
+
+Changes related to support of Yukon supreme chip.
+Don't have this chip version to test on,
+these are reverse engineered from the vendor (GPL) driver.
+
+Signed-off-by: Stephen Hemminger <shemminger at vyatta.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/sky2.c |   34 ++++++++++++++++++++++++++++++++--
+ 1 files changed, 32 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
+index 70524f2..3387a2f 100644
+--- a/drivers/net/sky2.c
++++ b/drivers/net/sky2.c
+@@ -787,8 +787,7 @@ static void sky2_set_tx_stfwd(struct sky2_hw *hw, unsigned port)
+ 
+ 	if ( (hw->chip_id == CHIP_ID_YUKON_EX &&
+ 	      hw->chip_rev != CHIP_REV_YU_EX_A0) ||
+-	     hw->chip_id == CHIP_ID_YUKON_FE_P ||
+-	     hw->chip_id == CHIP_ID_YUKON_SUPR) {
++	     hw->chip_id >= CHIP_ID_YUKON_FE_P) {
+ 		/* Yukon-Extreme B0 and further Extreme devices */
+ 		/* enable Store & Forward mode for TX */
+ 
+@@ -1404,6 +1403,31 @@ static int sky2_rx_start(struct sky2_port *sky2)
+ 
+ 	/* Tell chip about available buffers */
+ 	sky2_rx_update(sky2, rxq);
++
++	if (hw->chip_id == CHIP_ID_YUKON_EX ||
++	    hw->chip_id == CHIP_ID_YUKON_SUPR) {
++		/*
++		 * Disable flushing of non ASF packets;
++		 * must be done after initializing the BMUs;
++		 * drivers without ASF support should do this too, otherwise
++		 * it may happen that they cannot run on ASF devices;
++		 * remember that the MAC FIFO isn't reset during initialization.
++		 */
++		sky2_write32(hw, SK_REG(sky2->port, RX_GMF_CTRL_T), RX_MACSEC_FLUSH_OFF);
++	}
++
++	if (hw->chip_id >= CHIP_ID_YUKON_SUPR) {
++		/* Enable RX Home Address & Routing Header checksum fix */
++		sky2_write16(hw, SK_REG(sky2->port, RX_GMF_FL_CTRL),
++			     RX_IPV6_SA_MOB_ENA | RX_IPV6_DA_MOB_ENA);
++
++		/* Enable TX Home Address & Routing Header checksum fix */
++		sky2_write32(hw, Q_ADDR(txqaddr[sky2->port], Q_TEST),
++			     TBMU_TEST_HOME_ADD_FIX_EN | TBMU_TEST_ROUTING_ADD_FIX_EN);
++	}
++
++
++
+ 	return 0;
+ nomem:
+ 	sky2_rx_clean(sky2);
+@@ -2992,6 +3016,12 @@ static void sky2_reset(struct sky2_hw *hw)
+ 			sky2_write16(hw, SK_REG(i, GMAC_CTRL),
+ 				     GMC_BYP_MACSECRX_ON | GMC_BYP_MACSECTX_ON
+ 				     | GMC_BYP_RETR_ON);
++
++	}
++
++	if (hw->chip_id == CHIP_ID_YUKON_SUPR && hw->chip_rev > CHIP_REV_YU_SU_B0) {
++		/* enable MACSec clock gating */
++		sky2_pci_write32(hw, PCI_DEV_REG3, P_CLK_MACSEC_DIS);
+ 	}
+ 
+ 	/* Clear I2C IRQ noise */
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/features/all/sky2/0006-sky2-88E8059-support.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/sky2/0006-sky2-88E8059-support.patch	Sun Aug 29 21:57:32 2010	(r16222)
@@ -0,0 +1,160 @@
+From: Stephen Hemminger <shemminger at vyatta.com>
+Date: Thu, 29 Oct 2009 06:37:09 +0000
+Subject: [PATCH 06/56] sky2: 88E8059 support
+
+commit 0f5aac7070a01ec757ed243febe4fff7c944c4d2 upstream.
+
+Tentative support for newer Marvell hardware including
+the Yukon-2 Optima chip. Do not have hatdware to test this yet,
+code is based on vendor driver.
+
+Signed-off-by: Stephen Hemminger <shemminger at vyatta.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/sky2.c |   79 +++++++++++++++++++++++++++++++++++++++++++++++++++-
+ 1 files changed, 78 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
+index 3387a2f..53cce74 100644
+--- a/drivers/net/sky2.c
++++ b/drivers/net/sky2.c
+@@ -140,6 +140,7 @@ static DEFINE_PCI_DEVICE_TABLE(sky2_id_table) = {
+ 	{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x436D) }, /* 88E8055 */
+ 	{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4370) }, /* 88E8075 */
+ 	{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4380) }, /* 88E8057 */
++	{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4381) }, /* 88E8059 */
+ 	{ 0 }
+ };
+ 
+@@ -603,6 +604,16 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port)
+ 		/* apply workaround for integrated resistors calibration */
+ 		gm_phy_write(hw, port, PHY_MARV_PAGE_ADDR, 17);
+ 		gm_phy_write(hw, port, PHY_MARV_PAGE_DATA, 0x3f60);
++	} else if (hw->chip_id == CHIP_ID_YUKON_OPT && hw->chip_rev == 0) {
++		/* apply fixes in PHY AFE */
++		gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 0x00ff);
++
++		/* apply RDAC termination workaround */
++		gm_phy_write(hw, port, 24, 0x2800);
++		gm_phy_write(hw, port, 23, 0x2001);
++
++		/* set page register back to 0 */
++		gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 0);
+ 	} else if (hw->chip_id != CHIP_ID_YUKON_EX &&
+ 		   hw->chip_id < CHIP_ID_YUKON_SUPR) {
+ 		/* no effect on Yukon-XL */
+@@ -2127,6 +2138,25 @@ out:
+ 	spin_unlock(&sky2->phy_lock);
+ }
+ 
++/* Special quick link interrupt (Yukon-2 Optima only) */
++static void sky2_qlink_intr(struct sky2_hw *hw)
++{
++	struct sky2_port *sky2 = netdev_priv(hw->dev[0]);
++	u32 imask;
++	u16 phy;
++
++	/* disable irq */
++	imask = sky2_read32(hw, B0_IMSK);
++	imask &= ~Y2_IS_PHY_QLNK;
++	sky2_write32(hw, B0_IMSK, imask);
++
++	/* reset PHY Link Detect */
++	phy = sky2_pci_read16(hw, PSM_CONFIG_REG4);
++	sky2_pci_write16(hw, PSM_CONFIG_REG4, phy | 1);
++
++	sky2_link_up(sky2);
++}
++
+ /* Transmit timeout is only called if we are running, carrier is up
+  * and tx queue is full (stopped).
+  */
+@@ -2796,6 +2826,9 @@ static int sky2_poll(struct napi_struct *napi, int work_limit)
+ 	if (status & Y2_IS_IRQ_PHY2)
+ 		sky2_phy_intr(hw, 1);
+ 
++	if (status & Y2_IS_PHY_QLNK)
++		sky2_qlink_intr(hw);
++
+ 	while ((idx = sky2_read16(hw, STAT_PUT_IDX)) != hw->st_idx) {
+ 		work_done += sky2_status_intr(hw, work_limit - work_done, idx);
+ 
+@@ -2845,6 +2878,7 @@ static u32 sky2_mhz(const struct sky2_hw *hw)
+ 	case CHIP_ID_YUKON_EX:
+ 	case CHIP_ID_YUKON_SUPR:
+ 	case CHIP_ID_YUKON_UL_2:
++	case CHIP_ID_YUKON_OPT:
+ 		return 125;
+ 
+ 	case CHIP_ID_YUKON_FE:
+@@ -2934,6 +2968,7 @@ static int __devinit sky2_init(struct sky2_hw *hw)
+ 		break;
+ 
+ 	case CHIP_ID_YUKON_UL_2:
++	case CHIP_ID_YUKON_OPT:
+ 		hw->flags = SKY2_HW_GIGABIT
+ 			| SKY2_HW_ADV_POWER_CTL;
+ 		break;
+@@ -3024,6 +3059,46 @@ static void sky2_reset(struct sky2_hw *hw)
+ 		sky2_pci_write32(hw, PCI_DEV_REG3, P_CLK_MACSEC_DIS);
+ 	}
+ 
++	if (hw->chip_id == CHIP_ID_YUKON_OPT) {
++		u16 reg;
++		u32 msk;
++
++		if (hw->chip_rev == 0) {
++			/* disable PCI-E PHY power down (set PHY reg 0x80, bit 7 */
++			sky2_write32(hw, Y2_PEX_PHY_DATA, (0x80UL << 16) | (1 << 7));
++
++			/* set PHY Link Detect Timer to 1.1 second (11x 100ms) */
++			reg = 10;
++		} else {
++			/* set PHY Link Detect Timer to 0.4 second (4x 100ms) */
++			reg = 3;
++		}
++
++		reg <<= PSM_CONFIG_REG4_TIMER_PHY_LINK_DETECT_BASE;
++
++		/* reset PHY Link Detect */
++		sky2_pci_write16(hw, PSM_CONFIG_REG4,
++				 reg | PSM_CONFIG_REG4_RST_PHY_LINK_DETECT);
++		sky2_pci_write16(hw, PSM_CONFIG_REG4, reg);
++
++
++		/* enable PHY Quick Link */
++		msk = sky2_read32(hw, B0_IMSK);
++		msk |= Y2_IS_PHY_QLNK;
++		sky2_write32(hw, B0_IMSK, msk);
++
++		/* check if PSMv2 was running before */
++		reg = sky2_pci_read16(hw, PSM_CONFIG_REG3);
++		if (reg & PCI_EXP_LNKCTL_ASPMC) {
++			int cap = pci_find_capability(pdev, PCI_CAP_ID_EXP);
++			/* restore the PCIe Link Control register */
++			sky2_pci_write16(hw, cap + PCI_EXP_LNKCTL, reg);
++		}
++
++		/* re-enable PEX PM in PEX PHY debug reg. 8 (clear bit 12) */
++		sky2_write32(hw, Y2_PEX_PHY_DATA, PEX_DB_ACCESS | (0x08UL << 16));
++	}
++
+ 	/* Clear I2C IRQ noise */
+ 	sky2_write32(hw, B2_I2C_IRQ, 1);
+ 
+@@ -4442,9 +4517,11 @@ static const char *sky2_name(u8 chipid, char *buf, int sz)
+ 		"FE+",		/* 0xb8 */
+ 		"Supreme",	/* 0xb9 */
+ 		"UL 2",		/* 0xba */
++		"Unknown",	/* 0xbb */
++		"Optima",	/* 0xbc */
+ 	};
+ 
+-	if (chipid >= CHIP_ID_YUKON_XL && chipid < CHIP_ID_YUKON_UL_2)
++	if (chipid >= CHIP_ID_YUKON_XL && chipid < CHIP_ID_YUKON_OPT)
+ 		strncpy(buf, name[chipid - CHIP_ID_YUKON_XL], sz);
+ 	else
+ 		snprintf(buf, sz, "(chip %#x)", chipid);
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/features/all/sky2/0007-sky2-version-1.26.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/sky2/0007-sky2-version-1.26.patch	Sun Aug 29 21:57:32 2010	(r16222)
@@ -0,0 +1,28 @@
+From: Stephen Hemminger <shemminger at vyatta.com>
+Date: Thu, 29 Oct 2009 06:37:10 +0000
+Subject: [PATCH 07/56] sky2: version 1.26
+
+commit ac958154e9e1548933fe97e4ecbceb30e01e4a6f upstream.
+
+Signed-off-by: Stephen Hemminger <shemminger at vyatta.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/sky2.c |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
+index 53cce74..1729ebf 100644
+--- a/drivers/net/sky2.c
++++ b/drivers/net/sky2.c
+@@ -50,7 +50,7 @@
+ #include "sky2.h"
+ 
+ #define DRV_NAME		"sky2"
+-#define DRV_VERSION		"1.25"
++#define DRV_VERSION		"1.26"
+ #define PFX			DRV_NAME " "
+ 
+ /*
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/features/all/sky2/0009-sky2-fix-sky2_link_down-copy-paste-comment-error.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/sky2/0009-sky2-fix-sky2_link_down-copy-paste-comment-error.patch	Sun Aug 29 21:57:32 2010	(r16222)
@@ -0,0 +1,30 @@
+From: Brandon Philips <bphilips at suse.de>
+Date: Thu, 29 Oct 2009 17:01:49 -0700
+Subject: [PATCH 09/56] sky2: fix sky2_link_down copy/paste comment error
+
+commit 809aaaae162e58696c61e1d0c156cfe16bd309e2 upstream.
+
+Fix copy/paste comment error from sky2_link_up to sky2_link_down.
+
+Signed-off-by: Brandon Philips <bphilips at suse.de>
+Signed-off-by: Jiri Kosina <jkosina at suse.cz>
+---
+ drivers/net/sky2.c |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
+index 6a10d7b..a76cd66 100644
+--- a/drivers/net/sky2.c
++++ b/drivers/net/sky2.c
+@@ -1975,7 +1975,7 @@ static void sky2_link_down(struct sky2_port *sky2)
+ 
+ 	netif_carrier_off(sky2->netdev);
+ 
+-	/* Turn on link LED */
++	/* Turn off link LED */
+ 	sky2_write8(hw, SK_REG(port, LNK_LED_REG), LINKLED_OFF);
+ 
+ 	if (netif_msg_link(sky2))
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/features/all/sky2/0010-net-Fix-Yukon-2-Optima-TCP-offload-setup.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/sky2/0010-net-Fix-Yukon-2-Optima-TCP-offload-setup.patch	Sun Aug 29 21:57:32 2010	(r16222)
@@ -0,0 +1,36 @@
+From: Takashi Iwai <tiwai at suse.de>
+Date: Thu, 3 Dec 2009 05:12:01 +0000
+Subject: [PATCH 10/56] net: Fix Yukon-2 Optima TCP offload setup
+
+commit b338682dc5c20e8ff986e58407bdb6e3a3e3f0a3 upstream.
+
+Fix the TCP offload setup for Yukon-2 Optima.
+It requires SKY2_HW_NE_LE flag unlike Ultra 2.
+
+Signed-off-by: Takashi Iwai <tiwai at suse.de>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/sky2.c |    5 +++++
+ 1 files changed, 5 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
+index 3943d89..050e6b5 100644
+--- a/drivers/net/sky2.c
++++ b/drivers/net/sky2.c
+@@ -2968,8 +2968,13 @@ static int __devinit sky2_init(struct sky2_hw *hw)
+ 		break;
+ 
+ 	case CHIP_ID_YUKON_UL_2:
++		hw->flags = SKY2_HW_GIGABIT
++			| SKY2_HW_ADV_POWER_CTL;
++		break;
++
+ 	case CHIP_ID_YUKON_OPT:
+ 		hw->flags = SKY2_HW_GIGABIT
++			| SKY2_HW_NEW_LE
+ 			| SKY2_HW_ADV_POWER_CTL;
+ 		break;
+ 
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/features/all/sky2/0011-net-Add-missing-TST_CFG_WRITE-bits-around-sky2_pci_w.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/sky2/0011-net-Add-missing-TST_CFG_WRITE-bits-around-sky2_pci_w.patch	Sun Aug 29 21:57:32 2010	(r16222)
@@ -0,0 +1,49 @@
+From: Takashi Iwai <tiwai at suse.de>
+Date: Thu, 3 Dec 2009 05:12:02 +0000
+Subject: [PATCH 11/56] net: Add missing TST_CFG_WRITE bits around sky2_pci_write
+
+commit d66f0b20b2f8eac365fadf5ca492efe4ba539446 upstream.
+
+Add missing TST_CFG_WRITE bits around sky2_pci_write*() in Optima
+setup routines.  Without the cfg-write bits, the driver may spew endless
+link-up messages through qlink irq.
+
+Signed-off-by: Takashi Iwai <tiwai at suse.de>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/sky2.c |    4 ++++
+ 1 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
+index 050e6b5..013c9f5 100644
+--- a/drivers/net/sky2.c
++++ b/drivers/net/sky2.c
+@@ -2152,7 +2152,9 @@ static void sky2_qlink_intr(struct sky2_hw *hw)
+ 
+ 	/* reset PHY Link Detect */
+ 	phy = sky2_pci_read16(hw, PSM_CONFIG_REG4);
++	sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON);
+ 	sky2_pci_write16(hw, PSM_CONFIG_REG4, phy | 1);
++	sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF);
+ 
+ 	sky2_link_up(sky2);
+ }
+@@ -3082,6 +3084,7 @@ static void sky2_reset(struct sky2_hw *hw)
+ 		reg <<= PSM_CONFIG_REG4_TIMER_PHY_LINK_DETECT_BASE;
+ 
+ 		/* reset PHY Link Detect */
++		sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON);
+ 		sky2_pci_write16(hw, PSM_CONFIG_REG4,
+ 				 reg | PSM_CONFIG_REG4_RST_PHY_LINK_DETECT);
+ 		sky2_pci_write16(hw, PSM_CONFIG_REG4, reg);
+@@ -3099,6 +3102,7 @@ static void sky2_reset(struct sky2_hw *hw)
+ 			/* restore the PCIe Link Control register */
+ 			sky2_pci_write16(hw, cap + PCI_EXP_LNKCTL, reg);
+ 		}
++		sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF);
+ 
+ 		/* re-enable PEX PM in PEX PHY debug reg. 8 (clear bit 12) */
+ 		sky2_write32(hw, Y2_PEX_PHY_DATA, PEX_DB_ACCESS | (0x08UL << 16));
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/features/all/sky2/0012-sky2-print-Optima-chip-name.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/sky2/0012-sky2-print-Optima-chip-name.patch	Sun Aug 29 21:57:32 2010	(r16222)
@@ -0,0 +1,30 @@
+From: stephen hemminger <shemminger at vyatta.com>
+Date: Mon, 14 Dec 2009 08:33:47 +0000
+Subject: [PATCH 12/56] sky2: print Optima chip name
+
+commit dae3a5112d258764cad9e48439ca7dd05c2edca1 upstream.
+
+Off by one in name lookup makes Optima display as (chip 0xbc)
+
+Signed-off-by: Stephen Hemminger <shemminger at vyatta.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/sky2.c |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
+index 89a05d6..9431f64 100644
+--- a/drivers/net/sky2.c
++++ b/drivers/net/sky2.c
+@@ -4530,7 +4530,7 @@ static const char *sky2_name(u8 chipid, char *buf, int sz)
+ 		"Optima",	/* 0xbc */
+ 	};
+ 
+-	if (chipid >= CHIP_ID_YUKON_XL && chipid < CHIP_ID_YUKON_OPT)
++	if (chipid >= CHIP_ID_YUKON_XL && chipid <= CHIP_ID_YUKON_OPT)
+ 		strncpy(buf, name[chipid - CHIP_ID_YUKON_XL], sz);
+ 	else
+ 		snprintf(buf, sz, "(chip %#x)", chipid);
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/features/all/sky2/0013-sky2-leave-PCI-config-space-writeable.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/sky2/0013-sky2-leave-PCI-config-space-writeable.patch	Sun Aug 29 21:57:32 2010	(r16222)
@@ -0,0 +1,116 @@
+From: stephen hemminger <shemminger at vyatta.com>
+Date: Mon, 14 Dec 2009 08:50:12 +0000
+Subject: [PATCH 13/56] sky2: leave PCI config space writeable
+
+commit 166a0fd4c788ec7f10ca8194ec6d526afa12db75 upstream.
+
+Since power management is done by PCI subsystem as well as driver,
+don't toggle the bit that disables PCI register writes.
+
+Signed-off-by: Stephen Hemminger <shemminger at vyatta.com>
+Acked-by: Rafael J. Wysocki <rjw at sisk.pl>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/sky2.c |   13 -------------
+ 1 files changed, 0 insertions(+), 13 deletions(-)
+
+diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
+index 9431f64..1c01b96 100644
+--- a/drivers/net/sky2.c
++++ b/drivers/net/sky2.c
+@@ -644,7 +644,6 @@ static void sky2_phy_power_up(struct sky2_hw *hw, unsigned port)
+ {
+ 	u32 reg1;
+ 
+-	sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON);
+ 	reg1 = sky2_pci_read32(hw, PCI_DEV_REG1);
+ 	reg1 &= ~phy_power[port];
+ 
+@@ -652,7 +651,6 @@ static void sky2_phy_power_up(struct sky2_hw *hw, unsigned port)
+ 		reg1 |= coma_mode[port];
+ 
+ 	sky2_pci_write32(hw, PCI_DEV_REG1, reg1);
+-	sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF);
+ 	sky2_pci_read32(hw, PCI_DEV_REG1);
+ 
+ 	if (hw->chip_id == CHIP_ID_YUKON_FE)
+@@ -709,11 +707,9 @@ static void sky2_phy_power_down(struct sky2_hw *hw, unsigned port)
+ 		gm_phy_write(hw, port, PHY_MARV_CTRL, PHY_CT_PDOWN);
+ 	}
+ 
+-	sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON);
+ 	reg1 = sky2_pci_read32(hw, PCI_DEV_REG1);
+ 	reg1 |= phy_power[port];		/* set PHY to PowerDown/COMA Mode */
+ 	sky2_pci_write32(hw, PCI_DEV_REG1, reg1);
+-	sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF);
+ }
+ 
+ /* Force a renegotiation */
+@@ -2152,9 +2148,7 @@ static void sky2_qlink_intr(struct sky2_hw *hw)
+ 
+ 	/* reset PHY Link Detect */
+ 	phy = sky2_pci_read16(hw, PSM_CONFIG_REG4);
+-	sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON);
+ 	sky2_pci_write16(hw, PSM_CONFIG_REG4, phy | 1);
+-	sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF);
+ 
+ 	sky2_link_up(sky2);
+ }
+@@ -2645,7 +2639,6 @@ static void sky2_hw_intr(struct sky2_hw *hw)
+ 	if (status & (Y2_IS_MST_ERR | Y2_IS_IRQ_STAT)) {
+ 		u16 pci_err;
+ 
+-		sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON);
+ 		pci_err = sky2_pci_read16(hw, PCI_STATUS);
+ 		if (net_ratelimit())
+ 			dev_err(&pdev->dev, "PCI hardware error (0x%x)\n",
+@@ -2653,14 +2646,12 @@ static void sky2_hw_intr(struct sky2_hw *hw)
+ 
+ 		sky2_pci_write16(hw, PCI_STATUS,
+ 				      pci_err | PCI_STATUS_ERROR_BITS);
+-		sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF);
+ 	}
+ 
+ 	if (status & Y2_IS_PCI_EXP) {
+ 		/* PCI-Express uncorrectable Error occurred */
+ 		u32 err;
+ 
+-		sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON);
+ 		err = sky2_read32(hw, Y2_CFG_AER + PCI_ERR_UNCOR_STATUS);
+ 		sky2_write32(hw, Y2_CFG_AER + PCI_ERR_UNCOR_STATUS,
+ 			     0xfffffffful);
+@@ -2668,7 +2659,6 @@ static void sky2_hw_intr(struct sky2_hw *hw)
+ 			dev_err(&pdev->dev, "PCI Express error (0x%x)\n", err);
+ 
+ 		sky2_read32(hw, Y2_CFG_AER + PCI_ERR_UNCOR_STATUS);
+-		sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF);
+ 	}
+ 
+ 	if (status & Y2_HWE_L1_MASK)
+@@ -3047,7 +3037,6 @@ static void sky2_reset(struct sky2_hw *hw)
+ 	}
+ 
+ 	sky2_power_on(hw);
+-	sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF);
+ 
+ 	for (i = 0; i < hw->ports; i++) {
+ 		sky2_write8(hw, SK_REG(i, GMAC_LINK_CTRL), GMLC_RST_SET);
+@@ -3084,7 +3073,6 @@ static void sky2_reset(struct sky2_hw *hw)
+ 		reg <<= PSM_CONFIG_REG4_TIMER_PHY_LINK_DETECT_BASE;
+ 
+ 		/* reset PHY Link Detect */
+-		sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON);
+ 		sky2_pci_write16(hw, PSM_CONFIG_REG4,
+ 				 reg | PSM_CONFIG_REG4_RST_PHY_LINK_DETECT);
+ 		sky2_pci_write16(hw, PSM_CONFIG_REG4, reg);
+@@ -3102,7 +3090,6 @@ static void sky2_reset(struct sky2_hw *hw)
+ 			/* restore the PCIe Link Control register */
+ 			sky2_pci_write16(hw, cap + PCI_EXP_LNKCTL, reg);
+ 		}
+-		sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF);
+ 
+ 		/* re-enable PEX PM in PEX PHY debug reg. 8 (clear bit 12) */
+ 		sky2_write32(hw, Y2_PEX_PHY_DATA, PEX_DB_ACCESS | (0x08UL << 16));
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/features/all/sky2/0015-sky2-Refactor-sky2_get_regs-into-two-functions.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/sky2/0015-sky2-Refactor-sky2_get_regs-into-two-functions.patch	Sun Aug 29 21:57:32 2010	(r16222)
@@ -0,0 +1,134 @@
+From: Mike McCormack <mikem at ring3k.org>
+Date: Thu, 31 Dec 2009 00:49:43 +0000
+Subject: [PATCH 15/56] sky2: Refactor sky2_get_regs into two functions
+
+commit c32bbff81c04096c7888aed3946ee90fdbfbc3a3 upstream.
+
+Separate code deciding which registers can be accessed out of
+sky2_get_regs in preparation for adding more conditions into it.
+
+Signed-off-by: Mike McCormack <mikem at ring3k.org>
+Signed-off-by: Stephen Hemminger <shemminger at vyatta.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/sky2.c |   94 ++++++++++++++++++++++++++-------------------------
+ 1 files changed, 48 insertions(+), 46 deletions(-)
+
+diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
+index 1c01b96..faa4841 100644
+--- a/drivers/net/sky2.c
++++ b/drivers/net/sky2.c
+@@ -3837,6 +3837,50 @@ static int sky2_get_regs_len(struct net_device *dev)
+ 	return 0x4000;
+ }
+ 
++static int sky2_reg_access_ok(struct sky2_hw *hw, unsigned int b)
++{
++	/* This complicated switch statement is to make sure and
++	 * only access regions that are unreserved.
++	 * Some blocks are only valid on dual port cards.
++	 */
++	switch (b) {
++	/* second port */
++	case 5:		/* Tx Arbiter 2 */
++	case 9:		/* RX2 */
++	case 14 ... 15:	/* TX2 */
++	case 17: case 19: /* Ram Buffer 2 */
++	case 22 ... 23: /* Tx Ram Buffer 2 */
++	case 25:	/* Rx MAC Fifo 1 */
++	case 27:	/* Tx MAC Fifo 2 */
++	case 31:	/* GPHY 2 */
++	case 40 ... 47: /* Pattern Ram 2 */
++	case 52: case 54: /* TCP Segmentation 2 */
++	case 112 ... 116: /* GMAC 2 */
++		return hw->ports > 1;
++
++	case 0:		/* Control */
++	case 2:		/* Mac address */
++	case 4:		/* Tx Arbiter 1 */
++	case 7:		/* PCI express reg */
++	case 8:		/* RX1 */
++	case 12 ... 13: /* TX1 */
++	case 16: case 18:/* Rx Ram Buffer 1 */
++	case 20 ... 21: /* Tx Ram Buffer 1 */
++	case 24:	/* Rx MAC Fifo 1 */
++	case 26:	/* Tx MAC Fifo 1 */
++	case 28 ... 29: /* Descriptor and status unit */
++	case 30:	/* GPHY 1*/
++	case 32 ... 39: /* Pattern Ram 1 */
++	case 48: case 50: /* TCP Segmentation 1 */
++	case 56 ... 60:	/* PCI space */
++	case 80 ... 84:	/* GMAC 1 */
++		return 1;
++
++	default:
++		return 0;
++	}
++}
++
+ /*
+  * Returns copy of control register region
+  * Note: ethtool_get_regs always provides full size (16k) buffer
+@@ -3851,55 +3895,13 @@ static void sky2_get_regs(struct net_device *dev, struct ethtool_regs *regs,
+ 	regs->version = 1;
+ 
+ 	for (b = 0; b < 128; b++) {
+-		/* This complicated switch statement is to make sure and
+-		 * only access regions that are unreserved.
+-		 * Some blocks are only valid on dual port cards.
+-		 * and block 3 has some special diagnostic registers that
+-		 * are poison.
+-		 */
+-		switch (b) {
+-		case 3:
+-			/* skip diagnostic ram region */
++		/* skip poisonous diagnostic ram region in block 3 */
++		if (b == 3)
+ 			memcpy_fromio(p + 0x10, io + 0x10, 128 - 0x10);
+-			break;
+-
+-		/* dual port cards only */
+-		case 5:		/* Tx Arbiter 2 */
+-		case 9: 	/* RX2 */
+-		case 14 ... 15:	/* TX2 */
+-		case 17: case 19: /* Ram Buffer 2 */
+-		case 22 ... 23: /* Tx Ram Buffer 2 */
+-		case 25: 	/* Rx MAC Fifo 1 */
+-		case 27: 	/* Tx MAC Fifo 2 */
+-		case 31:	/* GPHY 2 */
+-		case 40 ... 47: /* Pattern Ram 2 */
+-		case 52: case 54: /* TCP Segmentation 2 */
+-		case 112 ... 116: /* GMAC 2 */
+-			if (sky2->hw->ports == 1)
+-				goto reserved;
+-			/* fall through */
+-		case 0:		/* Control */
+-		case 2:		/* Mac address */
+-		case 4:		/* Tx Arbiter 1 */
+-		case 7:		/* PCI express reg */
+-		case 8:		/* RX1 */
+-		case 12 ... 13: /* TX1 */
+-		case 16: case 18:/* Rx Ram Buffer 1 */
+-		case 20 ... 21: /* Tx Ram Buffer 1 */
+-		case 24: 	/* Rx MAC Fifo 1 */
+-		case 26: 	/* Tx MAC Fifo 1 */
+-		case 28 ... 29: /* Descriptor and status unit */
+-		case 30:	/* GPHY 1*/
+-		case 32 ... 39: /* Pattern Ram 1 */
+-		case 48: case 50: /* TCP Segmentation 1 */
+-		case 56 ... 60:	/* PCI space */
+-		case 80 ... 84:	/* GMAC 1 */
++		else if (sky2_reg_access_ok(sky2->hw, b))
+ 			memcpy_fromio(p, io, 128);
+-			break;
+-		default:
+-reserved:
++		else
+ 			memset(p, 0, 128);
+-		}
+ 
+ 		p += 128;
+ 		io += 128;
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/features/all/sky2/0016-sky2-Lock-transmit-queue-while-disabling-device.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/sky2/0016-sky2-Lock-transmit-queue-while-disabling-device.patch	Sun Aug 29 21:57:32 2010	(r16222)
@@ -0,0 +1,39 @@
+From: Mike McCormack <mikem at ring3k.org>
+Date: Thu, 31 Dec 2009 00:55:31 +0000
+Subject: [PATCH 16/56] sky2: Lock transmit queue while disabling device
+
+commit c36531b9b2e00d9715c3a0f5788ac5311435e078 upstream.
+
+netif_device_detach() does not take the tx_lock, so it's possible that
+a call to sky2_xmit_frame is still in progress after
+netif_device_detach() is complete.
+
+Take netif_tx_lock() to make sure all transmits have stopped while
+we're disabling the devices and that no other CPU is still
+transmitting a frame after we've disabling the device.
+
+Proposed fix for "sky2 panic under load" reported by Berck E. Nash.
+
+Signed-off-by: Mike McCormack <mikem at ring3k.org>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/sky2.c |    2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
+index faa4841..8ae8520 100644
+--- a/drivers/net/sky2.c
++++ b/drivers/net/sky2.c
+@@ -3176,7 +3176,9 @@ static void sky2_reset(struct sky2_hw *hw)
+ static void sky2_detach(struct net_device *dev)
+ {
+ 	if (netif_running(dev)) {
++		netif_tx_lock(dev);
+ 		netif_device_detach(dev);	/* stop txq */
++		netif_tx_unlock(dev);
+ 		sky2_down(dev);
+ 	}
+ }
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/features/all/sky2/0018-sky2-Enable-disable-WOL-per-hardware-device.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/sky2/0018-sky2-Enable-disable-WOL-per-hardware-device.patch	Sun Aug 29 21:57:32 2010	(r16222)
@@ -0,0 +1,69 @@
+From: Mike McCormack <mikem at ring3k.org>
+Date: Sat, 23 Jan 2010 02:09:26 -0800
+Subject: [PATCH 18/56] sky2: Enable/disable WOL per hardware device
+
+commit 2ca4231de7f7a5fd7137bac152030ba71f15e8c3 upstream.
+
+Y2_HW_WOL_ON/Y2_HW_WOL_OFF should be set and cleared per chip,
+not per port.  On dual port cards, Y2_HW_WOL_ON should be
+enabled if either sky2 port has WOL enabled.
+
+Found while reviewing code for a WOL regression, though this is
+probably not the cause of the regression.
+
+Signed-off-by: Mike McCormack <mikem at ring3k.org>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/sky2.c |   29 ++++++++++++++++++++++-------
+ 1 files changed, 22 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
+index 37f486b..02d0b42 100644
+--- a/drivers/net/sky2.c
++++ b/drivers/net/sky2.c
+@@ -3228,6 +3228,27 @@ static inline u8 sky2_wol_supported(const struct sky2_hw *hw)
+ 	return sky2_is_copper(hw) ? (WAKE_PHY | WAKE_MAGIC) : 0;
+ }
+ 
++static void sky2_hw_set_wol(struct sky2_hw *hw)
++{
++	int wol = 0;
++	int i;
++
++	for (i = 0; i < hw->ports; i++) {
++		struct net_device *dev = hw->dev[i];
++		struct sky2_port *sky2 = netdev_priv(dev);
++
++		if (sky2->wol)
++			wol = 1;
++	}
++
++	if (hw->chip_id == CHIP_ID_YUKON_EC_U ||
++	    hw->chip_id == CHIP_ID_YUKON_EX ||
++	    hw->chip_id == CHIP_ID_YUKON_FE_P)
++		sky2_write32(hw, B0_CTST, wol ? Y2_HW_WOL_ON : Y2_HW_WOL_OFF);
++
++	device_set_wakeup_enable(&hw->pdev->dev, wol);
++}
++
+ static void sky2_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
+ {
+ 	const struct sky2_port *sky2 = netdev_priv(dev);
+@@ -3247,13 +3268,7 @@ static int sky2_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
+ 
+ 	sky2->wol = wol->wolopts;
+ 
+-	if (hw->chip_id == CHIP_ID_YUKON_EC_U ||
+-	    hw->chip_id == CHIP_ID_YUKON_EX ||
+-	    hw->chip_id == CHIP_ID_YUKON_FE_P)
+-		sky2_write32(hw, B0_CTST, sky2->wol
+-			     ? Y2_HW_WOL_ON : Y2_HW_WOL_OFF);
+-
+-	device_set_wakeup_enable(&hw->pdev->dev, sky2->wol);
++	sky2_hw_set_wol(hw);
+ 
+ 	if (!netif_running(dev))
+ 		sky2_wol_init(sky2);
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/features/all/sky2/0019-sky2-revert-config-space-change.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/sky2/0019-sky2-revert-config-space-change.patch	Sun Aug 29 21:57:32 2010	(r16222)
@@ -0,0 +1,119 @@
+From: stephen hemminger <shemminger at vyatta.com>
+Date: Sun, 24 Jan 2010 18:46:06 +0000
+Subject: [PATCH 19/56] sky2: revert config space change
+
+commit a40ccc6868943e74ec12f26a266ce1d0373b2b32 upstream.
+
+Obviously, this register had some other impact that is causing
+the regression.  Either it is masking some other access or needs
+to be reset in some path.
+
+Either, way it is best to just revert the change for 2.6.33
+
+This reverts commit 166a0fd4c788ec7f10ca8194ec6d526afa12db75.
+
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/sky2.c |   13 +++++++++++++
+ 1 files changed, 13 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
+index 02d0b42..d760650 100644
+--- a/drivers/net/sky2.c
++++ b/drivers/net/sky2.c
+@@ -644,6 +644,7 @@ static void sky2_phy_power_up(struct sky2_hw *hw, unsigned port)
+ {
+ 	u32 reg1;
+ 
++	sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON);
+ 	reg1 = sky2_pci_read32(hw, PCI_DEV_REG1);
+ 	reg1 &= ~phy_power[port];
+ 
+@@ -651,6 +652,7 @@ static void sky2_phy_power_up(struct sky2_hw *hw, unsigned port)
+ 		reg1 |= coma_mode[port];
+ 
+ 	sky2_pci_write32(hw, PCI_DEV_REG1, reg1);
++	sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF);
+ 	sky2_pci_read32(hw, PCI_DEV_REG1);
+ 
+ 	if (hw->chip_id == CHIP_ID_YUKON_FE)
+@@ -707,9 +709,11 @@ static void sky2_phy_power_down(struct sky2_hw *hw, unsigned port)
+ 		gm_phy_write(hw, port, PHY_MARV_CTRL, PHY_CT_PDOWN);
+ 	}
+ 
++	sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON);
+ 	reg1 = sky2_pci_read32(hw, PCI_DEV_REG1);
+ 	reg1 |= phy_power[port];		/* set PHY to PowerDown/COMA Mode */
+ 	sky2_pci_write32(hw, PCI_DEV_REG1, reg1);
++	sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF);
+ }
+ 
+ /* Force a renegotiation */
+@@ -2149,7 +2153,9 @@ static void sky2_qlink_intr(struct sky2_hw *hw)
+ 
+ 	/* reset PHY Link Detect */
+ 	phy = sky2_pci_read16(hw, PSM_CONFIG_REG4);
++	sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON);
+ 	sky2_pci_write16(hw, PSM_CONFIG_REG4, phy | 1);
++	sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF);
+ 
+ 	sky2_link_up(sky2);
+ }
+@@ -2640,6 +2646,7 @@ static void sky2_hw_intr(struct sky2_hw *hw)
+ 	if (status & (Y2_IS_MST_ERR | Y2_IS_IRQ_STAT)) {
+ 		u16 pci_err;
+ 
++		sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON);
+ 		pci_err = sky2_pci_read16(hw, PCI_STATUS);
+ 		if (net_ratelimit())
+ 			dev_err(&pdev->dev, "PCI hardware error (0x%x)\n",
+@@ -2647,12 +2654,14 @@ static void sky2_hw_intr(struct sky2_hw *hw)
+ 
+ 		sky2_pci_write16(hw, PCI_STATUS,
+ 				      pci_err | PCI_STATUS_ERROR_BITS);
++		sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF);
+ 	}
+ 
+ 	if (status & Y2_IS_PCI_EXP) {
+ 		/* PCI-Express uncorrectable Error occurred */
+ 		u32 err;
+ 
++		sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON);
+ 		err = sky2_read32(hw, Y2_CFG_AER + PCI_ERR_UNCOR_STATUS);
+ 		sky2_write32(hw, Y2_CFG_AER + PCI_ERR_UNCOR_STATUS,
+ 			     0xfffffffful);
+@@ -2660,6 +2669,7 @@ static void sky2_hw_intr(struct sky2_hw *hw)
+ 			dev_err(&pdev->dev, "PCI Express error (0x%x)\n", err);
+ 
+ 		sky2_read32(hw, Y2_CFG_AER + PCI_ERR_UNCOR_STATUS);
++		sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF);
+ 	}
+ 
+ 	if (status & Y2_HWE_L1_MASK)
+@@ -3038,6 +3048,7 @@ static void sky2_reset(struct sky2_hw *hw)
+ 	}
+ 
+ 	sky2_power_on(hw);
++	sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF);
+ 
+ 	for (i = 0; i < hw->ports; i++) {
+ 		sky2_write8(hw, SK_REG(i, GMAC_LINK_CTRL), GMLC_RST_SET);
+@@ -3074,6 +3085,7 @@ static void sky2_reset(struct sky2_hw *hw)
+ 		reg <<= PSM_CONFIG_REG4_TIMER_PHY_LINK_DETECT_BASE;
+ 
+ 		/* reset PHY Link Detect */
++		sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON);
+ 		sky2_pci_write16(hw, PSM_CONFIG_REG4,
+ 				 reg | PSM_CONFIG_REG4_RST_PHY_LINK_DETECT);
+ 		sky2_pci_write16(hw, PSM_CONFIG_REG4, reg);
+@@ -3091,6 +3103,7 @@ static void sky2_reset(struct sky2_hw *hw)
+ 			/* restore the PCIe Link Control register */
+ 			sky2_pci_write16(hw, cap + PCI_EXP_LNKCTL, reg);
+ 		}
++		sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF);
+ 
+ 		/* re-enable PEX PM in PEX PHY debug reg. 8 (clear bit 12) */
+ 		sky2_write32(hw, Y2_PEX_PHY_DATA, PEX_DB_ACCESS | (0x08UL << 16));
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/features/all/sky2/0020-sky2-Fix-TX_MAP_PAGE-misspelling.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/sky2/0020-sky2-Fix-TX_MAP_PAGE-misspelling.patch	Sun Aug 29 21:57:32 2010	(r16222)
@@ -0,0 +1,32 @@
+From: Jarek Poplawski <jarkao2 at gmail.com>
+Date: Mon, 1 Feb 2010 00:19:07 +0000
+Subject: [PATCH 20/56] sky2: Fix TX_MAP_PAGE misspelling
+
+commit 0c2dc318e88100e1abdff07e8a7d60460984a2d2 upstream.
+
+Btw of the dma-debug problem reported by Michael Breuer I spotted
+a tiny misspelling in TX_MAP_PAGE definition introduced by commit
+6b84dacadbdc3.
+
+Signed-off-by: Jarek Poplawski <jarkao2 at gmail.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/sky2.h |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/sky2.h b/drivers/net/sky2.h
+index 365d79c..54cb303 100644
+--- a/drivers/net/sky2.h
++++ b/drivers/net/sky2.h
+@@ -2156,7 +2156,7 @@ struct tx_ring_info {
+ 	struct sk_buff	*skb;
+ 	unsigned long flags;
+ #define TX_MAP_SINGLE   0x0001
+-#define TX_MAP_PAGE     000002
++#define TX_MAP_PAGE     0x0002
+ 	DECLARE_PCI_UNMAP_ADDR(mapaddr);
+ 	DECLARE_PCI_UNMAP_LEN(maplen);
+ };
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/features/all/sky2/0022-sky2-hand-receive-DMA-mapping-failures.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/sky2/0022-sky2-hand-receive-DMA-mapping-failures.patch	Sun Aug 29 21:57:32 2010	(r16222)
@@ -0,0 +1,118 @@
+From: stephen hemminger <shemminger at vyatta.com>
+Date: Mon, 1 Feb 2010 13:45:41 +0000
+Subject: [PATCH 22/56] sky2: hand receive DMA mapping failures
+
+commit 3fbd9187d004149fb8a98c9cb51ef9f4a4f66aca upstream.
+
+If receive buffer mapping failed, then it was possible to get
+stuck with unmapped receive buffer in DMA ring.
+
+This would be an extremely rare condition because the driver had just
+released the map for the last receive so it should be able to get
+another map again (in soft-irq).
+
+Signed-off-by: Stephen Hemminger <shemminger at vyatta.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/sky2.c |   61 +++++++++++++++++++++++++++++++++++----------------
+ 1 files changed, 42 insertions(+), 19 deletions(-)
+
+diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
+index a6ddfc1..72c9249 100644
+--- a/drivers/net/sky2.c
++++ b/drivers/net/sky2.c
+@@ -1103,18 +1103,39 @@ static int sky2_rx_map_skb(struct pci_dev *pdev, struct rx_ring_info *re,
+ 	int i;
+ 
+ 	re->data_addr = pci_map_single(pdev, skb->data, size, PCI_DMA_FROMDEVICE);
+-	if (unlikely(pci_dma_mapping_error(pdev, re->data_addr)))
+-		return -EIO;
++	if (pci_dma_mapping_error(pdev, re->data_addr))
++		goto mapping_error;
+ 
+ 	pci_unmap_len_set(re, data_size, size);
+ 
+-	for (i = 0; i < skb_shinfo(skb)->nr_frags; i++)
+-		re->frag_addr[i] = pci_map_page(pdev,
+-						skb_shinfo(skb)->frags[i].page,
+-						skb_shinfo(skb)->frags[i].page_offset,
+-						skb_shinfo(skb)->frags[i].size,
++	for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
++		skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
++
++		re->frag_addr[i] = pci_map_page(pdev, frag->page,
++						frag->page_offset,
++						frag->size,
+ 						PCI_DMA_FROMDEVICE);
++
++		if (pci_dma_mapping_error(pdev, re->frag_addr[i]))
++			goto map_page_error;
++	}
+ 	return 0;
++
++map_page_error:
++	while (--i >= 0) {
++		pci_unmap_page(pdev, re->frag_addr[i],
++			       skb_shinfo(skb)->frags[i].size,
++			       PCI_DMA_FROMDEVICE);
++	}
++
++	pci_unmap_single(pdev, re->data_addr, pci_unmap_len(re, data_size),
++			 PCI_DMA_FROMDEVICE);
++
++mapping_error:
++	if (net_ratelimit())
++		dev_warn(&pdev->dev, "%s: rx mapping error\n",
++			 skb->dev->name);
++	return -EIO;
+ }
+ 
+ static void sky2_rx_unmap_skb(struct pci_dev *pdev, struct rx_ring_info *re)
+@@ -2306,30 +2327,32 @@ static struct sk_buff *receive_new(struct sky2_port *sky2,
+ 				   struct rx_ring_info *re,
+ 				   unsigned int length)
+ {
+-	struct sk_buff *skb, *nskb;
++	struct sk_buff *skb;
++	struct rx_ring_info nre;
+ 	unsigned hdr_space = sky2->rx_data_size;
+ 
+-	/* Don't be tricky about reusing pages (yet) */
+-	nskb = sky2_rx_alloc(sky2);
+-	if (unlikely(!nskb))
+-		return NULL;
++	nre.skb = sky2_rx_alloc(sky2);
++	if (unlikely(!nre.skb))
++		goto nobuf;
++
++	if (sky2_rx_map_skb(sky2->hw->pdev, &nre, hdr_space))
++		goto nomap;
+ 
+ 	skb = re->skb;
+ 	sky2_rx_unmap_skb(sky2->hw->pdev, re);
+-
+ 	prefetch(skb->data);
+-	re->skb = nskb;
+-	if (sky2_rx_map_skb(sky2->hw->pdev, re, hdr_space)) {
+-		dev_kfree_skb(nskb);
+-		re->skb = skb;
+-		return NULL;
+-	}
++	*re = nre;
+ 
+ 	if (skb_shinfo(skb)->nr_frags)
+ 		skb_put_frags(skb, hdr_space, length);
+ 	else
+ 		skb_put(skb, length);
+ 	return skb;
++
++nomap:
++	dev_kfree_skb(nre.skb);
++nobuf:
++	return NULL;
+ }
+ 
+ /*
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/features/all/sky2/0023-sky2-Flow-control-frames-recorded-as-dropped-packets.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/sky2/0023-sky2-Flow-control-frames-recorded-as-dropped-packets.patch	Sun Aug 29 21:57:32 2010	(r16222)
@@ -0,0 +1,46 @@
+From: Stephen Hemminger <shemminger at linux-foundation.org>
+Date: Wed, 3 Feb 2010 08:31:12 +0000
+Subject: [PATCH 23/56] sky2: Flow control frames recorded as dropped packets
+
+commit 90c30335a70e96b8b8493b7deb15e6b30e6d9fce upstream.
+
+Thanks for your patch.  A more general solution would be to move the
+rx_dropped up into sky2_receive.
+
+Signed-off-by: Stephen Hemminger <shemminger at vyatta.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/sky2.c |    8 +++++---
+ 1 files changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
+index 72c9249..7443622 100644
+--- a/drivers/net/sky2.c
++++ b/drivers/net/sky2.c
+@@ -2404,6 +2404,9 @@ okay:
+ 		skb = receive_copy(sky2, re, length);
+ 	else
+ 		skb = receive_new(sky2, re, length);
++
++	dev->stats.rx_dropped += (skb == NULL);
++
+ resubmit:
+ 	sky2_rx_submit(sky2, re);
+ 
+@@ -2515,11 +2518,10 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do, u16 idx)
+ 		case OP_RXSTAT:
+ 			total_packets[port]++;
+ 			total_bytes[port] += length;
++
+ 			skb = sky2_receive(dev, length, status);
+-			if (unlikely(!skb)) {
+-				dev->stats.rx_dropped++;
++			if (!skb)
+ 				break;
+-			}
+ 
+ 			/* This chip reports checksum status differently */
+ 			if (hw->flags & SKY2_HW_NEW_LE) {
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/features/all/sky2/0024-sky2-resume-clocks.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/sky2/0024-sky2-resume-clocks.patch	Sun Aug 29 21:57:32 2010	(r16222)
@@ -0,0 +1,42 @@
+From: stephen hemminger <shemminger at vyatta.com>
+Date: Sun, 7 Feb 2010 06:23:53 +0000
+Subject: [PATCH 24/56] sky2: resume clocks
+
+commit a0db28b898266265c1cc2ff84f041a561a265504 upstream.
+
+Change the resume path to use pci write config for a couple of reasons:
+1. pci_write_config_dword() allows for more error
+   checking of PCI health after resume.
+
+2. better to toggle this register on all chip types, since that
+   is what vendor driver does.
+
+Signed-off-by: Stephen Hemminger <shemminger at vyatta.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/sky2.c |    9 +++++----
+ 1 files changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
+index 7443622..1593ed4 100644
+--- a/drivers/net/sky2.c
++++ b/drivers/net/sky2.c
+@@ -4859,10 +4859,11 @@ static int sky2_resume(struct pci_dev *pdev)
+ 	pci_enable_wake(pdev, PCI_D0, 0);
+ 
+ 	/* Re-enable all clocks */
+-	if (hw->chip_id == CHIP_ID_YUKON_EX ||
+-	    hw->chip_id == CHIP_ID_YUKON_EC_U ||
+-	    hw->chip_id == CHIP_ID_YUKON_FE_P)
+-		sky2_pci_write32(hw, PCI_DEV_REG3, 0);
++	err = pci_write_config_dword(pdev, PCI_DEV_REG3, 0);
++	if (err) {
++		dev_err(&pdev->dev, "PCI write config failed\n");
++		goto out;
++	}
+ 
+ 	sky2_reset(hw);
+ 	sky2_write32(hw, B0_IMSK, Y2_IS_BASE);
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/features/all/sky2/0025-sky2-disable-ASF-on-Yukon-Supreme.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/sky2/0025-sky2-disable-ASF-on-Yukon-Supreme.patch	Sun Aug 29 21:57:32 2010	(r16222)
@@ -0,0 +1,43 @@
+From: stephen hemminger <shemminger at vyatta.com>
+Date: Sun, 7 Feb 2010 06:24:50 +0000
+Subject: [PATCH 25/56] sky2: disable ASF on Yukon Supreme
+
+commit acd12dde26eef5186a9d2ead9399d136932d2398 upstream.
+
+Clone of vendor code to disable ASF on Extreme and Supreme chips.
+
+Signed-off-by: Stephen Hemminger <shemminger at vyatta.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/sky2.c |   11 ++++++++++-
+ 1 files changed, 10 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
+index 1593ed4..1aa1f33 100644
+--- a/drivers/net/sky2.c
++++ b/drivers/net/sky2.c
+@@ -3035,11 +3035,20 @@ static void sky2_reset(struct sky2_hw *hw)
+ 	u32 hwe_mask = Y2_HWE_ALL_MASK;
+ 
+ 	/* disable ASF */
+-	if (hw->chip_id == CHIP_ID_YUKON_EX) {
++	if (hw->chip_id == CHIP_ID_YUKON_EX
++	    || hw->chip_id == CHIP_ID_YUKON_SUPR) {
++		sky2_write32(hw, CPU_WDOG, 0);
+ 		status = sky2_read16(hw, HCU_CCSR);
+ 		status &= ~(HCU_CCSR_AHB_RST | HCU_CCSR_CPU_RST_MODE |
+ 			    HCU_CCSR_UC_STATE_MSK);
++		/*
++		 * CPU clock divider shouldn't be used because
++		 * - ASF firmware may malfunction
++		 * - Yukon-Supreme: Parallel FLASH doesn't support divided clocks
++		 */
++		status &= ~HCU_CCSR_CPU_CLK_DIVIDE_MSK;
+ 		sky2_write16(hw, HCU_CCSR, status);
++		sky2_write32(hw, CPU_WDOG, 0);
+ 	} else
+ 		sky2_write8(hw, B28_Y2_ASF_STAT_CMD, Y2_ASF_RESET);
+ 	sky2_write16(hw, B0_CTST, Y2_ASF_DISABLE);
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/features/all/sky2/0026-sky2-receive-checksum-refactoring.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/sky2/0026-sky2-receive-checksum-refactoring.patch	Sun Aug 29 21:57:32 2010	(r16222)
@@ -0,0 +1,101 @@
+From: stephen hemminger <shemminger at vyatta.com>
+Date: Sun, 7 Feb 2010 06:28:36 +0000
+Subject: [PATCH 26/56] sky2: receive checksum refactoring
+
+commit 375c568844e49d292885c7485d4a255f71680e56 upstream.
+
+Break the largish case for handling receive checksum into a separate
+function, and if there is a problem use dev_XXX routines to
+show which hardware is the problem.
+
+Turn one corner case into a BUG().  This only happens if the driver
+is expecting one behavior but the chip does the old behavior;
+only ever saw this when bringing up a new chip type and driver
+was buggy.
+
+Signed-off-by: Stephen Hemminger <shemminger at vyatta.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/sky2.c |   59 ++++++++++++++++++++++++---------------------------
+ 1 files changed, 28 insertions(+), 31 deletions(-)
+
+diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
+index 1aa1f33..478288b 100644
+--- a/drivers/net/sky2.c
++++ b/drivers/net/sky2.c
+@@ -2484,6 +2484,32 @@ static inline void sky2_rx_done(struct sky2_hw *hw, unsigned port,
+ 	}
+ }
+ 
++static void sky2_rx_checksum(struct sky2_port *sky2, u32 status)
++{
++	/* If this happens then driver assuming wrong format for chip type */
++	BUG_ON(sky2->hw->flags & SKY2_HW_NEW_LE);
++
++	/* Both checksum counters are programmed to start at
++	 * the same offset, so unless there is a problem they
++	 * should match. This failure is an early indication that
++	 * hardware receive checksumming won't work.
++	 */
++	if (likely((u16)(status >> 16) == (u16)status)) {
++		struct sk_buff *skb = sky2->rx_ring[sky2->rx_next].skb;
++		skb->ip_summed = CHECKSUM_COMPLETE;
++		skb->csum = le16_to_cpu(status);
++	} else {
++		dev_notice(&sky2->hw->pdev->dev,
++			   "%s: receive checksum problem (status = %#x)\n",
++			   sky2->netdev->name, status);
++
++		/* Disable checksum offload */
++		sky2->flags &= ~SKY2_FLAG_RX_CHECKSUM;
++		sky2_write32(sky2->hw, Q_ADDR(rxqaddr[sky2->port], Q_CSR),
++			     BMU_DIS_RX_CHKSUM);
++	}
++}
++
+ /* Process status response ring */
+ static int sky2_status_intr(struct sky2_hw *hw, int to_do, u16 idx)
+ {
+@@ -2552,37 +2578,8 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do, u16 idx)
+ 			/* fall through */
+ #endif
+ 		case OP_RXCHKS:
+-			if (!(sky2->flags & SKY2_FLAG_RX_CHECKSUM))
+-				break;
+-
+-			/* If this happens then driver assuming wrong format */
+-			if (unlikely(hw->flags & SKY2_HW_NEW_LE)) {
+-				if (net_ratelimit())
+-					printk(KERN_NOTICE "%s: unexpected"
+-					       " checksum status\n",
+-					       dev->name);
+-				break;
+-			}
+-
+-			/* Both checksum counters are programmed to start at
+-			 * the same offset, so unless there is a problem they
+-			 * should match. This failure is an early indication that
+-			 * hardware receive checksumming won't work.
+-			 */
+-			if (likely(status >> 16 == (status & 0xffff))) {
+-				skb = sky2->rx_ring[sky2->rx_next].skb;
+-				skb->ip_summed = CHECKSUM_COMPLETE;
+-				skb->csum = le16_to_cpu(status);
+-			} else {
+-				printk(KERN_NOTICE PFX "%s: hardware receive "
+-				       "checksum problem (status = %#x)\n",
+-				       dev->name, status);
+-				sky2->flags &= ~SKY2_FLAG_RX_CHECKSUM;
+-
+-				sky2_write32(sky2->hw,
+-					     Q_ADDR(rxqaddr[port], Q_CSR),
+-					     BMU_DIS_RX_CHKSUM);
+-			}
++			if (likely(sky2->flags & SKY2_FLAG_RX_CHECKSUM))
++				sky2_rx_checksum(sky2, status);
+ 			break;
+ 
+ 		case OP_TXINDEXLE:
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/features/all/sky2/0028-sky2-fix-sparse-warning.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/sky2/0028-sky2-fix-sparse-warning.patch	Sun Aug 29 21:57:32 2010	(r16222)
@@ -0,0 +1,30 @@
+From: stephen hemminger <shemminger at vyatta.com>
+Date: Fri, 12 Feb 2010 06:57:58 +0000
+Subject: [PATCH 28/56] sky2: fix sparse warning
+
+commit 8b05543129a5f216e08625e947a16b844bc4766d upstream.
+
+Warning about hidden variable
+
+Signed-off-by: Stephen Hemminger <shemminger at vyatta.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/sky2.c |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
+index 45299d6..92f7ba0 100644
+--- a/drivers/net/sky2.c
++++ b/drivers/net/sky2.c
+@@ -3128,7 +3128,7 @@ static void sky2_reset(struct sky2_hw *hw)
+ 		/* check if PSMv2 was running before */
+ 		reg = sky2_pci_read16(hw, PSM_CONFIG_REG3);
+ 		if (reg & PCI_EXP_LNKCTL_ASPMC) {
+-			int cap = pci_find_capability(pdev, PCI_CAP_ID_EXP);
++			cap = pci_find_capability(pdev, PCI_CAP_ID_EXP);
+ 			/* restore the PCIe Link Control register */
+ 			sky2_pci_write16(hw, cap + PCI_EXP_LNKCTL, reg);
+ 		}
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/features/all/sky2/0029-sky2-WoL-changes.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/sky2/0029-sky2-WoL-changes.patch	Sun Aug 29 21:57:32 2010	(r16222)
@@ -0,0 +1,154 @@
+From: stephen hemminger <shemminger at vyatta.com>
+Date: Fri, 12 Feb 2010 06:57:59 +0000
+Subject: [PATCH 29/56] sky2: WoL changes
+
+commit 5f8ae5c537d937bab9cfeb83a30a9b670c3cfb35 upstream.
+
+Change Wake On Lan code to be similar to vendor driver. The definition
+of Y2_HW_WOL_ON is confusing; what it means is transition to firmware SPI
+setting when doing power change.
+
+Since same code is done for both shutdown and suspend, use common
+code path.
+
+Signed-off-by: Stephen Hemminger <shemminger at vyatta.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/sky2.c |   65 +++++++--------------------------------------------
+ 1 files changed, 9 insertions(+), 56 deletions(-)
+
+diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
+index 92f7ba0..edf37aa 100644
+--- a/drivers/net/sky2.c
++++ b/drivers/net/sky2.c
+@@ -251,6 +251,8 @@ static void sky2_power_on(struct sky2_hw *hw)
+ 
+ 		sky2_pci_write32(hw, PCI_CFG_REG_1, 0);
+ 
++		sky2_write16(hw, B0_CTST, Y2_HW_WOL_ON);
++
+ 		/* Enable workaround for dev 4.107 on Yukon-Ultra & Extreme */
+ 		reg = sky2_read32(hw, B2_GP_IO);
+ 		reg |= GLB_GPIO_STAT_RACE_DIS;
+@@ -782,6 +784,9 @@ static void sky2_wol_init(struct sky2_port *sky2)
+ 	ctrl |= WOL_CTL_DIS_PME_ON_PATTERN|WOL_CTL_DIS_PATTERN_UNIT;
+ 	sky2_write16(hw, WOL_REGS(port, WOL_CTRL_STAT), ctrl);
+ 
++	/* Disable PiG firmware */
++	sky2_write16(hw, B0_CTST, Y2_HW_WOL_OFF);
++
+ 	/* Turn on legacy PCI-Express PME mode */
+ 	reg1 = sky2_pci_read32(hw, PCI_DEV_REG1);
+ 	reg1 |= PCI_Y2_PME_LEGACY;
+@@ -789,7 +794,6 @@ static void sky2_wol_init(struct sky2_port *sky2)
+ 
+ 	/* block receiver */
+ 	sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_SET);
+-
+ }
+ 
+ static void sky2_set_tx_stfwd(struct sky2_hw *hw, unsigned port)
+@@ -3272,27 +3276,6 @@ static inline u8 sky2_wol_supported(const struct sky2_hw *hw)
+ 	return sky2_is_copper(hw) ? (WAKE_PHY | WAKE_MAGIC) : 0;
+ }
+ 
+-static void sky2_hw_set_wol(struct sky2_hw *hw)
+-{
+-	int wol = 0;
+-	int i;
+-
+-	for (i = 0; i < hw->ports; i++) {
+-		struct net_device *dev = hw->dev[i];
+-		struct sky2_port *sky2 = netdev_priv(dev);
+-
+-		if (sky2->wol)
+-			wol = 1;
+-	}
+-
+-	if (hw->chip_id == CHIP_ID_YUKON_EC_U ||
+-	    hw->chip_id == CHIP_ID_YUKON_EX ||
+-	    hw->chip_id == CHIP_ID_YUKON_FE_P)
+-		sky2_write32(hw, B0_CTST, wol ? Y2_HW_WOL_ON : Y2_HW_WOL_OFF);
+-
+-	device_set_wakeup_enable(&hw->pdev->dev, wol);
+-}
+-
+ static void sky2_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
+ {
+ 	const struct sky2_port *sky2 = netdev_priv(dev);
+@@ -3311,11 +3294,6 @@ static int sky2_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
+ 		return -EOPNOTSUPP;
+ 
+ 	sky2->wol = wol->wolopts;
+-
+-	sky2_hw_set_wol(hw);
+-
+-	if (!netif_running(dev))
+-		sky2_wol_init(sky2);
+ 	return 0;
+ }
+ 
+@@ -4809,7 +4787,6 @@ static void __devexit sky2_remove(struct pci_dev *pdev)
+ 	pci_set_drvdata(pdev, NULL);
+ }
+ 
+-#ifdef CONFIG_PM
+ static int sky2_suspend(struct pci_dev *pdev, pm_message_t state)
+ {
+ 	struct sky2_hw *hw = pci_get_drvdata(pdev);
+@@ -4834,6 +4811,8 @@ static int sky2_suspend(struct pci_dev *pdev, pm_message_t state)
+ 		wol |= sky2->wol;
+ 	}
+ 
++	device_set_wakeup_enable(&pdev->dev, wol != 0);
++
+ 	sky2_write32(hw, B0_IMSK, 0);
+ 	napi_disable(&hw->napi);
+ 	sky2_power_aux(hw);
+@@ -4846,6 +4825,7 @@ static int sky2_suspend(struct pci_dev *pdev, pm_message_t state)
+ 	return 0;
+ }
+ 
++#ifdef CONFIG_PM
+ static int sky2_resume(struct pci_dev *pdev)
+ {
+ 	struct sky2_hw *hw = pci_get_drvdata(pdev);
+@@ -4895,34 +4875,7 @@ out:
+ 
+ static void sky2_shutdown(struct pci_dev *pdev)
+ {
+-	struct sky2_hw *hw = pci_get_drvdata(pdev);
+-	int i, wol = 0;
+-
+-	if (!hw)
+-		return;
+-
+-	rtnl_lock();
+-	del_timer_sync(&hw->watchdog_timer);
+-
+-	for (i = 0; i < hw->ports; i++) {
+-		struct net_device *dev = hw->dev[i];
+-		struct sky2_port *sky2 = netdev_priv(dev);
+-
+-		if (sky2->wol) {
+-			wol = 1;
+-			sky2_wol_init(sky2);
+-		}
+-	}
+-
+-	if (wol)
+-		sky2_power_aux(hw);
+-	rtnl_unlock();
+-
+-	pci_enable_wake(pdev, PCI_D3hot, wol);
+-	pci_enable_wake(pdev, PCI_D3cold, wol);
+-
+-	pci_disable_device(pdev);
+-	pci_set_power_state(pdev, PCI_D3hot);
++	sky2_suspend(pdev, PMSG_SUSPEND);
+ }
+ 
+ static struct pci_driver sky2_driver = {
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/features/all/sky2/0030-sky2-dont-enable-PME-legacy-mode.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/sky2/0030-sky2-dont-enable-PME-legacy-mode.patch	Sun Aug 29 21:57:32 2010	(r16222)
@@ -0,0 +1,44 @@
+From: stephen hemminger <shemminger at vyatta.com>
+Date: Fri, 12 Feb 2010 06:58:00 +0000
+Subject: [PATCH 30/56] sky2: dont enable PME legacy mode
+
+commit 87b09f1f25cd1e01d7c50bf423c7fe33027d7511 upstream.
+
+This bit is not changed by vendor driver, and should be left alone.
+The documentation implies this a debug bit.
+  0 = WAKE# only asserted when VMAIN not available
+  1 = WAKE# is depend on wake events and independent of VMAIN.
+
+Signed-off-by: Stephen Hemminger <shemminger at vyatta.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/sky2.c |    6 ------
+ 1 files changed, 0 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
+index edf37aa..2494842 100644
+--- a/drivers/net/sky2.c
++++ b/drivers/net/sky2.c
+@@ -733,7 +733,6 @@ static void sky2_wol_init(struct sky2_port *sky2)
+ 	unsigned port = sky2->port;
+ 	enum flow_control save_mode;
+ 	u16 ctrl;
+-	u32 reg1;
+ 
+ 	/* Bring hardware out of reset */
+ 	sky2_write16(hw, B0_CTST, CS_RST_CLR);
+@@ -787,11 +786,6 @@ static void sky2_wol_init(struct sky2_port *sky2)
+ 	/* Disable PiG firmware */
+ 	sky2_write16(hw, B0_CTST, Y2_HW_WOL_OFF);
+ 
+-	/* Turn on legacy PCI-Express PME mode */
+-	reg1 = sky2_pci_read32(hw, PCI_DEV_REG1);
+-	reg1 |= PCI_Y2_PME_LEGACY;
+-	sky2_pci_write32(hw, PCI_DEV_REG1, reg1);
+-
+ 	/* block receiver */
+ 	sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_SET);
+ }
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/features/all/sky2/0031-sky2-jumbo-packet-changes.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/sky2/0031-sky2-jumbo-packet-changes.patch	Sun Aug 29 21:57:32 2010	(r16222)
@@ -0,0 +1,106 @@
+From: stephen hemminger <shemminger at vyatta.com>
+Date: Fri, 12 Feb 2010 06:58:01 +0000
+Subject: [PATCH 31/56] sky2: jumbo packet changes
+
+commit 44dde56d37787cbad2e867a41fe87d6b0aa37fc8 upstream.
+
+Change how FIFO is programmed in jumbo mode (to match vendor driver).
+Mostly cosmetic, the only register change is that the bits 22,23
+are not programemd used.
+
+Signed-off-by: Stephen Hemminger <shemminger at vyatta.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/sky2.c |   36 ++++++++++++++----------------------
+ drivers/net/sky2.h |    8 ++++----
+ 2 files changed, 18 insertions(+), 26 deletions(-)
+
+diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
+index 2494842..8a87e16 100644
+--- a/drivers/net/sky2.c
++++ b/drivers/net/sky2.c
+@@ -798,29 +798,15 @@ static void sky2_set_tx_stfwd(struct sky2_hw *hw, unsigned port)
+ 	      hw->chip_rev != CHIP_REV_YU_EX_A0) ||
+ 	     hw->chip_id >= CHIP_ID_YUKON_FE_P) {
+ 		/* Yukon-Extreme B0 and further Extreme devices */
+-		/* enable Store & Forward mode for TX */
++		sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), TX_STFW_ENA);
++	} else if (dev->mtu > ETH_DATA_LEN) {
++		/* set Tx GMAC FIFO Almost Empty Threshold */
++		sky2_write32(hw, SK_REG(port, TX_GMF_AE_THR),
++			     (ECU_JUMBO_WM << 16) | ECU_AE_THR);
+ 
+-		if (dev->mtu <= ETH_DATA_LEN)
+-			sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T),
+-				     TX_JUMBO_DIS | TX_STFW_ENA);
+-
+-		else
+-			sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T),
+-				     TX_JUMBO_ENA| TX_STFW_ENA);
+-	} else {
+-		if (dev->mtu <= ETH_DATA_LEN)
+-			sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), TX_STFW_ENA);
+-		else {
+-			/* set Tx GMAC FIFO Almost Empty Threshold */
+-			sky2_write32(hw, SK_REG(port, TX_GMF_AE_THR),
+-				     (ECU_JUMBO_WM << 16) | ECU_AE_THR);
+-
+-			sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), TX_STFW_DIS);
+-
+-			/* Can't do offload because of lack of store/forward */
+-			dev->features &= ~(NETIF_F_TSO | NETIF_F_SG | NETIF_F_ALL_CSUM);
+-		}
+-	}
++		sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), TX_STFW_DIS);
++	} else
++		sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), TX_STFW_ENA);
+ }
+ 
+ static void sky2_mac_init(struct sky2_hw *hw, unsigned port)
+@@ -2206,14 +2192,20 @@ static int sky2_change_mtu(struct net_device *dev, int new_mtu)
+ 	u16 ctl, mode;
+ 	u32 imask;
+ 
++	/* MTU size outside the spec */
+ 	if (new_mtu < ETH_ZLEN || new_mtu > ETH_JUMBO_MTU)
+ 		return -EINVAL;
+ 
++	/* MTU > 1500 on yukon FE and FE+ not allowed */
+ 	if (new_mtu > ETH_DATA_LEN &&
+ 	    (hw->chip_id == CHIP_ID_YUKON_FE ||
+ 	     hw->chip_id == CHIP_ID_YUKON_FE_P))
+ 		return -EINVAL;
+ 
++	/* TSO, etc on Yukon Ultra and MTU > 1500 not supported */
++	if (new_mtu > ETH_DATA_LEN && hw->chip_id == CHIP_ID_YUKON_EC_U)
++		dev->features &= ~(NETIF_F_TSO|NETIF_F_SG|NETIF_F_ALL_CSUM);
++
+ 	if (!netif_running(dev)) {
+ 		dev->mtu = new_mtu;
+ 		return 0;
+diff --git a/drivers/net/sky2.h b/drivers/net/sky2.h
+index 54cb303..a5e182d 100644
+--- a/drivers/net/sky2.h
++++ b/drivers/net/sky2.h
+@@ -1895,14 +1895,14 @@ enum {
+ 
+ /*	TX_GMF_CTRL_T	32 bit	Tx GMAC FIFO Control/Test */
+ enum {
+-	TX_STFW_DIS	= 1<<31,/* Disable Store & Forward (Yukon-EC Ultra) */
+-	TX_STFW_ENA	= 1<<30,/* Enable  Store & Forward (Yukon-EC Ultra) */
++	TX_STFW_DIS	= 1<<31,/* Disable Store & Forward */
++	TX_STFW_ENA	= 1<<30,/* Enable  Store & Forward */
+ 
+ 	TX_VLAN_TAG_ON	= 1<<25,/* enable  VLAN tagging */
+ 	TX_VLAN_TAG_OFF	= 1<<24,/* disable VLAN tagging */
+ 
+-	TX_JUMBO_ENA	= 1<<23,/* PCI Jumbo Mode enable (Yukon-EC Ultra) */
+-	TX_JUMBO_DIS	= 1<<22,/* PCI Jumbo Mode enable (Yukon-EC Ultra) */
++	TX_PCI_JUM_ENA  = 1<<23,/* PCI Jumbo Mode enable */
++	TX_PCI_JUM_DIS  = 1<<22,/* PCI Jumbo Mode enable */
+ 
+ 	GMF_WSP_TST_ON	= 1<<18,/* Write Shadow Pointer Test On */
+ 	GMF_WSP_TST_OFF	= 1<<17,/* Write Shadow Pointer Test Off */
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/features/all/sky2/0032-sky2-Factor-out-code-to-calculate-packet-sizes.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/sky2/0032-sky2-Factor-out-code-to-calculate-packet-sizes.patch	Sun Aug 29 21:57:32 2010	(r16222)
@@ -0,0 +1,108 @@
+From: Mike McCormack <mikem at ring3k.org>
+Date: Fri, 12 Feb 2010 06:58:02 +0000
+Subject: [PATCH 32/56] sky2: Factor out code to calculate packet sizes
+
+commit 39ef110ba859f44efeb9a88d0e85316cd1bbecda upstream.
+
+Move code to calculate receive threshold and packet size out of
+sky2_rx_start() so that is can be called from elsewhere easily.
+
+Signed-off-by: Mike McCormack <mikem at ring3k.org>
+Acked-by: Stephen Hemminger <shemminger at vyatta.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/sky2.c |   57 +++++++++++++++++++++++++++++++++------------------
+ 1 files changed, 37 insertions(+), 20 deletions(-)
+
+diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
+index 8a87e16..c5de65c 100644
+--- a/drivers/net/sky2.c
++++ b/drivers/net/sky2.c
+@@ -1049,6 +1049,40 @@ static inline struct sky2_rx_le *sky2_next_rx(struct sky2_port *sky2)
+ 	return le;
+ }
+ 
++static unsigned sky2_get_rx_threshold(struct sky2_port* sky2)
++{
++	unsigned size;
++
++	/* Space needed for frame data + headers rounded up */
++	size = roundup(sky2->netdev->mtu + ETH_HLEN + VLAN_HLEN, 8);
++
++	/* Stopping point for hardware truncation */
++	return (size - 8) / sizeof(u32);
++}
++
++static unsigned sky2_get_rx_data_size(struct sky2_port* sky2)
++{
++	struct rx_ring_info *re;
++	unsigned size;
++
++	/* Space needed for frame data + headers rounded up */
++	size = roundup(sky2->netdev->mtu + ETH_HLEN + VLAN_HLEN, 8);
++
++	sky2->rx_nfrags = size >> PAGE_SHIFT;
++	BUG_ON(sky2->rx_nfrags > ARRAY_SIZE(re->frag_addr));
++
++	/* Compute residue after pages */
++	size -= sky2->rx_nfrags << PAGE_SHIFT;
++
++	/* Optimize to handle small packets and headers */
++	if (size < copybreak)
++		size = copybreak;
++	if (size < ETH_HLEN)
++		size = ETH_HLEN;
++
++	return size;
++}
++
+ /* Build description to hardware for one receive segment */
+ static void sky2_rx_add(struct sky2_port *sky2,  u8 op,
+ 			dma_addr_t map, unsigned len)
+@@ -1343,7 +1377,7 @@ static int sky2_rx_start(struct sky2_port *sky2)
+ 	struct sky2_hw *hw = sky2->hw;
+ 	struct rx_ring_info *re;
+ 	unsigned rxq = rxqaddr[sky2->port];
+-	unsigned i, size, thresh;
++	unsigned i, thresh;
+ 
+ 	sky2->rx_put = sky2->rx_next = 0;
+ 	sky2_qset(hw, rxq);
+@@ -1364,25 +1398,7 @@ static int sky2_rx_start(struct sky2_port *sky2)
+ 	if (!(hw->flags & SKY2_HW_NEW_LE))
+ 		rx_set_checksum(sky2);
+ 
+-	/* Space needed for frame data + headers rounded up */
+-	size = roundup(sky2->netdev->mtu + ETH_HLEN + VLAN_HLEN, 8);
+-
+-	/* Stopping point for hardware truncation */
+-	thresh = (size - 8) / sizeof(u32);
+-
+-	sky2->rx_nfrags = size >> PAGE_SHIFT;
+-	BUG_ON(sky2->rx_nfrags > ARRAY_SIZE(re->frag_addr));
+-
+-	/* Compute residue after pages */
+-	size -= sky2->rx_nfrags << PAGE_SHIFT;
+-
+-	/* Optimize to handle small packets and headers */
+-	if (size < copybreak)
+-		size = copybreak;
+-	if (size < ETH_HLEN)
+-		size = ETH_HLEN;
+-
+-	sky2->rx_data_size = size;
++	sky2->rx_data_size = sky2_get_rx_data_size(sky2);
+ 
+ 	/* Fill Rx ring */
+ 	for (i = 0; i < sky2->rx_pending; i++) {
+@@ -1407,6 +1423,7 @@ static int sky2_rx_start(struct sky2_port *sky2)
+ 	 * the register is limited to 9 bits, so if you do frames > 2052
+ 	 * you better get the MTU right!
+ 	 */
++	thresh = sky2_get_rx_threshold(sky2);
+ 	if (thresh > 0x1ff)
+ 		sky2_write32(hw, SK_REG(sky2->port, RX_GMF_CTRL_T), RX_TRUNC_OFF);
+ 	else {
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/features/all/sky2/0033-sky2-Allocate-initial-skbs-in-sky2_alloc_buffers.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/sky2/0033-sky2-Allocate-initial-skbs-in-sky2_alloc_buffers.patch	Sun Aug 29 21:57:32 2010	(r16222)
@@ -0,0 +1,161 @@
+From: Mike McCormack <mikem at ring3k.org>
+Date: Fri, 12 Feb 2010 06:58:03 +0000
+Subject: [PATCH 33/56] sky2: Allocate initial skbs in sky2_alloc_buffers
+
+commit 200ac492b3c366346fcabd11897fadbd1a7a6599 upstream.
+
+Allocate everything in one place so there's a single point
+of failure in sky2_up, and sky2_rx_start can no longer fail.
+
+Don't leave the hardware in a partially initialized state in the
+case rx ring allocation fails.
+
+As with the old code, the rx ring still needs to be fully
+allocated for sky2_up to succeed.
+
+Signed-off-by: Mike McCormack <mikem at ring3k.org>
+Acked-by: Stephen Hemminger <shemminger at vyatta.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/sky2.c |   66 ++++++++++++++++++++++++++++-----------------------
+ 1 files changed, 36 insertions(+), 30 deletions(-)
+
+diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
+index c5de65c..493a820 100644
+--- a/drivers/net/sky2.c
++++ b/drivers/net/sky2.c
+@@ -1363,8 +1363,32 @@ static inline void sky2_rx_update(struct sky2_port *sky2, unsigned rxq)
+ 	sky2_put_idx(sky2->hw, rxq, sky2->rx_put);
+ }
+ 
++static int sky2_alloc_rx_skbs(struct sky2_port *sky2)
++{
++	struct sky2_hw *hw = sky2->hw;
++	unsigned i;
++
++	sky2->rx_data_size = sky2_get_rx_data_size(sky2);
++
++	/* Fill Rx ring */
++	for (i = 0; i < sky2->rx_pending; i++) {
++		struct rx_ring_info *re = sky2->rx_ring + i;
++
++		re->skb = sky2_rx_alloc(sky2);
++		if (!re->skb)
++			return -ENOMEM;
++
++		if (sky2_rx_map_skb(hw->pdev, re, sky2->rx_data_size)) {
++			dev_kfree_skb(re->skb);
++			re->skb = NULL;
++			return -ENOMEM;
++		}
++	}
++	return 0;
++}
++
+ /*
+- * Allocate and setup receiver buffer pool.
++ * Setup receiver buffer pool.
+  * Normal case this ends up creating one list element for skb
+  * in the receive ring. Worst case if using large MTU and each
+  * allocation falls on a different 64 bit region, that results
+@@ -1372,7 +1396,7 @@ static inline void sky2_rx_update(struct sky2_port *sky2, unsigned rxq)
+  * One element is used for checksum enable/disable, and one
+  * extra to avoid wrap.
+  */
+-static int sky2_rx_start(struct sky2_port *sky2)
++static void sky2_rx_start(struct sky2_port *sky2)
+ {
+ 	struct sky2_hw *hw = sky2->hw;
+ 	struct rx_ring_info *re;
+@@ -1398,22 +1422,9 @@ static int sky2_rx_start(struct sky2_port *sky2)
+ 	if (!(hw->flags & SKY2_HW_NEW_LE))
+ 		rx_set_checksum(sky2);
+ 
+-	sky2->rx_data_size = sky2_get_rx_data_size(sky2);
+-
+-	/* Fill Rx ring */
++	/* submit Rx ring */
+ 	for (i = 0; i < sky2->rx_pending; i++) {
+ 		re = sky2->rx_ring + i;
+-
+-		re->skb = sky2_rx_alloc(sky2);
+-		if (!re->skb)
+-			goto nomem;
+-
+-		if (sky2_rx_map_skb(hw->pdev, re, sky2->rx_data_size)) {
+-			dev_kfree_skb(re->skb);
+-			re->skb = NULL;
+-			goto nomem;
+-		}
+-
+ 		sky2_rx_submit(sky2, re);
+ 	}
+ 
+@@ -1455,13 +1466,6 @@ static int sky2_rx_start(struct sky2_port *sky2)
+ 		sky2_write32(hw, Q_ADDR(txqaddr[sky2->port], Q_TEST),
+ 			     TBMU_TEST_HOME_ADD_FIX_EN | TBMU_TEST_ROUTING_ADD_FIX_EN);
+ 	}
+-
+-
+-
+-	return 0;
+-nomem:
+-	sky2_rx_clean(sky2);
+-	return -ENOMEM;
+ }
+ 
+ static int sky2_alloc_buffers(struct sky2_port *sky2)
+@@ -1492,7 +1496,7 @@ static int sky2_alloc_buffers(struct sky2_port *sky2)
+ 	if (!sky2->rx_ring)
+ 		goto nomem;
+ 
+-	return 0;
++	return sky2_alloc_rx_skbs(sky2);
+ nomem:
+ 	return -ENOMEM;
+ }
+@@ -1501,6 +1505,8 @@ static void sky2_free_buffers(struct sky2_port *sky2)
+ {
+ 	struct sky2_hw *hw = sky2->hw;
+ 
++	sky2_rx_clean(sky2);
++
+ 	if (sky2->rx_le) {
+ 		pci_free_consistent(hw->pdev, RX_LE_BYTES,
+ 				    sky2->rx_le, sky2->rx_le_map);
+@@ -1590,9 +1596,7 @@ static int sky2_up(struct net_device *dev)
+ 	sky2_set_vlan_mode(hw, port, sky2->vlgrp != NULL);
+ #endif
+ 
+-	err = sky2_rx_start(sky2);
+-	if (err)
+-		goto err_out;
++	sky2_rx_start(sky2);
+ 
+ 	/* Enable interrupts from phy/mac for port */
+ 	imask = sky2_read32(hw, B0_IMSK);
+@@ -1960,8 +1964,6 @@ static int sky2_down(struct net_device *dev)
+ 	/* Free any pending frames stuck in HW queue */
+ 	sky2_tx_complete(sky2, sky2->tx_prod);
+ 
+-	sky2_rx_clean(sky2);
+-
+ 	sky2_free_buffers(sky2);
+ 
+ 	return 0;
+@@ -2257,7 +2259,11 @@ static int sky2_change_mtu(struct net_device *dev, int new_mtu)
+ 
+ 	sky2_write8(hw, RB_ADDR(rxqaddr[port], RB_CTRL), RB_ENA_OP_MD);
+ 
+-	err = sky2_rx_start(sky2);
++	err = sky2_alloc_rx_skbs(sky2);
++	if (!err)
++		sky2_rx_start(sky2);
++	else
++		sky2_rx_clean(sky2);
+ 	sky2_write32(hw, B0_IMSK, imask);
+ 
+ 	sky2_read32(hw, B0_Y2_SP_LISR);
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/features/all/sky2/0034-sky2-Refactor-sky2_up-into-two-functions.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/sky2/0034-sky2-Refactor-sky2_up-into-two-functions.patch	Sun Aug 29 21:57:32 2010	(r16222)
@@ -0,0 +1,96 @@
+From: Mike McCormack <mikem at ring3k.org>
+Date: Fri, 12 Feb 2010 06:58:04 +0000
+Subject: [PATCH 34/56] sky2: Refactor sky2_up into two functions
+
+commit ea0f71e59c20ea1e413cacfc971e051b3d6c6f64 upstream.
+
+Move hardware initialization into sky2_hw_up.
+
+Signed-off-by: Mike McCormack <mikem at ring3k.org>
+Acked-by: Stephen Hemminger <shemminger at vyatta.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/sky2.c |   41 +++++++++++++++++++++++++----------------
+ 1 files changed, 25 insertions(+), 16 deletions(-)
+
+diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
+index 493a820..1f0180f 100644
+--- a/drivers/net/sky2.c
++++ b/drivers/net/sky2.c
+@@ -1525,16 +1525,16 @@ static void sky2_free_buffers(struct sky2_port *sky2)
+ 	sky2->rx_ring = NULL;
+ }
+ 
+-/* Bring up network interface. */
+-static int sky2_up(struct net_device *dev)
++static void sky2_hw_up(struct sky2_port *sky2)
+ {
+-	struct sky2_port *sky2 = netdev_priv(dev);
+ 	struct sky2_hw *hw = sky2->hw;
+ 	unsigned port = sky2->port;
+-	u32 imask, ramsize;
+-	int cap, err;
++	u32 ramsize;
++	int cap;
+ 	struct net_device *otherdev = hw->dev[sky2->port^1];
+ 
++	tx_init(sky2);
++
+ 	/*
+  	 * On dual port PCI-X card, there is an problem where status
+ 	 * can be received out of order due to split transactions
+@@ -1546,16 +1546,7 @@ static int sky2_up(struct net_device *dev)
+ 		cmd = sky2_pci_read16(hw, cap + PCI_X_CMD);
+  		cmd &= ~PCI_X_CMD_MAX_SPLIT;
+  		sky2_pci_write16(hw, cap + PCI_X_CMD, cmd);
+-
+- 	}
+-
+-	netif_carrier_off(dev);
+-
+-	err = sky2_alloc_buffers(sky2);
+-	if (err)
+-		goto err_out;
+-
+-	tx_init(sky2);
++	}
+ 
+ 	sky2_mac_init(hw, port);
+ 
+@@ -1564,7 +1555,7 @@ static int sky2_up(struct net_device *dev)
+ 	if (ramsize > 0) {
+ 		u32 rxspace;
+ 
+-		pr_debug(PFX "%s: ram buffer %dK\n", dev->name, ramsize);
++		pr_debug(PFX "%s: ram buffer %dK\n", sky2->netdev->name, ramsize);
+ 		if (ramsize < 16)
+ 			rxspace = ramsize / 2;
+ 		else
+@@ -1597,6 +1588,24 @@ static int sky2_up(struct net_device *dev)
+ #endif
+ 
+ 	sky2_rx_start(sky2);
++}
++
++/* Bring up network interface. */
++static int sky2_up(struct net_device *dev)
++{
++	struct sky2_port *sky2 = netdev_priv(dev);
++	struct sky2_hw *hw = sky2->hw;
++	unsigned port = sky2->port;
++	u32 imask;
++	int err;
++
++	netif_carrier_off(dev);
++
++	err = sky2_alloc_buffers(sky2);
++	if (err)
++		goto err_out;
++
++	sky2_hw_up(sky2);
+ 
+ 	/* Enable interrupts from phy/mac for port */
+ 	imask = sky2_read32(hw, B0_IMSK);
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/features/all/sky2/0035-sky2-Refactor-sky2_down-into-two-functions.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/sky2/0035-sky2-Refactor-sky2_down-into-two-functions.patch	Sun Aug 29 21:57:32 2010	(r16222)
@@ -0,0 +1,68 @@
+From: Mike McCormack <mikem at ring3k.org>
+Date: Fri, 12 Feb 2010 06:58:05 +0000
+Subject: [PATCH 35/56] sky2: Refactor sky2_down into two functions
+
+commit f2b31cb3ae491f9e82443cf25cc5a9ebdbc63619 upstream.
+
+Create a sky2_hw_down that brings the hardware down.
+
+Signed-off-by: Mike McCormack <mikem at ring3k.org>
+Acked-by: Stephen Hemminber <shemminger at vyatta.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/sky2.c |   28 +++++++++++++++++-----------
+ 1 files changed, 17 insertions(+), 11 deletions(-)
+
+diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
+index 1f0180f..61a0451 100644
+--- a/drivers/net/sky2.c
++++ b/drivers/net/sky2.c
+@@ -1908,21 +1908,12 @@ static void sky2_tx_reset(struct sky2_hw *hw, unsigned port)
+ 	sky2_write8(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_RST_SET);
+ }
+ 
+-/* Network shutdown */
+-static int sky2_down(struct net_device *dev)
++static void sky2_hw_down(struct sky2_port *sky2)
+ {
+-	struct sky2_port *sky2 = netdev_priv(dev);
+ 	struct sky2_hw *hw = sky2->hw;
+ 	unsigned port = sky2->port;
+-	u16 ctrl;
+ 	u32 imask;
+-
+-	/* Never really got started! */
+-	if (!sky2->tx_le)
+-		return 0;
+-
+-	if (netif_msg_ifdown(sky2))
+-		printk(KERN_INFO PFX "%s: disabling interface\n", dev->name);
++	u16 ctrl;
+ 
+ 	/* Force flow control off */
+ 	sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_PAUSE_OFF);
+@@ -1972,6 +1963,21 @@ static int sky2_down(struct net_device *dev)
+ 
+ 	/* Free any pending frames stuck in HW queue */
+ 	sky2_tx_complete(sky2, sky2->tx_prod);
++}
++
++/* Network shutdown */
++static int sky2_down(struct net_device *dev)
++{
++	struct sky2_port *sky2 = netdev_priv(dev);
++
++	/* Never really got started! */
++	if (!sky2->tx_le)
++		return 0;
++
++	if (netif_msg_ifdown(sky2))
++		printk(KERN_INFO PFX "%s: disabling interface\n", dev->name);
++
++	sky2_hw_down(sky2);
+ 
+ 	sky2_free_buffers(sky2);
+ 
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/features/all/sky2/0036-sky2-Avoid-down-and-up-during-sky2_reset.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/sky2/0036-sky2-Avoid-down-and-up-during-sky2_reset.patch	Sun Aug 29 21:57:32 2010	(r16222)
@@ -0,0 +1,160 @@
+From: Mike McCormack <mikem at ring3k.org>
+Date: Fri, 12 Feb 2010 06:58:06 +0000
+Subject: [PATCH 36/56] sky2: Avoid down and up during sky2_reset
+
+commit 8a0c9228f110218f443d9ef8f9ab629251959733 upstream.
+
+Rewrite sky2_reset to work with interrupts disabled and
+ avoid freeing and reallocing memory.
+
+The old code used sky2_down and sky2_up to implement sky2_reset,
+ which meant interrupts could not be disabled, and the transmit and
+ receive ring buffers would be free'd and reallocated.
+
+To avoid the interrupt handler waking the transmit queue while
+ we're doing a reset, it's better to have interrupts and NAPI
+ polls disabled.
+
+Note: Modified Mike's patch to do IRQ disable in sky2_down before
+ calling sky2_hw_down - Stephen
+
+Signed-off-by: Mike McCormack <mikem at ring3k.org>
+Acked-by: Stephen Hemminger <shemminger at vyatta.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/sky2.c |   68 ++++++++++++++++++++++++++++++++++++----------------
+ 1 files changed, 47 insertions(+), 21 deletions(-)
+
+diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
+index 61a0451..4147530 100644
+--- a/drivers/net/sky2.c
++++ b/drivers/net/sky2.c
+@@ -1880,10 +1880,6 @@ static void sky2_tx_complete(struct sky2_port *sky2, u16 done)
+ 
+ 	sky2->tx_cons = idx;
+ 	smp_mb();
+-
+-	/* Wake unless it's detached, and called e.g. from sky2_down() */
+-	if (tx_avail(sky2) > MAX_SKB_TX_LE + 4 && netif_device_present(dev))
+-		netif_wake_queue(dev);
+ }
+ 
+ static void sky2_tx_reset(struct sky2_hw *hw, unsigned port)
+@@ -1912,7 +1908,6 @@ static void sky2_hw_down(struct sky2_port *sky2)
+ {
+ 	struct sky2_hw *hw = sky2->hw;
+ 	unsigned port = sky2->port;
+-	u32 imask;
+ 	u16 ctrl;
+ 
+ 	/* Force flow control off */
+@@ -1946,15 +1941,6 @@ static void sky2_hw_down(struct sky2_port *sky2)
+ 
+ 	sky2_rx_stop(sky2);
+ 
+-	/* Disable port IRQ */
+-	imask = sky2_read32(hw, B0_IMSK);
+-	imask &= ~portirq_msk[port];
+-	sky2_write32(hw, B0_IMSK, imask);
+-	sky2_read32(hw, B0_IMSK);
+-
+-	synchronize_irq(hw->pdev->irq);
+-	napi_synchronize(&hw->napi);
+-
+ 	spin_lock_bh(&sky2->phy_lock);
+ 	sky2_phy_power_down(hw, port);
+ 	spin_unlock_bh(&sky2->phy_lock);
+@@ -1969,6 +1955,7 @@ static void sky2_hw_down(struct sky2_port *sky2)
+ static int sky2_down(struct net_device *dev)
+ {
+ 	struct sky2_port *sky2 = netdev_priv(dev);
++	struct sky2_hw *hw = sky2->hw;
+ 
+ 	/* Never really got started! */
+ 	if (!sky2->tx_le)
+@@ -1977,6 +1964,14 @@ static int sky2_down(struct net_device *dev)
+ 	if (netif_msg_ifdown(sky2))
+ 		printk(KERN_INFO PFX "%s: disabling interface\n", dev->name);
+ 
++	/* Disable port IRQ */
++	sky2_write32(hw, B0_IMSK,
++		     sky2_read32(hw, B0_IMSK) & ~portirq_msk[sky2->port]);
++	sky2_read32(hw, B0_IMSK);
++
++	synchronize_irq(hw->pdev->irq);
++	napi_synchronize(&hw->napi);
++
+ 	sky2_hw_down(sky2);
+ 
+ 	sky2_free_buffers(sky2);
+@@ -2475,8 +2470,13 @@ static inline void sky2_tx_done(struct net_device *dev, u16 last)
+ {
+ 	struct sky2_port *sky2 = netdev_priv(dev);
+ 
+-	if (netif_running(dev))
++	if (netif_running(dev)) {
+ 		sky2_tx_complete(sky2, last);
++
++		/* Wake unless it's detached, and called e.g. from sky2_down() */
++		if (tx_avail(sky2) > MAX_SKB_TX_LE + 4)
++			netif_wake_queue(dev);
++	}
+ }
+ 
+ static inline void sky2_skb_rx(const struct sky2_port *sky2,
+@@ -3277,20 +3277,46 @@ static int sky2_reattach(struct net_device *dev)
+ static void sky2_restart(struct work_struct *work)
+ {
+ 	struct sky2_hw *hw = container_of(work, struct sky2_hw, restart_work);
++	u32 imask;
+ 	int i;
+ 
+ 	rtnl_lock();
+-	for (i = 0; i < hw->ports; i++)
+-		sky2_detach(hw->dev[i]);
+ 
+ 	napi_disable(&hw->napi);
++	synchronize_irq(hw->pdev->irq);
++	imask = sky2_read32(hw, B0_IMSK);
+ 	sky2_write32(hw, B0_IMSK, 0);
++
++	for (i = 0; i < hw->ports; i++) {
++		struct net_device *dev = hw->dev[i];
++		struct sky2_port *sky2 = netdev_priv(dev);
++
++		if (!netif_running(dev))
++			continue;
++
++		netif_carrier_off(dev);
++		netif_tx_disable(dev);
++		sky2_hw_down(sky2);
++	}
++
+ 	sky2_reset(hw);
+-	sky2_write32(hw, B0_IMSK, Y2_IS_BASE);
+-	napi_enable(&hw->napi);
+ 
+-	for (i = 0; i < hw->ports; i++)
+-		sky2_reattach(hw->dev[i]);
++	for (i = 0; i < hw->ports; i++) {
++		struct net_device *dev = hw->dev[i];
++		struct sky2_port *sky2 = netdev_priv(dev);
++
++		if (!netif_running(dev))
++			continue;
++
++		sky2_hw_up(sky2);
++		netif_wake_queue(dev);
++	}
++
++	sky2_write32(hw, B0_IMSK, imask);
++	sky2_read32(hw, B0_IMSK);
++
++	sky2_read32(hw, B0_Y2_SP_LISR);
++	napi_enable(&hw->napi);
+ 
+ 	rtnl_unlock();
+ }
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/features/all/sky2/0037-sky2-version-1.27.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/sky2/0037-sky2-version-1.27.patch	Sun Aug 29 21:57:32 2010	(r16222)
@@ -0,0 +1,28 @@
+From: stephen hemminger <shemminger at vyatta.com>
+Date: Fri, 12 Feb 2010 06:58:07 +0000
+Subject: [PATCH 37/56] sky2: version 1.27
+
+commit cfc0861ba32643c63901832a583054bea0445961 upstream.
+
+Signed-off-by: Stephen Hemminger <shemminger at vyatta.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/sky2.c |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
+index 4147530..dfff8e5 100644
+--- a/drivers/net/sky2.c
++++ b/drivers/net/sky2.c
+@@ -50,7 +50,7 @@
+ #include "sky2.h"
+ 
+ #define DRV_NAME		"sky2"
+-#define DRV_VERSION		"1.26"
++#define DRV_VERSION		"1.27"
+ #define PFX			DRV_NAME " "
+ 
+ /*
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/features/all/sky2/0041-sky2-Avoid-rtnl_unlock-without-rtnl_lock.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/sky2/0041-sky2-Avoid-rtnl_unlock-without-rtnl_lock.patch	Sun Aug 29 21:57:32 2010	(r16222)
@@ -0,0 +1,38 @@
+From: Mike McCormack <mikem at ring3k.org>
+Date: Sat, 13 Mar 2010 12:24:18 -0800
+Subject: [PATCH 41/56] sky2: Avoid rtnl_unlock without rtnl_lock
+
+commit 2a40018984c5c9647df1c18489449a3a227d9136 upstream.
+
+Make sure we always call rtnl_lock before going down the
+error path in sky2_resume, which unlocks the rtnl lock.
+
+Signed-off-by: Mike McCormack <mikem at ring3k.org>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/sky2.c |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
+index 653bdd7..d8ec4c1 100644
+--- a/drivers/net/sky2.c
++++ b/drivers/net/sky2.c
+@@ -4863,6 +4863,7 @@ static int sky2_resume(struct pci_dev *pdev)
+ 	if (!hw)
+ 		return 0;
+ 
++	rtnl_lock();
+ 	err = pci_set_power_state(pdev, PCI_D0);
+ 	if (err)
+ 		goto out;
+@@ -4884,7 +4885,6 @@ static int sky2_resume(struct pci_dev *pdev)
+ 	sky2_write32(hw, B0_IMSK, Y2_IS_BASE);
+ 	napi_enable(&hw->napi);
+ 
+-	rtnl_lock();
+ 	for (i = 0; i < hw->ports; i++) {
+ 		err = sky2_reattach(hw->dev[i]);
+ 		if (err)
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/features/all/sky2/0043-sky2-support-Yukon-EC_U-rev-B1-and-later.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/sky2/0043-sky2-support-Yukon-EC_U-rev-B1-and-later.patch	Sun Aug 29 21:57:32 2010	(r16222)
@@ -0,0 +1,73 @@
+From: stephen hemminger <shemminger at vyatta.com>
+Date: Mon, 29 Mar 2010 07:36:18 +0000
+Subject: [PATCH 43/56] sky2: support Yukon EC_U rev B1 and later
+
+commit c1cd0a859a01ed0591cb2d8931bdd283542c0252 upstream.
+
+Need to change logic to support later versions of Yukon 2 EC_U chip.
+
+Signed-off-by: Stephen Hemminger <shemminger at vyatta.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/sky2.c |    7 +++++--
+ drivers/net/sky2.h |   12 ++++++++----
+ 2 files changed, 13 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
+index d8ec4c1..4b403bd 100644
+--- a/drivers/net/sky2.c
++++ b/drivers/net/sky2.c
+@@ -877,6 +877,10 @@ static void sky2_mac_init(struct sky2_hw *hw, unsigned port)
+ 	if (hw->dev[port]->mtu > ETH_DATA_LEN)
+ 		reg |= GM_SMOD_JUMBO_ENA;
+ 
++	if (hw->chip_id == CHIP_ID_YUKON_EC_U &&
++	    hw->chip_rev == CHIP_REV_YU_EC_U_B1)
++		reg |= GM_NEW_FLOW_CTRL;
++
+ 	gma_write16(hw, port, GM_SERIAL_MODE, reg);
+ 
+ 	/* virtual address for data */
+@@ -1413,8 +1417,7 @@ static void sky2_rx_start(struct sky2_port *sky2)
+ 	/* These chips have no ram buffer?
+ 	 * MAC Rx RAM Read is controlled by hardware */
+ 	if (hw->chip_id == CHIP_ID_YUKON_EC_U &&
+-	    (hw->chip_rev == CHIP_REV_YU_EC_U_A1
+-	     || hw->chip_rev == CHIP_REV_YU_EC_U_B0))
++	    hw->chip_rev > CHIP_REV_YU_EC_U_A0)
+ 		sky2_write32(hw, Q_ADDR(rxq, Q_TEST), F_M_RX_RAM_DIS);
+ 
+ 	sky2_prefetch_init(hw, rxq, sky2->rx_le_map, RX_LE_SIZE - 1);
+diff --git a/drivers/net/sky2.h b/drivers/net/sky2.h
+index a5e182d..1c4d6a3 100644
+--- a/drivers/net/sky2.h
++++ b/drivers/net/sky2.h
+@@ -557,6 +557,7 @@ enum yukon_ec_u_rev {
+ 	CHIP_REV_YU_EC_U_A0  = 1,
+ 	CHIP_REV_YU_EC_U_A1  = 2,
+ 	CHIP_REV_YU_EC_U_B0  = 3,
++	CHIP_REV_YU_EC_U_B1  = 5,
+ };
+ enum yukon_fe_rev {
+ 	CHIP_REV_YU_FE_A1    = 1,
+@@ -1775,10 +1776,13 @@ enum {
+ /*	GM_SERIAL_MODE			16 bit r/w	Serial Mode Register */
+ enum {
+ 	GM_SMOD_DATABL_MSK	= 0x1f<<11, /* Bit 15..11:	Data Blinder (r/o) */
+-	GM_SMOD_LIMIT_4		= 1<<10, /* Bit 10:	4 consecutive Tx trials */
+-	GM_SMOD_VLAN_ENA	= 1<<9,	/* Bit  9:	Enable VLAN  (Max. Frame Len) */
+-	GM_SMOD_JUMBO_ENA	= 1<<8,	/* Bit  8:	Enable Jumbo (Max. Frame Len) */
+-	 GM_SMOD_IPG_MSK	= 0x1f	/* Bit 4..0:	Inter-Packet Gap (IPG) */
++	GM_SMOD_LIMIT_4		= 1<<10, /* 4 consecutive Tx trials */
++	GM_SMOD_VLAN_ENA	= 1<<9,	 /* Enable VLAN  (Max. Frame Len) */
++	GM_SMOD_JUMBO_ENA	= 1<<8,	 /* Enable Jumbo (Max. Frame Len) */
++
++	GM_NEW_FLOW_CTRL	= 1<<6,	 /* Enable New Flow-Control */
++
++	GM_SMOD_IPG_MSK		= 0x1f	 /* Bit 4..0:	Inter-Packet Gap (IPG) */
+ };
+ 
+ #define DATA_BLIND_VAL(x)	(((x)<<11) & GM_SMOD_DATABL_MSK)
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/features/all/sky2/0044-sky2-add-XL-revisions.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/sky2/0044-sky2-add-XL-revisions.patch	Sun Aug 29 21:57:32 2010	(r16222)
@@ -0,0 +1,79 @@
+From: stephen hemminger <shemminger at vyatta.com>
+Date: Mon, 29 Mar 2010 07:36:19 +0000
+Subject: [PATCH 44/56] sky2: add XL revisions
+
+commit 4b7c47aa221191b2bd62c653ea851afe5b625162 upstream.
+
+Add definitions for Yukon XL revisions.
+
+Signed-off-by: Stephen Hemminger <shemminger at vyatta.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/sky2.c |   10 ++++++----
+ drivers/net/sky2.h |    8 ++++++++
+ 2 files changed, 14 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
+index 4b403bd..eec3699 100644
+--- a/drivers/net/sky2.c
++++ b/drivers/net/sky2.c
+@@ -226,7 +226,7 @@ static void sky2_power_on(struct sky2_hw *hw)
+ 	/* disable Core Clock Division, */
+ 	sky2_write32(hw, B2_Y2_CLK_CTRL, Y2_CLK_DIV_DIS);
+ 
+-	if (hw->chip_id == CHIP_ID_YUKON_XL && hw->chip_rev > 1)
++	if (hw->chip_id == CHIP_ID_YUKON_XL && hw->chip_rev > CHIP_REV_YU_XL_A1)
+ 		/* enable bits are inverted */
+ 		sky2_write8(hw, B2_Y2_CLK_GATE,
+ 			    Y2_PCI_CLK_LNK1_DIS | Y2_COR_CLK_LNK1_DIS |
+@@ -268,7 +268,7 @@ static void sky2_power_on(struct sky2_hw *hw)
+ 
+ static void sky2_power_aux(struct sky2_hw *hw)
+ {
+-	if (hw->chip_id == CHIP_ID_YUKON_XL && hw->chip_rev > 1)
++	if (hw->chip_id == CHIP_ID_YUKON_XL && hw->chip_rev > CHIP_REV_YU_XL_A1)
+ 		sky2_write8(hw, B2_Y2_CLK_GATE, 0);
+ 	else
+ 		/* enable bits are inverted */
+@@ -651,7 +651,7 @@ static void sky2_phy_power_up(struct sky2_hw *hw, unsigned port)
+ 	reg1 = sky2_pci_read32(hw, PCI_DEV_REG1);
+ 	reg1 &= ~phy_power[port];
+ 
+-	if (hw->chip_id == CHIP_ID_YUKON_XL && hw->chip_rev > 1)
++	if (hw->chip_id == CHIP_ID_YUKON_XL && hw->chip_rev > CHIP_REV_YU_XL_A1)
+ 		reg1 |= coma_mode[port];
+ 
+ 	sky2_pci_write32(hw, PCI_DEV_REG1, reg1);
+@@ -823,7 +823,9 @@ static void sky2_mac_init(struct sky2_hw *hw, unsigned port)
+ 
+ 	sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_RST_CLR);
+ 
+-	if (hw->chip_id == CHIP_ID_YUKON_XL && hw->chip_rev == 0 && port == 1) {
++	if (hw->chip_id == CHIP_ID_YUKON_XL &&
++	    hw->chip_rev == CHIP_REV_YU_XL_A0 &&
++	    port == 1) {
+ 		/* WA DEV_472 -- looks like crossed wires on port 2 */
+ 		/* clear GMAC 1 Control reset */
+ 		sky2_write8(hw, SK_REG(0, GMAC_CTRL), GMC_RST_CLR);
+diff --git a/drivers/net/sky2.h b/drivers/net/sky2.h
+index 1c4d6a3..0bebfb3 100644
+--- a/drivers/net/sky2.h
++++ b/drivers/net/sky2.h
+@@ -548,6 +548,14 @@ enum {
+ 	CHIP_ID_YUKON_UL_2 = 0xba, /* YUKON-2 Ultra 2 */
+ 	CHIP_ID_YUKON_OPT  = 0xbc, /* YUKON-2 Optima */
+ };
++
++enum yukon_xl_rev {
++	CHIP_REV_YU_XL_A0  = 0,
++	CHIP_REV_YU_XL_A1  = 1,
++	CHIP_REV_YU_XL_A2  = 2,
++	CHIP_REV_YU_XL_A3  = 3,
++};
++
+ enum yukon_ec_rev {
+ 	CHIP_REV_YU_EC_A1    = 0,  /* Chip Rev. for Yukon-EC A1/A0 */
+ 	CHIP_REV_YU_EC_A2    = 1,  /* Chip Rev. for Yukon-EC A2 */
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/features/all/sky2/0045-sky2-avoid-duplicate-link-up-on-Optima-chip.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/sky2/0045-sky2-avoid-duplicate-link-up-on-Optima-chip.patch	Sun Aug 29 21:57:32 2010	(r16222)
@@ -0,0 +1,32 @@
+From: stephen hemminger <shemminger at vyatta.com>
+Date: Mon, 29 Mar 2010 07:36:20 +0000
+Subject: [PATCH 45/56] sky2: avoid duplicate link up on Optima chip
+
+commit 9badba2543d165154c540b80e59ff06c1b3e3f76 upstream.
+
+The Optima version has feature to detect link quickly without PHY interrupt,
+but it causes duplicate link up events.
+
+Signed-off-by: Stephen Hemminger <shemminger at vyatta.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/sky2.c |    3 ++-
+ 1 files changed, 2 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
+index eec3699..f1c0ec3 100644
+--- a/drivers/net/sky2.c
++++ b/drivers/net/sky2.c
+@@ -2146,7 +2146,8 @@ static void sky2_phy_intr(struct sky2_hw *hw, unsigned port)
+ 		   istatus, phystat);
+ 
+ 	if (istatus & PHY_M_IS_AN_COMPL) {
+-		if (sky2_autoneg_done(sky2, phystat) == 0)
++		if (sky2_autoneg_done(sky2, phystat) == 0 &&
++		    !netif_carrier_ok(dev))
+ 			sky2_link_up(sky2);
+ 		goto out;
+ 	}
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/features/all/sky2/0047-sky2-size-status-ring-based-on-Tx-Rx-ring.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/sky2/0047-sky2-size-status-ring-based-on-Tx-Rx-ring.patch	Sun Aug 29 21:57:32 2010	(r16222)
@@ -0,0 +1,147 @@
+From: stephen hemminger <shemminger at vyatta.com>
+Date: Thu, 22 Apr 2010 13:42:56 +0000
+Subject: [PATCH 47/56] sky2: size status ring based on Tx/Rx ring
+
+commit efe91932e79cfe59a562b70d8eb18049b36debc6 upstream.
+
+Sky2 status ring must be big enough to handle worst case number
+of status messages. It was being oversized (to handle dual port cards),
+and excessive number of tx ring entries were allowed. This patch reduces
+the footprint and makes sure the value is enough.
+
+Later patch to add RSS increases the number of possible Rx status elements.
+
+Signed-off-by: Stephen Hemminger <shemminger at vyatta.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/sky2.c |   35 +++++++++++++++++++----------------
+ drivers/net/sky2.h |    1 +
+ 2 files changed, 20 insertions(+), 16 deletions(-)
+
+diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
+index 3a086d3..4f83f11 100644
+--- a/drivers/net/sky2.c
++++ b/drivers/net/sky2.c
+@@ -70,18 +70,15 @@
+    VLAN:GSO + CKSUM + Data + skb_frags * DMA */
+ #define MAX_SKB_TX_LE	(2 + (sizeof(dma_addr_t)/sizeof(u32))*(MAX_SKB_FRAGS+1))
+ #define TX_MIN_PENDING		(MAX_SKB_TX_LE+1)
+-#define TX_MAX_PENDING		4096
++#define TX_MAX_PENDING		1024
+ #define TX_DEF_PENDING		127
+ 
+-#define STATUS_RING_SIZE	2048	/* 2 ports * (TX + 2*RX) */
+-#define STATUS_LE_BYTES		(STATUS_RING_SIZE*sizeof(struct sky2_status_le))
+ #define TX_WATCHDOG		(5 * HZ)
+ #define NAPI_WEIGHT		64
+ #define PHY_RETRIES		1000
+ 
+ #define SKY2_EEPROM_MAGIC	0x9955aabb
+ 
+-
+ #define RING_NEXT(x,s)	(((x)+1) & ((s)-1))
+ 
+ static const u32 default_msg =
+@@ -2558,7 +2555,7 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do, u16 idx)
+ 		if (!(opcode & HW_OWNER))
+ 			break;
+ 
+-		hw->st_idx = RING_NEXT(hw->st_idx, STATUS_RING_SIZE);
++		hw->st_idx = RING_NEXT(hw->st_idx, hw->st_size);
+ 
+ 		port = le->css & CSS_LINK_BIT;
+ 		dev = hw->dev[port];
+@@ -3198,7 +3195,7 @@ static void sky2_reset(struct sky2_hw *hw)
+ 	for (i = 0; i < hw->ports; i++)
+ 		sky2_gmac_reset(hw, i);
+ 
+-	memset(hw->st_le, 0, STATUS_LE_BYTES);
++	memset(hw->st_le, 0, hw->st_size * sizeof(struct sky2_status_le));
+ 	hw->st_idx = 0;
+ 
+ 	sky2_write32(hw, STAT_CTRL, SC_STAT_RST_SET);
+@@ -3208,7 +3205,7 @@ static void sky2_reset(struct sky2_hw *hw)
+ 	sky2_write32(hw, STAT_LIST_ADDR_HI, (u64) hw->st_dma >> 32);
+ 
+ 	/* Set the list last index */
+-	sky2_write16(hw, STAT_LAST_IDX, STATUS_RING_SIZE - 1);
++	sky2_write16(hw, STAT_LAST_IDX, hw->st_size - 1);
+ 
+ 	sky2_write16(hw, STAT_TX_IDX_TH, 10);
+ 	sky2_write8(hw, STAT_FIFO_WM, 16);
+@@ -4256,12 +4253,13 @@ static int sky2_debug_show(struct seq_file *seq, void *v)
+ 	napi_disable(&hw->napi);
+ 	last = sky2_read16(hw, STAT_PUT_IDX);
+ 
++	seq_printf(seq, "Status ring %u\n", hw->st_size);
+ 	if (hw->st_idx == last)
+ 		seq_puts(seq, "Status ring (empty)\n");
+ 	else {
+ 		seq_puts(seq, "Status ring\n");
+-		for (idx = hw->st_idx; idx != last && idx < STATUS_RING_SIZE;
+-		     idx = RING_NEXT(idx, STATUS_RING_SIZE)) {
++		for (idx = hw->st_idx; idx != last && idx < hw->st_size;
++		     idx = RING_NEXT(idx, hw->st_size)) {
+ 			const struct sky2_status_le *le = hw->st_le + idx;
+ 			seq_printf(seq, "[%d] %#x %d %#x\n",
+ 				   idx, le->opcode, le->length, le->status);
+@@ -4689,15 +4687,17 @@ static int __devinit sky2_probe(struct pci_dev *pdev,
+ 		goto err_out_free_hw;
+ 	}
+ 
+-	/* ring for status responses */
+-	hw->st_le = pci_alloc_consistent(pdev, STATUS_LE_BYTES, &hw->st_dma);
+-	if (!hw->st_le)
+-		goto err_out_iounmap;
+-
+ 	err = sky2_init(hw);
+ 	if (err)
+ 		goto err_out_iounmap;
+ 
++	/* ring for status responses */
++	hw->st_size = hw->ports * roundup_pow_of_two(2*RX_MAX_PENDING + TX_MAX_PENDING);
++	hw->st_le = pci_alloc_consistent(pdev, hw->st_size * sizeof(struct sky2_status_le),
++					 &hw->st_dma);
++	if (!hw->st_le)
++		goto err_out_reset;
++
+ 	dev_info(&pdev->dev, "Yukon-2 %s chip revision %d\n",
+ 		 sky2_name(hw->chip_id, buf1, sizeof(buf1)), hw->chip_rev);
+ 
+@@ -4771,8 +4771,10 @@ err_out_unregister:
+ err_out_free_netdev:
+ 	free_netdev(dev);
+ err_out_free_pci:
++	pci_free_consistent(pdev, hw->st_size * sizeof(struct sky2_status_le),
++			    hw->st_le, hw->st_dma);
++err_out_reset:
+ 	sky2_write8(hw, B0_CTST, CS_RST_SET);
+-	pci_free_consistent(pdev, STATUS_LE_BYTES, hw->st_le, hw->st_dma);
+ err_out_iounmap:
+ 	iounmap(hw->regs);
+ err_out_free_hw:
+@@ -4810,7 +4812,8 @@ static void __devexit sky2_remove(struct pci_dev *pdev)
+ 	free_irq(pdev->irq, hw);
+ 	if (hw->flags & SKY2_HW_USE_MSI)
+ 		pci_disable_msi(pdev);
+-	pci_free_consistent(pdev, STATUS_LE_BYTES, hw->st_le, hw->st_dma);
++	pci_free_consistent(pdev, hw->st_size * sizeof(struct sky2_status_le),
++			    hw->st_le, hw->st_dma);
+ 	pci_release_regions(pdev);
+ 	pci_disable_device(pdev);
+ 
+diff --git a/drivers/net/sky2.h b/drivers/net/sky2.h
+index 0bebfb3..125b5bd 100644
+--- a/drivers/net/sky2.h
++++ b/drivers/net/sky2.h
+@@ -2268,6 +2268,7 @@ struct sky2_hw {
+ 	u8		     ports;
+ 
+ 	struct sky2_status_le *st_le;
++	u32		     st_size;
+ 	u32		     st_idx;
+ 	dma_addr_t   	     st_dma;
+ 
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/features/all/sky2/0050-sky2-Restore-multicast-after-restart.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/sky2/0050-sky2-Restore-multicast-after-restart.patch	Sun Aug 29 21:57:32 2010	(r16222)
@@ -0,0 +1,30 @@
+From: Mike McCormack <mikem at ring3k.org>
+Date: Thu, 13 May 2010 06:12:48 +0000
+Subject: [PATCH 50/56] sky2: Restore multicast after restart
+
+commit 37652522faa0877dc6d0dbb6b999bdccc07f0e89 upstream.
+
+Multicast settings will be lost on reset, so restore them.
+
+Signed-off-by: Mike McCormack <mikem at ring3k.org>
+Acked-by: Stephen Hemminger <shemminger at vyatta.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/sky2.c |    1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
+index bf9c05b..15da5e4 100644
+--- a/drivers/net/sky2.c
++++ b/drivers/net/sky2.c
+@@ -3347,6 +3347,7 @@ static void sky2_restart(struct work_struct *work)
+ 			continue;
+ 
+ 		sky2_hw_up(sky2);
++		sky2_set_multicast(dev);
+ 		netif_wake_queue(dev);
+ 	}
+ 
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/features/all/sky2/0051-sky2-Avoid-race-in-sky2_change_mtu.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/sky2/0051-sky2-Avoid-race-in-sky2_change_mtu.patch	Sun Aug 29 21:57:32 2010	(r16222)
@@ -0,0 +1,37 @@
+From: Mike McCormack <mikem at ring3k.org>
+Date: Thu, 13 May 2010 06:12:49 +0000
+Subject: [PATCH 51/56] sky2: Avoid race in sky2_change_mtu
+
+commit df01093bb08916f434ebedde4610805d4105d05f upstream.
+
+netif_stop_queue does not ensure all in-progress transmits are complete,
+ so use netif_tx_disable() instead.
+
+Secondly, make sure NAPI polls are disabled before stopping the tx queue,
+ otherwise sky2_status_intr might trigger a TX queue wakeup between when
+ we stop the queue and NAPI is disabled.
+
+Signed-off-by: Mike McCormack <mikem at ring3k.org>
+Acked-by: Stephen Hemminger <shemminger at vyatta.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/sky2.c |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
+index 15da5e4..efc31e9 100644
+--- a/drivers/net/sky2.c
++++ b/drivers/net/sky2.c
+@@ -2275,8 +2275,8 @@ static int sky2_change_mtu(struct net_device *dev, int new_mtu)
+ 	sky2_write32(hw, B0_IMSK, 0);
+ 
+ 	dev->trans_start = jiffies;	/* prevent tx timeout */
+-	netif_stop_queue(dev);
+ 	napi_disable(&hw->napi);
++	netif_tx_disable(dev);
+ 
+ 	synchronize_irq(hw->pdev->irq);
+ 
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/features/all/sky2/0052-sky2-Shut-off-interrupts-before-NAPI.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/sky2/0052-sky2-Shut-off-interrupts-before-NAPI.patch	Sun Aug 29 21:57:32 2010	(r16222)
@@ -0,0 +1,36 @@
+From: Mike McCormack <mikem at ring3k.org>
+Date: Thu, 13 May 2010 06:12:50 +0000
+Subject: [PATCH 52/56] sky2: Shut off interrupts before NAPI
+
+commit 93135a3be0d909fabca9c4329177f71ae71b6847 upstream.
+
+Interrupts should be masked, then synchronized, and
+finally NAPI should be disabled.
+
+Signed-off-by: Mike McCormack <mikem at ring3k.org>
+Acked-by: Stephen Hemminger <shemminger at vyatta.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/sky2.c |    4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
+index efc31e9..f13a45f 100644
+--- a/drivers/net/sky2.c
++++ b/drivers/net/sky2.c
+@@ -3320,10 +3320,10 @@ static void sky2_restart(struct work_struct *work)
+ 
+ 	rtnl_lock();
+ 
+-	napi_disable(&hw->napi);
+-	synchronize_irq(hw->pdev->irq);
+ 	imask = sky2_read32(hw, B0_IMSK);
+ 	sky2_write32(hw, B0_IMSK, 0);
++	synchronize_irq(hw->pdev->irq);
++	napi_disable(&hw->napi);
+ 
+ 	for (i = 0; i < hw->ports; i++) {
+ 		struct net_device *dev = hw->dev[i];
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/features/all/sky2/0053-sky2-Refactor-down-up-code-out-of-sky2_restart.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/sky2/0053-sky2-Refactor-down-up-code-out-of-sky2_restart.patch	Sun Aug 29 21:57:32 2010	(r16222)
@@ -0,0 +1,84 @@
+From: Mike McCormack <mikem at ring3k.org>
+Date: Thu, 13 May 2010 06:12:51 +0000
+Subject: [PATCH 53/56] sky2: Refactor down/up code out of sky2_restart()
+
+commit d72ff8fa7f8b344382963721f842256825c4660b upstream.
+
+Code to bring down all sky2 interfaces and bring it up
+again can be reused in sky2_suspend and sky2_resume.
+
+Factor the code to bring the interfaces down into
+sky2_all_down and the up code into sky2_all_up.
+
+Signed-off-by: Mike McCormack <mikem at ring3k.org>
+Acked-by: Stephen Hemminger <shemminger at vyatta.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/sky2.c |   26 +++++++++++++++++++-------
+ 1 files changed, 19 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
+index f13a45f..cc6f312 100644
+--- a/drivers/net/sky2.c
++++ b/drivers/net/sky2.c
+@@ -3312,15 +3312,11 @@ static int sky2_reattach(struct net_device *dev)
+ 	return err;
+ }
+ 
+-static void sky2_restart(struct work_struct *work)
++static void sky2_all_down(struct sky2_hw *hw)
+ {
+-	struct sky2_hw *hw = container_of(work, struct sky2_hw, restart_work);
+-	u32 imask;
+ 	int i;
+ 
+-	rtnl_lock();
+-
+-	imask = sky2_read32(hw, B0_IMSK);
++	sky2_read32(hw, B0_IMSK);
+ 	sky2_write32(hw, B0_IMSK, 0);
+ 	synchronize_irq(hw->pdev->irq);
+ 	napi_disable(&hw->napi);
+@@ -3336,8 +3332,12 @@ static void sky2_restart(struct work_struct *work)
+ 		netif_tx_disable(dev);
+ 		sky2_hw_down(sky2);
+ 	}
++}
+ 
+-	sky2_reset(hw);
++static void sky2_all_up(struct sky2_hw *hw)
++{
++	u32 imask = Y2_IS_BASE;
++	int i;
+ 
+ 	for (i = 0; i < hw->ports; i++) {
+ 		struct net_device *dev = hw->dev[i];
+@@ -3348,6 +3348,7 @@ static void sky2_restart(struct work_struct *work)
+ 
+ 		sky2_hw_up(sky2);
+ 		sky2_set_multicast(dev);
++		imask |= portirq_msk[i];
+ 		netif_wake_queue(dev);
+ 	}
+ 
+@@ -3356,6 +3357,17 @@ static void sky2_restart(struct work_struct *work)
+ 
+ 	sky2_read32(hw, B0_Y2_SP_LISR);
+ 	napi_enable(&hw->napi);
++}
++
++static void sky2_restart(struct work_struct *work)
++{
++	struct sky2_hw *hw = container_of(work, struct sky2_hw, restart_work);
++
++	rtnl_lock();
++
++	sky2_all_down(hw);
++	sky2_reset(hw);
++	sky2_all_up(hw);
+ 
+ 	rtnl_unlock();
+ }
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/features/all/sky2/0054-sky2-Avoid-allocating-memory-in-sky2_resume.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/sky2/0054-sky2-Avoid-allocating-memory-in-sky2_resume.patch	Sun Aug 29 21:57:32 2010	(r16222)
@@ -0,0 +1,88 @@
+From: Mike McCormack <mikem at ring3k.org>
+Date: Thu, 13 May 2010 06:12:52 +0000
+Subject: [PATCH 54/56] sky2: Avoid allocating memory in sky2_resume
+
+commit 3403aca2320274dc5c617dc2f0cc358771a51be9 upstream.
+
+Allocating memory can fail, and since we have the memory we need
+in sky2_resume when sky2_suspend is called, just stop the hardware
+without freeing the memory it's using.
+
+This avoids the possibility of failing because we can't allocate
+memory in sky2_resume(), and allows sharing code with sky2_restart().
+
+Signed-off-by: Mike McCormack <mikem at ring3k.org>
+Acked-by: Stephen Hemminger <shemminger at vyatta.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/sky2.c |   20 +++++---------------
+ 1 files changed, 5 insertions(+), 15 deletions(-)
+
+diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
+index cc6f312..c2d6117 100644
+--- a/drivers/net/sky2.c
++++ b/drivers/net/sky2.c
+@@ -4926,12 +4926,12 @@ static int sky2_suspend(struct pci_dev *pdev, pm_message_t state)
+ 	cancel_work_sync(&hw->restart_work);
+ 
+ 	rtnl_lock();
++
++	sky2_all_down(hw);
+ 	for (i = 0; i < hw->ports; i++) {
+ 		struct net_device *dev = hw->dev[i];
+ 		struct sky2_port *sky2 = netdev_priv(dev);
+ 
+-		sky2_detach(dev);
+-
+ 		if (sky2->wol)
+ 			sky2_wol_init(sky2);
+ 
+@@ -4940,8 +4940,6 @@ static int sky2_suspend(struct pci_dev *pdev, pm_message_t state)
+ 
+ 	device_set_wakeup_enable(&pdev->dev, wol != 0);
+ 
+-	sky2_write32(hw, B0_IMSK, 0);
+-	napi_disable(&hw->napi);
+ 	sky2_power_aux(hw);
+ 	rtnl_unlock();
+ 
+@@ -4956,12 +4954,11 @@ static int sky2_suspend(struct pci_dev *pdev, pm_message_t state)
+ static int sky2_resume(struct pci_dev *pdev)
+ {
+ 	struct sky2_hw *hw = pci_get_drvdata(pdev);
+-	int i, err;
++	int err;
+ 
+ 	if (!hw)
+ 		return 0;
+ 
+-	rtnl_lock();
+ 	err = pci_set_power_state(pdev, PCI_D0);
+ 	if (err)
+ 		goto out;
+@@ -4979,20 +4976,13 @@ static int sky2_resume(struct pci_dev *pdev)
+ 		goto out;
+ 	}
+ 
++	rtnl_lock();
+ 	sky2_reset(hw);
+-	sky2_write32(hw, B0_IMSK, Y2_IS_BASE);
+-	napi_enable(&hw->napi);
+-
+-	for (i = 0; i < hw->ports; i++) {
+-		err = sky2_reattach(hw->dev[i]);
+-		if (err)
+-			goto out;
+-	}
++	sky2_all_up(hw);
+ 	rtnl_unlock();
+ 
+ 	return 0;
+ out:
+-	rtnl_unlock();
+ 
+ 	dev_err(&pdev->dev, "resume failed (%d)\n", err);
+ 	pci_disable_device(pdev);
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/features/all/sky2/0055-sky2-version-1.28.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/sky2/0055-sky2-version-1.28.patch	Sun Aug 29 21:57:32 2010	(r16222)
@@ -0,0 +1,23 @@
+From: stephen hemminger <shemminger at vyatta.com>
+Date: Thu, 13 May 2010 06:12:53 +0000
+Subject: [PATCH 55/56] sky2: version 1.28
+
+commit e0a67e2dd9aa01a59cd91a7b39a6af1282bbc214 upstream.
+
+Version 1.28
+
+Signed-off-by: Stephen Hemminger <shemminger at vyatta.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+[bwh: Adjust context for 2.6.32]
+---
+--- a/drivers/net/sky2.c
++++ b/drivers/net/sky2.c
+@@ -53,7 +53,7 @@
+ #include "sky2.h"
+ 
+ #define DRV_NAME		"sky2"
+-#define DRV_VERSION		"1.27"
++#define DRV_VERSION		"1.28"
+ #define PFX			DRV_NAME " "
+ 
+ /*

Modified: dists/sid/linux-2.6/debian/patches/series/22
==============================================================================
--- dists/sid/linux-2.6/debian/patches/series/22	Sun Aug 29 20:12:03 2010	(r16221)
+++ dists/sid/linux-2.6/debian/patches/series/22	Sun Aug 29 21:57:32 2010	(r16222)
@@ -31,3 +31,45 @@
 + debian/rt-2860-2870-sta-Enable-channels-12-14.patch
 + bugfix/all/SCSI-mptsas-fix-hangs-caused-by-ATA-pass-through.patch
 + bugfix/all/r8192u_usb-Don-t-export-symbols-from-ieee80211-stack.patch
++ features/all/sky2/0002-sky2-add-SK-9E21M-device-id.patch
++ features/all/sky2/0003-sky2-add-register-definitions-for-new-chips.patch
++ features/all/sky2/0004-sky2-fix-receive-pause-thresholds.patch
++ features/all/sky2/0005-sky2-workarounds-for-Yukon-2-supreme.patch
++ features/all/sky2/0006-sky2-88E8059-support.patch
++ features/all/sky2/0007-sky2-version-1.26.patch
++ features/all/sky2/0009-sky2-fix-sky2_link_down-copy-paste-comment-error.patch
++ features/all/sky2/0010-net-Fix-Yukon-2-Optima-TCP-offload-setup.patch
++ features/all/sky2/0011-net-Add-missing-TST_CFG_WRITE-bits-around-sky2_pci_w.patch
++ features/all/sky2/0012-sky2-print-Optima-chip-name.patch
++ features/all/sky2/0013-sky2-leave-PCI-config-space-writeable.patch
++ features/all/sky2/0015-sky2-Refactor-sky2_get_regs-into-two-functions.patch
++ features/all/sky2/0016-sky2-Lock-transmit-queue-while-disabling-device.patch
++ features/all/sky2/0018-sky2-Enable-disable-WOL-per-hardware-device.patch
++ features/all/sky2/0019-sky2-revert-config-space-change.patch
++ features/all/sky2/0020-sky2-Fix-TX_MAP_PAGE-misspelling.patch
++ features/all/sky2/0022-sky2-hand-receive-DMA-mapping-failures.patch
++ features/all/sky2/0023-sky2-Flow-control-frames-recorded-as-dropped-packets.patch
++ features/all/sky2/0024-sky2-resume-clocks.patch
++ features/all/sky2/0025-sky2-disable-ASF-on-Yukon-Supreme.patch
++ features/all/sky2/0026-sky2-receive-checksum-refactoring.patch
++ features/all/sky2/0028-sky2-fix-sparse-warning.patch
++ features/all/sky2/0029-sky2-WoL-changes.patch
++ features/all/sky2/0030-sky2-dont-enable-PME-legacy-mode.patch
++ features/all/sky2/0031-sky2-jumbo-packet-changes.patch
++ features/all/sky2/0032-sky2-Factor-out-code-to-calculate-packet-sizes.patch
++ features/all/sky2/0033-sky2-Allocate-initial-skbs-in-sky2_alloc_buffers.patch
++ features/all/sky2/0034-sky2-Refactor-sky2_up-into-two-functions.patch
++ features/all/sky2/0035-sky2-Refactor-sky2_down-into-two-functions.patch
++ features/all/sky2/0036-sky2-Avoid-down-and-up-during-sky2_reset.patch
++ features/all/sky2/0037-sky2-version-1.27.patch
++ features/all/sky2/0041-sky2-Avoid-rtnl_unlock-without-rtnl_lock.patch
++ features/all/sky2/0043-sky2-support-Yukon-EC_U-rev-B1-and-later.patch
++ features/all/sky2/0044-sky2-add-XL-revisions.patch
++ features/all/sky2/0045-sky2-avoid-duplicate-link-up-on-Optima-chip.patch
++ features/all/sky2/0047-sky2-size-status-ring-based-on-Tx-Rx-ring.patch
++ features/all/sky2/0050-sky2-Restore-multicast-after-restart.patch
++ features/all/sky2/0051-sky2-Avoid-race-in-sky2_change_mtu.patch
++ features/all/sky2/0052-sky2-Shut-off-interrupts-before-NAPI.patch
++ features/all/sky2/0053-sky2-Refactor-down-up-code-out-of-sky2_restart.patch
++ features/all/sky2/0054-sky2-Avoid-allocating-memory-in-sky2_resume.patch
++ features/all/sky2/0055-sky2-version-1.28.patch



More information about the Kernel-svn-changes mailing list