* (no subject)
From: Jeffrey (Sheng-Hui) Chu @ 2013-07-08 21:52 UTC (permalink / raw)
To: linux-wireless@vger.kernel.org
>From b4555081b1d27a31c22abede8e0397f1d61fbb04 Mon Sep 17 00:00:00 2001
From: Jeffrey Chu <jeffchu@broadcom.com>
Date: Mon, 8 Jul 2013 17:50:21 -0400
Subject: [PATCH] Add bcm2079x-i2c driver for Bcm2079x NFC Controller.
Signed-off-by: Jeffrey Chu <jeffchu@broadcom.com>
---
drivers/nfc/Kconfig | 1 +
drivers/nfc/Makefile | 1 +
drivers/nfc/bcm2079x/Kconfig | 10 +
drivers/nfc/bcm2079x/Makefile | 4 +
drivers/nfc/bcm2079x/bcm2079x-i2c.c | 416 +++++++++++++++++++++++++++++++++++
drivers/nfc/bcm2079x/bcm2079x.h | 34 +++
6 files changed, 466 insertions(+)
create mode 100644 drivers/nfc/bcm2079x/Kconfig
create mode 100644 drivers/nfc/bcm2079x/Makefile
create mode 100644 drivers/nfc/bcm2079x/bcm2079x-i2c.c
create mode 100644 drivers/nfc/bcm2079x/bcm2079x.h
diff --git a/drivers/nfc/Kconfig b/drivers/nfc/Kconfig
index 74a852e..fa540f4 100644
--- a/drivers/nfc/Kconfig
+++ b/drivers/nfc/Kconfig
@@ -38,5 +38,6 @@ config NFC_MEI_PHY
source "drivers/nfc/pn544/Kconfig"
source "drivers/nfc/microread/Kconfig"
+source "drivers/nfc/bcm2079x/Kconfig"
endmenu
diff --git a/drivers/nfc/Makefile b/drivers/nfc/Makefile
index aa6bd65..a56adf6 100644
--- a/drivers/nfc/Makefile
+++ b/drivers/nfc/Makefile
@@ -7,5 +7,6 @@ obj-$(CONFIG_NFC_MICROREAD) += microread/
obj-$(CONFIG_NFC_PN533) += pn533.o
obj-$(CONFIG_NFC_WILINK) += nfcwilink.o
obj-$(CONFIG_NFC_MEI_PHY) += mei_phy.o
+obj-$(CONFIG_NFC_PN544) += bcm2079x/
ccflags-$(CONFIG_NFC_DEBUG) := -DDEBUG
diff --git a/drivers/nfc/bcm2079x/Kconfig b/drivers/nfc/bcm2079x/Kconfig
new file mode 100644
index 0000000..889e181
--- /dev/null
+++ b/drivers/nfc/bcm2079x/Kconfig
@@ -0,0 +1,10 @@
+config NFC_BCM2079X_I2C
+ tristate "NFC BCM2079x i2c support"
+ depends on I2C
+ default n
+ ---help---
+ Broadcom BCM2079x i2c driver.
+ This is a driver that allows transporting NCI/HCI command and response
+ to/from Broadcom bcm2079x NFC Controller. Select this if your
+ platform is using i2c bus to controll this chip.
+
diff --git a/drivers/nfc/bcm2079x/Makefile b/drivers/nfc/bcm2079x/Makefile
new file mode 100644
index 0000000..be64d35
--- /dev/null
+++ b/drivers/nfc/bcm2079x/Makefile
@@ -0,0 +1,4 @@
+#
+# Makefile for bcm2079x NFC driver
+#
+obj-$(CONFIG_NFC_BCM2079X_I2C) += bcm2079x-i2c.o
diff --git a/drivers/nfc/bcm2079x/bcm2079x-i2c.c b/drivers/nfc/bcm2079x/bcm2079x-i2c.c
new file mode 100644
index 0000000..988a65e
--- /dev/null
+++ b/drivers/nfc/bcm2079x/bcm2079x-i2c.c
@@ -0,0 +1,416 @@
+/*
+ * Copyright (C) 2013 Broadcom Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/fs.h>
+#include <linux/slab.h>
+#include <linux/i2c.h>
+#include <linux/irq.h>
+#include <linux/interrupt.h>
+#include <linux/gpio.h>
+#include <linux/miscdevice.h>
+#include <linux/spinlock.h>
+#include <linux/poll.h>
+
+#include "bcm2079x.h"
+
+/* do not change below */
+#define MAX_BUFFER_SIZE 780
+
+/* Read data */
+#define PACKET_HEADER_SIZE_NCI (4)
+#define PACKET_HEADER_SIZE_HCI (3)
+#define PACKET_TYPE_NCI (16)
+#define PACKET_TYPE_HCIEV (4)
+#define MAX_PACKET_SIZE (PACKET_HEADER_SIZE_NCI + 255)
+
+struct bcm2079x_dev {
+ wait_queue_head_t read_wq;
+ struct mutex read_mutex;
+ struct i2c_client *client;
+ struct miscdevice bcm2079x_device;
+ unsigned int wake_gpio;
+ unsigned int en_gpio;
+ unsigned int irq_gpio;
+ bool irq_enabled;
+ spinlock_t irq_enabled_lock;
+ unsigned int count_irq;
+};
+
+static void bcm2079x_init_stat(struct bcm2079x_dev *bcm2079x_dev)
+{
+ bcm2079x_dev->count_irq = 0;
+}
+
+static void bcm2079x_disable_irq(struct bcm2079x_dev *bcm2079x_dev)
+{
+ unsigned long flags;
+ spin_lock_irqsave(&bcm2079x_dev->irq_enabled_lock, flags);
+ if (bcm2079x_dev->irq_enabled) {
+ disable_irq_nosync(bcm2079x_dev->client->irq);
+ bcm2079x_dev->irq_enabled = false;
+ }
+ spin_unlock_irqrestore(&bcm2079x_dev->irq_enabled_lock, flags);
+}
+
+static void bcm2079x_enable_irq(struct bcm2079x_dev *bcm2079x_dev)
+{
+ unsigned long flags;
+ spin_lock_irqsave(&bcm2079x_dev->irq_enabled_lock, flags);
+ if (!bcm2079x_dev->irq_enabled) {
+ bcm2079x_dev->irq_enabled = true;
+ enable_irq(bcm2079x_dev->client->irq);
+ }
+ spin_unlock_irqrestore(&bcm2079x_dev->irq_enabled_lock, flags);
+}
+
+static void set_client_addr(struct bcm2079x_dev *bcm2079x_dev, int addr)
+{
+ struct i2c_client *client = bcm2079x_dev->client;
+ dev_info(&client->dev,
+ "Set client device address from 0x%04X flag = "
+ "%02x, to 0x%04X\n",
+ client->addr, client->flags, addr);
+ client->addr = addr;
+ if (addr < 0x80)
+ client->flags &= ~I2C_CLIENT_TEN;
+ else
+ client->flags |= I2C_CLIENT_TEN;
+}
+
+static irqreturn_t bcm2079x_dev_irq_handler(int irq, void *dev_id)
+{
+ struct bcm2079x_dev *bcm2079x_dev = dev_id;
+ unsigned long flags;
+
+ spin_lock_irqsave(&bcm2079x_dev->irq_enabled_lock, flags);
+ bcm2079x_dev->count_irq++;
+ spin_unlock_irqrestore(&bcm2079x_dev->irq_enabled_lock, flags);
+ wake_up(&bcm2079x_dev->read_wq);
+
+ return IRQ_HANDLED;
+}
+
+static unsigned int bcm2079x_dev_poll(struct file *filp, poll_table *wait)
+{
+ struct bcm2079x_dev *bcm2079x_dev = filp->private_data;
+ unsigned int mask = 0;
+ unsigned long flags;
+
+ poll_wait(filp, &bcm2079x_dev->read_wq, wait);
+
+ spin_lock_irqsave(&bcm2079x_dev->irq_enabled_lock, flags);
+ if (bcm2079x_dev->count_irq > 0) {
+ bcm2079x_dev->count_irq--;
+ mask |= POLLIN | POLLRDNORM;
+ }
+ spin_unlock_irqrestore(&bcm2079x_dev->irq_enabled_lock, flags);
+
+ return mask;
+}
+
+static ssize_t bcm2079x_dev_read(struct file *filp, char __user *buf,
+ size_t count, loff_t *offset)
+{
+ struct bcm2079x_dev *bcm2079x_dev = filp->private_data;
+ unsigned char tmp[MAX_BUFFER_SIZE];
+ int total, len, ret;
+
+ total = 0;
+ len = 0;
+
+ if (count > MAX_BUFFER_SIZE)
+ count = MAX_BUFFER_SIZE;
+
+ mutex_lock(&bcm2079x_dev->read_mutex);
+
+ /* Read the first 4 bytes to include the length of the NCI or
+ HCI packet.*/
+ ret = i2c_master_recv(bcm2079x_dev->client, tmp, 4);
+ if (ret == 4) {
+ total = ret;
+ /* First byte is the packet type*/
+ switch (tmp[0]) {
+ case PACKET_TYPE_NCI:
+ len = tmp[PACKET_HEADER_SIZE_NCI-1];
+ break;
+
+ case PACKET_TYPE_HCIEV:
+ len = tmp[PACKET_HEADER_SIZE_HCI-1];
+ if (len == 0)
+ total--;
+ else
+ len--;
+ break;
+
+ default:
+ len = 0;/*Unknown packet byte */
+ break;
+ } /* switch*/
+
+ /* make sure full packet fits in the buffer*/
+ if (len > 0 && (len + total) <= count) {
+ /** read the remainder of the packet.
+ **/
+ ret = i2c_master_recv(bcm2079x_dev->client, tmp+total,
+ len);
+ if (ret == len)
+ total += len;
+ } /* if */
+ } /* if */
+
+ mutex_unlock(&bcm2079x_dev->read_mutex);
+
+ if (total > count || copy_to_user(buf, tmp, total)) {
+ dev_err(&bcm2079x_dev->client->dev,
+ "failed to copy to user space, total = %d\n", total);
+ total = -EFAULT;
+ }
+
+ return total;
+}
+
+static ssize_t bcm2079x_dev_write(struct file *filp, const char __user *buf,
+ size_t count, loff_t *offset)
+{
+ struct bcm2079x_dev *bcm2079x_dev = filp->private_data;
+ char tmp[MAX_BUFFER_SIZE];
+ int ret;
+
+ if (count > MAX_BUFFER_SIZE) {
+ dev_err(&bcm2079x_dev->client->dev, "out of memory\n");
+ return -ENOMEM;
+ }
+
+ if (copy_from_user(tmp, buf, count)) {
+ dev_err(&bcm2079x_dev->client->dev,
+ "failed to copy from user space\n");
+ return -EFAULT;
+ }
+
+ mutex_lock(&bcm2079x_dev->read_mutex);
+ /* Write data */
+
+ ret = i2c_master_send(bcm2079x_dev->client, tmp, count);
+ if (ret != count) {
+ dev_err(&bcm2079x_dev->client->dev,
+ "failed to write %d\n", ret);
+ ret = -EIO;
+ }
+ mutex_unlock(&bcm2079x_dev->read_mutex);
+
+ return ret;
+}
+
+static int bcm2079x_dev_open(struct inode *inode, struct file *filp)
+{
+ int ret = 0;
+
+ struct bcm2079x_dev *bcm2079x_dev = container_of(filp->private_data,
+ struct bcm2079x_dev,
+ bcm2079x_device);
+ filp->private_data = bcm2079x_dev;
+ bcm2079x_init_stat(bcm2079x_dev);
+ bcm2079x_enable_irq(bcm2079x_dev);
+ dev_info(&bcm2079x_dev->client->dev,
+ "%d,%d\n", imajor(inode), iminor(inode));
+
+ return ret;
+}
+
+static long bcm2079x_dev_unlocked_ioctl(struct file *filp,
+ unsigned int cmd, unsigned long arg)
+{
+ struct bcm2079x_dev *bcm2079x_dev = filp->private_data;
+
+ switch (cmd) {
+ case BCMNFC_POWER_CTL:
+ gpio_set_value(bcm2079x_dev->en_gpio, arg);
+ break;
+ case BCMNFC_WAKE_CTL:
+ gpio_set_value(bcm2079x_dev->wake_gpio, arg);
+ break;
+ case BCMNFC_SET_ADDR:
+ set_client_addr(bcm2079x_dev, arg);
+ break;
+ default:
+ dev_err(&bcm2079x_dev->client->dev,
+ "%s, unknown cmd (%x, %lx)\n", __func__, cmd, arg);
+ return -ENOSYS;
+ }
+
+ return 0;
+}
+
+static const struct file_operations bcm2079x_dev_fops = {
+ .owner = THIS_MODULE,
+ .llseek = no_llseek,
+ .poll = bcm2079x_dev_poll,
+ .read = bcm2079x_dev_read,
+ .write = bcm2079x_dev_write,
+ .open = bcm2079x_dev_open,
+ .unlocked_ioctl = bcm2079x_dev_unlocked_ioctl
+};
+
+static int bcm2079x_probe(struct i2c_client *client,
+ const struct i2c_device_id *id)
+{
+ int ret;
+ struct bcm2079x_platform_data *platform_data;
+ struct bcm2079x_dev *bcm2079x_dev;
+
+ platform_data = client->dev.platform_data;
+
+ dev_info(&client->dev, "%s, probing bcm2079x driver flags = %x\n",
+ __func__, client->flags);
+ if (platform_data == NULL) {
+ dev_err(&client->dev, "nfc probe fail\n");
+ return -ENODEV;
+ }
+
+ if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
+ dev_err(&client->dev, "need I2C_FUNC_I2C\n");
+ return -ENODEV;
+ }
+
+ ret = gpio_request_one(platform_data->irq_gpio, GPIOF_IN, "nfc_irq");
+ if (ret)
+ return -ENODEV;
+ ret = gpio_request_one(platform_data->en_gpio, GPIOF_OUT_INIT_LOW,
+ "nfc_en");
+ if (ret)
+ goto err_en;
+ ret = gpio_request_one(platform_data->wake_gpio, GPIOF_OUT_INIT_LOW,
+ "nfc_wake");
+ if (ret)
+ goto err_wake;
+
+ gpio_set_value(platform_data->en_gpio, 0);
+ gpio_set_value(platform_data->wake_gpio, 0);
+
+ bcm2079x_dev = kzalloc(sizeof(*bcm2079x_dev), GFP_KERNEL);
+ if (bcm2079x_dev == NULL) {
+ dev_err(&client->dev,
+ "failed to allocate memory for module data\n");
+ ret = -ENOMEM;
+ goto err_exit;
+ }
+
+ bcm2079x_dev->wake_gpio = platform_data->wake_gpio;
+ bcm2079x_dev->irq_gpio = platform_data->irq_gpio;
+ bcm2079x_dev->en_gpio = platform_data->en_gpio;
+ bcm2079x_dev->client = client;
+
+ /* init mutex and queues */
+ init_waitqueue_head(&bcm2079x_dev->read_wq);
+ mutex_init(&bcm2079x_dev->read_mutex);
+ spin_lock_init(&bcm2079x_dev->irq_enabled_lock);
+
+ bcm2079x_dev->bcm2079x_device.minor = MISC_DYNAMIC_MINOR;
+ bcm2079x_dev->bcm2079x_device.name = "bcm2079x-i2c";
+ bcm2079x_dev->bcm2079x_device.fops = &bcm2079x_dev_fops;
+
+ ret = misc_register(&bcm2079x_dev->bcm2079x_device);
+ if (ret) {
+ dev_err(&client->dev, "misc_register failed\n");
+ goto err_misc_register;
+ }
+
+ /* request irq. the irq is set whenever the chip has data available
+ * for reading. it is cleared when all data has been read.
+ */
+ dev_info(&client->dev, "requesting IRQ %d\n", client->irq);
+ bcm2079x_dev->irq_enabled = true;
+ ret = request_irq(client->irq, bcm2079x_dev_irq_handler,
+ IRQF_TRIGGER_RISING, client->name, bcm2079x_dev);
+ if (ret) {
+ dev_err(&client->dev, "request_irq failed\n");
+ goto err_request_irq_failed;
+ }
+ bcm2079x_disable_irq(bcm2079x_dev);
+ i2c_set_clientdata(client, bcm2079x_dev);
+ dev_info(&client->dev,
+ "%s, probing bcm2079x driver exited successfully\n",
+ __func__);
+ return 0;
+
+err_request_irq_failed:
+ misc_deregister(&bcm2079x_dev->bcm2079x_device);
+err_misc_register:
+ mutex_destroy(&bcm2079x_dev->read_mutex);
+ kfree(bcm2079x_dev);
+err_exit:
+ gpio_free(platform_data->wake_gpio);
+err_wake:
+ gpio_free(platform_data->en_gpio);
+err_en:
+ gpio_free(platform_data->irq_gpio);
+ return ret;
+}
+
+static int bcm2079x_remove(struct i2c_client *client)
+{
+ struct bcm2079x_dev *bcm2079x_dev;
+
+ bcm2079x_dev = i2c_get_clientdata(client);
+ free_irq(client->irq, bcm2079x_dev);
+ misc_deregister(&bcm2079x_dev->bcm2079x_device);
+ mutex_destroy(&bcm2079x_dev->read_mutex);
+ gpio_free(bcm2079x_dev->irq_gpio);
+ gpio_free(bcm2079x_dev->en_gpio);
+ gpio_free(bcm2079x_dev->wake_gpio);
+ kfree(bcm2079x_dev);
+
+ return 0;
+}
+
+static const struct i2c_device_id bcm2079x_id[] = {
+ {"bcm2079x-i2c", 0},
+ {}
+};
+
+static struct i2c_driver bcm2079x_driver = {
+ .id_table = bcm2079x_id,
+ .probe = bcm2079x_probe,
+ .remove = bcm2079x_remove,
+ .driver = {
+ .owner = THIS_MODULE,
+ .name = "bcm2079x-i2c",
+ },
+};
+
+/*
+ * module load/unload record keeping
+ */
+
+static int __init bcm2079x_dev_init(void)
+{
+ return i2c_add_driver(&bcm2079x_driver);
+}
+module_init(bcm2079x_dev_init);
+
+static void __exit bcm2079x_dev_exit(void)
+{
+ i2c_del_driver(&bcm2079x_driver);
+}
+module_exit(bcm2079x_dev_exit);
+
+MODULE_AUTHOR("Broadcom");
+MODULE_DESCRIPTION("NFC bcm2079x driver");
+MODULE_LICENSE("GPL");
diff --git a/drivers/nfc/bcm2079x/bcm2079x.h b/drivers/nfc/bcm2079x/bcm2079x.h
new file mode 100644
index 0000000..b8b243f
--- /dev/null
+++ b/drivers/nfc/bcm2079x/bcm2079x.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2013 Broadcom Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef _BCM2079X_H
+#define _BCM2079X_H
+
+#define BCMNFC_MAGIC 0xFA
+
+#define BCMNFC_POWER_CTL _IO(BCMNFC_MAGIC, 0x01)
+#define BCMNFC_WAKE_CTL _IO(BCMNFC_MAGIC, 0x05)
+#define BCMNFC_SET_ADDR _IO(BCMNFC_MAGIC, 0x07)
+
+struct bcm2079x_platform_data {
+ unsigned int irq_gpio;
+ unsigned int en_gpio;
+ unsigned int wake_gpio;
+};
+
+#endif
--
1.7.9.5
^ permalink raw reply related
* Re: [PATCH 1/3] [RFC] cfg80211: Add indoor only and GO concurrent channel attributes
From: Luis R. Rodriguez @ 2013-07-08 21:45 UTC (permalink / raw)
To: Ilan Peer, wireless-regdb@lists.infradead.org
Cc: linux-wireless, David Spinadel
In-Reply-To: <1372768095-26053-2-git-send-email-ilan.peer@intel.com>
Cc'ing a few other lists for a wider review.
On Tue, Jul 2, 2013 at 5:28 AM, Ilan Peer <ilan.peer@intel.com> wrote:
> From: David Spinadel <david.spinadel@intel.com>
>
> The FCC are clarifying some soft configuration requirements,
> which among other includes the following:
>
> 1. Concurrent GO operation, where devices may support WFD in
> bands where an authorized master (for example with DFS and
> DFS and radar detection capability in the UNII band) is operating.
Is WFD WiFi Display? Is there any strict relationship here to WFD and
GO and regulatory or is WFD just a use case example? Are you
indicating that the FCC is making special rules for cases in specific
bands where GO *can* co-exist with other GO devices ?
You annotate that this is somehow related to DFS, are the GO
concurrent rules that the FCC is defining only applicable to DFS
frequency ranges? If so would it suffice to only use DFS flag ? Or are
there other special cases beyond DFS frequency ranges that the FCC is
creating special handling?
Apart from the FCC are you aware of special cases handling for other
regulatory bodies at this point?
Note that we have already these on regdb.h from CRDA:
/*
* The Linux map defined in <linux/uapi/nl80211.h> enum nl80211_reg_rule_flags
*/
enum reg_rule_flags {
RRF_NO_OFDM = 1<<0, /* OFDM modulation not allowed */
RRF_NO_CCK = 1<<1, /* CCK modulation not allowed */
RRF_NO_INDOOR = 1<<2, /* indoor operation not allowed */
RRF_NO_OUTDOOR = 1<<3, /* outdoor operation not allowed */
RRF_DFS = 1<<4, /* DFS support is required to be
* used */
RRF_PTP_ONLY = 1<<5, /* this is only for Point To Point
* links */
RRF_PTMP_ONLY = 1<<6, /* this is only for Point To Multi
* Point links */
RRF_PASSIVE_SCAN = 1<<7, /* passive scan is required */
RRF_NO_IBSS = 1<<8, /* IBSS is not allowed */
};
Historically we don't distinguish then a type of 802.11 device that
initiates radiation except for the NO_IBSS rule, but that rule can be
treated more as legacy given that the intent and motivation behind
that was that some ODMs simply preferred an interpretation of
regulatory rules and we *currently* don't use that in much places
other than custom regulatory domains defined in the kernel. The
PTP_ONLY and PTMP_ONLY are example other rules that could potentially
have been used but to this day we haven't found a use case for it
given that typical 802.11 devices are PTMP.
I mention the NO_IBSS case as I'd like to try to avoid adding GO
specific flag if we can figure out a way to make this more generic. At
this point for example I think a more appropriate flag is in place:
* NO_IR - cannot initiate radiation
And this could in turn end up replacing most use cases of NO_IBSS and
PASSIVE_SCAN givne that both of these imply we cannot initiate
radiation unless specific things are done. I wonder if we can fold the
GO flag into this and perhaps rename the NO_IBSS flag to the GO one.
Also note that we should keep the flags in sync with the uapi nl80211
change. Please review these suggestions and let me know what you
think.
> 2. Indoor operation, where in bands requiring indoor operation, the
> device must be programmed to detect indoor operation, or
> - Device must be connected to AC Power
Does anyone know if the FCC considers "indoor" if we power a device
through the car on AC power through a converter ? Are we willing to
ignore that corner case?
> - Device must be under the control of a local master that is acting
Interesting, so some APIs would be defined, I take it on hostapd to do
the proper callbacks to 'slave' type of devices that depend on the
local master(s). I could envision this being implemented on hostapd by
expanding the AP interface type and associating 'slave' devices and
callbacks for updates on AP device updates (channel changes, and so
on). Is this work being planned?
Luis
> as an AP and is connected to AC Power.
>
> See https://apps.fcc.gov/eas/comments/GetPublishedDocument.html?id=327&tn=528122
>
> Add support for advertising Indoor-only and Concurrent-GO channel
> properties.
>
> Signed-off-by: David Spinadel <david.spinadel@intel.com>
> Signed-off-by: Ilan Peer <ilan.peer@intel.com>
> ---
> include/net/cfg80211.h | 6 ++++++
> include/uapi/linux/nl80211.h | 7 +++++++
> net/wireless/nl80211.c | 6 ++++++
> 3 files changed, 19 insertions(+)
>
> diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
> index 7b0730a..f0badeb 100644
> --- a/include/net/cfg80211.h
> +++ b/include/net/cfg80211.h
> @@ -110,6 +110,10 @@ enum ieee80211_band {
> * channel as the control or any of the secondary channels.
> * This may be due to the driver or due to regulatory bandwidth
> * restrictions.
> + * @IEEE80211_CHAN_INDOOR_ONLY: Only indoor use is permitted on this channel.
> + * @IEEE80211_CHAN_GO_CONCURRENT: GO operation is allowed on this channel if
> + * it's connected concurrently to a BSS on the same channel on 2.4 or
> + * to a channel in the same UNII band on 5.2.
> */
> enum ieee80211_channel_flags {
> IEEE80211_CHAN_DISABLED = 1<<0,
> @@ -121,6 +125,8 @@ enum ieee80211_channel_flags {
> IEEE80211_CHAN_NO_OFDM = 1<<6,
> IEEE80211_CHAN_NO_80MHZ = 1<<7,
> IEEE80211_CHAN_NO_160MHZ = 1<<8,
> + IEEE80211_CHAN_INDOOR_ONLY = 1<<9,
> + IEEE80211_CHAN_GO_CONCURRENT = 1<<10,
> };
>
> #define IEEE80211_CHAN_NO_HT40 \
> diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
> index 861e5eb..09a4f6b 100644
> --- a/include/uapi/linux/nl80211.h
> +++ b/include/uapi/linux/nl80211.h
> @@ -2158,6 +2158,11 @@ enum nl80211_band_attr {
> * @NL80211_FREQUENCY_ATTR_NO_160MHZ: any 160 MHz (but not 80+80) channel
> * using this channel as the primary or any of the secondary channels
> * isn't possible
> + * @NL80211_FREQUENCY_ATTR_INDOOR_ONLY: Indoor only use is permitted
> + * on this channel in current regulatory domain.
> + * @NL80211_FREQUENCY_ATTR_GO_CONCURRENT: GO operation is allowed on this
> + * channel if it's connected concurrently to a BSS on the same channel on
> + * 2.4 or to a channel in the same UNII band on 5.2.
> * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number
> * currently defined
> * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use
> @@ -2176,6 +2181,8 @@ enum nl80211_frequency_attr {
> NL80211_FREQUENCY_ATTR_NO_HT40_PLUS,
> NL80211_FREQUENCY_ATTR_NO_80MHZ,
> NL80211_FREQUENCY_ATTR_NO_160MHZ,
> + NL80211_FREQUENCY_ATTR_INDOOR_ONLY,
> + NL80211_FREQUENCY_ATTR_GO_CONCURRENT,
>
> /* keep last */
> __NL80211_FREQUENCY_ATTR_AFTER_LAST,
> diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
> index 7dc3343..cf22b22 100644
> --- a/net/wireless/nl80211.c
> +++ b/net/wireless/nl80211.c
> @@ -563,6 +563,12 @@ static int nl80211_msg_put_channel(struct sk_buff *msg,
> if ((chan->flags & IEEE80211_CHAN_NO_160MHZ) &&
> nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_160MHZ))
> goto nla_put_failure;
> + if ((chan->flags & IEEE80211_CHAN_INDOOR_ONLY) &&
> + nla_put_flag(msg, NL80211_FREQUENCY_ATTR_INDOOR_ONLY))
> + goto nla_put_failure;
> + if ((chan->flags & IEEE80211_CHAN_GO_CONCURRENT) &&
> + nla_put_flag(msg, NL80211_FREQUENCY_ATTR_GO_CONCURRENT))
> + goto nla_put_failure;
> }
>
> if (nla_put_u32(msg, NL80211_FREQUENCY_ATTR_MAX_TX_POWER,
> --
> 1.7.10.4
>
^ permalink raw reply
* Re: [RFC 42/53] wireless-regdb: ID, Indonesia - enable 5 GHz and VHT80
From: Luis R. Rodriguez @ 2013-07-08 20:23 UTC (permalink / raw)
To: Paul Stewart
Cc: John Linville, wireless-regdb@lists.infradead.org, linux-wireless
In-Reply-To: <CAMcMvsiQb=byYEV4z2aZUYCLjRmqJUm_SQrUrOPUXrrfkcjeLA@mail.gmail.com>
On Thu, Jul 4, 2013 at 10:51 AM, Paul Stewart <pstew@chromium.org> wrote:
> On Wed, Jul 3, 2013 at 6:04 PM, Luis R. Rodriguez
> <mcgrof@do-not-panic.com> wrote:
>>
>> From: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
>>
>> Pursuant to:
>>
>> http://www.postel.go.id/content/ID/regulasi/standardisasi/kepdir/bwa%205,8%20ghz.pdf,
>>
>> provide a 5GHz rule for Indonesian regulatory domain. QCA has
>> also verified VHT80 can be enabled. Patch originally posted by
>> Paul Stewart <pstew@chromium.org>, I just modified to enable 80 MHz
>> bandwidth.
>>
>> Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
> Signed-off-by: Paul Stewart <pstew@chromium.org>
Given I've been promoting the idea of taking the Linux kernel DCO and
making it a standalone project [0] it is critical for me to promote
proper usage of the Signed-off-by tag. In this case it is not
required, and a more appropriate tag is either Acked-by or
Reviewed-by. I'll add Acked-by for you and respin, thanks!
[0] https://docs.google.com/presentation/d/1J4VTSTuiJ88xcvOrYg7HRvwUoxOW9qvnBqOfoPPuc64/edit
Luis
^ permalink raw reply
* Re: [RFC 42/53] wireless-regdb: ID, Indonesia - enable 5 GHz and VHT80
From: Luis R. Rodriguez @ 2013-07-08 20:20 UTC (permalink / raw)
To: Krishna Chaitanya
Cc: Arend van Spriel, John W. Linville,
wireless-regdb@lists.infradead.org, linux-wireless
In-Reply-To: <CABPxzYLD3xp9vyTA42PsCdNo1qAm4+X4OrqFTN70-aGvO52FeQ@mail.gmail.com>
On Thu, Jul 4, 2013 at 12:29 PM, Krishna Chaitanya
<chaitanya.mgit@gmail.com> wrote:
> On Thu, Jul 4, 2013 at 11:53 PM, Arend van Spriel <arend@broadcom.com> wrote:
>>
>> On 07/04/2013 03:04 AM, Luis R. Rodriguez wrote:
>>>
>>> From: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
>>>
>>> Pursuant to:
>>>
>>> http://www.postel.go.id/content/ID/regulasi/standardisasi/kepdir/bwa%205,8%20ghz.pdf,
>>>
>>> provide a 5GHz rule for Indonesian regulatory domain. QCA has
>>> also verified VHT80 can be enabled. Patch originally posted by
>>> Paul Stewart <pstew@chromium.org>, I just modified to enable 80 MHz
>>> bandwidth.
>>
>>
>> Hi Luis,
>>
>> Is it just me or did you make a typo. Should '@ 20' be '@ 80' ?
Indeed, typo, I'll fix in my next iteration!
> But as per the document shared above the maximum BW allowed is 20MHz only, no?
> So is the VHT80 tested by QCA compliant to the reg rules?
Yes it is.
Luis
^ permalink raw reply
* Re: 3.9.5+: Crash in tcp_input.c:4810.
From: Ben Greear @ 2013-07-08 20:17 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netdev, linux-wireless@vger.kernel.org
In-Reply-To: <1373314235.4979.121.camel@edumazet-glaptop>
On 07/08/2013 01:10 PM, Eric Dumazet wrote:
> On Mon, 2013-07-08 at 12:59 -0700, Ben Greear wrote:
>
>>> There is this thing in ath9k about aggregating two frags
>>>
>>> drivers/net/wireless/ath/ath9k/recv.c line 1298 contains :
>>>
>>> RX_STAT_INC(rx_frags);
>>>
>>> Could you check these stats (I do not know if they are reported by
>>> ethtool -S or another debugging facility) and check if rx_frags is ever
>>> increasing ?
>>
>> They are in debugfs, and they appear to increase fairly often, for
>> instance:
>>
>> [root@lec2010-ath9k-1 lanforge]# cat /debug/ieee80211/wiphy0/ath9k/recv|tail -5
>> RX-Pkts-All : 288009442
>> RX-Bytes-All : 4067932166
>> RX-Beacons : 14826735
>> RX-Frags : 3944
>> RX-Spectral : 0
>>
>> I don't have the stats from the system that reproduced the bug
>> (it has been rebooted), but if I do see the bug again, I'll
>> grab the rx-frags and other stats just in case it shows
>> some anomaly.
>>
>
> Reading this code again, I believe following patch is needed.
>
> Could you test it ?
Sure, will do. Adding the linux-wireless mailing list as well.
Thanks,
Ben
>
> Thanks
>
> diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
> index 8be2b5d..f642f04 100644
> --- a/drivers/net/wireless/ath/ath9k/recv.c
> +++ b/drivers/net/wireless/ath/ath9k/recv.c
> @@ -1317,7 +1317,8 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp)
> if (sc->rx.frag) {
> int space = skb->len - skb_tailroom(hdr_skb);
>
> - if (pskb_expand_head(hdr_skb, 0, space, GFP_ATOMIC) < 0) {
> + if (space > 0 &&
> + pskb_expand_head(hdr_skb, 0, space, GFP_ATOMIC) < 0) {
> dev_kfree_skb(skb);
> RX_STAT_INC(rx_oom_err);
> goto requeue_drop_frag;
>
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply
* Re: wl127x: Unable to associate with a WPA2-PSK AP
From: Arik Nemtsov @ 2013-07-08 19:08 UTC (permalink / raw)
To: José Miguel Gonçalves; +Cc: linux-wireless, Luciano Coelho
In-Reply-To: <51DB0ACC.7050800@inov.pt>
Hey,
About the second issue - seems the following patch is missing from your tree:
http://permalink.gmane.org/gmane.linux.kernel.wireless.general/105449
So the warning is bogus. It will happen if you're working on a single
processor (UP) system.
To get the latest driver, you can use Luca's tree, which already
contains this patch:
git://git.kernel.org/pub/scm/linux/kernel/git/luca/wl12xx.git
Arik
On Mon, Jul 8, 2013 at 9:54 PM, José Miguel Gonçalves
<jose.goncalves@inov.pt> wrote:
> Hi,
>
> After solving some initial platform issues, I'm now blocked in two more
> issues using the wl127x driver with kernel 3.9.9 in a S3C2416 hardware based
> platform.
>
> The first one is that the command "iw wlan0 scan" does not scan all
> frequencies. I've seen a patch submitted to fix an issue in the driver for
> the 5 GHz band
> (http://permalink.gmane.org/gmane.linux.kernel.wireless.general/107771) but
> this is not my issue, because I can not see also several APs in the 2.4GHz
> band after a scan.
>
> The second issue is when I try to associate with an AP using WPA2-PSK with
> wpa_supplicant (only able to reach this point by setting "scan_freq" in
> wpa_supplicat.conf file to the frequency used by the AP, because of the
> inability to perform of a complete scan) I get an error in the driver, as
> shown in the log bellow:
>
>
> [root ~]$ wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf
> Successfully initialized wpa_supplicant
> [ 33.915000] wlcore: firmware booted (Rev 6.3.10.0.133)
> [ 34.280000] cfg80211: Calling CRDA for country: PT
> [ 34.290000] cfg80211: Regulatory domain changed to country: PT
> [ 34.290000] cfg80211: (start_freq - end_freq @ bandwidth),
> (max_antenna_gain, max_eirp)
> [ 34.305000] cfg80211: (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A,
> 2000 mBm)
> [ 34.320000] cfg80211: (5170000 KHz - 5250000 KHz @ 40000 KHz), (N/A,
> 2000 mBm)
> [ 34.320000] cfg80211: (5250000 KHz - 5330000 KHz @ 40000 KHz), (N/A,
> 2000 mBm)
> [ 34.330000] cfg80211: (5490000 KHz - 5710000 KHz @ 40000 KHz), (N/A,
> 2700 mBm)
> [ 34.340000] cfg80211: (57240000 KHz - 65880000 KHz @ 2160000 KHz),
> (N/A, 4000 mBm)
> wlan0: SME: Trying to authenticate with 88:43:e1:57:79:c0 (SSID='[
> 34.585000] wlan0: authenticate with 88:43:e1:57:79:c0
> A. Guidance' freq=2452 MHz)
> [ 34.595000] ------------[ cut here ]------------
> [ 34.595000] WARNING: at drivers/net/wireless/ti/wlcore/tx.c:1307
> wlcore_is_queue_stopped_by_reason_locked+0x98/0xb4 [wlcore]()
> [ 34.595000] Modules linked in: arc4 wl12xx wlcore mac80211 wlcore_sdio
> lm70
> [ 34.595000] Backtrace:
> [ 34.595000] [<c000b92c>] (dump_backtrace+0x0/0x10c) from [<c02ed4a4>]
> (dump_stack+0x18/0x1c)
> [ 34.595000] r6:bf05ddd8 r5:00000009 r4:00000000 r3:00000000
> [ 34.595000] [<c02ed48c>] (dump_stack+0x0/0x1c) from [<c0019ecc>]
> (warn_slowpath_common+0x54/0x70)
> [ 34.595000] [<c0019e78>] (warn_slowpath_common+0x0/0x70) from
> [<c0019f0c>] (warn_slowpath_null+0x24/0x2c)
> [ 34.595000] r8:c39e2acc r7:00000000 r6:c305b160 r5:bf06ca36 r4:00000002
> r3:00000009
> [ 34.595000] [<c0019ee8>] (warn_slowpath_null+0x0/0x2c) from [<bf05ddd8>]
> (wlcore_is_queue_stopped_by_reason_locked+0x98/0xb4 [wlcore])
> [ 34.595000] [<bf05dd40>]
> (wlcore_is_queue_stopped_by_reason_locked+0x0/0xb4 [wlcore]) from
> [<bf05de38>] (wlcore_is_queue_stopped_by_reason+0x44/0x7c [wlcore])
> [ 34.595000] r6:00000000 r5:c305b160 r4:80000013
> [ 34.595000] [<bf05ddf4>] (wlcore_is_queue_stopped_by_reason+0x0/0x7c
> [wlcore]) from [<bf05deb4>] (wl1271_handle_tx_low_watermark+0x44/0x94
> [wlcore])
> [ 34.595000] r8:c305b160 r7:c39e2acc r6:00000000 r5:c39e2acc r4:00000000
> r3:00000000
> [ 34.595000] [<bf05de70>] (wl1271_handle_tx_low_watermark+0x0/0x94
> [wlcore]) from [<bf05e050>] (wl1271_tx_reset_link_queues+0x14c/0x174
> [wlcore])
> [ 34.595000] [<bf05df04>] (wl1271_tx_reset_link_queues+0x0/0x174 [wlcore])
> from [<bf05970c>] (wl12xx_free_link+0xec/0x150 [wlcore])
> [ 34.595000] [<bf059620>] (wl12xx_free_link+0x0/0x150 [wlcore]) from
> [<bf059b50>] (wl12xx_cmd_role_stop_sta+0x98/0x100 [wlcore])
> [ 34.595000] r7:c305b160 r6:00000000 r5:c39e2acc r4:c3a89ac0
> [ 34.595000] [<bf059ab8>] (wl12xx_cmd_role_stop_sta+0x0/0x100 [wlcore])
> from [<bf0546d8>] (wl1271_bss_info_changed_sta+0x840/0x9a4 [wlcore])
> [ 34.595000] r7:c39e2acc r6:c305b160 r5:c39e2a10 r4:000000e0
> [ 34.595000] [<bf053e98>] (wl1271_bss_info_changed_sta+0x0/0x9a4 [wlcore])
> from [<bf054a0c>] (wl1271_op_bss_info_changed+0x1d0/0x46c [wlcore])
> [ 34.595000] [<bf05483c>] (wl1271_op_bss_info_changed+0x0/0x46c [wlcore])
> from [<bf009538>] (ieee80211_bss_info_change_notify+0x6c/0x10c [mac80211])
> [ 34.595000] [<bf0094cc>] (ieee80211_bss_info_change_notify+0x0/0x10c
> [mac80211]) from [<bf02bf1c>] (ieee80211_prep_connection+0x2dc/0x76c
> [mac80211])
> [ 34.595000] r7:00000fff r6:c39cfe48 r5:c305b8e4 r4:c39e2440
> [ 34.595000] [<bf02bc40>] (ieee80211_prep_connection+0x0/0x76c [mac80211])
> from [<bf030d70>] (ieee80211_mgd_auth+0x228/0x29c [mac80211])
> [ 34.595000] [<bf030b48>] (ieee80211_mgd_auth+0x0/0x29c [mac80211]) from
> [<bf01afd4>] (ieee80211_auth+0x18/0x1c [mac80211])
> [ 34.595000] [<bf01afbc>] (ieee80211_auth+0x0/0x1c [mac80211]) from
> [<c02e40a8>] (__cfg80211_mlme_auth+0x170/0x188)
> [ 34.595000] [<c02e3f38>] (__cfg80211_mlme_auth+0x0/0x188) from
> [<c02e4154>] (cfg80211_mlme_auth+0x94/0xb8)
> [ 34.595000] [<c02e40c0>] (cfg80211_mlme_auth+0x0/0xb8) from [<c02dffbc>]
> (nl80211_authenticate+0x258/0x27c)
> [ 34.595000] [<c02dfd64>] (nl80211_authenticate+0x0/0x27c) from
> [<c0260044>] (genl_rcv_msg+0x23c/0x274)
> [ 34.595000] [<c025fe08>] (genl_rcv_msg+0x0/0x274) from [<c025f458>]
> (netlink_rcv_skb+0xb4/0xc8)
> [ 34.595000] [<c025f3a4>] (netlink_rcv_skb+0x0/0xc8) from [<c025fdfc>]
> (genl_rcv+0x20/0x2c)
> [ 34.595000] r6:00000048 r5:c3a5b400 r4:c38c4bc0 r3:c025fddc
> [ 34.595000] [<c025fddc>] (genl_rcv+0x0/0x2c) from [<c025ee40>]
> (netlink_unicast+0x1b0/0x214)
> [ 34.595000] r4:c38c5e00 r3:c025fddc
> [ 34.595000] [<c025ec90>] (netlink_unicast+0x0/0x214) from [<c025f230>]
> (netlink_sendmsg+0x2e0/0x358)
> [ 34.595000] [<c025ef50>] (netlink_sendmsg+0x0/0x358) from [<c0230944>]
> (sock_sendmsg+0x88/0xa8)
> [ 34.595000] [<c02308bc>] (sock_sendmsg+0x0/0xa8) from [<c0230d64>]
> (___sys_sendmsg+0x2c8/0x2e0)
> [ 34.595000] [<c0230a9c>] (___sys_sendmsg+0x0/0x2e0) from [<c0232920>]
> (__sys_sendmsg+0x44/0x70)
> [ 34.595000] [<c02328dc>] (__sys_sendmsg+0x0/0x70) from [<c023295c>]
> (sys_sendmsg+0x10/0x14)
> [ 34.595000] r6:be94fa8c r5:017940a0 r4:00000000
> [ 34.595000] [<c023294c>] (sys_sendmsg+0x0/0x14) from [<c0009400>]
> (ret_fast_syscall+0x0/0x2c)
> [ 34.595000] ---[ end trace a2c5f3d5ef286154 ]---
> [ 34.605000] wlan0: send auth to 88:43:e1:57:79:c0 (try 1/3)
> [ 34.605000] ------------[ cut here ]------------
> [ 34.605000] WARNING: at drivers/net/wireless/ti/wlcore/tx.c:1316
> wlcore_is_queue_stopped_locked+0x74/0x8c [wlcore]()
> [ 34.605000] Modules linked in: arc4 wl12xx wlcore mac80211 wlcore_sdio
> lm70
> [ 34.605000] Backtrace:
> [ 34.605000] [<c000b92c>] (dump_backtrace+0x0/0x10c) from [<c02ed4a4>]
> (dump_stack+0x18/0x1c)
> [ 34.605000] r6:bf05f240 r5:00000009 r4:00000000 r3:00000000
> [ 34.605000] [<c02ed48c>] (dump_stack+0x0/0x1c) from [<c0019ecc>]
> (warn_slowpath_common+0x54/0x70)
> [ 34.605000] [<c0019e78>] (warn_slowpath_common+0x0/0x70) from
> [<c0019f0c>] (warn_slowpath_null+0x24/0x2c)
> [ 34.605000] r8:40000013 r7:c305b160 r6:c305b160 r5:bf06ca36 r4:00000000
> r3:00000009
> [ 34.605000] [<c0019ee8>] (warn_slowpath_null+0x0/0x2c) from [<bf05f240>]
> (wlcore_is_queue_stopped_locked+0x74/0x8c [wlcore])
> [ 34.605000] [<bf05f1cc>] (wlcore_is_queue_stopped_locked+0x0/0x8c
> [wlcore]) from [<bf05225c>] (wl1271_op_tx+0x104/0x290 [wlcore])
> [ 34.605000] r6:c39e2a10 r5:00000001 r4:c38c4a40 r3:00000003
> [ 34.605000] [<bf052158>] (wl1271_op_tx+0x0/0x290 [wlcore]) from
> [<bf023e64>] (__ieee80211_tx+0x134/0x384 [mac80211])
> [ 34.605000] [<bf023d30>] (__ieee80211_tx+0x0/0x384 [mac80211]) from
> [<bf024174>] (ieee80211_tx+0xc0/0xe8 [mac80211])
> [ 34.605000] [<bf0240b4>] (ieee80211_tx+0x0/0xe8 [mac80211]) from
> [<bf02474c>] (ieee80211_xmit+0x80/0x94 [mac80211])
> [ 34.605000] [<bf0246cc>] (ieee80211_xmit+0x0/0x94 [mac80211]) from
> [<bf025698>] (__ieee80211_tx_skb_tid_band+0x58/0x64 [mac80211])
> [ 34.605000] r8:00000000 r7:00000001 r6:00000000 r5:c39e2440 r4:c38c4a40
> r3:c3ae8000
> [ 34.605000] [<bf025640>] (__ieee80211_tx_skb_tid_band+0x0/0x64
> [mac80211]) from [<bf0286c4>] (ieee80211_send_auth+0x158/0x1e0 [mac80211])
> [ 34.605000] r6:c39e2440 r5:c38c4a40 r4:c3ac8b94 r3:00000000
> [ 34.605000] [<bf02856c>] (ieee80211_send_auth+0x0/0x1e0 [mac80211]) from
> [<bf02c550>] (ieee80211_probe_auth+0x174/0x2c8 [mac80211])
> [ 34.605000] [<bf02c3dc>] (ieee80211_probe_auth+0x0/0x2c8 [mac80211]) from
> [<bf030d80>] (ieee80211_mgd_auth+0x238/0x29c [mac80211])
> [ 34.605000] r8:c39e2798 r7:00000000 r6:c39e2440 r5:c3a72c20 r4:c3ae9af8
> [ 34.605000] [<bf030b48>] (ieee80211_mgd_auth+0x0/0x29c [mac80211]) from
> [<bf01afd4>] (ieee80211_auth+0x18/0x1c [mac80211])
> [ 34.605000] [<bf01afbc>] (ieee80211_auth+0x0/0x1c [mac80211]) from
> [<c02e40a8>] (__cfg80211_mlme_auth+0x170/0x188)
> [ 34.605000] [<c02e3f38>] (__cfg80211_mlme_auth+0x0/0x188) from
> [<c02e4154>] (cfg80211_mlme_auth+0x94/0xb8)
> [ 34.605000] [<c02e40c0>] (cfg80211_mlme_auth+0x0/0xb8) from [<c02dffbc>]
> (nl80211_authenticate+0x258/0x27c)
> [ 34.605000] [<c02dfd64>] (nl80211_authenticate+0x0/0x27c) from
> [<c0260044>] (genl_rcv_msg+0x23c/0x274)
> [ 34.605000] [<c025fe08>] (genl_rcv_msg+0x0/0x274) from [<c025f458>]
> (netlink_rcv_skb+0xb4/0xc8)
> [ 34.605000] [<c025f3a4>] (netlink_rcv_skb+0x0/0xc8) from [<c025fdfc>]
> (genl_rcv+0x20/0x2c)
> [ 34.605000] r6:00000048 r5:c3a5b400 r4:c38c4bc0 r3:c025fddc
> [ 34.605000] [<c025fddc>] (genl_rcv+0x0/0x2c) from [<c025ee40>]
> (netlink_unicast+0x1b0/0x214)
> [ 34.605000] r4:c38c5e00 r3:c025fddc
> [ 34.605000] [<c025ec90>] (netlink_unicast+0x0/0x214) from [<c025f230>]
> (netlink_sendmsg+0x2e0/0x358)
> [ 34.605000] [<c025ef50>] (netlink_sendmsg+0x0/0x358) from [<c0230944>]
> (sock_sendmsg+0x88/0xa8)
> [ 34.605000] [<c02308bc>] (sock_sendmsg+0x0/0xa8) from [<c0230d64>]
> (___sys_sendmsg+0x2c8/0x2e0)
> [ 34.605000] [<c0230a9c>] (___sys_sendmsg+0x0/0x2e0) from [<c0232920>]
> (__sys_sendmsg+0x44/0x70)
> [ 34.605000] [<c02328dc>] (__sys_sendmsg+0x0/0x70) from [<c023295c>]
> (sys_sendmsg+0x10/0x14)
> [ 34.605000] r6:be94fa8c r5:017940a0 r4:00000000
> [ 34.605000] [<c023294c>] (sys_sendmsg+0x0/0x14) from [<c0009400>]
> (ret_fast_syscall+0x0/0x2c)
> [ 34.605000] ---[ end trace a2c5f3d5ef286155 ]---
> [ 34.625000] wlan0: send auth to 88:43:e1:57:79:c0 (try 2/3)
> [ 34.640000] wlan0: send auth to 88:43:e1:57:79:c0 (try 3/3)
> [ 34.650000] wlan0: authentication with 88:43:e1:57:79:c0 timed out
> wlan0: SME: Trying to authenticate with 88:43:e1:57:79:c0 (SSID='[
> 34.875000] wlan0: authenticate with 88:43:e1:57:79:c0
> A. Guidance' freq=2452 MHz)
> [ 34.915000] wlan0: send auth to 88:43:e1:57:79:c0 (try 1/3)
> [ 34.920000] wlan0: authenticated
> wlan0: Trying to associate with 88:43:e1:57:79:c0 (SSID='A. Guidance'
> freq=2452 MHz)
> [ 34.995000] wlan0: associate with 88:43:e1:57:79:c0 (try 1/3)
> [ 35.015000] wlan0: associate with 88:43:e1:57:79:c0 (try 2/3)
> [ 35.035000] wlan0: associate with 88:43:e1:57:79:c0 (try 3/3)
> [ 35.060000] wlan0: association with 88:43:e1:57:79:c0 timed out
> wlan0: SME: Trying to authenticate with 88:43:e1:57:79:c0 (SSID='[
> 35.620000] wlan0: authenticate with 88:43:e1:57:79:c0
> A. Guidance' freq=2452 MHz)
> [ 35.660000] wlan0: send auth to 88:43:e1:57:79:c0 (try 1/3)
> [ 35.665000] wlan0: authenticated
> wlan0: Trying to associate with 88:43:e1:57:79:c0 (SSID='A. Guidance'
> freq=2452 MHz)
> [ 35.740000] wlan0: associate with 88:43:e1:57:79:c0 (try 1/3)
> [ 35.745000] wlan0: RX AssocResp from 88:43:e1:57:79:c0 (capab=0x431
> status=0 aid=2)
> [ 35.765000] wlan0: associated
> [ 35.770000] cfg80211: Calling CRDA for country: PT
> [ 35.780000] cfg80211: Regulatory domain changed to country: PT
> [ 35.780000] cfg80211: (start_freq - end_freq @ bandwidth),
> (max_antenna_gain, max_eirp)
> [ 35.790000] cfg80211: (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A,
> 2000 mBm)
> [ 35.790000] cfg80211: (5170000 KHz - 5250000 KHz @ 40000 KHz), (N/A,
> 2000 mBm)
> [ 35.800000] cfg80211: (5250000 KHz - 5330000 KHz @ 40000 KHz), (N/A,
> 2000 mBm)
> [ 35.800000] cfg80211: (5490000 KHz - 5710000 KHz @ 40000 KHz), (N/A,
> 2700 mBm)
> [ 35.810000] cfg80211: (57240000 KHz - 65880000 KHz @ 2160000 KHz),
> (N/A, 4000 mBm)
> wlan0: Associated with 88:43:e1:57:79:c0
> [ 37.585000] wlcore: Beacon loss detected. roles:0xff
> [ 39.250000] wlcore: Beacon loss detected. roles:0xff
> [ 40.935000] wlcore: Beacon loss detected. roles:0xff
> [ 42.400000] wlcore: Connection loss work (role_id: 0).
> [ 42.400000] wlan0: Connection to AP 88:43:e1:57:79:c0 lost
> [ 42.475000] cfg80211: Calling CRDA to update world regulatory domain
> [ 42.485000] cfg80211: World regulatory domain updated:
> [ 42.485000] cfg80211: (start_freq - end_freq @ bandwidth),
> (max_antenna_gain, max_eirp)
> [ 42.500000] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (300
> mBi, 2000 mBm)
> [ 42.500000] cfg80211: (2457000 KHz - 2482000 KHz @ 40000 KHz), (300
> mBi, 2000 mBm)
> [ 42.515000] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (300
> mBi, 2000 mBm)
> [ 42.515000] cfg80211: (5170000 KHz - 5250000 KHz @ 40000 KHz), (300
> mBi, 2000 mBm)
> [ 42.525000] cfg80211: (5735000 KHz - 5835000 KHz @ 40000 KHz), (300
> mBi, 2000 mBm)
> [ 42.525000] cfg80211: Calling CRDA for country: PT
> [ 42.540000] cfg80211: Regulatory domain changed to country: PT
> [ 42.540000] cfg80211: (start_freq - end_freq @ bandwidth),
> (max_antenna_gain, max_eirp)
> [ 42.550000] cfg80211: (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A,
> 2000 mBm)
> [ 42.550000] cfg80211: (5170000 KHz - 5250000 KHz @ 40000 KHz), (N/A,
> 2000 mBm)
> [ 42.560000] cfg80211: (5250000 KHz - 5330000 KHz @ 40000 KHz), (N/A,
> 2000 mBm)
> [ 42.560000] cfg80211: (5490000 KHz - 5710000 KHz @ 40000 KHz), (N/A,
> 2700 mBm)
> wlan0: CTRL-EVENT-DISCONNECTED bssid=88:43:e1:57:79:c0 reason=4 l[
> 42.575000] cfg80211: (57240000 KHz - 65880000 KHz @ 2160000 KHz), (N/A,
> 4000 mBm)
> ocally_generated=1
> wlan0: WPA: 4-Way Handshake failed - pre-shared key may be incorrect
> wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="A. Guidance" auth_failures=1
> duration=10
>
>
> Any ideas in what could be wrong?
>
> Best regards,
> José Gonçalves
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* wl127x: Unable to associate with a WPA2-PSK AP
From: José Miguel Gonçalves @ 2013-07-08 18:54 UTC (permalink / raw)
To: linux-wireless; +Cc: Luciano Coelho
Hi,
After solving some initial platform issues, I'm now blocked in two more issues
using the wl127x driver with kernel 3.9.9 in a S3C2416 hardware based platform.
The first one is that the command "iw wlan0 scan" does not scan all frequencies.
I've seen a patch submitted to fix an issue in the driver for the 5 GHz band
(http://permalink.gmane.org/gmane.linux.kernel.wireless.general/107771) but this
is not my issue, because I can not see also several APs in the 2.4GHz band after a
scan.
The second issue is when I try to associate with an AP using WPA2-PSK with
wpa_supplicant (only able to reach this point by setting "scan_freq" in
wpa_supplicat.conf file to the frequency used by the AP, because of the inability
to perform of a complete scan) I get an error in the driver, as shown in the log
bellow:
[root ~]$ wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf
Successfully initialized wpa_supplicant
[ 33.915000] wlcore: firmware booted (Rev 6.3.10.0.133)
[ 34.280000] cfg80211: Calling CRDA for country: PT
[ 34.290000] cfg80211: Regulatory domain changed to country: PT
[ 34.290000] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain,
max_eirp)
[ 34.305000] cfg80211: (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm)
[ 34.320000] cfg80211: (5170000 KHz - 5250000 KHz @ 40000 KHz), (N/A, 2000 mBm)
[ 34.320000] cfg80211: (5250000 KHz - 5330000 KHz @ 40000 KHz), (N/A, 2000 mBm)
[ 34.330000] cfg80211: (5490000 KHz - 5710000 KHz @ 40000 KHz), (N/A, 2700 mBm)
[ 34.340000] cfg80211: (57240000 KHz - 65880000 KHz @ 2160000 KHz), (N/A, 4000
mBm)
wlan0: SME: Trying to authenticate with 88:43:e1:57:79:c0 (SSID='[ 34.585000]
wlan0: authenticate with 88:43:e1:57:79:c0
A. Guidance' freq=2452 MHz)
[ 34.595000] ------------[ cut here ]------------
[ 34.595000] WARNING: at drivers/net/wireless/ti/wlcore/tx.c:1307
wlcore_is_queue_stopped_by_reason_locked+0x98/0xb4 [wlcore]()
[ 34.595000] Modules linked in: arc4 wl12xx wlcore mac80211 wlcore_sdio lm70
[ 34.595000] Backtrace:
[ 34.595000] [<c000b92c>] (dump_backtrace+0x0/0x10c) from [<c02ed4a4>]
(dump_stack+0x18/0x1c)
[ 34.595000] r6:bf05ddd8 r5:00000009 r4:00000000 r3:00000000
[ 34.595000] [<c02ed48c>] (dump_stack+0x0/0x1c) from [<c0019ecc>]
(warn_slowpath_common+0x54/0x70)
[ 34.595000] [<c0019e78>] (warn_slowpath_common+0x0/0x70) from [<c0019f0c>]
(warn_slowpath_null+0x24/0x2c)
[ 34.595000] r8:c39e2acc r7:00000000 r6:c305b160 r5:bf06ca36 r4:00000002
r3:00000009
[ 34.595000] [<c0019ee8>] (warn_slowpath_null+0x0/0x2c) from [<bf05ddd8>]
(wlcore_is_queue_stopped_by_reason_locked+0x98/0xb4 [wlcore])
[ 34.595000] [<bf05dd40>] (wlcore_is_queue_stopped_by_reason_locked+0x0/0xb4
[wlcore]) from [<bf05de38>] (wlcore_is_queue_stopped_by_reason+0x44/0x7c [wlcore])
[ 34.595000] r6:00000000 r5:c305b160 r4:80000013
[ 34.595000] [<bf05ddf4>] (wlcore_is_queue_stopped_by_reason+0x0/0x7c [wlcore])
from [<bf05deb4>] (wl1271_handle_tx_low_watermark+0x44/0x94 [wlcore])
[ 34.595000] r8:c305b160 r7:c39e2acc r6:00000000 r5:c39e2acc r4:00000000
r3:00000000
[ 34.595000] [<bf05de70>] (wl1271_handle_tx_low_watermark+0x0/0x94 [wlcore])
from [<bf05e050>] (wl1271_tx_reset_link_queues+0x14c/0x174 [wlcore])
[ 34.595000] [<bf05df04>] (wl1271_tx_reset_link_queues+0x0/0x174 [wlcore]) from
[<bf05970c>] (wl12xx_free_link+0xec/0x150 [wlcore])
[ 34.595000] [<bf059620>] (wl12xx_free_link+0x0/0x150 [wlcore]) from
[<bf059b50>] (wl12xx_cmd_role_stop_sta+0x98/0x100 [wlcore])
[ 34.595000] r7:c305b160 r6:00000000 r5:c39e2acc r4:c3a89ac0
[ 34.595000] [<bf059ab8>] (wl12xx_cmd_role_stop_sta+0x0/0x100 [wlcore]) from
[<bf0546d8>] (wl1271_bss_info_changed_sta+0x840/0x9a4 [wlcore])
[ 34.595000] r7:c39e2acc r6:c305b160 r5:c39e2a10 r4:000000e0
[ 34.595000] [<bf053e98>] (wl1271_bss_info_changed_sta+0x0/0x9a4 [wlcore]) from
[<bf054a0c>] (wl1271_op_bss_info_changed+0x1d0/0x46c [wlcore])
[ 34.595000] [<bf05483c>] (wl1271_op_bss_info_changed+0x0/0x46c [wlcore]) from
[<bf009538>] (ieee80211_bss_info_change_notify+0x6c/0x10c [mac80211])
[ 34.595000] [<bf0094cc>] (ieee80211_bss_info_change_notify+0x0/0x10c
[mac80211]) from [<bf02bf1c>] (ieee80211_prep_connection+0x2dc/0x76c [mac80211])
[ 34.595000] r7:00000fff r6:c39cfe48 r5:c305b8e4 r4:c39e2440
[ 34.595000] [<bf02bc40>] (ieee80211_prep_connection+0x0/0x76c [mac80211]) from
[<bf030d70>] (ieee80211_mgd_auth+0x228/0x29c [mac80211])
[ 34.595000] [<bf030b48>] (ieee80211_mgd_auth+0x0/0x29c [mac80211]) from
[<bf01afd4>] (ieee80211_auth+0x18/0x1c [mac80211])
[ 34.595000] [<bf01afbc>] (ieee80211_auth+0x0/0x1c [mac80211]) from [<c02e40a8>]
(__cfg80211_mlme_auth+0x170/0x188)
[ 34.595000] [<c02e3f38>] (__cfg80211_mlme_auth+0x0/0x188) from [<c02e4154>]
(cfg80211_mlme_auth+0x94/0xb8)
[ 34.595000] [<c02e40c0>] (cfg80211_mlme_auth+0x0/0xb8) from [<c02dffbc>]
(nl80211_authenticate+0x258/0x27c)
[ 34.595000] [<c02dfd64>] (nl80211_authenticate+0x0/0x27c) from [<c0260044>]
(genl_rcv_msg+0x23c/0x274)
[ 34.595000] [<c025fe08>] (genl_rcv_msg+0x0/0x274) from [<c025f458>]
(netlink_rcv_skb+0xb4/0xc8)
[ 34.595000] [<c025f3a4>] (netlink_rcv_skb+0x0/0xc8) from [<c025fdfc>]
(genl_rcv+0x20/0x2c)
[ 34.595000] r6:00000048 r5:c3a5b400 r4:c38c4bc0 r3:c025fddc
[ 34.595000] [<c025fddc>] (genl_rcv+0x0/0x2c) from [<c025ee40>]
(netlink_unicast+0x1b0/0x214)
[ 34.595000] r4:c38c5e00 r3:c025fddc
[ 34.595000] [<c025ec90>] (netlink_unicast+0x0/0x214) from [<c025f230>]
(netlink_sendmsg+0x2e0/0x358)
[ 34.595000] [<c025ef50>] (netlink_sendmsg+0x0/0x358) from [<c0230944>]
(sock_sendmsg+0x88/0xa8)
[ 34.595000] [<c02308bc>] (sock_sendmsg+0x0/0xa8) from [<c0230d64>]
(___sys_sendmsg+0x2c8/0x2e0)
[ 34.595000] [<c0230a9c>] (___sys_sendmsg+0x0/0x2e0) from [<c0232920>]
(__sys_sendmsg+0x44/0x70)
[ 34.595000] [<c02328dc>] (__sys_sendmsg+0x0/0x70) from [<c023295c>]
(sys_sendmsg+0x10/0x14)
[ 34.595000] r6:be94fa8c r5:017940a0 r4:00000000
[ 34.595000] [<c023294c>] (sys_sendmsg+0x0/0x14) from [<c0009400>]
(ret_fast_syscall+0x0/0x2c)
[ 34.595000] ---[ end trace a2c5f3d5ef286154 ]---
[ 34.605000] wlan0: send auth to 88:43:e1:57:79:c0 (try 1/3)
[ 34.605000] ------------[ cut here ]------------
[ 34.605000] WARNING: at drivers/net/wireless/ti/wlcore/tx.c:1316
wlcore_is_queue_stopped_locked+0x74/0x8c [wlcore]()
[ 34.605000] Modules linked in: arc4 wl12xx wlcore mac80211 wlcore_sdio lm70
[ 34.605000] Backtrace:
[ 34.605000] [<c000b92c>] (dump_backtrace+0x0/0x10c) from [<c02ed4a4>]
(dump_stack+0x18/0x1c)
[ 34.605000] r6:bf05f240 r5:00000009 r4:00000000 r3:00000000
[ 34.605000] [<c02ed48c>] (dump_stack+0x0/0x1c) from [<c0019ecc>]
(warn_slowpath_common+0x54/0x70)
[ 34.605000] [<c0019e78>] (warn_slowpath_common+0x0/0x70) from [<c0019f0c>]
(warn_slowpath_null+0x24/0x2c)
[ 34.605000] r8:40000013 r7:c305b160 r6:c305b160 r5:bf06ca36 r4:00000000
r3:00000009
[ 34.605000] [<c0019ee8>] (warn_slowpath_null+0x0/0x2c) from [<bf05f240>]
(wlcore_is_queue_stopped_locked+0x74/0x8c [wlcore])
[ 34.605000] [<bf05f1cc>] (wlcore_is_queue_stopped_locked+0x0/0x8c [wlcore])
from [<bf05225c>] (wl1271_op_tx+0x104/0x290 [wlcore])
[ 34.605000] r6:c39e2a10 r5:00000001 r4:c38c4a40 r3:00000003
[ 34.605000] [<bf052158>] (wl1271_op_tx+0x0/0x290 [wlcore]) from [<bf023e64>]
(__ieee80211_tx+0x134/0x384 [mac80211])
[ 34.605000] [<bf023d30>] (__ieee80211_tx+0x0/0x384 [mac80211]) from
[<bf024174>] (ieee80211_tx+0xc0/0xe8 [mac80211])
[ 34.605000] [<bf0240b4>] (ieee80211_tx+0x0/0xe8 [mac80211]) from [<bf02474c>]
(ieee80211_xmit+0x80/0x94 [mac80211])
[ 34.605000] [<bf0246cc>] (ieee80211_xmit+0x0/0x94 [mac80211]) from [<bf025698>]
(__ieee80211_tx_skb_tid_band+0x58/0x64 [mac80211])
[ 34.605000] r8:00000000 r7:00000001 r6:00000000 r5:c39e2440 r4:c38c4a40
r3:c3ae8000
[ 34.605000] [<bf025640>] (__ieee80211_tx_skb_tid_band+0x0/0x64 [mac80211]) from
[<bf0286c4>] (ieee80211_send_auth+0x158/0x1e0 [mac80211])
[ 34.605000] r6:c39e2440 r5:c38c4a40 r4:c3ac8b94 r3:00000000
[ 34.605000] [<bf02856c>] (ieee80211_send_auth+0x0/0x1e0 [mac80211]) from
[<bf02c550>] (ieee80211_probe_auth+0x174/0x2c8 [mac80211])
[ 34.605000] [<bf02c3dc>] (ieee80211_probe_auth+0x0/0x2c8 [mac80211]) from
[<bf030d80>] (ieee80211_mgd_auth+0x238/0x29c [mac80211])
[ 34.605000] r8:c39e2798 r7:00000000 r6:c39e2440 r5:c3a72c20 r4:c3ae9af8
[ 34.605000] [<bf030b48>] (ieee80211_mgd_auth+0x0/0x29c [mac80211]) from
[<bf01afd4>] (ieee80211_auth+0x18/0x1c [mac80211])
[ 34.605000] [<bf01afbc>] (ieee80211_auth+0x0/0x1c [mac80211]) from [<c02e40a8>]
(__cfg80211_mlme_auth+0x170/0x188)
[ 34.605000] [<c02e3f38>] (__cfg80211_mlme_auth+0x0/0x188) from [<c02e4154>]
(cfg80211_mlme_auth+0x94/0xb8)
[ 34.605000] [<c02e40c0>] (cfg80211_mlme_auth+0x0/0xb8) from [<c02dffbc>]
(nl80211_authenticate+0x258/0x27c)
[ 34.605000] [<c02dfd64>] (nl80211_authenticate+0x0/0x27c) from [<c0260044>]
(genl_rcv_msg+0x23c/0x274)
[ 34.605000] [<c025fe08>] (genl_rcv_msg+0x0/0x274) from [<c025f458>]
(netlink_rcv_skb+0xb4/0xc8)
[ 34.605000] [<c025f3a4>] (netlink_rcv_skb+0x0/0xc8) from [<c025fdfc>]
(genl_rcv+0x20/0x2c)
[ 34.605000] r6:00000048 r5:c3a5b400 r4:c38c4bc0 r3:c025fddc
[ 34.605000] [<c025fddc>] (genl_rcv+0x0/0x2c) from [<c025ee40>]
(netlink_unicast+0x1b0/0x214)
[ 34.605000] r4:c38c5e00 r3:c025fddc
[ 34.605000] [<c025ec90>] (netlink_unicast+0x0/0x214) from [<c025f230>]
(netlink_sendmsg+0x2e0/0x358)
[ 34.605000] [<c025ef50>] (netlink_sendmsg+0x0/0x358) from [<c0230944>]
(sock_sendmsg+0x88/0xa8)
[ 34.605000] [<c02308bc>] (sock_sendmsg+0x0/0xa8) from [<c0230d64>]
(___sys_sendmsg+0x2c8/0x2e0)
[ 34.605000] [<c0230a9c>] (___sys_sendmsg+0x0/0x2e0) from [<c0232920>]
(__sys_sendmsg+0x44/0x70)
[ 34.605000] [<c02328dc>] (__sys_sendmsg+0x0/0x70) from [<c023295c>]
(sys_sendmsg+0x10/0x14)
[ 34.605000] r6:be94fa8c r5:017940a0 r4:00000000
[ 34.605000] [<c023294c>] (sys_sendmsg+0x0/0x14) from [<c0009400>]
(ret_fast_syscall+0x0/0x2c)
[ 34.605000] ---[ end trace a2c5f3d5ef286155 ]---
[ 34.625000] wlan0: send auth to 88:43:e1:57:79:c0 (try 2/3)
[ 34.640000] wlan0: send auth to 88:43:e1:57:79:c0 (try 3/3)
[ 34.650000] wlan0: authentication with 88:43:e1:57:79:c0 timed out
wlan0: SME: Trying to authenticate with 88:43:e1:57:79:c0 (SSID='[ 34.875000]
wlan0: authenticate with 88:43:e1:57:79:c0
A. Guidance' freq=2452 MHz)
[ 34.915000] wlan0: send auth to 88:43:e1:57:79:c0 (try 1/3)
[ 34.920000] wlan0: authenticated
wlan0: Trying to associate with 88:43:e1:57:79:c0 (SSID='A. Guidance' freq=2452 MHz)
[ 34.995000] wlan0: associate with 88:43:e1:57:79:c0 (try 1/3)
[ 35.015000] wlan0: associate with 88:43:e1:57:79:c0 (try 2/3)
[ 35.035000] wlan0: associate with 88:43:e1:57:79:c0 (try 3/3)
[ 35.060000] wlan0: association with 88:43:e1:57:79:c0 timed out
wlan0: SME: Trying to authenticate with 88:43:e1:57:79:c0 (SSID='[ 35.620000]
wlan0: authenticate with 88:43:e1:57:79:c0
A. Guidance' freq=2452 MHz)
[ 35.660000] wlan0: send auth to 88:43:e1:57:79:c0 (try 1/3)
[ 35.665000] wlan0: authenticated
wlan0: Trying to associate with 88:43:e1:57:79:c0 (SSID='A. Guidance' freq=2452 MHz)
[ 35.740000] wlan0: associate with 88:43:e1:57:79:c0 (try 1/3)
[ 35.745000] wlan0: RX AssocResp from 88:43:e1:57:79:c0 (capab=0x431 status=0 aid=2)
[ 35.765000] wlan0: associated
[ 35.770000] cfg80211: Calling CRDA for country: PT
[ 35.780000] cfg80211: Regulatory domain changed to country: PT
[ 35.780000] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain,
max_eirp)
[ 35.790000] cfg80211: (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm)
[ 35.790000] cfg80211: (5170000 KHz - 5250000 KHz @ 40000 KHz), (N/A, 2000 mBm)
[ 35.800000] cfg80211: (5250000 KHz - 5330000 KHz @ 40000 KHz), (N/A, 2000 mBm)
[ 35.800000] cfg80211: (5490000 KHz - 5710000 KHz @ 40000 KHz), (N/A, 2700 mBm)
[ 35.810000] cfg80211: (57240000 KHz - 65880000 KHz @ 2160000 KHz), (N/A, 4000
mBm)
wlan0: Associated with 88:43:e1:57:79:c0
[ 37.585000] wlcore: Beacon loss detected. roles:0xff
[ 39.250000] wlcore: Beacon loss detected. roles:0xff
[ 40.935000] wlcore: Beacon loss detected. roles:0xff
[ 42.400000] wlcore: Connection loss work (role_id: 0).
[ 42.400000] wlan0: Connection to AP 88:43:e1:57:79:c0 lost
[ 42.475000] cfg80211: Calling CRDA to update world regulatory domain
[ 42.485000] cfg80211: World regulatory domain updated:
[ 42.485000] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain,
max_eirp)
[ 42.500000] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000
mBm)
[ 42.500000] cfg80211: (2457000 KHz - 2482000 KHz @ 40000 KHz), (300 mBi, 2000
mBm)
[ 42.515000] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000
mBm)
[ 42.515000] cfg80211: (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000
mBm)
[ 42.525000] cfg80211: (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000
mBm)
[ 42.525000] cfg80211: Calling CRDA for country: PT
[ 42.540000] cfg80211: Regulatory domain changed to country: PT
[ 42.540000] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain,
max_eirp)
[ 42.550000] cfg80211: (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm)
[ 42.550000] cfg80211: (5170000 KHz - 5250000 KHz @ 40000 KHz), (N/A, 2000 mBm)
[ 42.560000] cfg80211: (5250000 KHz - 5330000 KHz @ 40000 KHz), (N/A, 2000 mBm)
[ 42.560000] cfg80211: (5490000 KHz - 5710000 KHz @ 40000 KHz), (N/A, 2700 mBm)
wlan0: CTRL-EVENT-DISCONNECTED bssid=88:43:e1:57:79:c0 reason=4 l[ 42.575000]
cfg80211: (57240000 KHz - 65880000 KHz @ 2160000 KHz), (N/A, 4000 mBm)
ocally_generated=1
wlan0: WPA: 4-Way Handshake failed - pre-shared key may be incorrect
wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="A. Guidance" auth_failures=1
duration=10
Any ideas in what could be wrong?
Best regards,
José Gonçalves
^ permalink raw reply
* Re: Replacement for local->hw.conf.channel
From: Ben Greear @ 2013-07-08 18:47 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless@vger.kernel.org
In-Reply-To: <1373308289.8312.17.camel@jlt4.sipsolutions.net>
On 07/08/2013 11:31 AM, Johannes Berg wrote:
> On Mon, 2013-07-08 at 11:20 -0700, Ben Greear wrote:
>> On 07/04/2013 12:27 AM, Johannes Berg wrote:
>>> On Wed, 2013-07-03 at 17:01 -0700, Ben Greear wrote:
>>>> I'm trying to port some patches forward to 3.10....
>>>>
>>>> I am trying to find the current channel for a radio. Since
>>>> hw.conf.channel no longer exists, what is the best way to
>>>> go about this?
>>>
>>> Well there's hw.conf.chandef.chan now I think, but that can be NULL and
>>> generic mac80211 code must not use it. There's no single current channel
>>> any more, you want vif->chanctx or so.
>>
>> From looking at the scanning code (line 542 or so), it appears
>>
>> local->_oper_chandef.chan
>>
>> might work?
>
> No, don't use that in any new code. It's purely for compatibility with
> drivers that aren't converted to channel contexts (yet).
>
>> In 3.9, ath9k_htc was giving me a null channel in the code below:
>>
>> chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);
>> if (chanctx_conf)
>> channel = chanctx_conf->def.chan;
>> else
>> channel = NULL;
>
> Well that of course happens if the vif isn't bound to a channel context.
Any opinions on what to return in ethtool stats for frequency if
there is no channel context?
If there is a quick way to just return whatever the hardware is
currently using, I think that is best, but if there is not
a reliable way to do this then, some hard coded default
like 0 is probably best.
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply
* Re: Replacement for local->hw.conf.channel
From: Johannes Berg @ 2013-07-08 18:31 UTC (permalink / raw)
To: Ben Greear; +Cc: linux-wireless@vger.kernel.org
In-Reply-To: <51DB0302.5050201@candelatech.com>
On Mon, 2013-07-08 at 11:20 -0700, Ben Greear wrote:
> On 07/04/2013 12:27 AM, Johannes Berg wrote:
> > On Wed, 2013-07-03 at 17:01 -0700, Ben Greear wrote:
> >> I'm trying to port some patches forward to 3.10....
> >>
> >> I am trying to find the current channel for a radio. Since
> >> hw.conf.channel no longer exists, what is the best way to
> >> go about this?
> >
> > Well there's hw.conf.chandef.chan now I think, but that can be NULL and
> > generic mac80211 code must not use it. There's no single current channel
> > any more, you want vif->chanctx or so.
>
> From looking at the scanning code (line 542 or so), it appears
>
> local->_oper_chandef.chan
>
> might work?
No, don't use that in any new code. It's purely for compatibility with
drivers that aren't converted to channel contexts (yet).
> In 3.9, ath9k_htc was giving me a null channel in the code below:
>
> chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);
> if (chanctx_conf)
> channel = chanctx_conf->def.chan;
> else
> channel = NULL;
Well that of course happens if the vif isn't bound to a channel context.
johannes
^ permalink raw reply
* Re: Replacement for local->hw.conf.channel
From: Ben Greear @ 2013-07-08 18:20 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless@vger.kernel.org
In-Reply-To: <1372922870.8235.0.camel@jlt4.sipsolutions.net>
On 07/04/2013 12:27 AM, Johannes Berg wrote:
> On Wed, 2013-07-03 at 17:01 -0700, Ben Greear wrote:
>> I'm trying to port some patches forward to 3.10....
>>
>> I am trying to find the current channel for a radio. Since
>> hw.conf.channel no longer exists, what is the best way to
>> go about this?
>
> Well there's hw.conf.chandef.chan now I think, but that can be NULL and
> generic mac80211 code must not use it. There's no single current channel
> any more, you want vif->chanctx or so.
From looking at the scanning code (line 542 or so), it appears
local->_oper_chandef.chan
might work?
In 3.9, ath9k_htc was giving me a null channel in the code below:
chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);
if (chanctx_conf)
channel = chanctx_conf->def.chan;
else
channel = NULL;
I haven't tried that yet in 3.10 or later, so maybe I don't need the
hw.conf.channel in new code anyway.
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply
* Re: [PATCH] iw: Add support for mesh peer link expiration.
From: Johannes Berg @ 2013-07-08 18:14 UTC (permalink / raw)
To: Colleen Twitty; +Cc: linux-wirelss, open80211s
In-Reply-To: <1373303058-4229-1-git-send-email-colleen@cozybit.com>
On Mon, 2013-07-08 at 10:04 -0700, Colleen Twitty wrote:
> User can configure the peer link expiration time with a
> new mesh parameter, mesh_plink_timeout. This parameter
> sets the expiration time, in seconds, for peer links.
> After this time, the peer link is expired. This means the
> inactive STA is removed from the list of peers and is not
> considered a peer again unless it re-peers.
Applied.
johannes
^ permalink raw reply
* [PATCH] iw: Add support for mesh peer link expiration.
From: Colleen Twitty @ 2013-07-08 17:04 UTC (permalink / raw)
To: linux-wirelss; +Cc: Johannes Berg, open80211s
User can configure the peer link expiration time with a
new mesh parameter, mesh_plink_timeout. This parameter
sets the expiration time, in seconds, for peer links.
After this time, the peer link is expired. This means the
inactive STA is removed from the list of peers and is not
considered a peer again unless it re-peers.
Signed-off-by: Colleen Twitty <colleen@cozybit.com>
---
mesh.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/mesh.c b/mesh.c
index 5a09b62..ca065bf 100644
--- a/mesh.c
+++ b/mesh.c
@@ -157,6 +157,11 @@ static void _print_u32_timeout(struct nlattr *a)
printf("%u milliseconds", nla_get_u32(a));
}
+static void _print_u32_in_seconds(struct nlattr *a)
+{
+ printf("%d seconds", nla_get_u32(a));
+}
+
static void _print_u32_in_TUs(struct nlattr *a)
{
printf("%d TUs", nla_get_u32(a));
@@ -258,6 +263,8 @@ const static struct mesh_param_descr _mesh_param_descrs[] =
_my_nla_put_u32, _parse_u32_power_mode, _print_u32_power_mode},
{"mesh_awake_window", NL80211_MESHCONF_AWAKE_WINDOW,
_my_nla_put_u16, _parse_u16, _print_u16_in_TUs},
+ {"mesh_plink_timeout", NL80211_MESHCONF_PLINK_TIMEOUT,
+ _my_nla_put_u32, _parse_u32, _print_u32_in_seconds},
};
static void print_all_mesh_param_descr(void)
--
1.7.9.5
^ permalink raw reply related
* Re: ath10k mailing list and new git tree
From: Kalle Valo @ 2013-07-08 15:10 UTC (permalink / raw)
To: sedat.dilek; +Cc: linux-wireless, ath9k-devel, LKML, ath10k
In-Reply-To: <CA+icZUU32347g48dpk-gVZZ1H9pvnjaSWpQ12B-5vOkLzs8Nbg@mail.gmail.com>
Sedat Dilek <sedat.dilek@gmail.com> writes:
> On Mon, Jul 8, 2013 at 4:17 PM, Kalle Valo <kvalo@qca.qualcomm.com> wrote:
>> Hi,
>>
>> we have a new mailing list for ath10k, please use that in the future
>> instead of ath9k-devel:
>>
>> http://lists.infradead.org/mailman/listinfo/ath10k
>>
>> As ath10k is now in wireless-next please use the new git tree which is
>> for both ath6kl and ath10k:
>>
>> https://github.com/kvalo/ath
>>
>> I have also updated the wiki accordingly:
>>
>> http://wireless.kernel.org/en/users/Drivers/ath10k
>>
>
> You have sent these new informations for MAINTAINERS file to upstream?
Good point. Actually MAINTAINERS entry for ath10k is completely missing,
I'll send a patch for that.
Thanks.
--
Kalle Valo
^ permalink raw reply
* Re: ath10k mailing list and new git tree
From: Sedat Dilek @ 2013-07-08 14:58 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless, ath9k-devel, LKML
In-Reply-To: <87r4f9cf0w.fsf@kamboji.qca.qualcomm.com>
On Mon, Jul 8, 2013 at 4:17 PM, Kalle Valo <kvalo@qca.qualcomm.com> wrote:
> Hi,
>
> we have a new mailing list for ath10k, please use that in the future
> instead of ath9k-devel:
>
> http://lists.infradead.org/mailman/listinfo/ath10k
>
> As ath10k is now in wireless-next please use the new git tree which is
> for both ath6kl and ath10k:
>
> https://github.com/kvalo/ath
>
> I have also updated the wiki accordingly:
>
> http://wireless.kernel.org/en/users/Drivers/ath10k
>
You have sent these new informations for MAINTAINERS file to upstream?
- Sedat -
> --
> Kalle Valo
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCHv6 14/18] ath9k: set 5/10 MHz supported channels and fix bitrate
From: Simon Wunderlich @ 2013-07-08 14:56 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, Mathias Kretschmer, Simon Wunderlich
In-Reply-To: <1373295366-12823-1-git-send-email-siwu@hrz.tu-chemnitz.de>
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
---
Changes to PATCHv4:
* remove unused divisor line in the rate control
---
drivers/net/wireless/ath/ath9k/init.c | 24 ++++++++++++++++--------
drivers/net/wireless/ath/ath9k/rc.c | 5 +++++
2 files changed, 21 insertions(+), 8 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index 71aa5c9..bd909ba 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -146,14 +146,22 @@ static struct ieee80211_rate ath9k_legacy_rates[] = {
RATE(20, 0x1a, IEEE80211_RATE_SHORT_PREAMBLE),
RATE(55, 0x19, IEEE80211_RATE_SHORT_PREAMBLE),
RATE(110, 0x18, IEEE80211_RATE_SHORT_PREAMBLE),
- RATE(60, 0x0b, 0),
- RATE(90, 0x0f, 0),
- RATE(120, 0x0a, 0),
- RATE(180, 0x0e, 0),
- RATE(240, 0x09, 0),
- RATE(360, 0x0d, 0),
- RATE(480, 0x08, 0),
- RATE(540, 0x0c, 0),
+ RATE(60, 0x0b, (IEEE80211_RATE_SUPPORTS_5MHZ |
+ IEEE80211_RATE_SUPPORTS_10MHZ)),
+ RATE(90, 0x0f, (IEEE80211_RATE_SUPPORTS_5MHZ |
+ IEEE80211_RATE_SUPPORTS_10MHZ)),
+ RATE(120, 0x0a, (IEEE80211_RATE_SUPPORTS_5MHZ |
+ IEEE80211_RATE_SUPPORTS_10MHZ)),
+ RATE(180, 0x0e, (IEEE80211_RATE_SUPPORTS_5MHZ |
+ IEEE80211_RATE_SUPPORTS_10MHZ)),
+ RATE(240, 0x09, (IEEE80211_RATE_SUPPORTS_5MHZ |
+ IEEE80211_RATE_SUPPORTS_10MHZ)),
+ RATE(360, 0x0d, (IEEE80211_RATE_SUPPORTS_5MHZ |
+ IEEE80211_RATE_SUPPORTS_10MHZ)),
+ RATE(480, 0x08, (IEEE80211_RATE_SUPPORTS_5MHZ |
+ IEEE80211_RATE_SUPPORTS_10MHZ)),
+ RATE(540, 0x0c, (IEEE80211_RATE_SUPPORTS_5MHZ |
+ IEEE80211_RATE_SUPPORTS_10MHZ)),
};
#ifdef CONFIG_MAC80211_LEDS
diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
index e41f563..5a69d9b 100644
--- a/drivers/net/wireless/ath/ath9k/rc.c
+++ b/drivers/net/wireless/ath/ath9k/rc.c
@@ -1282,9 +1282,14 @@ static void ath_rate_init(void *priv, struct ieee80211_supported_band *sband,
struct ath_common *common = ath9k_hw_common(sc->sc_ah);
struct ath_rate_priv *ath_rc_priv = priv_sta;
int i, j = 0;
+ u32 rate_flags = ieee80211_chandef_rate_flags(&sc->hw->conf.chandef);
for (i = 0; i < sband->n_bitrates; i++) {
if (sta->supp_rates[sband->band] & BIT(i)) {
+ if ((rate_flags & sband->bitrates[i].flags)
+ != rate_flags)
+ continue;
+
ath_rc_priv->neg_rates.rs_rates[j]
= (sband->bitrates[i].bitrate * 2) / 10;
j++;
--
1.7.10.4
^ permalink raw reply related
* [PATCHv6 12/18] ath9k: use chandef instead of channel_type
From: Simon Wunderlich @ 2013-07-08 14:56 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, Mathias Kretschmer, Simon Wunderlich
In-Reply-To: <1373295366-12823-1-git-send-email-siwu@hrz.tu-chemnitz.de>
To enable support for 5/10 MHz, some internal functions must be
converted from using the (old) channel_type to chandef. This is a good
chance to change all remaining occurences.
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
---
drivers/net/wireless/ath/ath9k/common.c | 67 +++++++++++++++----------
drivers/net/wireless/ath/ath9k/common.h | 3 +-
drivers/net/wireless/ath/ath9k/htc_drv_main.c | 5 +-
drivers/net/wireless/ath/ath9k/init.c | 4 +-
drivers/net/wireless/ath/ath9k/main.c | 8 ++-
drivers/net/wireless/ath/ath9k/rc.c | 4 +-
6 files changed, 51 insertions(+), 40 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/common.c b/drivers/net/wireless/ath/ath9k/common.c
index 344fdde..d3063c2 100644
--- a/drivers/net/wireless/ath/ath9k/common.c
+++ b/drivers/net/wireless/ath/ath9k/common.c
@@ -49,37 +49,40 @@ int ath9k_cmn_get_hw_crypto_keytype(struct sk_buff *skb)
}
EXPORT_SYMBOL(ath9k_cmn_get_hw_crypto_keytype);
-static u32 ath9k_get_extchanmode(struct ieee80211_channel *chan,
- enum nl80211_channel_type channel_type)
+static u32 ath9k_get_extchanmode(struct cfg80211_chan_def *chandef)
{
u32 chanmode = 0;
- switch (chan->band) {
+ switch (chandef->chan->band) {
case IEEE80211_BAND_2GHZ:
- switch (channel_type) {
- case NL80211_CHAN_NO_HT:
- case NL80211_CHAN_HT20:
+ switch (chandef->width) {
+ case NL80211_CHAN_WIDTH_20_NOHT:
+ case NL80211_CHAN_WIDTH_20:
chanmode = CHANNEL_G_HT20;
break;
- case NL80211_CHAN_HT40PLUS:
- chanmode = CHANNEL_G_HT40PLUS;
+ case NL80211_CHAN_WIDTH_40:
+ if (chandef->center_freq1 > chandef->chan->center_freq)
+ chanmode = CHANNEL_G_HT40PLUS;
+ else
+ chanmode = CHANNEL_G_HT40MINUS;
break;
- case NL80211_CHAN_HT40MINUS:
- chanmode = CHANNEL_G_HT40MINUS;
+ default:
break;
}
break;
case IEEE80211_BAND_5GHZ:
- switch (channel_type) {
- case NL80211_CHAN_NO_HT:
- case NL80211_CHAN_HT20:
+ switch (chandef->width) {
+ case NL80211_CHAN_WIDTH_20_NOHT:
+ case NL80211_CHAN_WIDTH_20:
chanmode = CHANNEL_A_HT20;
break;
- case NL80211_CHAN_HT40PLUS:
- chanmode = CHANNEL_A_HT40PLUS;
+ case NL80211_CHAN_WIDTH_40:
+ if (chandef->center_freq1 > chandef->chan->center_freq)
+ chanmode = CHANNEL_A_HT40PLUS;
+ else
+ chanmode = CHANNEL_A_HT40MINUS;
break;
- case NL80211_CHAN_HT40MINUS:
- chanmode = CHANNEL_A_HT40MINUS;
+ default:
break;
}
break;
@@ -94,13 +97,12 @@ static u32 ath9k_get_extchanmode(struct ieee80211_channel *chan,
* Update internal channel flags.
*/
void ath9k_cmn_update_ichannel(struct ath9k_channel *ichan,
- struct ieee80211_channel *chan,
- enum nl80211_channel_type channel_type)
+ struct cfg80211_chan_def *chandef)
{
- ichan->channel = chan->center_freq;
- ichan->chan = chan;
+ ichan->channel = chandef->chan->center_freq;
+ ichan->chan = chandef->chan;
- if (chan->band == IEEE80211_BAND_2GHZ) {
+ if (chandef->chan->band == IEEE80211_BAND_2GHZ) {
ichan->chanmode = CHANNEL_G;
ichan->channelFlags = CHANNEL_2GHZ | CHANNEL_OFDM;
} else {
@@ -108,8 +110,22 @@ void ath9k_cmn_update_ichannel(struct ath9k_channel *ichan,
ichan->channelFlags = CHANNEL_5GHZ | CHANNEL_OFDM;
}
- if (channel_type != NL80211_CHAN_NO_HT)
- ichan->chanmode = ath9k_get_extchanmode(chan, channel_type);
+ switch (chandef->width) {
+ case NL80211_CHAN_WIDTH_5:
+ ichan->channelFlags |= CHANNEL_QUARTER;
+ break;
+ case NL80211_CHAN_WIDTH_10:
+ ichan->channelFlags |= CHANNEL_HALF;
+ break;
+ case NL80211_CHAN_WIDTH_20_NOHT:
+ break;
+ case NL80211_CHAN_WIDTH_20:
+ case NL80211_CHAN_WIDTH_40:
+ ichan->chanmode = ath9k_get_extchanmode(chandef);
+ break;
+ default:
+ WARN_ON(1);
+ }
}
EXPORT_SYMBOL(ath9k_cmn_update_ichannel);
@@ -125,8 +141,7 @@ struct ath9k_channel *ath9k_cmn_get_curchannel(struct ieee80211_hw *hw,
chan_idx = curchan->hw_value;
channel = &ah->channels[chan_idx];
- ath9k_cmn_update_ichannel(channel, curchan,
- cfg80211_get_chandef_type(&hw->conf.chandef));
+ ath9k_cmn_update_ichannel(channel, &hw->conf.chandef);
return channel;
}
diff --git a/drivers/net/wireless/ath/ath9k/common.h b/drivers/net/wireless/ath/ath9k/common.h
index 207d069..e039bcb 100644
--- a/drivers/net/wireless/ath/ath9k/common.h
+++ b/drivers/net/wireless/ath/ath9k/common.h
@@ -44,8 +44,7 @@
int ath9k_cmn_get_hw_crypto_keytype(struct sk_buff *skb);
void ath9k_cmn_update_ichannel(struct ath9k_channel *ichan,
- struct ieee80211_channel *chan,
- enum nl80211_channel_type channel_type);
+ struct cfg80211_chan_def *chandef);
struct ath9k_channel *ath9k_cmn_get_curchannel(struct ieee80211_hw *hw,
struct ath_hw *ah);
int ath9k_cmn_count_streams(unsigned int chainmask, int max);
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index 5c1bec1..d442581 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -1203,16 +1203,13 @@ static int ath9k_htc_config(struct ieee80211_hw *hw, u32 changed)
if ((changed & IEEE80211_CONF_CHANGE_CHANNEL) || chip_reset) {
struct ieee80211_channel *curchan = hw->conf.chandef.chan;
- enum nl80211_channel_type channel_type =
- cfg80211_get_chandef_type(&hw->conf.chandef);
int pos = curchan->hw_value;
ath_dbg(common, CONFIG, "Set channel: %d MHz\n",
curchan->center_freq);
ath9k_cmn_update_ichannel(&priv->ah->channels[pos],
- hw->conf.chandef.chan,
- channel_type);
+ &hw->conf.chandef);
if (ath9k_htc_set_channel(priv, hw, &priv->ah->channels[pos]) < 0) {
ath_err(common, "Unable to set channel\n");
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index 16f8b20..71aa5c9 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -710,13 +710,15 @@ static void ath9k_init_band_txpower(struct ath_softc *sc, int band)
struct ieee80211_supported_band *sband;
struct ieee80211_channel *chan;
struct ath_hw *ah = sc->sc_ah;
+ struct cfg80211_chan_def chandef;
int i;
sband = &sc->sbands[band];
for (i = 0; i < sband->n_channels; i++) {
chan = &sband->channels[i];
ah->curchan = &ah->channels[chan->hw_value];
- ath9k_cmn_update_ichannel(ah->curchan, chan, NL80211_CHAN_HT20);
+ cfg80211_chandef_create(&chandef, chan, NL80211_CHAN_HT20);
+ ath9k_cmn_update_ichannel(ah->curchan, &chandef);
ath9k_hw_set_txpowerlimit(ah, MAX_RATE_POWER, true);
}
}
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 1737a3e..ff91f4a 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1193,8 +1193,6 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
if ((changed & IEEE80211_CONF_CHANGE_CHANNEL) || reset_channel) {
struct ieee80211_channel *curchan = hw->conf.chandef.chan;
- enum nl80211_channel_type channel_type =
- cfg80211_get_chandef_type(&conf->chandef);
int pos = curchan->hw_value;
int old_pos = -1;
unsigned long flags;
@@ -1202,8 +1200,8 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
if (ah->curchan)
old_pos = ah->curchan - &ah->channels[0];
- ath_dbg(common, CONFIG, "Set channel: %d MHz type: %d\n",
- curchan->center_freq, channel_type);
+ ath_dbg(common, CONFIG, "Set channel: %d MHz width: %d\n",
+ curchan->center_freq, hw->conf.chandef.width);
/* update survey stats for the old channel before switching */
spin_lock_irqsave(&common->cc_lock, flags);
@@ -1211,7 +1209,7 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
spin_unlock_irqrestore(&common->cc_lock, flags);
ath9k_cmn_update_ichannel(&sc->sc_ah->channels[pos],
- curchan, channel_type);
+ &conf->chandef);
/*
* If the operating channel changes, change the survey in-use flags
diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
index a3c4ca0..e41f563 100644
--- a/drivers/net/wireless/ath/ath9k/rc.c
+++ b/drivers/net/wireless/ath/ath9k/rc.c
@@ -1326,8 +1326,8 @@ static void ath_rate_update(void *priv, struct ieee80211_supported_band *sband,
ath_rc_init(sc, priv_sta);
ath_dbg(ath9k_hw_common(sc->sc_ah), CONFIG,
- "Operating HT Bandwidth changed to: %d\n",
- cfg80211_get_chandef_type(&sc->hw->conf.chandef));
+ "Operating Bandwidth changed to: %d\n",
+ &sc->hw->conf.chandef->width);
}
}
--
1.7.10.4
^ permalink raw reply related
* [PATCHv6 18/18] ath5k: enable support for 5 MHz and 10 MHz channels
From: Simon Wunderlich @ 2013-07-08 14:56 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, Mathias Kretschmer, Simon Wunderlich
In-Reply-To: <1373295366-12823-1-git-send-email-siwu@hrz.tu-chemnitz.de>
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
---
drivers/net/wireless/ath/ath5k/ath5k.h | 1 +
drivers/net/wireless/ath/ath5k/base.c | 25 ++++++++++++++++++++++---
drivers/net/wireless/ath/ath5k/base.h | 2 +-
drivers/net/wireless/ath/ath5k/mac80211-ops.c | 2 +-
4 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/ath/ath5k/ath5k.h b/drivers/net/wireless/ath/ath5k/ath5k.h
index 2d691b8..74bd54d 100644
--- a/drivers/net/wireless/ath/ath5k/ath5k.h
+++ b/drivers/net/wireless/ath/ath5k/ath5k.h
@@ -29,6 +29,7 @@
#include <linux/average.h>
#include <linux/leds.h>
#include <net/mac80211.h>
+#include <net/cfg80211.h>
/* RX/TX descriptor hw structs
* TODO: Driver part should only see sw structs */
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 7c298af..48161ed 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -56,6 +56,7 @@
#include <linux/etherdevice.h>
#include <linux/nl80211.h>
+#include <net/cfg80211.h>
#include <net/ieee80211_radiotap.h>
#include <asm/unaligned.h>
@@ -443,11 +444,27 @@ ath5k_setup_bands(struct ieee80211_hw *hw)
* Called with ah->lock.
*/
int
-ath5k_chan_set(struct ath5k_hw *ah, struct ieee80211_channel *chan)
+ath5k_chan_set(struct ath5k_hw *ah, struct cfg80211_chan_def *chandef)
{
ATH5K_DBG(ah, ATH5K_DEBUG_RESET,
"channel set, resetting (%u -> %u MHz)\n",
- ah->curchan->center_freq, chan->center_freq);
+ ah->curchan->center_freq, chandef->chan->center_freq);
+
+ switch (chandef->width) {
+ case NL80211_CHAN_WIDTH_20:
+ case NL80211_CHAN_WIDTH_20_NOHT:
+ ah->ah_bwmode = AR5K_BWMODE_DEFAULT;
+ break;
+ case NL80211_CHAN_WIDTH_5:
+ ah->ah_bwmode = AR5K_BWMODE_5MHZ;
+ break;
+ case NL80211_CHAN_WIDTH_10:
+ ah->ah_bwmode = AR5K_BWMODE_10MHZ;
+ break;
+ default:
+ WARN_ON(1);
+ return -EINVAL;
+ }
/*
* To switch channels clear any pending DMA operations;
@@ -455,7 +472,7 @@ ath5k_chan_set(struct ath5k_hw *ah, struct ieee80211_channel *chan)
* hardware at the new frequency, and then re-enable
* the relevant bits of the h/w.
*/
- return ath5k_reset(ah, chan, true);
+ return ath5k_reset(ah, chandef->chan, true);
}
void ath5k_vif_iter(void *data, u8 *mac, struct ieee80211_vif *vif)
@@ -2525,6 +2542,8 @@ ath5k_init_ah(struct ath5k_hw *ah, const struct ath_bus_ops *bus_ops)
/* SW support for IBSS_RSN is provided by mac80211 */
hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN;
+ hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_5_10_MHZ;
+
/* both antennas can be configured as RX or TX */
hw->wiphy->available_antennas_tx = 0x3;
hw->wiphy->available_antennas_rx = 0x3;
diff --git a/drivers/net/wireless/ath/ath5k/base.h b/drivers/net/wireless/ath/ath5k/base.h
index ca9a83c..97469d0 100644
--- a/drivers/net/wireless/ath/ath5k/base.h
+++ b/drivers/net/wireless/ath/ath5k/base.h
@@ -101,7 +101,7 @@ void ath5k_set_beacon_filter(struct ieee80211_hw *hw, bool enable);
void ath5k_update_bssid_mask_and_opmode(struct ath5k_hw *ah,
struct ieee80211_vif *vif);
-int ath5k_chan_set(struct ath5k_hw *ah, struct ieee80211_channel *chan);
+int ath5k_chan_set(struct ath5k_hw *ah, struct cfg80211_chan_def *chandef);
void ath5k_txbuf_free_skb(struct ath5k_hw *ah, struct ath5k_buf *bf);
void ath5k_rxbuf_free_skb(struct ath5k_hw *ah, struct ath5k_buf *bf);
void ath5k_tx_queue(struct ieee80211_hw *hw, struct sk_buff *skb,
diff --git a/drivers/net/wireless/ath/ath5k/mac80211-ops.c b/drivers/net/wireless/ath/ath5k/mac80211-ops.c
index 81b686c..aa9d976 100644
--- a/drivers/net/wireless/ath/ath5k/mac80211-ops.c
+++ b/drivers/net/wireless/ath/ath5k/mac80211-ops.c
@@ -202,7 +202,7 @@ ath5k_config(struct ieee80211_hw *hw, u32 changed)
mutex_lock(&ah->lock);
if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
- ret = ath5k_chan_set(ah, conf->chandef.chan);
+ ret = ath5k_chan_set(ah, &conf->chandef);
if (ret < 0)
goto unlock;
}
--
1.7.10.4
^ permalink raw reply related
* [PATCHv6 13/18] ath9k: report 5/10 MHz channels
From: Simon Wunderlich @ 2013-07-08 14:56 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, Mathias Kretschmer, Simon Wunderlich
In-Reply-To: <1373295366-12823-1-git-send-email-siwu@hrz.tu-chemnitz.de>
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
---
drivers/net/wireless/ath/ath9k/recv.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index 865e043..0b0bc9d 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -865,6 +865,17 @@ static int ath9k_process_rate(struct ath_common *common,
band = hw->conf.chandef.chan->band;
sband = hw->wiphy->bands[band];
+ switch (hw->conf.chandef.width) {
+ case NL80211_CHAN_WIDTH_5:
+ rxs->flag |= RX_FLAG_5MHZ;
+ break;
+ case NL80211_CHAN_WIDTH_10:
+ rxs->flag |= RX_FLAG_10MHZ;
+ break;
+ default:
+ break;
+ }
+
if (rx_stats->rs_rate & 0x80) {
/* HT rate */
rxs->flag |= RX_FLAG_HT;
--
1.7.10.4
^ permalink raw reply related
* [PATCHv6 15/18] ath9k: announce that ath9k supports 5/10 MHz
From: Simon Wunderlich @ 2013-07-08 14:56 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, Mathias Kretschmer, Simon Wunderlich
In-Reply-To: <1373295366-12823-1-git-send-email-siwu@hrz.tu-chemnitz.de>
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
---
drivers/net/wireless/ath/ath9k/init.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index bd909ba..85a5a87 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -844,6 +844,7 @@ void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw)
hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN;
hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_TDLS;
hw->wiphy->flags |= WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL;
+ hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_5_10_MHZ;
#ifdef CONFIG_PM_SLEEP
if ((ah->caps.hw_caps & ATH9K_HW_WOW_DEVICE_CAPABLE) &&
--
1.7.10.4
^ permalink raw reply related
* [PATCHv6 11/18] ath9k: always use SIFS times from OFDM for 5/10 MHz
From: Simon Wunderlich @ 2013-07-08 14:55 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, Mathias Kretschmer, Simon Wunderlich
In-Reply-To: <1373295366-12823-1-git-send-email-siwu@hrz.tu-chemnitz.de>
5/10 MHz channels should always use SIFS times as defined in IEEE
802.11-2012 18.4.4 (OFDM PHY characteristics). This makes it compatible
to ath5k, which does the same.
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
---
drivers/net/wireless/ath/ath9k/hw.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 4ca0cb0..748f0b6 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -1069,7 +1069,7 @@ void ath9k_hw_init_global_settings(struct ath_hw *ah)
if (IS_CHAN_A_FAST_CLOCK(ah, chan))
tx_lat += 11;
- sifstime *= 2;
+ sifstime = 32;
ack_offset = 16;
slottime = 13;
} else if (IS_CHAN_QUARTER_RATE(chan)) {
@@ -1079,7 +1079,7 @@ void ath9k_hw_init_global_settings(struct ath_hw *ah)
if (IS_CHAN_A_FAST_CLOCK(ah, chan))
tx_lat += 22;
- sifstime *= 4;
+ sifstime = 64;
ack_offset = 32;
slottime = 21;
} else {
@@ -1116,7 +1116,6 @@ void ath9k_hw_init_global_settings(struct ath_hw *ah)
ctstimeout += 48 - sifstime - ah->slottime;
}
-
ath9k_hw_set_sifs_time(ah, sifstime);
ath9k_hw_setslottime(ah, slottime);
ath9k_hw_set_ack_timeout(ah, acktimeout);
--
1.7.10.4
^ permalink raw reply related
* [PATCHv6 17/18] ath5k: set 5/10 MHz supported channels and fix duration
From: Simon Wunderlich @ 2013-07-08 14:56 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, Mathias Kretschmer, Simon Wunderlich
In-Reply-To: <1373295366-12823-1-git-send-email-siwu@hrz.tu-chemnitz.de>
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
---
drivers/net/wireless/ath/ath5k/base.c | 24 ++++++++++++++++--------
drivers/net/wireless/ath/ath5k/pcu.c | 2 ++
drivers/net/wireless/ath/ath5k/qcu.c | 25 ++++++++++++++++++++++++-
3 files changed, 42 insertions(+), 9 deletions(-)
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 260a6fc..7c298af 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -165,28 +165,36 @@ static const struct ieee80211_rate ath5k_rates[] = {
.flags = IEEE80211_RATE_SHORT_PREAMBLE },
{ .bitrate = 60,
.hw_value = ATH5K_RATE_CODE_6M,
- .flags = 0 },
+ .flags = IEEE80211_RATE_SUPPORTS_5MHZ |
+ IEEE80211_RATE_SUPPORTS_10MHZ },
{ .bitrate = 90,
.hw_value = ATH5K_RATE_CODE_9M,
- .flags = 0 },
+ .flags = IEEE80211_RATE_SUPPORTS_5MHZ |
+ IEEE80211_RATE_SUPPORTS_10MHZ },
{ .bitrate = 120,
.hw_value = ATH5K_RATE_CODE_12M,
- .flags = 0 },
+ .flags = IEEE80211_RATE_SUPPORTS_5MHZ |
+ IEEE80211_RATE_SUPPORTS_10MHZ },
{ .bitrate = 180,
.hw_value = ATH5K_RATE_CODE_18M,
- .flags = 0 },
+ .flags = IEEE80211_RATE_SUPPORTS_5MHZ |
+ IEEE80211_RATE_SUPPORTS_10MHZ },
{ .bitrate = 240,
.hw_value = ATH5K_RATE_CODE_24M,
- .flags = 0 },
+ .flags = IEEE80211_RATE_SUPPORTS_5MHZ |
+ IEEE80211_RATE_SUPPORTS_10MHZ },
{ .bitrate = 360,
.hw_value = ATH5K_RATE_CODE_36M,
- .flags = 0 },
+ .flags = IEEE80211_RATE_SUPPORTS_5MHZ |
+ IEEE80211_RATE_SUPPORTS_10MHZ },
{ .bitrate = 480,
.hw_value = ATH5K_RATE_CODE_48M,
- .flags = 0 },
+ .flags = IEEE80211_RATE_SUPPORTS_5MHZ |
+ IEEE80211_RATE_SUPPORTS_10MHZ },
{ .bitrate = 540,
.hw_value = ATH5K_RATE_CODE_54M,
- .flags = 0 },
+ .flags = IEEE80211_RATE_SUPPORTS_5MHZ |
+ IEEE80211_RATE_SUPPORTS_10MHZ },
};
static inline u64 ath5k_extend_tsf(struct ath5k_hw *ah, u32 rstamp)
diff --git a/drivers/net/wireless/ath/ath5k/pcu.c b/drivers/net/wireless/ath/ath5k/pcu.c
index 1f16b42..c60d36a 100644
--- a/drivers/net/wireless/ath/ath5k/pcu.c
+++ b/drivers/net/wireless/ath/ath5k/pcu.c
@@ -144,11 +144,13 @@ ath5k_hw_get_frame_duration(struct ath5k_hw *ah, enum ieee80211_band band,
sifs = AR5K_INIT_SIFS_HALF_RATE;
preamble *= 2;
sym_time *= 2;
+ bitrate = DIV_ROUND_UP(bitrate, 2);
break;
case AR5K_BWMODE_5MHZ:
sifs = AR5K_INIT_SIFS_QUARTER_RATE;
preamble *= 4;
sym_time *= 4;
+ bitrate = DIV_ROUND_UP(bitrate, 4);
break;
default:
sifs = AR5K_INIT_SIFS_DEFAULT_BG;
diff --git a/drivers/net/wireless/ath/ath5k/qcu.c b/drivers/net/wireless/ath/ath5k/qcu.c
index 65fe929..0583c69 100644
--- a/drivers/net/wireless/ath/ath5k/qcu.c
+++ b/drivers/net/wireless/ath/ath5k/qcu.c
@@ -566,9 +566,11 @@ int ath5k_hw_set_ifs_intervals(struct ath5k_hw *ah, unsigned int slot_time)
{
struct ieee80211_channel *channel = ah->ah_current_channel;
enum ieee80211_band band;
+ struct ieee80211_supported_band *sband;
struct ieee80211_rate *rate;
u32 ack_tx_time, eifs, eifs_clock, sifs, sifs_clock;
u32 slot_time_clock = ath5k_hw_htoclock(ah, slot_time);
+ u32 rate_flags, i;
if (slot_time < 6 || slot_time_clock > AR5K_SLOT_TIME_MAX)
return -EINVAL;
@@ -605,7 +607,28 @@ int ath5k_hw_set_ifs_intervals(struct ath5k_hw *ah, unsigned int slot_time)
else
band = IEEE80211_BAND_2GHZ;
- rate = &ah->sbands[band].bitrates[0];
+ switch (ah->ah_bwmode) {
+ case AR5K_BWMODE_5MHZ:
+ rate_flags = IEEE80211_RATE_SUPPORTS_5MHZ;
+ break;
+ case AR5K_BWMODE_10MHZ:
+ rate_flags = IEEE80211_RATE_SUPPORTS_10MHZ;
+ break;
+ default:
+ rate_flags = 0;
+ break;
+ }
+ sband = &ah->sbands[band];
+ rate = NULL;
+ for (i = 0; i < sband->n_bitrates; i++) {
+ if ((rate_flags & sband->bitrates[i].flags) != rate_flags)
+ continue;
+ rate = &sband->bitrates[i];
+ break;
+ }
+ if (WARN_ON(!rate))
+ return -EINVAL;
+
ack_tx_time = ath5k_hw_get_frame_duration(ah, band, 10, rate, false);
/* ack_tx_time includes an SIFS already */
--
1.7.10.4
^ permalink raw reply related
* [PATCHv6 10/18] nl80211: allow 5 and 10 MHz channels for IBSS
From: Simon Wunderlich @ 2013-07-08 14:55 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, Mathias Kretschmer, Simon Wunderlich
In-Reply-To: <1373295366-12823-1-git-send-email-siwu@hrz.tu-chemnitz.de>
Whether the wiphy supports it or not is already checked, so what is left
is to enable these channel types.
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
---
net/wireless/nl80211.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 3019748..1318b5a 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -6318,6 +6318,8 @@ static int nl80211_join_ibss(struct sk_buff *skb, struct genl_info *info)
return -EINVAL;
switch (ibss.chandef.width) {
+ case NL80211_CHAN_WIDTH_5:
+ case NL80211_CHAN_WIDTH_10:
case NL80211_CHAN_WIDTH_20_NOHT:
break;
case NL80211_CHAN_WIDTH_20:
--
1.7.10.4
^ permalink raw reply related
* [PATCHv6 06/18] cfg80211/mac80211: get mandatory rates based on scan width
From: Simon Wunderlich @ 2013-07-08 14:55 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, Mathias Kretschmer, Simon Wunderlich
In-Reply-To: <1373295366-12823-1-git-send-email-siwu@hrz.tu-chemnitz.de>
Mandatory rates for 5 and 10 MHz are different from the rates used for
20 MHz in 2.4 GHz mode, as they use OFDM only.
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
---
Changes to PATCHv4:
* it is now based on scan_width instead of rate flags
---
include/net/cfg80211.h | 4 +++-
net/mac80211/ibss.c | 19 +++++++++++++++----
net/wireless/mesh.c | 5 ++++-
net/wireless/util.c | 14 ++++++++++----
4 files changed, 32 insertions(+), 10 deletions(-)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 1df4060..4ca16ab 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -3069,11 +3069,13 @@ ieee80211_get_response_rate(struct ieee80211_supported_band *sband,
/**
* ieee80211_mandatory_rates - get mandatory rates for a given band
* @sband: the band to look for rates in
+ * @scan_width: width of the control channel
*
* This function returns a bitmap of the mandatory rates for the given
* band, bits are set according to the rate position in the bitrates array.
*/
-u32 ieee80211_mandatory_rates(struct ieee80211_supported_band *sband);
+u32 ieee80211_mandatory_rates(struct ieee80211_supported_band *sband,
+ enum nl80211_bss_scan_width scan_width);
/*
* Radiotap parsing functions -- for controlled injection support
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index e9ec3e6..7fb0f2a 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -367,6 +367,7 @@ ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata, const u8 *bssid,
struct sta_info *sta;
struct ieee80211_chanctx_conf *chanctx_conf;
struct ieee80211_supported_band *sband;
+ enum nl80211_bss_scan_width scan_width;
int band;
/*
@@ -395,6 +396,7 @@ ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata, const u8 *bssid,
if (WARN_ON_ONCE(!chanctx_conf))
return NULL;
band = chanctx_conf->def.chan->band;
+ scan_width = cfg80211_chandef_to_scan_width(&chanctx_conf->def);
rcu_read_unlock();
sta = sta_info_alloc(sdata, addr, GFP_KERNEL);
@@ -408,7 +410,7 @@ ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata, const u8 *bssid,
/* make sure mandatory rates are always added */
sband = local->hw.wiphy->bands[band];
sta->sta.supp_rates[band] = supp_rates |
- ieee80211_mandatory_rates(sband);
+ ieee80211_mandatory_rates(sband, scan_width);
return ieee80211_ibss_finish_sta(sta);
}
@@ -472,6 +474,7 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
u64 beacon_timestamp, rx_timestamp;
u32 supp_rates = 0;
enum ieee80211_band band = rx_status->band;
+ enum nl80211_bss_scan_width scan_width;
struct ieee80211_supported_band *sband = local->hw.wiphy->bands[band];
bool rates_updated = false;
@@ -500,9 +503,15 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
prev_rates = sta->sta.supp_rates[band];
/* make sure mandatory rates are always added */
+ scan_width = NL80211_BSS_CHAN_WIDTH_20;
+ if (rx_status->flag & RX_FLAG_5MHZ)
+ scan_width = NL80211_BSS_CHAN_WIDTH_5;
+ if (rx_status->flag & RX_FLAG_10MHZ)
+ scan_width = NL80211_BSS_CHAN_WIDTH_10;
+
sta->sta.supp_rates[band] = supp_rates |
- ieee80211_mandatory_rates(sband);
-
+ ieee80211_mandatory_rates(sband,
+ scan_width);
if (sta->sta.supp_rates[band] != prev_rates) {
ibss_dbg(sdata,
"updated supp_rates set for %pM based on beacon/probe_resp (0x%x -> 0x%x)\n",
@@ -636,6 +645,7 @@ void ieee80211_ibss_rx_no_sta(struct ieee80211_sub_if_data *sdata,
struct sta_info *sta;
struct ieee80211_chanctx_conf *chanctx_conf;
struct ieee80211_supported_band *sband;
+ enum nl80211_bss_scan_width scan_width;
int band;
/*
@@ -661,6 +671,7 @@ void ieee80211_ibss_rx_no_sta(struct ieee80211_sub_if_data *sdata,
return;
}
band = chanctx_conf->def.chan->band;
+ scan_width = cfg80211_chandef_to_scan_width(&chanctx_conf->def);
rcu_read_unlock();
sta = sta_info_alloc(sdata, addr, GFP_ATOMIC);
@@ -672,7 +683,7 @@ void ieee80211_ibss_rx_no_sta(struct ieee80211_sub_if_data *sdata,
/* make sure mandatory rates are always added */
sband = local->hw.wiphy->bands[band];
sta->sta.supp_rates[band] = supp_rates |
- ieee80211_mandatory_rates(sband);
+ ieee80211_mandatory_rates(sband, scan_width);
spin_lock(&ifibss->incomplete_lock);
list_add(&sta->list, &ifibss->incomplete_stations);
diff --git a/net/wireless/mesh.c b/net/wireless/mesh.c
index 30c4920..0553fd4 100644
--- a/net/wireless/mesh.c
+++ b/net/wireless/mesh.c
@@ -167,9 +167,12 @@ int __cfg80211_join_mesh(struct cfg80211_registered_device *rdev,
* basic rates
*/
if (!setup->basic_rates) {
+ enum nl80211_bss_scan_width scan_width;
struct ieee80211_supported_band *sband =
rdev->wiphy.bands[setup->chandef.chan->band];
- setup->basic_rates = ieee80211_mandatory_rates(sband);
+ scan_width = cfg80211_chandef_to_scan_width(&setup->chandef);
+ setup->basic_rates = ieee80211_mandatory_rates(sband,
+ scan_width);
}
if (!cfg80211_reg_can_beacon(&rdev->wiphy, &setup->chandef))
diff --git a/net/wireless/util.c b/net/wireless/util.c
index 74458b7..ce090c1 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -33,7 +33,8 @@ ieee80211_get_response_rate(struct ieee80211_supported_band *sband,
}
EXPORT_SYMBOL(ieee80211_get_response_rate);
-u32 ieee80211_mandatory_rates(struct ieee80211_supported_band *sband)
+u32 ieee80211_mandatory_rates(struct ieee80211_supported_band *sband,
+ enum nl80211_bss_scan_width scan_width)
{
struct ieee80211_rate *bitrates;
u32 mandatory_rates = 0;
@@ -43,10 +44,15 @@ u32 ieee80211_mandatory_rates(struct ieee80211_supported_band *sband)
if (WARN_ON(!sband))
return 1;
- if (sband->band == IEEE80211_BAND_2GHZ)
- mandatory_flag = IEEE80211_RATE_MANDATORY_B;
- else
+ if (sband->band == IEEE80211_BAND_2GHZ) {
+ if (scan_width == NL80211_BSS_CHAN_WIDTH_5 ||
+ scan_width == NL80211_BSS_CHAN_WIDTH_10)
+ mandatory_flag = IEEE80211_RATE_MANDATORY_G;
+ else
+ mandatory_flag = IEEE80211_RATE_MANDATORY_B;
+ } else {
mandatory_flag = IEEE80211_RATE_MANDATORY_A;
+ }
bitrates = sband->bitrates;
for (i = 0; i < sband->n_bitrates; i++)
--
1.7.10.4
^ permalink raw reply related
* [PATCHv6 16/18] ath5k: report 5/10 MHz channels
From: Simon Wunderlich @ 2013-07-08 14:56 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, Mathias Kretschmer, Simon Wunderlich
In-Reply-To: <1373295366-12823-1-git-send-email-siwu@hrz.tu-chemnitz.de>
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
---
drivers/net/wireless/ath/ath5k/base.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index ce67ab7..260a6fc 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -1400,6 +1400,16 @@ ath5k_receive_frame(struct ath5k_hw *ah, struct sk_buff *skb,
rxs->rate_idx = ath5k_hw_to_driver_rix(ah, rs->rs_rate);
rxs->flag |= ath5k_rx_decrypted(ah, skb, rs);
+ switch (ah->ah_bwmode) {
+ case AR5K_BWMODE_5MHZ:
+ rxs->flag |= RX_FLAG_5MHZ;
+ break;
+ case AR5K_BWMODE_10MHZ:
+ rxs->flag |= RX_FLAG_10MHZ;
+ break;
+ default:
+ break;
+ }
if (rxs->rate_idx >= 0 && rs->rs_rate ==
ah->sbands[ah->curchan->band].bitrates[rxs->rate_idx].hw_value_short)
--
1.7.10.4
^ permalink raw reply related
* [PATCHv6 09/18] mac80211: return if IBSS chandef can not be used
From: Simon Wunderlich @ 2013-07-08 14:55 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, Mathias Kretschmer, Simon Wunderlich
In-Reply-To: <1373295366-12823-1-git-send-email-siwu@hrz.tu-chemnitz.de>
This was originally designed to fail when a 40+/40- mode can not be
used, but basic modes (such as 5/10/20 MHz) must be handled
with an error.
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
---
net/mac80211/ibss.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index b99d948..7941e8d 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -85,6 +85,14 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
chandef = ifibss->chandef;
if (!cfg80211_reg_can_beacon(local->hw.wiphy, &chandef)) {
+ if (chandef.width == NL80211_CHAN_WIDTH_5 ||
+ chandef.width == NL80211_CHAN_WIDTH_10 ||
+ chandef.width == NL80211_CHAN_WIDTH_20_NOHT ||
+ chandef.width == NL80211_CHAN_WIDTH_20) {
+ sdata_info(sdata,
+ "Failed to join IBSS, beacons forbidden\n");
+ return;
+ }
chandef.width = NL80211_CHAN_WIDTH_20;
chandef.center_freq1 = chan->center_freq;
}
--
1.7.10.4
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox