summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Hemp <c.hemp@phytec.de>2013-10-04 11:36:03 +0200
committerJustin Waters <justin.waters@timesys.com>2013-11-12 11:44:12 -0500
commitdb29867c3a08bd41d83d260fc86ea8b88b242fac (patch)
treec43ad170e09e403521e415aece8023c3b9064297
parent5e2355acb73239c20752f7b9c3be4523e3db24dc (diff)
Added SDIO WiFi wl1271 support
Signed-off-by: Grigory Milev <g.milev@sam-solutions.net> Signed-off-by: Christian Hemp <c.hemp@phytec.de>
-rw-r--r--drivers/net/wireless/wl12xx/Kconfig2
-rw-r--r--drivers/net/wireless/wl12xx/main.c35
-rw-r--r--drivers/net/wireless/wl12xx/sdio.c1
3 files changed, 38 insertions, 0 deletions
diff --git a/drivers/net/wireless/wl12xx/Kconfig b/drivers/net/wireless/wl12xx/Kconfig
index 35ce7b0f4a60..1dc6a474e26e 100644
--- a/drivers/net/wireless/wl12xx/Kconfig
+++ b/drivers/net/wireless/wl12xx/Kconfig
@@ -1,6 +1,7 @@
menuconfig WL12XX_MENU
tristate "TI wl12xx driver support"
depends on MAC80211 && EXPERIMENTAL
+ select WEXT_PRIV
---help---
This will enable TI wl12xx driver support for the following chips:
wl1271, wl1273, wl1281 and wl1283.
@@ -12,6 +13,7 @@ config WL12XX
depends on INET
select FW_LOADER
select CRC7
+ select WIRELESS_EXT
---help---
This module adds support for wireless adapters based on TI wl1271 and
TI wl1273 chipsets. This module does *not* include support for wl1251.
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index e6497dc669df..f1ffec0b3bb6 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -1767,6 +1767,8 @@ static void wl1271_op_remove_interface(struct ieee80211_hw *hw,
mutex_unlock(&wl->mutex);
cancel_work_sync(&wl->recovery_work);
+ if (wl->set_power)
+ wl->set_power(0);
}
void wl1271_configure_filters(struct wl1271 *wl, unsigned int filters)
@@ -3781,9 +3783,39 @@ static ssize_t wl1271_sysfs_show_hw_pg_ver(struct device *dev,
static DEVICE_ATTR(hw_pg_ver, S_IRUGO | S_IWUSR,
wl1271_sysfs_show_hw_pg_ver, NULL);
+
+static int parse_mac(unsigned char *mac, unsigned char const *str_mac)
+{
+ int i = 0;
+ char *end;
+ int ret = -EINVAL;
+
+ for (;;) {
+ mac[i++] = simple_strtoul(str_mac, &end, 16);
+ if (i == 6) {
+ if (!*end || (*end == ' '))
+ ret = 0;
+ break;
+ }
+ str_mac = end + 1;
+ if ((*end != '-') && (*end != ':'))
+ break;
+ }
+ return ret;
+}
+
+static char *mac;
+module_param(mac, charp, S_IRUGO);
+MODULE_PARM_DESC(mac, "mac address override");
+
int wl1271_register_hw(struct wl1271 *wl)
{
int ret;
+ u8 override_mac[ETH_ALEN];
+ memset(override_mac, 0, ETH_ALEN);
+ if (mac)
+ if (parse_mac(override_mac, mac))
+ memset(override_mac, 0, ETH_ALEN);
if (wl->mac80211_registered)
return 0;
@@ -3804,6 +3836,9 @@ int wl1271_register_hw(struct wl1271 *wl)
wl->mac_addr[5] = nvs_ptr[3];
}
+ if (is_valid_ether_addr(override_mac))
+ memcpy(wl->mac_addr, override_mac, sizeof(wl->mac_addr));
+
SET_IEEE80211_PERM_ADDR(wl->hw, wl->mac_addr);
ret = ieee80211_register_hw(wl->hw);
diff --git a/drivers/net/wireless/wl12xx/sdio.c b/drivers/net/wireless/wl12xx/sdio.c
index 536e5065454b..5bd82f2c15ca 100644
--- a/drivers/net/wireless/wl12xx/sdio.c
+++ b/drivers/net/wireless/wl12xx/sdio.c
@@ -303,6 +303,7 @@ static int __devinit wl1271_probe(struct sdio_func *func,
/* Tell PM core that we don't need the card to be powered now */
pm_runtime_put_noidle(&func->dev);
+ wl->set_power = wlan_data->set_power;
wl1271_notice("initialized");
return 0;