Netdev List
 help / color / mirror / Atom feed
* [PATCH 0/2] bonding: add the debugfs interface to see RLB hash table
From: Taku Izumi @ 2010-12-03  2:51 UTC (permalink / raw)
  To: netdev@vger.kernel.org, Jay Vosburgh; +Cc: eric.dumazet, shemminger

This patchset provides the debugfs facility to the bonding driver and
the interface to see RLB hashtable in it.

 *[PATCH 1/2] bonding: add the debugfs facility to the bonding driver
 *[PATCH 2/2] bonding: add the debugfs interface to see RLB hash table

Best regards,
Taku Izumi


^ permalink raw reply

* Re: [v2 PATCH 1/2] bonding: sync netpoll code with bridge
From: Cong Wang @ 2010-12-03  2:13 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: linux-kernel, Jiri Pirko, Neil Horman, netdev, David S. Miller,
	Eric W. Biederman, Herbert Xu, bonding-devel, Jay Vosburgh
In-Reply-To: <20101202103650.06647704@nehalam>

On 12/03/10 02:36, Stephen Hemminger wrote:
> On Thu, 2 Dec 2010 08:35:42 -0500
> Amerigo Wang<amwang@redhat.com>  wrote:
>
>>   #ifdef CONFIG_NET_POLL_CONTROLLER
>> -	if (unlikely(bond->dev->priv_flags&  IFF_IN_NETPOLL)) {
>> -		struct netpoll *np = bond->dev->npinfo->netpoll;
>> -		slave_dev->npinfo = bond->dev->npinfo;
>> +	if (unlikely(netpoll_tx_running(slave_dev))) {
>>   		slave_dev->priv_flags |= IFF_IN_NETPOLL;
>> -		netpoll_send_skb_on_dev(np, skb, slave_dev);
>> +		bond_netpoll_send_skb(bond_get_slave_by_dev(bond, slave_dev), skb);
>>   		slave_dev->priv_flags&= ~IFF_IN_NETPOLL;
>>   	} else
>>   #endif
>
> Couldn't you eliminate #ifdef by putting the following into header file.
>
> #ifdef CONFIG_NET_POLL_CONTROLLER
> static inline netpoll_tx_running
> ...
> #else
> #define netpoll_tx_running(dev)  (0)
> #endif
>

Oh, nice idea! Will change this in the next update.

Thanks.

^ permalink raw reply

* Re: [PATCH net-next-2.6 v6 04/20] can: EG20T PCH: Add Tx Flow Control
From: Tomoya MORINAGA @ 2010-12-03  0:58 UTC (permalink / raw)
  To: David Miller
  Cc: wg, w.sang, chripell, 21cnbao, sameo, socketcan-core, netdev,
	linux-kernel, qi.wang, yong.y.wang, andrew.chih.howe.khor,
	joel.clark, kok.howg.ewe, margie.foster
In-Reply-To: <20101202.131236.28815617.davem@davemloft.net>

On Friday, December 03, 2010 6:12 AM, David Miller wrote :

> 
> When implementing functionality like this it is better to use other
> existing well tested network drivers as a guide rather then trying
> to be unique and clever, as you are doing here.

Sure. I will do so.

> 
> Second of all, checking the state of the device to determine if a
> stop queue should be performed has two problems:
> 
> 1) The test uses a magic constant mask, which is undocumented.

Do you above "magic constant" mean "0xfc00" ?
If so, this constant is replaced to MACRO in 08/20 patch. 

> 
> 2) It causes the race you have on the wake queue side
> 
> Use pure software state to guide your actions, and let the hardware
> interrupt trigger the wake queue.
> 
> Also, you don't implement this as a true ring buffer, you only
> consider to stop the queue when you hit the last TX object entry.  But
> all the previous slots could be available.

We can't use ring buffer.
Because ring buffer causes issue of tx packet out-of-order.

I show EG20T CAN HW spec below
According to priority, EG20T CAN HW sends packet from message object.
The priority is Message object number.
Lower number is high-priority, Higher is low priority

Thus, I think we can't use ring buffer.

Still, do you think I can use ring buffer ?
------
Thanks,

Tomoya MORINAGA
OKI SEMICONDUCTOR CO., LTD.

^ permalink raw reply

* Re: jme: UDP checksum error, and lots of them
From: Jan Engelhardt @ 2010-12-02 23:54 UTC (permalink / raw)
  To: Francois Romieu; +Cc: David Miller, cooldavid, netdev
In-Reply-To: <20101202231546.GA3507@electric-eye.fr.zoreil.com>

On Friday 2010-12-03 00:15, Francois Romieu wrote:

>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.

Then the checksums of all other packets I am emitting would also be 0000 
or wrong, which isn't the case.

Also, when I am running vpnc on my desktop machine (unlike the
laptop, it has sis900 and is i586), tcpdump agrees with the checksum
it seems.
So either it's due to x86_64, or it is in fact jme..

00:48:10.954007 IP 192.168.13.37.4500 > 134.76.22.1.4500: UDP-encap:
ESP(spi=0x2224e306,seq=0x225a), length 164
        0x0000:  4500 00c0 4582 4000 4011 8a90 c0a8 0d25  E...E.@.@......%
        0x0010:  864c 1601 1194 1194 00ac b0e4 2224 e306  .L.........."$..
        0x0020:  0000 225a 70d8 8311 d5f4 0936 1a1c 1664  .."Zp......6...d
        0x0030:  f4b9 9281 a9a3 6b91 41eb 1deb 737e defd  ......k.A...s~..
        0x0040:  d5cc 9a76 976c 4216 bdf3 4f23 50b7 deda  ...v.lB...O#P...
        0x0050:  dcf2 489f 223d 9e24 21fb b5f4 5829 ec4c  ..H."=.$!...X).L
        0x0060:  f90b 25b2 588f 82e1 131c b273 07e0 7234  ..%.X......s..r4
        0x0070:  957c 69e8 6e56 353c 7ce8 446a 52a2 fe2f  .|i.nV5<|.DjR../
        0x0080:  ea75 c9ac e7e3 df40 bca5 2ca9 e376 29ea  .u.....@..,..v).
        0x0090:  080b 2329 c1b7 1111 0e4b 8c13 af98 4d5e  ..#).....K....M^
        0x00a0:  1708 a911 9962 d023 9dff 4df6 58fd e035  .....b.#..M.X..5
        0x00b0:  5386 4198 ea07 376d 8c96 3466 394d c7e6  S.A...7m..4f9M..

^ permalink raw reply

* [PATCH net-next-2.6 17/17] sfc: Store MAC address from NVRAM in net_device::perm_addr
From: Ben Hutchings @ 2010-12-02 23:48 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-net-drivers
In-Reply-To: <1291333490.3259.23.camel@bwh-desktop>

For some reason we failed to make this change when perm_addr was
introduced.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 drivers/net/sfc/efx.c        |    8 +++++---
 drivers/net/sfc/falcon.c     |    2 +-
 drivers/net/sfc/net_driver.h |    2 --
 drivers/net/sfc/siena.c      |    8 +-------
 4 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c
index 7e820d9..f3e4043 100644
--- a/drivers/net/sfc/efx.c
+++ b/drivers/net/sfc/efx.c
@@ -909,6 +909,7 @@ static void efx_mac_work(struct work_struct *data)
 
 static int efx_probe_port(struct efx_nic *efx)
 {
+	unsigned char *perm_addr;
 	int rc;
 
 	netif_dbg(efx, probe, efx->net_dev, "create port\n");
@@ -922,11 +923,12 @@ static int efx_probe_port(struct efx_nic *efx)
 		return rc;
 
 	/* Sanity check MAC address */
-	if (is_valid_ether_addr(efx->mac_address)) {
-		memcpy(efx->net_dev->dev_addr, efx->mac_address, ETH_ALEN);
+	perm_addr = efx->net_dev->perm_addr;
+	if (is_valid_ether_addr(perm_addr)) {
+		memcpy(efx->net_dev->dev_addr, perm_addr, ETH_ALEN);
 	} else {
 		netif_err(efx, probe, efx->net_dev, "invalid MAC address %pM\n",
-			  efx->mac_address);
+			  perm_addr);
 		if (!allow_bad_hwaddr) {
 			rc = -EINVAL;
 			goto err;
diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c
index 07f684e..70e4f7d 100644
--- a/drivers/net/sfc/falcon.c
+++ b/drivers/net/sfc/falcon.c
@@ -1297,7 +1297,7 @@ static int falcon_probe_nvconfig(struct efx_nic *efx)
 	}
 
 	/* Read the MAC addresses */
-	memcpy(efx->mac_address, nvconfig->mac_address[0], ETH_ALEN);
+	memcpy(efx->net_dev->perm_addr, nvconfig->mac_address[0], ETH_ALEN);
 
 	netif_dbg(efx, probe, efx->net_dev, "PHY is %d phy_id %d\n",
 		  efx->phy_type, efx->mdio.prtad);
diff --git a/drivers/net/sfc/net_driver.h b/drivers/net/sfc/net_driver.h
index 6dd5e6d..0d19fbf 100644
--- a/drivers/net/sfc/net_driver.h
+++ b/drivers/net/sfc/net_driver.h
@@ -678,7 +678,6 @@ struct efx_filter_state;
  * @stats_buffer: DMA buffer for statistics
  * @stats_lock: Statistics update lock. Serialises statistics fetches
  * @mac_op: MAC interface
- * @mac_address: Permanent MAC address
  * @phy_type: PHY type
  * @phy_op: PHY interface
  * @phy_data: PHY private data (including PHY-specific stats)
@@ -762,7 +761,6 @@ struct efx_nic {
 	spinlock_t stats_lock;
 
 	struct efx_mac_operations *mac_op;
-	unsigned char mac_address[ETH_ALEN];
 
 	unsigned int phy_type;
 	struct efx_phy_operations *phy_op;
diff --git a/drivers/net/sfc/siena.c b/drivers/net/sfc/siena.c
index b315980..bf84561 100644
--- a/drivers/net/sfc/siena.c
+++ b/drivers/net/sfc/siena.c
@@ -194,13 +194,7 @@ static int siena_reset_hw(struct efx_nic *efx, enum reset_type method)
 
 static int siena_probe_nvconfig(struct efx_nic *efx)
 {
-	int rc;
-
-	rc = efx_mcdi_get_board_cfg(efx, efx->mac_address, NULL);
-	if (rc)
-		return rc;
-
-	return 0;
+	return efx_mcdi_get_board_cfg(efx, efx->net_dev->perm_addr, NULL);
 }
 
 static int siena_probe_nic(struct efx_nic *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 16/17] sfc: Use current MAC address, not NVRAM MAC address, for WoL filter
From: Ben Hutchings @ 2010-12-02 23:48 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/siena.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/sfc/siena.c b/drivers/net/sfc/siena.c
index 45236f5..b315980 100644
--- a/drivers/net/sfc/siena.c
+++ b/drivers/net/sfc/siena.c
@@ -562,7 +562,7 @@ static int siena_set_wol(struct efx_nic *efx, u32 type)
 		if (nic_data->wol_filter_id != -1)
 			efx_mcdi_wol_filter_remove(efx,
 						   nic_data->wol_filter_id);
-		rc = efx_mcdi_wol_filter_set_magic(efx, efx->mac_address,
+		rc = efx_mcdi_wol_filter_set_magic(efx, efx->net_dev->dev_addr,
 						   &nic_data->wol_filter_id);
 		if (rc)
 			goto fail;
-- 
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 15/17] sfc: When waking a stopped tx_queue, only lock that tx_queue
From: Ben Hutchings @ 2010-12-02 23:48 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>

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

diff --git a/drivers/net/sfc/tx.c b/drivers/net/sfc/tx.c
index 1172698..03194f7 100644
--- a/drivers/net/sfc/tx.c
+++ b/drivers/net/sfc/tx.c
@@ -401,6 +401,7 @@ void efx_xmit_done(struct efx_tx_queue *tx_queue, unsigned int index)
 {
 	unsigned fill_level;
 	struct efx_nic *efx = tx_queue->efx;
+	struct netdev_queue *queue;
 
 	EFX_BUG_ON_PARANOID(index > tx_queue->ptr_mask);
 
@@ -417,12 +418,15 @@ void efx_xmit_done(struct efx_tx_queue *tx_queue, unsigned int index)
 
 			/* Do this under netif_tx_lock(), to avoid racing
 			 * with efx_xmit(). */
-			netif_tx_lock(efx->net_dev);
+			queue = netdev_get_tx_queue(
+				efx->net_dev,
+				tx_queue->queue / EFX_TXQ_TYPES);
+			__netif_tx_lock(queue, smp_processor_id());
 			if (tx_queue->stopped) {
 				tx_queue->stopped = 0;
 				efx_wake_queue(tx_queue->channel);
 			}
-			netif_tx_unlock(efx->net_dev);
+			__netif_tx_unlock(queue);
 		}
 	}
 }
-- 
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 14/17] sfc: Update kernel-doc to match earlier move of Toeplitz hash key
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/net_driver.h |    1 +
 drivers/net/sfc/nic.h        |    1 -
 2 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/sfc/net_driver.h b/drivers/net/sfc/net_driver.h
index b7e8fe9..6dd5e6d 100644
--- a/drivers/net/sfc/net_driver.h
+++ b/drivers/net/sfc/net_driver.h
@@ -647,6 +647,7 @@ struct efx_filter_state;
  * @n_tx_channels: Number of channels used for TX
  * @rx_buffer_len: RX buffer length
  * @rx_buffer_order: Order (log2) of number of pages for each RX buffer
+ * @rx_hash_key: Toeplitz hash key for RSS
  * @rx_indir_table: Indirection table for RSS
  * @int_error_count: Number of internal errors seen recently
  * @int_error_expire: Time at which error count will be expired
diff --git a/drivers/net/sfc/nic.h b/drivers/net/sfc/nic.h
index f107dc7..eb05869 100644
--- a/drivers/net/sfc/nic.h
+++ b/drivers/net/sfc/nic.h
@@ -146,7 +146,6 @@ static inline struct falcon_board *falcon_board(struct efx_nic *efx)
  * @fw_build: Firmware build number
  * @mcdi: Management-Controller-to-Driver Interface
  * @wol_filter_id: Wake-on-LAN packet filter id
- * @ipv6_rss_key: Toeplitz hash key for IPv6 RSS
  */
 struct siena_nic_data {
 	u64 fw_version;
-- 
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 13/17] sfc: Move xmac_poll_required into 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>

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 drivers/net/sfc/falcon.c        |    3 ++-
 drivers/net/sfc/falcon_boards.c |    3 ++-
 drivers/net/sfc/falcon_xmac.c   |   13 +++++++++----
 drivers/net/sfc/net_driver.h    |    2 --
 drivers/net/sfc/nic.h           |    2 ++
 5 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c
index fd5bf0b..07f684e 100644
--- a/drivers/net/sfc/falcon.c
+++ b/drivers/net/sfc/falcon.c
@@ -886,6 +886,7 @@ static bool
 falcon_handle_global_event(struct efx_channel *channel, efx_qword_t *event)
 {
 	struct efx_nic *efx = channel->efx;
+	struct falcon_nic_data *nic_data = efx->nic_data;
 
 	if (EFX_QWORD_FIELD(*event, FSF_AB_GLB_EV_G_PHY0_INTR) ||
 	    EFX_QWORD_FIELD(*event, FSF_AB_GLB_EV_XG_PHY0_INTR) ||
@@ -895,7 +896,7 @@ falcon_handle_global_event(struct efx_channel *channel, efx_qword_t *event)
 
 	if ((efx_nic_rev(efx) == EFX_REV_FALCON_B0) &&
 	    EFX_QWORD_FIELD(*event, FSF_BB_GLB_EV_XG_MGT_INTR)) {
-		efx->xmac_poll_required = true;
+		nic_data->xmac_poll_required = true;
 		return true;
 	}
 
diff --git a/drivers/net/sfc/falcon_boards.c b/drivers/net/sfc/falcon_boards.c
index a6fc5ce..2dd16f0 100644
--- a/drivers/net/sfc/falcon_boards.c
+++ b/drivers/net/sfc/falcon_boards.c
@@ -415,10 +415,11 @@ static void sfe4001_fini(struct efx_nic *efx)
 
 static int sfe4001_check_hw(struct efx_nic *efx)
 {
+	struct falcon_nic_data *nic_data = efx->nic_data;
 	s32 status;
 
 	/* If XAUI link is up then do not monitor */
-	if (EFX_WORKAROUND_7884(efx) && !efx->xmac_poll_required)
+	if (EFX_WORKAROUND_7884(efx) && !nic_data->xmac_poll_required)
 		return 0;
 
 	/* Check the powered status of the PHY. Lack of power implies that
diff --git a/drivers/net/sfc/falcon_xmac.c b/drivers/net/sfc/falcon_xmac.c
index e293e25..b49e843 100644
--- a/drivers/net/sfc/falcon_xmac.c
+++ b/drivers/net/sfc/falcon_xmac.c
@@ -87,6 +87,7 @@ int falcon_reset_xaui(struct efx_nic *efx)
 
 static void falcon_ack_status_intr(struct efx_nic *efx)
 {
+	struct falcon_nic_data *nic_data = efx->nic_data;
 	efx_oword_t reg;
 
 	if ((efx_nic_rev(efx) != EFX_REV_FALCON_B0) || LOOPBACK_INTERNAL(efx))
@@ -98,7 +99,7 @@ static void falcon_ack_status_intr(struct efx_nic *efx)
 
 	/* We can only use this interrupt to signal the negative edge of
 	 * xaui_align [we have to poll the positive edge]. */
-	if (efx->xmac_poll_required)
+	if (nic_data->xmac_poll_required)
 		return;
 
 	efx_reado(efx, &reg, FR_AB_XM_MGT_INT_MSK);
@@ -276,12 +277,14 @@ static bool falcon_xmac_check_fault(struct efx_nic *efx)
 
 static int falcon_reconfigure_xmac(struct efx_nic *efx)
 {
+	struct falcon_nic_data *nic_data = efx->nic_data;
+
 	falcon_reconfigure_xgxs_core(efx);
 	falcon_reconfigure_xmac_core(efx);
 
 	falcon_reconfigure_mac_wrapper(efx);
 
-	efx->xmac_poll_required = !falcon_xmac_link_ok_retry(efx, 5);
+	nic_data->xmac_poll_required = !falcon_xmac_link_ok_retry(efx, 5);
 	falcon_ack_status_intr(efx);
 
 	return 0;
@@ -349,11 +352,13 @@ static void falcon_update_stats_xmac(struct efx_nic *efx)
 
 void falcon_poll_xmac(struct efx_nic *efx)
 {
+	struct falcon_nic_data *nic_data = efx->nic_data;
+
 	if (!EFX_WORKAROUND_5147(efx) || !efx->link_state.up ||
-	    !efx->xmac_poll_required)
+	    !nic_data->xmac_poll_required)
 		return;
 
-	efx->xmac_poll_required = !falcon_xmac_link_ok_retry(efx, 1);
+	nic_data->xmac_poll_required = !falcon_xmac_link_ok_retry(efx, 1);
 	falcon_ack_status_intr(efx);
 }
 
diff --git a/drivers/net/sfc/net_driver.h b/drivers/net/sfc/net_driver.h
index f9d53a0..b7e8fe9 100644
--- a/drivers/net/sfc/net_driver.h
+++ b/drivers/net/sfc/net_driver.h
@@ -684,7 +684,6 @@ struct efx_filter_state;
  * @mdio: PHY MDIO interface
  * @mdio_bus: PHY MDIO bus ID (only used by Siena)
  * @phy_mode: PHY operating mode. Serialised by @mac_lock.
- * @xmac_poll_required: XMAC link state needs polling
  * @link_advertising: Autonegotiation advertising flags
  * @link_state: Current state of the link
  * @n_link_state_changes: Number of times the link has changed state
@@ -771,7 +770,6 @@ struct efx_nic {
 	unsigned int mdio_bus;
 	enum efx_phy_mode phy_mode;
 
-	bool xmac_poll_required;
 	u32 link_advertising;
 	struct efx_link_state link_state;
 	unsigned int n_link_state_changes;
diff --git a/drivers/net/sfc/nic.h b/drivers/net/sfc/nic.h
index 980cf4b..f107dc7 100644
--- a/drivers/net/sfc/nic.h
+++ b/drivers/net/sfc/nic.h
@@ -118,6 +118,7 @@ struct falcon_board {
  * @spi_eeprom: SPI EEPROM device
  * @spi_lock: SPI bus lock
  * @mdio_lock: MDIO bus lock
+ * @xmac_poll_required: XMAC link state needs polling
  */
 struct falcon_nic_data {
 	struct pci_dev *pci_dev2;
@@ -130,6 +131,7 @@ struct falcon_nic_data {
 	struct efx_spi_device spi_eeprom;
 	struct mutex spi_lock;
 	struct mutex mdio_lock;
+	bool xmac_poll_required;
 };
 
 static inline struct falcon_board *falcon_board(struct efx_nic *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 12/17] sfc: Move Falcon global event handling to falcon.c
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/falcon.c     |   36 +++++++++++++++++++++++++++++++
 drivers/net/sfc/net_driver.h |    2 +
 drivers/net/sfc/nic.c        |   48 ++++-------------------------------------
 3 files changed, 43 insertions(+), 43 deletions(-)

diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c
index af62899..fd5bf0b 100644
--- a/drivers/net/sfc/falcon.c
+++ b/drivers/net/sfc/falcon.c
@@ -881,6 +881,40 @@ static void falcon_remove_port(struct efx_nic *efx)
 	efx_nic_free_buffer(efx, &efx->stats_buffer);
 }
 
+/* Global events are basically PHY events */
+static bool
+falcon_handle_global_event(struct efx_channel *channel, efx_qword_t *event)
+{
+	struct efx_nic *efx = channel->efx;
+
+	if (EFX_QWORD_FIELD(*event, FSF_AB_GLB_EV_G_PHY0_INTR) ||
+	    EFX_QWORD_FIELD(*event, FSF_AB_GLB_EV_XG_PHY0_INTR) ||
+	    EFX_QWORD_FIELD(*event, FSF_AB_GLB_EV_XFP_PHY0_INTR))
+		/* Ignored */
+		return true;
+
+	if ((efx_nic_rev(efx) == EFX_REV_FALCON_B0) &&
+	    EFX_QWORD_FIELD(*event, FSF_BB_GLB_EV_XG_MGT_INTR)) {
+		efx->xmac_poll_required = true;
+		return true;
+	}
+
+	if (efx_nic_rev(efx) <= EFX_REV_FALCON_A1 ?
+	    EFX_QWORD_FIELD(*event, FSF_AA_GLB_EV_RX_RECOVERY) :
+	    EFX_QWORD_FIELD(*event, FSF_BB_GLB_EV_RX_RECOVERY)) {
+		netif_err(efx, rx_err, efx->net_dev,
+			  "channel %d seen global RX_RESET event. Resetting.\n",
+			  channel->channel);
+
+		atomic_inc(&efx->rx_reset);
+		efx_schedule_reset(efx, EFX_WORKAROUND_6555(efx) ?
+				   RESET_TYPE_RX_RECOVERY : RESET_TYPE_DISABLE);
+		return true;
+	}
+
+	return false;
+}
+
 /**************************************************************************
  *
  * Falcon test code
@@ -1702,6 +1736,7 @@ struct efx_nic_type falcon_a1_nic_type = {
 	.reset = falcon_reset_hw,
 	.probe_port = falcon_probe_port,
 	.remove_port = falcon_remove_port,
+	.handle_global_event = falcon_handle_global_event,
 	.prepare_flush = falcon_prepare_flush,
 	.update_stats = falcon_update_nic_stats,
 	.start_stats = falcon_start_nic_stats,
@@ -1742,6 +1777,7 @@ struct efx_nic_type falcon_b0_nic_type = {
 	.reset = falcon_reset_hw,
 	.probe_port = falcon_probe_port,
 	.remove_port = falcon_remove_port,
+	.handle_global_event = falcon_handle_global_event,
 	.prepare_flush = falcon_prepare_flush,
 	.update_stats = falcon_update_nic_stats,
 	.start_stats = falcon_start_nic_stats,
diff --git a/drivers/net/sfc/net_driver.h b/drivers/net/sfc/net_driver.h
index 2ffc920..f9d53a0 100644
--- a/drivers/net/sfc/net_driver.h
+++ b/drivers/net/sfc/net_driver.h
@@ -819,6 +819,7 @@ static inline unsigned int efx_port_num(struct efx_nic *efx)
  *	be called while the controller is uninitialised.
  * @probe_port: Probe the MAC and PHY
  * @remove_port: Free resources allocated by probe_port()
+ * @handle_global_event: Handle a "global" event (may be %NULL)
  * @prepare_flush: Prepare the hardware for flushing the DMA queues
  * @update_stats: Update statistics not provided by event handling
  * @start_stats: Start the regular fetching of statistics
@@ -863,6 +864,7 @@ struct efx_nic_type {
 	int (*reset)(struct efx_nic *efx, enum reset_type method);
 	int (*probe_port)(struct efx_nic *efx);
 	void (*remove_port)(struct efx_nic *efx);
+	bool (*handle_global_event)(struct efx_channel *channel, efx_qword_t *);
 	void (*prepare_flush)(struct efx_nic *efx);
 	void (*update_stats)(struct efx_nic *efx);
 	void (*start_stats)(struct efx_nic *efx);
diff --git a/drivers/net/sfc/nic.c b/drivers/net/sfc/nic.c
index 41c36b9..9743cff 100644
--- a/drivers/net/sfc/nic.c
+++ b/drivers/net/sfc/nic.c
@@ -894,46 +894,6 @@ efx_handle_generated_event(struct efx_channel *channel, efx_qword_t *event)
 			  channel->channel, EFX_QWORD_VAL(*event));
 }
 
-/* Global events are basically PHY events */
-static void
-efx_handle_global_event(struct efx_channel *channel, efx_qword_t *event)
-{
-	struct efx_nic *efx = channel->efx;
-	bool handled = false;
-
-	if (EFX_QWORD_FIELD(*event, FSF_AB_GLB_EV_G_PHY0_INTR) ||
-	    EFX_QWORD_FIELD(*event, FSF_AB_GLB_EV_XG_PHY0_INTR) ||
-	    EFX_QWORD_FIELD(*event, FSF_AB_GLB_EV_XFP_PHY0_INTR)) {
-		/* Ignored */
-		handled = true;
-	}
-
-	if ((efx_nic_rev(efx) >= EFX_REV_FALCON_B0) &&
-	    EFX_QWORD_FIELD(*event, FSF_BB_GLB_EV_XG_MGT_INTR)) {
-		efx->xmac_poll_required = true;
-		handled = true;
-	}
-
-	if (efx_nic_rev(efx) <= EFX_REV_FALCON_A1 ?
-	    EFX_QWORD_FIELD(*event, FSF_AA_GLB_EV_RX_RECOVERY) :
-	    EFX_QWORD_FIELD(*event, FSF_BB_GLB_EV_RX_RECOVERY)) {
-		netif_err(efx, rx_err, efx->net_dev,
-			  "channel %d seen global RX_RESET event. Resetting.\n",
-			  channel->channel);
-
-		atomic_inc(&efx->rx_reset);
-		efx_schedule_reset(efx, EFX_WORKAROUND_6555(efx) ?
-				   RESET_TYPE_RX_RECOVERY : RESET_TYPE_DISABLE);
-		handled = true;
-	}
-
-	if (!handled)
-		netif_err(efx, hw, efx->net_dev,
-			  "channel %d unknown global event "
-			  EFX_QWORD_FMT "\n", channel->channel,
-			  EFX_QWORD_VAL(*event));
-}
-
 static void
 efx_handle_driver_event(struct efx_channel *channel, efx_qword_t *event)
 {
@@ -1050,15 +1010,17 @@ int efx_nic_process_eventq(struct efx_channel *channel, int budget)
 		case FSE_AZ_EV_CODE_DRV_GEN_EV:
 			efx_handle_generated_event(channel, &event);
 			break;
-		case FSE_AZ_EV_CODE_GLOBAL_EV:
-			efx_handle_global_event(channel, &event);
-			break;
 		case FSE_AZ_EV_CODE_DRIVER_EV:
 			efx_handle_driver_event(channel, &event);
 			break;
 		case FSE_CZ_EV_CODE_MCDI_EV:
 			efx_mcdi_process_event(channel, &event);
 			break;
+		case FSE_AZ_EV_CODE_GLOBAL_EV:
+			if (efx->type->handle_global_event &&
+			    efx->type->handle_global_event(channel, &event))
+				break;
+			/* else fall through */
 		default:
 			netif_err(channel->efx, hw, channel->efx->net_dev,
 				  "channel %d unknown event type %d (data "
-- 
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 11/17] sfc: Move mdio_lock 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 MDIO on Falcon, so move this out of
struct efx_nic.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 drivers/net/sfc/efx.c        |    1 -
 drivers/net/sfc/falcon.c     |   11 +++++++----
 drivers/net/sfc/net_driver.h |    2 --
 drivers/net/sfc/nic.h        |    2 ++
 4 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c
index 6aed6ac..7e820d9 100644
--- a/drivers/net/sfc/efx.c
+++ b/drivers/net/sfc/efx.c
@@ -2198,7 +2198,6 @@ static int efx_init_struct(struct efx_nic *efx, struct efx_nic_type *type,
 	/* Initialise common structures */
 	memset(efx, 0, sizeof(*efx));
 	spin_lock_init(&efx->biu_lock);
-	mutex_init(&efx->mdio_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 ca59f7e..af62899 100644
--- a/drivers/net/sfc/falcon.c
+++ b/drivers/net/sfc/falcon.c
@@ -717,6 +717,7 @@ static int falcon_mdio_write(struct net_device *net_dev,
 			     int prtad, int devad, u16 addr, u16 value)
 {
 	struct efx_nic *efx = netdev_priv(net_dev);
+	struct falcon_nic_data *nic_data = efx->nic_data;
 	efx_oword_t reg;
 	int rc;
 
@@ -724,7 +725,7 @@ static int falcon_mdio_write(struct net_device *net_dev,
 		   "writing MDIO %d register %d.%d with 0x%04x\n",
 		    prtad, devad, addr, value);
 
-	mutex_lock(&efx->mdio_lock);
+	mutex_lock(&nic_data->mdio_lock);
 
 	/* Check MDIO not currently being accessed */
 	rc = falcon_gmii_wait(efx);
@@ -760,7 +761,7 @@ static int falcon_mdio_write(struct net_device *net_dev,
 	}
 
 out:
-	mutex_unlock(&efx->mdio_lock);
+	mutex_unlock(&nic_data->mdio_lock);
 	return rc;
 }
 
@@ -769,10 +770,11 @@ static int falcon_mdio_read(struct net_device *net_dev,
 			    int prtad, int devad, u16 addr)
 {
 	struct efx_nic *efx = netdev_priv(net_dev);
+	struct falcon_nic_data *nic_data = efx->nic_data;
 	efx_oword_t reg;
 	int rc;
 
-	mutex_lock(&efx->mdio_lock);
+	mutex_lock(&nic_data->mdio_lock);
 
 	/* Check MDIO not currently being accessed */
 	rc = falcon_gmii_wait(efx);
@@ -811,7 +813,7 @@ static int falcon_mdio_read(struct net_device *net_dev,
 	}
 
 out:
-	mutex_unlock(&efx->mdio_lock);
+	mutex_unlock(&nic_data->mdio_lock);
 	return rc;
 }
 
@@ -839,6 +841,7 @@ static int falcon_probe_port(struct efx_nic *efx)
 	}
 
 	/* Fill out MDIO structure and loopback modes */
+	mutex_init(&nic_data->mdio_lock);
 	efx->mdio.mdio_read = falcon_mdio_read;
 	efx->mdio.mdio_write = falcon_mdio_write;
 	rc = efx->phy_op->probe(efx);
diff --git a/drivers/net/sfc/net_driver.h b/drivers/net/sfc/net_driver.h
index e5ee2d5..2ffc920 100644
--- a/drivers/net/sfc/net_driver.h
+++ b/drivers/net/sfc/net_driver.h
@@ -679,7 +679,6 @@ struct efx_filter_state;
  * @mac_op: MAC interface
  * @mac_address: Permanent MAC address
  * @phy_type: PHY type
- * @mdio_lock: MDIO lock
  * @phy_op: PHY interface
  * @phy_data: PHY private data (including PHY-specific stats)
  * @mdio: PHY MDIO interface
@@ -766,7 +765,6 @@ struct efx_nic {
 	unsigned char mac_address[ETH_ALEN];
 
 	unsigned int phy_type;
-	struct mutex mdio_lock;
 	struct efx_phy_operations *phy_op;
 	void *phy_data;
 	struct mdio_if_info mdio;
diff --git a/drivers/net/sfc/nic.h b/drivers/net/sfc/nic.h
index 2a0fff3..980cf4b 100644
--- a/drivers/net/sfc/nic.h
+++ b/drivers/net/sfc/nic.h
@@ -117,6 +117,7 @@ struct falcon_board {
  * @spi_flash: SPI flash device
  * @spi_eeprom: SPI EEPROM device
  * @spi_lock: SPI bus lock
+ * @mdio_lock: MDIO bus lock
  */
 struct falcon_nic_data {
 	struct pci_dev *pci_dev2;
@@ -128,6 +129,7 @@ struct falcon_nic_data {
 	struct efx_spi_device spi_flash;
 	struct efx_spi_device spi_eeprom;
 	struct mutex spi_lock;
+	struct mutex mdio_lock;
 };
 
 static inline struct falcon_board *falcon_board(struct efx_nic *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 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


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