Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next-2.6 10/17] sfc: Move SPI state to struct falcon_nic_data
From: Ben Hutchings @ 2010-12-02 23:47 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-net-drivers
In-Reply-To: <1291333490.3259.23.camel@bwh-desktop>

We only have direct access to SPI on Falcon, so move all this state
out of struct efx_nic.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 drivers/net/sfc/efx.c        |    4 --
 drivers/net/sfc/falcon.c     |   91 ++++++++++++++++++-----------------------
 drivers/net/sfc/mtd.c        |   29 ++++++++------
 drivers/net/sfc/net_driver.h |    8 ----
 drivers/net/sfc/nic.h        |    7 +++
 drivers/net/sfc/spi.h        |    5 ++
 6 files changed, 69 insertions(+), 75 deletions(-)

diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c
index b4580c4..6aed6ac 100644
--- a/drivers/net/sfc/efx.c
+++ b/drivers/net/sfc/efx.c
@@ -1961,7 +1961,6 @@ void efx_reset_down(struct efx_nic *efx, enum reset_type method)
 
 	efx_stop_all(efx);
 	mutex_lock(&efx->mac_lock);
-	mutex_lock(&efx->spi_lock);
 
 	efx_fini_channels(efx);
 	if (efx->port_initialized && method != RESET_TYPE_INVISIBLE)
@@ -2003,7 +2002,6 @@ int efx_reset_up(struct efx_nic *efx, enum reset_type method, bool ok)
 	efx_init_channels(efx);
 	efx_restore_filters(efx);
 
-	mutex_unlock(&efx->spi_lock);
 	mutex_unlock(&efx->mac_lock);
 
 	efx_start_all(efx);
@@ -2013,7 +2011,6 @@ int efx_reset_up(struct efx_nic *efx, enum reset_type method, bool ok)
 fail:
 	efx->port_initialized = false;
 
-	mutex_unlock(&efx->spi_lock);
 	mutex_unlock(&efx->mac_lock);
 
 	return rc;
