[ath9k-devel] Atheros [168c 0034] can't enable wireless button LED.

2012-06-19 Thread Matt Chen
Hi experts,

I tested the latest kernel v3.5-rc3 ath9k for the Atheros [168c 0034],
code name is Miami. I found no matter how I press the wifi button to
enable/disable the wifi, it doesn't work to me.
Even I found the rfkill status for this interface is not changing.

-- 
Thank you.
___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel


Re: [ath9k-devel] Atheros [168c 0034] can't enable wireless button LED.

2012-06-19 Thread Mohammed Shafi
Hi Matt,

 I tested the latest kernel v3.5-rc3 ath9k for the Atheros [168c 0034],
 code name is Miami. I found no matter how I press the wifi button to
 enable/disable the wifi, it doesn't work to me.
 Even I found the rfkill status for this interface is not changing.

its a AR9462please poke at the register  #define AR_GPIO_IN  - 0x402c : 0x404c)
i remember testing it in a acer laptop, it was working.


 --
 Thank you.
 --
 To unsubscribe from this list: send the line unsubscribe linux-wireless in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
thanks,
shafi
___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel


[ath9k-devel] ath9k-devel Digest, Vol 49, Issue 0

2012-06-19 Thread Nabajyoti Bera
How can use aircrack-ng f0r WEP in windows 7 32 bit

-Original Message-
From: ath9k-devel-requ...@lists.ath9k.org
Sent: 19 June 2012 03:30 PM
To: ath9k-devel@lists.ath9k.org
Subject: ath9k-devel Digest, Vol 48, Issue 29

Send ath9k-devel mailing list submissions to
ath9k-devel@lists.ath9k.org

To subscribe or unsubscribe via the World Wide Web, visit
https://lists.ath9k.org/mailman/listinfo/ath9k-devel
or, via email, send a message with subject or body 'help' to
ath9k-devel-requ...@lists.ath9k.org

You can reach the person managing the list at
ath9k-devel-ow...@lists.ath9k.org

When replying, please edit your Subject line so it is more specific
than Re: Contents of ath9k-devel digest...


Today's Topics:

   1. Atheros [168c 0034] can't enable wireless button LED. (Matt Chen)
   2. Re: Atheros [168c 0034] can't enable wireless button  LED.
  (Mohammed Shafi)


--

Message: 1
Date: Tue, 19 Jun 2012 16:06:40 +0800


[The entire original message is not included]
___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel


[ath9k-devel] [PATCH 00/10] Add support for WOW in ath9k

2012-06-19 Thread Mohammed Shafi Shajakhan
From: Mohammed Shafi Shajakhan moham...@qca.qualcomm.com

Add support for hardware WoW in ath9k. Magic-packet,
beacon loss triggers, deauth/disassoc patterns
(a special case of user pattern) are tested with 
AR9485, AR9280. User pattern needs a bit of
investigation on parsing to appropriate 802.11 format.
we will do more rigorous testing and address bugs.

Thanks a lot to Vadivel for providing me the hardware and
inputs to test. Thanks to Rajkumar, Russell, Russell for
their invaluable help. Thanks to Aeolous, Senthil and
Sujith, Raja. Thanks a lot to Luis for providing the complete
frame work for WoW in his initial wow patches.

Mohammed Shafi Shajakhan (10):
  ath9k_hw: Add register definitions for WoW support
  ath9k: Add definitions and structures to support WoW
  ath9k_hw: Add WoW hardware capability flags
  ath9k_hw: advertise WoW support for capable chipsets
  ath9k: advertise supported WoW flags to upper layer
  ath9k_hw: INI changes for WoW for AR9002 chipsets
  ath9k_hw: Add hardware code for WoW
  ath: Add Wake-on-Wireless debug mask
  ath9k: Add WoW related mac80211 callbacks
  ath9k: do not disable hardware while wow is enabled

 drivers/net/wireless/ath/ath.h   |2 +
 drivers/net/wireless/ath/ath9k/Makefile  |1 +
 drivers/net/wireless/ath/ath9k/ar9002_hw.c   |5 +
 drivers/net/wireless/ath/ath9k/ar9002_initvals.h |   14 +
 drivers/net/wireless/ath/ath9k/ath9k.h   |   29 ++
 drivers/net/wireless/ath/ath9k/hw.c  |8 +
 drivers/net/wireless/ath/ath9k/hw.h  |   75 +++
 drivers/net/wireless/ath/ath9k/init.c|   21 +-
 drivers/net/wireless/ath/ath9k/main.c|  376 ++-
 drivers/net/wireless/ath/ath9k/pci.c |6 +
 drivers/net/wireless/ath/ath9k/reg.h |  145 ++-
 drivers/net/wireless/ath/ath9k/wow.c |  559 ++
 12 files changed, 1229 insertions(+), 12 deletions(-)
 create mode 100644 drivers/net/wireless/ath/ath9k/wow.c

___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel


[ath9k-devel] [PATCH 01/10] ath9k_hw: Add register definitions for WoW support

2012-06-19 Thread Mohammed Shafi Shajakhan
From: Mohammed Shafi Shajakhan moham...@qca.qualcomm.com

*MAC WoW registers

back-off shift, MAC interrupt enable, magic packet enable,
pattern match enable, aifs, slot wait period, keep alive
frame failure count, beacon fail enable, beacon timeout,
keep alive timeout, auto keep alive disable,
keep alive fail disable and their corresponding
status registers. keep alive frame delay,
pattern end/byte offsets, transmit buffers for
keep alive frames and storing the user patterns

*Power Management Control registers

pme_d3cold_vaux, host_pme_enable, aux_pwr_detect,
power_state_mask, wow_pme_clear

Cc: Senthil Balasubramanian senth...@qca.qualcomm.com
Cc: Rajkumar Manoharan rmano...@qca.qualcomm.com
Cc: vadi...@qca.qualcomm.com
Tested-by: Mohammed Shafi Shajakhan moham...@qca.qualcomm.com
Signed-off-by: Luis R. Rodriguez mcg...@qca.qualcomm.com
Signed-off-by: Mohammed Shafi Shajakhan moham...@qca.qualcomm.com
---
 drivers/net/wireless/ath/ath9k/reg.h |  145 +-
 1 files changed, 144 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/reg.h 
b/drivers/net/wireless/ath/ath9k/reg.h
index 75acefb..e904f0a 100644
--- a/drivers/net/wireless/ath/ath9k/reg.h
+++ b/drivers/net/wireless/ath/ath9k/reg.h
@@ -696,9 +696,12 @@
 #define AR_WA_BIT7 (1  7)
 #define AR_WA_BIT23(1  23)
 #define AR_WA_D3_L1_DISABLE(1  14)
+#define AR_WA_UNTIE_RESET_EN   (1  15) /* Enable PCI Reset
+to POR (power-on-reset) */
 #define AR_WA_D3_TO_L1_DISABLE_REAL (1  16)
 #define AR_WA_ASPM_TIMER_BASED_DISABLE  (1  17)
-#define AR_WA_RESET_EN  (1  18) /* Sw Control to enable 
PCI-Reset to POR (bit 15) */
+#define AR_WA_RESET_EN  (1  18) /* Enable PCI-Reset to
+POR (bit 15) */
 #define AR_WA_ANALOG_SHIFT  (1  20)
 #define AR_WA_POR_SHORT (1  21) /* PCI-E Phy reset control */
 #define AR_WA_BIT22(1  22)
@@ -1028,6 +1031,8 @@ enum {
 #define AR_PCIE_PM_CTRL  (AR_SREV_9340(ah) ? 0x4004 : 
0x4014)
 #define AR_PCIE_PM_CTRL_ENA  0x0008
 
+#define AR_PCIE_PHY_REG30x18c08
+
 #define AR_NUM_GPIO  14
 #define AR928X_NUM_GPIO  10
 #define AR9285_NUM_GPIO  12
@@ -1231,6 +1236,8 @@ enum {
 #define AR_RTC_PLL_CLKSEL   0x0300
 #define AR_RTC_PLL_CLKSEL_S 8
 #define AR_RTC_PLL_BYPASS  0x0001
+#define AR_RTC_PLL_NOPWD   0x0004
+#define AR_RTC_PLL_NOPWD_S 18
 
 #define PLL3 0x16188
 #define PLL3_DO_MEAS_MASK 0x4000
@@ -1883,6 +1890,8 @@ enum {
 #define AR_PCU_MISC_MODE2_HWWAR2   0x0200
 #define AR_PCU_MISC_MODE2_RESERVED20xFFFE
 
+#define AR_PCU_MISC_MODE3 0x83d0
+
 #define AR_MAC_PCU_ASYNC_FIFO_REG3 0x8358
 #define AR_MAC_PCU_ASYNC_FIFO_REG3_DATAPATH_SEL0x0400
 #define AR_MAC_PCU_ASYNC_FIFO_REG3_SOFT_RESET  0x8000
@@ -1905,6 +1914,140 @@ enum {
 #define AR_RATE_DURATION_32 0x8780
 #define AR_RATE_DURATION(_n)(AR_RATE_DURATION_0 + ((_n)2))
 
+/* WoW - Wake On Wireless */
+
+#define AR_PMCTRL_AUX_PWR_DET  0x1000 /* Puts Chip in L2 state */
+#define AR_PMCTRL_D3COLD_VAUX  0x0080
+#define AR_PMCTRL_HOST_PME_EN  0x0040 /* Send OOB WAKE_L on WoW
+ event */
+#define AR_PMCTRL_WOW_PME_CLR  0x0020 /* Clear WoW event */
+#define AR_PMCTRL_PWR_STATE_MASK   0x0f00 /* Power State Mask */
+#define AR_PMCTRL_PWR_STATE_D1D3   0x0f00 /* Activate D1 and D3 */
+#define AR_PMCTRL_PWR_STATE_D1D3_REAL  0x0f00 /* Activate D1 and D3 */
+#define AR_PMCTRL_PWR_STATE_D0 0x0800 /* Activate D0 */
+#define AR_PMCTRL_PWR_PM_CTRL_ENA  0x8000 /* Enable power mgmt */
+
+#define AR_WOW_BEACON_TIMO_MAX 0x
+
+/*
+ * MAC WoW Registers
+ */
+
+#define AR_WOW_PATTERN 0x825C
+#define AR_WOW_COUNT   0x8260
+#define AR_WOW_BCN_EN  0x8270
+#define AR_WOW_BCN_TIMO0x8274
+#define AR_WOW_KEEP_ALIVE_TIMO 0x8278
+#define AR_WOW_KEEP_ALIVE  0x827c
+#define AR_WOW_US_SCALAR   0x8284
+#define AR_WOW_KEEP_ALIVE_DELAY0x8288
+#define AR_WOW_PATTERN_MATCH   0x828c
+#define AR_WOW_PATTERN_OFF10x8290  /* pattern bytes 0 - 3 */
+#define AR_WOW_PATTERN_OFF20x8294  /* pattern bytes 4 - 7 */
+
+/* for AR9285 or later version of chips */
+#define AR_WOW_EXACT   0x829c
+#define AR_WOW_LENGTH1 0x8360
+#define AR_WOW_LENGTH2 0X8364
+/* register to enable match for less 

[ath9k-devel] [PATCH 02/10] ath9k: Add definitions and structures to support WoW

2012-06-19 Thread Mohammed Shafi Shajakhan
From: Mohammed Shafi Shajakhan moham...@qca.qualcomm.com

*add structures, macros and variables for WoW, so that the driver
can make use of it.
*maintain a list for user enabled patterns and masks
*track pattern slots for the hardware limitation on the
maximum number of patterns that can be stored.
*track interrupts enabled before WoW suspend, so
that can be reconfigured after resume
*have macros to parse user defined wow configurations to
hardware code

Cc: Senthil Balasubramanian senth...@qca.qualcomm.com
Cc: Rajkumar Manoharan rmano...@qca.qualcomm.com
Cc: vadi...@qca.qualcomm.com
Tested-by: Mohammed Shafi Shajakhan moham...@qca.qualcomm.com
Signed-off-by: Luis R. Rodriguez mcg...@qca.qualcomm.com
Signed-off-by: Mohammed Shafi Shajakhan moham...@qca.qualcomm.com
---
 drivers/net/wireless/ath/ath9k/ath9k.h |   20 
 drivers/net/wireless/ath/ath9k/hw.h|   21 +
 2 files changed, 41 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h 
b/drivers/net/wireless/ath/ath9k/ath9k.h
index a8c0500..264c25b 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -505,6 +505,19 @@ static inline u16 ath9k_btcoex_aggr_limit(struct ath_softc 
*sc,
 }
 #endif /* CONFIG_ATH9K_BTCOEX_SUPPORT */
 
+struct ath9k_wow_pattern {
+   bool slot;
+   u8 pattern_bytes[MAX_PATTERN_SIZE];
+   u8 mask_bytes[MAX_PATTERN_SIZE];
+   u32 pattern_len;
+   struct list_head list;
+};
+
+struct ath9k_wow_info {
+   u32 num_of_patterns;
+   struct list_head wow_patterns;
+};
+
 //
 /*   LED Control*/
 //
@@ -706,6 +719,13 @@ struct ath_softc {
struct ath_ant_comb ant_comb;
u8 ant_tx, ant_rx;
struct dfs_pattern_detector *dfs_detector;
+
+#ifdef CONFIG_PM_SLEEP
+   bool wow_got_bmiss_intr;
+   bool wow_sleep_proc_intr; /* in the middle of WoW sleep ? */
+   u32 wow_intr_before_sleep;
+   struct ath9k_wow_info wow_info;
+#endif
 };
 
 void ath9k_tasklet(unsigned long data);
diff --git a/drivers/net/wireless/ath/ath9k/hw.h 
b/drivers/net/wireless/ath/ath9k/hw.h
index 03d5909..d0e14a3 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -179,6 +179,24 @@
 #define PAPRD_TABLE_SZ 24
 #define PAPRD_IDEAL_AGC2_PWR_RANGE 0xe0
 
+/* Wake on Wireless */
+
+#define MAX_PATTERN_SIZE   256
+#define MAX_PATTERN_MASK_SIZE  32
+#define MAX_NUM_PATTERN8
+#define MAX_NUM_USER_PATTERN   6 /*  deducting the disassociate and
+ deauthenticate packets */
+
+/*
+ * WoW trigger mapping to hardware code
+ */
+
+#define AH_WOW_USER_PATTERN_EN BIT(0)
+#define AH_WOW_MAGIC_PATTERN_ENBIT(1)
+#define AH_WOW_LINK_CHANGE BIT(2)
+#define AH_WOW_BEACON_MISS BIT(3)
+#define AH_WOW_MAX_EVENTS  4
+
 enum ath_hw_txq_subtype {
ATH_TXQ_AC_BE = 0,
ATH_TXQ_AC_BK = 1,
@@ -861,6 +879,9 @@ struct ath_hw {
/* Enterprise mode cap */
u32 ent_mode;
 
+#ifdef CONFIG_PM_SLEEP
+   u32 wow_event_mask;
+#endif
bool is_clk_25mhz;
int (*get_mac_revision)(void);
int (*external_reset)(void);
-- 
1.7.0.4

___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel


[ath9k-devel] [PATCH 03/10] ath9k_hw: Add WoW hardware capability flags

2012-06-19 Thread Mohammed Shafi Shajakhan
From: Mohammed Shafi Shajakhan moham...@qca.qualcomm.com

have seperate wow capability flags for
*basic wow support
*device capable of matching exact user defined pattern
or de-authentication/disassoc pattern
*device such AR9280 requires first four bytes for
all sort of patterns

Cc: Senthil Balasubramanian senth...@qca.qualcomm.com
Cc: Rajkumar Manoharan rmano...@qca.qualcomm.com
Cc: vadi...@qca.qualcomm.com
Tested-by: Mohammed Shafi Shajakhan moham...@qca.qualcomm.com
Signed-off-by: Luis R. Rodriguez mcg...@qca.qualcomm.com
Signed-off-by: Mohammed Shafi Shajakhan moham...@qca.qualcomm.com
---
 drivers/net/wireless/ath/ath9k/hw.h |   20 
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/hw.h 
b/drivers/net/wireless/ath/ath9k/hw.h
index d0e14a3..73a1238 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -231,6 +231,23 @@ enum ath9k_hw_caps {
ATH9K_HW_CAP_DFS= BIT(16),
 };
 
+/*
+ * enum ath9k_hw_wow_caps - WoW device capabilities
+ * @ATH9K_HW_WOW_DEVICE_CAPABLE: device revision is capable of WoW.
+ * @ATH9K_HW_WOW_PATTERN_MATCH_EXACT: device is capable of matching
+ * an exact user defined pattern or de-authentication/disassoc pattern.
+ * @ATH9K_HW_WOW_PATTERN_MATCH_DWORD: device requires the first four
+ * bytes of the pattern for user defined pattern, de-authentication and
+ * disassociation patterns for all types of possible frames recieved
+ * of those types.
+ */
+
+enum ath9k_hw_wow_caps {
+   ATH9K_HW_WOW_DEVICE_CAPABLE = BIT(0),
+   ATH9K_HW_WOW_PATTERN_MATCH_EXACT= BIT(1),
+   ATH9K_HW_WOW_PATTERN_MATCH_DWORD= BIT(2),
+};
+
 struct ath9k_hw_capabilities {
u32 hw_caps; /* ATH9K_HW_CAP_* from ath9k_hw_caps */
u16 rts_aggr_limit;
@@ -246,6 +263,9 @@ struct ath9k_hw_capabilities {
u8 txs_len;
u16 pcie_lcr_offset;
bool pcie_lcr_extsync_en;
+#ifdef CONFIG_PM_SLEEP
+   enum ath9k_hw_wow_caps wow_caps;
+#endif
 };
 
 struct ath9k_ops_config {
-- 
1.7.0.4

___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel


[ath9k-devel] [PATCH 04/10] ath9k_hw: advertise WoW support for capable chipsets

2012-06-19 Thread Mohammed Shafi Shajakhan
From: Mohammed Shafi Shajakhan moham...@qca.qualcomm.com

support WoW for all chipsets starting from AR9280, AR9285, AR9287,
AR9380, AR9382, AR9485, AR9462. Really all hardware may not support
WoW even though the flag is set and the WoW working depends on
your laptop, BIOS apart from the hardware.

Cc: Senthil Balasubramanian senth...@qca.qualcomm.com
Cc: Rajkumar Manoharan rmano...@qca.qualcomm.com
Cc: vadi...@qca.qualcomm.com
Tested-by: Mohammed Shafi Shajakhan moham...@qca.qualcomm.com
Signed-off-by: Luis R. Rodriguez mcg...@qca.qualcomm.com
Signed-off-by: Mohammed Shafi Shajakhan moham...@qca.qualcomm.com
---
 drivers/net/wireless/ath/ath9k/hw.c |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/hw.c 
b/drivers/net/wireless/ath/ath9k/hw.c
index 784baee..fea7f24 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -2560,6 +2560,14 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah)
}
 
 
+   if (AR_SREV_9280_20_OR_LATER(ah)) {
+   pCap-wow_caps = ATH9K_HW_WOW_DEVICE_CAPABLE |
+ATH9K_HW_WOW_PATTERN_MATCH_EXACT;
+
+   if (AR_SREV_9280(ah))
+   pCap-wow_caps |= ATH9K_HW_WOW_PATTERN_MATCH_DWORD;
+   }
+
return 0;
 }
 
-- 
1.7.0.4

___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel


[ath9k-devel] [PATCH 05/10] ath9k: advertise supported WoW flags to upper layer

2012-06-19 Thread Mohammed Shafi Shajakhan
From: Mohammed Shafi Shajakhan moham...@qca.qualcomm.com

currently the code supports WoW triggers due to
*magic packet
*user defined patterns
*deauth and disassoc patterns
*disconnect - beacon miss, last beacon received timeout,
no ack for keeep alive frames.

we need to support other WoW offload features in the
near future. also a minor cleanup.

Cc: Senthil Balasubramanian senth...@qca.qualcomm.com
Cc: Rajkumar Manoharan rmano...@qca.qualcomm.com
Cc: vadi...@qca.qualcomm.com
Tested-by: Mohammed Shafi Shajakhan moham...@qca.qualcomm.com
Signed-off-by: Luis R. Rodriguez mcg...@qca.qualcomm.com
Signed-off-by: Mohammed Shafi Shajakhan moham...@qca.qualcomm.com
---
 drivers/net/wireless/ath/ath9k/init.c |   20 ++--
 1 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/init.c 
b/drivers/net/wireless/ath/ath9k/init.c
index 9dfce1a..d08824f 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -688,8 +688,8 @@ void ath9k_set_hw_capab(struct ath_softc *sc, struct 
ieee80211_hw *hw)
IEEE80211_HW_SPECTRUM_MGMT |
IEEE80211_HW_REPORTS_TX_ACK_STATUS;
 
-   if (sc-sc_ah-caps.hw_caps  ATH9K_HW_CAP_HT)
-hw-flags |= IEEE80211_HW_AMPDU_AGGREGATION;
+   if (ah-caps.hw_caps  ATH9K_HW_CAP_HT)
+   hw-flags |= IEEE80211_HW_AMPDU_AGGREGATION;
 
if (AR_SREV_9160_10_OR_LATER(sc-sc_ah) || ath9k_modparam_nohwcrypt)
hw-flags |= IEEE80211_HW_MFP_CAPABLE;
@@ -713,6 +713,22 @@ void ath9k_set_hw_capab(struct ath_softc *sc, struct 
ieee80211_hw *hw)
hw-wiphy-flags |= WIPHY_FLAG_SUPPORTS_TDLS;
hw-wiphy-flags |= WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL;
 
+#ifdef CONFIG_PM_SLEEP
+
+   if ((ah-caps.wow_caps  ATH9K_HW_WOW_DEVICE_CAPABLE) 
+   device_can_wakeup(sc-dev)) {
+
+   hw-wiphy-wowlan.flags = WIPHY_WOWLAN_MAGIC_PKT |
+ WIPHY_WOWLAN_DISCONNECT;
+   hw-wiphy-wowlan.n_patterns = MAX_NUM_USER_PATTERN;
+   hw-wiphy-wowlan.pattern_min_len = 1;
+   hw-wiphy-wowlan.pattern_max_len = MAX_PATTERN_SIZE;
+   INIT_LIST_HEAD(sc-wow_info.wow_patterns);
+
+   }
+
+#endif
+
hw-queues = 4;
hw-max_rates = 4;
hw-channel_change_time = 5000;
-- 
1.7.0.4

___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel


[ath9k-devel] [PATCH 06/10] ath9k_hw: INI changes for WoW for AR9002 chipsets

2012-06-19 Thread Mohammed Shafi Shajakhan
From: Mohammed Shafi Shajakhan moham...@qca.qualcomm.com

for AR9002 family of chipsets and for WoW sleep, we reprogram
the SerDes so that the PLL and CHK REQ are both enabled. this
uses more power but in certain cases this is required as otherwise
WoW sleep is unstable and chip may disappear.

Cc: Senthil Balasubramanian senth...@qca.qualcomm.com
Cc: Rajkumar Manoharan rmano...@qca.qualcomm.com
Cc: vadi...@qca.qualcomm.com
Tested-by: Mohammed Shafi Shajakhan moham...@qca.qualcomm.com
Signed-off-by: Luis R. Rodriguez mcg...@qca.qualcomm.com
Signed-off-by: Mohammed Shafi Shajakhan moham...@qca.qualcomm.com
---
 drivers/net/wireless/ath/ath9k/ar9002_hw.c   |5 +
 drivers/net/wireless/ath/ath9k/ar9002_initvals.h |   14 ++
 drivers/net/wireless/ath/ath9k/hw.h  |3 +++
 3 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9002_hw.c 
b/drivers/net/wireless/ath/ath9k/ar9002_hw.c
index d9a69fc..3779043 100644
--- a/drivers/net/wireless/ath/ath9k/ar9002_hw.c
+++ b/drivers/net/wireless/ath/ath9k/ar9002_hw.c
@@ -47,6 +47,11 @@ static void ar9002_hw_init_mode_regs(struct ath_hw *ah)
INIT_INI_ARRAY(ah-iniPcieSerdes,
   ar9280PciePhy_clkreq_always_on_L1_9280,
   ARRAY_SIZE(ar9280PciePhy_clkreq_always_on_L1_9280), 
2);
+#ifdef CONFIG_PM_SLEEP
+   INIT_INI_ARRAY(ah-iniPcieSerdesWow,
+  ar9280PciePhy_awow,
+  ARRAY_SIZE(ar9280PciePhy_awow), 2);
+#endif
 
if (AR_SREV_9287_11_OR_LATER(ah)) {
INIT_INI_ARRAY(ah-iniModes, ar9287Modes_9287_1_1,
diff --git a/drivers/net/wireless/ath/ath9k/ar9002_initvals.h 
b/drivers/net/wireless/ath/ath9k/ar9002_initvals.h
index 4d18c66..beb6162 100644
--- a/drivers/net/wireless/ath/ath9k/ar9002_initvals.h
+++ b/drivers/net/wireless/ath/ath9k/ar9002_initvals.h
@@ -925,6 +925,20 @@ static const u32 
ar9280PciePhy_clkreq_always_on_L1_9280[][2] = {
{0x4044, 0x},
 };
 
+static const u32 ar9280PciePhy_awow[][2] = {
+   /* Addr  allmodes  */
+   {0x4040, 0x9248fd00},
+   {0x4040, 0x24924924},
+   {0x4040, 0xa819},
+   {0x4040, 0x13160820},
+   {0x4040, 0xe5980560},
+   {0x4040, 0xc01dcffd},
+   {0x4040, 0x1aaabe41},
+   {0x4040, 0xbe105554},
+   {0x4040, 0x00043007},
+   {0x4044, 0x},
+};
+
 static const u32 ar9285Modes_9285_1_2[][5] = {
/* Addr  5G_HT20 5G_HT40 2G_HT40 2G_HT20   */
{0x1030, 0x0230, 0x0460, 0x02c0, 0x0160},
diff --git a/drivers/net/wireless/ath/ath9k/hw.h 
b/drivers/net/wireless/ath/ath9k/hw.h
index 73a1238..2a20216 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -852,6 +852,9 @@ struct ath_hw {
struct ar5416IniArray iniBank7;
struct ar5416IniArray iniAddac;
struct ar5416IniArray iniPcieSerdes;
+#ifdef CONFIG_PM_SLEEP
+   struct ar5416IniArray iniPcieSerdesWow;
+#endif
struct ar5416IniArray iniPcieSerdesLowPower;
struct ar5416IniArray iniModesFastClock;
struct ar5416IniArray iniAdditional;
-- 
1.7.0.4

___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel


[ath9k-devel] [PATCH 08/10] ath: Add Wake-on-Wireless debug mask

2012-06-19 Thread Mohammed Shafi Shajakhan
From: Mohammed Shafi Shajakhan moham...@qca.qualcomm.com

to help the developers and users to debug/know
whats happening with WoW

Cc: Senthil Balasubramanian senth...@qca.qualcomm.com
Cc: Rajkumar Manoharan rmano...@qca.qualcomm.com
Cc: vadi...@qca.qualcomm.com
Tested-by: Mohammed Shafi Shajakhan moham...@qca.qualcomm.com
Signed-off-by: Mohammed Shafi Shajakhan moham...@qca.qualcomm.com
---
 drivers/net/wireless/ath/ath.h |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ath.h b/drivers/net/wireless/ath/ath.h
index c54b7d3..9bd0248 100644
--- a/drivers/net/wireless/ath/ath.h
+++ b/drivers/net/wireless/ath/ath.h
@@ -215,6 +215,7 @@ void ath_printk(const char *level, const struct ath_common 
*common,
  * used exclusively for WLAN-BT coexistence starting from
  * AR9462.
  * @ATH_DBG_DFS: radar datection
+ * @ATH_DBG_WOW: Wake on Wireless
  * @ATH_DBG_ANY: enable all debugging
  *
  * The debug level is used to control the amount and type of debugging output
@@ -242,6 +243,7 @@ enum ATH_DEBUG {
ATH_DBG_BSTUCK  = 0x8000,
ATH_DBG_MCI = 0x0001,
ATH_DBG_DFS = 0x0002,
+   ATH_DBG_WOW = 0x0004,
ATH_DBG_ANY = 0x
 };
 
-- 
1.7.0.4

___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel


[ath9k-devel] [PATCH 09/10] ath9k: Add WoW related mac80211 callbacks

2012-06-19 Thread Mohammed Shafi Shajakhan
From: Mohammed Shafi Shajakhan moham...@qca.qualcomm.com

add suspend/resume/set_wakeup callbacks to the driver

*suspend

- bail out only if all the conditions for configuring WoW
  is fine, currently multivif case is not handled
- check for associated state
- map wow triggers from user space data
- add deauth/disassoc pattern and user defined pattern.,
  for the later a list is maintained
- store the interrupt mask before suspend, enabled beacon
  miss interrupt for WoW
- configure WoW in the hardware by calling the
  ath9k_hw_wow_enable

*resume

- restore the interrupts based on the interrupt mask
  stored before suspend
- call ath9k_hw_wow_wakeup to configure/restore the hardware
  after wow wakeup by clearning away WoW events and also
  to know the WoW wakeup reason from the status register

*set_wakeup

- to call 'device_set_wakeup_enable' from cfg80211/mac80211
  when wow is configured and as per Rafael/johannnes the
  right way to do so rather in the driver suspend/resume
  call back

also a minor cleanup

Tested-by: Mohammed Shafi Shajakhan moham...@qca.qualcomm.com
Cc: Senthil Balasubramanian senth...@qca.qualcomm.com
Cc: Rajkumar Manoharan rmano...@qca.qualcomm.com
Cc: vadi...@qca.qualcomm.com
Signed-off-by: Mohammed Shafi Shajakhan moham...@qca.qualcomm.com
---
 drivers/net/wireless/ath/ath9k/ath9k.h |9 +
 drivers/net/wireless/ath/ath9k/init.c  |1 +
 drivers/net/wireless/ath/ath9k/main.c  |  376 +++-
 drivers/net/wireless/ath/ath9k/pci.c   |3 +
 4 files changed, 380 insertions(+), 9 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h 
b/drivers/net/wireless/ath/ath9k/ath9k.h
index 264c25b..292e61a 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -518,6 +518,14 @@ struct ath9k_wow_info {
struct list_head wow_patterns;
 };
 
+#ifdef CONFIG_PM_SLEEP
+void ath_wow_cleanup(struct ath_softc *sc);
+#else
+static inline void ath_wow_cleanup(struct ath_softc *sc)
+{
+}
+#endif
+
 //
 /*   LED Control*/
 //
@@ -719,6 +727,7 @@ struct ath_softc {
struct ath_ant_comb ant_comb;
u8 ant_tx, ant_rx;
struct dfs_pattern_detector *dfs_detector;
+   u32 wow_enabled;
 
 #ifdef CONFIG_PM_SLEEP
bool wow_got_bmiss_intr;
diff --git a/drivers/net/wireless/ath/ath9k/init.c 
b/drivers/net/wireless/ath/ath9k/init.c
index d08824f..39bf275 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -885,6 +885,7 @@ void ath9k_deinit_device(struct ath_softc *sc)
ath9k_ps_restore(sc);
 
ieee80211_unregister_hw(hw);
+   ath_wow_cleanup(sc);
ath_rx_cleanup(sc);
ath_tx_cleanup(sc);
ath9k_deinit_softc(sc);
diff --git a/drivers/net/wireless/ath/ath9k/main.c 
b/drivers/net/wireless/ath/ath9k/main.c
index 52561b3..8a9e542 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -486,6 +486,17 @@ irqreturn_t ath_isr(int irq, void *dev)
if (status  SCHED_INTR)
sched = true;
 
+#ifdef CONFIG_PM_SLEEP
+   if (status  ATH9K_INT_BMISS) {
+   if (sc-wow_sleep_proc_intr) {
+   ath_dbg(common, ANY, during WoW we got a BMISS\n);
+   sc-wow_got_bmiss_intr = true;
+   sc-wow_sleep_proc_intr = false;
+   }
+   ath_dbg(common, INTERRUPT, beacon miss interrupt\n);
+   }
+#endif
+
/*
 * If a FATAL or RXORN interrupt is received, we have to reset the
 * chip immediately.
@@ -2091,24 +2102,365 @@ static void ath9k_get_et_stats(struct ieee80211_hw *hw,
 #endif
 
 
+#ifdef CONFIG_PM_SLEEP
+
+void ath_wow_cleanup(struct ath_softc *sc)
+{
+   struct ath9k_wow_info *wow_info = sc-wow_info;
+   struct ath9k_wow_pattern *wow_pattern  = NULL, *tmp;
+
+   if (!(sc-wow_enabled  AH_WOW_USER_PATTERN_EN))
+   return;
+
+   list_for_each_entry_safe(wow_pattern, tmp,
+wow_info-wow_patterns, list) {
+
+   list_del(wow_pattern-list);
+   kfree(wow_pattern);
+   }
+
+}
+
+static void ath9k_wow_map_triggers(struct ath_softc *sc,
+  struct cfg80211_wowlan *wowlan,
+  u32 *wow_triggers)
+{
+   if (wowlan-disconnect)
+   *wow_triggers |= AH_WOW_LINK_CHANGE |
+AH_WOW_BEACON_MISS;
+   if (wowlan-magic_pkt)
+   *wow_triggers |= AH_WOW_MAGIC_PATTERN_EN;
+
+   if (wowlan-n_patterns)
+   *wow_triggers |= AH_WOW_USER_PATTERN_EN;
+
+   sc-wow_enabled = *wow_triggers;
+
+}
+
+static void ath9k_wow_add_disassoc_deauth_pattern(struct ath_softc *sc)
+{
+   struct ath_hw *ah = sc-sc_ah;
+   struct ath_common *common = ath9k_hw_common(ah);
+   struct ath9k_hw_capabilities *pcaps = ah-caps;

[ath9k-devel] [PATCH 10/10] ath9k: do not disable hardware while wow is enabled

2012-06-19 Thread Mohammed Shafi Shajakhan
From: Mohammed Shafi Shajakhan moham...@qca.qualcomm.com

Cc: Senthil Balasubramanian senth...@qca.qualcomm.com
Cc: Rajkumar Manoharan rmano...@qca.qualcomm.com
Cc: vadi...@qca.qualcomm.com
Tested-by: Mohammed Shafi Shajakhan moham...@qca.qualcomm.com
Signed-off-by: Mohammed Shafi Shajakhan moham...@qca.qualcomm.com
---
 drivers/net/wireless/ath/ath9k/pci.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/pci.c 
b/drivers/net/wireless/ath/ath9k/pci.c
index 2b7fe51..b9e67e2 100644
--- a/drivers/net/wireless/ath/ath9k/pci.c
+++ b/drivers/net/wireless/ath/ath9k/pci.c
@@ -316,6 +316,9 @@ static int ath_pci_suspend(struct device *device)
struct ieee80211_hw *hw = pci_get_drvdata(pdev);
struct ath_softc *sc = hw-priv;
 
+   if (sc-wow_enabled)
+   return 0;
+
/* The device has to be moved to FULLSLEEP forcibly.
 * Otherwise the chip never moved to full sleep,
 * when no interface is up.
-- 
1.7.0.4

___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel


Re: [ath9k-devel] [PATCH 01/10] ath9k_hw: Add register definitions for WoW support

2012-06-19 Thread Thiagarajan, Vasanthakumar

From: Shajakhan, Mohammed Shafi (Mohammed Shafi)
Sent: Tuesday, June 19, 2012 9:17 PM
To: John W. Linville
Cc: linux-wirel...@vger.kernel.org; Rodriguez, Luis; 
ath9k-devel@lists.ath9k.org; Manoharan, Rajkumar; Manoharan, Sujith; 
Pitchaimani, Vadivel; Hu, Russell; Yang, Aeolus; Shajakhan, Mohammed Shafi 
(Mohammed Shafi); Balasubramanian, Senthil Kumar; Rodriguez, Luis
Subject: [PATCH 01/10] ath9k_hw: Add register definitions for WoW support

From: Mohammed Shafi Shajakhan moham...@qca.qualcomm.com

*MAC WoW registers

back-off shift, MAC interrupt enable, magic packet enable,
pattern match enable, aifs, slot wait period, keep alive
frame failure count, beacon fail enable, beacon timeout,
keep alive timeout, auto keep alive disable,
keep alive fail disable and their corresponding
status registers. keep alive frame delay,
pattern end/byte offsets, transmit buffers for
keep alive frames and storing the user patterns

*Power Management Control registers

pme_d3cold_vaux, host_pme_enable, aux_pwr_detect,
power_state_mask, wow_pme_clear

Cc: Senthil Balasubramanian senth...@qca.qualcomm.com
Cc: Rajkumar Manoharan rmano...@qca.qualcomm.com
Cc: vadi...@qca.qualcomm.com
Tested-by: Mohammed Shafi Shajakhan moham...@qca.qualcomm.com

You need not add Tested-by yourself, it is expected anyway.

Vasanth
___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel


Re: [ath9k-devel] [PATCH 03/10] ath9k_hw: Add WoW hardware capability flags

2012-06-19 Thread Rajkumar Manoharan
On Tue, Jun 19, 2012 at 09:17:23PM +0530, Mohammed Shafi Shajakhan wrote:
 From: Mohammed Shafi Shajakhan moham...@qca.qualcomm.com
 
 have seperate wow capability flags for
 *basic wow support
 *device capable of matching exact user defined pattern
 or de-authentication/disassoc pattern
 *device such AR9280 requires first four bytes for
 all sort of patterns
 
 Cc: Senthil Balasubramanian senth...@qca.qualcomm.com
 Cc: Rajkumar Manoharan rmano...@qca.qualcomm.com
 Cc: vadi...@qca.qualcomm.com
 Tested-by: Mohammed Shafi Shajakhan moham...@qca.qualcomm.com
 Signed-off-by: Luis R. Rodriguez mcg...@qca.qualcomm.com
 Signed-off-by: Mohammed Shafi Shajakhan moham...@qca.qualcomm.com
 ---
  drivers/net/wireless/ath/ath9k/hw.h |   20 
  1 files changed, 20 insertions(+), 0 deletions(-)
 
 diff --git a/drivers/net/wireless/ath/ath9k/hw.h 
 b/drivers/net/wireless/ath/ath9k/hw.h
 index d0e14a3..73a1238 100644
 --- a/drivers/net/wireless/ath/ath9k/hw.h
 +++ b/drivers/net/wireless/ath/ath9k/hw.h
 @@ -231,6 +231,23 @@ enum ath9k_hw_caps {
   ATH9K_HW_CAP_DFS= BIT(16),
  };
  
 +/*
 + * enum ath9k_hw_wow_caps - WoW device capabilities
 + * @ATH9K_HW_WOW_DEVICE_CAPABLE: device revision is capable of WoW.
 + * @ATH9K_HW_WOW_PATTERN_MATCH_EXACT: device is capable of matching
 + * an exact user defined pattern or de-authentication/disassoc pattern.
 + * @ATH9K_HW_WOW_PATTERN_MATCH_DWORD: device requires the first four
 + * bytes of the pattern for user defined pattern, de-authentication and
 + * disassociation patterns for all types of possible frames recieved
 + * of those types.
 + */
 +
 +enum ath9k_hw_wow_caps {
 + ATH9K_HW_WOW_DEVICE_CAPABLE = BIT(0),
 + ATH9K_HW_WOW_PATTERN_MATCH_EXACT= BIT(1),
 + ATH9K_HW_WOW_PATTERN_MATCH_DWORD= BIT(2),
 +};
 +
  struct ath9k_hw_capabilities {
   u32 hw_caps; /* ATH9K_HW_CAP_* from ath9k_hw_caps */
   u16 rts_aggr_limit;
 @@ -246,6 +263,9 @@ struct ath9k_hw_capabilities {
   u8 txs_len;
   u16 pcie_lcr_offset;
   bool pcie_lcr_extsync_en;
 +#ifdef   CONFIG_PM_SLEEP
 + enum ath9k_hw_wow_caps wow_caps;
 +#endif
Why can't you align with existing HW_CAP_* flags? why do you need a separate
place holder?

-Rajkumar
___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel


Re: [ath9k-devel] [PATCH 02/10] ath9k: Add definitions and structures to support WoW

2012-06-19 Thread Rajkumar Manoharan
On Tue, Jun 19, 2012 at 09:17:22PM +0530, Mohammed Shafi Shajakhan wrote:
 From: Mohammed Shafi Shajakhan moham...@qca.qualcomm.com
 
 *add structures, macros and variables for WoW, so that the driver
 can make use of it.
 *maintain a list for user enabled patterns and masks
 *track pattern slots for the hardware limitation on the
 maximum number of patterns that can be stored.
 *track interrupts enabled before WoW suspend, so
 that can be reconfigured after resume
 *have macros to parse user defined wow configurations to
 hardware code
 
 Cc: Senthil Balasubramanian senth...@qca.qualcomm.com
 Cc: Rajkumar Manoharan rmano...@qca.qualcomm.com
 Cc: vadi...@qca.qualcomm.com
 Tested-by: Mohammed Shafi Shajakhan moham...@qca.qualcomm.com
 Signed-off-by: Luis R. Rodriguez mcg...@qca.qualcomm.com
 Signed-off-by: Mohammed Shafi Shajakhan moham...@qca.qualcomm.com
 ---
  drivers/net/wireless/ath/ath9k/ath9k.h |   20 
  drivers/net/wireless/ath/ath9k/hw.h|   21 +
  2 files changed, 41 insertions(+), 0 deletions(-)
 
 diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h 
 b/drivers/net/wireless/ath/ath9k/ath9k.h
 index a8c0500..264c25b 100644
 --- a/drivers/net/wireless/ath/ath9k/ath9k.h
 +++ b/drivers/net/wireless/ath/ath9k/ath9k.h
 @@ -505,6 +505,19 @@ static inline u16 ath9k_btcoex_aggr_limit(struct 
 ath_softc *sc,
  }
  #endif /* CONFIG_ATH9K_BTCOEX_SUPPORT */
  
 +struct ath9k_wow_pattern {
 + bool slot;
 + u8 pattern_bytes[MAX_PATTERN_SIZE];
 + u8 mask_bytes[MAX_PATTERN_SIZE];
 + u32 pattern_len;
 + struct list_head list;
 +};
 +
 +struct ath9k_wow_info {
 + u32 num_of_patterns;
 + struct list_head wow_patterns;
 +};
 +
  //
  /*   LED Control*/
  //
 @@ -706,6 +719,13 @@ struct ath_softc {
   struct ath_ant_comb ant_comb;
   u8 ant_tx, ant_rx;
   struct dfs_pattern_detector *dfs_detector;
 +
 +#ifdef CONFIG_PM_SLEEP
 + bool wow_got_bmiss_intr;
 + bool wow_sleep_proc_intr; /* in the middle of WoW sleep ? */
 + u32 wow_intr_before_sleep;
 + struct ath9k_wow_info wow_info;
 +#endif
  };
  
  void ath9k_tasklet(unsigned long data);
 diff --git a/drivers/net/wireless/ath/ath9k/hw.h 
 b/drivers/net/wireless/ath/ath9k/hw.h
 index 03d5909..d0e14a3 100644
 --- a/drivers/net/wireless/ath/ath9k/hw.h
 +++ b/drivers/net/wireless/ath/ath9k/hw.h
 @@ -179,6 +179,24 @@
  #define PAPRD_TABLE_SZ   24
  #define PAPRD_IDEAL_AGC2_PWR_RANGE   0xe0
  
 +/* Wake on Wireless */
 +
 +#define MAX_PATTERN_SIZE 256
 +#define MAX_PATTERN_MASK_SIZE32
 +#define MAX_NUM_PATTERN  8
 +#define MAX_NUM_USER_PATTERN 6 /*  deducting the disassociate and
 +   deauthenticate packets */
 +
 +/*
 + * WoW trigger mapping to hardware code
 + */
 +
 +#define AH_WOW_USER_PATTERN_EN   BIT(0)
 +#define AH_WOW_MAGIC_PATTERN_EN  BIT(1)
 +#define AH_WOW_LINK_CHANGE   BIT(2)
 +#define AH_WOW_BEACON_MISS   BIT(3)
 +#define AH_WOW_MAX_EVENTS4
Why do you need AH_WOW_MAX_EVENT? It looks like out of sync and also it is 
never be used.

-Rajkumar
___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel


Re: [ath9k-devel] [PATCH 07/10] ath9k_hw: Add hardware code for WoW

2012-06-19 Thread Rajkumar Manoharan
On Tue, Jun 19, 2012 at 09:17:27PM +0530, Mohammed Shafi Shajakhan wrote:
 From: Mohammed Shafi Shajakhan moham...@qca.qualcomm.com
 
 add a new file wow.c which takes care of the hardware code
 for WoW.
[...]
 ---
  3 files changed, 591 insertions(+), 0 deletions(-)
  create mode 100644 drivers/net/wireless/ath/ath9k/wow.c
 
 diff --git a/drivers/net/wireless/ath/ath9k/Makefile 
 b/drivers/net/wireless/ath/ath9k/Makefile
 index 9c41232..2ad8f94 100644
 --- a/drivers/net/wireless/ath/ath9k/Makefile
 +++ b/drivers/net/wireless/ath/ath9k/Makefile
 @@ -17,6 +17,7 @@ ath9k-$(CONFIG_ATH9K_DFS_CERTIFIED) += \
   dfs.o \
   dfs_pattern_detector.o \
   dfs_pri_detector.o
 +ath9k-$(CONFIG_PM_SLEEP) += wow.o
  
  obj-$(CONFIG_ATH9K) += ath9k.o
  
 diff --git a/drivers/net/wireless/ath/ath9k/hw.h 
 b/drivers/net/wireless/ath/ath9k/hw.h
 index 2a20216..8e417c1 100644
 --- a/drivers/net/wireless/ath/ath9k/hw.h
 +++ b/drivers/net/wireless/ath/ath9k/hw.h
 @@ -1110,6 +1110,37 @@ ath9k_hw_get_btcoex_scheme(struct ath_hw *ah)
  }
  #endif /* CONFIG_ATH9K_BTCOEX_SUPPORT */
  
 +
 +#ifdef CONFIG_PM_SLEEP
 +const char *ath9k_hw_wow_event_to_string(u32 wow_event);
 +void ath9k_hw_wow_apply_pattern(struct ath_hw *ah, u8 *user_pattern,
 + u8 *user_mask, int pattern_count,
 + int pattern_len);
 +u32 ath9k_hw_wow_wakeup(struct ath_hw *ah);
 +void ath9k_hw_wow_enable(struct ath_hw *ah, u32 pattern_enable);
 +#else
 +static inline const char *ath9k_hw_wow_event_to_string(u32 wow_event)
 +{
 + return NULL;
 +}
 +static inline void ath9k_hw_wow_apply_pattern(struct ath_hw *ah,
 +   u8 *user_pattern, u8 *user_mask,
 +   int pattern_count,
 +   int pattern_len)
 +{
 + return;
 +}
No need to return void function and also fix indent for arguments
 +static inline u32 ath9k_hw_wow_wakeup(struct ath_hw *ah)
 +{
 + return 0;
 +}
 +static inline void ath9k_hw_wow_enable(struct ath_hw *ah, u32 pattern_enable)
 +{
 +}
 +#endif
 +
 +
 +
  #define ATH9K_CLOCK_RATE_CCK 22
  #define ATH9K_CLOCK_RATE_5GHZ_OFDM   40
  #define ATH9K_CLOCK_RATE_2GHZ_OFDM   44
 diff --git a/drivers/net/wireless/ath/ath9k/wow.c 
 b/drivers/net/wireless/ath/ath9k/wow.c
 new file mode 100644
 index 000..66a7a74
 --- /dev/null
 +++ b/drivers/net/wireless/ath/ath9k/wow.c
 @@ -0,0 +1,559 @@
 +
 +/*
 + * Copyright (c) 2008-2011 Atheros Communications Inc.
 + *
Please update the Copyright.

 +
 +#include linux/export.h
 +#include ath9k.h
 +#include reg.h
 +#include hw-ops.h
 +
[...]
 + if (AR_SREV_9285(ah) || AR_SREV_9287(ah))
 + set = AR9285_WA_DEFAULT;
 + else
 + set = AR9280_WA_DEFAULT;
 +
 + /*
 +  * In AR9280 and AR9285, bit 14 in WA register
 +  * (disable L1) should only be set when device
 +  * enters D3 state and be cleared when device
 +  * comes back to D0
 +  */
 +
 + if (ah-config.pcie_waen  AR_WA_D3_L1_DISABLE)
 + set = set | AR_WA_D3_L1_DISABLE;
 +
 + clr = AR_WA_UNTIE_RESET_EN;
 + set = set | AR_WA_RESET_EN | AR_WA_POR_SHORT;
simplify it as |=

-Rajkumar 
___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel


Re: [ath9k-devel] [PATCH 05/10] ath9k: advertise supported WoW flags to upper layer

2012-06-19 Thread Julian Calaby
Hi Mohammed,

On Wed, Jun 20, 2012 at 1:47 AM, Mohammed Shafi Shajakhan
moham...@qca.qualcomm.com wrote:
 From: Mohammed Shafi Shajakhan moham...@qca.qualcomm.com

 currently the code supports WoW triggers due to
 *magic packet
 *user defined patterns
 *deauth and disassoc patterns
 *disconnect - beacon miss, last beacon received timeout,
 no ack for keeep alive frames.

 we need to support other WoW offload features in the
 near future. also a minor cleanup.

 Cc: Senthil Balasubramanian senth...@qca.qualcomm.com
 Cc: Rajkumar Manoharan rmano...@qca.qualcomm.com
 Cc: vadi...@qca.qualcomm.com
 Tested-by: Mohammed Shafi Shajakhan moham...@qca.qualcomm.com
 Signed-off-by: Luis R. Rodriguez mcg...@qca.qualcomm.com
 Signed-off-by: Mohammed Shafi Shajakhan moham...@qca.qualcomm.com
 ---
  drivers/net/wireless/ath/ath9k/init.c |   20 ++--
  1 files changed, 18 insertions(+), 2 deletions(-)

 diff --git a/drivers/net/wireless/ath/ath9k/init.c 
 b/drivers/net/wireless/ath/ath9k/init.c
 index 9dfce1a..d08824f 100644
 --- a/drivers/net/wireless/ath/ath9k/init.c
 +++ b/drivers/net/wireless/ath/ath9k/init.c
 @@ -688,8 +688,8 @@ void ath9k_set_hw_capab(struct ath_softc *sc, struct 
 ieee80211_hw *hw)
                IEEE80211_HW_SPECTRUM_MGMT |
                IEEE80211_HW_REPORTS_TX_ACK_STATUS;

 -       if (sc-sc_ah-caps.hw_caps  ATH9K_HW_CAP_HT)
 -                hw-flags |= IEEE80211_HW_AMPDU_AGGREGATION;
 +       if (ah-caps.hw_caps  ATH9K_HW_CAP_HT)
 +               hw-flags |= IEEE80211_HW_AMPDU_AGGREGATION;

This doesn't look like it belongs with the rest of the patch.

Thanks,

-- 
Julian Calaby

Email: julian.cal...@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/
.Plan: http://sites.google.com/site/juliancalaby/
___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel


Re: [ath9k-devel] [PATCH 02/10] ath9k: Add definitions and structures to support WoW

2012-06-19 Thread Mohammed Shafi Shajakhan
Hi Raj,

On Tuesday 19 June 2012 11:08 PM, Rajkumar Manoharan wrote:
 On Tue, Jun 19, 2012 at 09:17:22PM +0530, Mohammed Shafi Shajakhan wrote:
 From: Mohammed Shafi Shajakhanmoham...@qca.qualcomm.com

 *add structures, macros and variables for WoW, so that the driver
 can make use of it.
 *maintain a list for user enabled patterns and masks
 *track pattern slots for the hardware limitation on the
 maximum number of patterns that can be stored.
 *track interrupts enabled before WoW suspend, so
 that can be reconfigured after resume
 *have macros to parse user defined wow configurations to
 hardware code

 Cc: Senthil Balasubramaniansenth...@qca.qualcomm.com
 Cc: Rajkumar Manoharanrmano...@qca.qualcomm.com
 Cc: vadi...@qca.qualcomm.com
 Tested-by: Mohammed Shafi Shajakhanmoham...@qca.qualcomm.com
 Signed-off-by: Luis R. Rodriguezmcg...@qca.qualcomm.com
 Signed-off-by: Mohammed Shafi Shajakhanmoham...@qca.qualcomm.com
 ---
   drivers/net/wireless/ath/ath9k/ath9k.h |   20 
   drivers/net/wireless/ath/ath9k/hw.h|   21 +
   2 files changed, 41 insertions(+), 0 deletions(-)

 diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h 
 b/drivers/net/wireless/ath/ath9k/ath9k.h
 index a8c0500..264c25b 100644
 --- a/drivers/net/wireless/ath/ath9k/ath9k.h
 +++ b/drivers/net/wireless/ath/ath9k/ath9k.h
 @@ -505,6 +505,19 @@ static inline u16 ath9k_btcoex_aggr_limit(struct 
 ath_softc *sc,
   }
   #endif /* CONFIG_ATH9K_BTCOEX_SUPPORT */

 +struct ath9k_wow_pattern {
 +bool slot;
 +u8 pattern_bytes[MAX_PATTERN_SIZE];
 +u8 mask_bytes[MAX_PATTERN_SIZE];
 +u32 pattern_len;
 +struct list_head list;
 +};
 +
 +struct ath9k_wow_info {
 +u32 num_of_patterns;
 +struct list_head wow_patterns;
 +};
 +
   //
   /*   LED Control*/
   //
 @@ -706,6 +719,13 @@ struct ath_softc {
  struct ath_ant_comb ant_comb;
  u8 ant_tx, ant_rx;
  struct dfs_pattern_detector *dfs_detector;
 +
 +#ifdef CONFIG_PM_SLEEP
 +bool wow_got_bmiss_intr;
 +bool wow_sleep_proc_intr; /* in the middle of WoW sleep ? */
 +u32 wow_intr_before_sleep;
 +struct ath9k_wow_info wow_info;
 +#endif
   };

   void ath9k_tasklet(unsigned long data);
 diff --git a/drivers/net/wireless/ath/ath9k/hw.h 
 b/drivers/net/wireless/ath/ath9k/hw.h
 index 03d5909..d0e14a3 100644
 --- a/drivers/net/wireless/ath/ath9k/hw.h
 +++ b/drivers/net/wireless/ath/ath9k/hw.h
 @@ -179,6 +179,24 @@
   #define PAPRD_TABLE_SZ 24
   #define PAPRD_IDEAL_AGC2_PWR_RANGE 0xe0

 +/* Wake on Wireless */
 +
 +#define MAX_PATTERN_SIZE256
 +#define MAX_PATTERN_MASK_SIZE   32
 +#define MAX_NUM_PATTERN 8
 +#define MAX_NUM_USER_PATTERN6 /*  deducting the 
 disassociate and
 +  deauthenticate packets */
 +
 +/*
 + * WoW trigger mapping to hardware code
 + */
 +
 +#define AH_WOW_USER_PATTERN_EN  BIT(0)
 +#define AH_WOW_MAGIC_PATTERN_EN BIT(1)
 +#define AH_WOW_LINK_CHANGE  BIT(2)
 +#define AH_WOW_BEACON_MISS  BIT(3)
 +#define AH_WOW_MAX_EVENTS   4
 Why do you need AH_WOW_MAX_EVENT? It looks like out of sync and also it is 
 never be used.

i will correct this out in v2. also found few more unused stuff, will 
correct it out. thanks for your review.

-- 
thanks,
shafi
___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel


Re: [ath9k-devel] [PATCH 03/10] ath9k_hw: Add WoW hardware capability flags

2012-06-19 Thread Mohammed Shafi Shajakhan
On Tuesday 19 June 2012 10:50 PM, Rajkumar Manoharan wrote:
 On Tue, Jun 19, 2012 at 09:17:23PM +0530, Mohammed Shafi Shajakhan wrote:
 From: Mohammed Shafi Shajakhanmoham...@qca.qualcomm.com

 have seperate wow capability flags for
 *basic wow support
 *device capable of matching exact user defined pattern
 or de-authentication/disassoc pattern
 *device such AR9280 requires first four bytes for
 all sort of patterns

 Cc: Senthil Balasubramaniansenth...@qca.qualcomm.com
 Cc: Rajkumar Manoharanrmano...@qca.qualcomm.com
 Cc: vadi...@qca.qualcomm.com
 Tested-by: Mohammed Shafi Shajakhanmoham...@qca.qualcomm.com
 Signed-off-by: Luis R. Rodriguezmcg...@qca.qualcomm.com
 Signed-off-by: Mohammed Shafi Shajakhanmoham...@qca.qualcomm.com
 ---
   drivers/net/wireless/ath/ath9k/hw.h |   20 
   1 files changed, 20 insertions(+), 0 deletions(-)

 diff --git a/drivers/net/wireless/ath/ath9k/hw.h 
 b/drivers/net/wireless/ath/ath9k/hw.h
 index d0e14a3..73a1238 100644
 --- a/drivers/net/wireless/ath/ath9k/hw.h
 +++ b/drivers/net/wireless/ath/ath9k/hw.h
 @@ -231,6 +231,23 @@ enum ath9k_hw_caps {
  ATH9K_HW_CAP_DFS= BIT(16),
   };

 +/*
 + * enum ath9k_hw_wow_caps - WoW device capabilities
 + * @ATH9K_HW_WOW_DEVICE_CAPABLE: device revision is capable of WoW.
 + * @ATH9K_HW_WOW_PATTERN_MATCH_EXACT: device is capable of matching
 + * an exact user defined pattern or de-authentication/disassoc pattern.
 + * @ATH9K_HW_WOW_PATTERN_MATCH_DWORD: device requires the first four
 + * bytes of the pattern for user defined pattern, de-authentication and
 + * disassociation patterns for all types of possible frames recieved
 + * of those types.
 + */
 +
 +enum ath9k_hw_wow_caps {
 +ATH9K_HW_WOW_DEVICE_CAPABLE = BIT(0),
 +ATH9K_HW_WOW_PATTERN_MATCH_EXACT= BIT(1),
 +ATH9K_HW_WOW_PATTERN_MATCH_DWORD= BIT(2),
 +};
 +
   struct ath9k_hw_capabilities {
  u32 hw_caps; /* ATH9K_HW_CAP_* from ath9k_hw_caps */
  u16 rts_aggr_limit;
 @@ -246,6 +263,9 @@ struct ath9k_hw_capabilities {
  u8 txs_len;
  u16 pcie_lcr_offset;
  bool pcie_lcr_extsync_en;
 +#ifdef  CONFIG_PM_SLEEP
 +enum ath9k_hw_wow_caps wow_caps;
 +#endif
 Why can't you align with existing HW_CAP_* flags? why do you need a separate
 place holder?

i just thought as there are three flags specific, it would be nice to 
have it as a seperate enumeration. Just found a bug that if 
CONFIG_PM_SLEEP it would be a problem. will address this in v2.

-- 
thanks,
shafi
___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel


Re: [ath9k-devel] [PATCH 05/10] ath9k: advertise supported WoW flags to upper layer

2012-06-19 Thread Mohammed Shafi Shajakhan
Hi Julian,


 On Wed, Jun 20, 2012 at 1:47 AM, Mohammed Shafi Shajakhan
 moham...@qca.qualcomm.com  wrote:
 From: Mohammed Shafi Shajakhanmoham...@qca.qualcomm.com

 currently the code supports WoW triggers due to
 *magic packet
 *user defined patterns
 *deauth and disassoc patterns
 *disconnect - beacon miss, last beacon received timeout,
 no ack for keeep alive frames.

 we need to support other WoW offload features in the
 near future. also a minor cleanup.

 Cc: Senthil Balasubramaniansenth...@qca.qualcomm.com
 Cc: Rajkumar Manoharanrmano...@qca.qualcomm.com
 Cc: vadi...@qca.qualcomm.com
 Tested-by: Mohammed Shafi Shajakhanmoham...@qca.qualcomm.com
 Signed-off-by: Luis R. Rodriguezmcg...@qca.qualcomm.com
 Signed-off-by: Mohammed Shafi Shajakhanmoham...@qca.qualcomm.com
 ---
   drivers/net/wireless/ath/ath9k/init.c |   20 ++--
   1 files changed, 18 insertions(+), 2 deletions(-)

 diff --git a/drivers/net/wireless/ath/ath9k/init.c 
 b/drivers/net/wireless/ath/ath9k/init.c
 index 9dfce1a..d08824f 100644
 --- a/drivers/net/wireless/ath/ath9k/init.c
 +++ b/drivers/net/wireless/ath/ath9k/init.c
 @@ -688,8 +688,8 @@ void ath9k_set_hw_capab(struct ath_softc *sc, struct 
 ieee80211_hw *hw)
 IEEE80211_HW_SPECTRUM_MGMT |
 IEEE80211_HW_REPORTS_TX_ACK_STATUS;

 -   if (sc-sc_ah-caps.hw_caps  ATH9K_HW_CAP_HT)
 -hw-flags |= IEEE80211_HW_AMPDU_AGGREGATION;
 +   if (ah-caps.hw_caps  ATH9K_HW_CAP_HT)
 +   hw-flags |= IEEE80211_HW_AMPDU_AGGREGATION;

 This doesn't look like it belongs with the rest of the patch.


its a minor cleanup, but would be best to do it separately. there is 
also another place i did this thing, thanks i will address in v2.

-- 
thanks,
shafi
___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel


Re: [ath9k-devel] [PATCH 07/10] ath9k_hw: Add hardware code for WoW

2012-06-19 Thread Mohammed Shafi Shajakhan
Hi Raj,

On Tuesday 19 June 2012 11:20 PM, Rajkumar Manoharan wrote:
 On Tue, Jun 19, 2012 at 09:17:27PM +0530, Mohammed Shafi Shajakhan wrote:
 From: Mohammed Shafi Shajakhanmoham...@qca.qualcomm.com

 add a new file wow.c which takes care of the hardware code
 for WoW.
 [...]
 ---
   3 files changed, 591 insertions(+), 0 deletions(-)
   create mode 100644 drivers/net/wireless/ath/ath9k/wow.c

 diff --git a/drivers/net/wireless/ath/ath9k/Makefile 
 b/drivers/net/wireless/ath/ath9k/Makefile
 index 9c41232..2ad8f94 100644
 --- a/drivers/net/wireless/ath/ath9k/Makefile
 +++ b/drivers/net/wireless/ath/ath9k/Makefile
 @@ -17,6 +17,7 @@ ath9k-$(CONFIG_ATH9K_DFS_CERTIFIED) += \
  dfs.o \
  dfs_pattern_detector.o \
  dfs_pri_detector.o
 +ath9k-$(CONFIG_PM_SLEEP) += wow.o

   obj-$(CONFIG_ATH9K) += ath9k.o

 diff --git a/drivers/net/wireless/ath/ath9k/hw.h 
 b/drivers/net/wireless/ath/ath9k/hw.h
 index 2a20216..8e417c1 100644
 --- a/drivers/net/wireless/ath/ath9k/hw.h
 +++ b/drivers/net/wireless/ath/ath9k/hw.h
 @@ -1110,6 +1110,37 @@ ath9k_hw_get_btcoex_scheme(struct ath_hw *ah)
   }
   #endif /* CONFIG_ATH9K_BTCOEX_SUPPORT */

 +
 +#ifdef CONFIG_PM_SLEEP
 +const char *ath9k_hw_wow_event_to_string(u32 wow_event);
 +void ath9k_hw_wow_apply_pattern(struct ath_hw *ah, u8 *user_pattern,
 +u8 *user_mask, int pattern_count,
 +int pattern_len);
 +u32 ath9k_hw_wow_wakeup(struct ath_hw *ah);
 +void ath9k_hw_wow_enable(struct ath_hw *ah, u32 pattern_enable);
 +#else
 +static inline const char *ath9k_hw_wow_event_to_string(u32 wow_event)
 +{
 +return NULL;
 +}
 +static inline void ath9k_hw_wow_apply_pattern(struct ath_hw *ah,
 +  u8 *user_pattern, u8 *user_mask,
 +  int pattern_count,
 +  int pattern_len)
 +{
 +return;
 +}
 No need to return void function and also fix indent for arguments

sorry, will address this.

 +static inline u32 ath9k_hw_wow_wakeup(struct ath_hw *ah)
 +{
 +return 0;
 +}
 +static inline void ath9k_hw_wow_enable(struct ath_hw *ah, u32 
 pattern_enable)
 +{
 +}
 +#endif
 +
 +
 +
   #define ATH9K_CLOCK_RATE_CCK   22
   #define ATH9K_CLOCK_RATE_5GHZ_OFDM 40
   #define ATH9K_CLOCK_RATE_2GHZ_OFDM 44
 diff --git a/drivers/net/wireless/ath/ath9k/wow.c 
 b/drivers/net/wireless/ath/ath9k/wow.c
 new file mode 100644
 index 000..66a7a74
 --- /dev/null
 +++ b/drivers/net/wireless/ath/ath9k/wow.c
 @@ -0,0 +1,559 @@
 +
 +/*
 + * Copyright (c) 2008-2011 Atheros Communications Inc.
 + *
 Please update the Copyright.

sure, thanks!


 +
 +#includelinux/export.h
 +#include ath9k.h
 +#include reg.h
 +#include hw-ops.h
 +
 [...]
 +if (AR_SREV_9285(ah) || AR_SREV_9287(ah))
 +set = AR9285_WA_DEFAULT;
 +else
 +set = AR9280_WA_DEFAULT;
 +
 +/*
 + * In AR9280 and AR9285, bit 14 in WA register
 + * (disable L1) should only be set when device
 + * enters D3 state and be cleared when device
 + * comes back to D0
 + */
 +
 +if (ah-config.pcie_waen  AR_WA_D3_L1_DISABLE)
 +set = set | AR_WA_D3_L1_DISABLE;
 +
 +clr = AR_WA_UNTIE_RESET_EN;
 +set = set | AR_WA_RESET_EN | AR_WA_POR_SHORT;
 simplify it as |=

oh ok ,sorry i missed it. thanks.


-- 
thanks,
shafi
___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel