Linux wireless drivers development
 help / color / mirror / Atom feed
* Re: Switching band of a dual-band WiFi device
From: Simon Farnsworth @ 2013-08-15  9:03 UTC (permalink / raw)
  To: Christian Gagneraud; +Cc: linux-wireless
In-Reply-To: <520C631F.6010806@gna.org>

[-- Attachment #1: Type: text/plain, Size: 2136 bytes --]

On Thursday 15 August 2013 17:11:59 Christian Gagneraud wrote:
> Hi there,
> 
> I am using a TP-Link TL-WDN3200 on a ubuntu 13.04 (kernel 
> 3.8.0-27-generic), and I have install relevant modules with 
> backports-3.11-rc3-1.
> 
> I would like to switch my WiFi stick to 5GHz, I tried iwconfig wlan0 
> freq 5G, but I get ENOTSUPP.
> Is the freq settings suppose to handle this 2.4 vs 5GHz band or is it 
> only for selecting channel frequency within a given band?
> 
> Does linux-wireless provides a way for selecting 2.4 or 5GHz band?

Linux should automatically select the right frequency band, depending on
the frequencies in use by the device you're trying to communicate with.
Connect to an AP in the 5GHz band, and Linux should just use 5GHz
automatically.
> 
> "iw phy phy11 info" tells me that in band 2, all the frequencies are 
> disabled except:
>                          * 5745 MHz [149] (30.0 dBm)
>                          * 5755 MHz [151] (30.0 dBm)
>                          * 5765 MHz [153] (30.0 dBm)
>                          * 5775 MHz [155] (30.0 dBm)
>                          * 5785 MHz [157] (30.0 dBm)
>                          * 5795 MHz [159] (30.0 dBm)
>                          * 5805 MHz [161] (30.0 dBm)
>                          * 5825 MHz [165] (30.0 dBm)
> 
That's showing you that, with Linux's understanding of the RF regulations in
your area, it can only transmit on certain frequencies.

> As well, my understanding of WiFi might be a bit limited but, does a 
> dual-band WiFi device provides 2.4 and 5GHz services at the same time or 
> do I need to select one or the other myself? Or maybe I can just 
> enable/disable them manually (and separately)?
> 
A dual-band WiFi device can only transmit and receive on one channel at a
time. The advantage of dual-band is that it can transmit and receive on either
the 5GHz band (which is less crowded), or the 2.4GHz band (which is more
commonly used). There's no need to select the band manually - it will just
use 5GHz when the other device (e.g. the AP) is using 5GHz.
-- 
Simon Farnsworth
Software Engineer
ONELAN Ltd
http://www.onelan.com

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply

* [PATCH v14 0/2] P2P find phase offload
From: Vladimir Kondratiev @ 2013-08-15 11:51 UTC (permalink / raw)
  To: Johannes Berg
  Cc: Vladimir Kondratiev, linux-wireless, Luis R . Rodriguez,
	John W . Linville, Jouni Malinen

Addressed input collected:

- remove NL80211_FEATURE_P2P_PROBE_RESP_OFFLOAD feature flag because
  NL80211_RXMGMT_FLAG_REPLIED flag in cfg80211_rx_mgmt() provide needed
  info on per-frame basis
- validate min/max discoverable interval parameters
- use kcalloc to allocate array

Vladimir Kondratiev (2):
  cfg80211: add 'flags' to cfg80211_rx_mgmt()
  cfg80211: P2P find phase offload

 drivers/net/wireless/ath/ath6kl/wmi.c         |   7 +-
 drivers/net/wireless/ath/wil6210/wmi.c        |   2 +-
 drivers/net/wireless/brcm80211/brcmfmac/p2p.c |   4 +-
 drivers/net/wireless/mwifiex/util.c           |   4 +-
 include/net/cfg80211.h                        |  79 +++++++++-
 include/uapi/linux/nl80211.h                  |  27 ++++
 net/mac80211/rx.c                             |   3 +-
 net/wireless/mlme.c                           |   4 +-
 net/wireless/nl80211.c                        | 216 +++++++++++++++++++++++++-
 net/wireless/nl80211.h                        |   2 +-
 net/wireless/rdev-ops.h                       |  19 +++
 net/wireless/trace.h                          |  44 ++++++
 12 files changed, 394 insertions(+), 17 deletions(-)

-- 
1.8.1.2


^ permalink raw reply

* [PATCH v14 2/2] cfg80211: P2P find phase offload
From: Vladimir Kondratiev @ 2013-08-15 11:51 UTC (permalink / raw)
  To: Johannes Berg
  Cc: Vladimir Kondratiev, linux-wireless, Luis R . Rodriguez,
	John W . Linville, Jouni Malinen
In-Reply-To: <1376567489-1863-1-git-send-email-qca_vkondrat@qca.qualcomm.com>

Allow to implement P2P find phase in the driver/firmware.

Offload scheme designed as follows:

- Driver provide methods start_p2p_find and stop_p2p_find in the cfg80211_ops;
- wpa_supplicant analyses methods supported to discover p2p offload support;
to perform p2p scan, wpa_supplicant:
- perform legacy scan, through driver's cfg80211_ops 'scan' method
- configure rx management filter to get probe-request and probe-response frames
- start p2p find via driver's cfg80211_ops start_p2p_find method
- driver start p2p find with hardware and notify wpa_supplicant with
  cfg80211_p2p_find_notify_start()
- driver/firmware toggle search/listen states. Received probe-request and
  probe-response frames passed to the wpa_supplicant via cfg80211_rx_mgmt;
  replied by driver/firmware probe-request frames indicated with
  NL80211_RXMGMT_FLAG_REPLIED flag
- when wpa_supplicant wants to stop p2p find, it calls driver's
  cfg80211_ops stop_p2p_find method. Alternatively, driver/firmware may decide
  to stop p2p find. In all cases, driver notifies wpa_supplicant using
  cfg80211_p2p_find_notify_end()

All driver to user space communication done through nl80211 layer.

Offloaded P2P find does not support variations like progressive scan.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
---
 include/net/cfg80211.h       |  76 ++++++++++++++++
 include/uapi/linux/nl80211.h |  10 +++
 net/wireless/nl80211.c       | 210 +++++++++++++++++++++++++++++++++++++++++++
 net/wireless/rdev-ops.h      |  19 ++++
 net/wireless/trace.h         |  44 +++++++++
 5 files changed, 359 insertions(+)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index e1ee9d3..c831f8b 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1924,6 +1924,36 @@ struct cfg80211_update_ft_ies_params {
 };
 
 /**
+ * struct cfg80211_p2p_find_params - parameters for P2P find
+ * @probe_ie: extra IE's for probe frames
+ * @probe_ie_len: length, bytes, of @probe_ie
+ * @probe_resp_ie: extra IE's for probe response frames
+ * @probe_resp_ie_len: length, bytes, of @probe_resp_ie
+ *	Driver/firmware may add additional IE's as well as modify
+ *	provided ones; typical IE's to be added are
+ *	WLAN_EID_EXT_SUPP_RATES, WLAN_EID_DS_PARAMS,
+ *	WLAN_EID_HT_CAPABILITY.
+ * @min_discoverable_interval: and
+ * @max_discoverable_interval: min/max for random multiplier of 100TU's
+ *	for the listen state duration
+ * @listen_channel: channel to listen on; not NULL
+ * @n_channels: number of channels to operate on
+ * @channels: channels to operate on; non-empty list
+ */
+struct cfg80211_p2p_find_params {
+	const u8 *probe_ie;
+	size_t probe_ie_len;
+	const u8 *probe_resp_ie;
+	size_t probe_resp_ie_len;
+	u32 min_discoverable_interval;
+	u32 max_discoverable_interval;
+	struct ieee80211_channel *listen_channel;
+
+	int n_channels;
+	struct ieee80211_channel **channels;
+};
+
+/**
  * struct cfg80211_ops - backend description for wireless configuration
  *
  * This struct is registered by fullmac card drivers and/or wireless stacks
@@ -2165,6 +2195,24 @@ struct cfg80211_update_ft_ies_params {
  * @set_coalesce: Set coalesce parameters.
  *
  * @channel_switch: initiate channel-switch procedure (with CSA)
+ *
+ * @start_p2p_find: start P2P find phase
+ *	Parameters include IEs for probe/probe-resp frames;
+ *	and channels to operate on.
+ *	Parameters are not retained after call, driver need to copy data if
+ *	it need it later.
+ *	P2P find can't run concurrently with ROC or scan,
+ *	conflict with scan detected by cfg80211 and -EBUSY returned;
+ *	and driver should check for ROC and return -EBUSY to indicate conflict.
+ *	While performing P2P discovery, driver should report received
+ *	probe-request and probe-response frames via cfg80211_rx_mgmt
+ *	accordingly to the rx mgmt filter, as set by mgmt_frame_register().
+ *	If device indicates NL80211_FEATURE_P2P_PROBE_RESP_OFFLOAD, it may
+ *	reply some matching probes and replied probes may be not reported to
+ *	the upper layers; otherwise it must not reply any probe.
+ * @stop_p2p_find: stop P2P find phase
+ *	After stopping p2p find, driver should call
+ *	cfg80211_p2p_find_notify_end() to inform upper layers
  */
 struct cfg80211_ops {
 	int	(*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
@@ -2406,6 +2454,12 @@ struct cfg80211_ops {
 	int	(*channel_switch)(struct wiphy *wiphy,
 				  struct net_device *dev,
 				  struct cfg80211_csa_settings *params);
+
+	int	(*start_p2p_find)(struct wiphy *wiphy,
+				  struct wireless_dev *wdev,
+				  struct cfg80211_p2p_find_params *params);
+	void	(*stop_p2p_find)(struct wiphy *wiphy,
+				 struct wireless_dev *wdev);
 };
 
 /*
@@ -3062,6 +3116,7 @@ struct wireless_dev {
 	struct mutex mtx;
 
 	bool use_4addr, p2p_started;
+	bool p2p_find_active; /* protected by rtnl */
 
 	u8 address[ETH_ALEN] __aligned(sizeof(u16));
 
@@ -4376,6 +4431,27 @@ void cfg80211_report_wowlan_wakeup(struct wireless_dev *wdev,
  */
 void cfg80211_crit_proto_stopped(struct wireless_dev *wdev, gfp_t gfp);
 
+/**
+ * cfg80211_p2p_find_notify_start - report p2p find phase started
+ * @wdev: the wireless device reporting the event
+ * @gfp: allocation flags
+ */
+void cfg80211_p2p_find_notify_start(struct wireless_dev *wdev, gfp_t gfp);
+
+/**
+ * cfg80211_p2p_find_notify_end - report p2p find phase ended
+ * @wdev: the wireless device reporting the event
+ * @gfp: allocation flags
+ *
+ * p2p find phase may be ended either unsolicited or in response to
+ * ops->stop_p2p_find. If called out of context of ops->stop_p2p_find,
+ * should be protected with rtnl_lock()
+ *
+ * In any case, if @start_p2p_find from driver's struct cfg80211_ops called,
+ * @cfg80211_p2p_find_notify_end should be eventually called
+ */
+void cfg80211_p2p_find_notify_end(struct wireless_dev *wdev, gfp_t gfp);
+
 /* Logging, debugging and troubleshooting/diagnostic helpers. */
 
 /* wiphy_printk helpers, similar to dev_printk */
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index fc1665e..5a00bd61 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -853,6 +853,9 @@ enum nl80211_commands {
 
 	NL80211_CMD_CHANNEL_SWITCH,
 
+	NL80211_CMD_START_P2P_FIND,
+	NL80211_CMD_STOP_P2P_FIND,
+
 	/* add new commands above here */
 
 	/* used to define NL80211_CMD_MAX below */
@@ -1497,6 +1500,10 @@ enum nl80211_commands {
  *	As specified in the enum nl80211_rxmgmt_flags.
  *	Passed from cfg80211_rx_mgmt()
  *
+ * @NL80211_ATTR_MIN_DISCOVERABLE_INTERVAL:
+ * @NL80211_ATTR_MAX_DISCOVERABLE_INTERVAL: min/max discoverable interval
+ *	for the p2p find, multiple of 100 TUs, represented as u32
+ *
  * @NL80211_ATTR_MAX: highest attribute number currently defined
  * @__NL80211_ATTR_AFTER_LAST: internal use
  */
@@ -1807,6 +1814,9 @@ enum nl80211_attrs {
 
 	NL80211_ATTR_RXMGMT_FLAGS,
 
+	NL80211_ATTR_MIN_DISCOVERABLE_INTERVAL,
+	NL80211_ATTR_MAX_DISCOVERABLE_INTERVAL,
+
 	/* add attributes here, update the policy in nl80211.c */
 
 	__NL80211_ATTR_AFTER_LAST,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 8dbb289..d2a85f1 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -354,6 +354,8 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = {
 	[NL80211_ATTR_CSA_IES] = { .type = NLA_NESTED },
 	[NL80211_ATTR_CSA_C_OFF_BEACON] = { .type = NLA_U16 },
 	[NL80211_ATTR_CSA_C_OFF_PRESP] = { .type = NLA_U16 },
+	[NL80211_ATTR_MIN_DISCOVERABLE_INTERVAL] = { .type = NLA_U32 },
+	[NL80211_ATTR_MAX_DISCOVERABLE_INTERVAL] = { .type = NLA_U32 },
 };
 
 /* policy for the key attributes */
@@ -1431,6 +1433,8 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *dev,
 			CMD(crit_proto_stop, CRIT_PROTOCOL_STOP);
 			if (dev->wiphy.flags & WIPHY_FLAG_HAS_CHANNEL_SWITCH)
 				CMD(channel_switch, CHANNEL_SWITCH);
+			CMD(start_p2p_find, START_P2P_FIND);
+			CMD(stop_p2p_find, STOP_P2P_FIND);
 		}
 
 #ifdef CONFIG_NL80211_TESTMODE
@@ -8762,6 +8766,157 @@ static int nl80211_crit_protocol_stop(struct sk_buff *skb,
 	return 0;
 }
 
+static int p2p_find_handle_channel(struct wiphy *wiphy,
+				    struct cfg80211_p2p_find_params *params,
+				    u32 freq)
+{
+	struct ieee80211_channel *chan = ieee80211_get_channel(wiphy, freq);
+
+	if (!chan)
+		return -EINVAL;
+
+	/* ignore disabled channels */
+	if (chan->flags & IEEE80211_CHAN_DISABLED)
+		return 0;
+
+	params->channels[params->n_channels++] = chan;
+	return 0;
+}
+
+static int nl80211_start_p2p_find(struct sk_buff *skb, struct genl_info *info)
+{
+	struct cfg80211_registered_device *rdev = info->user_ptr[0];
+	struct wireless_dev *wdev = info->user_ptr[1];
+	struct wiphy *wiphy = &rdev->wiphy;
+	/*
+	 * Defaults, as defined in the spec
+	 * Ref: Wi-Fi Peer-to-Peer (P2P) Technical Specification v1.1
+	 * Clause: 3.1.2.1.3 Find Phase
+	 */
+	struct cfg80211_p2p_find_params params = {
+		.min_discoverable_interval = 1,
+		.max_discoverable_interval = 3,
+	};
+	/* P2P spec defines social channels 1,6,11 @2.4GHz and 2 @60GHz */
+	static u32 social_freqs[] = {2412, 2437, 2462, 60480};
+	struct nlattr *attr_freq = info->attrs[NL80211_ATTR_SCAN_FREQUENCIES];
+	struct nlattr *attr_l_freq = info->attrs[NL80211_ATTR_WIPHY_FREQ];
+	struct nlattr *attr;
+	int err, tmp, n_channels;
+	struct ieee80211_channel *chan;
+
+	if (wdev->iftype != NL80211_IFTYPE_P2P_DEVICE)
+		return -EOPNOTSUPP;
+
+	if (!rdev->ops->start_p2p_find || !rdev->ops->stop_p2p_find)
+		return -EOPNOTSUPP;
+
+	if (!attr_l_freq)
+		return -EINVAL;
+
+	if (!is_valid_ie_attr(info->attrs[NL80211_ATTR_IE]))
+		return -EINVAL;
+
+	if (!is_valid_ie_attr(info->attrs[NL80211_ATTR_IE_PROBE_RESP]))
+		return -EINVAL;
+
+	if (rdev->scan_req)
+		return -EBUSY;
+
+	if (wdev->p2p_find_active)
+		return -EBUSY;
+
+	chan = ieee80211_get_channel(wiphy, nla_get_u32(attr_l_freq));
+	if (!chan || (chan->flags & IEEE80211_CHAN_DISABLED))
+		return -EINVAL;
+	params.listen_channel = chan;
+
+	attr = info->attrs[NL80211_ATTR_MIN_DISCOVERABLE_INTERVAL];
+	if (attr)
+		params.min_discoverable_interval = nla_get_u32(attr);
+
+	attr = info->attrs[NL80211_ATTR_MAX_DISCOVERABLE_INTERVAL];
+	if (attr)
+		params.max_discoverable_interval = nla_get_u32(attr);
+
+	if (params.min_discoverable_interval >
+	    params.max_discoverable_interval)
+		return -EINVAL;
+
+	if (attr_freq) {
+		n_channels = validate_scan_freqs(attr_freq);
+		if (!n_channels)
+			return -EINVAL;
+	} else {
+		n_channels = ARRAY_SIZE(social_freqs);
+	}
+	params.channels = kcalloc(n_channels, sizeof(*params.channels),
+				  GFP_KERNEL);
+	if (!params.channels)
+		return -ENOMEM;
+
+	if (attr_freq) {
+		/* user specified, bail out if channel not found */
+		nla_for_each_nested(attr, attr_freq, tmp) {
+			err = p2p_find_handle_channel(wiphy, &params,
+						      nla_get_u32(attr));
+			if (err)
+				goto out_free;
+		}
+	} else { /* all supported social channels */
+		/* ignore errors for non-existing channels */
+		for (tmp = 0; tmp < ARRAY_SIZE(social_freqs); tmp++) {
+			p2p_find_handle_channel(wiphy, &params,
+						social_freqs[tmp]);
+		}
+	}
+	if (!params.n_channels) {
+		err = -EINVAL;
+		goto out_free;
+	}
+
+	attr = info->attrs[NL80211_ATTR_IE];
+	if (attr) {
+		params.probe_ie_len = nla_len(attr);
+		params.probe_ie = nla_data(attr);
+	}
+
+	attr = info->attrs[NL80211_ATTR_IE_PROBE_RESP];
+	if (attr) {
+		params.probe_resp_ie_len = nla_len(attr);
+		params.probe_resp_ie = nla_data(attr);
+	}
+
+	wdev->p2p_find_active = true;
+	err = rdev_start_p2p_find(rdev, wdev, &params);
+	if (err)
+		wdev->p2p_find_active = false;
+
+out_free:
+	kfree(params.channels);
+
+	return err;
+}
+
+static int nl80211_stop_p2p_find(struct sk_buff *skb, struct genl_info *info)
+{
+	struct cfg80211_registered_device *rdev = info->user_ptr[0];
+	struct wireless_dev *wdev = info->user_ptr[1];
+
+	if (wdev->iftype != NL80211_IFTYPE_P2P_DEVICE)
+		return -EOPNOTSUPP;
+
+	if (!rdev->ops->start_p2p_find || !rdev->ops->stop_p2p_find)
+		return -EOPNOTSUPP;
+
+	if (!wdev->p2p_find_active)
+		return -ENOENT;
+
+	rdev_stop_p2p_find(rdev, wdev);
+
+	return 0;
+}
+
 #define NL80211_FLAG_NEED_WIPHY		0x01
 #define NL80211_FLAG_NEED_NETDEV	0x02
 #define NL80211_FLAG_NEED_RTNL		0x04
@@ -9435,6 +9590,22 @@ static struct genl_ops nl80211_ops[] = {
 				  NL80211_FLAG_NEED_RTNL,
 	},
 	{
+		.cmd = NL80211_CMD_START_P2P_FIND,
+		.doit = nl80211_start_p2p_find,
+		.policy = nl80211_policy,
+		.flags = GENL_ADMIN_PERM,
+		.internal_flags = NL80211_FLAG_NEED_WDEV_UP |
+				  NL80211_FLAG_NEED_RTNL,
+	},
+	{
+		.cmd = NL80211_CMD_STOP_P2P_FIND,
+		.doit = nl80211_stop_p2p_find,
+		.policy = nl80211_policy,
+		.flags = GENL_ADMIN_PERM,
+		.internal_flags = NL80211_FLAG_NEED_WDEV_UP |
+				  NL80211_FLAG_NEED_RTNL,
+	},
+	{
 		.cmd = NL80211_CMD_GET_PROTOCOL_FEATURES,
 		.doit = nl80211_get_protocol_features,
 		.policy = nl80211_policy,
@@ -11126,6 +11297,45 @@ void cfg80211_tdls_oper_request(struct net_device *dev, const u8 *peer,
 }
 EXPORT_SYMBOL(cfg80211_tdls_oper_request);
 
+static
+void cfg80211_p2p_find_notify(struct wireless_dev *wdev, int cmd, gfp_t gfp)
+{
+	struct wiphy *wiphy = wdev->wiphy;
+	struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
+	struct sk_buff *msg;
+	void *hdr;
+
+	trace_cfg80211_p2p_find_notify(wdev, cmd);
+	msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
+	if (!msg)
+		return;
+
+	hdr = nl80211hdr_put(msg, 0, 0, 0, cmd);
+	if (!hdr) {
+		nlmsg_free(msg);
+		return;
+	}
+
+	genlmsg_end(msg, hdr);
+
+	genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
+				nl80211_scan_mcgrp.id, GFP_KERNEL);
+}
+
+void cfg80211_p2p_find_notify_start(struct wireless_dev *wdev, gfp_t gfp)
+{
+	cfg80211_p2p_find_notify(wdev, NL80211_CMD_START_P2P_FIND, gfp);
+}
+EXPORT_SYMBOL(cfg80211_p2p_find_notify_start);
+
+void cfg80211_p2p_find_notify_end(struct wireless_dev *wdev, gfp_t gfp)
+{
+	ASSERT_RTNL();
+	cfg80211_p2p_find_notify(wdev, NL80211_CMD_STOP_P2P_FIND, gfp);
+	wdev->p2p_find_active = false;
+}
+EXPORT_SYMBOL(cfg80211_p2p_find_notify_end);
+
 static int nl80211_netlink_notify(struct notifier_block * nb,
 				  unsigned long state,
 				  void *_notify)
diff --git a/net/wireless/rdev-ops.h b/net/wireless/rdev-ops.h
index de870d4..6c3f463 100644
--- a/net/wireless/rdev-ops.h
+++ b/net/wireless/rdev-ops.h
@@ -935,4 +935,23 @@ static inline int rdev_channel_switch(struct cfg80211_registered_device *rdev,
 	return ret;
 }
 
+static inline int rdev_start_p2p_find(struct cfg80211_registered_device *rdev,
+				      struct wireless_dev *wdev,
+				      struct cfg80211_p2p_find_params *params)
+{
+	int ret;
+	trace_rdev_start_p2p_find(&rdev->wiphy, wdev, params);
+	ret = rdev->ops->start_p2p_find(&rdev->wiphy, wdev, params);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
+}
+
+static inline void rdev_stop_p2p_find(struct cfg80211_registered_device *rdev,
+				      struct wireless_dev *wdev)
+{
+	trace_rdev_stop_p2p_find(&rdev->wiphy, wdev);
+	rdev->ops->stop_p2p_find(&rdev->wiphy, wdev);
+	trace_rdev_return_void(&rdev->wiphy);
+}
+
 #endif /* __CFG80211_RDEV_OPS */
diff --git a/net/wireless/trace.h b/net/wireless/trace.h
index f0ebdcd..ec5b0cd 100644
--- a/net/wireless/trace.h
+++ b/net/wireless/trace.h
@@ -1874,6 +1874,36 @@ TRACE_EVENT(rdev_channel_switch,
 		  __entry->counter_offset_presp)
 );
 
+TRACE_EVENT(rdev_start_p2p_find,
+	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
+		 struct cfg80211_p2p_find_params *params),
+	TP_ARGS(wiphy, wdev, params),
+	TP_STRUCT__entry(
+		WIPHY_ENTRY
+		WDEV_ENTRY
+		__field(u32, min_di)
+		__field(u32, max_di)
+		__field(u32, listen_freq)
+		__field(int, n_channels)
+	),
+	TP_fast_assign(
+		WIPHY_ASSIGN;
+		WDEV_ASSIGN;
+		__entry->min_di = params->min_discoverable_interval;
+		__entry->max_di = params->max_discoverable_interval;
+		__entry->listen_freq = params->listen_channel->center_freq;
+		__entry->n_channels = params->n_channels;
+	),
+	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", listen %d MHz, disc. int. [%d..%d], n_channels %d",
+		  WIPHY_PR_ARG, WDEV_PR_ARG, __entry->listen_freq,
+		  __entry->min_di, __entry->max_di, __entry->n_channels)
+);
+
+DEFINE_EVENT(wiphy_wdev_evt, rdev_stop_p2p_find,
+	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
+	TP_ARGS(wiphy, wdev)
+);
+
 /*************************************************************
  *	     cfg80211 exported functions traces		     *
  *************************************************************/
@@ -2557,6 +2587,20 @@ TRACE_EVENT(cfg80211_ft_event,
 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(target_ap))
 );
 
+TRACE_EVENT(cfg80211_p2p_find_notify,
+	TP_PROTO(struct wireless_dev *wdev, int cmd),
+	TP_ARGS(wdev, cmd),
+	TP_STRUCT__entry(
+		WDEV_ENTRY
+		__field(int, cmd)
+	),
+	TP_fast_assign(
+		WDEV_ASSIGN;
+		__entry->cmd = cmd;
+	),
+	TP_printk(WDEV_PR_FMT ", cmd: %d", WDEV_PR_ARG, __entry->cmd)
+);
+
 #endif /* !__RDEV_OPS_TRACE || TRACE_HEADER_MULTI_READ */
 
 #undef TRACE_INCLUDE_PATH
-- 
1.8.1.2


^ permalink raw reply related

* [PATCH v14 1/2] cfg80211: add 'flags' to cfg80211_rx_mgmt()
From: Vladimir Kondratiev @ 2013-08-15 11:51 UTC (permalink / raw)
  To: Johannes Berg
  Cc: Vladimir Kondratiev, linux-wireless, Luis R . Rodriguez,
	John W . Linville, Jouni Malinen
In-Reply-To: <1376567489-1863-1-git-send-email-qca_vkondrat@qca.qualcomm.com>

Flags intended to report various auxiliary information.
Introduced flag NL80211_RXMGMT_FLAG_REPLIED to report
whether frame was replied by the device/driver.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath6kl/wmi.c         |  7 +++----
 drivers/net/wireless/ath/wil6210/wmi.c        |  2 +-
 drivers/net/wireless/brcm80211/brcmfmac/p2p.c |  4 ++--
 drivers/net/wireless/mwifiex/util.c           |  4 ++--
 include/net/cfg80211.h                        |  3 ++-
 include/uapi/linux/nl80211.h                  | 17 +++++++++++++++++
 net/mac80211/rx.c                             |  3 +--
 net/wireless/mlme.c                           |  4 ++--
 net/wireless/nl80211.c                        |  6 ++++--
 net/wireless/nl80211.h                        |  2 +-
 10 files changed, 35 insertions(+), 17 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c
index 87aefb4..546d5da 100644
--- a/drivers/net/wireless/ath/ath6kl/wmi.c
+++ b/drivers/net/wireless/ath/ath6kl/wmi.c
@@ -568,8 +568,8 @@ static int ath6kl_wmi_rx_probe_req_event_rx(struct wmi *wmi, u8 *datap, int len,
 		   dlen, freq, vif->probe_req_report);
 
 	if (vif->probe_req_report || vif->nw_type == AP_NETWORK)
-		cfg80211_rx_mgmt(&vif->wdev, freq, 0,
-				 ev->data, dlen, GFP_ATOMIC);
+		cfg80211_rx_mgmt(&vif->wdev, freq, 0, ev->data, dlen, 0,
+				 GFP_ATOMIC);
 
 	return 0;
 }
@@ -608,8 +608,7 @@ static int ath6kl_wmi_rx_action_event_rx(struct wmi *wmi, u8 *datap, int len,
 		return -EINVAL;
 	}
 	ath6kl_dbg(ATH6KL_DBG_WMI, "rx_action: len=%u freq=%u\n", dlen, freq);
-	cfg80211_rx_mgmt(&vif->wdev, freq, 0,
-			 ev->data, dlen, GFP_ATOMIC);
+	cfg80211_rx_mgmt(&vif->wdev, freq, 0, ev->data, dlen, 0, GFP_ATOMIC);
 
 	return 0;
 }