@@ -2202,7 +2199,6 @@ static int efx_init_struct(struct efx_nic *efx, struct efx_nic_type *type,
 	memset(efx, 0, sizeof(*efx));
 	spin_lock_init(&efx->biu_lock);
 	mutex_init(&efx->mdio_lock);
-	mutex_init(&efx->spi_lock);
 #ifdef CONFIG_SFC_MTD
 	INIT_LIST_HEAD(&efx->mtd_list);
 #endif
diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c
index fe15084..ca59f7e 100644
--- a/drivers/net/sfc/falcon.c
+++ b/drivers/net/sfc/falcon.c
@@ -254,7 +254,6 @@ int falcon_spi_cmd(struct efx_nic *efx, const struct efx_spi_device *spi,
 	/* Input validation */
 	if (len > FALCON_SPI_MAX_LEN)
 		return -EINVAL;
-	BUG_ON(!mutex_is_locked(&efx->spi_lock));
 
 	/* Check that previous command is not still running */
 	rc = falcon_spi_poll(efx);
@@ -888,6 +887,7 @@ static void falcon_remove_port(struct efx_nic *efx)
 static int
 falcon_read_nvram(struct efx_nic *efx, struct falcon_nvconfig *nvconfig_out)
 {
+	struct falcon_nic_data *nic_data = efx->nic_data;
 	struct falcon_nvconfig *nvconfig;
 	struct efx_spi_device *spi;
 	void *region;
@@ -895,8 +895,11 @@ falcon_read_nvram(struct efx_nic *efx, struct falcon_nvconfig *nvconfig_out)
 	__le16 *word, *limit;
 	u32 csum;
 
-	spi = efx->spi_flash ? efx->spi_flash : efx->spi_eeprom;
-	if (!spi)
+	if (efx_spi_present(&nic_data->spi_flash))
+		spi = &nic_data->spi_flash;
+	else if (efx_spi_present(&nic_data->spi_eeprom))
+		spi = &nic_data->spi_eeprom;
+	else
 		return -EINVAL;
 
 	region = kmalloc(FALCON_NVCONFIG_END, GFP_KERNEL);
@@ -904,12 +907,13 @@ falcon_read_nvram(struct efx_nic *efx, struct falcon_nvconfig *nvconfig_out)
 		return -ENOMEM;
 	nvconfig = region + FALCON_NVCONFIG_OFFSET;
 
-	mutex_lock(&efx->spi_lock);
+	mutex_lock(&nic_data->spi_lock);
 	rc = falcon_spi_read(efx, spi, 0, FALCON_NVCONFIG_END, NULL, region);
-	mutex_unlock(&efx->spi_lock);
+	mutex_unlock(&nic_data->spi_lock);
 	if (rc) {
 		netif_err(efx, hw, efx->net_dev, "Failed to read %s\n",
-			  efx->spi_flash ? "flash" : "EEPROM");
+			  efx_spi_present(&nic_data->spi_flash) ?
+			  "flash" : "EEPROM");
 		rc = -EIO;
 		goto out;
 	}
@@ -1011,7 +1015,7 @@ static int falcon_b0_test_registers(struct efx_nic *efx)
 
 /* Resets NIC to known state.  This routine must be called in process
  * context and is allowed to sleep. */
-static int falcon_reset_hw(struct efx_nic *efx, enum reset_type method)
+static int __falcon_reset_hw(struct efx_nic *efx, enum reset_type method)
 {
 	struct falcon_nic_data *nic_data = efx->nic_data;
 	efx_oword_t glb_ctl_reg_ker;
@@ -1107,6 +1111,18 @@ fail5:
 	return rc;
 }
 
+static int falcon_reset_hw(struct efx_nic *efx, enum reset_type method)
+{
+	struct falcon_nic_data *nic_data = efx->nic_data;
+	int rc;
+
+	mutex_lock(&nic_data->spi_lock);
+	rc = __falcon_reset_hw(efx, method);
+	mutex_unlock(&nic_data->spi_lock);
+
+	return rc;
+}
+
 static void falcon_monitor(struct efx_nic *efx)
 {
 	bool link_changed;
@@ -1188,16 +1204,11 @@ static int falcon_reset_sram(struct efx_nic *efx)
 	return -ETIMEDOUT;
 }
 
-static int falcon_spi_device_init(struct efx_nic *efx,
-				  struct efx_spi_device **spi_device_ret,
+static void falcon_spi_device_init(struct efx_nic *efx,
+				  struct efx_spi_device *spi_device,
 				  unsigned int device_id, u32 device_type)
 {
-	struct efx_spi_device *spi_device;
-
 	if (device_type != 0) {
-		spi_device = kzalloc(sizeof(*spi_device), GFP_KERNEL);
-		if (!spi_device)
-			return -ENOMEM;
 		spi_device->device_id = device_id;
 		spi_device->size =
 			1 << SPI_DEV_TYPE_FIELD(device_type, SPI_DEV_TYPE_SIZE);
@@ -1214,25 +1225,14 @@ static int falcon_spi_device_init(struct efx_nic *efx,
 			1 << SPI_DEV_TYPE_FIELD(device_type,
 						SPI_DEV_TYPE_BLOCK_SIZE);
 	} else {
-		spi_device = NULL;
+		spi_device->size = 0;
 	}
-
-	kfree(*spi_device_ret);
-	*spi_device_ret = spi_device;
-	return 0;
-}
-
-static void falcon_remove_spi_devices(struct efx_nic *efx)
-{
-	kfree(efx->spi_eeprom);
-	efx->spi_eeprom = NULL;
-	kfree(efx->spi_flash);
-	efx->spi_flash = NULL;
 }
 
 /* Extract non-volatile configuration */
 static int falcon_probe_nvconfig(struct efx_nic *efx)
 {
+	struct falcon_nic_data *nic_data = efx->nic_data;
 	struct falcon_nvconfig *nvconfig;
 	int rc;
 
@@ -1242,24 +1242,20 @@ static int falcon_probe_nvconfig(struct efx_nic *efx)
 
 	rc = falcon_read_nvram(efx, nvconfig);
 	if (rc)
-		goto fail1;
+		goto out;
 
 	efx->phy_type = nvconfig->board_v2.port0_phy_type;
 	efx->mdio.prtad = nvconfig->board_v2.port0_phy_addr;
 
 	if (le16_to_cpu(nvconfig->board_struct_ver) >= 3) {
-		rc = falcon_spi_device_init(
-			efx, &efx->spi_flash, FFE_AB_SPI_DEVICE_FLASH,
+		falcon_spi_device_init(
+			efx, &nic_data->spi_flash, FFE_AB_SPI_DEVICE_FLASH,
 			le32_to_cpu(nvconfig->board_v3
 				    .spi_device_type[FFE_AB_SPI_DEVICE_FLASH]));
-		if (rc)
-			goto fail2;
-		rc = falcon_spi_device_init(
-			efx, &efx->spi_eeprom, FFE_AB_SPI_DEVICE_EEPROM,
+		falcon_spi_device_init(
+			efx, &nic_data->spi_eeprom, FFE_AB_SPI_DEVICE_EEPROM,
 			le32_to_cpu(nvconfig->board_v3
 				    .spi_device_type[FFE_AB_SPI_DEVICE_EEPROM]));
-		if (rc)
-			goto fail2;
 	}
 
 	/* Read the MAC addresses */
@@ -1270,15 +1266,7 @@ static int falcon_probe_nvconfig(struct efx_nic *efx)
 
 	rc = falcon_probe_board(efx,
 				le16_to_cpu(nvconfig->board_v2.board_revision));
-	if (rc)
-		goto fail2;
-
-	kfree(nvconfig);
-	return 0;
-
- fail2:
-	falcon_remove_spi_devices(efx);
- fail1:
+out:
 	kfree(nvconfig);
 	return rc;
 }
@@ -1286,6 +1274,7 @@ static int falcon_probe_nvconfig(struct efx_nic *efx)
 /* Probe all SPI devices on the NIC */
 static void falcon_probe_spi_devices(struct efx_nic *efx)
 {
+	struct falcon_nic_data *nic_data = efx->nic_data;
 	efx_oword_t nic_stat, gpio_ctl, ee_vpd_cfg;
 	int boot_dev;
 
@@ -1314,12 +1303,14 @@ static void falcon_probe_spi_devices(struct efx_nic *efx)
 		efx_writeo(efx, &ee_vpd_cfg, FR_AB_EE_VPD_CFG0);
 	}
 
+	mutex_init(&nic_data->spi_lock);
+
 	if (boot_dev == FFE_AB_SPI_DEVICE_FLASH)
-		falcon_spi_device_init(efx, &efx->spi_flash,
+		falcon_spi_device_init(efx, &nic_data->spi_flash,
 				       FFE_AB_SPI_DEVICE_FLASH,
 				       default_flash_type);
 	if (boot_dev == FFE_AB_SPI_DEVICE_EEPROM)
-		falcon_spi_device_init(efx, &efx->spi_eeprom,
+		falcon_spi_device_init(efx, &nic_data->spi_eeprom,
 				       FFE_AB_SPI_DEVICE_EEPROM,
 				       large_eeprom_type);
 }
@@ -1384,7 +1375,7 @@ static int falcon_probe_nic(struct efx_nic *efx)
 	}
 
 	/* Now we can reset the NIC */
-	rc = falcon_reset_hw(efx, RESET_TYPE_ALL);
+	rc = __falcon_reset_hw(efx, RESET_TYPE_ALL);
 	if (rc) {
 		netif_err(efx, probe, efx->net_dev, "failed to reset NIC\n");
 		goto fail3;
@@ -1442,7 +1433,6 @@ static int falcon_probe_nic(struct efx_nic *efx)
 	BUG_ON(i2c_del_adapter(&board->i2c_adap));
 	memset(&board->i2c_adap, 0, sizeof(board->i2c_adap));
  fail5:
-	falcon_remove_spi_devices(efx);
 	efx_nic_free_buffer(efx, &efx->irq_status);
  fail4:
  fail3:
@@ -1596,10 +1586,9 @@ static void falcon_remove_nic(struct efx_nic *efx)
 	BUG_ON(rc);
 	memset(&board->i2c_adap, 0, sizeof(board->i2c_adap));
 
-	falcon_remove_spi_devices(efx);
 	efx_nic_free_buffer(efx, &efx->irq_status);
 
-	falcon_reset_hw(efx, RESET_TYPE_ALL);
+	__falcon_reset_hw(efx, RESET_TYPE_ALL);
 
 	/* Release the second function after the reset */
 	if (nic_data->pci_dev2) {
diff --git a/drivers/net/sfc/mtd.c b/drivers/net/sfc/mtd.c
index d44c745..d386274 100644
--- a/drivers/net/sfc/mtd.c
+++ b/drivers/net/sfc/mtd.c
@@ -321,14 +321,15 @@ static int falcon_mtd_read(struct mtd_info *mtd, loff_t start,
 	struct efx_mtd *efx_mtd = mtd->priv;
 	const struct efx_spi_device *spi = efx_mtd->spi;
 	struct efx_nic *efx = efx_mtd->efx;
+	struct falcon_nic_data *nic_data = efx->nic_data;
 	int rc;
 
-	rc = mutex_lock_interruptible(&efx->spi_lock);
+	rc = mutex_lock_interruptible(&nic_data->spi_lock);
 	if (rc)
 		return rc;
 	rc = falcon_spi_read(efx, spi, part->offset + start, len,
 			     retlen, buffer);
-	mutex_unlock(&efx->spi_lock);
+	mutex_unlock(&nic_data->spi_lock);
 	return rc;
 }
 
@@ -337,13 +338,14 @@ static int falcon_mtd_erase(struct mtd_info *mtd, loff_t start, size_t len)
 	struct efx_mtd_partition *part = to_efx_mtd_partition(mtd);
 	struct efx_mtd *efx_mtd = mtd->priv;
 	struct efx_nic *efx = efx_mtd->efx;
+	struct falcon_nic_data *nic_data = efx->nic_data;
 	int rc;
 
-	rc = mutex_lock_interruptible(&efx->spi_lock);
+	rc = mutex_lock_interruptible(&nic_data->spi_lock);
 	if (rc)
 		return rc;
 	rc = efx_spi_erase(part, part->offset + start, len);
-	mutex_unlock(&efx->spi_lock);
+	mutex_unlock(&nic_data->spi_lock);
 	return rc;
 }
 
@@ -354,14 +356,15 @@ static int falcon_mtd_write(struct mtd_info *mtd, loff_t start,
 	struct efx_mtd *efx_mtd = mtd->priv;
 	const struct efx_spi_device *spi = efx_mtd->spi;
 	struct efx_nic *efx = efx_mtd->efx;
+	struct falcon_nic_data *nic_data = efx->nic_data;
 	int rc;
 
-	rc = mutex_lock_interruptible(&efx->spi_lock);
+	rc = mutex_lock_interruptible(&nic_data->spi_lock);
 	if (rc)
 		return rc;
 	rc = falcon_spi_write(efx, spi, part->offset + start, len,
 			      retlen, buffer);
-	mutex_unlock(&efx->spi_lock);
+	mutex_unlock(&nic_data->spi_lock);
 	return rc;
 }
 
@@ -370,11 +373,12 @@ static int falcon_mtd_sync(struct mtd_info *mtd)
 	struct efx_mtd_partition *part = to_efx_mtd_partition(mtd);
 	struct efx_mtd *efx_mtd = mtd->priv;
 	struct efx_nic *efx = efx_mtd->efx;
+	struct falcon_nic_data *nic_data = efx->nic_data;
 	int rc;
 
-	mutex_lock(&efx->spi_lock);
+	mutex_lock(&nic_data->spi_lock);
 	rc = efx_spi_slow_wait(part, true);
-	mutex_unlock(&efx->spi_lock);
+	mutex_unlock(&nic_data->spi_lock);
 	return rc;
 }
 
@@ -387,14 +391,15 @@ static struct efx_mtd_ops falcon_mtd_ops = {
 
 static int falcon_mtd_probe(struct efx_nic *efx)
 {
+	struct falcon_nic_data *nic_data = efx->nic_data;
 	struct efx_spi_device *spi;
 	struct efx_mtd *efx_mtd;
 	int rc = -ENODEV;
 
 	ASSERT_RTNL();
 
-	spi = efx->spi_flash;
-	if (spi && spi->size > FALCON_FLASH_BOOTCODE_START) {
+	spi = &nic_data->spi_flash;
+	if (efx_spi_present(spi) && spi->size > FALCON_FLASH_BOOTCODE_START) {
 		efx_mtd = kzalloc(sizeof(*efx_mtd) + sizeof(efx_mtd->part[0]),
 				  GFP_KERNEL);
 		if (!efx_mtd)
@@ -419,8 +424,8 @@ static int falcon_mtd_probe(struct efx_nic *efx)
 		}
 	}
 
-	spi = efx->spi_eeprom;
-	if (spi && spi->size > EFX_EEPROM_BOOTCONFIG_START) {
+	spi = &nic_data->spi_eeprom;
+	if (efx_spi_present(spi) && spi->size > EFX_EEPROM_BOOTCONFIG_START) {
 		efx_mtd = kzalloc(sizeof(*efx_mtd) + sizeof(efx_mtd->part[0]),
 				  GFP_KERNEL);
 		if (!efx_mtd)
diff --git a/drivers/net/sfc/net_driver.h b/drivers/net/sfc/net_driver.h
index 0a7e26d..e5ee2d5 100644
--- a/drivers/net/sfc/net_driver.h
+++ b/drivers/net/sfc/net_driver.h
@@ -657,11 +657,6 @@ struct efx_filter_state;
  *	to verify that an interrupt has occurred.
  * @irq_zero_count: Number of legacy IRQs seen with queue flags == 0
  * @fatal_irq_level: IRQ level (bit number) used for serious errors
- * @spi_flash: SPI flash device
- *	This field will be %NULL if no flash device is present (or for Siena).
- * @spi_eeprom: SPI EEPROM device
- *	This field will be %NULL if no EEPROM device is present (or for Siena).
- * @spi_lock: SPI bus lock
  * @mtd_list: List of MTDs attached to the NIC
  * @n_rx_nodesc_drop_cnt: RX no descriptor drop count
  * @nic_data: Hardware dependant state
@@ -746,9 +741,6 @@ struct efx_nic {
 	unsigned irq_zero_count;
 	unsigned fatal_irq_level;
 
-	struct efx_spi_device *spi_flash;
-	struct efx_spi_device *spi_eeprom;
-	struct mutex spi_lock;
 #ifdef CONFIG_SFC_MTD
 	struct list_head mtd_list;
 #endif
diff --git a/drivers/net/sfc/nic.h b/drivers/net/sfc/nic.h
index 0438dc9..2a0fff3 100644
--- a/drivers/net/sfc/nic.h
+++ b/drivers/net/sfc/nic.h
@@ -15,6 +15,7 @@
 #include "net_driver.h"
 #include "efx.h"
 #include "mcdi.h"
+#include "spi.h"
 
 /*
  * Falcon hardware control
@@ -113,6 +114,9 @@ struct falcon_board {
  * @stats_pending: Is there a pending DMA of MAC statistics.
  * @stats_timer: A timer for regularly fetching MAC statistics.
  * @stats_dma_done: Pointer to the flag which indicates DMA completion.
+ * @spi_flash: SPI flash device
+ * @spi_eeprom: SPI EEPROM device
+ * @spi_lock: SPI bus lock
  */
 struct falcon_nic_data {
 	struct pci_dev *pci_dev2;
@@ -121,6 +125,9 @@ struct falcon_nic_data {
 	bool stats_pending;
 	struct timer_list stats_timer;
 	u32 *stats_dma_done;
+	struct efx_spi_device spi_flash;
+	struct efx_spi_device spi_eeprom;
+	struct mutex spi_lock;
 };
 
 static inline struct falcon_board *falcon_board(struct efx_nic *efx)
diff --git a/drivers/net/sfc/spi.h b/drivers/net/sfc/spi.h
index 8bf4fce..879b7f6 100644
--- a/drivers/net/sfc/spi.h
+++ b/drivers/net/sfc/spi.h
@@ -61,6 +61,11 @@ struct efx_spi_device {
 	unsigned int block_size;
 };
 
+static inline bool efx_spi_present(const struct efx_spi_device *spi)
+{
+	return spi->size != 0;
+}
+
 int falcon_spi_cmd(struct efx_nic *efx,
 		   const struct efx_spi_device *spi, unsigned int command,
 		   int address, const void* in, void *out, size_t len);
-- 
1.7.3.2



-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


^ permalink raw reply related

* [PATCH net-next-2.6 09/17] sfc: Remove unnecessary inclusion of various private header files
From: Ben Hutchings @ 2010-12-02 23:47 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-net-drivers
In-Reply-To: <1291333490.3259.23.camel@bwh-desktop>

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 drivers/net/sfc/efx.c           |    1 -
 drivers/net/sfc/ethtool.c       |    1 -
 drivers/net/sfc/falcon.c        |    1 -
 drivers/net/sfc/falcon_boards.c |    2 --
 drivers/net/sfc/falcon_xmac.c   |    1 -
 drivers/net/sfc/mcdi_phy.c      |    1 -
 drivers/net/sfc/mdio_10g.c      |    1 -
 drivers/net/sfc/tenxpress.c     |    2 --
 8 files changed, 0 insertions(+), 10 deletions(-)

diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c
index 05df20e..b4580c4 100644
--- a/drivers/net/sfc/efx.c
+++ b/drivers/net/sfc/efx.c
@@ -23,7 +23,6 @@
 #include <linux/gfp.h>
 #include "net_driver.h"
 #include "efx.h"
-#include "mdio_10g.h"
 #include "nic.h"
 
 #include "mcdi.h"
diff --git a/drivers/net/sfc/ethtool.c b/drivers/net/sfc/ethtool.c
index 00fb674..aae756b 100644
--- a/drivers/net/sfc/ethtool.c
+++ b/drivers/net/sfc/ethtool.c
@@ -17,7 +17,6 @@
 #include "efx.h"
 #include "filter.h"
 #include "nic.h"
-#include "mdio_10g.h"
 
 struct ethtool_string {
 	char name[ETH_GSTRING_LEN];
diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c
index b2c3381..fe15084 100644
--- a/drivers/net/sfc/falcon.c
+++ b/drivers/net/sfc/falcon.c
@@ -24,7 +24,6 @@
 #include "nic.h"
 #include "regs.h"
 #include "io.h"
-#include "mdio_10g.h"
 #include "phy.h"
 #include "workarounds.h"
 
diff --git a/drivers/net/sfc/falcon_boards.c b/drivers/net/sfc/falcon_boards.c
index 6c20d45..a6fc5ce 100644
--- a/drivers/net/sfc/falcon_boards.c
+++ b/drivers/net/sfc/falcon_boards.c
@@ -13,8 +13,6 @@
 #include "phy.h"
 #include "efx.h"
 #include "nic.h"
-#include "regs.h"
-#include "io.h"
 #include "workarounds.h"
 
 /* Macros for unpacking the board revision */
diff --git a/drivers/net/sfc/falcon_xmac.c b/drivers/net/sfc/falcon_xmac.c
index b31f595..e293e25 100644
--- a/drivers/net/sfc/falcon_xmac.c
+++ b/drivers/net/sfc/falcon_xmac.c
@@ -16,7 +16,6 @@
 #include "io.h"
 #include "mac.h"
 #include "mdio_10g.h"
-#include "phy.h"
 #include "workarounds.h"
 
 /**************************************************************************
diff --git a/drivers/net/sfc/mcdi_phy.c b/drivers/net/sfc/mcdi_phy.c
index c992742..0e97eed 100644
--- a/drivers/net/sfc/mcdi_phy.c
+++ b/drivers/net/sfc/mcdi_phy.c
@@ -16,7 +16,6 @@
 #include "phy.h"
 #include "mcdi.h"
 #include "mcdi_pcol.h"
-#include "mdio_10g.h"
 #include "nic.h"
 #include "selftest.h"
 
diff --git a/drivers/net/sfc/mdio_10g.c b/drivers/net/sfc/mdio_10g.c
index 98d9460..56b0266 100644
--- a/drivers/net/sfc/mdio_10g.c
+++ b/drivers/net/sfc/mdio_10g.c
@@ -15,7 +15,6 @@
 #include "net_driver.h"
 #include "mdio_10g.h"
 #include "workarounds.h"
-#include "nic.h"
 
 unsigned efx_mdio_id_oui(u32 id)
 {
diff --git a/drivers/net/sfc/tenxpress.c b/drivers/net/sfc/tenxpress.c
index 1bc6c48..f102912 100644
--- a/drivers/net/sfc/tenxpress.c
+++ b/drivers/net/sfc/tenxpress.c
@@ -15,9 +15,7 @@
 #include "mdio_10g.h"
 #include "nic.h"
 #include "phy.h"
-#include "regs.h"
 #include "workarounds.h"
-#include "selftest.h"
 
 /* We expect these MMDs to be in the package. */
 #define TENXPRESS_REQUIRED_DEVS (MDIO_DEVS_PMAPMD	| \
-- 
1.7.3.2



-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


^ permalink raw reply related

* [PATCH net-next-2.6 08/17] sfc: Expose Falcon BootROM config through MTD, not ethtool
From: Ben Hutchings @ 2010-12-02 23:47 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-net-drivers
In-Reply-To: <1291333490.3259.23.camel@bwh-desktop>

The ethtool EEPROM interface is really meant for exposing chip
configuration, not BootROM configuration.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 drivers/net/sfc/ethtool.c |   59 ----------------------------------
 drivers/net/sfc/mtd.c     |   77 +++++++++++++++++++++++++++++++-------------
 2 files changed, 54 insertions(+), 82 deletions(-)

diff --git a/drivers/net/sfc/ethtool.c b/drivers/net/sfc/ethtool.c
index edb9d16..00fb674 100644
--- a/drivers/net/sfc/ethtool.c
+++ b/drivers/net/sfc/ethtool.c
@@ -17,7 +17,6 @@
 #include "efx.h"
 #include "filter.h"
 #include "nic.h"
-#include "spi.h"
 #include "mdio_10g.h"
 
 struct ethtool_string {
@@ -629,61 +628,6 @@ static u32 efx_ethtool_get_link(struct net_device *net_dev)
 	return efx->link_state.up;
 }
 
-static int efx_ethtool_get_eeprom_len(struct net_device *net_dev)
-{
-	struct efx_nic *efx = netdev_priv(net_dev);
-	struct efx_spi_device *spi = efx->spi_eeprom;
-
-	if (!spi)
-		return 0;
-	return min(spi->size, EFX_EEPROM_BOOTCONFIG_END) -
-		min(spi->size, EFX_EEPROM_BOOTCONFIG_START);
-}
-
-static int efx_ethtool_get_eeprom(struct net_device *net_dev,
-				  struct ethtool_eeprom *eeprom, u8 *buf)
-{
-	struct efx_nic *efx = netdev_priv(net_dev);
-	struct efx_spi_device *spi = efx->spi_eeprom;
-	size_t len;
-	int rc;
-
-	rc = mutex_lock_interruptible(&efx->spi_lock);
-	if (rc)
-		return rc;
-	rc = falcon_spi_read(efx, spi,
-			     eeprom->offset + EFX_EEPROM_BOOTCONFIG_START,
-			     eeprom->len, &len, buf);
-	mutex_unlock(&efx->spi_lock);
-
-	eeprom->magic = EFX_ETHTOOL_EEPROM_MAGIC;
-	eeprom->len = len;
-	return rc;
-}
-
-static int efx_ethtool_set_eeprom(struct net_device *net_dev,
-				  struct ethtool_eeprom *eeprom, u8 *buf)
-{
-	struct efx_nic *efx = netdev_priv(net_dev);
-	struct efx_spi_device *spi = efx->spi_eeprom;
-	size_t len;
-	int rc;
-
-	if (eeprom->magic != EFX_ETHTOOL_EEPROM_MAGIC)
-		return -EINVAL;
-
-	rc = mutex_lock_interruptible(&efx->spi_lock);
-	if (rc)
-		return rc;
-	rc = falcon_spi_write(efx, spi,
-			      eeprom->offset + EFX_EEPROM_BOOTCONFIG_START,
-			      eeprom->len, &len, buf);
-	mutex_unlock(&efx->spi_lock);
-
-	eeprom->len = len;
-	return rc;
-}
-
 static int efx_ethtool_get_coalesce(struct net_device *net_dev,
 				    struct ethtool_coalesce *coalesce)
 {
@@ -1116,9 +1060,6 @@ const struct ethtool_ops efx_ethtool_ops = {
 	.set_msglevel		= efx_ethtool_set_msglevel,
 	.nway_reset		= efx_ethtool_nway_reset,
 	.get_link		= efx_ethtool_get_link,
-	.get_eeprom_len		= efx_ethtool_get_eeprom_len,
-	.get_eeprom		= efx_ethtool_get_eeprom,
-	.set_eeprom		= efx_ethtool_set_eeprom,
 	.get_coalesce		= efx_ethtool_get_coalesce,
 	.set_coalesce		= efx_ethtool_set_coalesce,
 	.get_ringparam		= efx_ethtool_get_ringparam,
diff --git a/drivers/net/sfc/mtd.c b/drivers/net/sfc/mtd.c
index 02e54b4..d44c745 100644
--- a/drivers/net/sfc/mtd.c
+++ b/drivers/net/sfc/mtd.c
@@ -387,35 +387,66 @@ static struct efx_mtd_ops falcon_mtd_ops = {
 
 static int falcon_mtd_probe(struct efx_nic *efx)
 {
-	struct efx_spi_device *spi = efx->spi_flash;
+	struct efx_spi_device *spi;
 	struct efx_mtd *efx_mtd;
-	int rc;
+	int rc = -ENODEV;
 
 	ASSERT_RTNL();
 
-	if (!spi || spi->size <= FALCON_FLASH_BOOTCODE_START)
-		return -ENODEV;
-
-	efx_mtd = kzalloc(sizeof(*efx_mtd) + sizeof(efx_mtd->part[0]),
-			  GFP_KERNEL);
-	if (!efx_mtd)
-		return -ENOMEM;
-
-	efx_mtd->spi = spi;
-	efx_mtd->name = "flash";
-	efx_mtd->ops = &falcon_mtd_ops;
+	spi = efx->spi_flash;
+	if (spi && spi->size > FALCON_FLASH_BOOTCODE_START) {
+		efx_mtd = kzalloc(sizeof(*efx_mtd) + sizeof(efx_mtd->part[0]),
+				  GFP_KERNEL);
+		if (!efx_mtd)
+			return -ENOMEM;
+
+		efx_mtd->spi = spi;
+		efx_mtd->name = "flash";
+		efx_mtd->ops = &falcon_mtd_ops;
+
+		efx_mtd->n_parts = 1;
+		efx_mtd->part[0].mtd.type = MTD_NORFLASH;
+		efx_mtd->part[0].mtd.flags = MTD_CAP_NORFLASH;
+		efx_mtd->part[0].mtd.size = spi->size - FALCON_FLASH_BOOTCODE_START;
+		efx_mtd->part[0].mtd.erasesize = spi->erase_size;
+		efx_mtd->part[0].offset = FALCON_FLASH_BOOTCODE_START;
+		efx_mtd->part[0].type_name = "sfc_flash_bootrom";
+
+		rc = efx_mtd_probe_device(efx, efx_mtd);
+		if (rc) {
+			kfree(efx_mtd);
+			return rc;
+		}
+	}
 
-	efx_mtd->n_parts = 1;
-	efx_mtd->part[0].mtd.type = MTD_NORFLASH;
-	efx_mtd->part[0].mtd.flags = MTD_CAP_NORFLASH;
-	efx_mtd->part[0].mtd.size = spi->size - FALCON_FLASH_BOOTCODE_START;
-	efx_mtd->part[0].mtd.erasesize = spi->erase_size;
-	efx_mtd->part[0].offset = FALCON_FLASH_BOOTCODE_START;
-	efx_mtd->part[0].type_name = "sfc_flash_bootrom";
+	spi = efx->spi_eeprom;
+	if (spi && spi->size > EFX_EEPROM_BOOTCONFIG_START) {
+		efx_mtd = kzalloc(sizeof(*efx_mtd) + sizeof(efx_mtd->part[0]),
+				  GFP_KERNEL);
+		if (!efx_mtd)
+			return -ENOMEM;
+
+		efx_mtd->spi = spi;
+		efx_mtd->name = "EEPROM";
+		efx_mtd->ops = &falcon_mtd_ops;
+
+		efx_mtd->n_parts = 1;
+		efx_mtd->part[0].mtd.type = MTD_RAM;
+		efx_mtd->part[0].mtd.flags = MTD_CAP_RAM;
+		efx_mtd->part[0].mtd.size =
+			min(spi->size, EFX_EEPROM_BOOTCONFIG_END) -
+			EFX_EEPROM_BOOTCONFIG_START;
+		efx_mtd->part[0].mtd.erasesize = spi->erase_size;
+		efx_mtd->part[0].offset = EFX_EEPROM_BOOTCONFIG_START;
+		efx_mtd->part[0].type_name = "sfc_bootconfig";
+
+		rc = efx_mtd_probe_device(efx, efx_mtd);
+		if (rc) {
+			kfree(efx_mtd);
+			return rc;
+		}
+	}
 
-	rc = efx_mtd_probe_device(efx, efx_mtd);
-	if (rc)
-		kfree(efx_mtd);
 	return rc;
 }
 
-- 
1.7.3.2



-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


^ permalink raw reply related

* [PATCH net-next-2.6 07/17] sfc: Remove broken automatic fallback for invalid Falcon chip/board config
From: Ben Hutchings @ 2010-12-02 23:47 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-net-drivers
In-Reply-To: <1291333490.3259.23.camel@bwh-desktop>

If the Falcon board config is invalid, we cannot proceed - we do not
have a valid board type to pass to falcon_probe_board(), and if we
kluge that to work with an unknown board then other initialisation
code will crash.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 drivers/net/sfc/falcon.c |   57 +++++++++++++++++++--------------------------
 1 files changed, 24 insertions(+), 33 deletions(-)

diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c
index 267019b..b2c3381 100644
--- a/drivers/net/sfc/falcon.c
+++ b/drivers/net/sfc/falcon.c
@@ -1235,7 +1235,6 @@ static void falcon_remove_spi_devices(struct efx_nic *efx)
 static int falcon_probe_nvconfig(struct efx_nic *efx)
 {
 	struct falcon_nvconfig *nvconfig;
-	int board_rev;
 	int rc;
 
 	nvconfig = kmalloc(sizeof(*nvconfig), GFP_KERNEL);
@@ -1243,37 +1242,25 @@ static int falcon_probe_nvconfig(struct efx_nic *efx)
 		return -ENOMEM;
 
 	rc = falcon_read_nvram(efx, nvconfig);
-	if (rc == -EINVAL) {
-		netif_err(efx, probe, efx->net_dev,
-			  "NVRAM is invalid therefore using defaults\n");
-		efx->phy_type = PHY_TYPE_NONE;
-		efx->mdio.prtad = MDIO_PRTAD_NONE;
-		board_rev = 0;
-		rc = 0;
-	} else if (rc) {
+	if (rc)
 		goto fail1;
-	} else {
-		struct falcon_nvconfig_board_v2 *v2 = &nvconfig->board_v2;
-		struct falcon_nvconfig_board_v3 *v3 = &nvconfig->board_v3;
-
-		efx->phy_type = v2->port0_phy_type;
-		efx->mdio.prtad = v2->port0_phy_addr;
-		board_rev = le16_to_cpu(v2->board_revision);
-
-		if (le16_to_cpu(nvconfig->board_struct_ver) >= 3) {
-			rc = falcon_spi_device_init(
-				efx, &efx->spi_flash, FFE_AB_SPI_DEVICE_FLASH,
-				le32_to_cpu(v3->spi_device_type
-					    [FFE_AB_SPI_DEVICE_FLASH]));
-			if (rc)
-				goto fail2;
-			rc = falcon_spi_device_init(
-				efx, &efx->spi_eeprom, FFE_AB_SPI_DEVICE_EEPROM,
-				le32_to_cpu(v3->spi_device_type
-					    [FFE_AB_SPI_DEVICE_EEPROM]));
-			if (rc)
-				goto fail2;
-		}
+
+	efx->phy_type = nvconfig->board_v2.port0_phy_type;
+	efx->mdio.prtad = nvconfig->board_v2.port0_phy_addr;
+
+	if (le16_to_cpu(nvconfig->board_struct_ver) >= 3) {
+		rc = falcon_spi_device_init(
+			efx, &efx->spi_flash, FFE_AB_SPI_DEVICE_FLASH,
+			le32_to_cpu(nvconfig->board_v3
+				    .spi_device_type[FFE_AB_SPI_DEVICE_FLASH]));
+		if (rc)
+			goto fail2;
+		rc = falcon_spi_device_init(
+			efx, &efx->spi_eeprom, FFE_AB_SPI_DEVICE_EEPROM,
+			le32_to_cpu(nvconfig->board_v3
+				    .spi_device_type[FFE_AB_SPI_DEVICE_EEPROM]));
+		if (rc)
+			goto fail2;
 	}
 
 	/* Read the MAC addresses */
@@ -1282,7 +1269,8 @@ static int falcon_probe_nvconfig(struct efx_nic *efx)
 	netif_dbg(efx, probe, efx->net_dev, "PHY is %d phy_id %d\n",
 		  efx->phy_type, efx->mdio.prtad);
 
-	rc = falcon_probe_board(efx, board_rev);
+	rc = falcon_probe_board(efx,
+				le16_to_cpu(nvconfig->board_v2.board_revision));
 	if (rc)
 		goto fail2;
 
@@ -1419,8 +1407,11 @@ static int falcon_probe_nic(struct efx_nic *efx)
 
 	/* Read in the non-volatile configuration */
 	rc = falcon_probe_nvconfig(efx);
-	if (rc)
+	if (rc) {
+		if (rc == -EINVAL)
+			netif_err(efx, probe, efx->net_dev, "NVRAM is invalid\n");
 		goto fail5;
+	}
 
 	/* Initialise I2C adapter */
 	board = falcon_board(efx);
-- 
1.7.3.2



-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


^ permalink raw reply related

* [PATCH net-next-2.6 06/17] sfc: Fix event based MCDI completion and MC REBOOT/CMDDONE ordering issue
From: Ben Hutchings @ 2010-12-02 23:46 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-net-drivers
In-Reply-To: <1291333490.3259.23.camel@bwh-desktop>

From: Steve Hodgson <shodgson@solarflare.com>

The mcfw *never* sends CMDDONE when rebooting. Changing this so that it always
sends CMDDONE *before* REBOOT is easy on Siena, but it's not obvious that we
could guarantee to be able to implement this on future hardware.

Given this, I'm less convinced that the protocol should be changed.

To reiterate the failure mode: The driver sees this:

 issue command
 receive REBOOT event

Was that reboot event sent before the command was issued, or in
response to the command? If the former then there will be a subsequent
CMDDONE event, if the latter, then there will be no CMDDONE event.

Options to resolve this are:

 1. REBOOT always completes an outstanding mcdi request, and we set
    the credits count to ignore a subsequent CMDDONE event with
    mismatching seqno.

 2. REBOOT never completes an outstanding mcdi request. If there is
    no CMDDONE event then we rely on the mcdi timeout code to complete
    the outstanding request, incurring a 10s delay.

I'd argue that (2) is tidier, but that incurring a 10s delay is a little
needless. Let's go with (1).

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 drivers/net/sfc/mcdi.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/net/sfc/mcdi.c b/drivers/net/sfc/mcdi.c
index e389ac6..b716e82 100644
--- a/drivers/net/sfc/mcdi.c
+++ b/drivers/net/sfc/mcdi.c
@@ -463,6 +463,7 @@ static void efx_mcdi_ev_death(struct efx_nic *efx, int rc)
 		if (mcdi->mode == MCDI_MODE_EVENTS) {
 			mcdi->resprc = rc;
 			mcdi->resplen = 0;
+			++mcdi->credits;
 		}
 	} else
 		/* Nobody was waiting for an MCDI request, so trigger a reset */
-- 
1.7.3.2



-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


^ permalink raw reply related

* [PATCH net-next-2.6 05/17] sfc: Clear RXIN_SEL when soft-resetting QT2025C
From: Ben Hutchings @ 2010-12-02 23:46 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-net-drivers
In-Reply-To: <1291333490.3259.23.camel@bwh-desktop>

When we enable PMA/PMD loopback this automatically sets RXIN_SEL
(inverse polarity for RXIN).  We need to clear that bit during the
soft-reset sequence, as it is not done automatically.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 drivers/net/sfc/qt202x_phy.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/net/sfc/qt202x_phy.c b/drivers/net/sfc/qt202x_phy.c
index 68813d1..ea3ae00 100644
--- a/drivers/net/sfc/qt202x_phy.c
+++ b/drivers/net/sfc/qt202x_phy.c
@@ -41,6 +41,8 @@
 #define PCS_UC_STATUS_LBN	0
 #define PCS_UC_STATUS_WIDTH	8
 #define PCS_UC_STATUS_FW_SAVE	0x20
+#define PMA_PMD_MODE_REG	0xc301
+#define PMA_PMD_RXIN_SEL_LBN	6
 #define PMA_PMD_FTX_CTRL2_REG	0xc309
 #define PMA_PMD_FTX_STATIC_LBN	13
 #define PMA_PMD_VEND1_REG	0xc001
@@ -282,6 +284,10 @@ static int qt2025c_select_phy_mode(struct efx_nic *efx)
 	 * slow) reload of the firmware image (the microcontroller's code
 	 * memory is not affected by the microcontroller reset). */
 	efx_mdio_write(efx, 1, 0xc317, 0x00ff);
+	/* PMA/PMD loopback sets RXIN to inverse polarity and the firmware
+	 * restart doesn't reset it. We need to do that ourselves. */
+	efx_mdio_set_flag(efx, 1, PMA_PMD_MODE_REG,
+			  1 << PMA_PMD_RXIN_SEL_LBN, false);
 	efx_mdio_write(efx, 1, 0xc300, 0x0002);
 	msleep(20);
 
-- 
1.7.3.2



-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


^ permalink raw reply related

* [PATCH net-next-2.6 04/17] sfc: Read-to-clear LM87 alarm/interrupt status at start of day
From: Ben Hutchings @ 2010-12-02 23:46 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-net-drivers
In-Reply-To: <1291333490.3259.23.camel@bwh-desktop>

We do not want to shut down the board based on a fault that has
already been cleared.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 drivers/net/sfc/falcon_boards.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/net/sfc/falcon_boards.c b/drivers/net/sfc/falcon_boards.c
index 86180ee..6c20d45 100644
--- a/drivers/net/sfc/falcon_boards.c
+++ b/drivers/net/sfc/falcon_boards.c
@@ -99,6 +99,10 @@ static int efx_init_lm87(struct efx_nic *efx, struct i2c_board_info *info,
 	if (!client)
 		return -EIO;
 
+	/* Read-to-clear alarm/interrupt status */
+	i2c_smbus_read_byte_data(client, LM87_REG_ALARMS1);
+	i2c_smbus_read_byte_data(client, LM87_REG_ALARMS2);
+
 	rc = efx_poke_lm87(client, reg_values);
 	if (rc)
 		goto err;
-- 
1.7.3.2



-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


^ permalink raw reply related

* [PATCH net-next-2.6 03/17] sfc: Distinguish critical and non-critical over-temperature conditions
From: Ben Hutchings @ 2010-12-02 23:46 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-net-drivers
In-Reply-To: <1291333490.3259.23.camel@bwh-desktop>

Set both the 'maximum' and critical temperature limits for LM87
hardware monitors on Falcon boards.  Do not shut down a port until the
critical temperature is reached, but warn as soon as the 'maximum'
temperature is reached.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 drivers/net/sfc/falcon_boards.c |  109 ++++++++++++++++++++++++++++----------
 1 files changed, 80 insertions(+), 29 deletions(-)

diff --git a/drivers/net/sfc/falcon_boards.c b/drivers/net/sfc/falcon_boards.c
index cfc29d7..86180ee 100644
--- a/drivers/net/sfc/falcon_boards.c
+++ b/drivers/net/sfc/falcon_boards.c
@@ -30,17 +30,28 @@
 #define FALCON_BOARD_SFN4112F 0x52
 
 /* Board temperature is about 15°C above ambient when air flow is
- * limited. */
+ * limited.  The maximum acceptable ambient temperature varies
+ * depending on the PHY specifications but the critical temperature
+ * above which we should shut down to avoid damage is 80°C. */
 #define FALCON_BOARD_TEMP_BIAS	15
+#define FALCON_BOARD_TEMP_CRIT	(80 + FALCON_BOARD_TEMP_BIAS)
 
 /* SFC4000 datasheet says: 'The maximum permitted junction temperature
  * is 125°C; the thermal design of the environment for the SFC4000
  * should aim to keep this well below 100°C.' */
+#define FALCON_JUNC_TEMP_MIN	0
 #define FALCON_JUNC_TEMP_MAX	90
+#define FALCON_JUNC_TEMP_CRIT	125
 
 /*****************************************************************************
  * Support for LM87 sensor chip used on several boards
  */
+#define LM87_REG_TEMP_HW_INT_LOCK	0x13
+#define LM87_REG_TEMP_HW_EXT_LOCK	0x14
+#define LM87_REG_TEMP_HW_INT		0x17
+#define LM87_REG_TEMP_HW_EXT		0x18
+#define LM87_REG_TEMP_EXT1		0x26
+#define LM87_REG_TEMP_INT		0x27
 #define LM87_REG_ALARMS1		0x41
 #define LM87_REG_ALARMS2		0x42
 #define LM87_IN_LIMITS(nr, _min, _max)			\
@@ -57,6 +68,27 @@
 
 #if defined(CONFIG_SENSORS_LM87) || defined(CONFIG_SENSORS_LM87_MODULE)
 
+static int efx_poke_lm87(struct i2c_client *client, const u8 *reg_values)
+{
+	while (*reg_values) {
+		u8 reg = *reg_values++;
+		u8 value = *reg_values++;
+		int rc = i2c_smbus_write_byte_data(client, reg, value);
+		if (rc)
+			return rc;
+	}
+	return 0;
+}
+
+static const u8 falcon_lm87_common_regs[] = {
+	LM87_REG_TEMP_HW_INT_LOCK, FALCON_BOARD_TEMP_CRIT,
+	LM87_REG_TEMP_HW_INT, FALCON_BOARD_TEMP_CRIT,
+	LM87_TEMP_EXT1_LIMITS(FALCON_JUNC_TEMP_MIN, FALCON_JUNC_TEMP_MAX),
+	LM87_REG_TEMP_HW_EXT_LOCK, FALCON_JUNC_TEMP_CRIT,
+	LM87_REG_TEMP_HW_EXT, FALCON_JUNC_TEMP_CRIT,
+	0
+};
+
 static int efx_init_lm87(struct efx_nic *efx, struct i2c_board_info *info,
 			 const u8 *reg_values)
 {
@@ -67,13 +99,12 @@ static int efx_init_lm87(struct efx_nic *efx, struct i2c_board_info *info,
 	if (!client)
 		return -EIO;
 
-	while (*reg_values) {
-		u8 reg = *reg_values++;
-		u8 value = *reg_values++;
-		rc = i2c_smbus_write_byte_data(client, reg, value);
-		if (rc)
-			goto err;
-	}
+	rc = efx_poke_lm87(client, reg_values);
+	if (rc)
+		goto err;
+	rc = efx_poke_lm87(client, falcon_lm87_common_regs);
+	if (rc)
+		goto err;
 
 	board->hwmon_client = client;
 	return 0;
@@ -91,36 +122,56 @@ static void efx_fini_lm87(struct efx_nic *efx)
 static int efx_check_lm87(struct efx_nic *efx, unsigned mask)
 {
 	struct i2c_client *client = falcon_board(efx)->hwmon_client;
-	s32 alarms1, alarms2;
+	bool temp_crit, elec_fault, is_failure;
+	u16 alarms;
+	s32 reg;
 
 	/* If link is up then do not monitor temperature */
 	if (EFX_WORKAROUND_7884(efx) && efx->link_state.up)
 		return 0;
 
-	alarms1 = i2c_smbus_read_byte_data(client, LM87_REG_ALARMS1);
-	alarms2 = i2c_smbus_read_byte_data(client, LM87_REG_ALARMS2);
-	if (alarms1 < 0)
-		return alarms1;
-	if (alarms2 < 0)
-		return alarms2;
-	alarms1 &= mask;
-	alarms2 &= mask >> 8;
-	if (alarms1 || alarms2) {
+	reg = i2c_smbus_read_byte_data(client, LM87_REG_ALARMS1);
+	if (reg < 0)
+		return reg;
+	alarms = reg;
+	reg = i2c_smbus_read_byte_data(client, LM87_REG_ALARMS2);
+	if (reg < 0)
+		return reg;
+	alarms |= reg << 8;
+	alarms &= mask;
+
+	temp_crit = false;
+	if (alarms & LM87_ALARM_TEMP_INT) {
+		reg = i2c_smbus_read_byte_data(client, LM87_REG_TEMP_INT);
+		if (reg < 0)
+			return reg;
+		if (reg > FALCON_BOARD_TEMP_CRIT)
+			temp_crit = true;
+	}
+	if (alarms & LM87_ALARM_TEMP_EXT1) {
+		reg = i2c_smbus_read_byte_data(client, LM87_REG_TEMP_EXT1);
+		if (reg < 0)
+			return reg;
+		if (reg > FALCON_JUNC_TEMP_CRIT)
+			temp_crit = true;
+	}
+	elec_fault = alarms & ~(LM87_ALARM_TEMP_INT | LM87_ALARM_TEMP_EXT1);
+	is_failure = temp_crit || elec_fault;
+
+	if (alarms)
 		netif_err(efx, hw, efx->net_dev,
-			  "LM87 detected a hardware failure (status %02x:%02x)"
-			  "%s%s%s\n",
-			  alarms1, alarms2,
-			  (alarms1 & LM87_ALARM_TEMP_INT) ?
+			  "LM87 detected a hardware %s (status %02x:%02x)"
+			  "%s%s%s%s\n",
+			  is_failure ? "failure" : "problem",
+			  alarms & 0xff, alarms >> 8,
+			  (alarms & LM87_ALARM_TEMP_INT) ?
 			  "; board is overheating" : "",
-			  (alarms1 & LM87_ALARM_TEMP_EXT1) ?
+			  (alarms & LM87_ALARM_TEMP_EXT1) ?
 			  "; controller is overheating" : "",
-			  (alarms1 & ~(LM87_ALARM_TEMP_INT | LM87_ALARM_TEMP_EXT1)
-			   || alarms2) ?
-			  "; electrical fault" : "");
-		return -ERANGE;
-	}
+			  temp_crit ? "; reached critical temperature" : "",
+			  elec_fault ? "; electrical fault" : "");
 
-	return 0;
+	return is_failure ? -ERANGE : 0;
 }
 
 #else /* !CONFIG_SENSORS_LM87 */
-- 
1.7.3.2



-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


^ permalink raw reply related

* [PATCH net-next-2.6 02/17] sfc: Fix condition for no-op in set_phy_flash_cfg()
From: Ben Hutchings @ 2010-12-02 23:46 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-net-drivers
In-Reply-To: <1291333490.3259.23.camel@bwh-desktop>

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 drivers/net/sfc/falcon_boards.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/sfc/falcon_boards.c b/drivers/net/sfc/falcon_boards.c
index cfc6a5b..cfc29d7 100644
--- a/drivers/net/sfc/falcon_boards.c
+++ b/drivers/net/sfc/falcon_boards.c
@@ -325,7 +325,7 @@ static ssize_t set_phy_flash_cfg(struct device *dev,
 		new_mode = old_mode & ~PHY_MODE_SPECIAL;
 	else
 		new_mode = PHY_MODE_SPECIAL;
-	if (old_mode == new_mode) {
+	if (!((old_mode ^ new_mode) & PHY_MODE_SPECIAL)) {
 		err = 0;
 	} else if (efx->state != STATE_RUNNING || netif_running(efx->net_dev)) {
 		err = -EBUSY;
-- 
1.7.3.2



-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


^ permalink raw reply related

* [PATCH net-next-2.6 01/17] sfc: Reduce log level for MCDI error response in efx_mcdi_rpc()
From: Ben Hutchings @ 2010-12-02 23:46 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-net-drivers
In-Reply-To: <1291333490.3259.23.camel@bwh-desktop>

Some errors are expected, e.g. when sending new commands to an MC
running old firmware.  Only the caller of efx_mcdi_rpc() can decide
what is a real error.  Therefore log the error responses with
netif_dbg().

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 drivers/net/sfc/mcdi.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/sfc/mcdi.c b/drivers/net/sfc/mcdi.c
index 12cf910..e389ac6 100644
--- a/drivers/net/sfc/mcdi.c
+++ b/drivers/net/sfc/mcdi.c
@@ -381,7 +381,7 @@ int efx_mcdi_rpc(struct efx_nic *efx, unsigned cmd,
 				  -rc);
 			efx_schedule_reset(efx, RESET_TYPE_MC_FAILURE);
 		} else
-			netif_err(efx, hw, efx->net_dev,
+			netif_dbg(efx, hw, efx->net_dev,
 				  "MC command 0x%x inlen %d failed rc=%d\n",
 				  cmd, (int)inlen, -rc);
 	}
-- 
1.7.3.2



-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


^ permalink raw reply related

* linux-next: manual merge of the net tree with the wireless-current tree
From: Stephen Rothwell @ 2010-12-02 23:45 UTC (permalink / raw)
  To: David Miller, netdev
  Cc: linux-next, linux-kernel, Senthil Balasubramanian, Felix Fietkau,
	John W. Linville

Hi all,

Today's linux-next merge of the net tree got a conflict in
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c between commit
e702ba18f25887c76d26c8a85cc1706463c62e9a ("ath9k_hw: fix endian issues
with CTLs on AR9003") from the wireless-current tree and commits
3092354970381fb8b6439fb4def0c34632277ae9 ("ath9k_hw: add eeprom templates
for ar9003 family chipsets") and f4475a6e52fce8d951a96c763f36b835bf89fdec
("ath9k_hw: Enable strong signal detection for AR9003") from the net tree.

There have been many more fields added that will need to be wrapped in
CTL().  I just fixed up the conflicting case.  It looks like this has
been fixed up by the wireless-current tree being merged into the wireless
tree and and so will go away when the wireless tree is merged into the
net tree again.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
index a7b82f0,3161a59..0000000
--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
@@@ -55,17 -57,2327 +57,2329 @@@
  #define SUB_NUM_CTL_MODES_AT_5G_40 2    /* excluding HT40, EXT-OFDM */
  #define SUB_NUM_CTL_MODES_AT_2G_40 3    /* excluding HT40, EXT-OFDM, EXT-CCK */
  
 +#define CTL(_tpower, _flag) ((_tpower) | ((_flag) << 6))
 +
+ static int ar9003_hw_power_interpolate(int32_t x,
+ 				       int32_t *px, int32_t *py, u_int16_t np);
  static const struct ar9300_eeprom ar9300_default = {
  	.eepromVersion = 2,
- 	.templateVersion = 2,
- 	.macAddr = {1, 2, 3, 4, 5, 6},
- 	.custData = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 		     0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+ 	.templateVersion = 2,
+ 	.macAddr = {1, 2, 3, 4, 5, 6},
+ 	.custData = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 		     0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+ 	.baseEepHeader = {
+ 		.regDmn = { LE16(0), LE16(0x1f) },
+ 		.txrxMask =  0x77, /* 4 bits tx and 4 bits rx */
+ 		.opCapFlags = {
+ 			.opFlags = AR9300_OPFLAGS_11G | AR9300_OPFLAGS_11A,
+ 			.eepMisc = 0,
+ 		},
+ 		.rfSilent = 0,
+ 		.blueToothOptions = 0,
+ 		.deviceCap = 0,
+ 		.deviceType = 5, /* takes lower byte in eeprom location */
+ 		.pwrTableOffset = AR9300_PWR_TABLE_OFFSET,
+ 		.params_for_tuning_caps = {0, 0},
+ 		.featureEnable = 0x0c,
+ 		 /*
+ 		  * bit0 - enable tx temp comp - disabled
+ 		  * bit1 - enable tx volt comp - disabled
+ 		  * bit2 - enable fastClock - enabled
+ 		  * bit3 - enable doubling - enabled
+ 		  * bit4 - enable internal regulator - disabled
+ 		  * bit5 - enable pa predistortion - disabled
+ 		  */
+ 		.miscConfiguration = 0, /* bit0 - turn down drivestrength */
+ 		.eepromWriteEnableGpio = 3,
+ 		.wlanDisableGpio = 0,
+ 		.wlanLedGpio = 8,
+ 		.rxBandSelectGpio = 0xff,
+ 		.txrxgain = 0,
+ 		.swreg = 0,
+ 	 },
+ 	.modalHeader2G = {
+ 	/* ar9300_modal_eep_header  2g */
+ 		/* 4 idle,t1,t2,b(4 bits per setting) */
+ 		.antCtrlCommon = LE32(0x110),
+ 		/* 4 ra1l1, ra2l1, ra1l2, ra2l2, ra12 */
+ 		.antCtrlCommon2 = LE32(0x22222),
+ 
+ 		/*
+ 		 * antCtrlChain[AR9300_MAX_CHAINS]; 6 idle, t, r,
+ 		 * rx1, rx12, b (2 bits each)
+ 		 */
+ 		.antCtrlChain = { LE16(0x150), LE16(0x150), LE16(0x150) },
+ 
+ 		/*
+ 		 * xatten1DB[AR9300_MAX_CHAINS];  3 xatten1_db
+ 		 * for ar9280 (0xa20c/b20c 5:0)
+ 		 */
+ 		.xatten1DB = {0, 0, 0},
+ 
+ 		/*
+ 		 * xatten1Margin[AR9300_MAX_CHAINS]; 3 xatten1_margin
+ 		 * for ar9280 (0xa20c/b20c 16:12
+ 		 */
+ 		.xatten1Margin = {0, 0, 0},
+ 		.tempSlope = 36,
+ 		.voltSlope = 0,
+ 
+ 		/*
+ 		 * spurChans[OSPREY_EEPROM_MODAL_SPURS]; spur
+ 		 * channels in usual fbin coding format
+ 		 */
+ 		.spurChans = {0, 0, 0, 0, 0},
+ 
+ 		/*
+ 		 * noiseFloorThreshCh[AR9300_MAX_CHAINS]; 3 Check
+ 		 * if the register is per chain
+ 		 */
+ 		.noiseFloorThreshCh = {-1, 0, 0},
+ 		.ob = {1, 1, 1},/* 3 chain */
+ 		.db_stage2 = {1, 1, 1}, /* 3 chain  */
+ 		.db_stage3 = {0, 0, 0},
+ 		.db_stage4 = {0, 0, 0},
+ 		.xpaBiasLvl = 0,
+ 		.txFrameToDataStart = 0x0e,
+ 		.txFrameToPaOn = 0x0e,
+ 		.txClip = 3, /* 4 bits tx_clip, 4 bits dac_scale_cck */
+ 		.antennaGain = 0,
+ 		.switchSettling = 0x2c,
+ 		.adcDesiredSize = -30,
+ 		.txEndToXpaOff = 0,
+ 		.txEndToRxOn = 0x2,
+ 		.txFrameToXpaOn = 0xe,
+ 		.thresh62 = 28,
+ 		.papdRateMaskHt20 = LE32(0x0cf0e0e0),
+ 		.papdRateMaskHt40 = LE32(0x6cf0e0e0),
+ 		.futureModal = {
+ 			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 		},
+ 	 },
+ 	.base_ext1 = {
+ 		.ant_div_control = 0,
+ 		.future = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
+ 	},
+ 	.calFreqPier2G = {
+ 		FREQ2FBIN(2412, 1),
+ 		FREQ2FBIN(2437, 1),
+ 		FREQ2FBIN(2472, 1),
+ 	 },
+ 	/* ar9300_cal_data_per_freq_op_loop 2g */
+ 	.calPierData2G = {
+ 		{ {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0} },
+ 		{ {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0} },
+ 		{ {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0} },
+ 	 },
+ 	.calTarget_freqbin_Cck = {
+ 		FREQ2FBIN(2412, 1),
+ 		FREQ2FBIN(2484, 1),
+ 	 },
+ 	.calTarget_freqbin_2G = {
+ 		FREQ2FBIN(2412, 1),
+ 		FREQ2FBIN(2437, 1),
+ 		FREQ2FBIN(2472, 1)
+ 	 },
+ 	.calTarget_freqbin_2GHT20 = {
+ 		FREQ2FBIN(2412, 1),
+ 		FREQ2FBIN(2437, 1),
+ 		FREQ2FBIN(2472, 1)
+ 	 },
+ 	.calTarget_freqbin_2GHT40 = {
+ 		FREQ2FBIN(2412, 1),
+ 		FREQ2FBIN(2437, 1),
+ 		FREQ2FBIN(2472, 1)
+ 	 },
+ 	.calTargetPowerCck = {
+ 		 /* 1L-5L,5S,11L,11S */
+ 		 { {36, 36, 36, 36} },
+ 		 { {36, 36, 36, 36} },
+ 	},
+ 	.calTargetPower2G = {
+ 		 /* 6-24,36,48,54 */
+ 		 { {32, 32, 28, 24} },
+ 		 { {32, 32, 28, 24} },
+ 		 { {32, 32, 28, 24} },
+ 	},
+ 	.calTargetPower2GHT20 = {
+ 		{ {32, 32, 32, 32, 28, 20, 32, 32, 28, 20, 32, 32, 28, 20} },
+ 		{ {32, 32, 32, 32, 28, 20, 32, 32, 28, 20, 32, 32, 28, 20} },
+ 		{ {32, 32, 32, 32, 28, 20, 32, 32, 28, 20, 32, 32, 28, 20} },
+ 	},
+ 	.calTargetPower2GHT40 = {
+ 		{ {32, 32, 32, 32, 28, 20, 32, 32, 28, 20, 32, 32, 28, 20} },
+ 		{ {32, 32, 32, 32, 28, 20, 32, 32, 28, 20, 32, 32, 28, 20} },
+ 		{ {32, 32, 32, 32, 28, 20, 32, 32, 28, 20, 32, 32, 28, 20} },
+ 	},
+ 	.ctlIndex_2G =  {
+ 		0x11, 0x12, 0x15, 0x17, 0x41, 0x42,
+ 		0x45, 0x47, 0x31, 0x32, 0x35, 0x37,
+ 	},
+ 	.ctl_freqbin_2G = {
+ 		{
+ 			FREQ2FBIN(2412, 1),
+ 			FREQ2FBIN(2417, 1),
+ 			FREQ2FBIN(2457, 1),
+ 			FREQ2FBIN(2462, 1)
+ 		},
+ 		{
+ 			FREQ2FBIN(2412, 1),
+ 			FREQ2FBIN(2417, 1),
+ 			FREQ2FBIN(2462, 1),
+ 			0xFF,
+ 		},
+ 
+ 		{
+ 			FREQ2FBIN(2412, 1),
+ 			FREQ2FBIN(2417, 1),
+ 			FREQ2FBIN(2462, 1),
+ 			0xFF,
+ 		},
+ 		{
+ 			FREQ2FBIN(2422, 1),
+ 			FREQ2FBIN(2427, 1),
+ 			FREQ2FBIN(2447, 1),
+ 			FREQ2FBIN(2452, 1)
+ 		},
+ 
+ 		{
+ 			/* Data[4].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
+ 			/* Data[4].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
+ 			/* Data[4].ctlEdges[2].bChannel */ FREQ2FBIN(2472, 1),
+ 			/* Data[4].ctlEdges[3].bChannel */ FREQ2FBIN(2484, 1),
+ 		},
+ 
+ 		{
+ 			/* Data[5].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
+ 			/* Data[5].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
+ 			/* Data[5].ctlEdges[2].bChannel */ FREQ2FBIN(2472, 1),
+ 			0,
+ 		},
+ 
+ 		{
+ 			/* Data[6].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
+ 			/* Data[6].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
+ 			FREQ2FBIN(2472, 1),
+ 			0,
+ 		},
+ 
+ 		{
+ 			/* Data[7].ctlEdges[0].bChannel */ FREQ2FBIN(2422, 1),
+ 			/* Data[7].ctlEdges[1].bChannel */ FREQ2FBIN(2427, 1),
+ 			/* Data[7].ctlEdges[2].bChannel */ FREQ2FBIN(2447, 1),
+ 			/* Data[7].ctlEdges[3].bChannel */ FREQ2FBIN(2462, 1),
+ 		},
+ 
+ 		{
+ 			/* Data[8].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
+ 			/* Data[8].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
+ 			/* Data[8].ctlEdges[2].bChannel */ FREQ2FBIN(2472, 1),
+ 		},
+ 
+ 		{
+ 			/* Data[9].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
+ 			/* Data[9].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
+ 			/* Data[9].ctlEdges[2].bChannel */ FREQ2FBIN(2472, 1),
+ 			0
+ 		},
+ 
+ 		{
+ 			/* Data[10].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
+ 			/* Data[10].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
+ 			/* Data[10].ctlEdges[2].bChannel */ FREQ2FBIN(2472, 1),
+ 			0
+ 		},
+ 
+ 		{
+ 			/* Data[11].ctlEdges[0].bChannel */ FREQ2FBIN(2422, 1),
+ 			/* Data[11].ctlEdges[1].bChannel */ FREQ2FBIN(2427, 1),
+ 			/* Data[11].ctlEdges[2].bChannel */ FREQ2FBIN(2447, 1),
+ 			/* Data[11].ctlEdges[3].bChannel */ FREQ2FBIN(2462, 1),
+ 		}
+ 	 },
+ 	.ctlPowerData_2G = {
+ 		 { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
+ 		 { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
+ 		 { { {60, 1}, {60, 0}, {60, 0}, {60, 1} } },
+ 
+ 		 { { {60, 1}, {60, 0}, {0, 0}, {0, 0} } },
+ 		 { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
+ 		 { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
+ 
+ 		 { { {60, 0}, {60, 1}, {60, 1}, {60, 0} } },
+ 		 { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
+ 		 { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
+ 
+ 		 { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
+ 		 { { {60, 0}, {60, 1}, {60, 1}, {60, 1} } },
+ 		 { { {60, 0}, {60, 1}, {60, 1}, {60, 1} } },
+ 	 },
+ 	.modalHeader5G = {
+ 		/* 4 idle,t1,t2,b (4 bits per setting) */
+ 		.antCtrlCommon = LE32(0x110),
+ 		/* 4 ra1l1, ra2l1, ra1l2,ra2l2,ra12 */
+ 		.antCtrlCommon2 = LE32(0x22222),
+ 		 /* antCtrlChain 6 idle, t,r,rx1,rx12,b (2 bits each) */
+ 		.antCtrlChain = {
+ 			LE16(0x000), LE16(0x000), LE16(0x000),
+ 		},
+ 		 /* xatten1DB 3 xatten1_db for AR9280 (0xa20c/b20c 5:0) */
+ 		.xatten1DB = {0, 0, 0},
+ 
+ 		/*
+ 		 * xatten1Margin[AR9300_MAX_CHAINS]; 3 xatten1_margin
+ 		 * for merlin (0xa20c/b20c 16:12
+ 		 */
+ 		.xatten1Margin = {0, 0, 0},
+ 		.tempSlope = 68,
+ 		.voltSlope = 0,
+ 		/* spurChans spur channels in usual fbin coding format */
+ 		.spurChans = {0, 0, 0, 0, 0},
+ 		/* noiseFloorThreshCh Check if the register is per chain */
+ 		.noiseFloorThreshCh = {-1, 0, 0},
+ 		.ob = {3, 3, 3}, /* 3 chain */
+ 		.db_stage2 = {3, 3, 3}, /* 3 chain */
+ 		.db_stage3 = {3, 3, 3}, /* doesn't exist for 2G */
+ 		.db_stage4 = {3, 3, 3},	 /* don't exist for 2G */
+ 		.xpaBiasLvl = 0,
+ 		.txFrameToDataStart = 0x0e,
+ 		.txFrameToPaOn = 0x0e,
+ 		.txClip = 3, /* 4 bits tx_clip, 4 bits dac_scale_cck */
+ 		.antennaGain = 0,
+ 		.switchSettling = 0x2d,
+ 		.adcDesiredSize = -30,
+ 		.txEndToXpaOff = 0,
+ 		.txEndToRxOn = 0x2,
+ 		.txFrameToXpaOn = 0xe,
+ 		.thresh62 = 28,
+ 		.papdRateMaskHt20 = LE32(0x0c80c080),
+ 		.papdRateMaskHt40 = LE32(0x0080c080),
+ 		.futureModal = {
+ 			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 		},
+ 	 },
+ 	.base_ext2 = {
+ 		.tempSlopeLow = 0,
+ 		.tempSlopeHigh = 0,
+ 		.xatten1DBLow = {0, 0, 0},
+ 		.xatten1MarginLow = {0, 0, 0},
+ 		.xatten1DBHigh = {0, 0, 0},
+ 		.xatten1MarginHigh = {0, 0, 0}
+ 	},
+ 	.calFreqPier5G = {
+ 		FREQ2FBIN(5180, 0),
+ 		FREQ2FBIN(5220, 0),
+ 		FREQ2FBIN(5320, 0),
+ 		FREQ2FBIN(5400, 0),
+ 		FREQ2FBIN(5500, 0),
+ 		FREQ2FBIN(5600, 0),
+ 		FREQ2FBIN(5725, 0),
+ 		FREQ2FBIN(5825, 0)
+ 	},
+ 	.calPierData5G = {
+ 			{
+ 				{0, 0, 0, 0, 0},
+ 				{0, 0, 0, 0, 0},
+ 				{0, 0, 0, 0, 0},
+ 				{0, 0, 0, 0, 0},
+ 				{0, 0, 0, 0, 0},
+ 				{0, 0, 0, 0, 0},
+ 				{0, 0, 0, 0, 0},
+ 				{0, 0, 0, 0, 0},
+ 			},
+ 			{
+ 				{0, 0, 0, 0, 0},
+ 				{0, 0, 0, 0, 0},
+ 				{0, 0, 0, 0, 0},
+ 				{0, 0, 0, 0, 0},
+ 				{0, 0, 0, 0, 0},
+ 				{0, 0, 0, 0, 0},
+ 				{0, 0, 0, 0, 0},
+ 				{0, 0, 0, 0, 0},
+ 			},
+ 			{
+ 				{0, 0, 0, 0, 0},
+ 				{0, 0, 0, 0, 0},
+ 				{0, 0, 0, 0, 0},
+ 				{0, 0, 0, 0, 0},
+ 				{0, 0, 0, 0, 0},
+ 				{0, 0, 0, 0, 0},
+ 				{0, 0, 0, 0, 0},
+ 				{0, 0, 0, 0, 0},
+ 			},
+ 
+ 	},
+ 	.calTarget_freqbin_5G = {
+ 		FREQ2FBIN(5180, 0),
+ 		FREQ2FBIN(5220, 0),
+ 		FREQ2FBIN(5320, 0),
+ 		FREQ2FBIN(5400, 0),
+ 		FREQ2FBIN(5500, 0),
+ 		FREQ2FBIN(5600, 0),
+ 		FREQ2FBIN(5725, 0),
+ 		FREQ2FBIN(5825, 0)
+ 	},
+ 	.calTarget_freqbin_5GHT20 = {
+ 		FREQ2FBIN(5180, 0),
+ 		FREQ2FBIN(5240, 0),
+ 		FREQ2FBIN(5320, 0),
+ 		FREQ2FBIN(5500, 0),
+ 		FREQ2FBIN(5700, 0),
+ 		FREQ2FBIN(5745, 0),
+ 		FREQ2FBIN(5725, 0),
+ 		FREQ2FBIN(5825, 0)
+ 	},
+ 	.calTarget_freqbin_5GHT40 = {
+ 		FREQ2FBIN(5180, 0),
+ 		FREQ2FBIN(5240, 0),
+ 		FREQ2FBIN(5320, 0),
+ 		FREQ2FBIN(5500, 0),
+ 		FREQ2FBIN(5700, 0),
+ 		FREQ2FBIN(5745, 0),
+ 		FREQ2FBIN(5725, 0),
+ 		FREQ2FBIN(5825, 0)
+ 	 },
+ 	.calTargetPower5G = {
+ 		/* 6-24,36,48,54 */
+ 		{ {20, 20, 20, 10} },
+ 		{ {20, 20, 20, 10} },
+ 		{ {20, 20, 20, 10} },
+ 		{ {20, 20, 20, 10} },
+ 		{ {20, 20, 20, 10} },
+ 		{ {20, 20, 20, 10} },
+ 		{ {20, 20, 20, 10} },
+ 		{ {20, 20, 20, 10} },
+ 	 },
+ 	.calTargetPower5GHT20 = {
+ 		/*
+ 		 * 0_8_16,1-3_9-11_17-19,
+ 		 * 4,5,6,7,12,13,14,15,20,21,22,23
+ 		 */
+ 		{ {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
+ 		{ {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
+ 		{ {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
+ 		{ {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
+ 		{ {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
+ 		{ {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
+ 		{ {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
+ 		{ {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
+ 	 },
+ 	.calTargetPower5GHT40 =  {
+ 		/*
+ 		 * 0_8_16,1-3_9-11_17-19,
+ 		 * 4,5,6,7,12,13,14,15,20,21,22,23
+ 		 */
+ 		{ {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
+ 		{ {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
+ 		{ {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
+ 		{ {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
+ 		{ {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
+ 		{ {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
+ 		{ {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
+ 		{ {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
+ 	 },
+ 	.ctlIndex_5G =  {
+ 		0x10, 0x16, 0x18, 0x40, 0x46,
+ 		0x48, 0x30, 0x36, 0x38
+ 	},
+ 	.ctl_freqbin_5G =  {
+ 		{
+ 			/* Data[0].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
+ 			/* Data[0].ctlEdges[1].bChannel */ FREQ2FBIN(5260, 0),
+ 			/* Data[0].ctlEdges[2].bChannel */ FREQ2FBIN(5280, 0),
+ 			/* Data[0].ctlEdges[3].bChannel */ FREQ2FBIN(5500, 0),
+ 			/* Data[0].ctlEdges[4].bChannel */ FREQ2FBIN(5600, 0),
+ 			/* Data[0].ctlEdges[5].bChannel */ FREQ2FBIN(5700, 0),
+ 			/* Data[0].ctlEdges[6].bChannel */ FREQ2FBIN(5745, 0),
+ 			/* Data[0].ctlEdges[7].bChannel */ FREQ2FBIN(5825, 0)
+ 		},
+ 		{
+ 			/* Data[1].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
+ 			/* Data[1].ctlEdges[1].bChannel */ FREQ2FBIN(5260, 0),
+ 			/* Data[1].ctlEdges[2].bChannel */ FREQ2FBIN(5280, 0),
+ 			/* Data[1].ctlEdges[3].bChannel */ FREQ2FBIN(5500, 0),
+ 			/* Data[1].ctlEdges[4].bChannel */ FREQ2FBIN(5520, 0),
+ 			/* Data[1].ctlEdges[5].bChannel */ FREQ2FBIN(5700, 0),
+ 			/* Data[1].ctlEdges[6].bChannel */ FREQ2FBIN(5745, 0),
+ 			/* Data[1].ctlEdges[7].bChannel */ FREQ2FBIN(5825, 0)
+ 		},
+ 
+ 		{
+ 			/* Data[2].ctlEdges[0].bChannel */ FREQ2FBIN(5190, 0),
+ 			/* Data[2].ctlEdges[1].bChannel */ FREQ2FBIN(5230, 0),
+ 			/* Data[2].ctlEdges[2].bChannel */ FREQ2FBIN(5270, 0),
+ 			/* Data[2].ctlEdges[3].bChannel */ FREQ2FBIN(5310, 0),
+ 			/* Data[2].ctlEdges[4].bChannel */ FREQ2FBIN(5510, 0),
+ 			/* Data[2].ctlEdges[5].bChannel */ FREQ2FBIN(5550, 0),
+ 			/* Data[2].ctlEdges[6].bChannel */ FREQ2FBIN(5670, 0),
+ 			/* Data[2].ctlEdges[7].bChannel */ FREQ2FBIN(5755, 0)
+ 		},
+ 
+ 		{
+ 			/* Data[3].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
+ 			/* Data[3].ctlEdges[1].bChannel */ FREQ2FBIN(5200, 0),
+ 			/* Data[3].ctlEdges[2].bChannel */ FREQ2FBIN(5260, 0),
+ 			/* Data[3].ctlEdges[3].bChannel */ FREQ2FBIN(5320, 0),
+ 			/* Data[3].ctlEdges[4].bChannel */ FREQ2FBIN(5500, 0),
+ 			/* Data[3].ctlEdges[5].bChannel */ FREQ2FBIN(5700, 0),
+ 			/* Data[3].ctlEdges[6].bChannel */ 0xFF,
+ 			/* Data[3].ctlEdges[7].bChannel */ 0xFF,
+ 		},
+ 
+ 		{
+ 			/* Data[4].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
+ 			/* Data[4].ctlEdges[1].bChannel */ FREQ2FBIN(5260, 0),
+ 			/* Data[4].ctlEdges[2].bChannel */ FREQ2FBIN(5500, 0),
+ 			/* Data[4].ctlEdges[3].bChannel */ FREQ2FBIN(5700, 0),
+ 			/* Data[4].ctlEdges[4].bChannel */ 0xFF,
+ 			/* Data[4].ctlEdges[5].bChannel */ 0xFF,
+ 			/* Data[4].ctlEdges[6].bChannel */ 0xFF,
+ 			/* Data[4].ctlEdges[7].bChannel */ 0xFF,
+ 		},
+ 
+ 		{
+ 			/* Data[5].ctlEdges[0].bChannel */ FREQ2FBIN(5190, 0),
+ 			/* Data[5].ctlEdges[1].bChannel */ FREQ2FBIN(5270, 0),
+ 			/* Data[5].ctlEdges[2].bChannel */ FREQ2FBIN(5310, 0),
+ 			/* Data[5].ctlEdges[3].bChannel */ FREQ2FBIN(5510, 0),
+ 			/* Data[5].ctlEdges[4].bChannel */ FREQ2FBIN(5590, 0),
+ 			/* Data[5].ctlEdges[5].bChannel */ FREQ2FBIN(5670, 0),
+ 			/* Data[5].ctlEdges[6].bChannel */ 0xFF,
+ 			/* Data[5].ctlEdges[7].bChannel */ 0xFF
+ 		},
+ 
+ 		{
+ 			/* Data[6].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
+ 			/* Data[6].ctlEdges[1].bChannel */ FREQ2FBIN(5200, 0),
+ 			/* Data[6].ctlEdges[2].bChannel */ FREQ2FBIN(5220, 0),
+ 			/* Data[6].ctlEdges[3].bChannel */ FREQ2FBIN(5260, 0),
+ 			/* Data[6].ctlEdges[4].bChannel */ FREQ2FBIN(5500, 0),
+ 			/* Data[6].ctlEdges[5].bChannel */ FREQ2FBIN(5600, 0),
+ 			/* Data[6].ctlEdges[6].bChannel */ FREQ2FBIN(5700, 0),
+ 			/* Data[6].ctlEdges[7].bChannel */ FREQ2FBIN(5745, 0)
+ 		},
+ 
+ 		{
+ 			/* Data[7].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
+ 			/* Data[7].ctlEdges[1].bChannel */ FREQ2FBIN(5260, 0),
+ 			/* Data[7].ctlEdges[2].bChannel */ FREQ2FBIN(5320, 0),
+ 			/* Data[7].ctlEdges[3].bChannel */ FREQ2FBIN(5500, 0),
+ 			/* Data[7].ctlEdges[4].bChannel */ FREQ2FBIN(5560, 0),
+ 			/* Data[7].ctlEdges[5].bChannel */ FREQ2FBIN(5700, 0),
+ 			/* Data[7].ctlEdges[6].bChannel */ FREQ2FBIN(5745, 0),
+ 			/* Data[7].ctlEdges[7].bChannel */ FREQ2FBIN(5825, 0)
+ 		},
+ 
+ 		{
+ 			/* Data[8].ctlEdges[0].bChannel */ FREQ2FBIN(5190, 0),
+ 			/* Data[8].ctlEdges[1].bChannel */ FREQ2FBIN(5230, 0),
+ 			/* Data[8].ctlEdges[2].bChannel */ FREQ2FBIN(5270, 0),
+ 			/* Data[8].ctlEdges[3].bChannel */ FREQ2FBIN(5510, 0),
+ 			/* Data[8].ctlEdges[4].bChannel */ FREQ2FBIN(5550, 0),
+ 			/* Data[8].ctlEdges[5].bChannel */ FREQ2FBIN(5670, 0),
+ 			/* Data[8].ctlEdges[6].bChannel */ FREQ2FBIN(5755, 0),
+ 			/* Data[8].ctlEdges[7].bChannel */ FREQ2FBIN(5795, 0)
+ 		}
+ 	 },
+ 	.ctlPowerData_5G = {
+ 		{
+ 			{
+ 				{60, 1}, {60, 1}, {60, 1}, {60, 1},
+ 				{60, 1}, {60, 1}, {60, 1}, {60, 0},
+ 			}
+ 		},
+ 		{
+ 			{
+ 				{60, 1}, {60, 1}, {60, 1}, {60, 1},
+ 				{60, 1}, {60, 1}, {60, 1}, {60, 0},
+ 			}
+ 		},
+ 		{
+ 			{
+ 				{60, 0}, {60, 1}, {60, 0}, {60, 1},
+ 				{60, 1}, {60, 1}, {60, 1}, {60, 1},
+ 			}
+ 		},
+ 		{
+ 			{
+ 				{60, 0}, {60, 1}, {60, 1}, {60, 0},
+ 				{60, 1}, {60, 0}, {60, 0}, {60, 0},
+ 			}
+ 		},
+ 		{
+ 			{
+ 				{60, 1}, {60, 1}, {60, 1}, {60, 0},
+ 				{60, 0}, {60, 0}, {60, 0}, {60, 0},
+ 			}
+ 		},
+ 		{
+ 			{
+ 				{60, 1}, {60, 1}, {60, 1}, {60, 1},
+ 				{60, 1}, {60, 0}, {60, 0}, {60, 0},
+ 			}
+ 		},
+ 		{
+ 			{
+ 				{60, 1}, {60, 1}, {60, 1}, {60, 1},
+ 				{60, 1}, {60, 1}, {60, 1}, {60, 1},
+ 			}
+ 		},
+ 		{
+ 			{
+ 				{60, 1}, {60, 1}, {60, 0}, {60, 1},
+ 				{60, 1}, {60, 1}, {60, 1}, {60, 0},
+ 			}
+ 		},
+ 		{
+ 			{
+ 				{60, 1}, {60, 0}, {60, 1}, {60, 1},
+ 				{60, 1}, {60, 1}, {60, 0}, {60, 1},
+ 			}
+ 		},
+ 	 }
+ };
+ 
+ static const struct ar9300_eeprom ar9300_x113 = {
+ 	.eepromVersion = 2,
+ 	.templateVersion = 6,
+ 	.macAddr = {0x00, 0x03, 0x7f, 0x0, 0x0, 0x0},
+ 	.custData = {"x113-023-f0000"},
+ 	.baseEepHeader = {
+ 		.regDmn = { LE16(0), LE16(0x1f) },
+ 		.txrxMask =  0x77, /* 4 bits tx and 4 bits rx */
+ 		.opCapFlags = {
+ 			.opFlags = AR9300_OPFLAGS_11G | AR9300_OPFLAGS_11A,
+ 			.eepMisc = 0,
+ 		},
+ 		.rfSilent = 0,
+ 		.blueToothOptions = 0,
+ 		.deviceCap = 0,
+ 		.deviceType = 5, /* takes lower byte in eeprom location */
+ 		.pwrTableOffset = AR9300_PWR_TABLE_OFFSET,
+ 		.params_for_tuning_caps = {0, 0},
+ 		.featureEnable = 0x0d,
+ 		 /*
+ 		  * bit0 - enable tx temp comp - disabled
+ 		  * bit1 - enable tx volt comp - disabled
+ 		  * bit2 - enable fastClock - enabled
+ 		  * bit3 - enable doubling - enabled
+ 		  * bit4 - enable internal regulator - disabled
+ 		  * bit5 - enable pa predistortion - disabled
+ 		  */
+ 		.miscConfiguration = 0, /* bit0 - turn down drivestrength */
+ 		.eepromWriteEnableGpio = 6,
+ 		.wlanDisableGpio = 0,
+ 		.wlanLedGpio = 8,
+ 		.rxBandSelectGpio = 0xff,
+ 		.txrxgain = 0x21,
+ 		.swreg = 0,
+ 	 },
+ 	.modalHeader2G = {
+ 	/* ar9300_modal_eep_header  2g */
+ 		/* 4 idle,t1,t2,b(4 bits per setting) */
+ 		.antCtrlCommon = LE32(0x110),
+ 		/* 4 ra1l1, ra2l1, ra1l2, ra2l2, ra12 */
+ 		.antCtrlCommon2 = LE32(0x44444),
+ 
+ 		/*
+ 		 * antCtrlChain[AR9300_MAX_CHAINS]; 6 idle, t, r,
+ 		 * rx1, rx12, b (2 bits each)
+ 		 */
+ 		.antCtrlChain = { LE16(0x150), LE16(0x150), LE16(0x150) },
+ 
+ 		/*
+ 		 * xatten1DB[AR9300_MAX_CHAINS];  3 xatten1_db
+ 		 * for ar9280 (0xa20c/b20c 5:0)
+ 		 */
+ 		.xatten1DB = {0, 0, 0},
+ 
+ 		/*
+ 		 * xatten1Margin[AR9300_MAX_CHAINS]; 3 xatten1_margin
+ 		 * for ar9280 (0xa20c/b20c 16:12
+ 		 */
+ 		.xatten1Margin = {0, 0, 0},
+ 		.tempSlope = 25,
+ 		.voltSlope = 0,
+ 
+ 		/*
+ 		 * spurChans[OSPREY_EEPROM_MODAL_SPURS]; spur
+ 		 * channels in usual fbin coding format
+ 		 */
+ 		.spurChans = {FREQ2FBIN(2464, 1), 0, 0, 0, 0},
+ 
+ 		/*
+ 		 * noiseFloorThreshCh[AR9300_MAX_CHAINS]; 3 Check
+ 		 * if the register is per chain
+ 		 */
+ 		.noiseFloorThreshCh = {-1, 0, 0},
+ 		.ob = {1, 1, 1},/* 3 chain */
+ 		.db_stage2 = {1, 1, 1}, /* 3 chain  */
+ 		.db_stage3 = {0, 0, 0},
+ 		.db_stage4 = {0, 0, 0},
+ 		.xpaBiasLvl = 0,
+ 		.txFrameToDataStart = 0x0e,
+ 		.txFrameToPaOn = 0x0e,
+ 		.txClip = 3, /* 4 bits tx_clip, 4 bits dac_scale_cck */
+ 		.antennaGain = 0,
+ 		.switchSettling = 0x2c,
+ 		.adcDesiredSize = -30,
+ 		.txEndToXpaOff = 0,
+ 		.txEndToRxOn = 0x2,
+ 		.txFrameToXpaOn = 0xe,
+ 		.thresh62 = 28,
+ 		.papdRateMaskHt20 = LE32(0x0c80c080),
+ 		.papdRateMaskHt40 = LE32(0x0080c080),
+ 		.futureModal = {
+ 			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 		},
+ 	 },
+ 	 .base_ext1 = {
+ 		.ant_div_control = 0,
+ 		.future = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
+ 	 },
+ 	.calFreqPier2G = {
+ 		FREQ2FBIN(2412, 1),
+ 		FREQ2FBIN(2437, 1),
+ 		FREQ2FBIN(2472, 1),
+ 	 },
+ 	/* ar9300_cal_data_per_freq_op_loop 2g */
+ 	.calPierData2G = {
+ 		{ {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0} },
+ 		{ {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0} },
+ 		{ {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0} },
+ 	 },
+ 	.calTarget_freqbin_Cck = {
+ 		FREQ2FBIN(2412, 1),
+ 		FREQ2FBIN(2472, 1),
+ 	 },
+ 	.calTarget_freqbin_2G = {
+ 		FREQ2FBIN(2412, 1),
+ 		FREQ2FBIN(2437, 1),
+ 		FREQ2FBIN(2472, 1)
+ 	 },
+ 	.calTarget_freqbin_2GHT20 = {
+ 		FREQ2FBIN(2412, 1),
+ 		FREQ2FBIN(2437, 1),
+ 		FREQ2FBIN(2472, 1)
+ 	 },
+ 	.calTarget_freqbin_2GHT40 = {
+ 		FREQ2FBIN(2412, 1),
+ 		FREQ2FBIN(2437, 1),
+ 		FREQ2FBIN(2472, 1)
+ 	 },
+ 	.calTargetPowerCck = {
+ 		 /* 1L-5L,5S,11L,11S */
+ 		 { {34, 34, 34, 34} },
+ 		 { {34, 34, 34, 34} },
+ 	},
+ 	.calTargetPower2G = {
+ 		 /* 6-24,36,48,54 */
+ 		 { {34, 34, 32, 32} },
+ 		 { {34, 34, 32, 32} },
+ 		 { {34, 34, 32, 32} },
+ 	},
+ 	.calTargetPower2GHT20 = {
+ 		{ {32, 32, 32, 32, 32, 28, 32, 32, 30, 28, 0, 0, 0, 0} },
+ 		{ {32, 32, 32, 32, 32, 28, 32, 32, 30, 28, 0, 0, 0, 0} },
+ 		{ {32, 32, 32, 32, 32, 28, 32, 32, 30, 28, 0, 0, 0, 0} },
+ 	},
+ 	.calTargetPower2GHT40 = {
+ 		{ {30, 30, 30, 30, 30, 28, 30, 30, 28, 26, 0, 0, 0, 0} },
+ 		{ {30, 30, 30, 30, 30, 28, 30, 30, 28, 26, 0, 0, 0, 0} },
+ 		{ {30, 30, 30, 30, 30, 28, 30, 30, 28, 26, 0, 0, 0, 0} },
+ 	},
+ 	.ctlIndex_2G =  {
+ 		0x11, 0x12, 0x15, 0x17, 0x41, 0x42,
+ 		0x45, 0x47, 0x31, 0x32, 0x35, 0x37,
+ 	},
+ 	.ctl_freqbin_2G = {
+ 		{
+ 			FREQ2FBIN(2412, 1),
+ 			FREQ2FBIN(2417, 1),
+ 			FREQ2FBIN(2457, 1),
+ 			FREQ2FBIN(2462, 1)
+ 		},
+ 		{
+ 			FREQ2FBIN(2412, 1),
+ 			FREQ2FBIN(2417, 1),
+ 			FREQ2FBIN(2462, 1),
+ 			0xFF,
+ 		},
+ 
+ 		{
+ 			FREQ2FBIN(2412, 1),
+ 			FREQ2FBIN(2417, 1),
+ 			FREQ2FBIN(2462, 1),
+ 			0xFF,
+ 		},
+ 		{
+ 			FREQ2FBIN(2422, 1),
+ 			FREQ2FBIN(2427, 1),
+ 			FREQ2FBIN(2447, 1),
+ 			FREQ2FBIN(2452, 1)
+ 		},
+ 
+ 		{
+ 			/* Data[4].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
+ 			/* Data[4].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
+ 			/* Data[4].ctlEdges[2].bChannel */ FREQ2FBIN(2472, 1),
+ 			/* Data[4].ctlEdges[3].bChannel */ FREQ2FBIN(2484, 1),
+ 		},
+ 
+ 		{
+ 			/* Data[5].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
+ 			/* Data[5].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
+ 			/* Data[5].ctlEdges[2].bChannel */ FREQ2FBIN(2472, 1),
+ 			0,
+ 		},
+ 
+ 		{
+ 			/* Data[6].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
+ 			/* Data[6].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
+ 			FREQ2FBIN(2472, 1),
+ 			0,
+ 		},
+ 
+ 		{
+ 			/* Data[7].ctlEdges[0].bChannel */ FREQ2FBIN(2422, 1),
+ 			/* Data[7].ctlEdges[1].bChannel */ FREQ2FBIN(2427, 1),
+ 			/* Data[7].ctlEdges[2].bChannel */ FREQ2FBIN(2447, 1),
+ 			/* Data[7].ctlEdges[3].bChannel */ FREQ2FBIN(2462, 1),
+ 		},
+ 
+ 		{
+ 			/* Data[8].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
+ 			/* Data[8].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
+ 			/* Data[8].ctlEdges[2].bChannel */ FREQ2FBIN(2472, 1),
+ 		},
+ 
+ 		{
+ 			/* Data[9].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
+ 			/* Data[9].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
+ 			/* Data[9].ctlEdges[2].bChannel */ FREQ2FBIN(2472, 1),
+ 			0
+ 		},
+ 
+ 		{
+ 			/* Data[10].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
+ 			/* Data[10].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
+ 			/* Data[10].ctlEdges[2].bChannel */ FREQ2FBIN(2472, 1),
+ 			0
+ 		},
+ 
+ 		{
+ 			/* Data[11].ctlEdges[0].bChannel */ FREQ2FBIN(2422, 1),
+ 			/* Data[11].ctlEdges[1].bChannel */ FREQ2FBIN(2427, 1),
+ 			/* Data[11].ctlEdges[2].bChannel */ FREQ2FBIN(2447, 1),
+ 			/* Data[11].ctlEdges[3].bChannel */ FREQ2FBIN(2462, 1),
+ 		}
+ 	 },
+ 	.ctlPowerData_2G = {
+ 		 { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
+ 		 { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
+ 		 { { {60, 1}, {60, 0}, {60, 0}, {60, 1} } },
+ 
+ 		 { { {60, 1}, {60, 0}, {0, 0}, {0, 0} } },
+ 		 { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
+ 		 { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
+ 
+ 		 { { {60, 0}, {60, 1}, {60, 1}, {60, 0} } },
+ 		 { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
+ 		 { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
+ 
+ 		 { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
+ 		 { { {60, 0}, {60, 1}, {60, 1}, {60, 1} } },
+ 		 { { {60, 0}, {60, 1}, {60, 1}, {60, 1} } },
+ 	 },
+ 	.modalHeader5G = {
+ 		/* 4 idle,t1,t2,b (4 bits per setting) */
+ 		.antCtrlCommon = LE32(0x220),
+ 		/* 4 ra1l1, ra2l1, ra1l2,ra2l2,ra12 */
+ 		.antCtrlCommon2 = LE32(0x11111),
+ 		 /* antCtrlChain 6 idle, t,r,rx1,rx12,b (2 bits each) */
+ 		.antCtrlChain = {
+ 			LE16(0x150), LE16(0x150), LE16(0x150),
+ 		},
+ 		 /* xatten1DB 3 xatten1_db for AR9280 (0xa20c/b20c 5:0) */
+ 		.xatten1DB = {0, 0, 0},
+ 
+ 		/*
+ 		 * xatten1Margin[AR9300_MAX_CHAINS]; 3 xatten1_margin
+ 		 * for merlin (0xa20c/b20c 16:12
+ 		 */
+ 		.xatten1Margin = {0, 0, 0},
+ 		.tempSlope = 68,
+ 		.voltSlope = 0,
+ 		/* spurChans spur channels in usual fbin coding format */
+ 		.spurChans = {FREQ2FBIN(5500, 0), 0, 0, 0, 0},
+ 		/* noiseFloorThreshCh Check if the register is per chain */
+ 		.noiseFloorThreshCh = {-1, 0, 0},
+ 		.ob = {3, 3, 3}, /* 3 chain */
+ 		.db_stage2 = {3, 3, 3}, /* 3 chain */
+ 		.db_stage3 = {3, 3, 3}, /* doesn't exist for 2G */
+ 		.db_stage4 = {3, 3, 3},	 /* don't exist for 2G */
+ 		.xpaBiasLvl = 0,
+ 		.txFrameToDataStart = 0x0e,
+ 		.txFrameToPaOn = 0x0e,
+ 		.txClip = 3, /* 4 bits tx_clip, 4 bits dac_scale_cck */
+ 		.antennaGain = 0,
+ 		.switchSettling = 0x2d,
+ 		.adcDesiredSize = -30,
+ 		.txEndToXpaOff = 0,
+ 		.txEndToRxOn = 0x2,
+ 		.txFrameToXpaOn = 0xe,
+ 		.thresh62 = 28,
+ 		.papdRateMaskHt20 = LE32(0x0cf0e0e0),
+ 		.papdRateMaskHt40 = LE32(0x6cf0e0e0),
+ 		.futureModal = {
+ 			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 		},
+ 	 },
+ 	.base_ext2 = {
+ 		.tempSlopeLow = 72,
+ 		.tempSlopeHigh = 105,
+ 		.xatten1DBLow = {0, 0, 0},
+ 		.xatten1MarginLow = {0, 0, 0},
+ 		.xatten1DBHigh = {0, 0, 0},
+ 		.xatten1MarginHigh = {0, 0, 0}
+ 	 },
+ 	.calFreqPier5G = {
+ 		FREQ2FBIN(5180, 0),
+ 		FREQ2FBIN(5240, 0),
+ 		FREQ2FBIN(5320, 0),
+ 		FREQ2FBIN(5400, 0),
+ 		FREQ2FBIN(5500, 0),
+ 		FREQ2FBIN(5600, 0),
+ 		FREQ2FBIN(5745, 0),
+ 		FREQ2FBIN(5785, 0)
+ 	},
+ 	.calPierData5G = {
+ 			{
+ 				{0, 0, 0, 0, 0},
+ 				{0, 0, 0, 0, 0},
+ 				{0, 0, 0, 0, 0},
+ 				{0, 0, 0, 0, 0},
+ 				{0, 0, 0, 0, 0},
+ 				{0, 0, 0, 0, 0},
+ 				{0, 0, 0, 0, 0},
+ 				{0, 0, 0, 0, 0},
+ 			},
+ 			{
+ 				{0, 0, 0, 0, 0},
+ 				{0, 0, 0, 0, 0},
+ 				{0, 0, 0, 0, 0},
+ 				{0, 0, 0, 0, 0},
+ 				{0, 0, 0, 0, 0},
+ 				{0, 0, 0, 0, 0},
+ 				{0, 0, 0, 0, 0},
+ 				{0, 0, 0, 0, 0},
+ 			},
+ 			{
+ 				{0, 0, 0, 0, 0},
+ 				{0, 0, 0, 0, 0},
+ 				{0, 0, 0, 0, 0},
+ 				{0, 0, 0, 0, 0},
+ 				{0, 0, 0, 0, 0},
+ 				{0, 0, 0, 0, 0},
+ 				{0, 0, 0, 0, 0},
+ 				{0, 0, 0, 0, 0},
+ 			},
+ 
+ 	},
+ 	.calTarget_freqbin_5G = {
+ 		FREQ2FBIN(5180, 0),
+ 		FREQ2FBIN(5220, 0),
+ 		FREQ2FBIN(5320, 0),
+ 		FREQ2FBIN(5400, 0),
+ 		FREQ2FBIN(5500, 0),
+ 		FREQ2FBIN(5600, 0),
+ 		FREQ2FBIN(5745, 0),
+ 		FREQ2FBIN(5785, 0)
+ 	},
+ 	.calTarget_freqbin_5GHT20 = {
+ 		FREQ2FBIN(5180, 0),
+ 		FREQ2FBIN(5240, 0),
+ 		FREQ2FBIN(5320, 0),
+ 		FREQ2FBIN(5400, 0),
+ 		FREQ2FBIN(5500, 0),
+ 		FREQ2FBIN(5700, 0),
+ 		FREQ2FBIN(5745, 0),
+ 		FREQ2FBIN(5825, 0)
+ 	},
+ 	.calTarget_freqbin_5GHT40 = {
+ 		FREQ2FBIN(5190, 0),
+ 		FREQ2FBIN(5230, 0),
+ 		FREQ2FBIN(5320, 0),
+ 		FREQ2FBIN(5410, 0),
+ 		FREQ2FBIN(5510, 0),
+ 		FREQ2FBIN(5670, 0),
+ 		FREQ2FBIN(5755, 0),
+ 		FREQ2FBIN(5825, 0)
+ 	 },
+ 	.calTargetPower5G = {
+ 		/* 6-24,36,48,54 */
+ 		{ {42, 40, 40, 34} },
+ 		{ {42, 40, 40, 34} },
+ 		{ {42, 40, 40, 34} },
+ 		{ {42, 40, 40, 34} },
+ 		{ {42, 40, 40, 34} },
+ 		{ {42, 40, 40, 34} },
+ 		{ {42, 40, 40, 34} },
+ 		{ {42, 40, 40, 34} },
+ 	 },
+ 	.calTargetPower5GHT20 = {
+ 		/*
+ 		 * 0_8_16,1-3_9-11_17-19,
+ 		 * 4,5,6,7,12,13,14,15,20,21,22,23
+ 		 */
+ 		{ {40, 40, 40, 40, 32, 28, 40, 40, 32, 28, 40, 40, 32, 20} },
+ 		{ {40, 40, 40, 40, 32, 28, 40, 40, 32, 28, 40, 40, 32, 20} },
+ 		{ {40, 40, 40, 40, 32, 28, 40, 40, 32, 28, 40, 40, 32, 20} },
+ 		{ {40, 40, 40, 40, 32, 28, 40, 40, 32, 28, 40, 40, 32, 20} },
+ 		{ {40, 40, 40, 40, 32, 28, 40, 40, 32, 28, 40, 40, 32, 20} },
+ 		{ {40, 40, 40, 40, 32, 28, 40, 40, 32, 28, 40, 40, 32, 20} },
+ 		{ {38, 38, 38, 38, 32, 28, 38, 38, 32, 28, 38, 38, 32, 26} },
+ 		{ {36, 36, 36, 36, 32, 28, 36, 36, 32, 28, 36, 36, 32, 26} },
+ 	 },
+ 	.calTargetPower5GHT40 =  {
+ 		/*
+ 		 * 0_8_16,1-3_9-11_17-19,
+ 		 * 4,5,6,7,12,13,14,15,20,21,22,23
+ 		 */
+ 		{ {40, 40, 40, 38, 30, 26, 40, 40, 30, 26, 40, 40, 30, 24} },
+ 		{ {40, 40, 40, 38, 30, 26, 40, 40, 30, 26, 40, 40, 30, 24} },
+ 		{ {40, 40, 40, 38, 30, 26, 40, 40, 30, 26, 40, 40, 30, 24} },
+ 		{ {40, 40, 40, 38, 30, 26, 40, 40, 30, 26, 40, 40, 30, 24} },
+ 		{ {40, 40, 40, 38, 30, 26, 40, 40, 30, 26, 40, 40, 30, 24} },
+ 		{ {40, 40, 40, 38, 30, 26, 40, 40, 30, 26, 40, 40, 30, 24} },
+ 		{ {36, 36, 36, 36, 30, 26, 36, 36, 30, 26, 36, 36, 30, 24} },
+ 		{ {34, 34, 34, 34, 30, 26, 34, 34, 30, 26, 34, 34, 30, 24} },
+ 	 },
+ 	.ctlIndex_5G =  {
+ 		0x10, 0x16, 0x18, 0x40, 0x46,
+ 		0x48, 0x30, 0x36, 0x38
+ 	},
+ 	.ctl_freqbin_5G =  {
+ 		{
+ 			/* Data[0].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
+ 			/* Data[0].ctlEdges[1].bChannel */ FREQ2FBIN(5260, 0),
+ 			/* Data[0].ctlEdges[2].bChannel */ FREQ2FBIN(5280, 0),
+ 			/* Data[0].ctlEdges[3].bChannel */ FREQ2FBIN(5500, 0),
+ 			/* Data[0].ctlEdges[4].bChannel */ FREQ2FBIN(5600, 0),
+ 			/* Data[0].ctlEdges[5].bChannel */ FREQ2FBIN(5700, 0),
+ 			/* Data[0].ctlEdges[6].bChannel */ FREQ2FBIN(5745, 0),
+ 			/* Data[0].ctlEdges[7].bChannel */ FREQ2FBIN(5825, 0)
+ 		},
+ 		{
+ 			/* Data[1].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
+ 			/* Data[1].ctlEdges[1].bChannel */ FREQ2FBIN(5260, 0),
+ 			/* Data[1].ctlEdges[2].bChannel */ FREQ2FBIN(5280, 0),
+ 			/* Data[1].ctlEdges[3].bChannel */ FREQ2FBIN(5500, 0),
+ 			/* Data[1].ctlEdges[4].bChannel */ FREQ2FBIN(5520, 0),
+ 			/* Data[1].ctlEdges[5].bChannel */ FREQ2FBIN(5700, 0),
+ 			/* Data[1].ctlEdges[6].bChannel */ FREQ2FBIN(5745, 0),
+ 			/* Data[1].ctlEdges[7].bChannel */ FREQ2FBIN(5825, 0)
+ 		},
+ 
+ 		{
+ 			/* Data[2].ctlEdges[0].bChannel */ FREQ2FBIN(5190, 0),
+ 			/* Data[2].ctlEdges[1].bChannel */ FREQ2FBIN(5230, 0),
+ 			/* Data[2].ctlEdges[2].bChannel */ FREQ2FBIN(5270, 0),
+ 			/* Data[2].ctlEdges[3].bChannel */ FREQ2FBIN(5310, 0),
+ 			/* Data[2].ctlEdges[4].bChannel */ FREQ2FBIN(5510, 0),
+ 			/* Data[2].ctlEdges[5].bChannel */ FREQ2FBIN(5550, 0),
+ 			/* Data[2].ctlEdges[6].bChannel */ FREQ2FBIN(5670, 0),
+ 			/* Data[2].ctlEdges[7].bChannel */ FREQ2FBIN(5755, 0)
+ 		},
+ 
+ 		{
+ 			/* Data[3].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
+ 			/* Data[3].ctlEdges[1].bChannel */ FREQ2FBIN(5200, 0),
+ 			/* Data[3].ctlEdges[2].bChannel */ FREQ2FBIN(5260, 0),
+ 			/* Data[3].ctlEdges[3].bChannel */ FREQ2FBIN(5320, 0),
+ 			/* Data[3].ctlEdges[4].bChannel */ FREQ2FBIN(5500, 0),
+ 			/* Data[3].ctlEdges[5].bChannel */ FREQ2FBIN(5700, 0),
+ 			/* Data[3].ctlEdges[6].bChannel */ 0xFF,
+ 			/* Data[3].ctlEdges[7].bChannel */ 0xFF,
+ 		},
+ 
+ 		{
+ 			/* Data[4].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
+ 			/* Data[4].ctlEdges[1].bChannel */ FREQ2FBIN(5260, 0),
+ 			/* Data[4].ctlEdges[2].bChannel */ FREQ2FBIN(5500, 0),
+ 			/* Data[4].ctlEdges[3].bChannel */ FREQ2FBIN(5700, 0),
+ 			/* Data[4].ctlEdges[4].bChannel */ 0xFF,
+ 			/* Data[4].ctlEdges[5].bChannel */ 0xFF,
+ 			/* Data[4].ctlEdges[6].bChannel */ 0xFF,
+ 			/* Data[4].ctlEdges[7].bChannel */ 0xFF,
+ 		},
+ 
+ 		{
+ 			/* Data[5].ctlEdges[0].bChannel */ FREQ2FBIN(5190, 0),
+ 			/* Data[5].ctlEdges[1].bChannel */ FREQ2FBIN(5270, 0),
+ 			/* Data[5].ctlEdges[2].bChannel */ FREQ2FBIN(5310, 0),
+ 			/* Data[5].ctlEdges[3].bChannel */ FREQ2FBIN(5510, 0),
+ 			/* Data[5].ctlEdges[4].bChannel */ FREQ2FBIN(5590, 0),
+ 			/* Data[5].ctlEdges[5].bChannel */ FREQ2FBIN(5670, 0),
+ 			/* Data[5].ctlEdges[6].bChannel */ 0xFF,
+ 			/* Data[5].ctlEdges[7].bChannel */ 0xFF
+ 		},
+ 
+ 		{
+ 			/* Data[6].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
+ 			/* Data[6].ctlEdges[1].bChannel */ FREQ2FBIN(5200, 0),
+ 			/* Data[6].ctlEdges[2].bChannel */ FREQ2FBIN(5220, 0),
+ 			/* Data[6].ctlEdges[3].bChannel */ FREQ2FBIN(5260, 0),
+ 			/* Data[6].ctlEdges[4].bChannel */ FREQ2FBIN(5500, 0),
+ 			/* Data[6].ctlEdges[5].bChannel */ FREQ2FBIN(5600, 0),
+ 			/* Data[6].ctlEdges[6].bChannel */ FREQ2FBIN(5700, 0),
+ 			/* Data[6].ctlEdges[7].bChannel */ FREQ2FBIN(5745, 0)
+ 		},
+ 
+ 		{
+ 			/* Data[7].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
+ 			/* Data[7].ctlEdges[1].bChannel */ FREQ2FBIN(5260, 0),
+ 			/* Data[7].ctlEdges[2].bChannel */ FREQ2FBIN(5320, 0),
+ 			/* Data[7].ctlEdges[3].bChannel */ FREQ2FBIN(5500, 0),
+ 			/* Data[7].ctlEdges[4].bChannel */ FREQ2FBIN(5560, 0),
+ 			/* Data[7].ctlEdges[5].bChannel */ FREQ2FBIN(5700, 0),
+ 			/* Data[7].ctlEdges[6].bChannel */ FREQ2FBIN(5745, 0),
+ 			/* Data[7].ctlEdges[7].bChannel */ FREQ2FBIN(5825, 0)
+ 		},
+ 
+ 		{
+ 			/* Data[8].ctlEdges[0].bChannel */ FREQ2FBIN(5190, 0),
+ 			/* Data[8].ctlEdges[1].bChannel */ FREQ2FBIN(5230, 0),
+ 			/* Data[8].ctlEdges[2].bChannel */ FREQ2FBIN(5270, 0),
+ 			/* Data[8].ctlEdges[3].bChannel */ FREQ2FBIN(5510, 0),
+ 			/* Data[8].ctlEdges[4].bChannel */ FREQ2FBIN(5550, 0),
+ 			/* Data[8].ctlEdges[5].bChannel */ FREQ2FBIN(5670, 0),
+ 			/* Data[8].ctlEdges[6].bChannel */ FREQ2FBIN(5755, 0),
+ 			/* Data[8].ctlEdges[7].bChannel */ FREQ2FBIN(5795, 0)
+ 		}
+ 	 },
+ 	.ctlPowerData_5G = {
+ 		{
+ 			{
+ 				{60, 1}, {60, 1}, {60, 1}, {60, 1},
+ 				{60, 1}, {60, 1}, {60, 1}, {60, 0},
+ 			}
+ 		},
+ 		{
+ 			{
+ 				{60, 1}, {60, 1}, {60, 1}, {60, 1},
+ 				{60, 1}, {60, 1}, {60, 1}, {60, 0},
+ 			}
+ 		},
+ 		{
+ 			{
+ 				{60, 0}, {60, 1}, {60, 0}, {60, 1},
+ 				{60, 1}, {60, 1}, {60, 1}, {60, 1},
+ 			}
+ 		},
+ 		{
+ 			{
+ 				{60, 0}, {60, 1}, {60, 1}, {60, 0},
+ 				{60, 1}, {60, 0}, {60, 0}, {60, 0},
+ 			}
+ 		},
+ 		{
+ 			{
+ 				{60, 1}, {60, 1}, {60, 1}, {60, 0},
+ 				{60, 0}, {60, 0}, {60, 0}, {60, 0},
+ 			}
+ 		},
+ 		{
+ 			{
+ 				{60, 1}, {60, 1}, {60, 1}, {60, 1},
+ 				{60, 1}, {60, 0}, {60, 0}, {60, 0},
+ 			}
+ 		},
+ 		{
+ 			{
+ 				{60, 1}, {60, 1}, {60, 1}, {60, 1},
+ 				{60, 1}, {60, 1}, {60, 1}, {60, 1},
+ 			}
+ 		},
+ 		{
+ 			{
+ 				{60, 1}, {60, 1}, {60, 0}, {60, 1},
+ 				{60, 1}, {60, 1}, {60, 1}, {60, 0},
+ 			}
+ 		},
+ 		{
+ 			{
+ 				{60, 1}, {60, 0}, {60, 1}, {60, 1},
+ 				{60, 1}, {60, 1}, {60, 0}, {60, 1},
+ 			}
+ 		},
+ 	 }
+ };
+ 
+ 
+ static const struct ar9300_eeprom ar9300_h112 = {
+ 	.eepromVersion = 2,
+ 	.templateVersion = 3,
+ 	.macAddr = {0x00, 0x03, 0x7f, 0x0, 0x0, 0x0},
+ 	.custData = {"h112-241-f0000"},
+ 	.baseEepHeader = {
+ 		.regDmn = { LE16(0), LE16(0x1f) },
+ 		.txrxMask =  0x77, /* 4 bits tx and 4 bits rx */
+ 		.opCapFlags = {
+ 			.opFlags = AR9300_OPFLAGS_11G | AR9300_OPFLAGS_11A,
+ 			.eepMisc = 0,
+ 		},
+ 		.rfSilent = 0,
+ 		.blueToothOptions = 0,
+ 		.deviceCap = 0,
+ 		.deviceType = 5, /* takes lower byte in eeprom location */
+ 		.pwrTableOffset = AR9300_PWR_TABLE_OFFSET,
+ 		.params_for_tuning_caps = {0, 0},
+ 		.featureEnable = 0x0d,
+ 		/*
+ 		 * bit0 - enable tx temp comp - disabled
+ 		 * bit1 - enable tx volt comp - disabled
+ 		 * bit2 - enable fastClock - enabled
+ 		 * bit3 - enable doubling - enabled
+ 		 * bit4 - enable internal regulator - disabled
+ 		 * bit5 - enable pa predistortion - disabled
+ 		 */
+ 		.miscConfiguration = 0, /* bit0 - turn down drivestrength */
+ 		.eepromWriteEnableGpio = 6,
+ 		.wlanDisableGpio = 0,
+ 		.wlanLedGpio = 8,
+ 		.rxBandSelectGpio = 0xff,
+ 		.txrxgain = 0x10,
+ 		.swreg = 0,
+ 	},
+ 	.modalHeader2G = {
+ 		/* ar9300_modal_eep_header  2g */
+ 		/* 4 idle,t1,t2,b(4 bits per setting) */
+ 		.antCtrlCommon = LE32(0x110),
+ 		/* 4 ra1l1, ra2l1, ra1l2, ra2l2, ra12 */
+ 		.antCtrlCommon2 = LE32(0x44444),
+ 
+ 		/*
+ 		 * antCtrlChain[AR9300_MAX_CHAINS]; 6 idle, t, r,
+ 		 * rx1, rx12, b (2 bits each)
+ 		 */
+ 		.antCtrlChain = { LE16(0x150), LE16(0x150), LE16(0x150) },
+ 
+ 		/*
+ 		 * xatten1DB[AR9300_MAX_CHAINS];  3 xatten1_db
+ 		 * for ar9280 (0xa20c/b20c 5:0)
+ 		 */
+ 		.xatten1DB = {0, 0, 0},
+ 
+ 		/*
+ 		 * xatten1Margin[AR9300_MAX_CHAINS]; 3 xatten1_margin
+ 		 * for ar9280 (0xa20c/b20c 16:12
+ 		 */
+ 		.xatten1Margin = {0, 0, 0},
+ 		.tempSlope = 25,
+ 		.voltSlope = 0,
+ 
+ 		/*
+ 		 * spurChans[OSPREY_EEPROM_MODAL_SPURS]; spur
+ 		 * channels in usual fbin coding format
+ 		 */
+ 		.spurChans = {FREQ2FBIN(2464, 1), 0, 0, 0, 0},
+ 
+ 		/*
+ 		 * noiseFloorThreshCh[AR9300_MAX_CHAINS]; 3 Check
+ 		 * if the register is per chain
+ 		 */
+ 		.noiseFloorThreshCh = {-1, 0, 0},
+ 		.ob = {1, 1, 1},/* 3 chain */
+ 		.db_stage2 = {1, 1, 1}, /* 3 chain  */
+ 		.db_stage3 = {0, 0, 0},
+ 		.db_stage4 = {0, 0, 0},
+ 		.xpaBiasLvl = 0,
+ 		.txFrameToDataStart = 0x0e,
+ 		.txFrameToPaOn = 0x0e,
+ 		.txClip = 3, /* 4 bits tx_clip, 4 bits dac_scale_cck */
+ 		.antennaGain = 0,
+ 		.switchSettling = 0x2c,
+ 		.adcDesiredSize = -30,
+ 		.txEndToXpaOff = 0,
+ 		.txEndToRxOn = 0x2,
+ 		.txFrameToXpaOn = 0xe,
+ 		.thresh62 = 28,
+ 		.papdRateMaskHt20 = LE32(0x80c080),
+ 		.papdRateMaskHt40 = LE32(0x80c080),
+ 		.futureModal = {
+ 			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 		},
+ 	},
+ 	.base_ext1 = {
+ 		.ant_div_control = 0,
+ 		.future = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
+ 	},
+ 	.calFreqPier2G = {
+ 		FREQ2FBIN(2412, 1),
+ 		FREQ2FBIN(2437, 1),
+ 		FREQ2FBIN(2472, 1),
+ 	},
+ 	/* ar9300_cal_data_per_freq_op_loop 2g */
+ 	.calPierData2G = {
+ 		{ {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0} },
+ 		{ {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0} },
+ 		{ {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0} },
+ 	},
+ 	.calTarget_freqbin_Cck = {
+ 		FREQ2FBIN(2412, 1),
+ 		FREQ2FBIN(2484, 1),
+ 	},
+ 	.calTarget_freqbin_2G = {
+ 		FREQ2FBIN(2412, 1),
+ 		FREQ2FBIN(2437, 1),
+ 		FREQ2FBIN(2472, 1)
+ 	},
+ 	.calTarget_freqbin_2GHT20 = {
+ 		FREQ2FBIN(2412, 1),
+ 		FREQ2FBIN(2437, 1),
+ 		FREQ2FBIN(2472, 1)
+ 	},
+ 	.calTarget_freqbin_2GHT40 = {
+ 		FREQ2FBIN(2412, 1),
+ 		FREQ2FBIN(2437, 1),
+ 		FREQ2FBIN(2472, 1)
+ 	},
+ 	.calTargetPowerCck = {
+ 		/* 1L-5L,5S,11L,11S */
+ 		{ {34, 34, 34, 34} },
+ 		{ {34, 34, 34, 34} },
+ 	},
+ 	.calTargetPower2G = {
+ 		/* 6-24,36,48,54 */
+ 		{ {34, 34, 32, 32} },
+ 		{ {34, 34, 32, 32} },
+ 		{ {34, 34, 32, 32} },
+ 	},
+ 	.calTargetPower2GHT20 = {
+ 		{ {32, 32, 32, 32, 32, 30, 32, 32, 30, 28, 28, 28, 28, 24} },
+ 		{ {32, 32, 32, 32, 32, 30, 32, 32, 30, 28, 28, 28, 28, 24} },
+ 		{ {32, 32, 32, 32, 32, 30, 32, 32, 30, 28, 28, 28, 28, 24} },
+ 	},
+ 	.calTargetPower2GHT40 = {
+ 		{ {30, 30, 30, 30, 30, 28, 30, 30, 28, 26, 26, 26, 26, 22} },
+ 		{ {30, 30, 30, 30, 30, 28, 30, 30, 28, 26, 26, 26, 26, 22} },
+ 		{ {30, 30, 30, 30, 30, 28, 30, 30, 28, 26, 26, 26, 26, 22} },
+ 	},
+ 	.ctlIndex_2G =  {
+ 		0x11, 0x12, 0x15, 0x17, 0x41, 0x42,
+ 		0x45, 0x47, 0x31, 0x32, 0x35, 0x37,
+ 	},
+ 	.ctl_freqbin_2G = {
+ 		{
+ 			FREQ2FBIN(2412, 1),
+ 			FREQ2FBIN(2417, 1),
+ 			FREQ2FBIN(2457, 1),
+ 			FREQ2FBIN(2462, 1)
+ 		},
+ 		{
+ 			FREQ2FBIN(2412, 1),
+ 			FREQ2FBIN(2417, 1),
+ 			FREQ2FBIN(2462, 1),
+ 			0xFF,
+ 		},
+ 
+ 		{
+ 			FREQ2FBIN(2412, 1),
+ 			FREQ2FBIN(2417, 1),
+ 			FREQ2FBIN(2462, 1),
+ 			0xFF,
+ 		},
+ 		{
+ 			FREQ2FBIN(2422, 1),
+ 			FREQ2FBIN(2427, 1),
+ 			FREQ2FBIN(2447, 1),
+ 			FREQ2FBIN(2452, 1)
+ 		},
+ 
+ 		{
+ 			/* Data[4].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
+ 			/* Data[4].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
+ 			/* Data[4].ctlEdges[2].bChannel */ FREQ2FBIN(2472, 1),
+ 			/* Data[4].ctlEdges[3].bChannel */ FREQ2FBIN(2484, 1),
+ 		},
+ 
+ 		{
+ 			/* Data[5].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
+ 			/* Data[5].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
+ 			/* Data[5].ctlEdges[2].bChannel */ FREQ2FBIN(2472, 1),
+ 			0,
+ 		},
+ 
+ 		{
+ 			/* Data[6].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
+ 			/* Data[6].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
+ 			FREQ2FBIN(2472, 1),
+ 			0,
+ 		},
+ 
+ 		{
+ 			/* Data[7].ctlEdges[0].bChannel */ FREQ2FBIN(2422, 1),
+ 			/* Data[7].ctlEdges[1].bChannel */ FREQ2FBIN(2427, 1),
+ 			/* Data[7].ctlEdges[2].bChannel */ FREQ2FBIN(2447, 1),
+ 			/* Data[7].ctlEdges[3].bChannel */ FREQ2FBIN(2462, 1),
+ 		},
+ 
+ 		{
+ 			/* Data[8].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
+ 			/* Data[8].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
+ 			/* Data[8].ctlEdges[2].bChannel */ FREQ2FBIN(2472, 1),
+ 		},
+ 
+ 		{
+ 			/* Data[9].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
+ 			/* Data[9].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
+ 			/* Data[9].ctlEdges[2].bChannel */ FREQ2FBIN(2472, 1),
+ 			0
+ 		},
+ 
+ 		{
+ 			/* Data[10].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
+ 			/* Data[10].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
+ 			/* Data[10].ctlEdges[2].bChannel */ FREQ2FBIN(2472, 1),
+ 			0
+ 		},
+ 
+ 		{
+ 			/* Data[11].ctlEdges[0].bChannel */ FREQ2FBIN(2422, 1),
+ 			/* Data[11].ctlEdges[1].bChannel */ FREQ2FBIN(2427, 1),
+ 			/* Data[11].ctlEdges[2].bChannel */ FREQ2FBIN(2447, 1),
+ 			/* Data[11].ctlEdges[3].bChannel */ FREQ2FBIN(2462, 1),
+ 		}
+ 	},
+ 	.ctlPowerData_2G = {
+ 		{ { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
+ 		{ { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
+ 		{ { {60, 1}, {60, 0}, {60, 0}, {60, 1} } },
+ 
+ 		{ { {60, 1}, {60, 0}, {0, 0}, {0, 0} } },
+ 		{ { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
+ 		{ { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
+ 
+ 		{ { {60, 0}, {60, 1}, {60, 1}, {60, 0} } },
+ 		{ { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
+ 		{ { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
+ 
+ 		{ { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
+ 		{ { {60, 0}, {60, 1}, {60, 1}, {60, 1} } },
+ 		{ { {60, 0}, {60, 1}, {60, 1}, {60, 1} } },
+ 	},
+ 	.modalHeader5G = {
+ 		/* 4 idle,t1,t2,b (4 bits per setting) */
+ 		.antCtrlCommon = LE32(0x220),
+ 		/* 4 ra1l1, ra2l1, ra1l2,ra2l2,ra12 */
+ 		.antCtrlCommon2 = LE32(0x44444),
+ 		/* antCtrlChain 6 idle, t,r,rx1,rx12,b (2 bits each) */
+ 		.antCtrlChain = {
+ 			LE16(0x150), LE16(0x150), LE16(0x150),
+ 		},
+ 		/* xatten1DB 3 xatten1_db for AR9280 (0xa20c/b20c 5:0) */
+ 		.xatten1DB = {0, 0, 0},
+ 
+ 		/*
+ 		 * xatten1Margin[AR9300_MAX_CHAINS]; 3 xatten1_margin
+ 		 * for merlin (0xa20c/b20c 16:12
+ 		 */
+ 		.xatten1Margin = {0, 0, 0},
+ 		.tempSlope = 45,
+ 		.voltSlope = 0,
+ 		/* spurChans spur channels in usual fbin coding format */
+ 		.spurChans = {0, 0, 0, 0, 0},
+ 		/* noiseFloorThreshCh Check if the register is per chain */
+ 		.noiseFloorThreshCh = {-1, 0, 0},
+ 		.ob = {3, 3, 3}, /* 3 chain */
+ 		.db_stage2 = {3, 3, 3}, /* 3 chain */
+ 		.db_stage3 = {3, 3, 3}, /* doesn't exist for 2G */
+ 		.db_stage4 = {3, 3, 3},	 /* don't exist for 2G */
+ 		.xpaBiasLvl = 0,
+ 		.txFrameToDataStart = 0x0e,
+ 		.txFrameToPaOn = 0x0e,
+ 		.txClip = 3, /* 4 bits tx_clip, 4 bits dac_scale_cck */
+ 		.antennaGain = 0,
+ 		.switchSettling = 0x2d,
+ 		.adcDesiredSize = -30,
+ 		.txEndToXpaOff = 0,
+ 		.txEndToRxOn = 0x2,
+ 		.txFrameToXpaOn = 0xe,
+ 		.thresh62 = 28,
+ 		.papdRateMaskHt20 = LE32(0x0cf0e0e0),
+ 		.papdRateMaskHt40 = LE32(0x6cf0e0e0),
+ 		.futureModal = {
+ 			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 		},
+ 	},
+ 	.base_ext2 = {
+ 		.tempSlopeLow = 40,
+ 		.tempSlopeHigh = 50,
+ 		.xatten1DBLow = {0, 0, 0},
+ 		.xatten1MarginLow = {0, 0, 0},
+ 		.xatten1DBHigh = {0, 0, 0},
+ 		.xatten1MarginHigh = {0, 0, 0}
+ 	},
+ 	.calFreqPier5G = {
+ 		FREQ2FBIN(5180, 0),
+ 		FREQ2FBIN(5220, 0),
+ 		FREQ2FBIN(5320, 0),
+ 		FREQ2FBIN(5400, 0),
+ 		FREQ2FBIN(5500, 0),
+ 		FREQ2FBIN(5600, 0),
+ 		FREQ2FBIN(5700, 0),
+ 		FREQ2FBIN(5825, 0)
+ 	},
+ 	.calPierData5G = {
+ 		{
+ 			{0, 0, 0, 0, 0},
+ 			{0, 0, 0, 0, 0},
+ 			{0, 0, 0, 0, 0},
+ 			{0, 0, 0, 0, 0},
+ 			{0, 0, 0, 0, 0},
+ 			{0, 0, 0, 0, 0},
+ 			{0, 0, 0, 0, 0},
+ 			{0, 0, 0, 0, 0},
+ 		},
+ 		{
+ 			{0, 0, 0, 0, 0},
+ 			{0, 0, 0, 0, 0},
+ 			{0, 0, 0, 0, 0},
+ 			{0, 0, 0, 0, 0},
+ 			{0, 0, 0, 0, 0},
+ 			{0, 0, 0, 0, 0},
+ 			{0, 0, 0, 0, 0},
+ 			{0, 0, 0, 0, 0},
+ 		},
+ 		{
+ 			{0, 0, 0, 0, 0},
+ 			{0, 0, 0, 0, 0},
+ 			{0, 0, 0, 0, 0},
+ 			{0, 0, 0, 0, 0},
+ 			{0, 0, 0, 0, 0},
+ 			{0, 0, 0, 0, 0},
+ 			{0, 0, 0, 0, 0},
+ 			{0, 0, 0, 0, 0},
+ 		},
+ 
+ 	},
+ 	.calTarget_freqbin_5G = {
+ 		FREQ2FBIN(5180, 0),
+ 		FREQ2FBIN(5240, 0),
+ 		FREQ2FBIN(5320, 0),
+ 		FREQ2FBIN(5400, 0),
+ 		FREQ2FBIN(5500, 0),
+ 		FREQ2FBIN(5600, 0),
+ 		FREQ2FBIN(5700, 0),
+ 		FREQ2FBIN(5825, 0)
+ 	},
+ 	.calTarget_freqbin_5GHT20 = {
+ 		FREQ2FBIN(5180, 0),
+ 		FREQ2FBIN(5240, 0),
+ 		FREQ2FBIN(5320, 0),
+ 		FREQ2FBIN(5400, 0),
+ 		FREQ2FBIN(5500, 0),
+ 		FREQ2FBIN(5700, 0),
+ 		FREQ2FBIN(5745, 0),
+ 		FREQ2FBIN(5825, 0)
+ 	},
+ 	.calTarget_freqbin_5GHT40 = {
+ 		FREQ2FBIN(5180, 0),
+ 		FREQ2FBIN(5240, 0),
+ 		FREQ2FBIN(5320, 0),
+ 		FREQ2FBIN(5400, 0),
+ 		FREQ2FBIN(5500, 0),
+ 		FREQ2FBIN(5700, 0),
+ 		FREQ2FBIN(5745, 0),
+ 		FREQ2FBIN(5825, 0)
+ 	},
+ 	.calTargetPower5G = {
+ 		/* 6-24,36,48,54 */
+ 		{ {30, 30, 28, 24} },
+ 		{ {30, 30, 28, 24} },
+ 		{ {30, 30, 28, 24} },
+ 		{ {30, 30, 28, 24} },
+ 		{ {30, 30, 28, 24} },
+ 		{ {30, 30, 28, 24} },
+ 		{ {30, 30, 28, 24} },
+ 		{ {30, 30, 28, 24} },
+ 	},
+ 	.calTargetPower5GHT20 = {
+ 		/*
+ 		 * 0_8_16,1-3_9-11_17-19,
+ 		 * 4,5,6,7,12,13,14,15,20,21,22,23
+ 		 */
+ 		{ {30, 30, 30, 28, 24, 20, 30, 28, 24, 20, 20, 20, 20, 16} },
+ 		{ {30, 30, 30, 28, 24, 20, 30, 28, 24, 20, 20, 20, 20, 16} },
+ 		{ {30, 30, 30, 26, 22, 18, 30, 26, 22, 18, 18, 18, 18, 16} },
+ 		{ {30, 30, 30, 26, 22, 18, 30, 26, 22, 18, 18, 18, 18, 16} },
+ 		{ {30, 30, 30, 24, 20, 16, 30, 24, 20, 16, 16, 16, 16, 14} },
+ 		{ {30, 30, 30, 24, 20, 16, 30, 24, 20, 16, 16, 16, 16, 14} },
+ 		{ {30, 30, 30, 22, 18, 14, 30, 22, 18, 14, 14, 14, 14, 12} },
+ 		{ {30, 30, 30, 22, 18, 14, 30, 22, 18, 14, 14, 14, 14, 12} },
+ 	},
+ 	.calTargetPower5GHT40 =  {
+ 		/*
+ 		 * 0_8_16,1-3_9-11_17-19,
+ 		 * 4,5,6,7,12,13,14,15,20,21,22,23
+ 		 */
+ 		{ {28, 28, 28, 26, 22, 18, 28, 26, 22, 18, 18, 18, 18, 14} },
+ 		{ {28, 28, 28, 26, 22, 18, 28, 26, 22, 18, 18, 18, 18, 14} },
+ 		{ {28, 28, 28, 24, 20, 16, 28, 24, 20, 16, 16, 16, 16, 12} },
+ 		{ {28, 28, 28, 24, 20, 16, 28, 24, 20, 16, 16, 16, 16, 12} },
+ 		{ {28, 28, 28, 22, 18, 14, 28, 22, 18, 14, 14, 14, 14, 10} },
+ 		{ {28, 28, 28, 22, 18, 14, 28, 22, 18, 14, 14, 14, 14, 10} },
+ 		{ {28, 28, 28, 20, 16, 12, 28, 20, 16, 12, 12, 12, 12, 8} },
+ 		{ {28, 28, 28, 20, 16, 12, 28, 20, 16, 12, 12, 12, 12, 8} },
+ 	},
+ 	.ctlIndex_5G =  {
+ 		0x10, 0x16, 0x18, 0x40, 0x46,
+ 		0x48, 0x30, 0x36, 0x38
+ 	},
+ 	.ctl_freqbin_5G =  {
+ 		{
+ 			/* Data[0].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
+ 			/* Data[0].ctlEdges[1].bChannel */ FREQ2FBIN(5260, 0),
+ 			/* Data[0].ctlEdges[2].bChannel */ FREQ2FBIN(5280, 0),
+ 			/* Data[0].ctlEdges[3].bChannel */ FREQ2FBIN(5500, 0),
+ 			/* Data[0].ctlEdges[4].bChannel */ FREQ2FBIN(5600, 0),
+ 			/* Data[0].ctlEdges[5].bChannel */ FREQ2FBIN(5700, 0),
+ 			/* Data[0].ctlEdges[6].bChannel */ FREQ2FBIN(5745, 0),
+ 			/* Data[0].ctlEdges[7].bChannel */ FREQ2FBIN(5825, 0)
+ 		},
+ 		{
+ 			/* Data[1].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
+ 			/* Data[1].ctlEdges[1].bChannel */ FREQ2FBIN(5260, 0),
+ 			/* Data[1].ctlEdges[2].bChannel */ FREQ2FBIN(5280, 0),
+ 			/* Data[1].ctlEdges[3].bChannel */ FREQ2FBIN(5500, 0),
+ 			/* Data[1].ctlEdges[4].bChannel */ FREQ2FBIN(5520, 0),
+ 			/* Data[1].ctlEdges[5].bChannel */ FREQ2FBIN(5700, 0),
+ 			/* Data[1].ctlEdges[6].bChannel */ FREQ2FBIN(5745, 0),
+ 			/* Data[1].ctlEdges[7].bChannel */ FREQ2FBIN(5825, 0)
+ 		},
+ 
+ 		{
+ 			/* Data[2].ctlEdges[0].bChannel */ FREQ2FBIN(5190, 0),
+ 			/* Data[2].ctlEdges[1].bChannel */ FREQ2FBIN(5230, 0),
+ 			/* Data[2].ctlEdges[2].bChannel */ FREQ2FBIN(5270, 0),
+ 			/* Data[2].ctlEdges[3].bChannel */ FREQ2FBIN(5310, 0),
+ 			/* Data[2].ctlEdges[4].bChannel */ FREQ2FBIN(5510, 0),
+ 			/* Data[2].ctlEdges[5].bChannel */ FREQ2FBIN(5550, 0),
+ 			/* Data[2].ctlEdges[6].bChannel */ FREQ2FBIN(5670, 0),
+ 			/* Data[2].ctlEdges[7].bChannel */ FREQ2FBIN(5755, 0)
+ 		},
+ 
+ 		{
+ 			/* Data[3].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
+ 			/* Data[3].ctlEdges[1].bChannel */ FREQ2FBIN(5200, 0),
+ 			/* Data[3].ctlEdges[2].bChannel */ FREQ2FBIN(5260, 0),
+ 			/* Data[3].ctlEdges[3].bChannel */ FREQ2FBIN(5320, 0),
+ 			/* Data[3].ctlEdges[4].bChannel */ FREQ2FBIN(5500, 0),
+ 			/* Data[3].ctlEdges[5].bChannel */ FREQ2FBIN(5700, 0),
+ 			/* Data[3].ctlEdges[6].bChannel */ 0xFF,
+ 			/* Data[3].ctlEdges[7].bChannel */ 0xFF,
+ 		},
+ 
+ 		{
+ 			/* Data[4].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
+ 			/* Data[4].ctlEdges[1].bChannel */ FREQ2FBIN(5260, 0),
+ 			/* Data[4].ctlEdges[2].bChannel */ FREQ2FBIN(5500, 0),
+ 			/* Data[4].ctlEdges[3].bChannel */ FREQ2FBIN(5700, 0),
+ 			/* Data[4].ctlEdges[4].bChannel */ 0xFF,
+ 			/* Data[4].ctlEdges[5].bChannel */ 0xFF,
+ 			/* Data[4].ctlEdges[6].bChannel */ 0xFF,
+ 			/* Data[4].ctlEdges[7].bChannel */ 0xFF,
+ 		},
+ 
+ 		{
+ 			/* Data[5].ctlEdges[0].bChannel */ FREQ2FBIN(5190, 0),
+ 			/* Data[5].ctlEdges[1].bChannel */ FREQ2FBIN(5270, 0),
+ 			/* Data[5].ctlEdges[2].bChannel */ FREQ2FBIN(5310, 0),
+ 			/* Data[5].ctlEdges[3].bChannel */ FREQ2FBIN(5510, 0),
+ 			/* Data[5].ctlEdges[4].bChannel */ FREQ2FBIN(5590, 0),
+ 			/* Data[5].ctlEdges[5].bChannel */ FREQ2FBIN(5670, 0),
+ 			/* Data[5].ctlEdges[6].bChannel */ 0xFF,
+ 			/* Data[5].ctlEdges[7].bChannel */ 0xFF
+ 		},
+ 
+ 		{
+ 			/* Data[6].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
+ 			/* Data[6].ctlEdges[1].bChannel */ FREQ2FBIN(5200, 0),
+ 			/* Data[6].ctlEdges[2].bChannel */ FREQ2FBIN(5220, 0),
+ 			/* Data[6].ctlEdges[3].bChannel */ FREQ2FBIN(5260, 0),
+ 			/* Data[6].ctlEdges[4].bChannel */ FREQ2FBIN(5500, 0),
+ 			/* Data[6].ctlEdges[5].bChannel */ FREQ2FBIN(5600, 0),
+ 			/* Data[6].ctlEdges[6].bChannel */ FREQ2FBIN(5700, 0),
+ 			/* Data[6].ctlEdges[7].bChannel */ FREQ2FBIN(5745, 0)
+ 		},
+ 
+ 		{
+ 			/* Data[7].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
+ 			/* Data[7].ctlEdges[1].bChannel */ FREQ2FBIN(5260, 0),
+ 			/* Data[7].ctlEdges[2].bChannel */ FREQ2FBIN(5320, 0),
+ 			/* Data[7].ctlEdges[3].bChannel */ FREQ2FBIN(5500, 0),
+ 			/* Data[7].ctlEdges[4].bChannel */ FREQ2FBIN(5560, 0),
+ 			/* Data[7].ctlEdges[5].bChannel */ FREQ2FBIN(5700, 0),
+ 			/* Data[7].ctlEdges[6].bChannel */ FREQ2FBIN(5745, 0),
+ 			/* Data[7].ctlEdges[7].bChannel */ FREQ2FBIN(5825, 0)
+ 		},
+ 
+ 		{
+ 			/* Data[8].ctlEdges[0].bChannel */ FREQ2FBIN(5190, 0),
+ 			/* Data[8].ctlEdges[1].bChannel */ FREQ2FBIN(5230, 0),
+ 			/* Data[8].ctlEdges[2].bChannel */ FREQ2FBIN(5270, 0),
+ 			/* Data[8].ctlEdges[3].bChannel */ FREQ2FBIN(5510, 0),
+ 			/* Data[8].ctlEdges[4].bChannel */ FREQ2FBIN(5550, 0),
+ 			/* Data[8].ctlEdges[5].bChannel */ FREQ2FBIN(5670, 0),
+ 			/* Data[8].ctlEdges[6].bChannel */ FREQ2FBIN(5755, 0),
+ 			/* Data[8].ctlEdges[7].bChannel */ FREQ2FBIN(5795, 0)
+ 		}
+ 	},
+ 	.ctlPowerData_5G = {
+ 		{
+ 			{
+ 				{60, 1}, {60, 1}, {60, 1}, {60, 1},
+ 				{60, 1}, {60, 1}, {60, 1}, {60, 0},
+ 			}
+ 		},
+ 		{
+ 			{
+ 				{60, 1}, {60, 1}, {60, 1}, {60, 1},
+ 				{60, 1}, {60, 1}, {60, 1}, {60, 0},
+ 			}
+ 		},
+ 		{
+ 			{
+ 				{60, 0}, {60, 1}, {60, 0}, {60, 1},
+ 				{60, 1}, {60, 1}, {60, 1}, {60, 1},
+ 			}
+ 		},
+ 		{
+ 			{
+ 				{60, 0}, {60, 1}, {60, 1}, {60, 0},
+ 				{60, 1}, {60, 0}, {60, 0}, {60, 0},
+ 			}
+ 		},
+ 		{
+ 			{
+ 				{60, 1}, {60, 1}, {60, 1}, {60, 0},
+ 				{60, 0}, {60, 0}, {60, 0}, {60, 0},
+ 			}
+ 		},
+ 		{
+ 			{
+ 				{60, 1}, {60, 1}, {60, 1}, {60, 1},
+ 				{60, 1}, {60, 0}, {60, 0}, {60, 0},
+ 			}
+ 		},
+ 		{
+ 			{
+ 				{60, 1}, {60, 1}, {60, 1}, {60, 1},
+ 				{60, 1}, {60, 1}, {60, 1}, {60, 1},
+ 			}
+ 		},
+ 		{
+ 			{
+ 				{60, 1}, {60, 1}, {60, 0}, {60, 1},
+ 				{60, 1}, {60, 1}, {60, 1}, {60, 0},
+ 			}
+ 		},
+ 		{
+ 			{
+ 				{60, 1}, {60, 0}, {60, 1}, {60, 1},
+ 				{60, 1}, {60, 1}, {60, 0}, {60, 1},
+ 			}
+ 		},
+ 	}
+ };
+ 
+ 
+ static const struct ar9300_eeprom ar9300_x112 = {
+ 	.eepromVersion = 2,
+ 	.templateVersion = 5,
+ 	.macAddr = {0x00, 0x03, 0x7f, 0x0, 0x0, 0x0},
+ 	.custData = {"x112-041-f0000"},
+ 	.baseEepHeader = {
+ 		.regDmn = { LE16(0), LE16(0x1f) },
+ 		.txrxMask =  0x77, /* 4 bits tx and 4 bits rx */
+ 		.opCapFlags = {
+ 			.opFlags = AR9300_OPFLAGS_11G | AR9300_OPFLAGS_11A,
+ 			.eepMisc = 0,
+ 		},
+ 		.rfSilent = 0,
+ 		.blueToothOptions = 0,
+ 		.deviceCap = 0,
+ 		.deviceType = 5, /* takes lower byte in eeprom location */
+ 		.pwrTableOffset = AR9300_PWR_TABLE_OFFSET,
+ 		.params_for_tuning_caps = {0, 0},
+ 		.featureEnable = 0x0d,
+ 		/*
+ 		 * bit0 - enable tx temp comp - disabled
+ 		 * bit1 - enable tx volt comp - disabled
+ 		 * bit2 - enable fastclock - enabled
+ 		 * bit3 - enable doubling - enabled
+ 		 * bit4 - enable internal regulator - disabled
+ 		 * bit5 - enable pa predistortion - disabled
+ 		 */
+ 		.miscConfiguration = 0, /* bit0 - turn down drivestrength */
+ 		.eepromWriteEnableGpio = 6,
+ 		.wlanDisableGpio = 0,
+ 		.wlanLedGpio = 8,
+ 		.rxBandSelectGpio = 0xff,
+ 		.txrxgain = 0x0,
+ 		.swreg = 0,
+ 	},
+ 	.modalHeader2G = {
+ 		/* ar9300_modal_eep_header  2g */
+ 		/* 4 idle,t1,t2,b(4 bits per setting) */
+ 		.antCtrlCommon = LE32(0x110),
+ 		/* 4 ra1l1, ra2l1, ra1l2, ra2l2, ra12 */
+ 		.antCtrlCommon2 = LE32(0x22222),
+ 
+ 		/*
+ 		 * antCtrlChain[ar9300_max_chains]; 6 idle, t, r,
+ 		 * rx1, rx12, b (2 bits each)
+ 		 */
+ 		.antCtrlChain = { LE16(0x10), LE16(0x10), LE16(0x10) },
+ 
+ 		/*
+ 		 * xatten1DB[AR9300_max_chains];  3 xatten1_db
+ 		 * for ar9280 (0xa20c/b20c 5:0)
+ 		 */
+ 		.xatten1DB = {0x1b, 0x1b, 0x1b},
+ 
+ 		/*
+ 		 * xatten1Margin[ar9300_max_chains]; 3 xatten1_margin
+ 		 * for ar9280 (0xa20c/b20c 16:12
+ 		 */
+ 		.xatten1Margin = {0x15, 0x15, 0x15},
+ 		.tempSlope = 50,
+ 		.voltSlope = 0,
+ 
+ 		/*
+ 		 * spurChans[OSPrey_eeprom_modal_sPURS]; spur
+ 		 * channels in usual fbin coding format
+ 		 */
+ 		.spurChans = {FREQ2FBIN(2464, 1), 0, 0, 0, 0},
+ 
+ 		/*
+ 		 * noiseFloorThreshch[ar9300_max_cHAINS]; 3 Check
+ 		 * if the register is per chain
+ 		 */
+ 		.noiseFloorThreshCh = {-1, 0, 0},
+ 		.ob = {1, 1, 1},/* 3 chain */
+ 		.db_stage2 = {1, 1, 1}, /* 3 chain  */
+ 		.db_stage3 = {0, 0, 0},
+ 		.db_stage4 = {0, 0, 0},
+ 		.xpaBiasLvl = 0,
+ 		.txFrameToDataStart = 0x0e,
+ 		.txFrameToPaOn = 0x0e,
+ 		.txClip = 3, /* 4 bits tx_clip, 4 bits dac_scale_cck */
+ 		.antennaGain = 0,
+ 		.switchSettling = 0x2c,
+ 		.adcDesiredSize = -30,
+ 		.txEndToXpaOff = 0,
+ 		.txEndToRxOn = 0x2,
+ 		.txFrameToXpaOn = 0xe,
+ 		.thresh62 = 28,
+ 		.papdRateMaskHt20 = LE32(0x0c80c080),
+ 		.papdRateMaskHt40 = LE32(0x0080c080),
+ 		.futureModal = {
+ 			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 		},
+ 	},
+ 	.base_ext1 = {
+ 		.ant_div_control = 0,
+ 		.future = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
+ 	},
+ 	.calFreqPier2G = {
+ 		FREQ2FBIN(2412, 1),
+ 		FREQ2FBIN(2437, 1),
+ 		FREQ2FBIN(2472, 1),
+ 	},
+ 	/* ar9300_cal_data_per_freq_op_loop 2g */
+ 	.calPierData2G = {
+ 		{ {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0} },
+ 		{ {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0} },
+ 		{ {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0} },
+ 	},
+ 	.calTarget_freqbin_Cck = {
+ 		FREQ2FBIN(2412, 1),
+ 		FREQ2FBIN(2472, 1),
+ 	},
+ 	.calTarget_freqbin_2G = {
+ 		FREQ2FBIN(2412, 1),
+ 		FREQ2FBIN(2437, 1),
+ 		FREQ2FBIN(2472, 1)
+ 	},
+ 	.calTarget_freqbin_2GHT20 = {
+ 		FREQ2FBIN(2412, 1),
+ 		FREQ2FBIN(2437, 1),
+ 		FREQ2FBIN(2472, 1)
+ 	},
+ 	.calTarget_freqbin_2GHT40 = {
+ 		FREQ2FBIN(2412, 1),
+ 		FREQ2FBIN(2437, 1),
+ 		FREQ2FBIN(2472, 1)
+ 	},
+ 	.calTargetPowerCck = {
+ 		/* 1L-5L,5S,11L,11s */
+ 		{ {38, 38, 38, 38} },
+ 		{ {38, 38, 38, 38} },
+ 	},
+ 	.calTargetPower2G = {
+ 		/* 6-24,36,48,54 */
+ 		{ {38, 38, 36, 34} },
+ 		{ {38, 38, 36, 34} },
+ 		{ {38, 38, 34, 32} },
+ 	},
+ 	.calTargetPower2GHT20 = {
+ 		{ {36, 36, 36, 36, 36, 34, 34, 32, 30, 28, 28, 28, 28, 26} },
+ 		{ {36, 36, 36, 36, 36, 34, 36, 34, 32, 30, 30, 30, 28, 26} },
+ 		{ {36, 36, 36, 36, 36, 34, 34, 32, 30, 28, 28, 28, 28, 26} },
+ 	},
+ 	.calTargetPower2GHT40 = {
+ 		{ {36, 36, 36, 36, 34, 32, 32, 30, 28, 26, 26, 26, 26, 24} },
+ 		{ {36, 36, 36, 36, 34, 32, 34, 32, 30, 28, 28, 28, 28, 24} },
+ 		{ {36, 36, 36, 36, 34, 32, 32, 30, 28, 26, 26, 26, 26, 24} },
+ 	},
+ 	.ctlIndex_2G =  {
+ 		0x11, 0x12, 0x15, 0x17, 0x41, 0x42,
+ 		0x45, 0x47, 0x31, 0x32, 0x35, 0x37,
+ 	},
+ 	.ctl_freqbin_2G = {
+ 		{
+ 			FREQ2FBIN(2412, 1),
+ 			FREQ2FBIN(2417, 1),
+ 			FREQ2FBIN(2457, 1),
+ 			FREQ2FBIN(2462, 1)
+ 		},
+ 		{
+ 			FREQ2FBIN(2412, 1),
+ 			FREQ2FBIN(2417, 1),
+ 			FREQ2FBIN(2462, 1),
+ 			0xFF,
+ 		},
+ 
+ 		{
+ 			FREQ2FBIN(2412, 1),
+ 			FREQ2FBIN(2417, 1),
+ 			FREQ2FBIN(2462, 1),
+ 			0xFF,
+ 		},
+ 		{
+ 			FREQ2FBIN(2422, 1),
+ 			FREQ2FBIN(2427, 1),
+ 			FREQ2FBIN(2447, 1),
+ 			FREQ2FBIN(2452, 1)
+ 		},
+ 
+ 		{
+ 			/* Data[4].ctledges[0].bchannel */ FREQ2FBIN(2412, 1),
+ 			/* Data[4].ctledges[1].bchannel */ FREQ2FBIN(2417, 1),
+ 			/* Data[4].ctledges[2].bchannel */ FREQ2FBIN(2472, 1),
+ 			/* Data[4].ctledges[3].bchannel */ FREQ2FBIN(2484, 1),
+ 		},
+ 
+ 		{
+ 			/* Data[5].ctledges[0].bchannel */ FREQ2FBIN(2412, 1),
+ 			/* Data[5].ctledges[1].bchannel */ FREQ2FBIN(2417, 1),
+ 			/* Data[5].ctledges[2].bchannel */ FREQ2FBIN(2472, 1),
+ 			0,
+ 		},
+ 
+ 		{
+ 			/* Data[6].ctledges[0].bchannel */ FREQ2FBIN(2412, 1),
+ 			/* Data[6].ctledges[1].bchannel */ FREQ2FBIN(2417, 1),
+ 			FREQ2FBIN(2472, 1),
+ 			0,
+ 		},
+ 
+ 		{
+ 			/* Data[7].ctledges[0].bchannel */ FREQ2FBIN(2422, 1),
+ 			/* Data[7].ctledges[1].bchannel */ FREQ2FBIN(2427, 1),
+ 			/* Data[7].ctledges[2].bchannel */ FREQ2FBIN(2447, 1),
+ 			/* Data[7].ctledges[3].bchannel */ FREQ2FBIN(2462, 1),
+ 		},
+ 
+ 		{
+ 			/* Data[8].ctledges[0].bchannel */ FREQ2FBIN(2412, 1),
+ 			/* Data[8].ctledges[1].bchannel */ FREQ2FBIN(2417, 1),
+ 			/* Data[8].ctledges[2].bchannel */ FREQ2FBIN(2472, 1),
+ 		},
+ 
+ 		{
+ 			/* Data[9].ctledges[0].bchannel */ FREQ2FBIN(2412, 1),
+ 			/* Data[9].ctledges[1].bchannel */ FREQ2FBIN(2417, 1),
+ 			/* Data[9].ctledges[2].bchannel */ FREQ2FBIN(2472, 1),
+ 			0
+ 		},
+ 
+ 		{
+ 			/* Data[10].ctledges[0].bchannel */ FREQ2FBIN(2412, 1),
+ 			/* Data[10].ctledges[1].bchannel */ FREQ2FBIN(2417, 1),
+ 			/* Data[10].ctledges[2].bchannel */ FREQ2FBIN(2472, 1),
+ 			0
+ 		},
+ 
+ 		{
+ 			/* Data[11].ctledges[0].bchannel */ FREQ2FBIN(2422, 1),
+ 			/* Data[11].ctledges[1].bchannel */ FREQ2FBIN(2427, 1),
+ 			/* Data[11].ctledges[2].bchannel */ FREQ2FBIN(2447, 1),
+ 			/* Data[11].ctledges[3].bchannel */ FREQ2FBIN(2462, 1),
+ 		}
+ 	},
+ 	.ctlPowerData_2G = {
+ 		{ { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
+ 		{ { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
+ 		{ { {60, 1}, {60, 0}, {60, 0}, {60, 1} } },
+ 
+ 		{ { {60, 1}, {60, 0}, {0, 0}, {0, 0} } },
+ 		{ { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
+ 		{ { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
+ 
+ 		{ { {60, 0}, {60, 1}, {60, 1}, {60, 0} } },
+ 		{ { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
+ 		{ { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
+ 
+ 		{ { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
+ 		{ { {60, 0}, {60, 1}, {60, 1}, {60, 1} } },
+ 		{ { {60, 0}, {60, 1}, {60, 1}, {60, 1} } },
+ 	},
+ 	.modalHeader5G = {
+ 		/* 4 idle,t1,t2,b (4 bits per setting) */
+ 		.antCtrlCommon = LE32(0x110),
+ 		/* 4 ra1l1, ra2l1, ra1l2,ra2l2,ra12 */
+ 		.antCtrlCommon2 = LE32(0x22222),
+ 		/* antCtrlChain 6 idle, t,r,rx1,rx12,b (2 bits each) */
+ 		.antCtrlChain = {
+ 			LE16(0x0), LE16(0x0), LE16(0x0),
+ 		},
+ 		/* xatten1DB 3 xatten1_db for ar9280 (0xa20c/b20c 5:0) */
+ 		.xatten1DB = {0x13, 0x19, 0x17},
+ 
+ 		/*
+ 		 * xatten1Margin[ar9300_max_chains]; 3 xatten1_margin
+ 		 * for merlin (0xa20c/b20c 16:12
+ 		 */
+ 		.xatten1Margin = {0x19, 0x19, 0x19},
+ 		.tempSlope = 70,
+ 		.voltSlope = 15,
+ 		/* spurChans spur channels in usual fbin coding format */
+ 		.spurChans = {0, 0, 0, 0, 0},
+ 		/* noiseFloorThreshch check if the register is per chain */
+ 		.noiseFloorThreshCh = {-1, 0, 0},
+ 		.ob = {3, 3, 3}, /* 3 chain */
+ 		.db_stage2 = {3, 3, 3}, /* 3 chain */
+ 		.db_stage3 = {3, 3, 3}, /* doesn't exist for 2G */
+ 		.db_stage4 = {3, 3, 3},	 /* don't exist for 2G */
+ 		.xpaBiasLvl = 0,
+ 		.txFrameToDataStart = 0x0e,
+ 		.txFrameToPaOn = 0x0e,
+ 		.txClip = 3, /* 4 bits tx_clip, 4 bits dac_scale_cck */
+ 		.antennaGain = 0,
+ 		.switchSettling = 0x2d,
+ 		.adcDesiredSize = -30,
+ 		.txEndToXpaOff = 0,
+ 		.txEndToRxOn = 0x2,
+ 		.txFrameToXpaOn = 0xe,
+ 		.thresh62 = 28,
+ 		.papdRateMaskHt20 = LE32(0x0cf0e0e0),
+ 		.papdRateMaskHt40 = LE32(0x6cf0e0e0),
+ 		.futureModal = {
+ 			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 		},
+ 	},
+ 	.base_ext2 = {
+ 		.tempSlopeLow = 72,
+ 		.tempSlopeHigh = 105,
+ 		.xatten1DBLow = {0x10, 0x14, 0x10},
+ 		.xatten1MarginLow = {0x19, 0x19 , 0x19},
+ 		.xatten1DBHigh = {0x1d, 0x20, 0x24},
+ 		.xatten1MarginHigh = {0x10, 0x10, 0x10}
+ 	},
+ 	.calFreqPier5G = {
+ 		FREQ2FBIN(5180, 0),
+ 		FREQ2FBIN(5220, 0),
+ 		FREQ2FBIN(5320, 0),
+ 		FREQ2FBIN(5400, 0),
+ 		FREQ2FBIN(5500, 0),
+ 		FREQ2FBIN(5600, 0),
+ 		FREQ2FBIN(5700, 0),
+ 		FREQ2FBIN(5785, 0)
+ 	},
+ 	.calPierData5G = {
+ 		{
+ 			{0, 0, 0, 0, 0},
+ 			{0, 0, 0, 0, 0},
+ 			{0, 0, 0, 0, 0},
+ 			{0, 0, 0, 0, 0},
+ 			{0, 0, 0, 0, 0},
+ 			{0, 0, 0, 0, 0},
+ 			{0, 0, 0, 0, 0},
+ 			{0, 0, 0, 0, 0},
+ 		},
+ 		{
+ 			{0, 0, 0, 0, 0},
+ 			{0, 0, 0, 0, 0},
+ 			{0, 0, 0, 0, 0},
+ 			{0, 0, 0, 0, 0},
+ 			{0, 0, 0, 0, 0},
+ 			{0, 0, 0, 0, 0},
+ 			{0, 0, 0, 0, 0},
+ 			{0, 0, 0, 0, 0},
+ 		},
+ 		{
+ 			{0, 0, 0, 0, 0},
+ 			{0, 0, 0, 0, 0},
+ 			{0, 0, 0, 0, 0},
+ 			{0, 0, 0, 0, 0},
+ 			{0, 0, 0, 0, 0},
+ 			{0, 0, 0, 0, 0},
+ 			{0, 0, 0, 0, 0},
+ 			{0, 0, 0, 0, 0},
+ 		},
+ 
+ 	},
+ 	.calTarget_freqbin_5G = {
+ 		FREQ2FBIN(5180, 0),
+ 		FREQ2FBIN(5220, 0),
+ 		FREQ2FBIN(5320, 0),
+ 		FREQ2FBIN(5400, 0),
+ 		FREQ2FBIN(5500, 0),
+ 		FREQ2FBIN(5600, 0),
+ 		FREQ2FBIN(5725, 0),
+ 		FREQ2FBIN(5825, 0)
+ 	},
+ 	.calTarget_freqbin_5GHT20 = {
+ 		FREQ2FBIN(5180, 0),
+ 		FREQ2FBIN(5220, 0),
+ 		FREQ2FBIN(5320, 0),
+ 		FREQ2FBIN(5400, 0),
+ 		FREQ2FBIN(5500, 0),
+ 		FREQ2FBIN(5600, 0),
+ 		FREQ2FBIN(5725, 0),
+ 		FREQ2FBIN(5825, 0)
+ 	},
+ 	.calTarget_freqbin_5GHT40 = {
+ 		FREQ2FBIN(5180, 0),
+ 		FREQ2FBIN(5220, 0),
+ 		FREQ2FBIN(5320, 0),
+ 		FREQ2FBIN(5400, 0),
+ 		FREQ2FBIN(5500, 0),
+ 		FREQ2FBIN(5600, 0),
+ 		FREQ2FBIN(5725, 0),
+ 		FREQ2FBIN(5825, 0)
+ 	},
+ 	.calTargetPower5G = {
+ 		/* 6-24,36,48,54 */
+ 		{ {32, 32, 28, 26} },
+ 		{ {32, 32, 28, 26} },
+ 		{ {32, 32, 28, 26} },
+ 		{ {32, 32, 26, 24} },
+ 		{ {32, 32, 26, 24} },
+ 		{ {32, 32, 24, 22} },
+ 		{ {30, 30, 24, 22} },
+ 		{ {30, 30, 24, 22} },
+ 	},
+ 	.calTargetPower5GHT20 = {
+ 		/*
+ 		 * 0_8_16,1-3_9-11_17-19,
+ 		 * 4,5,6,7,12,13,14,15,20,21,22,23
+ 		 */
+ 		{ {32, 32, 32, 32, 28, 26, 32, 28, 26, 24, 24, 24, 22, 22} },
+ 		{ {32, 32, 32, 32, 28, 26, 32, 28, 26, 24, 24, 24, 22, 22} },
+ 		{ {32, 32, 32, 32, 28, 26, 32, 28, 26, 24, 24, 24, 22, 22} },
+ 		{ {32, 32, 32, 32, 28, 26, 32, 26, 24, 22, 22, 22, 20, 20} },
+ 		{ {32, 32, 32, 32, 28, 26, 32, 26, 24, 22, 20, 18, 16, 16} },
+ 		{ {32, 32, 32, 32, 28, 26, 32, 24, 20, 16, 18, 16, 14, 14} },
+ 		{ {30, 30, 30, 30, 28, 26, 30, 24, 20, 16, 18, 16, 14, 14} },
+ 		{ {30, 30, 30, 30, 28, 26, 30, 24, 20, 16, 18, 16, 14, 14} },
+ 	},
+ 	.calTargetPower5GHT40 =  {
+ 		/*
+ 		 * 0_8_16,1-3_9-11_17-19,
+ 		 * 4,5,6,7,12,13,14,15,20,21,22,23
+ 		 */
+ 		{ {32, 32, 32, 30, 28, 26, 30, 28, 26, 24, 24, 24, 22, 22} },
+ 		{ {32, 32, 32, 30, 28, 26, 30, 28, 26, 24, 24, 24, 22, 22} },
+ 		{ {32, 32, 32, 30, 28, 26, 30, 28, 26, 24, 24, 24, 22, 22} },
+ 		{ {32, 32, 32, 30, 28, 26, 30, 26, 24, 22, 22, 22, 20, 20} },
+ 		{ {32, 32, 32, 30, 28, 26, 30, 26, 24, 22, 20, 18, 16, 16} },
+ 		{ {32, 32, 32, 30, 28, 26, 30, 22, 20, 16, 18, 16, 14, 14} },
+ 		{ {30, 30, 30, 30, 28, 26, 30, 22, 20, 16, 18, 16, 14, 14} },
+ 		{ {30, 30, 30, 30, 28, 26, 30, 22, 20, 16, 18, 16, 14, 14} },
+ 	},
+ 	.ctlIndex_5G =  {
+ 		0x10, 0x16, 0x18, 0x40, 0x46,
+ 		0x48, 0x30, 0x36, 0x38
+ 	},
+ 	.ctl_freqbin_5G =  {
+ 		{
+ 			/* Data[0].ctledges[0].bchannel */ FREQ2FBIN(5180, 0),
+ 			/* Data[0].ctledges[1].bchannel */ FREQ2FBIN(5260, 0),
+ 			/* Data[0].ctledges[2].bchannel */ FREQ2FBIN(5280, 0),
+ 			/* Data[0].ctledges[3].bchannel */ FREQ2FBIN(5500, 0),
+ 			/* Data[0].ctledges[4].bchannel */ FREQ2FBIN(5600, 0),
+ 			/* Data[0].ctledges[5].bchannel */ FREQ2FBIN(5700, 0),
+ 			/* Data[0].ctledges[6].bchannel */ FREQ2FBIN(5745, 0),
+ 			/* Data[0].ctledges[7].bchannel */ FREQ2FBIN(5825, 0)
+ 		},
+ 		{
+ 			/* Data[1].ctledges[0].bchannel */ FREQ2FBIN(5180, 0),
+ 			/* Data[1].ctledges[1].bchannel */ FREQ2FBIN(5260, 0),
+ 			/* Data[1].ctledges[2].bchannel */ FREQ2FBIN(5280, 0),
+ 			/* Data[1].ctledges[3].bchannel */ FREQ2FBIN(5500, 0),
+ 			/* Data[1].ctledges[4].bchannel */ FREQ2FBIN(5520, 0),
+ 			/* Data[1].ctledges[5].bchannel */ FREQ2FBIN(5700, 0),
+ 			/* Data[1].ctledges[6].bchannel */ FREQ2FBIN(5745, 0),
+ 			/* Data[1].ctledges[7].bchannel */ FREQ2FBIN(5825, 0)
+ 		},
+ 
+ 		{
+ 			/* Data[2].ctledges[0].bchannel */ FREQ2FBIN(5190, 0),
+ 			/* Data[2].ctledges[1].bchannel */ FREQ2FBIN(5230, 0),
+ 			/* Data[2].ctledges[2].bchannel */ FREQ2FBIN(5270, 0),
+ 			/* Data[2].ctledges[3].bchannel */ FREQ2FBIN(5310, 0),
+ 			/* Data[2].ctledges[4].bchannel */ FREQ2FBIN(5510, 0),
+ 			/* Data[2].ctledges[5].bchannel */ FREQ2FBIN(5550, 0),
+ 			/* Data[2].ctledges[6].bchannel */ FREQ2FBIN(5670, 0),
+ 			/* Data[2].ctledges[7].bchannel */ FREQ2FBIN(5755, 0)
+ 		},
+ 
+ 		{
+ 			/* Data[3].ctledges[0].bchannel */ FREQ2FBIN(5180, 0),
+ 			/* Data[3].ctledges[1].bchannel */ FREQ2FBIN(5200, 0),
+ 			/* Data[3].ctledges[2].bchannel */ FREQ2FBIN(5260, 0),
+ 			/* Data[3].ctledges[3].bchannel */ FREQ2FBIN(5320, 0),
+ 			/* Data[3].ctledges[4].bchannel */ FREQ2FBIN(5500, 0),
+ 			/* Data[3].ctledges[5].bchannel */ FREQ2FBIN(5700, 0),
+ 			/* Data[3].ctledges[6].bchannel */ 0xFF,
+ 			/* Data[3].ctledges[7].bchannel */ 0xFF,
+ 		},
+ 
+ 		{
+ 			/* Data[4].ctledges[0].bchannel */ FREQ2FBIN(5180, 0),
+ 			/* Data[4].ctledges[1].bchannel */ FREQ2FBIN(5260, 0),
+ 			/* Data[4].ctledges[2].bchannel */ FREQ2FBIN(5500, 0),
+ 			/* Data[4].ctledges[3].bchannel */ FREQ2FBIN(5700, 0),
+ 			/* Data[4].ctledges[4].bchannel */ 0xFF,
+ 			/* Data[4].ctledges[5].bchannel */ 0xFF,
+ 			/* Data[4].ctledges[6].bchannel */ 0xFF,
+ 			/* Data[4].ctledges[7].bchannel */ 0xFF,
+ 		},
+ 
+ 		{
+ 			/* Data[5].ctledges[0].bchannel */ FREQ2FBIN(5190, 0),
+ 			/* Data[5].ctledges[1].bchannel */ FREQ2FBIN(5270, 0),
+ 			/* Data[5].ctledges[2].bchannel */ FREQ2FBIN(5310, 0),
+ 			/* Data[5].ctledges[3].bchannel */ FREQ2FBIN(5510, 0),
+ 			/* Data[5].ctledges[4].bchannel */ FREQ2FBIN(5590, 0),
+ 			/* Data[5].ctledges[5].bchannel */ FREQ2FBIN(5670, 0),
+ 			/* Data[5].ctledges[6].bchannel */ 0xFF,
+ 			/* Data[5].ctledges[7].bchannel */ 0xFF
+ 		},
+ 
+ 		{
+ 			/* Data[6].ctledges[0].bchannel */ FREQ2FBIN(5180, 0),
+ 			/* Data[6].ctledges[1].bchannel */ FREQ2FBIN(5200, 0),
+ 			/* Data[6].ctledges[2].bchannel */ FREQ2FBIN(5220, 0),
+ 			/* Data[6].ctledges[3].bchannel */ FREQ2FBIN(5260, 0),
+ 			/* Data[6].ctledges[4].bchannel */ FREQ2FBIN(5500, 0),
+ 			/* Data[6].ctledges[5].bchannel */ FREQ2FBIN(5600, 0),
+ 			/* Data[6].ctledges[6].bchannel */ FREQ2FBIN(5700, 0),
+ 			/* Data[6].ctledges[7].bchannel */ FREQ2FBIN(5745, 0)
+ 		},
+ 
+ 		{
+ 			/* Data[7].ctledges[0].bchannel */ FREQ2FBIN(5180, 0),
+ 			/* Data[7].ctledges[1].bchannel */ FREQ2FBIN(5260, 0),
+ 			/* Data[7].ctledges[2].bchannel */ FREQ2FBIN(5320, 0),
+ 			/* Data[7].ctledges[3].bchannel */ FREQ2FBIN(5500, 0),
+ 			/* Data[7].ctledges[4].bchannel */ FREQ2FBIN(5560, 0),
+ 			/* Data[7].ctledges[5].bchannel */ FREQ2FBIN(5700, 0),
+ 			/* Data[7].ctledges[6].bchannel */ FREQ2FBIN(5745, 0),
+ 			/* Data[7].ctledges[7].bchannel */ FREQ2FBIN(5825, 0)
+ 		},
+ 
+ 		{
+ 			/* Data[8].ctledges[0].bchannel */ FREQ2FBIN(5190, 0),
+ 			/* Data[8].ctledges[1].bchannel */ FREQ2FBIN(5230, 0),
+ 			/* Data[8].ctledges[2].bchannel */ FREQ2FBIN(5270, 0),
+ 			/* Data[8].ctledges[3].bchannel */ FREQ2FBIN(5510, 0),
+ 			/* Data[8].ctledges[4].bchannel */ FREQ2FBIN(5550, 0),
+ 			/* Data[8].ctledges[5].bchannel */ FREQ2FBIN(5670, 0),
+ 			/* Data[8].ctledges[6].bchannel */ FREQ2FBIN(5755, 0),
+ 			/* Data[8].ctledges[7].bchannel */ FREQ2FBIN(5795, 0)
+ 		}
+ 	},
+ 	.ctlPowerData_5G = {
+ 		{
+ 			{
+ 				{60, 1}, {60, 1}, {60, 1}, {60, 1},
+ 				{60, 1}, {60, 1}, {60, 1}, {60, 0},
+ 			}
+ 		},
+ 		{
+ 			{
+ 				{60, 1}, {60, 1}, {60, 1}, {60, 1},
+ 				{60, 1}, {60, 1}, {60, 1}, {60, 0},
+ 			}
+ 		},
+ 		{
+ 			{
+ 				{60, 0}, {60, 1}, {60, 0}, {60, 1},
+ 				{60, 1}, {60, 1}, {60, 1}, {60, 1},
+ 			}
+ 		},
+ 		{
+ 			{
+ 				{60, 0}, {60, 1}, {60, 1}, {60, 0},
+ 				{60, 1}, {60, 0}, {60, 0}, {60, 0},
+ 			}
+ 		},
+ 		{
+ 			{
+ 				{60, 1}, {60, 1}, {60, 1}, {60, 0},
+ 				{60, 0}, {60, 0}, {60, 0}, {60, 0},
+ 			}
+ 		},
+ 		{
+ 			{
+ 				{60, 1}, {60, 1}, {60, 1}, {60, 1},
+ 				{60, 1}, {60, 0}, {60, 0}, {60, 0},
+ 			}
+ 		},
+ 		{
+ 			{
+ 				{60, 1}, {60, 1}, {60, 1}, {60, 1},
+ 				{60, 1}, {60, 1}, {60, 1}, {60, 1},
+ 			}
+ 		},
+ 		{
+ 			{
+ 				{60, 1}, {60, 1}, {60, 0}, {60, 1},
+ 				{60, 1}, {60, 1}, {60, 1}, {60, 0},
+ 			}
+ 		},
+ 		{
+ 			{
+ 				{60, 1}, {60, 0}, {60, 1}, {60, 1},
+ 				{60, 1}, {60, 1}, {60, 0}, {60, 1},
+ 			}
+ 		},
+ 	}
+ };
+ 
+ static const struct ar9300_eeprom ar9300_h116 = {
+ 	.eepromVersion = 2,
+ 	.templateVersion = 4,
+ 	.macAddr = {0x00, 0x03, 0x7f, 0x0, 0x0, 0x0},
+ 	.custData = {"h116-041-f0000"},
  	.baseEepHeader = {
  		.regDmn = { LE16(0), LE16(0x1f) },
- 		.txrxMask =  0x77, /* 4 bits tx and 4 bits rx */
+ 		.txrxMask =  0x33, /* 4 bits tx and 4 bits rx */
  		.opCapFlags = {
  			.opFlags = AR9300_OPFLAGS_11G | AR9300_OPFLAGS_11A,
  			.eepMisc = 0,

^ permalink raw reply

* sfc: Bug fixes and cleanup
From: Ben Hutchings @ 2010-12-02 23:44 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, sf-linux-drivers

The following changes since commit c20ec76157747434652e721cdd4dccd8654ad370:

  forcedeth: Use netdev_dbg for printk(KERN_DEBUG (2010-11-29 11:44:56 -0800)

are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/bwh/sfc-next-2.6.git for-davem

Various bug fixes and cleanup.  I'll post them all as replies to this
message.  Please pull.

Ben.

Ben Hutchings (15):
      sfc: Reduce log level for MCDI error response in efx_mcdi_rpc()
      sfc: Fix condition for no-op in set_phy_flash_cfg()
      sfc: Distinguish critical and non-critical over-temperature conditions
      sfc: Read-to-clear LM87 alarm/interrupt status at start of day
      sfc: Clear RXIN_SEL when soft-resetting QT2025C
      sfc: Remove broken automatic fallback for invalid Falcon chip/board config
      sfc: Expose Falcon BootROM config through MTD, not ethtool
      sfc: Remove unnecessary inclusion of various private header files
      sfc: Move SPI state to struct falcon_nic_data
      sfc: Move mdio_lock to struct falcon_nic_data
      sfc: Move Falcon global event handling to falcon.c
      sfc: Move xmac_poll_required into struct falcon_nic_data
      sfc: Update kernel-doc to match earlier move of Toeplitz hash key
      sfc: Use current MAC address, not NVRAM MAC address, for WoL filter
      sfc: Store MAC address from NVRAM in net_device::perm_addr

Steve Hodgson (2):
      sfc: Fix event based MCDI completion and MC REBOOT/CMDDONE ordering issue
      sfc: When waking a stopped tx_queue, only lock that tx_queue

 drivers/net/sfc/efx.c           |   14 +--
 drivers/net/sfc/ethtool.c       |   60 -------------
 drivers/net/sfc/falcon.c        |  183 +++++++++++++++++++++-----------------
 drivers/net/sfc/falcon_boards.c |  120 ++++++++++++++++++-------
 drivers/net/sfc/falcon_xmac.c   |   14 ++-
 drivers/net/sfc/mcdi.c          |    3 +-
 drivers/net/sfc/mcdi_phy.c      |    1 -
 drivers/net/sfc/mdio_10g.c      |    1 -
 drivers/net/sfc/mtd.c           |   98 ++++++++++++++-------
 drivers/net/sfc/net_driver.h    |   17 +---
 drivers/net/sfc/nic.c           |   48 +---------
 drivers/net/sfc/nic.h           |   12 +++-
 drivers/net/sfc/qt202x_phy.c    |    6 ++
 drivers/net/sfc/siena.c         |   10 +--
 drivers/net/sfc/spi.h           |    5 +
 drivers/net/sfc/tenxpress.c     |    2 -
 drivers/net/sfc/tx.c            |    8 ++-
 17 files changed, 309 insertions(+), 293 deletions(-)

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


^ permalink raw reply

* 2.6.37-rc4-git1: Reported regressions from 2.6.36
From: Rafael J. Wysocki @ 2010-12-02 23:35 UTC (permalink / raw)
  To: Linux Kernel Mailing List
  Cc: Maciej Rutecki, Florian Mickler, Andrew Morton, Linus Torvalds,
	Kernel Testers List, Network Development, Linux ACPI,
	Linux PM List, Linux SCSI List, Linux Wireless List, DRI

This message contains a list of some regressions from 2.6.36,
for which there are no fixes in the mainline known to the tracking team.
If any of them have been fixed already, please let us know.

If you know of any other unresolved regressions from 2.6.36, please let us
know either and we'll add them to the list.  Also, please let us know
if any of the entries below are invalid.

Each entry from the list will be sent additionally in an automatic reply
to this message with CCs to the people involved in reporting and handling
the issue.


Listed regressions statistics:

  Date          Total  Pending  Unresolved
  ----------------------------------------
  2010-12-03       55       25          19
  2010-11-19       39       29          25


Unresolved regressions
----------------------

Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=24142
Subject		: No more bt848 driver in 2.6.37-rc*
Submitter	: Christian Casteyde <casteyde.christian@free.fr>
Date		: 2010-11-30 20:50 (3 days old)


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=23902
Subject		: [BUG] 2.6.37-rc3 massive interactivity regression on ARM
Submitter	: Mikael Pettersson <mikpe@it.uu.se>
Date		: 2010-11-27 15:16 (6 days old)
Message-ID	: <19697.8378.717761.236202@pilspetsen.it.uu.se>
References	: http://marc.info/?l=linux-kernel&m=129087098911837&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=23762
Subject		: kernel 2.6.37-rc2 breaks i915 graphics
Submitter	: Chris Vine <chris@cvine.freeserve.co.uk>
Date		: 2010-11-21 10:23 (12 days old)
Message-ID	: <20101121102344.7c590b99@laptop.homenet>
References	: http://marc.info/?l=linux-kernel&m=129033505414671&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=23542
Subject		: HP 2530p accelerated graphics causes spontaneous power off/on
Submitter	: Bjorn Helgaas <bjorn.helgaas@hp.com>
Date		: 2010-11-22 17:12 (11 days old)
References	: https://patchwork.kernel.org/patch/365092/
Handled-By	: Bjorn Helgaas <bjorn.helgaas@hp.com>


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=23462
Subject		: DVI/EDID broken with Intel i945 graphics and 2.6.37-rc2
Submitter	: Tino Keitel <tino.keitel@tikei.de>
Date		: 2010-11-16 18:49 (17 days old)
Message-ID	: <20101116184914.GA15794@mac.home>
References	: http://marc.info/?l=linux-kernel&m=128993389113001&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=23432
Subject		: resume from suspend hangs on everex stepnote sa2053
Submitter	: tomas m <tmezzadra@gmail.com>
Date		: 2010-11-21 13:32 (12 days old)


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=23332
Subject		: Boot failure on HP nx6325
Submitter	: Rafael J. Wysocki <rjw@sisk.pl>
Date		: 2010-11-20 00:57 (13 days old)
First-Bad-Commit: http://git.kernel.org/linus/1af3c2e45e7a641e774bbb84fa428f2f0bf2d9c9
Handled-By	: Bjorn Helgaas <bjorn.helgaas@hp.com>


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=23142
Subject		: autofs4 hang in 2.6.37-rc1
Submitter	: Avi Kivity <avi@redhat.com>
Date		: 2010-11-14 12:55 (19 days old)
Message-ID	: <4CDFDC2B.6040205@redhat.com>
References	: http://marc.info/?l=linux-kernel&m=128973936026185&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=23102
Subject		: [bisected] i915 regression in post 2.6.36 kernels
Submitter	: Johannes Hirte <johannes.hirte@fem.tu-ilmenau.de>
Date		: 2010-11-10 7:02 (23 days old)
Message-ID	: <201011100802.20332.johannes.hirte@fem.tu-ilmenau.de>
References	: http://marc.info/?l=linux-kernel&m=128937310017057&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=22942
Subject		: [2.6.37-rc1, OOM] virtblk: OOM in do_virtblk_request()
Submitter	: Dave Chinner <david@fromorbit.com>
Date		: 2010-11-05 1:30 (28 days old)
Message-ID	: <20101105013003.GE13830@dastard>
References	: http://marc.info/?l=linux-kernel&m=128892062917641&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=22912
Subject		: spi_lm70llp module crash on unload (2.6.37-rc1)
Submitter	: Randy Dunlap <randy.dunlap@oracle.com>
Date		: 2010-11-05 0:16 (28 days old)
Message-ID	: <20101104171620.00d8c95d.randy.dunlap@oracle.com>
References	: http://marc.info/?l=linux-kernel&m=128891627913647&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=22882
Subject		: (2.6.37-rc1) amd64-agp module crashed on second load
Submitter	: Randy Dunlap <randy.dunlap@oracle.com>
Date		: 2010-11-05 0:13 (28 days old)
Message-ID	: <20101104171333.fea1f498.randy.dunlap@oracle.com>
References	: http://marc.info/?l=linux-kernel&m=128891605213447&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=22812
Subject		: kernel oops on 2.6.37-rc1
Submitter	: Andrew <atswartz@gmail.com>
Date		: 2010-11-12 16:05 (21 days old)
First-Bad-Commit: http://git.kernel.org/linus/a68c439b1966c91f0ef474e2bf275d6792312726


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=22672
Subject		: Regression in 2.6.37-rc1 for Intel 945 Graphics Adapter - bisected to commit e9e331a
Submitter	: Larry Finger <Larry.Finger@lwfinger.net>
Date		: 2010-11-11 01:56 (22 days old)
References	: https://bugs.freedesktop.org/show_bug.cgi?id=31803
		  http://marc.info/?l=linux-kernel&m=128944001311444&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=22642
Subject		: 2.6.37-rc1: Disk takes 10 seconds to resume - MacBook2,1
Submitter	: Tobias <devnull@plzk.org>
Date		: 2010-11-10 19:33 (23 days old)


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=22562
Subject		: Regression in 2.6.37-rc1 - logs spammed with "unable to enumerate USB port" - bisected to commit 3df7169e
Submitter	: Larry Finger <Larry.Finger@lwfinger.net>
Date		: 2010-11-02 22:32 (31 days old)
First-Bad-Commit: http://git.kernel.org/linus/3df7169e73fc1d71a39cffeacc969f6840cdf52b
Message-ID	: <4CD09166.4060202@lwfinger.net>
References	: http://marc.info/?l=linux-kernel&m=128873713207906&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=22542
Subject		: [2.6.37-rc1] drm:i195 errors
Submitter	: Paul Rolland <rol@witbe.net>
Date		: 2010-11-02 14:58 (31 days old)
Message-ID	: <20101102155813.09cb2c6e@tux.DEF.witbe.net>
References	: http://marc.info/?l=linux-kernel&m=128870991628970&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=22532
Subject		: 2.6.37-rc1: BUG: scheduling while atomic (kvm_init)
Submitter	: Thomas Meyer <thomas@m3y3r.de>
Date		: 2010-11-02 19:06 (31 days old)
Message-ID	: <50AA24C585B14210A44AB599605C7CBD@hugo>
References	: http://marc.info/?l=linux-kernel&m=128872479921559&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=22472
Subject		: vga_switcheroo fails to switch from intel to ati
Submitter	: Radu Andries <admiral0@tuxfamily.org>
Date		: 2010-11-08 16:46 (25 days old)


Regressions with patches
------------------------

Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=24012
Subject		: Commit g18733b0 hangs my LVM+raid10 system
Submitter	: Giacomo Catenazzi <cate@cateee.net>
Date		: 2010-11-29 19:48 (4 days old)
Handled-By	: Neil Brown <neilb@suse.de>
Patch		: https://bugzilla.kernel.org/show_bug.cgi?id=24012#c16


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=23452
Subject		: 5ada28bf76752 causes compilation error if !CONFIG_LEDS_CLASS
Submitter	: Michal Hocko <mhocko@suse.cz>
Date		: 2010-11-16 14:20 (17 days old)
Message-ID	: <20101116142027.GC19247@tiehlicka.suse.cz>
References	: http://marc.info/?l=linux-kernel&m=128991726220668&w=2
Handled-By	: Johannes Berg <johannes.berg@intel.com>
Patch		: https://patchwork.kernel.org/patch/365582/


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=23012
Subject		: ftdi_sio /dev/ttyUSB error:  "Resource Temporarily Unavailable"
Submitter	: Kevin Smith <thirdwiggin@gmail.com>
Date		: 2010-11-16 06:25 (17 days old)
Handled-By	: Alan Stern <stern@rowland.harvard.edu>
Patch		: https://bugzilla.kernel.org/attachment.cgi?id=38372


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=22932
Subject		: [REGRESSION] [2.6.37-rc1] Fan noise after suspend to ram/disk
Submitter	: Maciej Rutecki <maciej.rutecki@gmail.com>
Date		: 2010-11-04 16:06 (29 days old)
First-Bad-Commit: http://git.kernel.org/linus/3e384ee6c687cb397581ee8f9440fc8220cfac80
Message-ID	: <201011041706.59046.maciej.rutecki@gmail.com>
References	: http://marc.info/?l=linux-kernel&m=128888684308982&w=2
Handled-By	: Rafael J. Wysocki <rjw@sisk.pl>
Patch		: https://patchwork.kernel.org/patch/354682/


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=22662
Subject		: divide error in select_task_rq_fair()
Submitter	: Myron Stowe <myron.stowe@hp.com>
Date		: 2010-11-10 23:58 (23 days old)
Patch		: http://lkml.org/lkml/2010/11/13/176
		  http://lkml.org/lkml/2010/11/13/181


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=22572
Subject		: Linux 2.6.37-rc1 (acpi_video)
Submitter	: Randy Dunlap <randy.dunlap@oracle.com>
Date		: 2010-11-02 18:51 (31 days old)
Message-ID	: <20101102115106.bac57d21.randy.dunlap@oracle.com>
References	: http://marc.info/?l=linux-kernel&m=128872403920449&w=2
		  http://marc.info/?l=linux-acpi&m=128874714517914&w=2
Handled-By	: Zhang Rui <rui.zhang@intel.com>
Patch		: https://bugzilla.kernel.org/attachment.cgi?id=36992


For details, please visit the bug entries and follow the links given in
references.

As you can see, there is a Bugzilla entry for each of the listed regressions.
There also is a Bugzilla entry used for tracking the regressions from 2.6.36,
unresolved as well as resolved, at:

http://bugzilla.kernel.org/show_bug.cgi?id=21782

Please let the tracking team know if there are any Bugzilla entries that
should be added to the list in there.

Thanks!


^ permalink raw reply

* Re: jme: UDP checksum error, and lots of them
From: Francois Romieu @ 2010-12-02 23:15 UTC (permalink / raw)
  To: David Miller; +Cc: cooldavid, jengelh, netdev
In-Reply-To: <20101201.215916.104055114.davem@davemloft.net>

David Miller <davem@davemloft.net> :
[...]
> Something isn't right here.  The only thing that makes sense is if
> the tcpdump checksum validation is wrong for some reason.  Because
> only then could we give a reason for the UDP frames to not be
> dropped before vpnc can see them.

Wild guess : 192.168... is the local address and tcpdump chokes on
an outgoing, yet-not-checksummed packet.

-- 
Ueimor

^ permalink raw reply

* Re: [PATCH][IPv6] Export userland ND options through netlink (RDNSS support)
From: David Woodhouse @ 2010-12-02 22:59 UTC (permalink / raw)
  To: Pierre Ynard, yoshfuji; +Cc: netdev
In-Reply-To: <20071005060930.GA15305@via.ecp.fr>

On Fri, 2007-10-05 at 08:09 +0200, Pierre Ynard wrote:
> As discussed before, this patch provides userland with a way to access
> relevant options in Router Advertisements, after they are processed and
> validated by the kernel. Extra options are processed in a generic way;
> this patch only exports RDNSS options described in RFC5006, but support
> to control which options are exported could be easily added.
> 
> A new rtnetlink message type is defined, to transport Neighbor Discovery
> options, along with optional context information. At the moment only
> the address of the router sending an RDNSS option is included, but
> additional attributes may be later defined, if needed by new use cases.

RFC5006 §6.1 says:
    Note:  An RDNSS address MUST be used only as long as both the RA
      router lifetime and the RDNSS option lifetime have not expired.
      The reason is that the RDNSS may not be currently reachable or may
      not provide service to the host's current address (e.g., due to
      network ingress filtering [16][17]).

But when this option makes its way to userspace, we don't *know* the RA
router lifetime, or even which interface it came in on. I'm not sure how
we can use this correctly.

This is a start at using it in ConnMan... but unless I'm missing
something, we don't have enough information to do it properly:
http://lists.connman.net/pipermail/connman/2010-December/002781.html

-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse@intel.com                              Intel Corporation


^ permalink raw reply

* Re: [PATCH v2] ethtool : Allow ethtool to set interface in loopback mode.
From: Mahesh Bandewar @ 2010-12-02 22:35 UTC (permalink / raw)
  To: Ben Hutchings, linux-netdev; +Cc: Tom Herbert, David Miller
In-Reply-To: <1291299660.3259.5.camel@bwh-desktop>

This patch adds -L command-line option to switch loopback mode on/off
and -l option to display current loopback mode on a specified interface.

Signed-off-by Mahesh Bandewar <maheshb@google.com>

 Change-log
   v2:
      - Changed argument from enable/disable to on/off
      - Added these new options into the man page.

 ethtool-copy.h |    2 +
 ethtool.8      |   21 ++++++++++++++++++
 ethtool.c      |   64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 87 insertions(+), 0 deletions(-)

---

diff --git a/ethtool-copy.h b/ethtool-copy.h
index 75c3ae7..297a042 100644
--- a/ethtool-copy.h
+++ b/ethtool-copy.h
@@ -584,6 +584,8 @@ struct ethtool_flash {
 #define ETHTOOL_GSSET_INFO     0x00000037 /* Get string set info */
 #define ETHTOOL_GRXFHINDIR     0x00000038 /* Get RX flow hash indir'n table */
 #define ETHTOOL_SRXFHINDIR     0x00000039 /* Set RX flow hash indir'n table */
+#define ETHTOOL_SLOOPBACK      0x0000003a /* Enable / Disable loopback. */
+#define ETHTOOL_GLOOPBACK      0x0000003b /* Get loopback status. */

 /* compatibility with older code */
 #define SPARC_ETH_GSET         ETHTOOL_GSET
diff --git a/ethtool.8 b/ethtool.8
index 1760924..bda1fe6 100644
--- a/ethtool.8
+++ b/ethtool.8
@@ -174,6 +174,13 @@ ethtool \- Display or change ethernet card settings
 .B2 txvlan on off
 .B2 rxhash on off

+.B ethtool \-l|\-\-show\-loopback
+.I ethX
+
+.B ethtool \-L|\-\-config\-loopback
+.I ethX
+.B1 on off
+
 .B ethtool \-p|\-\-identify
 .I ethX
 .RI [ N ]
@@ -406,6 +413,20 @@ Specifies whether TX VLAN acceleration should be enabled
 .A2 rxhash on off
 Specifies whether receive hashing offload should be enabled
 .TP
+.B \-l \-\-show\-loopback
+Queries the specified ethernet device for loopback mode settings.
+.TP
+.B \-L \-\-config\-loopback
+Configures loopback mode on the specified ethernet device. Possible values
+are:
+.TP
+.A1 on off
+Switches loopback mode
+.B on
+or
+.B off
+for the speficied ethernet device.
+.TP
 .B \-p \-\-identify
 Initiates adapter-specific action intended to enable an operator to
 easily identify the adapter by sight.  Typically this involves
diff --git a/ethtool.c b/ethtool.c
index 239912b..b3bf4dd 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -114,6 +114,8 @@ static int do_srxntuple(int fd, struct ifreq *ifr);
 static int do_grxntuple(int fd, struct ifreq *ifr);
 static int do_flash(int fd, struct ifreq *ifr);
 static int do_permaddr(int fd, struct ifreq *ifr);
+static int do_sloopback(int fd, struct ifreq *ifr);
+static int do_gloopback(int fd, struct ifreq *ifr);

 static int send_ioctl(int fd, struct ifreq *ifr);

@@ -145,6 +147,8 @@ static enum {
        MODE_GNTUPLE,
        MODE_FLASHDEV,
        MODE_PERMADDR,
+       MODE_SLOOPBACK,
+       MODE_GLOOPBACK,
 } mode = MODE_GSET;

 static struct option {
@@ -266,6 +270,9 @@ static struct option {
                "Get Rx ntuple filters and actions\n" },
     { "-P", "--show-permaddr", MODE_PERMADDR,
                "Show permanent hardware address" },
+    { "-L", "--config-loopback", MODE_SLOOPBACK, "{En|Dis}able device loopback"
+               "               [ on|off ]\n"},
+    { "-l", "--show-loopback", MODE_GLOOPBACK, "Show device loopback mode",},
     { "-h", "--help", MODE_HELP, "Show this help" },
     {}
 };
@@ -407,6 +414,8 @@ static char *flash_file = NULL;
 static int flash = -1;
 static int flash_region = -1;

+static int loopback_enable = 0;
+
 static int msglvl_changed;
 static u32 msglvl_wanted = 0;
 static u32 msglvl_mask = 0;
@@ -841,6 +850,8 @@ static void parse_cmdline(int argc, char **argp)
                            (mode == MODE_GNTUPLE) ||
                            (mode == MODE_PHYS_ID) ||
                            (mode == MODE_FLASHDEV) ||
+                           (mode == MODE_SLOOPBACK) ||
+                           (mode == MODE_GLOOPBACK) ||
                            (mode == MODE_PERMADDR)) {
                                devname = argp[i];
                                break;
@@ -1009,6 +1020,16 @@ static void parse_cmdline(int argc, char **argp)
                                }
                                break;
                        }
+                       if (mode == MODE_SLOOPBACK) {
+                               if (!strcmp(argp[i], "on"))
+                                       loopback_enable = 1;
+                               else if (!strcmp(argp[i], "off"))
+                                       loopback_enable = 0;
+                               else
+                                       show_usage(1);
+                               i = argc;
+                               break;
+                       }
                        if (mode != MODE_SSET)
                                show_usage(1);
                        if (!strcmp(argp[i], "speed")) {
@@ -2019,6 +2040,10 @@ static int doit(void)
                return do_flash(fd, &ifr);
        } else if (mode == MODE_PERMADDR) {
                return do_permaddr(fd, &ifr);
+       } else if (mode == MODE_SLOOPBACK) {
+               return do_sloopback(fd, &ifr);
+       } else if (mode == MODE_GLOOPBACK) {
+               return do_gloopback(fd, &ifr);
        }

        return 69;
@@ -3201,6 +3226,45 @@ static int do_grxntuple(int fd, struct ifreq *ifr)
        return 0;
 }

+static int do_sloopback(int fd, struct ifreq *ifr)
+{
+       int err;
+       struct ethtool_value edata;
+
+       edata.cmd = ETHTOOL_SLOOPBACK;
+       edata.data = loopback_enable;
+       ifr->ifr_data = (caddr_t)&edata;
+
+       err = send_ioctl(fd, ifr);
+       if (err < 0) {
+               char error[64];
+               sprintf(error, "Cannot turn %s loopback mode",
+                               loopback_enable ? "on" : "off");
+               perror(error);
+               return 1;
+       }
+
+       return err;
+}
+
+static int do_gloopback(int fd, struct ifreq *ifr)
+{
+       int err;
+       struct ethtool_value edata;
+
+       edata.cmd = ETHTOOL_GLOOPBACK;
+       ifr->ifr_data = (caddr_t)&edata;
+
+       err = send_ioctl(fd, ifr);
+       if (err < 0) {
+               perror("Cannot get loopback status");
+               return 1;
+       }
+       printf("Loopback is turned %s\n", edata.data ? "on" : "off");
+
+       return err;
+}
+
 static int send_ioctl(int fd, struct ifreq *ifr)
 {
        return ioctl(fd, SIOCETHTOOL, ifr);

^ permalink raw reply related

* Re: bridge netpoll support: mismatch between net core and bridge headers
From: Mike Frysinger @ 2010-12-02 21:57 UTC (permalink / raw)
  To: David Miller; +Cc: herbert, netdev
In-Reply-To: <20101202.095135.226774598.davem@davemloft.net>

On Thu, Dec 2, 2010 at 12:51, David Miller wrote:
> From: Mike Frysinger <vapier.adi@gmail.com>
>> On Wed, Dec 1, 2010 at 19:33, David Miller wrote:
>>> Attached.  Also please provide one of the failing ".config" files,
>>> and please test if simply going "make oldconfig" unbreaks things.
>>> It may be that randconfig allows configurations that the config
>>> system normally does not allow.
>>
>> hrm, so your patch does fix things.  the downside is that it might be
>> caused by kgdboe (which isnt in mainline yet).  that's the only
>> randconfig i can find so far to cause the issue.
>
> If that's the case you just need to check and make sure that kgdboe
> handles dependencies properly in it's Kconfig changes.
>
> I suspect that simply adding kgdboe as a new "or" case to the
> "def_bool" statement of NETPOLL in driver/net/Kconfig will fix the
> problem.
>
> If kgdboe is using "select" to handle these dependencies, that's the
> bug.

it is using select to enable reverse depends.  i'll look at sending a
fix as you suggest to the kgdb devs.  thanks !
-mike

^ permalink raw reply

* Re: RFS configuration questions
From: Eric Dumazet @ 2010-12-02 21:40 UTC (permalink / raw)
  To: Shawn Bohrer; +Cc: netdev, therbert
In-Reply-To: <20101202211602.GA2775@BohrerMBP.rgmadvisors.com>

Le jeudi 02 décembre 2010 à 15:16 -0600, Shawn Bohrer a écrit :
> I've been playing around with RPS/RFS on my multiqueue 10g Chelsio NIC
> and I've got some questions about configuring RFS.
> 
> I've enabled RPS with:
> 
> for x in $(seq 0 7); do
>     echo FFFFFFFF,FFFFFFFF > /sys/class/net/vlan816/queues/rx-${x}/rps_cpus
> done
> 
> This appears to work when I watch 'mpstat -P ALL 1' as I can see the
> softirq load is now getting distributed across all of the CPUs instead
> of just the four (the card is a two port card and assigns four queues
> per port) original hw receive queues which I have bound to CPUs
> 0-3.
> 
> To enable RFS I've run:
> 
> echo 16384 > /proc/sys/net/core/rps_sock_flow_entries
> 
> Is there any explanation of what this sysctl actually does?  Is this
> the max number of sockets/flows that the kernel can steer?  Is this a
> system wide max, a per interface max, or a per receive queue max?
> 

Yes, some doc is missing...

Its a system wide and shared limit.

> Next I ran:
> 
> for x in $(seq 0 7); do
>     echo 16384 > /sys/class/net/vlan816/queues/rx-${x}/rps_flow_cnt
> done
> 
> Is this correct?  Is these the max number of sockets/flows that can be
> steered per receive queue?  Does the sum of these values need to add
> up to rps_sock_flow_entries (I also tried 2048)? Is this all that is
> needed to enable RFS?
> 

Yes thats all.

> With these settings I can watch 'mpstat -P ALL 1' and it doesn't
> appear RFS has changed the softirq load.  To get a better idea if it
> was working I used taskset to bind my receiving processes to a set of
> cores, yet mpstat still shows the softirq load getting distributed
> across all cores, not just the ones where my receiving processes are
> bound.  Is there a better way to determine if RFS is actually working?
> Have I configured RFS incorrectly?

It seems fine to me, but what kind of workload do you have, and what
version of kernel do you run ?




^ permalink raw reply

* Re: [PATCH 0/11 net-next] TIPC cleanups for native API removal
From: David Miller @ 2010-12-02 21:34 UTC (permalink / raw)
  To: paul.gortmaker; +Cc: netdev, allan.stephens
In-Reply-To: <1291154463-26346-1-git-send-email-paul.gortmaker@windriver.com>

From: Paul Gortmaker <paul.gortmaker@windriver.com>
Date: Tue, 30 Nov 2010 17:00:52 -0500

> The purge of the unused code that existed just to support the draft
> API spec (commit 31e3c3f6f1f9b154981a0e6620df700463db30ee) actually
> opens the door for several more cleanups of similar nature.  It is
> possible to relocate and internalize header file content, reduce the
> number of exported symbols further, and manually inline some of the
> "used once" functions that used to be separate just to be exported.
> 
> Some other largely trivial one-off type cleanups are also included.
> Overall, this set of commits should largely be a no-op in terms of
> behaviour change though.

Looks great, all applied, thanks!

^ permalink raw reply

* Re: [PATCH v2 4/4] net: kill unused macros from head file
From: David Miller @ 2010-12-02 21:28 UTC (permalink / raw)
  To: shanwei; +Cc: yoshfuji, netdev
In-Reply-To: <4CF71AFD.6020409@cn.fujitsu.com>

From: Shan Wei <shanwei@cn.fujitsu.com>
Date: Thu, 02 Dec 2010 12:05:17 +0800

> These macros have been defined for several years since v2.6.12-rc2(tracing by git),
> but never be used. So remove them.
> 
> 
> Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>

Applied.

^ permalink raw reply

* Re: [PATCH v2 3/4] ipv6: use ND_REACHABLE_TIME and ND_RETRANS_TIMER instead of magic number
From: David Miller @ 2010-12-02 21:28 UTC (permalink / raw)
  To: shanwei; +Cc: netdev, yoshfuji
In-Reply-To: <4CF71AF8.9050205@cn.fujitsu.com>

From: Shan Wei <shanwei@cn.fujitsu.com>
Date: Thu, 02 Dec 2010 12:05:12 +0800

> 
> ND_REACHABLE_TIME and ND_RETRANS_TIMER have defined 
> since v2.6.12-rc2, but never been used.
> So use them instead of magic number.
> 
> This patch also changes original code style to read comfortably .
> 
> Thank YOSHIFUJI Hideaki for pointing it out.
> 
> Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>

Applied.

^ permalink raw reply

* Re: [PATCH v2 2/4] tcp: use TCP_BASE_MSS to set basic mss value
From: David Miller @ 2010-12-02 21:28 UTC (permalink / raw)
  To: shanwei; +Cc: jheffner, netdev
In-Reply-To: <4CF71AE2.6050406@cn.fujitsu.com>

From: Shan Wei <shanwei@cn.fujitsu.com>
Date: Thu, 02 Dec 2010 12:04:50 +0800

> 
> TCP_BASE_MSS is defined, but not used.
> commit 5d424d5a introduce this macro, so use
> it to initial sysctl_tcp_base_mss.
> 
> commit 5d424d5a674f782d0659a3b66d951f412901faee
> Author: John Heffner <jheffner@psc.edu>
> Date:   Mon Mar 20 17:53:41 2006 -0800
> 
>     [TCP]: MTU probing
> 
> Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
> ---

Applied.

^ permalink raw reply

* Re: [PATCH v2 1/4] net: snmp: fix the wrong ICMP_MIB_MAX value
From: David Miller @ 2010-12-02 21:27 UTC (permalink / raw)
  To: shanwei; +Cc: netdev
In-Reply-To: <4CF71ADB.5060702@cn.fujitsu.com>

From: Shan Wei <shanwei@cn.fujitsu.com>
Date: Thu, 02 Dec 2010 12:04:43 +0800

> __ICMP_MIB_MAX is equal to the total number of icmp mib,
> So no need to add 1. This wastes 4/8 bytes memory.
> 
> Change it to be same as ICMP6_MIB_MAX, TCP_MIB_MAX, UDP_MIB_MAX.
> 
> 
> Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>

Applied.

^ permalink raw reply

* Re: [PATCH] fix hang in dmfe driver on sending of big packet (linux-2.6.35)
From: David Miller @ 2010-12-02 21:24 UTC (permalink / raw)
  To: eric.dumazet; +Cc: lav, netdev, tori
In-Reply-To: <1291125459.2904.75.camel@edumazet-laptop>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 30 Nov 2010 14:57:39 +0100

> From: Alexander V. Lukyanov <lav@netis.ru>
> 
> Le mardi 30 novembre 2010 à 16:46 +0300, Alexander V. Lukyanov a écrit :
>> Hello!
>> 
>> This patch fixes hang in dmfe driver on attempt of sending a big packet.
>> Without this patch the code stops the queue and never wakes it again.
>> 
>> Signed-off-by: Alexander V. Lukyanov <lav@netis.ru>
>> 
> 
> Nice catch, but your patch is not a "diff -p1" one
> 
> I did it for net-2.6 tree :
> 
> Thanks
> 
> [PATCH] tulip: fix hang in dmfe driver on sending of big packet
> 
> This patch fixes hang in dmfe driver on attempt of sending a big packet.
> Without this patch the code stops the queue and never wakes it again.
> 
> Signed-off-by: Alexander V. Lukyanov <lav@netis.ru>
> Acked-by: Eric Dumazet <eric.dumazet@gmail.com>

Applied.

^ permalink raw reply

* Re: [PATCH] stmmac: priv->lock can be used uninitialized
From: David Miller @ 2010-12-02 21:19 UTC (permalink / raw)
  To: vlad.lungu; +Cc: netdev, peppe.cavallaro
In-Reply-To: <9345448e435110e2bdff65bb4322060a6f1f6b63.1291106902.git.vlad.lungu@windriver.com>

From: Vlad Lungu <vlad.lungu@windriver.com>
Date: Tue, 30 Nov 2010 10:52:52 +0200

> To reproduce: if connman (http://connman.net/) is started,
> inserting the stmmac module triggers a "BUG: spinlock bad magic on CPU#0".
> 
> Registering the device in stmmac_probe() sends a notification to connman
> which brings the interface up before the lock is initialized.
> 
> Signed-off-by: Vlad Lungu <vlad.lungu@windriver.com>

Applied, thanks.

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox