* [PATCH 1/3] wl12xx: enable station mode
@ 2009-04-22 3:44 Bob Copeland
2009-04-22 3:44 ` [PATCH 2/3] wl12xx: remove sysfs file Bob Copeland
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Bob Copeland @ 2009-04-22 3:44 UTC (permalink / raw)
To: kalle.valo; +Cc: linux-wireless, Bob Copeland
Add the interface_modes bitmask.
Signed-off-by: Bob Copeland <me@bobcopeland.com>
---
Kalle, couple more minor updates here.
drivers/net/wireless/wl12xx/main.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 61e51bc..2e01295 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -1239,6 +1239,7 @@ static int wl12xx_init_ieee80211(struct wl12xx *wl)
wl->hw->flags = IEEE80211_HW_SIGNAL_DBM |
IEEE80211_HW_NOISE_DBM;
+ wl->hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION);
wl->hw->wiphy->max_scan_ssids = 1;
wl->hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &wl12xx_band_2ghz;
--
1.6.0.6
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/3] wl12xx: remove sysfs file
2009-04-22 3:44 [PATCH 1/3] wl12xx: enable station mode Bob Copeland
@ 2009-04-22 3:44 ` Bob Copeland
2009-04-22 19:54 ` Kalle Valo
2009-04-22 3:44 ` [PATCH 3/3] wl12xx: remove struct platform device Bob Copeland
2009-04-22 19:54 ` [PATCH 1/3] wl12xx: enable station mode Kalle Valo
2 siblings, 1 reply; 6+ messages in thread
From: Bob Copeland @ 2009-04-22 3:44 UTC (permalink / raw)
To: kalle.valo; +Cc: linux-wireless, Bob Copeland
Remove tx_mgmt_frm_rate file since we don't need it.
Signed-off-by: Bob Copeland <me@bobcopeland.com>
---
drivers/net/wireless/wl12xx/main.c | 152 ------------------------------------
1 files changed, 0 insertions(+), 152 deletions(-)
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 2e01295..7f2da39 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -44,151 +44,6 @@
#include "init.h"
#include "netlink.h"
-static ssize_t wl12xx_sysfs_show_tx_mgmt_frm_rate(struct device *dev,
- struct device_attribute *attr,
- char *buf)
-{
- struct wl12xx *wl = dev_get_drvdata(dev);
- ssize_t len;
- int val;
-
- /* FIXME: what's the maximum length of buf? page size?*/
- len = 500;
-
- switch (wl->tx_mgmt_frm_rate) {
- /* skip 1 and 12 Mbps because they have same value 0x0a */
- case RATE_2MBPS:
- val = 20;
- break;
- case RATE_5_5MBPS:
- val = 55;
- break;
- case RATE_11MBPS:
- val = 110;
- break;
- case RATE_6MBPS:
- val = 60;
- break;
- case RATE_9MBPS:
- val = 90;
- break;
- case RATE_12MBPS:
- val = 120;
- break;
- case RATE_18MBPS:
- val = 180;
- break;
- case RATE_24MBPS:
- val = 240;
- break;
- case RATE_36MBPS:
- val = 360;
- break;
- case RATE_48MBPS:
- val = 480;
- break;
- case RATE_54MBPS:
- val = 540;
- break;
- default:
- val = 10;
- }
-
- /* for 1 and 12 Mbps we have to check the modulation */
- if (wl->tx_mgmt_frm_rate == RATE_1MBPS) {
- switch (wl->tx_mgmt_frm_rate) {
- case CCK_LONG:
- val = 10;
- break;
- case OFDM:
- val = 120;
- break;
- default:
- val = 10;
- break;
- }
- }
- len = snprintf(buf, len, "%d", val);
-
- return len;
-}
-
-static ssize_t wl12xx_sysfs_store_tx_mgmt_frm_rate(struct device *dev,
- struct device_attribute *attr,
- const char *buf, size_t count)
-{
- struct wl12xx *wl = dev_get_drvdata(dev);
- unsigned long res;
- int ret;
-
- ret = strict_strtoul(buf, 10, &res);
-
- if (ret < 0) {
- wl12xx_warning("incorrect value written to tx_mgmt_frm_rate");
- return 0;
- }
-
- switch (res) {
- case 10:
- wl->tx_mgmt_frm_rate = RATE_1MBPS;
- wl->tx_mgmt_frm_mod = CCK_LONG;
- break;
- case 20:
- wl->tx_mgmt_frm_rate = RATE_2MBPS;
- wl->tx_mgmt_frm_mod = CCK_LONG;
- break;
- case 55:
- wl->tx_mgmt_frm_rate = RATE_5_5MBPS;
- wl->tx_mgmt_frm_mod = CCK_LONG;
- break;
- case 110:
- wl->tx_mgmt_frm_rate = RATE_11MBPS;
- wl->tx_mgmt_frm_mod = CCK_LONG;
- break;
- case 60:
- wl->tx_mgmt_frm_rate = RATE_6MBPS;
- wl->tx_mgmt_frm_mod = OFDM;
- break;
- case 90:
- wl->tx_mgmt_frm_rate = RATE_9MBPS;
- wl->tx_mgmt_frm_mod = OFDM;
- break;
- case 120:
- wl->tx_mgmt_frm_rate = RATE_12MBPS;
- wl->tx_mgmt_frm_mod = OFDM;
- break;
- case 180:
- wl->tx_mgmt_frm_rate = RATE_18MBPS;
- wl->tx_mgmt_frm_mod = OFDM;
- break;
- case 240:
- wl->tx_mgmt_frm_rate = RATE_24MBPS;
- wl->tx_mgmt_frm_mod = OFDM;
- break;
- case 360:
- wl->tx_mgmt_frm_rate = RATE_36MBPS;
- wl->tx_mgmt_frm_mod = OFDM;
- break;
- case 480:
- wl->tx_mgmt_frm_rate = RATE_48MBPS;
- wl->tx_mgmt_frm_mod = OFDM;
- break;
- case 540:
- wl->tx_mgmt_frm_rate = RATE_54MBPS;
- wl->tx_mgmt_frm_mod = OFDM;
- break;
- default:
- wl12xx_warning("incorrect value written to tx_mgmt_frm_rate");
- return 0;
- }
-
- return count;
-}
-
-static DEVICE_ATTR(tx_mgmt_frm_rate, S_IRUGO | S_IWUSR,
- wl12xx_sysfs_show_tx_mgmt_frm_rate,
- wl12xx_sysfs_store_tx_mgmt_frm_rate);
-
static void wl12xx_disable_interrupts(struct wl12xx *wl)
{
disable_irq(gpio_to_irq(wl->config->irq_gpio));
@@ -1402,13 +1257,6 @@ static int __devinit wl12xx_probe(struct spi_device *spi)
if (ret)
goto out_register_hw;
- ret = device_create_file(&wl12xx_device.dev,
- &dev_attr_tx_mgmt_frm_rate);
- if (ret < 0) {
- wl12xx_error("failed to create sysfs file tx_mgmt_frm_rate");
- goto out_register_hw;
- }
-
wl12xx_notice("initialized");
return 0;
--
1.6.0.6
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/3] wl12xx: remove struct platform device
2009-04-22 3:44 [PATCH 1/3] wl12xx: enable station mode Bob Copeland
2009-04-22 3:44 ` [PATCH 2/3] wl12xx: remove sysfs file Bob Copeland
@ 2009-04-22 3:44 ` Bob Copeland
2009-04-22 19:55 ` Kalle Valo
2009-04-22 19:54 ` [PATCH 1/3] wl12xx: enable station mode Kalle Valo
2 siblings, 1 reply; 6+ messages in thread
From: Bob Copeland @ 2009-04-22 3:44 UTC (permalink / raw)
To: kalle.valo; +Cc: linux-wireless, Bob Copeland
As far as I can tell this was only for the sysfs file, so now
that it's gone we can kill the wl12xx_device struct.
Signed-off-by: Bob Copeland <me@bobcopeland.com>
---
drivers/net/wireless/wl12xx/acx.c | 1 -
drivers/net/wireless/wl12xx/cmd.c | 1 -
drivers/net/wireless/wl12xx/main.c | 31 ++-----------------------------
drivers/net/wireless/wl12xx/spi.c | 1 -
4 files changed, 2 insertions(+), 32 deletions(-)
diff --git a/drivers/net/wireless/wl12xx/acx.c b/drivers/net/wireless/wl12xx/acx.c
index b90310d..be01417 100644
--- a/drivers/net/wireless/wl12xx/acx.c
+++ b/drivers/net/wireless/wl12xx/acx.c
@@ -1,7 +1,6 @@
#include "acx.h"
#include <linux/module.h>
-#include <linux/platform_device.h>
#include <linux/crc7.h>
#include <linux/spi/spi.h>
diff --git a/drivers/net/wireless/wl12xx/cmd.c b/drivers/net/wireless/wl12xx/cmd.c
index 93eb843..2f07bf2 100644
--- a/drivers/net/wireless/wl12xx/cmd.c
+++ b/drivers/net/wireless/wl12xx/cmd.c
@@ -1,7 +1,6 @@
#include "cmd.h"
#include <linux/module.h>
-#include <linux/platform_device.h>
#include <linux/crc7.h>
#include <linux/spi/spi.h>
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 7f2da39..0bfa3da 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -22,7 +22,6 @@
*/
#include <linux/module.h>
-#include <linux/platform_device.h>
#include <linux/interrupt.h>
#include <linux/firmware.h>
#include <linux/delay.h>
@@ -1103,21 +1102,6 @@ static int wl12xx_init_ieee80211(struct wl12xx *wl)
return 0;
}
-static void wl12xx_device_release(struct device *dev)
-{
-
-}
-
-static struct platform_device wl12xx_device = {
- .name = "wl12xx",
- .id = -1,
-
- /* device model insists to have a release function */
- .dev = {
- .release = wl12xx_device_release,
- },
-};
-
#define WL12XX_DEFAULT_CHANNEL 1
static int __devinit wl12xx_probe(struct spi_device *spi)
{
@@ -1238,20 +1222,13 @@ static int __devinit wl12xx_probe(struct spi_device *spi)
disable_irq(gpio_to_irq(wl->config->irq_gpio));
- ret = platform_device_register(&wl12xx_device);
- if (ret) {
- wl12xx_error("couldn't register platform device");
- goto out_irq;
- }
- dev_set_drvdata(&wl12xx_device.dev, wl);
-
ret = wl12xx_init_ieee80211(wl);
if (ret)
- goto out_platform;
+ goto out_irq;
ret = wl12xx_register_hw(wl);
if (ret)
- goto out_platform;
+ goto out_irq;
ret = wl12xx_nl_register();
if (ret)
@@ -1265,9 +1242,6 @@ static int __devinit wl12xx_probe(struct spi_device *spi)
ieee80211_unregister_hw(hw);
wl->mac80211_registered = false;
- out_platform:
- platform_device_unregister(&wl12xx_device);
-
out_irq:
free_irq(gpio_to_irq(wl->config->irq_gpio), wl);
@@ -1288,7 +1262,6 @@ static int __devexit wl12xx_remove(struct spi_device *spi)
struct wl12xx *wl = dev_get_drvdata(&spi->dev);
ieee80211_unregister_hw(wl->hw);
- platform_device_unregister(&wl12xx_device);
free_irq(gpio_to_irq(wl->config->irq_gpio), wl);
gpio_free(wl->config->power_gpio);
gpio_free(wl->config->irq_gpio);
diff --git a/drivers/net/wireless/wl12xx/spi.c b/drivers/net/wireless/wl12xx/spi.c
index 939aae7..4b4688e 100644
--- a/drivers/net/wireless/wl12xx/spi.c
+++ b/drivers/net/wireless/wl12xx/spi.c
@@ -22,7 +22,6 @@
*/
#include <linux/module.h>
-#include <linux/platform_device.h>
#include <linux/crc7.h>
#include <linux/spi/spi.h>
--
1.6.0.6
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/3] wl12xx: enable station mode
2009-04-22 3:44 [PATCH 1/3] wl12xx: enable station mode Bob Copeland
2009-04-22 3:44 ` [PATCH 2/3] wl12xx: remove sysfs file Bob Copeland
2009-04-22 3:44 ` [PATCH 3/3] wl12xx: remove struct platform device Bob Copeland
@ 2009-04-22 19:54 ` Kalle Valo
2 siblings, 0 replies; 6+ messages in thread
From: Kalle Valo @ 2009-04-22 19:54 UTC (permalink / raw)
To: Bob Copeland; +Cc: linux-wireless
Bob Copeland <me@bobcopeland.com> writes:
> Add the interface_modes bitmask.
Applied.
--
Kalle Valo
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/3] wl12xx: remove sysfs file
2009-04-22 3:44 ` [PATCH 2/3] wl12xx: remove sysfs file Bob Copeland
@ 2009-04-22 19:54 ` Kalle Valo
0 siblings, 0 replies; 6+ messages in thread
From: Kalle Valo @ 2009-04-22 19:54 UTC (permalink / raw)
To: Bob Copeland; +Cc: linux-wireless
Bob Copeland <me@bobcopeland.com> writes:
> Remove tx_mgmt_frm_rate file since we don't need it.
I agree. I made this hack because our RF engineers needed, it shouldn't
be in upstream version.
--
Kalle Valo
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 3/3] wl12xx: remove struct platform device
2009-04-22 3:44 ` [PATCH 3/3] wl12xx: remove struct platform device Bob Copeland
@ 2009-04-22 19:55 ` Kalle Valo
0 siblings, 0 replies; 6+ messages in thread
From: Kalle Valo @ 2009-04-22 19:55 UTC (permalink / raw)
To: Bob Copeland; +Cc: linux-wireless
Bob Copeland <me@bobcopeland.com> writes:
> As far as I can tell this was only for the sysfs file, so now
> that it's gone we can kill the wl12xx_device struct.
Agree, applied.
--
Kalle Valo
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-04-22 19:55 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-22 3:44 [PATCH 1/3] wl12xx: enable station mode Bob Copeland
2009-04-22 3:44 ` [PATCH 2/3] wl12xx: remove sysfs file Bob Copeland
2009-04-22 19:54 ` Kalle Valo
2009-04-22 3:44 ` [PATCH 3/3] wl12xx: remove struct platform device Bob Copeland
2009-04-22 19:55 ` Kalle Valo
2009-04-22 19:54 ` [PATCH 1/3] wl12xx: enable station mode Kalle Valo
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).