diff --git a/drivers/net/wireless/ath/wil6210/wmi.c b/drivers/net/wireless/ath/wil6210/wmi.c
index 5220f15..063963e 100644
--- a/drivers/net/wireless/ath/wil6210/wmi.c
+++ b/drivers/net/wireless/ath/wil6210/wmi.c
@@ -339,7 +339,7 @@ static void wmi_evt_rx_mgmt(struct wil6210_priv *wil, int id, void *d, int len)
 		}
 	} else {
 		cfg80211_rx_mgmt(wil->wdev, freq, signal,
-				 (void *)rx_mgmt_frame, d_len, GFP_KERNEL);
+				 (void *)rx_mgmt_frame, d_len, 0, GFP_KERNEL);
 	}
 }
 
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c
index 79555f0..d7a9745 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c
@@ -1430,7 +1430,7 @@ int brcmf_p2p_notify_action_frame_rx(struct brcmf_if *ifp,
 					      IEEE80211_BAND_5GHZ);
 
 	wdev = &ifp->vif->wdev;
-	cfg80211_rx_mgmt(wdev, freq, 0, (u8 *)mgmt_frame, mgmt_frame_len,
+	cfg80211_rx_mgmt(wdev, freq, 0, (u8 *)mgmt_frame, mgmt_frame_len, 0,
 			 GFP_ATOMIC);
 
 	kfree(mgmt_frame);
@@ -1895,7 +1895,7 @@ s32 brcmf_p2p_notify_rx_mgmt_p2p_probereq(struct brcmf_if *ifp,
 					      IEEE80211_BAND_2GHZ :
 					      IEEE80211_BAND_5GHZ);
 
-	cfg80211_rx_mgmt(&vif->wdev, freq, 0, mgmt_frame, mgmt_frame_len,
+	cfg80211_rx_mgmt(&vif->wdev, freq, 0, mgmt_frame, mgmt_frame_len, 0,
 			 GFP_ATOMIC);
 
 	brcmf_dbg(INFO, "mgmt_frame_len (%d) , e->datalen (%d), chanspec (%04x), freq (%d)\n",
diff --git a/drivers/net/wireless/mwifiex/util.c b/drivers/net/wireless/mwifiex/util.c
index e57ac0d..5d9e150 100644
--- a/drivers/net/wireless/mwifiex/util.c
+++ b/drivers/net/wireless/mwifiex/util.c
@@ -171,8 +171,8 @@ mwifiex_process_mgmt_packet(struct mwifiex_private *priv,
 	rx_pd->rx_pkt_length = cpu_to_le16(pkt_len);
 
 	cfg80211_rx_mgmt(priv->wdev, priv->roc_cfg.chan.center_freq,
-			 CAL_RSSI(rx_pd->snr, rx_pd->nf),
-			 skb->data, pkt_len, GFP_ATOMIC);
+			 CAL_RSSI(rx_pd->snr, rx_pd->nf), skb->data, pkt_len,
+			 0, GFP_ATOMIC);
 
 	return 0;
 }
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index b7495c7..e1ee9d3 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -4055,6 +4055,7 @@ void cfg80211_conn_failed(struct net_device *dev, const u8 *mac_addr,
  * @sig_dbm: signal strength in mBm, or 0 if unknown
  * @buf: Management frame (header + body)
  * @len: length of the frame data
+ * @flags: flags, as defined in enum nl80211_rxmgmt_flags
  * @gfp: context flags
  *
  * This function is called whenever an Action frame is received for a station
@@ -4066,7 +4067,7 @@ void cfg80211_conn_failed(struct net_device *dev, const u8 *mac_addr,
  * driver is responsible for rejecting the frame.
  */
 bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int sig_dbm,
-		      const u8 *buf, size_t len, gfp_t gfp);
+		      const u8 *buf, size_t len, u32 flags, gfp_t gfp);
 
 /**
  * cfg80211_mgmt_tx_status - notification of TX status for management frame
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 1f42bc3..fc1665e 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -1493,6 +1493,10 @@ enum nl80211_commands {
  * @NL80211_ATTR_CSA_C_OFF_PRESP: Offset of the channel switch counter
  *	field in the probe response (%NL80211_ATTR_PROBE_RESP).
  *
+ * @NL80211_ATTR_RXMGMT_FLAGS: flags for nl80211_send_mgmt(), u32.
+ *	As specified in the enum nl80211_rxmgmt_flags.
+ *	Passed from cfg80211_rx_mgmt()
+ *
  * @NL80211_ATTR_MAX: highest attribute number currently defined
  * @__NL80211_ATTR_AFTER_LAST: internal use
  */
@@ -1801,6 +1805,8 @@ enum nl80211_attrs {
 	NL80211_ATTR_CSA_C_OFF_BEACON,
 	NL80211_ATTR_CSA_C_OFF_PRESP,
 
+	NL80211_ATTR_RXMGMT_FLAGS,
+
 	/* add attributes here, update the policy in nl80211.c */
 
 	__NL80211_ATTR_AFTER_LAST,
@@ -3901,4 +3907,15 @@ enum nl80211_crit_proto_id {
 /* maximum duration for critical protocol measures */
 #define NL80211_CRIT_PROTO_MAX_DURATION		5000 /* msec */
 
+/**
+ * enum nl80211_rxmgmt_flags - flags for received management frame.
+ *
+ * Used by cfg80211_rx_mgmt()
+ *
+ * @NL80211_RXMGMT_FLAG_REPLIED: frame was replied by device/driver.
+ */
+enum nl80211_rxmgmt_flags {
+	NL80211_RXMGMT_FLAG_REPLIED = 1 << 0,
+};
+
 #endif /* __LINUX_NL80211_H */
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 6b85f95..6698a34 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -2684,8 +2684,7 @@ ieee80211_rx_h_userspace_mgmt(struct ieee80211_rx_data *rx)
 		sig = status->signal;
 
 	if (cfg80211_rx_mgmt(&rx->sdata->wdev, status->freq, sig,
-			     rx->skb->data, rx->skb->len,
-			     GFP_ATOMIC)) {
+			     rx->skb->data, rx->skb->len, 0, GFP_ATOMIC)) {
 		if (rx->sta)
 			rx->sta->rx_packets++;
 		dev_kfree_skb(rx->skb);
diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
index bfac5e1..8d49c1c 100644
--- a/net/wireless/mlme.c
+++ b/net/wireless/mlme.c
@@ -621,7 +621,7 @@ int cfg80211_mlme_mgmt_tx(struct cfg80211_registered_device *rdev,
 }
 
 bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int sig_mbm,
-		      const u8 *buf, size_t len, gfp_t gfp)
+		      const u8 *buf, size_t len, u32 flags, gfp_t gfp)
 {
 	struct wiphy *wiphy = wdev->wiphy;
 	struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
@@ -664,7 +664,7 @@ bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int sig_mbm,
 		/* Indicate the received Action frame to user space */
 		if (nl80211_send_mgmt(rdev, wdev, reg->nlportid,
 				      freq, sig_mbm,
-				      buf, len, gfp))
+				      buf, len, flags, gfp))
 			continue;
 
 		result = true;
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index adf1e98..8dbb289 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -10442,7 +10442,7 @@ EXPORT_SYMBOL(cfg80211_rx_unexpected_4addr_frame);
 int nl80211_send_mgmt(struct cfg80211_registered_device *rdev,
 		      struct wireless_dev *wdev, u32 nlportid,
 		      int freq, int sig_dbm,
-		      const u8 *buf, size_t len, gfp_t gfp)
+		      const u8 *buf, size_t len, u32 flags, gfp_t gfp)
 {
 	struct net_device *netdev = wdev->netdev;
 	struct sk_buff *msg;
@@ -10465,7 +10465,9 @@ int nl80211_send_mgmt(struct cfg80211_registered_device *rdev,
 	    nla_put_u32(msg, NL80211_ATTR_WIPHY_FREQ, freq) ||
 	    (sig_dbm &&
 	     nla_put_u32(msg, NL80211_ATTR_RX_SIGNAL_DBM, sig_dbm)) ||
-	    nla_put(msg, NL80211_ATTR_FRAME, len, buf))
+	    nla_put(msg, NL80211_ATTR_FRAME, len, buf) ||
+	    (flags &&
+	     nla_put_u32(msg, NL80211_ATTR_RXMGMT_FLAGS, flags)))
 		goto nla_put_failure;
 
 	genlmsg_end(msg, hdr);
diff --git a/net/wireless/nl80211.h b/net/wireless/nl80211.h
index 44341bf..2c0f2b3 100644
--- a/net/wireless/nl80211.h
+++ b/net/wireless/nl80211.h
@@ -66,7 +66,7 @@ void nl80211_send_ibss_bssid(struct cfg80211_registered_device *rdev,
 int nl80211_send_mgmt(struct cfg80211_registered_device *rdev,
 		      struct wireless_dev *wdev, u32 nlpid,
 		      int freq, int sig_dbm,
-		      const u8 *buf, size_t len, gfp_t gfp);
+		      const u8 *buf, size_t len, u32 flags, gfp_t gfp);
 
 void
 nl80211_radar_notify(struct cfg80211_registered_device *rdev,
-- 
1.8.1.2


^ permalink raw reply related

* Re: [PATCH] mac80211: implement STA CSA for drivers using channel contexts
From: Johannes Berg @ 2013-08-15 12:03 UTC (permalink / raw)
  To: Arik Nemtsov; +Cc: linux-wireless
In-Reply-To: <1376395438-24788-1-git-send-email-arik@wizery.com>

On Tue, 2013-08-13 at 15:03 +0300, Arik Nemtsov wrote:

> This isn't very well tested yet, but seems to work with a TI wl18xx card.
> The single-role/single-channel support is enough to pass the 11h certification.

:-)

>  net/mac80211/cfg.c  |  5 +++++
>  net/mac80211/chan.c |  5 -----
>  net/mac80211/mlme.c | 55 +++++++++++++++++++++++++++++++++++++++--------------
>  3 files changed, 46 insertions(+), 19 deletions(-)
> 
> diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
> index 7aa38ce..beb1c2a 100644
> --- a/net/mac80211/cfg.c
> +++ b/net/mac80211/cfg.c
> @@ -2872,6 +2872,11 @@ void ieee80211_csa_finalize_work(struct work_struct *work)
>  	if (WARN_ON(err < 0))
>  		return;
>  
> +	if (!local->use_chanctx) {
> +		local->_oper_chandef = local->csa_chandef;
> +		ieee80211_hw_config(local, 0);
> +	}

I don't really understand this part - I think you should add some
documentation or something?

> @@ -453,11 +453,6 @@ int ieee80211_vif_change_channel(struct ieee80211_sub_if_data *sdata,
>  	chanctx_changed |= IEEE80211_CHANCTX_CHANGE_CHANNEL;
>  	drv_change_chanctx(local, ctx, chanctx_changed);
>  
> -	if (!local->use_chanctx) {
> -		local->_oper_chandef = *chandef;
> -		ieee80211_hw_config(local, 0);
> -	}

I really don't like it either - this was here so that no other code
really needed to be worried about non-chanctx drivers.

> @@ -1180,17 +1196,27 @@ ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata,
>  	}
>  
>  	ifmgd->flags |= IEEE80211_STA_CSA_RECEIVED;
> +	sdata->vif.csa_active = true;

I don't think we can just do this - this isn't going to result in good
behaviour for multi-vif drivers and in particular I'm pretty sure with
the MVM driver this would result in bad behaviour.

If you really want to do this I think it needs to be optional.

Also the documentation for the chanctx channel change probably needs to
be updated, etc.

johannes


^ permalink raw reply

* Re: [PATCH 1/3] ath10k: clean up HTT tx tid handling
From: Kalle Valo @ 2013-08-15 13:07 UTC (permalink / raw)
  To: Michal Kazior; +Cc: ath10k, linux-wireless
In-Reply-To: <1376036014-29707-2-git-send-email-michal.kazior@tieto.com>

Michal Kazior <michal.kazior@tieto.com> writes:

> The tids weren't mapped really properly. This
> doesn't fix any known bug but seems the right
> thing to do.
>
> Signed-off-by: Michal Kazior <michal.kazior@tieto.com>

[...]

>  enum htt_data_tx_ext_tid {
> -	HTT_DATA_TX_EXT_TID_NON_QOS_MCAST_BCAST = 16,
> -	HTT_DATA_TX_EXT_TID_MGMT                = 17,
> +	HTT_DATA_TX_EXT_TID_NON_QOS_UNICAST     = 16,
> +	HTT_DATA_TX_EXT_TID_UNUSED              = 17,
> +	HTT_DATA_TX_EXT_TID_NON_QOS_MCAST_BCAST = 18,
> +	HTT_DATA_TX_EXT_TID_MGMT                = 19,
>  	HTT_DATA_TX_EXT_TID_INVALID             = 31
>  };

This doesn't seem to match what firmware uses. We need to investigate
more about this so I drop the patch for now.

-- 
Kalle Valo

^ permalink raw reply

* Re: [PATCH 3/3] ath10k: add support for HTT 3.0
From: Kalle Valo @ 2013-08-15 13:10 UTC (permalink / raw)
  To: Michal Kazior; +Cc: ath10k, linux-wireless
In-Reply-To: <1376036014-29707-4-git-send-email-michal.kazior@tieto.com>

Michal Kazior <michal.kazior@tieto.com> writes:

> New firmware comes with new HTT protocol version.
> In 3.0 the separate mgmt tx command has been
> removed. All traffic is to be pushed through data
> tx (tx_frm) command with a twist - FW seems to not
> be able (yet?) to access tx fragment table so for
> manamgement frames frame pointer is passed
> directly.
>
> Signed-off-by: Michal Kazior <michal.kazior@tieto.com>

Because I dropped patch 1 this patch had conflicts. I tried to be extra
careful, but please double check my conflict resolution.

-- 
Kalle Valo

^ permalink raw reply

* Re: [PATCH 0/3] ath10k: firmware-related updates
From: Kalle Valo @ 2013-08-15 13:09 UTC (permalink / raw)
  To: Michal Kazior; +Cc: ath10k, linux-wireless
In-Reply-To: <1376036014-29707-1-git-send-email-michal.kazior@tieto.com>

Michal Kazior <michal.kazior@tieto.com> writes:

> Hi,
>
> This patchset contains 2 firmware-related upgrades
> and 1 fix (that I though is a good pick to include
> here, since it's related with HTT tx).
>
> This keeps backward compatbility with old
> firmware.
>
> This includes fixes for issues pointed out during
> RFC review.

[...]

> Michal Kazior (3):
>   ath10k: clean up HTT tx tid handling

I dropped this patch.

>   ath10k: add support for firmware newer than 636
>   ath10k: add support for HTT 3.0

These two are applied.

-- 
Kalle Valo

^ permalink raw reply

* pull-request: mac802111 2013-08-15
From: Johannes Berg @ 2013-08-15 15:46 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

[-- Attachment #1: Type: text/plain, Size: 1079 bytes --]

John,

I have two more fixes ...

This time, I have one fix from Dan Carpenter for users of
nl80211hdr_put(), and one fix from myself fixing a regression with the
libertas driver.

Please let me know if there's any problem.

johannes

The following changes since commit ddfe49b42d8ad4bfdf92d63d4a74f162660d878d:

  mac80211: continue using disabled channels while connected (2013-07-31 21:18:17 +0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git for-john

for you to fetch changes up to dee8a9732e713480075adbbca8eb220c5b8d1216:

  cfg80211: don't request disconnect if not connected (2013-08-14 14:00:19 +0200)

----------------------------------------------------------------
Dan Carpenter (1):
      nl80211: nl80211hdr_put() doesn't return an ERR_PTR

Johannes Berg (1):
      cfg80211: don't request disconnect if not connected

 net/wireless/nl80211.c | 22 +++++++++++-----------
 net/wireless/sme.c     | 10 ++++------
 2 files changed, 15 insertions(+), 17 deletions(-)


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply

* Re: [PATCH] mac80211: implement STA CSA for drivers using channel contexts
From: Arik Nemtsov @ 2013-08-15 16:07 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless@vger.kernel.org
In-Reply-To: <1376568235.14084.12.camel@jlt4.sipsolutions.net>

On Thu, Aug 15, 2013 at 3:03 PM, Johannes Berg
<johannes@sipsolutions.net> wrote:
>> @@ -2872,6 +2872,11 @@ void ieee80211_csa_finalize_work(struct work_struct *work)
>>       if (WARN_ON(err < 0))
>>               return;
>>
>> +     if (!local->use_chanctx) {
>> +             local->_oper_chandef = local->csa_chandef;
>> +             ieee80211_hw_config(local, 0);
>> +     }
>
> I don't really understand this part - I think you should add some
> documentation or something?

Basically I removed this chunk of code from
ieee80211_vif_change_channel() and put it here - a bit later in the AP
CSA flow.
I don't think it does any harm.

>
>> @@ -453,11 +453,6 @@ int ieee80211_vif_change_channel(struct ieee80211_sub_if_data *sdata,
>>       chanctx_changed |= IEEE80211_CHANCTX_CHANGE_CHANNEL;
>>       drv_change_chanctx(local, ctx, chanctx_changed);
>>
>> -     if (!local->use_chanctx) {
>> -             local->_oper_chandef = *chandef;
>> -             ieee80211_hw_config(local, 0);
>> -     }
>
> I really don't like it either - this was here so that no other code
> really needed to be worried about non-chanctx drivers.

Well right now ieee80211_chswitch_work() takes care of it, and does
something a bit different there to accommodate the legacy behavior -
if the chan_switch op is defined, ieee80211_hw_config is not called.
Would you prefer that ieee80211_vif_change_channel() handle all this,
checking interface type to do the right thing?

>
>> @@ -1180,17 +1196,27 @@ ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata,
>>       }
>>
>>       ifmgd->flags |= IEEE80211_STA_CSA_RECEIVED;
>> +     sdata->vif.csa_active = true;
>
> I don't think we can just do this - this isn't going to result in good
> behaviour for multi-vif drivers and in particular I'm pretty sure with
> the MVM driver this would result in bad behaviour.
>
> If you really want to do this I think it needs to be optional.

I only added it since the current implementation of
ieee80211_vif_change_channel() bails if it's false. That said, I'm not
sure what's wrong here. This setting is per-vif.

>
> Also the documentation for the chanctx channel change probably needs to
> be updated, etc.

Is there any current documentation? The AP CSA patches by Simon didn't
have any IIRC.
I guess I'm not sure what's special here, we just replace the chandef
and that's it.

Arik

^ permalink raw reply

* Re: [PATCH] net: rfkill: Do not ignore errors from regulator_enable()
From: Johannes Berg @ 2013-08-15 16:17 UTC (permalink / raw)
  To: Luis Henriques
  Cc: linux-kernel, netdev, linux-wireless, David S. Miller,
	John W. Linville
In-Reply-To: <1376518206-10710-1-git-send-email-luis.henriques@canonical.com>

On Wed, 2013-08-14 at 23:10 +0100, Luis Henriques wrote:
> Function regulator_enable() may return an error that has to be checked.
> This patch changes function rfkill_regulator_set_block() so that it checks
> for the return code.  Also, rfkill_data->reg_enabled is set to 'true' only
> if there is no error.

Applied.

johannes


^ permalink raw reply

* [PATCH 1/3] staging: vt6656: rxtx.c remove typdef PTX_BUFFER
From: Malcolm Priestley @ 2013-08-15 18:34 UTC (permalink / raw)
  To: gregkh; +Cc: linux-wireless

Rename to vnt_tx_buffer.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>

---
 drivers/staging/vt6656/rxtx.c | 20 ++++++++++----------
 drivers/staging/vt6656/rxtx.h | 20 +++++++++-----------
 2 files changed, 19 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
index 9cd4158..083f58f 100644
--- a/drivers/staging/vt6656/rxtx.c
+++ b/drivers/staging/vt6656/rxtx.c
@@ -996,8 +996,8 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType,
 	u32 uNodeIndex, u16 wCurrentRate, u32 *pcbHeaderLen, u32 *pcbTotalLen)
 {
 	struct vnt_manager *pMgmt = &pDevice->vnt_mgmt;
+	struct vnt_tx_buffer *pTxBufHead;
 	u32 cbFrameSize, cbFrameBodySize;
-	PTX_BUFFER pTxBufHead;
 	u32 cb802_1_H_len;
 	u32 cbIVlen = 0, cbICVlen = 0, cbMIClen = 0, cbMACHdLen = 0;
 	u32 cbFCSlen = 4, cbMICHDR = 0;
@@ -1026,7 +1026,7 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType,
 			bSoftWEP = true; /* WEP 256 */
 	}
 
-    pTxBufHead = (PTX_BUFFER) usbPacketBuf;
+	pTxBufHead = (struct vnt_tx_buffer *)usbPacketBuf;
 
     // Get pkt type
     if (ntohs(psEthHeader->h_proto) > ETH_DATA_LEN) {
@@ -1489,7 +1489,7 @@ CMD_STATUS csMgmt_xmit(struct vnt_private *pDevice,
 	struct vnt_tx_mgmt *pPacket)
 {
 	struct vnt_manager *pMgmt = &pDevice->vnt_mgmt;
-	PTX_BUFFER pTX_Buffer;
+	struct vnt_tx_buffer *pTX_Buffer;
 	PSTxBufHead pTxBufHead;
 	PUSB_SEND_CONTEXT pContext;
 	struct ieee80211_hdr *pMACHeader;
@@ -1512,7 +1512,7 @@ CMD_STATUS csMgmt_xmit(struct vnt_private *pDevice,
         return CMD_STATUS_RESOURCES;
     }
 
-    pTX_Buffer = (PTX_BUFFER) (&pContext->Data[0]);
+	pTX_Buffer = (struct vnt_tx_buffer *)&pContext->Data[0];
     pbyTxBufferAddr = (u8 *)&(pTX_Buffer->adwTxKey[0]);
     cbFrameBodySize = pPacket->cbPayloadLen;
     pTxBufHead = (PSTxBufHead) pbyTxBufferAddr;
@@ -1838,6 +1838,7 @@ CMD_STATUS csBeacon_xmit(struct vnt_private *pDevice,
 void vDMA0_tx_80211(struct vnt_private *pDevice, struct sk_buff *skb)
 {
 	struct vnt_manager *pMgmt = &pDevice->vnt_mgmt;
+	struct vnt_tx_buffer *pTX_Buffer;
 	u8 byPktType;
 	u8 *pbyTxBufferAddr;
 	void *pvRTS, *pvCTS, *pvTxDataHd;
@@ -1865,7 +1866,6 @@ void vDMA0_tx_80211(struct vnt_private *pDevice, struct sk_buff *skb)
 	PSKeyItem pTransmitKey = NULL;
 	u8 *pbyIVHead, *pbyPayloadHead, *pbyMacHdr;
 	u32 cbExtSuppRate = 0;
-	PTX_BUFFER pTX_Buffer;
 	PUSB_SEND_CONTEXT pContext;
 
     pvRrvTime = pMICHDR = pvRTS = pvCTS = pvTxDataHd = NULL;
@@ -1886,7 +1886,7 @@ void vDMA0_tx_80211(struct vnt_private *pDevice, struct sk_buff *skb)
         return ;
     }
 
-    pTX_Buffer = (PTX_BUFFER)(&pContext->Data[0]);
+	pTX_Buffer = (struct vnt_tx_buffer *)&pContext->Data[0];
     pbyTxBufferAddr = (u8 *)(&pTX_Buffer->adwTxKey[0]);
     pTxBufHead = (PSTxBufHead) pbyTxBufferAddr;
     wTxBufSize = sizeof(STxBufHead);
@@ -2218,6 +2218,7 @@ int nsDMA_tx_packet(struct vnt_private *pDevice,
 {
 	struct net_device_stats *pStats = &pDevice->stats;
 	struct vnt_manager *pMgmt = &pDevice->vnt_mgmt;
+	struct vnt_tx_buffer *pTX_Buffer;
 	u32 BytesToWrite = 0, uHeaderLen = 0;
 	u32 uNodeIndex = 0;
 	u8 byMask[8] = {1, 2, 4, 8, 0x10, 0x20, 0x40, 0x80};
@@ -2233,7 +2234,6 @@ int nsDMA_tx_packet(struct vnt_private *pDevice,
 	int bNodeExist = false;
 	PUSB_SEND_CONTEXT pContext;
 	bool fConvertedPacket;
-	PTX_BUFFER pTX_Buffer;
 	u32 status;
 	u16 wKeepRate = pDevice->wCurrentRate;
 	int bTxeapol_key = false;
@@ -2564,7 +2564,7 @@ int nsDMA_tx_packet(struct vnt_private *pDevice,
         }
     }
 
-    pTX_Buffer = (PTX_BUFFER)&(pContext->Data[0]);
+	pTX_Buffer = (struct vnt_tx_buffer *)&pContext->Data[0];
     pTX_Buffer->byPKTNO = (u8) (((pDevice->wCurrentRate<<4) &0x00F0) | ((pDevice->wSeqCounter - 1) & 0x000F));
     pTX_Buffer->wTxByteCount = (u16)BytesToWrite;
 
@@ -2611,6 +2611,7 @@ int bRelayPacketSend(struct vnt_private *pDevice, u8 *pbySkbData, u32 uDataLen,
 	u32 uNodeIndex)
 {
 	struct vnt_manager *pMgmt = &pDevice->vnt_mgmt;
+	struct vnt_tx_buffer *pTX_Buffer;
 	u32 BytesToWrite = 0, uHeaderLen = 0;
 	u8 byPktType = PK_TYPE_11B;
 	int bNeedEncryption = false;
@@ -2620,7 +2621,6 @@ int bRelayPacketSend(struct vnt_private *pDevice, u8 *pbySkbData, u32 uDataLen,
 	PUSB_SEND_CONTEXT pContext;
 	u8 byPktTyp;
 	int fConvertedPacket;
-	PTX_BUFFER pTX_Buffer;
 	u32 status;
 	u16 wKeepRate = pDevice->wCurrentRate;
 
@@ -2714,7 +2714,7 @@ int bRelayPacketSend(struct vnt_private *pDevice, u8 *pbySkbData, u32 uDataLen,
         return false;
     }
 
-    pTX_Buffer = (PTX_BUFFER)&(pContext->Data[0]);
+	pTX_Buffer = (struct vnt_tx_buffer *)&pContext->Data[0];
     pTX_Buffer->byPKTNO = (u8) (((pDevice->wCurrentRate<<4) &0x00F0) | ((pDevice->wSeqCounter - 1) & 0x000F));
     pTX_Buffer->wTxByteCount = (u16)BytesToWrite;
 
diff --git a/drivers/staging/vt6656/rxtx.h b/drivers/staging/vt6656/rxtx.h
index 3e2a877..bd1f9e2 100644
--- a/drivers/staging/vt6656/rxtx.h
+++ b/drivers/staging/vt6656/rxtx.h
@@ -32,18 +32,16 @@
 #include "device.h"
 #include "wcmd.h"
 
-typedef struct tagSTX_BUFFER
-{
-    u8                            byType;
-    u8                            byPKTNO;
-    u16                            wTxByteCount;
-
+struct vnt_tx_buffer {
+	u8 byType;
+	u8 byPKTNO;
+	u16 wTxByteCount;
 	u32 adwTxKey[4];
-    u16                            wFIFOCtl;
-    u16                            wTimeStamp;
-    u16                            wFragCtl;
-    u16                            wReserved;
-} __packed TX_BUFFER, *PTX_BUFFER;
+	u16 wFIFOCtl;
+	u16 wTimeStamp;
+	u16 wFragCtl;
+	u16 wReserved;
+} __packed;
 
 typedef struct tagSBEACON_BUFFER
 {
-- 
1.8.1.2




^ permalink raw reply related

* [PATCH 2/3] staging: vt6656: rxtx.c : s_bPacketToWirelessUsb remove usbPacketBuf.
From: Malcolm Priestley @ 2013-08-15 18:37 UTC (permalink / raw)
  To: gregkh; +Cc: linux-wireless

Move vnt_tx_buffer *pTxBufHead to argument u8 *usbPacketBuf position.

Fix the calling to s_bPacketToWirelessUsb so it attached to
the calling struct vnt_tx_buffer pTX_Buffer.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
---
 drivers/staging/vt6656/rxtx.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
index 083f58f..e37e82c 100644
--- a/drivers/staging/vt6656/rxtx.c
+++ b/drivers/staging/vt6656/rxtx.c
@@ -991,12 +991,12 @@ static void s_vGenerateTxParameter(struct vnt_private *pDevice,
 */
 
 static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType,
-	u8 *usbPacketBuf, int bNeedEncryption, u32 uSkbPacketLen, u32 uDMAIdx,
-	struct ethhdr *psEthHeader, u8 *pPacket, PSKeyItem pTransmitKey,
-	u32 uNodeIndex, u16 wCurrentRate, u32 *pcbHeaderLen, u32 *pcbTotalLen)
+	struct vnt_tx_buffer *pTxBufHead, int bNeedEncryption,
+	u32 uSkbPacketLen, u32 uDMAIdx,	struct ethhdr *psEthHeader,
+	u8 *pPacket, PSKeyItem pTransmitKey, u32 uNodeIndex, u16 wCurrentRate,
+	u32 *pcbHeaderLen, u32 *pcbTotalLen)
 {
 	struct vnt_manager *pMgmt = &pDevice->vnt_mgmt;
-	struct vnt_tx_buffer *pTxBufHead;
 	u32 cbFrameSize, cbFrameBodySize;
 	u32 cb802_1_H_len;
 	u32 cbIVlen = 0, cbICVlen = 0, cbMIClen = 0, cbMACHdLen = 0;
@@ -1026,8 +1026,6 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType,
 			bSoftWEP = true; /* WEP 256 */
 	}
 
-	pTxBufHead = (struct vnt_tx_buffer *)usbPacketBuf;
-
     // Get pkt type
     if (ntohs(psEthHeader->h_proto) > ETH_DATA_LEN) {
         if (pDevice->dwDiagRefCount == 0) {
@@ -2541,8 +2539,10 @@ int nsDMA_tx_packet(struct vnt_private *pDevice,
         }
     }
 
+	pTX_Buffer = (struct vnt_tx_buffer *)&pContext->Data[0];
+
     fConvertedPacket = s_bPacketToWirelessUsb(pDevice, byPktType,
-                        (u8 *)(&pContext->Data[0]), bNeedEncryption,
+			pTX_Buffer, bNeedEncryption,
                         skb->len, uDMAIdx, &pDevice->sTxEthHeader,
                         (u8 *)skb->data, pTransmitKey, uNodeIndex,
                         pDevice->wCurrentRate,
@@ -2564,7 +2564,6 @@ int nsDMA_tx_packet(struct vnt_private *pDevice,
         }
     }
 
-	pTX_Buffer = (struct vnt_tx_buffer *)&pContext->Data[0];
     pTX_Buffer->byPKTNO = (u8) (((pDevice->wCurrentRate<<4) &0x00F0) | ((pDevice->wSeqCounter - 1) & 0x000F));
     pTX_Buffer->wTxByteCount = (u16)BytesToWrite;
 
@@ -2701,8 +2700,10 @@ int bRelayPacketSend(struct vnt_private *pDevice, u8 *pbySkbData, u32 uDataLen,
     // Convert the packet to an usb frame and copy into our buffer
     // and send the irp.
 
+	pTX_Buffer = (struct vnt_tx_buffer *)&pContext->Data[0];
+
     fConvertedPacket = s_bPacketToWirelessUsb(pDevice, byPktType,
-                         (u8 *)(&pContext->Data[0]), bNeedEncryption,
+			pTX_Buffer, bNeedEncryption,
                          uDataLen, TYPE_AC0DMA, &pDevice->sTxEthHeader,
                          pbySkbData, pTransmitKey, uNodeIndex,
                          pDevice->wCurrentRate,
@@ -2714,7 +2715,6 @@ int bRelayPacketSend(struct vnt_private *pDevice, u8 *pbySkbData, u32 uDataLen,
         return false;
     }
 
-	pTX_Buffer = (struct vnt_tx_buffer *)&pContext->Data[0];
     pTX_Buffer->byPKTNO = (u8) (((pDevice->wCurrentRate<<4) &0x00F0) | ((pDevice->wSeqCounter - 1) & 0x000F));
     pTX_Buffer->wTxByteCount = (u16)BytesToWrite;
 
-- 
1.8.1.2




^ permalink raw reply related

* [PATCH 3/3] staging: vt6656: rxtx.h : remove typedef struct tagSBEACON_BUFFER
From: Malcolm Priestley @ 2013-08-15 18:40 UTC (permalink / raw)
  To: gregkh; +Cc: linux-wireless

Replace with struct vnt_beacon_buffer.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
---
 drivers/staging/vt6656/rxtx.c |  5 +++--
 drivers/staging/vt6656/rxtx.h | 16 +++++++---------
 2 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
index e37e82c..7a4ebbc 100644
--- a/drivers/staging/vt6656/rxtx.c
+++ b/drivers/staging/vt6656/rxtx.c
@@ -1753,6 +1753,7 @@ CMD_STATUS csMgmt_xmit(struct vnt_private *pDevice,
 CMD_STATUS csBeacon_xmit(struct vnt_private *pDevice,
 	struct vnt_tx_mgmt *pPacket)
 {
+	struct vnt_beacon_buffer *pTX_Buffer;
 	u32 cbFrameSize = pPacket->cbMPDULen + WLAN_FCS_LEN;
 	u32 cbHeaderSize = 0;
 	u16 wTxBufSize = sizeof(STxShortBufHead);
@@ -1762,7 +1763,6 @@ CMD_STATUS csBeacon_xmit(struct vnt_private *pDevice,
 	u16 wCurrentRate;
 	u32 cbFrameBodySize;
 	u32 cbReqCount;
-	PBEACON_BUFFER pTX_Buffer;
 	u8 *pbyTxBufferAddr;
 	PUSB_SEND_CONTEXT pContext;
 	CMD_STATUS status;
@@ -1773,7 +1773,8 @@ CMD_STATUS csBeacon_xmit(struct vnt_private *pDevice,
         DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"ManagementSend TX...NO CONTEXT!\n");
         return status ;
     }
-    pTX_Buffer = (PBEACON_BUFFER) (&pContext->Data[0]);
+
+	pTX_Buffer = (struct vnt_beacon_buffer *)&pContext->Data[0];
     pbyTxBufferAddr = (u8 *)&(pTX_Buffer->wFIFOCtl);
 
     cbFrameBodySize = pPacket->cbPayloadLen;
diff --git a/drivers/staging/vt6656/rxtx.h b/drivers/staging/vt6656/rxtx.h
index bd1f9e2..3e347a9 100644
--- a/drivers/staging/vt6656/rxtx.h
+++ b/drivers/staging/vt6656/rxtx.h
@@ -43,15 +43,13 @@ struct vnt_tx_buffer {
 	u16 wReserved;
 } __packed;
 
-typedef struct tagSBEACON_BUFFER
-{
-    u8                            byType;
-    u8                            byPKTNO;
-    u16                            wTxByteCount;
-
-    u16                            wFIFOCtl;
-    u16                            wTimeStamp;
-} __packed BEACON_BUFFER, *PBEACON_BUFFER;
+struct vnt_beacon_buffer {
+	u8 byType;
+	u8 byPKTNO;
+	u16 wTxByteCount;
+	u16 wFIFOCtl;
+	u16 wTimeStamp;
+} __packed;
 
 void vDMA0_tx_80211(struct vnt_private *, struct sk_buff *skb);
 int nsDMA_tx_packet(struct vnt_private *, u32 uDMAIdx, struct sk_buff *skb);
-- 
1.8.1.2




^ permalink raw reply related

* Re: pull-request: mac802111 2013-08-15
From: John W. Linville @ 2013-08-15 19:41 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless
In-Reply-To: <1376581601.14084.14.camel@jlt4.sipsolutions.net>

On Thu, Aug 15, 2013 at 05:46:41PM +0200, Johannes Berg wrote:
> John,
> 
> I have two more fixes ...
> 
> This time, I have one fix from Dan Carpenter for users of
> nl80211hdr_put(), and one fix from myself fixing a regression with the
> libertas driver.
> 
> Please let me know if there's any problem.
> 
> johannes
> 
> The following changes since commit ddfe49b42d8ad4bfdf92d63d4a74f162660d878d:
> 
>   mac80211: continue using disabled channels while connected (2013-07-31 21:18:17 +0200)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git for-john
> 
> for you to fetch changes up to dee8a9732e713480075adbbca8eb220c5b8d1216:
> 
>   cfg80211: don't request disconnect if not connected (2013-08-14 14:00:19 +0200)

Pulling now...

-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply

* Re: [GIT] [3.12] NFC updates
From: John W. Linville @ 2013-08-15 19:56 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: Linux NFC, Linux Wireless
In-Reply-To: <20130814230448.GB11055@zurbaran>

On Thu, Aug 15, 2013 at 01:04:48AM +0200, Samuel Ortiz wrote:
> Hi John,
> 
> This is the first NFC pull request for the 3.12 release.
> 
> With this one we have:
> 
> - A few pn533 improvements and minor fixes. Testing our pn533 driver
>   against Google's NCI stack triggered a few issues that we fixed now.
>   We also added Tx fragmentation support to this driver.
> 
> - More NFC secure element handling. We added a GET_SE netlink command
>   for getting all the discovered secure elements, and we defined 2
>   additional secure element netlink event (transaction and connectivity).
>   We also fixed a couple of typos and copy-paste bugs from the secure
>   element handling code.
> 
> - Firmware download support for the pn544 driver. This chipset can enter a
>   special mode where it's waiting for firmware blobs to replace the
>   already flashed one. We now support that mode.
> 
> The following changes since commit d1e2586f484dfc36eee2b2d3a6c6c77be67ca492:
> 
>   mwifiex: fix build error when CONFIG_PM is not set (2013-08-12 14:36:55 -0400)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/sameo/nfc-next.git tags/nfc-next-3.12-1
> 
> for you to fetch changes up to 39525ee1dc78ca1f5f2fb1f764f7a141005fe440:
> 
>   NFC: Update secure element state (2013-08-14 01:13:40 +0200)

Pulling now...

-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply

* Re: Pull request: ath 20130812
From: John W. Linville @ 2013-08-15 19:54 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linux-wireless, ath6kl-devel, ath10k
In-Reply-To: <871u5zuhbm.fsf@kamboji.qca.qualcomm.com>

On Mon, Aug 12, 2013 at 05:14:37PM +0300, Kalle Valo wrote:
> Hi John,
> 
> here's a small pull request for ath10k and ath6kl. The changes are:
> 
> New features in ath10k are rx/tx checsumming in hw and survey scan
> implemented by Michal. Also he made fixes to different areas of the
> driver, most notable being fixing the case when using two streams and
> reducing the number of interface combinations to avoid firmware crashes.
> Bartosz did a clean related to how we handle SoC power save in PCI
> layer.
> 
> For ath6kl Mohammed and Vasanth sent each a patch to fix two infrequent
> crashes.
> 
> The following changes since commit 424121c365aed6ec93bbc8b515548df79c5af61c:
> 
>   ath10k: fix rts/fragmentation threshold setup (2013-07-30 18:01:21 +0300)
> 
> are available in the git repository at:
> 
>   git://github.com/kvalo/ath.git for-linville
> 
> for you to fetch changes up to 9d0e2f0772d394060bf3b17cd1f3a35574365103:
> 
>   ath6kl: Fix invalid pointer access on fuzz testing with AP mode (2013-08-07 10:58:59 +0300)

Pulling now...

-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply

* Re: [PATCH-resend 0/9] ath5k/ath9k: respin/resend 5/10 MHz and CSA patches
From: John W. Linville @ 2013-08-15 20:04 UTC (permalink / raw)
  To: Simon Wunderlich; +Cc: linux-wireless, Simon Wunderlich
In-Reply-To: <1376460098-26648-1-git-send-email-siwu@hrz.tu-chemnitz.de>

On Wed, Aug 14, 2013 at 08:01:29AM +0200, Simon Wunderlich wrote:
> This series contains the rebased patches for 5/10 MHz and channel switch
> announcement for ath5k/ath9k as sent in their respective series earlier. No
> modification was made. Since Johannes picked the nl/cfg/mac80211 parts
> only, these patches are still missing in the tree. John reported some
> trouble building with these patches, but I couldn't see any problems here.
> 
> The series is based on wireless-testing of todays master. Please tell
> me if there are any problems (including compiler errors and kernel config)
> so I can rework if neccesary.

  CC      drivers/net/wireless/ath/ath9k/rc.o
drivers/net/wireless/ath/ath9k/rc.c: In function ‘ath_rate_update’:
drivers/net/wireless/ath/ath9k/rc.c:1333:3: error: invalid type argument of ‘->’ (have ‘struct cfg80211_chan_def’)
make[2]: *** [drivers/net/wireless/ath/ath9k/rc.o] Error 1

> 
> Thanks!
> 	Simon
> 
> Simon Wunderlich (9):
>   ath9k: always use SIFS times from OFDM for 5/10 MHz
>   ath9k: use chandef instead of channel_type
>   ath9k: report 5/10 MHz channels
>   ath9k: set 5/10 MHz supported channels and fix bitrate
>   ath9k: announce that ath9k supports 5/10 MHz
>   ath5k: report 5/10 MHz channels
>   ath5k: set 5/10 MHz supported channels and fix duration
>   ath5k: enable support for 5 MHz and 10 MHz channels
>   ath9k: enable CSA functionality in ath9k
> 
>  drivers/net/wireless/ath/ath5k/ath5k.h        |    1 +
>  drivers/net/wireless/ath/ath5k/base.c         |   59 ++++++++++++++++++----
>  drivers/net/wireless/ath/ath5k/base.h         |    2 +-
>  drivers/net/wireless/ath/ath5k/mac80211-ops.c |    2 +-
>  drivers/net/wireless/ath/ath5k/pcu.c          |    2 +
>  drivers/net/wireless/ath/ath5k/qcu.c          |   25 ++++++++-
>  drivers/net/wireless/ath/ath9k/ath9k.h        |    2 +
>  drivers/net/wireless/ath/ath9k/beacon.c       |   21 ++++++++
>  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/hw.c           |    5 +-
>  drivers/net/wireless/ath/ath9k/init.c         |   30 +++++++----
>  drivers/net/wireless/ath/ath9k/main.c         |   25 +++++++--
>  drivers/net/wireless/ath/ath9k/rc.c           |    9 +++-
>  drivers/net/wireless/ath/ath9k/recv.c         |   11 ++++
>  drivers/net/wireless/ath/ath9k/xmit.c         |    2 +
>  17 files changed, 206 insertions(+), 65 deletions(-)
> 
> -- 
> 1.7.10.4
> 
> 

-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply

* [PATCH 1/2] staging: vt6656: desc.h Remove typedef struct tagSRTS_* to new strutures in rxtx.h
From: Malcolm Priestley @ 2013-08-15 20:23 UTC (permalink / raw)
  To: gregkh; +Cc: linux-wireless

The new structures being
typedef struct tagSRTS_g -> struct vnt_rts_g
typedef struct tagSRTS_g_FB -> struct vnt_rts_g_fb
typedef struct tagSRTS_ab -> struct vnt_rts_ab
typedef struct tagSRTS_a_FB -> struct vnt_rts_a_fb

These are only needed by rxtc.c so moved to rxtx.h and
will eventually form part of the structure of
struct vnt_tx_buffer.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
---
 drivers/staging/vt6656/desc.h | 66 -------------------------------------------
 drivers/staging/vt6656/rxtx.c | 51 ++++++++++++++++++++++-----------
 drivers/staging/vt6656/rxtx.h | 53 ++++++++++++++++++++++++++++++++++
 3 files changed, 87 insertions(+), 83 deletions(-)

diff --git a/drivers/staging/vt6656/desc.h b/drivers/staging/vt6656/desc.h
index 1a1cf34..4e2eb18 100644
--- a/drivers/staging/vt6656/desc.h
+++ b/drivers/staging/vt6656/desc.h
@@ -186,72 +186,6 @@ SRrvTime_atim, *PSRrvTime_atim;
 typedef const SRrvTime_atim *PCSRrvTime_atim;
 
 /*
- * RTS buffer header
- */
-typedef struct tagSRTS_g {
-    u8        bySignalField_b;
-    u8        byServiceField_b;
-    u16        wTransmitLength_b;
-    u8        bySignalField_a;
-    u8        byServiceField_a;
-    u16        wTransmitLength_a;
-    u16        wDuration_ba;
-    u16        wDuration_aa;
-    u16        wDuration_bb;
-    u16        wReserved;
-	struct ieee80211_rts data;
-} __attribute__ ((__packed__))
-SRTS_g, *PSRTS_g;
-typedef const SRTS_g *PCSRTS_g;
-
-typedef struct tagSRTS_g_FB {
-    u8        bySignalField_b;
-    u8        byServiceField_b;
-    u16        wTransmitLength_b;
-    u8        bySignalField_a;
-    u8        byServiceField_a;
-    u16        wTransmitLength_a;
-    u16        wDuration_ba;
-    u16        wDuration_aa;
-    u16        wDuration_bb;
-    u16        wReserved;
-    u16        wRTSDuration_ba_f0;
-    u16        wRTSDuration_aa_f0;
-    u16        wRTSDuration_ba_f1;
-    u16        wRTSDuration_aa_f1;
-	struct ieee80211_rts data;
-} __attribute__ ((__packed__))
-SRTS_g_FB, *PSRTS_g_FB;
-
-typedef const SRTS_g_FB *PCSRTS_g_FB;
-
-typedef struct tagSRTS_ab {
-    u8        bySignalField;
-    u8        byServiceField;
-    u16        wTransmitLength;
-    u16        wDuration;
-    u16        wReserved;
-	struct ieee80211_rts data;
-} __attribute__ ((__packed__))
-SRTS_ab, *PSRTS_ab;
-
-typedef const SRTS_ab *PCSRTS_ab;
-
-typedef struct tagSRTS_a_FB {
-    u8        bySignalField;
-    u8        byServiceField;
-    u16        wTransmitLength;
-    u16        wDuration;
-    u16        wReserved;
-    u16        wRTSDuration_f0;
-    u16        wRTSDuration_f1;
-	struct ieee80211_rts data;
-} __attribute__ ((__packed__))
-SRTS_a_FB, *PSRTS_a_FB;
-
-typedef const SRTS_a_FB *PCSRTS_a_FB;
-
-/*
  * CTS buffer header
  */
 typedef struct tagSCTS {
diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
index 7a4ebbc..e7ff845 100644
--- a/drivers/staging/vt6656/rxtx.c
+++ b/drivers/staging/vt6656/rxtx.c
@@ -629,7 +629,7 @@ static void s_vFillRTSHead(struct vnt_private *pDevice, u8 byPktType,
     //       Otherwise, we need to modified codes for them.
     if (byPktType == PK_TYPE_11GB || byPktType == PK_TYPE_11GA) {
         if (byFBOption == AUTO_FB_NONE) {
-            PSRTS_g pBuf = (PSRTS_g)pvRTS;
+		struct vnt_rts_g *pBuf = (struct vnt_rts_g *)pvRTS;
             //Get SignalField,ServiceField,Length
             BBvCalculateParameter(pDevice, uRTSFrameLen, pDevice->byTopCCKBasicRate, PK_TYPE_11B,
                 (u16 *)&(wLen), (u8 *)&(pBuf->byServiceField_b), (u8 *)&(pBuf->bySignalField_b)
@@ -665,7 +665,7 @@ static void s_vFillRTSHead(struct vnt_private *pDevice, u8 byPktType,
 			memcpy(pBuf->data.ta, psEthHeader->h_source, ETH_ALEN);
         }
         else {
-           PSRTS_g_FB pBuf = (PSRTS_g_FB)pvRTS;
+		struct vnt_rts_g_fb *pBuf = (struct vnt_rts_g_fb *)pvRTS;
             //Get SignalField,ServiceField,Length
             BBvCalculateParameter(pDevice, uRTSFrameLen, pDevice->byTopCCKBasicRate, PK_TYPE_11B,
                 (u16 *)&(wLen), (u8 *)&(pBuf->byServiceField_b), (u8 *)&(pBuf->bySignalField_b)
@@ -715,7 +715,7 @@ static void s_vFillRTSHead(struct vnt_private *pDevice, u8 byPktType,
     }
     else if (byPktType == PK_TYPE_11A) {
         if (byFBOption == AUTO_FB_NONE) {
-            PSRTS_ab pBuf = (PSRTS_ab)pvRTS;
+		struct vnt_rts_ab *pBuf = (struct vnt_rts_ab *)pvRTS;
             //Get SignalField,ServiceField,Length
             BBvCalculateParameter(pDevice, uRTSFrameLen, pDevice->byTopOFDMBasicRate, byPktType,
                 (u16 *)&(wLen), (u8 *)&(pBuf->byServiceField), (u8 *)&(pBuf->bySignalField)
@@ -741,7 +741,7 @@ static void s_vFillRTSHead(struct vnt_private *pDevice, u8 byPktType,
 			memcpy(pBuf->data.ta, psEthHeader->h_source, ETH_ALEN);
         }
         else {
-            PSRTS_a_FB pBuf = (PSRTS_a_FB)pvRTS;
+		struct vnt_rts_a_fb *pBuf = (struct vnt_rts_a_fb *)pvRTS;
             //Get SignalField,ServiceField,Length
             BBvCalculateParameter(pDevice, uRTSFrameLen, pDevice->byTopOFDMBasicRate, byPktType,
                 (u16 *)&(wLen), (u8 *)&(pBuf->byServiceField), (u8 *)&(pBuf->bySignalField)
@@ -774,7 +774,7 @@ static void s_vFillRTSHead(struct vnt_private *pDevice, u8 byPktType,
         }
     }
     else if (byPktType == PK_TYPE_11B) {
-        PSRTS_ab pBuf = (PSRTS_ab)pvRTS;
+	struct vnt_rts_ab *pBuf = (struct vnt_rts_ab *)pvRTS;
         //Get SignalField,ServiceField,Length
         BBvCalculateParameter(pDevice, uRTSFrameLen, pDevice->byTopCCKBasicRate, PK_TYPE_11B,
             (u16 *)&(wLen), (u8 *)&(pBuf->byServiceField), (u8 *)&(pBuf->bySignalField)
@@ -1151,10 +1151,15 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType,
             if (bRTS == true) {//RTS_need
                 pvRrvTime = (PSRrvTime_gRTS) (pbyTxBufferAddr + wTxBufSize);
                 pMICHDR = (PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_gRTS));
-                pvRTS = (PSRTS_g) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_gRTS) + cbMICHDR);
+		pvRTS = (struct vnt_rts_g *) (pbyTxBufferAddr + wTxBufSize +
+				sizeof(SRrvTime_gRTS) + cbMICHDR);
                 pvCTS = NULL;
-                pvTxDataHd = (PSTxDataHead_g) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_gRTS) + cbMICHDR + sizeof(SRTS_g));
-                cbHeaderLength = wTxBufSize + sizeof(SRrvTime_gRTS) + cbMICHDR + sizeof(SRTS_g) + sizeof(STxDataHead_g);
+		pvTxDataHd = (PSTxDataHead_g) (pbyTxBufferAddr + wTxBufSize +
+			sizeof(SRrvTime_gRTS) + cbMICHDR +
+						sizeof(struct vnt_rts_g));
+		cbHeaderLength = wTxBufSize + sizeof(SRrvTime_gRTS) +
+			cbMICHDR + sizeof(struct vnt_rts_g) +
+				sizeof(STxDataHead_g);
             }
             else { //RTS_needless
                 pvRrvTime = (PSRrvTime_gCTS) (pbyTxBufferAddr + wTxBufSize);
@@ -1169,10 +1174,14 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType,
             if (bRTS == true) {//RTS_need
                 pvRrvTime = (PSRrvTime_gRTS) (pbyTxBufferAddr + wTxBufSize);
                 pMICHDR = (PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_gRTS));
-                pvRTS = (PSRTS_g_FB) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_gRTS) + cbMICHDR);
+		pvRTS = (struct vnt_rts_g_fb *) (pbyTxBufferAddr + wTxBufSize +
+				sizeof(SRrvTime_gRTS) + cbMICHDR);
                 pvCTS = NULL;
-                pvTxDataHd = (PSTxDataHead_g_FB) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_gRTS) + cbMICHDR + sizeof(SRTS_g_FB));
-                cbHeaderLength = wTxBufSize + sizeof(SRrvTime_gRTS) + cbMICHDR + sizeof(SRTS_g_FB) + sizeof(STxDataHead_g_FB);
+		pvTxDataHd = (PSTxDataHead_g_FB) (pbyTxBufferAddr + wTxBufSize +
+			sizeof(SRrvTime_gRTS) + cbMICHDR +
+					sizeof(struct vnt_rts_g_fb));
+		cbHeaderLength = wTxBufSize + sizeof(SRrvTime_gRTS) + cbMICHDR +
+			sizeof(struct vnt_rts_g_fb) + sizeof(STxDataHead_g_FB);
             }
             else if (bRTS == false) { //RTS_needless
                 pvRrvTime = (PSRrvTime_gCTS) (pbyTxBufferAddr + wTxBufSize);
@@ -1189,10 +1198,14 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType,
             if (bRTS == true) {//RTS_need
                 pvRrvTime = (PSRrvTime_ab) (pbyTxBufferAddr + wTxBufSize);
                 pMICHDR = (PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_ab));
-                pvRTS = (PSRTS_ab) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_ab) + cbMICHDR);
+		pvRTS = (struct vnt_rts_ab *) (pbyTxBufferAddr + wTxBufSize +
+				sizeof(SRrvTime_ab) + cbMICHDR);
                 pvCTS = NULL;
-                pvTxDataHd = (PSTxDataHead_ab) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_ab) + cbMICHDR + sizeof(SRTS_ab));
-                cbHeaderLength = wTxBufSize + sizeof(PSRrvTime_ab) + cbMICHDR + sizeof(SRTS_ab) + sizeof(STxDataHead_ab);
+		pvTxDataHd = (PSTxDataHead_ab) (pbyTxBufferAddr + wTxBufSize +
+			sizeof(SRrvTime_ab) + cbMICHDR +
+						sizeof(struct vnt_rts_ab));
+		cbHeaderLength = wTxBufSize + sizeof(PSRrvTime_ab) + cbMICHDR +
+			sizeof(struct vnt_rts_ab) + sizeof(STxDataHead_ab);
             }
             else if (bRTS == false) { //RTS_needless, no MICHDR
                 pvRrvTime = (PSRrvTime_ab) (pbyTxBufferAddr + wTxBufSize);
@@ -1207,10 +1220,14 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType,
             if (bRTS == true) {//RTS_need
                 pvRrvTime = (PSRrvTime_ab) (pbyTxBufferAddr + wTxBufSize);
                 pMICHDR = (PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_ab));
-                pvRTS = (PSRTS_a_FB) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_ab) + cbMICHDR);
+		pvRTS = (struct vnt_rts_a_fb *) (pbyTxBufferAddr + wTxBufSize +
+				sizeof(SRrvTime_ab) + cbMICHDR);
                 pvCTS = NULL;
-                pvTxDataHd = (PSTxDataHead_a_FB) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_ab) + cbMICHDR + sizeof(SRTS_a_FB));
-                cbHeaderLength = wTxBufSize + sizeof(PSRrvTime_ab) + cbMICHDR + sizeof(SRTS_a_FB) + sizeof(STxDataHead_a_FB);
+		pvTxDataHd = (PSTxDataHead_a_FB) (pbyTxBufferAddr + wTxBufSize +
+			sizeof(SRrvTime_ab) + cbMICHDR +
+					sizeof(struct vnt_rts_a_fb));
+		cbHeaderLength = wTxBufSize + sizeof(PSRrvTime_ab) + cbMICHDR +
+			sizeof(struct vnt_rts_a_fb) + sizeof(STxDataHead_a_FB);
             }
             else if (bRTS == false) { //RTS_needless
                 pvRrvTime = (PSRrvTime_ab) (pbyTxBufferAddr + wTxBufSize);
diff --git a/drivers/staging/vt6656/rxtx.h b/drivers/staging/vt6656/rxtx.h
index 3e347a9..8ce5bfc 100644
--- a/drivers/staging/vt6656/rxtx.h
+++ b/drivers/staging/vt6656/rxtx.h
@@ -32,6 +32,59 @@
 #include "device.h"
 #include "wcmd.h"
 
+/* RTS buffer header */
+struct vnt_rts_g {
+	u8 bySignalField_b;
+	u8 byServiceField_b;
+	u16 wTransmitLength_b;
+	u8 bySignalField_a;
+	u8 byServiceField_a;
+	u16 wTransmitLength_a;
+	u16 wDuration_ba;
+	u16 wDuration_aa;
+	u16 wDuration_bb;
+	u16 wReserved;
+	struct ieee80211_rts data;
+} __packed;
+
+struct vnt_rts_g_fb {
+	u8 bySignalField_b;
+	u8 byServiceField_b;
+	u16 wTransmitLength_b;
+	u8 bySignalField_a;
+	u8 byServiceField_a;
+	u16 wTransmitLength_a;
+	u16 wDuration_ba;
+	u16 wDuration_aa;
+	u16 wDuration_bb;
+	u16 wReserved;
+	u16 wRTSDuration_ba_f0;
+	u16 wRTSDuration_aa_f0;
+	u16 wRTSDuration_ba_f1;
+	u16 wRTSDuration_aa_f1;
+	struct ieee80211_rts data;
+} __packed;
+
+struct vnt_rts_ab {
+	u8 bySignalField;
+	u8 byServiceField;
+	u16 wTransmitLength;
+	u16 wDuration;
+	u16 wReserved;
+	struct ieee80211_rts data;
+} __packed;
+
+struct vnt_rts_a_fb {
+	u8 bySignalField;
+	u8 byServiceField;
+	u16 wTransmitLength;
+	u16 wDuration;
+	u16 wReserved;
+	u16 wRTSDuration_f0;
+	u16 wRTSDuration_f1;
+	struct ieee80211_rts data;
+} __packed;
+
 struct vnt_tx_buffer {
 	u8 byType;
 	u8 byPKTNO;
-- 
1.8.1.2


^ permalink raw reply related

* [PATCH 2/2] staging: vt6656: desc.h Move typedef struct tagSCTS* to new structures in rxtx.h
From: Malcolm Priestley @ 2013-08-15 20:27 UTC (permalink / raw)
  To: gregkh; +Cc: linux-wireless

The new structures being
typedef struct tagSCTS -> struct vnt_cts
typedef struct tagSCTS_FB -> struct vnt_cts_fb

These are only needed by rxtc.c so moved to rxtx.h and
will eventually form part of the structure of
struct vnt_tx_buffer.

The linux/ieee80211.h in desc.h is no longer needed.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
---
 drivers/staging/vt6656/desc.h | 32 ------------------------------
 drivers/staging/vt6656/rxtx.c | 45 ++++++++++++++++++++++++++++---------------
 drivers/staging/vt6656/rxtx.h | 23 ++++++++++++++++++++++
 3 files changed, 53 insertions(+), 47 deletions(-)

diff --git a/drivers/staging/vt6656/desc.h b/drivers/staging/vt6656/desc.h
index 4e2eb18..d770a78 100644
--- a/drivers/staging/vt6656/desc.h
+++ b/drivers/staging/vt6656/desc.h
@@ -33,7 +33,6 @@
 
 #include <linux/types.h>
 #include <linux/mm.h>
-#include <linux/ieee80211.h>
 
 #include "tether.h"
 
@@ -186,37 +185,6 @@ SRrvTime_atim, *PSRrvTime_atim;
 typedef const SRrvTime_atim *PCSRrvTime_atim;
 
 /*
- * CTS buffer header
- */
-typedef struct tagSCTS {
-    u8        bySignalField_b;
-    u8        byServiceField_b;
-    u16        wTransmitLength_b;
-    u16        wDuration_ba;
-    u16        wReserved;
-	struct ieee80211_cts data;
-	u16 reserved2;
-} __attribute__ ((__packed__))
-SCTS, *PSCTS;
-
-typedef const SCTS *PCSCTS;
-
-typedef struct tagSCTS_FB {
-    u8        bySignalField_b;
-    u8        byServiceField_b;
-    u16        wTransmitLength_b;
-    u16        wDuration_ba;
-    u16        wReserved;
-    u16        wCTSDuration_ba_f0;
-    u16        wCTSDuration_ba_f1;
-	struct ieee80211_cts data;
-	u16 reserved2;
-} __attribute__ ((__packed__))
-SCTS_FB, *PSCTS_FB;
-
-typedef const SCTS_FB *PCSCTS_FB;
-
-/*
  * TX FIFO header
  */
 typedef struct tagSTxBufHead {
diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
index e7ff845..d9827b3 100644
--- a/drivers/staging/vt6656/rxtx.c
+++ b/drivers/staging/vt6656/rxtx.c
@@ -822,7 +822,7 @@ static void s_vFillCTSHead(struct vnt_private *pDevice, u32 uDMAIdx,
     if (byPktType == PK_TYPE_11GB || byPktType == PK_TYPE_11GA) {
         if (byFBOption != AUTO_FB_NONE && uDMAIdx != TYPE_ATIMDMA && uDMAIdx != TYPE_BEACONDMA) {
             // Auto Fall back
-            PSCTS_FB pBuf = (PSCTS_FB)pvCTS;
+		struct vnt_cts_fb *pBuf = (struct vnt_cts_fb *)pvCTS;
             //Get SignalField,ServiceField,Length
             BBvCalculateParameter(pDevice, uCTSFrameLen, pDevice->byTopCCKBasicRate, PK_TYPE_11B,
                 (u16 *)&(wLen), (u8 *)&(pBuf->byServiceField_b), (u8 *)&(pBuf->bySignalField_b)
@@ -844,7 +844,7 @@ static void s_vFillCTSHead(struct vnt_private *pDevice, u32 uDMAIdx,
 		pBuf->data.frame_control = TYPE_CTL_CTS;
 		memcpy(pBuf->data.ra, pDevice->abyCurrentNetAddr, ETH_ALEN);
         } else { //if (byFBOption != AUTO_FB_NONE && uDMAIdx != TYPE_ATIMDMA && uDMAIdx != TYPE_BEACONDMA)
-            PSCTS pBuf = (PSCTS)pvCTS;
+		struct vnt_cts *pBuf = (struct vnt_cts *)pvCTS;
             //Get SignalField,ServiceField,Length
             BBvCalculateParameter(pDevice, uCTSFrameLen, pDevice->byTopCCKBasicRate, PK_TYPE_11B,
                 (u16 *)&(wLen), (u8 *)&(pBuf->byServiceField_b), (u8 *)&(pBuf->bySignalField_b)
@@ -1165,9 +1165,13 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType,
                 pvRrvTime = (PSRrvTime_gCTS) (pbyTxBufferAddr + wTxBufSize);
                 pMICHDR = (PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_gCTS));
                 pvRTS = NULL;
-                pvCTS = (PSCTS) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_gCTS) + cbMICHDR);
-                pvTxDataHd = (PSTxDataHead_g) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_gCTS) + cbMICHDR + sizeof(SCTS));
-                cbHeaderLength = wTxBufSize + sizeof(SRrvTime_gCTS) + cbMICHDR + sizeof(SCTS) + sizeof(STxDataHead_g);
+		pvCTS = (struct vnt_cts *) (pbyTxBufferAddr + wTxBufSize +
+				sizeof(SRrvTime_gCTS) + cbMICHDR);
+		pvTxDataHd = (PSTxDataHead_g) (pbyTxBufferAddr + wTxBufSize +
+			sizeof(SRrvTime_gCTS) + cbMICHDR +
+						sizeof(struct vnt_cts));
+		cbHeaderLength = wTxBufSize + sizeof(SRrvTime_gCTS) + cbMICHDR +
+			sizeof(struct vnt_cts) + sizeof(STxDataHead_g);
             }
         } else {
             // Auto Fall Back
@@ -1187,9 +1191,14 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType,
                 pvRrvTime = (PSRrvTime_gCTS) (pbyTxBufferAddr + wTxBufSize);
                 pMICHDR = (PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_gCTS));
                 pvRTS = NULL;
-                pvCTS = (PSCTS_FB) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_gCTS) + cbMICHDR);
-                pvTxDataHd = (PSTxDataHead_g_FB) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_gCTS) + cbMICHDR + sizeof(SCTS_FB));
-                cbHeaderLength = wTxBufSize + sizeof(SRrvTime_gCTS) + cbMICHDR + sizeof(SCTS_FB) + sizeof(STxDataHead_g_FB);
+		pvCTS = (struct vnt_cts_fb *) (pbyTxBufferAddr + wTxBufSize +
+					sizeof(SRrvTime_gCTS) + cbMICHDR);
+		pvTxDataHd = (PSTxDataHead_g_FB) (pbyTxBufferAddr +
+			wTxBufSize + sizeof(SRrvTime_gCTS) + cbMICHDR +
+						sizeof(struct vnt_cts_fb));
+		cbHeaderLength = wTxBufSize + sizeof(SRrvTime_gCTS) +
+				cbMICHDR + sizeof(struct vnt_cts_fb) +
+					sizeof(STxDataHead_g_FB);
             }
         } // Auto Fall Back
     }
@@ -1508,7 +1517,7 @@ CMD_STATUS csMgmt_xmit(struct vnt_private *pDevice,
 	PSTxBufHead pTxBufHead;
 	PUSB_SEND_CONTEXT pContext;
 	struct ieee80211_hdr *pMACHeader;
-	PSCTS pCTS;
+	struct vnt_cts *pCTS;
 	struct ethhdr sEthHeader;
 	u8 byPktType, *pbyTxBufferAddr;
 	void *pvRTS, *pvTxDataHd, *pvRrvTime, *pMICHDR;
@@ -1647,9 +1656,12 @@ CMD_STATUS csMgmt_xmit(struct vnt_private *pDevice,
         pvRrvTime = (PSRrvTime_gCTS) (pbyTxBufferAddr + wTxBufSize);
         pMICHDR = NULL;
         pvRTS = NULL;
-        pCTS = (PSCTS) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_gCTS));
-        pvTxDataHd = (PSTxDataHead_g) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_gCTS) + sizeof(SCTS));
-        cbHeaderSize = wTxBufSize + sizeof(SRrvTime_gCTS) + sizeof(SCTS) + sizeof(STxDataHead_g);
+	pCTS = (struct vnt_cts *) (pbyTxBufferAddr + wTxBufSize +
+						sizeof(SRrvTime_gCTS));
+	pvTxDataHd = (PSTxDataHead_g) (pbyTxBufferAddr + wTxBufSize +
+		sizeof(SRrvTime_gCTS) + sizeof(struct vnt_cts));
+	cbHeaderSize = wTxBufSize + sizeof(SRrvTime_gCTS) +
+		sizeof(struct vnt_cts) + sizeof(STxDataHead_g);
     }
     else { // 802.11a/b packet
         pvRrvTime = (PSRrvTime_ab) (pbyTxBufferAddr + wTxBufSize);
@@ -2047,9 +2059,12 @@ void vDMA0_tx_80211(struct vnt_private *pDevice, struct sk_buff *skb)
         pvRrvTime = (PSRrvTime_gCTS) (pbyTxBufferAddr + wTxBufSize);
         pMICHDR = (PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_gCTS));
         pvRTS = NULL;
-        pvCTS = (PSCTS) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_gCTS) + cbMICHDR);
-        pvTxDataHd = (PSTxDataHead_g) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_gCTS) + cbMICHDR + sizeof(SCTS));
-        cbHeaderSize = wTxBufSize + sizeof(SRrvTime_gCTS) + cbMICHDR + sizeof(SCTS) + sizeof(STxDataHead_g);
+	pvCTS = (struct vnt_cts *) (pbyTxBufferAddr + wTxBufSize +
+			sizeof(SRrvTime_gCTS) + cbMICHDR);
+	pvTxDataHd = (PSTxDataHead_g) (pbyTxBufferAddr + wTxBufSize +
+		sizeof(SRrvTime_gCTS) + cbMICHDR + sizeof(struct vnt_cts));
+	cbHeaderSize = wTxBufSize + sizeof(SRrvTime_gCTS) + cbMICHDR +
+				sizeof(struct vnt_cts) + sizeof(STxDataHead_g);
 
     }
     else {//802.11a/b packet
diff --git a/drivers/staging/vt6656/rxtx.h b/drivers/staging/vt6656/rxtx.h
index 8ce5bfc..8fd5be1 100644
--- a/drivers/staging/vt6656/rxtx.h
+++ b/drivers/staging/vt6656/rxtx.h
@@ -85,6 +85,29 @@ struct vnt_rts_a_fb {
 	struct ieee80211_rts data;
 } __packed;
 
+/* CTS buffer header */
+struct vnt_cts {
+	u8 bySignalField_b;
+	u8 byServiceField_b;
+	u16 wTransmitLength_b;
+	u16 wDuration_ba;
+	u16 wReserved;
+	struct ieee80211_cts data;
+	u16 reserved2;
+} __packed;
+
+struct vnt_cts_fb {
+	u8 bySignalField_b;
+	u8 byServiceField_b;
+	u16 wTransmitLength_b;
+	u16 wDuration_ba;
+	u16 wReserved;
+	u16 wCTSDuration_ba_f0;
+	u16 wCTSDuration_ba_f1;
+	struct ieee80211_cts data;
+	u16 reserved2;
+} __packed;
+
 struct vnt_tx_buffer {
 	u8 byType;
 	u8 byPKTNO;
-- 
1.8.1.2





^ permalink raw reply related

* Re: Switching band of a dual-band WiFi device
From: Christian Gagneraud @ 2013-08-15 22:43 UTC (permalink / raw)
  To: Simon Farnsworth; +Cc: linux-wireless
In-Reply-To: <1483073.ZnhDhG6Z68@f17simon>

On 15/08/13 21:03, Simon Farnsworth wrote:
> On Thursday 15 August 2013 17:11:59 Christian Gagneraud wrote:
>> Hi there,
>>
>> I am using a TP-Link TL-WDN3200 on a ubuntu 13.04 (kernel
>> 3.8.0-27-generic), and I have install relevant modules with
>> backports-3.11-rc3-1.
>>
>> I would like to switch my WiFi stick to 5GHz, I tried iwconfig wlan0
>> freq 5G, but I get ENOTSUPP.
>> Is the freq settings suppose to handle this 2.4 vs 5GHz band or is it
>> only for selecting channel frequency within a given band?
>>
>> Does linux-wireless provides a way for selecting 2.4 or 5GHz band?
>
> Linux should automatically select the right frequency band, depending on
> the frequencies in use by the device you're trying to communicate with.
> Connect to an AP in the 5GHz band, and Linux should just use 5GHz
> automatically.
>>
>> "iw phy phy11 info" tells me that in band 2, all the frequencies are
>> disabled except:
>>                           * 5745 MHz [149] (30.0 dBm)
>>                           * 5755 MHz [151] (30.0 dBm)
>>                           * 5765 MHz [153] (30.0 dBm)
>>                           * 5775 MHz [155] (30.0 dBm)
>>                           * 5785 MHz [157] (30.0 dBm)
>>                           * 5795 MHz [159] (30.0 dBm)
>>                           * 5805 MHz [161] (30.0 dBm)
>>                           * 5825 MHz [165] (30.0 dBm)
>>
> That's showing you that, with Linux's understanding of the RF regulations in
> your area, it can only transmit on certain frequencies.

OK, that's the CRDA thing, I understand now! ;)

>
>> As well, my understanding of WiFi might be a bit limited but, does a
>> dual-band WiFi device provides 2.4 and 5GHz services at the same time or
>> do I need to select one or the other myself? Or maybe I can just
>> enable/disable them manually (and separately)?
>>
> A dual-band WiFi device can only transmit and receive on one channel at a
> time. The advantage of dual-band is that it can transmit and receive on either
> the 5GHz band (which is less crowded), or the 2.4GHz band (which is more
> commonly used). There's no need to select the band manually - it will just
> use 5GHz when the other device (e.g. the AP) is using 5GHz.
>

Thanks for your answers Simon, everything is working now.
I had to change the regulatory domain of the USB stick to NZ as it comes 
with CN (country of origin) and NZ/CN don't really overlap in the 5GHz band.

Regards,
Chris

^ permalink raw reply

* [TL-WN721N] No disconnect notification when AP is gone
From: Christian Gagneraud @ 2013-08-15 23:12 UTC (permalink / raw)
  To: linux-wireless

Hi there,

I'm using a TP-LINK TL-WN721N, and experience a strange behaviour, I'm 
running Ubuntu 13.04 (3.8.0-27-generic + backports-3.11-rc3-1).

The problem is that if I am connected to my AP and then power it off, I 
never receive a disconnect notification.

I first reported the bug to the connman mailing list [1], but it was 
suggested there that it could be a bug in the device driver.

At first I was using the Ubuntu kernel modules, but before reporting any 
bugs, I switched to backports-3.11-rc3-1, and I still have the problem.

Any thoughts?

Regards,
Chris

[1] Latest messages haven't been archived  yet, but:
  https://lists.connman.net/pipermail/connman/2013-August/015401.html

^ permalink raw reply

* Re: [PATCH 1/2] staging: vt6656: desc.h Remove typedef struct tagSRTS_* to new strutures in rxtx.h
From: Joe Perches @ 2013-08-16  1:21 UTC (permalink / raw)
  To: Malcolm Priestley; +Cc: gregkh, linux-wireless
In-Reply-To: <1376598205.8200.27.camel@canaries32-MCP7A>

On Thu, 2013-08-15 at 21:23 +0100, Malcolm Priestley wrote:
> The new structures being
> typedef struct tagSRTS_g -> struct vnt_rts_g
> typedef struct tagSRTS_g_FB -> struct vnt_rts_g_fb
> typedef struct tagSRTS_ab -> struct vnt_rts_ab
> typedef struct tagSRTS_a_FB -> struct vnt_rts_a_fb
> 
> These are only needed by rxtc.c so moved to rxtx.h and
> will eventually form part of the structure of
> struct vnt_tx_buffer.

It would be simpler to verify these changes
if you did not do any whitespace modifications
like changing line wrapping at the same time.



^ permalink raw reply

* Re: [PATCH] backports: rename some mem functions to not break custom kernels
From: Luis R. Rodriguez @ 2013-08-16  3:14 UTC (permalink / raw)
  To: Arik Nemtsov, backports; +Cc: linux-wireless, mcgrof
In-Reply-To: <1376466485-25796-1-git-send-email-arik@wizery.com>

On Wed, Aug 14, 2013 at 10:48:05AM +0300, Arik Nemtsov wrote:
> When custom patches are cherry-picked to a kernel, some symbols exported
> by backports may clash with the built-in ones. Rename the backports
> symbols using the standard backport_ prefix to prevent that.
> 
> The offending symbols were exported by the patch below:
> 
> commit 2ce5c22448bb45998318267c00b5d6ef9cff3170
> Author: Hauke Mehrtens <hauke@hauke-m.de>
> Date:   Thu Jun 6 13:48:04 2013 +0200
> 
>     backports: backport some memory functions
> 
> Signed-off-by: Arik Nemtsov <arik@wizery.com>

Thanks, applied and pushed. Next time please add
the backports@vger.kernel.org list.

  Luis

^ permalink raw reply

* Re: [TL-WN721N] No disconnect notification when AP is gone
From: Oleksij Rempel @ 2013-08-16  7:05 UTC (permalink / raw)
  To: Christian Gagneraud; +Cc: linux-wireless, ath9k-devel@lists.ath9k.org
In-Reply-To: <520D6058.7040405@gna.org>

Am 16.08.2013 01:12, schrieb Christian Gagneraud:
> Hi there,
>
> I'm using a TP-LINK TL-WN721N, and experience a strange behaviour, I'm
> running Ubuntu 13.04 (3.8.0-27-generic + backports-3.11-rc3-1).
>
> The problem is that if I am connected to my AP and then power it off, I
> never receive a disconnect notification.
>
> I first reported the bug to the connman mailing list [1], but it was
> suggested there that it could be a bug in the device driver.
>
> At first I was using the Ubuntu kernel modules, but before reporting any
> bugs, I switched to backports-3.11-rc3-1, and I still have the problem.
>
> Any thoughts?
>
> Regards,
> Chris
>
> [1] Latest messages haven't been archived  yet, but:
>   https://lists.connman.net/pipermail/connman/2013-August/015401.html

I assume it is Atheros ar9271 based adapter. Did you tried to use latest 
firmware?
https://github.com/qca/open-ath9k-htc-firmware

If you have some time, i'll suggest you to investigate this issue so far 
you can by your self.

-- 
Regards,
Oleksij

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox