All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] wlcore/wl12xx: add suppoprt for HP and SKW FEM radio manufacturers
@ 2012-06-13 14:14 Yair Shapira
  2012-06-13 14:14 ` [PATCH 1/2] " Yair Shapira
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Yair Shapira @ 2012-06-13 14:14 UTC (permalink / raw)
  To: linux-wireless, coelho; +Cc: yair.shapira

Add support for HP(High Performance TQS fem type 3) and SKW (fem type 2)
in radio params. BIP Calibration (PLT mode) of new radio types is supported
In addition new log added to display BIP calibration radio_status

Yair Shapira (2):
  wlcore/wl12xx: add suppoprt for HP and SKW FEM radio manufacturers
  wlcore: add print logs of radio_status in case of BIP calibration

 drivers/net/wireless/ti/wl12xx/cmd.c      |   16 ++++++++++------
 drivers/net/wireless/ti/wlcore/cmd.h      |   21 +++++++++++++++++++++
 drivers/net/wireless/ti/wlcore/ini.h      |   22 +++++++++++++++++-----
 drivers/net/wireless/ti/wlcore/testmode.c |   14 ++++++++++++++
 4 files changed, 62 insertions(+), 11 deletions(-)
 mode change 100644 => 100755 drivers/net/wireless/ti/wl12xx/cmd.c
 mode change 100644 => 100755 drivers/net/wireless/ti/wlcore/cmd.h
 mode change 100644 => 100755 drivers/net/wireless/ti/wlcore/ini.h
 mode change 100644 => 100755 drivers/net/wireless/ti/wlcore/testmode.c

-- 
1.7.9.5


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] wlcore/wl12xx: add suppoprt for HP and SKW FEM radio manufacturers
  2012-06-13 14:14 [PATCH 0/2] wlcore/wl12xx: add suppoprt for HP and SKW FEM radio manufacturers Yair Shapira
@ 2012-06-13 14:14 ` Yair Shapira
  2012-06-13 14:14 ` [PATCH 2/2] wlcore: add print logs of radio_status in case of BIP calibration Yair Shapira
  2012-06-13 19:05 ` [PATCH 0/2] wlcore/wl12xx: add suppoprt for HP and SKW FEM radio manufacturers Luciano Coelho
  2 siblings, 0 replies; 4+ messages in thread
From: Yair Shapira @ 2012-06-13 14:14 UTC (permalink / raw)
  To: linux-wireless, coelho; +Cc: yair.shapira

Add support for HP(High Performance TQS fem type 3) and SKW
(fem type 2). This is done by increasing the number of FEM
manufacturers to 4

Usually FEM parameters from ini file are read from nvs file and
passed to firmware using TEST_CMD_INI_FILE_RADIO_PARAM. Still,
because the nvs file has only place for 2 FEMs, we need to pass the
new FEM types information in one of the available entries

This is done by mapping new fem types 2,3 to entry 0. This solution
works for manual FEM selection. AutoDetect-FEM still support only
fem types 0 and 1

Signed-off-by: Yair Shapira <yair.shapira@ti.com>
---
 drivers/net/wireless/ti/wl12xx/cmd.c |   16 ++++++++++------
 drivers/net/wireless/ti/wlcore/ini.h |   22 +++++++++++++++++-----
 2 files changed, 27 insertions(+), 11 deletions(-)
 mode change 100644 => 100755 drivers/net/wireless/ti/wl12xx/cmd.c
 mode change 100644 => 100755 drivers/net/wireless/ti/wlcore/ini.h

diff --git a/drivers/net/wireless/ti/wl12xx/cmd.c b/drivers/net/wireless/ti/wl12xx/cmd.c
old mode 100644
new mode 100755
index 50ba748..30be784
--- a/drivers/net/wireless/ti/wl12xx/cmd.c
+++ b/drivers/net/wireless/ti/wl12xx/cmd.c
@@ -174,7 +174,7 @@ int wl1271_cmd_radio_parms(struct wl1271 *wl)
 	struct wl1271_nvs_file *nvs = (struct wl1271_nvs_file *)wl->nvs;
 	struct wl1271_radio_parms_cmd *radio_parms;
 	struct wl1271_ini_general_params *gp = &nvs->general_params;
-	int ret;
+	int ret, fem_idx;
 
 	if (!wl->nvs)
 		return -ENODEV;
@@ -185,11 +185,13 @@ int wl1271_cmd_radio_parms(struct wl1271 *wl)
 
 	radio_parms->test.id = TEST_CMD_INI_FILE_RADIO_PARAM;
 
+	fem_idx = WL12XX_FEM_TO_NVS_ENTRY(gp->tx_bip_fem_manufacturer);
+
 	/* 2.4GHz parameters */
 	memcpy(&radio_parms->static_params_2, &nvs->stat_radio_params_2,
 	       sizeof(struct wl1271_ini_band_params_2));
 	memcpy(&radio_parms->dyn_params_2,
-	       &nvs->dyn_radio_params_2[gp->tx_bip_fem_manufacturer].params,
+	       &nvs->dyn_radio_params_2[fem_idx].params,
 	       sizeof(struct wl1271_ini_fem_params_2));
 
 	/* 5GHz parameters */
@@ -197,7 +199,7 @@ int wl1271_cmd_radio_parms(struct wl1271 *wl)
 	       &nvs->stat_radio_params_5,
 	       sizeof(struct wl1271_ini_band_params_5));
 	memcpy(&radio_parms->dyn_params_5,
-	       &nvs->dyn_radio_params_5[gp->tx_bip_fem_manufacturer].params,
+	       &nvs->dyn_radio_params_5[fem_idx].params,
 	       sizeof(struct wl1271_ini_fem_params_5));
 
 	wl1271_dump(DEBUG_CMD, "TEST_CMD_INI_FILE_RADIO_PARAM: ",
@@ -216,7 +218,7 @@ int wl128x_cmd_radio_parms(struct wl1271 *wl)
 	struct wl128x_nvs_file *nvs = (struct wl128x_nvs_file *)wl->nvs;
 	struct wl128x_radio_parms_cmd *radio_parms;
 	struct wl128x_ini_general_params *gp = &nvs->general_params;
-	int ret;
+	int ret, fem_idx;
 
 	if (!wl->nvs)
 		return -ENODEV;
@@ -227,11 +229,13 @@ int wl128x_cmd_radio_parms(struct wl1271 *wl)
 
 	radio_parms->test.id = TEST_CMD_INI_FILE_RADIO_PARAM;
 
+	fem_idx = WL12XX_FEM_TO_NVS_ENTRY(gp->tx_bip_fem_manufacturer);
+
 	/* 2.4GHz parameters */
 	memcpy(&radio_parms->static_params_2, &nvs->stat_radio_params_2,
 	       sizeof(struct wl128x_ini_band_params_2));
 	memcpy(&radio_parms->dyn_params_2,
-	       &nvs->dyn_radio_params_2[gp->tx_bip_fem_manufacturer].params,
+	       &nvs->dyn_radio_params_2[fem_idx].params,
 	       sizeof(struct wl128x_ini_fem_params_2));
 
 	/* 5GHz parameters */
@@ -239,7 +243,7 @@ int wl128x_cmd_radio_parms(struct wl1271 *wl)
 	       &nvs->stat_radio_params_5,
 	       sizeof(struct wl128x_ini_band_params_5));
 	memcpy(&radio_parms->dyn_params_5,
-	       &nvs->dyn_radio_params_5[gp->tx_bip_fem_manufacturer].params,
+	       &nvs->dyn_radio_params_5[fem_idx].params,
 	       sizeof(struct wl128x_ini_fem_params_5));
 
 	radio_parms->fem_vendor_and_options = nvs->fem_vendor_and_options;
diff --git a/drivers/net/wireless/ti/wlcore/ini.h b/drivers/net/wireless/ti/wlcore/ini.h
old mode 100644
new mode 100755
index 4cf9ecc..d24fe3b
--- a/drivers/net/wireless/ti/wlcore/ini.h
+++ b/drivers/net/wireless/ti/wlcore/ini.h
@@ -172,7 +172,19 @@ struct wl128x_ini_fem_params_5 {
 
 /* NVS data structure */
 #define WL1271_INI_NVS_SECTION_SIZE		     468
-#define WL1271_INI_FEM_MODULE_COUNT                  2
+
+/* We have four FEM module types: 0-RFMD, 1-TQS, 2-SKW, 3-TQS_HP */
+#define WL1271_INI_FEM_MODULE_COUNT                  4
+
+/*
+ * In NVS we only store two FEM module entries -
+ *	  FEM modules 0,2,3 are stored in entry 0
+ *	  FEM module 1 is stored in entry 1
+ */
+#define WL12XX_NVS_FEM_MODULE_COUNT                  2
+
+#define WL12XX_FEM_TO_NVS_ENTRY(ini_fem_module)      \
+	((ini_fem_module) == 1 ? 1 : 0)
 
 #define WL1271_INI_LEGACY_NVS_FILE_SIZE              800
 
@@ -188,13 +200,13 @@ struct wl1271_nvs_file {
 	struct {
 		struct wl1271_ini_fem_params_2 params;
 		u8 padding;
-	} dyn_radio_params_2[WL1271_INI_FEM_MODULE_COUNT];
+	} dyn_radio_params_2[WL12XX_NVS_FEM_MODULE_COUNT];
 	struct wl1271_ini_band_params_5 stat_radio_params_5;
 	u8 padding3;
 	struct {
 		struct wl1271_ini_fem_params_5 params;
 		u8 padding;
-	} dyn_radio_params_5[WL1271_INI_FEM_MODULE_COUNT];
+	} dyn_radio_params_5[WL12XX_NVS_FEM_MODULE_COUNT];
 } __packed;
 
 struct wl128x_nvs_file {
@@ -209,12 +221,12 @@ struct wl128x_nvs_file {
 	struct {
 		struct wl128x_ini_fem_params_2 params;
 		u8 padding;
-	} dyn_radio_params_2[WL1271_INI_FEM_MODULE_COUNT];
+	} dyn_radio_params_2[WL12XX_NVS_FEM_MODULE_COUNT];
 	struct wl128x_ini_band_params_5 stat_radio_params_5;
 	u8 padding3;
 	struct {
 		struct wl128x_ini_fem_params_5 params;
 		u8 padding;
-	} dyn_radio_params_5[WL1271_INI_FEM_MODULE_COUNT];
+	} dyn_radio_params_5[WL12XX_NVS_FEM_MODULE_COUNT];
 } __packed;
 #endif
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] wlcore: add print logs of radio_status in case of BIP calibration
  2012-06-13 14:14 [PATCH 0/2] wlcore/wl12xx: add suppoprt for HP and SKW FEM radio manufacturers Yair Shapira
  2012-06-13 14:14 ` [PATCH 1/2] " Yair Shapira
@ 2012-06-13 14:14 ` Yair Shapira
  2012-06-13 19:05 ` [PATCH 0/2] wlcore/wl12xx: add suppoprt for HP and SKW FEM radio manufacturers Luciano Coelho
  2 siblings, 0 replies; 4+ messages in thread
From: Yair Shapira @ 2012-06-13 14:14 UTC (permalink / raw)
  To: linux-wireless, coelho; +Cc: yair.shapira

FEM BIP calibration may fail with fw/phy radio status. In order to
recognize these failures a log is added to the calibration answer
(TEST_CMD_P2G_CAL)

Signed-off-by: Yair Shapira <yair.shapira@ti.com>
---
 drivers/net/wireless/ti/wlcore/cmd.h      |   21 +++++++++++++++++++++
 drivers/net/wireless/ti/wlcore/testmode.c |   14 ++++++++++++++
 2 files changed, 35 insertions(+)
 mode change 100644 => 100755 drivers/net/wireless/ti/wlcore/cmd.h
 mode change 100644 => 100755 drivers/net/wireless/ti/wlcore/testmode.c

diff --git a/drivers/net/wireless/ti/wlcore/cmd.h b/drivers/net/wireless/ti/wlcore/cmd.h
old mode 100644
new mode 100755
index 85171f2..b94cc37
--- a/drivers/net/wireless/ti/wlcore/cmd.h
+++ b/drivers/net/wireless/ti/wlcore/cmd.h
@@ -652,4 +652,25 @@ struct wl12xx_cmd_stop_channel_switch {
 	struct wl1271_cmd_header header;
 } __packed;
 
+/* Used to check radio status after calibration */
+#define MAX_TLV_LENGTH  	500
+#define TEST_CMD_P2G_CAL	2	/* TX BiP */
+
+struct wl1271_cmd_cal_p2g {
+	struct wl1271_cmd_header header;
+
+	struct wl1271_cmd_test_header test;
+
+	__le32 ver;
+	__le16 len;
+	u8 buf[MAX_TLV_LENGTH];
+	u8 type;
+	u8 padding;
+
+	__le16 radio_status;
+
+	u8 sub_band_mask;
+	u8 padding2;
+} __packed;
+
 #endif /* __WL1271_CMD_H__ */
diff --git a/drivers/net/wireless/ti/wlcore/testmode.c b/drivers/net/wireless/ti/wlcore/testmode.c
old mode 100644
new mode 100755
index 0e59ea2..2a53284
--- a/drivers/net/wireless/ti/wlcore/testmode.c
+++ b/drivers/net/wireless/ti/wlcore/testmode.c
@@ -108,6 +108,20 @@ static int wl1271_tm_cmd_test(struct wl1271 *wl, struct nlattr *tb[])
 	}
 
 	if (answer) {
+		/* If we got bip calibration answer print radio status */
+		struct wl1271_cmd_cal_p2g* params =
+			(struct wl1271_cmd_cal_p2g*) buf;
+
+		s16 radio_status = (s16) le16_to_cpu(params->radio_status);
+
+		if (params->test.id == TEST_CMD_P2G_CAL &&
+		    radio_status < 0)
+			wl1271_warning("testmode cmd: radio status=%d",
+					radio_status);
+		else
+			wl1271_info("testmode cmd: radio status=%d",
+					radio_status);
+
 		len = nla_total_size(buf_len);
 		skb = cfg80211_testmode_alloc_reply_skb(wl->hw->wiphy, len);
 		if (!skb) {
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] wlcore/wl12xx: add suppoprt for HP and SKW FEM radio manufacturers
  2012-06-13 14:14 [PATCH 0/2] wlcore/wl12xx: add suppoprt for HP and SKW FEM radio manufacturers Yair Shapira
  2012-06-13 14:14 ` [PATCH 1/2] " Yair Shapira
  2012-06-13 14:14 ` [PATCH 2/2] wlcore: add print logs of radio_status in case of BIP calibration Yair Shapira
@ 2012-06-13 19:05 ` Luciano Coelho
  2 siblings, 0 replies; 4+ messages in thread
From: Luciano Coelho @ 2012-06-13 19:05 UTC (permalink / raw)
  To: Yair Shapira; +Cc: linux-wireless

On Wed, 2012-06-13 at 17:14 +0300, Yair Shapira wrote:
> Add support for HP(High Performance TQS fem type 3) and SKW (fem type 2)
> in radio params. BIP Calibration (PLT mode) of new radio types is supported
> In addition new log added to display BIP calibration radio_status
> 
> Yair Shapira (2):
>   wlcore/wl12xx: add suppoprt for HP and SKW FEM radio manufacturers
>   wlcore: add print logs of radio_status in case of BIP calibration
> 
>  drivers/net/wireless/ti/wl12xx/cmd.c      |   16 ++++++++++------
>  drivers/net/wireless/ti/wlcore/cmd.h      |   21 +++++++++++++++++++++
>  drivers/net/wireless/ti/wlcore/ini.h      |   22 +++++++++++++++++-----
>  drivers/net/wireless/ti/wlcore/testmode.c |   14 ++++++++++++++
>  4 files changed, 62 insertions(+), 11 deletions(-)
>  mode change 100644 => 100755 drivers/net/wireless/ti/wl12xx/cmd.c
>  mode change 100644 => 100755 drivers/net/wireless/ti/wlcore/cmd.h
>  mode change 100644 => 100755 drivers/net/wireless/ti/wlcore/ini.h
>  mode change 100644 => 100755 drivers/net/wireless/ti/wlcore/testmode.c

Applied and pushed, fixing some checkpatch bugs, including these
accidental file mode changes.

Thanks Yair!

--
Luca.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-06-13 19:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-13 14:14 [PATCH 0/2] wlcore/wl12xx: add suppoprt for HP and SKW FEM radio manufacturers Yair Shapira
2012-06-13 14:14 ` [PATCH 1/2] " Yair Shapira
2012-06-13 14:14 ` [PATCH 2/2] wlcore: add print logs of radio_status in case of BIP calibration Yair Shapira
2012-06-13 19:05 ` [PATCH 0/2] wlcore/wl12xx: add suppoprt for HP and SKW FEM radio manufacturers Luciano Coelho

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.