linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gery Kahn <geryk@ti.com>
To: <linux-wireless@vger.kernel.org>
Cc: Luciano Coelho <luciano.coelho@nokia.com>
Subject: [PATCH v2] Ability to set reference clock as module parameter
Date: Mon, 11 Oct 2010 13:41:49 +0200	[thread overview]
Message-ID: <1286797309-22786-1-git-send-email-geryk@ti.com> (raw)

v2 Cleaned changes from development

Option to set reference clock as module param, debugfs readonly permanent 
MAC address

Signed-off-by: Gery Kahn <geryk@ti.com>
---
 arch/arm/mach-omap2/board-zoom-peripherals.c |    2 +-
 drivers/net/wireless/wl12xx/wl1271.h         |    3 ++-
 drivers/net/wireless/wl12xx/wl1271_debugfs.c |    5 ++++-
 drivers/net/wireless/wl12xx/wl1271_main.c    |    3 +++
 drivers/net/wireless/wl12xx/wl1271_sdio.c    |    9 ++++++++-
 5 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c
index 287ffcb..d1a8870 100644
--- a/arch/arm/mach-omap2/board-zoom-peripherals.c
+++ b/arch/arm/mach-omap2/board-zoom-peripherals.c
@@ -190,7 +190,7 @@ static struct platform_device omap_vwlan_device = {
 struct wl12xx_platform_data omap_zoom_wlan_data __initdata = {
 	.irq = OMAP_GPIO_IRQ(OMAP_ZOOM_WLAN_IRQ_GPIO),
 	/* ZOOM ref clock is 26 MHz */
-	.board_ref_clock = 1,
+	.board_ref_clock = WL12XX_REFCLOCK_26,
 };
 
 static struct omap2_hsmmc_info mmc[] __initdata = {
diff --git a/drivers/net/wireless/wl12xx/wl1271.h b/drivers/net/wireless/wl12xx/wl1271.h
index 9b8ba82..bb94b95 100644
--- a/drivers/net/wireless/wl12xx/wl1271.h
+++ b/drivers/net/wireless/wl12xx/wl1271.h
@@ -273,6 +273,7 @@ struct wl1271_debugfs {
 
 	struct dentry *retry_count;
 	struct dentry *excessive_retries;
+	struct dentry *ref_clk;
 	struct dentry *gpio_power;
 };
 
diff --git a/drivers/net/wireless/wl12xx/wl1271_debugfs.c b/drivers/net/wireless/wl12xx/wl1271_debugfs.c
index c239ef4..db67acc 100644
--- a/drivers/net/wireless/wl12xx/wl1271_debugfs.c
+++ b/drivers/net/wireless/wl12xx/wl1271_debugfs.c
@@ -35,7 +35,6 @@
 #define WL1271_DEBUGFS_STATS_LIFETIME 1000
 
 /* debugfs macros idea from mac80211 */
-
 #define DEBUGFS_READONLY_FILE(name, buflen, fmt, value...)		\
 static ssize_t name## _read(struct file *file, char __user *userbuf,	\
 			    size_t count, loff_t *ppos)			\
@@ -219,6 +218,8 @@ DEBUGFS_FWSTATS_FILE(rxpipe, tx_xfr_host_int_trig_rx_data, 20, "%u");
 DEBUGFS_READONLY_FILE(retry_count, 20, "%u", wl->stats.retry_count);
 DEBUGFS_READONLY_FILE(excessive_retries, 20, "%u",
 		      wl->stats.excessive_retries);
+DEBUGFS_READONLY_FILE(ref_clk, 3, "%d", wl->ref_clock);
+
 
 static ssize_t tx_queue_len_read(struct file *file, char __user *userbuf,
 				 size_t count, loff_t *ppos)
@@ -390,6 +391,7 @@ static void wl1271_debugfs_delete_files(struct wl1271 *wl)
 	DEBUGFS_DEL(tx_queue_len);
 	DEBUGFS_DEL(retry_count);
 	DEBUGFS_DEL(excessive_retries);
+	DEBUGFS_DEL(ref_clk);
 
 	DEBUGFS_DEL(gpio_power);
 }
@@ -492,6 +494,7 @@ static int wl1271_debugfs_add_files(struct wl1271 *wl)
 	DEBUGFS_ADD(tx_queue_len, wl->debugfs.rootdir);
 	DEBUGFS_ADD(retry_count, wl->debugfs.rootdir);
 	DEBUGFS_ADD(excessive_retries, wl->debugfs.rootdir);
+	DEBUGFS_ADD(ref_clk, wl->debugfs.rootdir);
 
 	DEBUGFS_ADD(gpio_power, wl->debugfs.rootdir);
 
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c
index adcbffb..c1a111e 100644
--- a/drivers/net/wireless/wl12xx/wl1271_main.c
+++ b/drivers/net/wireless/wl12xx/wl1271_main.c
@@ -946,6 +946,9 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw,
 
 	memcpy(wl->mac_addr, vif->addr, ETH_ALEN);
 
+	/* update MAC address in wiphy struct */
+	memcpy(wiphy->perm_addr, vif->addr, ETH_ALEN);
+
 	if (wl->state != WL1271_STATE_OFF) {
 		wl1271_error("cannot start because not in off state: %d",
 			     wl->state);
diff --git a/drivers/net/wireless/wl12xx/wl1271_sdio.c b/drivers/net/wireless/wl12xx/wl1271_sdio.c
index e359cdd..697716e 100644
--- a/drivers/net/wireless/wl12xx/wl1271_sdio.c
+++ b/drivers/net/wireless/wl12xx/wl1271_sdio.c
@@ -44,6 +44,10 @@
 #define SDIO_DEVICE_ID_TI_WL1271	0x4076
 #endif
 
+static int modparam_ref_clk;
+module_param_named(ref_clk, modparam_ref_clk, int, 0444);
+MODULE_PARM_DESC(ref_clk, "Set reference clock");
+
 static const struct sdio_device_id wl1271_devices[] = {
 	{ SDIO_DEVICE(SDIO_VENDOR_ID_TI, SDIO_DEVICE_ID_TI_WL1271) },
 	{}
@@ -237,7 +241,10 @@ static int __devinit wl1271_probe(struct sdio_func *func,
 	}
 
 	wl->irq = wlan_data->irq;
-	wl->ref_clock = wlan_data->board_ref_clock;
+	if (modparam_ref_clk)
+		wl->ref_clock =  modparam_ref_clk;
+	else
+		wl->ref_clock = wlan_data->board_ref_clock;
 
 	ret = request_irq(wl->irq, wl1271_irq, 0, DRIVER_NAME, wl);
 	if (ret < 0) {
-- 
1.7.0.4


             reply	other threads:[~2010-10-11 11:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-11 11:41 Gery Kahn [this message]
2010-10-11 11:57 ` [PATCH v2] Ability to set reference clock as module parameter Luciano Coelho

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=1286797309-22786-1-git-send-email-geryk@ti.com \
    --to=geryk@ti.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luciano.coelho@nokia.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).