linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kalle Valo <kalle.valo@iki.fi>
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH 08/16] wl1251: Add acx command to set tbtt and dtim period
Date: Tue, 17 Nov 2009 18:49:08 +0200	[thread overview]
Message-ID: <20091117164907.2236.41929.stgit@tikku> (raw)
In-Reply-To: <20091117164614.2236.8543.stgit@tikku>

From: Vidhya Govindan <vidhya.govindan@nokia.com>

The dtim period obtained from the mac80211 is not set to the firmware.
This patch implements the acx command to set correct tbtt and dtim value
to the firmware.

Signed-off-by: Vidhya Govindan <vidhya.govindan@nokia.com>
Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
Reviewed-by: Janne Ylalehto <janne.ylalehto@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
---

 drivers/net/wireless/wl12xx/wl1251_acx.c |   28 ++++++++++++++++++++++++++++
 drivers/net/wireless/wl12xx/wl1251_acx.h |   18 ++++++++++++++++++
 2 files changed, 46 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/wl1251_acx.c b/drivers/net/wireless/wl12xx/wl1251_acx.c
index 50633e0..acfa086 100644
--- a/drivers/net/wireless/wl12xx/wl1251_acx.c
+++ b/drivers/net/wireless/wl12xx/wl1251_acx.c
@@ -948,3 +948,31 @@ out:
 	kfree(mem_conf);
 	return ret;
 }
+
+int wl1251_acx_wr_tbtt_and_dtim(struct wl1251 *wl, u16 tbtt, u8 dtim)
+{
+	struct wl1251_acx_wr_tbtt_and_dtim *acx;
+	int ret;
+
+	wl1251_debug(DEBUG_ACX, "acx tbtt and dtim");
+
+	acx = kzalloc(sizeof(*acx), GFP_KERNEL);
+	if (!acx) {
+		ret = -ENOMEM;
+		goto out;
+	}
+
+	acx->tbtt = tbtt;
+	acx->dtim = dtim;
+
+	ret = wl1251_cmd_configure(wl, ACX_WR_TBTT_AND_DTIM,
+				   acx, sizeof(*acx));
+	if (ret < 0) {
+		wl1251_warning("failed to set tbtt and dtim: %d", ret);
+		goto out;
+	}
+
+out:
+	kfree(acx);
+	return ret;
+}
diff --git a/drivers/net/wireless/wl12xx/wl1251_acx.h b/drivers/net/wireless/wl12xx/wl1251_acx.h
index ce1c995..44a4b04 100644
--- a/drivers/net/wireless/wl12xx/wl1251_acx.h
+++ b/drivers/net/wireless/wl12xx/wl1251_acx.h
@@ -1149,6 +1149,23 @@ struct wl1251_acx_mem_map {
 	u32 num_rx_mem_blocks;
 } __attribute__ ((packed));
 
+
+struct wl1251_acx_wr_tbtt_and_dtim {
+
+	struct acx_header header;
+
+	/* Time in TUs between two consecutive beacons */
+	u16 tbtt;
+
+	/*
+	 * DTIM period
+	 * For BSS: Number of TBTTs in a DTIM period (range: 1-10)
+	 * For IBSS: value shall be set to 1
+	*/
+	u8  dtim;
+	u8  padding;
+} __attribute__ ((packed));
+
 /*************************************************************************
 
     Host Interrupt Register (WiLink -> Host)
@@ -1304,5 +1321,6 @@ int wl1251_acx_statistics(struct wl1251 *wl, struct acx_statistics *stats);
 int wl1251_acx_tsf_info(struct wl1251 *wl, u64 *mactime);
 int wl1251_acx_rate_policies(struct wl1251 *wl);
 int wl1251_acx_mem_cfg(struct wl1251 *wl);
+int wl1251_acx_wr_tbtt_and_dtim(struct wl1251 *wl, u16 tbtt, u8 dtim);
 
 #endif /* __WL1251_ACX_H__ */


  parent reply	other threads:[~2009-11-17 16:49 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-17 16:48 [PATCH 00/16] wl1251: beacon filter support and more Kalle Valo
2009-11-17 16:48 ` [PATCH 01/16] wl1251: Add connection monitoring configuration Kalle Valo
2009-11-17 16:48 ` [PATCH 02/16] wl1251: Enable beacon filtering with the stack Kalle Valo
2009-11-17 16:48 ` [PATCH 03/16] wl1251: Configure beacon filtering on if PSM used Kalle Valo
2009-11-17 16:48 ` [PATCH 04/16] wl1251: Implement delayed entry into ELP mode Kalle Valo
2009-11-17 16:48 ` [PATCH 05/16] wl1251: allocate space for firmware with vmalloc() Kalle Valo
2009-11-17 16:48 ` [PATCH 06/16] wl1251: fix deadlock with ieee80211 beacon filter calls Kalle Valo
2009-11-17 17:01   ` Johannes Berg
2009-11-17 17:10     ` Kalle Valo
2009-11-17 16:49 ` [PATCH 07/16] wl1251: mask aid bits 14 and 15 in ps-poll template Kalle Valo
2009-11-17 16:49 ` Kalle Valo [this message]
2009-11-17 16:49 ` [PATCH 09/16] wl1251: Set the correct dtim period to the firmware Kalle Valo
2009-11-17 16:49 ` [PATCH 10/16] wl1251: Increase the beacon loss timeout value and handle regain event Kalle Valo
2009-11-17 16:49 ` [PATCH 11/16] wl1251: Add IRQ looping support Kalle Valo
2009-11-17 16:49 ` [PATCH 12/16] wl1251: Filter out unwanted events Kalle Valo
2009-11-17 16:49 ` [PATCH 13/16] wl1251: Fix regression in IRQ loop handling Kalle Valo
2009-11-17 16:49 ` [PATCH 14/16] wl1251: Send null data packet with "TODS" bit set Kalle Valo
2009-11-17 16:50 ` [PATCH 15/16] wl1251: remove depcreated qual usage Kalle Valo
2009-11-17 16:50 ` [PATCH 16/16] wl1251: add NVS in EEPROM support Kalle Valo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091117164907.2236.41929.stgit@tikku \
    --to=kalle.valo@iki.fi \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).